(function(){let t=window.require("fs"),a=window.require("process"),o=a.platform,l=("win32"===o?a.env.APPDATA:"darwin"===o?a.env.HOME+"/Library/Preferences":process.env.HOME+"/.config")+"/BetterDiscord/",d="localStorage.json",u={};if(t.existsSync(`${l}${d}`))try{u=JSON.parse(t.readFileSync(`${l}${d}`))}catch(b){console.log(b)}else if(t.existsSync(d))try{u=JSON.parse(t.readFileSync(d))}catch(b){console.log(b)}var h=u;h.setItem=function(b,f){h[b]=f,this.save()},h.getItem=function(b){return h[b]||null},h.save=function(){t.writeFileSync(`${l}${d}`,JSON.stringify(this),null,4)};var g=new Proxy(h,{set:function(b,f,y){h[f]=y,h.save()},get:function(b,f){return h[f]||null}});window.localStorage=g})(),(()=>{let t=document.createElement("div");t.className="bd-loaderv2",t.title="BetterDiscord is loading...",document.body.appendChild(t)})();var betterDiscordIPC=require("electron").ipcRenderer;window.bdStorage={},window.bdStorage.get=function(t){return betterDiscordIPC.sendSync("synchronous-message",{arg:"storage",cmd:"get","var":t})},window.bdStorage.set=function(t,a){betterDiscordIPC.sendSync("synchronous-message",{arg:"storage",cmd:"set","var":t,data:a})},window.bdPluginStorage={},window.bdPluginStorage.get=function(t,a){return betterDiscordIPC.sendSync("synchronous-message",{arg:"pluginstorage",cmd:"get",pn:t,"var":a})},window.bdPluginStorage.set=function(t,a,o){betterDiscordIPC.sendSync("synchronous-message",{arg:"pluginstorage",cmd:"set",pn:t,"var":a,data:o})};var bdSettings={},bdSettingsStorage={},releaseChannel=DiscordNative.globals.releaseChannel;bdSettingsStorage.initialize=function(){let t=require("fs"),a={stable:{},canary:{},ptb:{}};if(t.existsSync(bdConfig.dataPath+"/bdsettings.json"))try{a=JSON.parse(t.readFileSync(bdConfig.dataPath+"/bdsettings.json")),a.hasOwnProperty("settings")&&(a={[releaseChannel]:a})}catch(o){a={stable:{},canary:{},ptb:{}}}bdSettings=a?a:{stable:{},canary:{},ptb:{}}},bdSettingsStorage.get=function(t){return bdSettings[releaseChannel][t]?bdSettings[releaseChannel][t]:null},bdSettingsStorage.set=function(t,a){let o=require("fs");bdSettings[releaseChannel][t]=a;try{return o.writeFileSync(bdConfig.dataPath+"/bdsettings.json",JSON.stringify(bdSettings,null,4)),!0}catch(l){return Utils.err(l),!1}};var settingsPanel,emoteModule,quickEmoteMenu,voiceMode,pluginModule,themeModule,dMode,publicServersModule,supportedVersion="0.2.81",bbdVersion="0.1.2",mainCore,settings={"Save logs locally":{id:"bda-gs-0",info:"Saves chat logs locally",implemented:!1,hidden:!1,cat:"core"},"Public Servers":{id:"bda-gs-1",info:"Display public servers button",implemented:!0,hidden:!1,cat:"core"},"Minimal Mode":{id:"bda-gs-2",info:"Hide elements and reduce the size of elements.",implemented:!0,hidden:!1,cat:"core"},"Voice Mode":{id:"bda-gs-4",info:"Only show voice chat",implemented:!0,hidden:!1,cat:"core"},"Hide Channels":{id:"bda-gs-3",info:"Hide channels in minimal mode",implemented:!0,hidden:!1,cat:"core"},"Dark Mode":{id:"bda-gs-5",info:"Make certain elements dark by default(wip)",implemented:!0,hidden:!1,cat:"core"},"Override Default Emotes":{id:"bda-es-5",info:"Override default emotes",implemented:!1,hidden:!1,cat:"core"},"Voice Disconnect":{id:"bda-dc-0",info:"Disconnect from voice server when closing Discord",implemented:!0,hidden:!1,cat:"core"},"Custom css live update":{id:"bda-css-0",info:"",implemented:!0,hidden:!0,cat:"core"},"Custom css auto udpate":{id:"bda-css-1",info:"",implemented:!0,hidden:!0,cat:"core"},"24 Hour Timestamps":{id:"bda-gs-6",info:"Replace 12hr timestamps with proper ones",implemented:!0,hidden:!1,cat:"core"},"Coloured Text":{id:"bda-gs-7",info:"Make text colour the same as role colour",implemented:!0,hidden:!1,cat:"core"},"BetterDiscord Blue":{id:"bda-gs-b",info:"Replace Discord blue with BD Blue",implemented:!0,hidden:!1,cat:"core"},"Developer Mode":{id:"bda-gs-8",info:"Developer Mode",implemented:!0,hidden:!1,cat:"core"},"Startup Error Modal":{id:"fork-ps-1",info:"Show a modal with plugin/theme errors on startup",implemented:!0,hidden:!1,cat:"fork"},"Show Toasts":{id:"fork-ps-2",info:"Shows a small notification for starting and stopping plugins & themes",implemented:!0,hidden:!1,cat:"fork"},"Scroll To Settings":{id:"fork-ps-3",info:"Auto-scrolls to a plugin's settings when the button is clicked (only if out of view)",implemented:!0,hidden:!1,cat:"fork"},"Animate On Hover":{id:"fork-es-2",info:"Only animate the emote modifiers on hover",implemented:!0,hidden:!1,cat:"fork"},"Copy Selector":{id:"fork-dm-1",info:"Adds a \"Copy Selector\" option to context menus when developer mode is active",implemented:!0,hidden:!1,cat:"fork"},"Download Emotes":{id:"fork-es-3",info:"Download emotes when the cache is expired",implemented:!0,hidden:!1,cat:"fork"},"Normalize Classes":{id:"fork-ps-4",info:"Adds stable classes to elements to help themes. (e.g. adds .da-channels to .channels-Ie2l6A)",implemented:!0,hidden:!1,cat:"fork"},"Twitch Emotes":{id:"bda-es-7",info:"Show Twitch emotes",implemented:!0,hidden:!1,cat:"emote"},"FrankerFaceZ Emotes":{id:"bda-es-1",info:"Show FrankerFaceZ Emotes",implemented:!0,hidden:!1,cat:"emote"},"BetterTTV Emotes":{id:"bda-es-2",info:"Show BetterTTV Emotes",implemented:!0,hidden:!1,cat:"emote"},"Emote Menu":{id:"bda-es-0",info:"Show Twitch/Favourite emotes in emote menu",implemented:!0,hidden:!1,cat:"emote"},"Emoji Menu":{id:"bda-es-9",info:"Show Discord emoji menu",implemented:!0,hidden:!1,cat:"emote"},"Emote Autocomplete":{id:"bda-es-3",info:"Autocomplete emote commands",implemented:!1,hidden:!1,cat:"emote"},"Emote Auto Capitalization":{id:"bda-es-4",info:"Autocapitalize emote commands",implemented:!0,hidden:!1,cat:"emote"},"Show Names":{id:"bda-es-6",info:"Show emote names on hover",implemented:!0,hidden:!1,cat:"emote"},"Show emote modifiers":{id:"bda-es-8",info:"Enable emote mods (flip, spin, pulse, spin2, spin3, 1spin, 2spin, 3spin, tr, bl, br, shake, shake2, shake3, flap)",implemented:!0,hidden:!1,cat:"emote"}},defaultCookie={"bda-gs-0":!1,"bda-gs-1":!0,"bda-gs-2":!1,"bda-gs-3":!1,"bda-gs-4":!1,"bda-gs-5":!0,"bda-gs-6":!1,"bda-gs-7":!1,"bda-gs-8":!1,"bda-es-0":!0,"bda-es-1":!0,"bda-es-2":!0,"bda-es-3":!1,"bda-es-4":!1,"bda-es-5":!0,"bda-es-6":!0,"bda-es-7":!0,"bda-gs-b":!1,"bda-es-8":!0,"bda-jd":!0,"bda-dc-0":!1,"bda-css-0":!1,"bda-css-1":!1,"bda-es-9":!0,"fork-dm-1":!1,"fork-ps-1":!0,"fork-ps-2":!0,"fork-ps-3":!0,"fork-ps-4":!0,"fork-es-2":!1,"fork-es-3":!0},settingsCookie={},bdpluginErrors,bdthemeErrors,bdConfig=null;function Core(t){window.bdConfig=t}var classNormalizer;Core.prototype.init=async function(){return bdConfig.version
Please download the latest version from BetterDiscord.net"):void(bdConfig.updater.LatestVersion>bdConfig.version&&this.alert("Update Available",` An update for BandagedBD is available (${bdConfig.updater.LatestVersion})! Please Reinstall!

Download Installer `),Utils.log("Initializing Settings"),this.initSettings(),classNormalizer=new ClassNormalizer,emoteModule=new EmoteModule,quickEmoteMenu=new QuickEmoteMenu,Utils.log("Initializing EmoteModule"),window.emotePromise=emoteModule.init().then(()=>{emoteModule.initialized=!0,Utils.log("Initializing QuickEmoteMenu"),quickEmoteMenu.init()}),publicServersModule=new V2_PublicServers,voiceMode=new VoiceMode,dMode=new devMode,this.injectExternals(),await this.checkForGuilds(),Utils.log("Updating Settings"),settingsPanel=new V2_SettingsPanel,settingsPanel.updateSettings(),!bdpluginErrors&&(bdpluginErrors=[]),!bdthemeErrors&&(bdthemeErrors=[]),Utils.log("Loading Plugins"),pluginModule=new PluginModule,pluginModule.loadPlugins(),Utils.log("Loading Themes"),themeModule=new ThemeModule,themeModule.loadThemes(),$("#customcss").detach().appendTo(document.head),window.addEventListener("beforeunload",function(){settingsCookie["bda-dc-0"]&&document.querySelector(".btn.btn-disconnect").click()}),publicServersModule.initialize(),emoteModule.autoCapitalize(),Utils.log("Removing Loading Icon"),document.getElementsByClassName("bd-loaderv2")[0].remove(),Utils.log("Initializing Main Observer"),this.initObserver(),settingsCookie["fork-ps-1"]&&(Utils.log("Collecting Startup Errors"),this.showStartupErrors()))},Core.prototype.checkForGuilds=function(){return new Promise(t=>{const a=function(){return 0").html(atob(window.bdStorage.get("bdcustomcss"))).appendTo(document.head),defaultCookie)void 0==settingsCookie[t]&&(settingsCookie[t]=defaultCookie[t],this.saveSettings())},Core.prototype.saveSettings=function(){bdSettingsStorage.set("settings",settingsCookie)},Core.prototype.loadSettings=function(){settingsCookie=bdSettingsStorage.get("settings")},Core.prototype.initObserver=function(){const t=new MutationObserver(a=>{for(let d,o=0,l=a.length;o{if(settingsCookie["bda-gs-6"]){const o=a.returnValue.match(t);return o&&4===o.length?"AM"===o[3]?a.returnValue=a.returnValue.replace(o[0],`${"12"===o[1]?"00":o[1].padStart(2,"0")}:${o[2]}`):a.returnValue=a.returnValue.replace(o[0],`${parseInt(o[1])+12}:${o[2]}`):void 0}}})}},Core.prototype.injectColoredText=function(){this.cancelColoredText||(this.cancelColoredText=Utils.monkeyPatch(BDV2.MessageContentComponent.prototype,"render",{after:t=>{settingsCookie["bda-gs-7"]&&Utils.monkeyPatch(t.returnValue.props,"children",{silent:!0,after:({returnValue:a})=>{const o=a.props.children[1],l=t.thisObject.props.message.colorString;return o&&l&&(o.props.style={color:l}),a}})}}))},Core.prototype.removeColoredText=function(){document.querySelectorAll(".markup-2BOw-j").forEach(t=>{t.style.setProperty("color","")})},Core.prototype.alert=function(t,a){let o=$(`
`);o.find(".footer button").on("click",()=>{o.addClass("closing"),setTimeout(()=>{o.remove()},300)}),o.find(".bd-backdrop").on("click",()=>{o.addClass("closing"),setTimeout(()=>{o.remove()},300)}),o.appendTo("#app-mount")},Core.prototype.showStartupErrors=function(){function t(l){let d=$(`
`);for(let u of l){let h=$(`
${u.name?u.name:u.file}
${u.reason}
`);d.append(h),u.error&&h.find("a").on("click",g=>{g.preventDefault(),Utils.err(`Error details for ${u.name?u.name:u.file}.`,u.error)})}return d}if(bdpluginErrors&&bdthemeErrors&&(bdpluginErrors.length||bdthemeErrors.length)){let a=$(`
`),o=[t(bdpluginErrors),t(bdthemeErrors)];a.find(".tab-bar-item").on("click",l=>{l.preventDefault(),a.find(".tab-bar-item").removeClass("selected"),$(l.target).addClass("selected"),a.find(".scroller").empty().append(o[$(l.target).index()])}),a.find(".footer button").on("click",()=>{a.addClass("closing"),setTimeout(()=>{a.remove()},300)}),a.find(".bd-backdrop").on("click",()=>{a.addClass("closing"),setTimeout(()=>{a.remove()},300)}),a.appendTo("#app-mount"),a.find(".tab-bar-item")[0].click()}},Core.prototype.showToast=function(t,a={}){if(bdConfig.deferLoaded){if(!document.querySelector(".bd-toasts")){let h=document.createElement("div");h.classList.add("bd-toasts");let g=document.querySelector(".chat-3bRxxu form, #friends, .noChannel-Z1DQK7, .activityFeed-28jde9");h.style.setProperty("left",g?g.getBoundingClientRect().left+"px":"0px"),h.style.setProperty("width",g?g.offsetWidth+"px":"100%"),h.style.setProperty("bottom",(document.querySelector(".chat-3bRxxu form")?document.querySelector(".chat-3bRxxu form").offsetHeight:80)+"px"),document.querySelector(".app").appendChild(h)}const{type:o="",icon:l=!0,timeout:d=3e3}=a;let u=document.createElement("div");u.classList.add("bd-toast"),o&&u.classList.add("toast-"+o),o&&l&&u.classList.add("icon"),u.innerText=t,document.querySelector(".bd-toasts").appendChild(u),setTimeout(()=>{u.classList.add("closing"),setTimeout(()=>{u.remove(),document.querySelectorAll(".bd-toasts .bd-toast").length||document.querySelector(".bd-toasts").remove()},300)},d)}},window.emotesFfz={},window.emotesBTTV={},window.emotesBTTV2={},window.emotesTwitch={},window.subEmotesTwitch={},window.bdEmotes={TwitchGlobal:{},TwitchSubscriber:{},BTTV:{},FrankerFaceZ:{},BTTV2:{}},window.bdEmoteSettingIDs={TwitchGlobal:"bda-es-7",TwitchSubscriber:"bda-es-7",BTTV:"bda-es-2",FrankerFaceZ:"bda-es-1",BTTV2:"bda-es-2"};function EmoteModule(){}EmoteModule.prototype.init=async function(){this.modifiers=["flip","spin","pulse","spin2","spin3","1spin","2spin","3spin","tr","bl","br","shake","shake2","shake3","flap"],this.overrides=["twitch","bttv","ffz"],this.categories=["TwitchGlobal","TwitchSubscriber","BTTV","BTTV2","FrankerFaceZ"];let t={TwitchGlobal:{url:"https://twitchemotes.com/api_cache/v3/global.json",backup:"https://cdn.staticaly.com/gh/rauenzi/BetterDiscordApp/master/data/emotedata_twitch_global.json",variable:"TwitchGlobal",oldVariable:"emotesTwitch",getEmoteURL:a=>`https://static-cdn.jtvnw.net/emoticons/v1/${a.id}/1.0`,getOldData:(a,o)=>{return{id:a.match(/\/([0-9]+)\//)[1],code:o,emoticon_set:0,description:null}}},TwitchSubscriber:{url:"https://twitchemotes.com/api_cache/v3/subscriber.json",backup:"https://cdn.staticaly.com/gh/rauenzi/BetterDiscordApp/master/data/emotedata_twitch_subscriber.json",variable:"TwitchSubscriber",oldVariable:"subEmotesTwitch",parser:a=>{let o={};for(let l in a){let d=a[l];for(let g,u=0,h=d.emotes.length;u{return a},getEmoteURL:a=>`https://static-cdn.jtvnw.net/emoticons/v1/${a}/1.0`,getOldData:a=>a.match(/\/([0-9]+)\//)[1]},FrankerFaceZ:{url:"https://cdn.staticaly.com/gh/rauenzi/BetterDiscordApp/master/data/emotedata_ffz.json",variable:"FrankerFaceZ",oldVariable:"emotesFfz",getEmoteURL:a=>`https://cdn.frankerfacez.com/emoticon/${a}/1`,getOldData:a=>a.match(/\/([0-9]+)\//)[1]},BTTV:{url:"https://api.betterttv.net/emotes",variable:"BTTV",oldVariable:"emotesBTTV",parser:a=>{let o={};for(let u,l=0,d=a.emotes.length;l`${a}`,getOldData:a=>a},BTTV2:{url:"https://cdn.staticaly.com/gh/rauenzi/BetterDiscordApp/master/data/emotedata_bttv.json",variable:"BTTV2",oldVariable:"emotesBTTV2",getEmoteURL:a=>`https://cdn.betterttv.net/emote/${a}/1x`,getOldData:a=>a.match(/emote\/(.+)\//)[1]}};for(await this.getBlacklist(),await this.loadEmoteData(t);!BDV2.MessageContentComponent;)await new Promise(a=>setTimeout(a,100));this.cancelEmoteRender||(this.cancelEmoteRender=Utils.monkeyPatch(BDV2.MessageContentComponent.prototype,"render",{after:({returnValue:a})=>{Utils.monkeyPatch(a.props,"children",{silent:!0,after:({returnValue:o})=>{const l=o.props.children[1];if(l.props.children){const d=l.props.children[1];if(d&&d.length){for(let h=0;hV.length)){this.modifiers.includes(z)&&settingsCookie["bda-es-8"]||(z=""),this.overrides.includes(U)?z=U:U="";let W=this.categories[O];if("twitch"===U?window.bdEmotes.TwitchGlobal[V]?W="TwitchGlobal":window.bdEmotes.TwitchSubscriber[V]&&(W="TwitchSubscriber"):"bttv"===U?window.bdEmotes.BTTV[V]?W="BTTV":window.bdEmotes.BTTV2[V]&&(W="BTTV2"):"ffz"==U&&window.bdEmotes.FrankerFaceZ[V]&&(W="FrankerFaceZ"),window.bdEmotes[W][V]&&settingsCookie[window.bdEmoteSettingIDs[W]]){const H=d[h].match(new RegExp(`([\\s]|^)${Utils.escape(z?V+":"+z:V)}([\\s]|$)`));if(H){const Z=d[h].substring(0,H.index+H[1].length),J=d[h].substring(H.index+H[0].length-H[2].length);d[h]=Z;const K=BDV2.react.createElement(BDEmote,{name:V,url:window.bdEmotes[W][V],modifier:z});d.splice(h+1,0,J),d.splice(h+1,0,K)}}}}}}const u=d.every(h=>{return"string"==typeof h&&""==h.replace(/\s*/,"")||h.type&&"BDEmote"==h.type.name||h.props&&h.props.children&&h.props.children.props&&h.props.children.props.emojiName});if(u)for(let h of d)"object"==typeof h&&("BDEmote"==h.type.name?h.props.jumboable=!0:h.props&&h.props.children&&h.props.children.props&&h.props.children.props.emojiName&&(h.props.children.props.jumboable=!0))}}}})}}))},EmoteModule.prototype.clearEmoteData=async function(){let t=require("fs"),o=bdConfig.dataPath+"emote_data.json",l=t.existsSync(o);l&&t.unlinkSync(o),window.bdStorage.set("emoteCacheDate",new Date().toJSON()),window.bdEmotes={TwitchGlobal:{},TwitchSubscriber:{},BTTV:{},FrankerFaceZ:{},BTTV2:{}}},EmoteModule.prototype.goBack=async function(t){for(let a in t)for(let o in window.bdEmotes[t[a].variable])window[t[a].oldVariable][o]=t[a].getOldData(window.bdEmotes[t[a].variable][o],o)},EmoteModule.prototype.isCacheValid=function(){const t=new Date(window.bdStorage.get("emoteCacheDate")||null),a=new Date,o=Math.round(Math.abs((a.getTime()-t.getTime())/86400000));return!(o>bdConfig.cache.days)||(window.bdStorage.set("emoteCacheDate",a.toJSON()),!1)},EmoteModule.prototype.loadEmoteData=async function(t){const a=require("fs"),l=bdConfig.dataPath+"emote_data.json",d=a.existsSync(l);if(d&&this.isCacheValid()){settingsCookie["fork-ps-2"]&&mainCore.showToast("Loading emotes from cache.",{type:"info"}),Utils.log("[Emotes] Loading emotes from local cache.");const u=await new Promise(g=>{a.readFile(l,"utf8",(b,f)=>{Utils.log("[Emotes] Emotes loaded from cache."),b&&(f={}),g(f)})});let h=Utils.testJSON(u);for(const g in h&&(window.bdEmotes=JSON.parse(u)),t)h=0setTimeout(g,1e3));let h=await this.downloadEmotes(t[u]);window.bdEmotes[t[u].variable]=h}settingsCookie["fork-ps-2"]&&mainCore.showToast("All emotes successfully downloaded.",{type:"success"});try{a.writeFileSync(l,JSON.stringify(window.bdEmotes),"utf8")}catch(u){Utils.err("[Emotes] Could not save emote data.",u)}quickEmoteMenu.init()},EmoteModule.prototype.downloadEmotes=function(t){let a=require("request"),o={url:t.url,timeout:t.timeout?t.timeout:5e3};return Utils.log("[Emotes] Downloading: "+t.variable),new Promise((l,d)=>{a(o,(u,h,g)=>{if(u)return Utils.err("[Emotes] Could not download "+t.variable,u),t.backup?(t.url=t.backup,t.backup=null,t.backupParser&&(t.parser=t.backupParser),l(this.downloadEmotes(t))):d({});let b={};try{b=JSON.parse(g)}catch(f){return Utils.err("[Emotes] Could not download "+t.variable,u),t.backup?(t.url=t.backup,t.backup=null,t.backupParser&&(t.parser=t.backupParser),l(this.downloadEmotes(t))):d({})}for(let f in"function"==typeof t.parser&&(b=t.parser(b)),b)b[f]=t.getEmoteURL(b[f]);l(b),Utils.log("[Emotes] Downloaded: "+t.variable)})})},EmoteModule.prototype.getBlacklist=function(){return new Promise(t=>{$.getJSON("https://cdn.staticaly.com/gh/rauenzi/BetterDiscordApp/master/data/emotefilter.json",function(a){t(bemotes=a.blacklist)})})};var bemotes=[];EmoteModule.prototype.autoCapitalize=function(){$("body").delegate($(".channelTextArea-1LDbYG textarea:first"),"keyup change paste",()=>{if(settingsCookie["bda-es-4"]){var t=$(".channelTextArea-1LDbYG textarea:first").val();if(void 0!=t){var a=t.split(" ").pop();if(3",a+=" ",a+=" ",a+="
",this.qmeHeader=a;var o="";o+="
",o+="
",o+="
",o+="
";var l="";for(let u in window.bdEmotes.TwitchGlobal)window.bdEmotes.TwitchGlobal.hasOwnProperty(u)&&(l=window.bdEmotes.TwitchGlobal[u],o+="
",o+=" \"\"",o+=" ",o+="
");o+="
",o+="
",o+="
",o+="
",this.teContainer=o;var d="";for(let u in d+="
",d+="
",d+="
",d+="
",this.favoriteEmotes)l=this.favoriteEmotes[u],d+="
",d+=" \"\"",d+=" ",d+="
";d+="
",d+="
",d+="
",d+="
",this.faContainer=d},QuickEmoteMenu.prototype.favContext=function(t,a){t.stopPropagation();var o=$("
",{id:"rmenu","data-emoteid":$(a).prop("title"),text:"Remove","class":"context-menu theme-dark"});return o.css({top:t.pageY-$("#bda-qem-favourite-container").offset().top,left:t.pageX-$("#bda-qem-favourite-container").offset().left}),$(a).parent().append(o),o.on("click",function(l){return l.preventDefault(),l.stopPropagation(),$(this).remove(),delete quickEmoteMenu.favoriteEmotes[$(this).data("emoteid")],quickEmoteMenu.updateFavorites(),!1}),!1},QuickEmoteMenu.prototype.switchHandler=function(t){this.switchQem($(t).attr("id"))},QuickEmoteMenu.prototype.switchQem=function(t){var a=$("#bda-qem-twitch"),o=$("#bda-qem-favourite"),l=$("#bda-qem-emojis");a.removeClass("active"),o.removeClass("active"),l.removeClass("active"),$(".emojiPicker-3m1S-j").hide(),$("#bda-qem-favourite-container").hide(),$("#bda-qem-twitch-container").hide();"bda-qem-twitch"===t?(a.addClass("active"),$("#bda-qem-twitch-container").show()):"bda-qem-favourite"===t?(o.addClass("active"),$("#bda-qem-favourite-container").show()):"bda-qem-emojis"===t?(l.addClass("active"),$(".emojiPicker-3m1S-j").show(),$(".emojiPicker-3m1S-j .search-bar-inner input, .emojiPicker-3m1S-j .search-bar-inner input").focus()):void 0;this.lastTab=t;var d=$(".emote-icon");d.off(),d.on("click",function(){var u=$(this).attr("title"),h=Utils.getTextArea();Utils.insertText(h[0]," "==h.val().slice(-1)?h.val()+u:h.val()+" "+u)})},QuickEmoteMenu.prototype.obsCallback=function(t){var a=$(t);settingsCookie["bda-es-9"]?a.removeClass("bda-qme-hidden"):a.addClass("bda-qme-hidden");settingsCookie["bda-es-0"]&&(a.prepend(this.qmeHeader),a.append(this.teContainer),a.append(this.faContainer),this.lastTab==void 0&&(this.lastTab="bda-qem-favourite"),this.switchQem(this.lastTab))},QuickEmoteMenu.prototype.favorite=function(t,a){this.favoriteEmotes.hasOwnProperty(t)||(this.favoriteEmotes[t]=a),this.updateFavorites()},QuickEmoteMenu.prototype.updateFavorites=function(){var t="";for(var a in t+="
",t+="
",t+="
",t+="
",this.favoriteEmotes){var o=this.favoriteEmotes[a];t+="
",t+=" \"\"",t+=" ",t+="
"}t+="
",t+="
",t+="
",t+="
",this.faContainer=t,$("#bda-qem-favourite-container").replaceWith(t),window.bdStorage.set("bdfavemotes",btoa(JSON.stringify(this.favoriteEmotes)))};var Utils=class t{static getTextArea(){return $(".channelTextArea-1LDbYG textarea")}static insertText(a,o){a.focus(),a.selectionStart=0,a.selectionEnd=a.value.length,document.execCommand("insertText",!1,o)}static jqDefer(a){window.jQuery?a():setTimeout(function(){this.jqDefer(a)},100)}static injectCss(a){$("",{type:"text/css",rel:"stylesheet",href:a}).appendTo($("head"))}static injectJs(a){$("