function Core(){}function EmoteModule(){}function PublicServers(){}function QuickEmoteMenu(){}function CustomCssEditor(){}function SettingsPanel(){utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.9.0/codemirror.min.js"),utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.9.0/mode/css/css.min.js"),utils.injectJs("https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.4.2/Sortable.min.js")}function Utils(){}function VoiceMode(){}function PluginModule(){}function ThemeModule(){}function BdWSocket(){bdws=this}function BdApi(){}function devMode(){}var settingsPanel,emoteModule,utils,quickEmoteMenu,opublicServers,voiceMode,pluginModule,themeModule,customCssEditor,dMode,jsVersion=1.73,supportedVersion="0.2.5",mainObserver,twitchEmoteUrlStart="https://static-cdn.jtvnw.net/emoticons/v1/",twitchEmoteUrlEnd="/1.0",ffzEmoteUrlStart="https://cdn.frankerfacez.com/emoticon/",ffzEmoteUrlEnd="/1",bttvEmoteUrlStart="https://cdn.betterttv.net/emote/",bttvEmoteUrlEnd="/1x",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"},"Developer Mode":{id:"bda-gs-8",info:"Developer Mode",implemented:!0,hidden:!1,cat:"core"},"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",implemented:!0,hidden:!1,cat:"emote"}},links={"Jiiks.net":{text:"Jiiks.net",href:"thtp://jiiks.net",target:"_blank"},twitter:{text:"Twitter",href:"http://twitter.com/jiiksi",target:"_blank"},github:{text:"Github",href:"http://github.com/jiiks",target:"_blank"}},defaultCookie={version:jsVersion,"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-es-8":!0,"bda-jd":!0,"bda-es-8":!0,"bda-dc-0":!1,"bda-css-0":!1,"bda-css-1":!1,"bda-es-9":!0},bdchangelog={changes:{"0a":{title:"1.73 : Native sub emotes",text:"Native sub emote support disabled for now due to a critical bug",img:""},"1a":{title:"1.73 : Initial Developer Mode",text:"Enable developer mode from settings!",img:""},a:{title:"v1.72 : Public Servers",text:"Public servers now have categories, description, tags, dark mode and more!",img:""},b:{title:"v1.72 : Import/Export",text:"Import/Export buttons now disappear in themes/plugins tabs to avoid confusion",img:""},c:{title:"v1.72 : Changelog",text:"You can now reopen this changelog from the settings",img:""},d:{title:"v1.71 : Hide Twitch emotes",text:"Hide all emotes option now toggles Twitch emotes instead!",img:""},e:{title:"v1.71 : Override FFZ emote",text:'Use the :bttv emote modifier to override a FFZ emote with a BTTV one!',img:""},f:{title:"v1.70 : 0.2.8 Support",text:"Added support for Core version 0.2.8.",img:""},g:{title:"v1.70 : Setting Import/Export",text:"You can now import and export your settings!",img:""},h:{title:"v1.70 : Public Server List Infinite Scroll",text:"Public server list now has the ability to load more than 20 servers.",img:""},i:{title:"v1.70 : 24 hour timestamps",text:"Replace 12 hour timestamp with 24 hour timestamps!",img:""},j:{title:"v1.70 : Coloured text",text:"Make text colour the same as role colour!",img:""}},fixes:{a:{title:"v1.72 : Settings panel",text:"Settings panel will now show no matter how you open it!",img:""},b:{title:"v1.72 : Fixed emote edit bug",text:"Edits now appear properly even with emotes!",img:""},c:{title:"v1.72 : Public servers",text:"Public servers button is visible again!",img:""},d:{title:"v1.72 : Public servers",text:"Updated public servers api endpoint url for fetching correct serverlist.",img:""},e:{title:"v1.71 : Fixed emotes and edit",text:"Emotes work again! So does editing emotes!",img:""},f:{title:"Spoilers are currently broken :(",text:"Ps. I know this in the fixes section :o",img:""}}},settingsCookie={};Core.prototype.init=function(){function a(){if(console.log((new Date).getTime()+" Defer"),$(".guilds-wrapper .guilds").children().length>0){console.log((new Date).getTime()+" Defer Loaded");var c=($(".guilds>li:first-child"),$("
';if(null!=bdchangelog.changes){a+='

New Stuff

"}if(null!=bdchangelog.fixes){a+='

Fixed

"}if(null!=bdchangelog.upcoming){a+='

Coming Soon

"}return a+='
'},Core.prototype.alert=function(a,b){for(var c="",d=0;5>d;d++)c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random()*"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".length));var e=' ';$("body").append(e),utils.addBackdrop(c)};var emotesFfz={},emotesBTTV={},emotesTwitch={emotes:{emote:{image_id:0}}},subEmotesTwitch={};EmoteModule.prototype.init=function(){},EmoteModule.prototype.getBlacklist=function(){$.getJSON("https://cdn.rawgit.com/Jiiks/betterDiscordApp/"+_hash+"/data/emotefilter.json",function(a){bemotes=a.blacklist})},EmoteModule.prototype.obsCallback=function(a){for(var b=this,c=0;c-1&&(e=e.replace("[!s]",""),d.data("spoilered",!1),d.addClass("spoiler"));var k=["flip","spin","pulse","spin2","spin3","1spin","2spin","3spin","tr","bl","br","shake","shake2","shake3","flap"],l="",m=!1,n=e;if(e.indexOf(":")>-1){var o=e.split(":");""!=o[0]&&""!=o[1]&&(k.indexOf(o[1])>-1&&(n=o[0],l=settingsCookie["bda-es-8"]?"emote"+o[1]:""),"bttv"==o[1]&&(n=o[0],m=!0))}if(-1==$.inArray(n,bemotes)){if("undefind"!=typeof emotesTwitch&&settingsCookie["bda-es-7"]&&emotesTwitch.emotes.hasOwnProperty(n)&&n.length>=4){null!=i&&(a.splice(b+g++,0,document.createTextNode(i)),i=null);var p=twitchEmoteUrlStart+emotesTwitch.emotes[n].image_id+twitchEmoteUrlEnd;return a.splice(b+g++,0,c.createEmoteElement(n,p,l)),void(h=!0)}if("undefined"!=typeof subEmotesTwitch&&settingsCookie["bda-es-7"]&&subEmotesTwitch.hasOwnProperty(n)&&n.length>=4){null!=i&&(a.splice(b+g++,0,document.createTextNode(i)),i=null);var p=twitchEmoteUrlStart+subEmotesTwitch[n]+twitchEmoteUrlEnd;return a.splice(b+g++,0,c.createEmoteElement(n,p,l)),void(h=!0)}if("undefined"!=typeof emotesBTTV&&settingsCookie["bda-es-2"]&&emotesBTTV.hasOwnProperty(n)&&n.length>=4){null!=i&&(a.splice(b+g++,0,document.createTextNode(i)),i=null);var p=emotesBTTV[n];return a.splice(b+g++,0,c.createEmoteElement(n,p,l)),void(h=!0)}if("undefined"!=typeof emotesFfz&&settingsCookie["bda-es-1"]&&(!m||!emotesBTTV2.hasOwnProperty(n))&&emotesFfz.hasOwnProperty(n)&&n.length>=4){null!=i&&(a.splice(b+g++,0,document.createTextNode(i)),i=null);var p=ffzEmoteUrlStart+emotesFfz[n]+ffzEmoteUrlEnd;return a.splice(b+g++,0,c.createEmoteElement(n,p,l)),void(h=!0)}if("undefined"!=typeof emotesBTTV2&&settingsCookie["bda-es-2"]&&emotesBTTV2.hasOwnProperty(n)&&n.length>=4){null!=i&&(a.splice(b+g++,0,document.createTextNode(i)),i=null);var p=bttvEmoteUrlStart+emotesBTTV2[n]+bttvEmoteUrlEnd;return m&&emotesFfz.hasOwnProperty(n)&&(n+=":bttv"),a.splice(b+g++,0,c.createEmoteElement(n,p,l)),void(h=!0)}}null==i?i=e:i+=""+e,f===j.length-1&&a.splice(b+g,0,document.createTextNode(i))}),h){var j=d.outerHeight();d.html(a);var k=$(".scroller.messages").first();k.scrollTop(k.scrollTop()+(d.outerHeight()-j))}}}})}var c=this;if(a.parentElement){var d=$(a).parent();(d.hasClass("markup")||d.hasClass("message-content"))&&(b(),d.children().hasClass("edited")&&setTimeout(b,250))}},EmoteModule.prototype.createEmoteElement=function(a,b,c){var d=Math.round(a.length/4),e=a.substr(0,d)+"﷙"+a.substr(d,d)+"﷙"+a.substr(2*d,d)+"﷙"+a.substr(3*d),f=''+e+'';return $.parseHTML(f.replace(new RegExp("﷙","g"),""))[0]},EmoteModule.prototype.autoCapitalize=function(){var a=this;$("body").delegate($(".channel-textarea-inner textarea:first"),"keyup change paste",function(){if(settingsCookie["bda-es-4"]){var b=$(".channel-textarea-inner textarea:first").val();if(void 0!=b){var c=b.split(" ").pop();if(c.length>3){if("danSgame"==c)return;var d=a.capitalize(c.toLowerCase());null!==d&&void 0!==d&&$(".channel-textarea-inner textarea:first").val(b.replace(c,d))}}}})},EmoteModule.prototype.capitalize=function(a){var b=emotesTwitch.emotes;for(var c in b)if(b.hasOwnProperty(c)&&a==(c+"").toLowerCase())return c},PublicServers.prototype.getPanel=function(){return this.container},PublicServers.prototype.init=function(){this.filtered=["134680912691462144","86004744966914048"],this.bdServer=null,this.loadingServers=!1;var a=this,b=$(".guilds>:first-child");b.after($("
",{class:"guild",id:"bd-pub-li",css:{height:"20px",display:1==settingsCookie["bda-gs-1"]?"":"none"}}).append($("
",{class:"guild-inner",css:{height:"20px","border-radius":"4px"}}).append($("").append($("
",{css:{"line-height":"20px","font-size":"12px"},text:"public",id:"bd-pub-button"}))))),$("#bd-pub-button").on("click",function(){a.show()});var c='

Public Servers

  • All
  • FPS Games
  • MMO Games
  • MOBA Games
  • Strategy Games
  • Sports Games
  • Puzzle Games
  • Retro Games
  • Party Games
  • Tabletop Games
  • Sandbox Games
  • Community
  • Language
  • Programming
  • Other
  • Simulation Games
';this.container=c,$("#bd-pub-li").length<1&&setTimeout(function(){a.init()},250)},PublicServers.prototype.getPinnedServer=function(){var a=this,b={sort:[{online:"desc"}],size:1,query:{query_string:{default_operator:"AND",query:"BetterDiscord"}}};$.ajax({type:"POST",dataType:"json",url:"https://search-discordservers-izrtub5nprzrl76ugyy6hdooe4.us-west-1.es.amazonaws.com/discord_servers/_search",crossDomain:!0,data:JSON.stringify(b),success:function(b){try{var c=b.hits.hits[0]._source;"86004744966914048"==c.identifier&&(a.bdServer=c,a.showPinnedServer())}catch(b){a.bdServer=null}}})},PublicServers.prototype.hidePinnedServer=function(){$("#pubs-container .scroller-wrap").css({"margin-top":"0",height:"500px"}),$(".server-pinned").hide()},PublicServers.prototype.showPinnedServer=function(){$(".server-pinned .server-icon").css("background-image","url("+this.bdServer.icon+")"),$(".server-pinned .server-members span").text(this.bdServer.online+"/"+this.bdServer.members+" Members"),$(".server-pinned .server-region span").text(this.bdServer.region),$(".server-pinned .server-info button").data("server-invite-code",this.bdServer.invite_code),$("#pubs-container .scroller-wrap").css({"margin-top":"75px",height:"425px"}),$(".server-pinned").show()},PublicServers.prototype.show=function(){var a=this;this.hidePinnedServer(),$("#pubs-cat-select").text("All"),this.selectedCategory="all",$("#pubs-container .scroller-wrap").css({"margin-top":"0",height:"500px"}),$(".server-pinned").hide(),$(".app").append(this.getPanel()),null==this.bdServer?this.getPinnedServer():this.showPinnedServer(),a.search(0,!0),$("#pubs-searchbtn").off("click").on("click",function(){a.search()}),$("#pubs-sterm").off("keyup").on("keyup",function(b){13==b.keyCode&&a.search(0,!0)}),$("#pubs-cat-select").off("click").on("click",function(){$("#pubs-select-dropdown").addClass("open")}),$(".pubs-cat-select-li").off("click").on("click",function(){$("#pubs-select-dropdown").removeClass("open"),$("#pubs-cat-select").text($(this).text()),a.selectedCategory!=$(this).data("val")&&(a.selectedCategory=$(this).data("val"),a.search(0,!0))}),$("#pubs-container").off("mouseup").on("mouseup",function(){$("#pubs-select-dropdown").removeClass("open")});var a=this;$(document).on("mouseup.bdps",function(b){$("#bd-pub-button").is(b.target)||$("#pubs-container").is(b.target)||0!==$("#pubs-container").has(b.target).length||a.hide()}),$("#pubs-scroller").off("scroll.pubs").on("scroll.pubs",function(){if(!a.loadingServers){var b=$("#pubs-list");$(this).scrollTop()+550
',e+='
',e+='
',b.is_official&&(e+='Official!'),e+=''+b.name+"";var f=[];b.categories.forEach(function(a){f.push(a.name)}),e+=''+f.join(", ")+"",e+=''+(void 0==b.description?"No Description":b.description)+"",e+="
",e+="
",e+='
',e+=""+b.online+"/"+b.members+" Members",e+="
",e+='
',e+=""+b.region+"",e+="
",e+='
',e+="",e+="
",e+="
",$("#pubs-list").append(e),$("button[data-server-invite-code="+c+"]").on("click",function(){d.joinServer(c)})}),b&&$("#pubs-header-title").text("Public Servers - Search Results: "+$("#pubs-list").children().length)},done:function(){$("#pubs-spinner").hide(),$("#pubs-spinner-bottom").hide(),$("#pubs-searchbtn").prop("disabled",!1),$("#pubs-sterm").prop("disabled",!1),d.loadingServers=!1},always:function(){$("#pubs-spinner").hide(),$("#pubs-spinner-bottom").hide(),$("#pubs-searchbtn").prop("disabled",!1),$("#pubs-sterm").prop("disabled",!1),d.loadingServers=!1},error:function(){$("#pubs-spinner").hide(),$("#pubs-spinner-bottom").hide(),$("#pubs-searchbtn").prop("disabled",!1),$("#pubs-sterm").prop("disabled",!1),d.loadingServers=!1},complete:function(){$("#pubs-spinner").hide(),$("#pubs-spinner-bottom").hide(),$("#pubs-searchbtn").prop("disabled",!1),$("#pubs-sterm").prop("disabled",!1),d.loadingServers=!1}})},PublicServers.prototype.search=function(a,b){var c=$("#pubs-sterm").val(),d={sort:[{online:"desc"}],from:a,size:20,query:{filtered:{query:{query_string:{default_operator:"AND",query:c?c:"*"}},filter:{bool:{must_not:[{terms:{identifier:this.filtered}}]}}}}};"all"!=this.selectedCategory&&(d.query.filtered.filter.bool.must=[{term:{"categories.id":this.selectedCategory}}]),this.loadServers(d,!0,b)},PublicServers.prototype.joinServer=function(a){$(".guilds-add").click(),$(".action.join .btn").click(),$(".create-guild-container input").val(a),$(".form.join-server .btn-primary").click()},QuickEmoteMenu.prototype.init=function(){$(document).on("mousedown",function(a){"rmenu"!=a.target.id&&$("#rmenu").remove()}),this.favoriteEmotes={};var a=localStorage.bdfavemotes;void 0!=a&&(this.favoriteEmotes=JSON.parse(atob(a)));var b="";b+='
',b+=' ',b+=" ",b+="
",this.qmeHeader=b;var c="";c+='
',c+='
',c+='
',c+='
';for(var d in emotesTwitch.emotes)if(emotesTwitch.emotes.hasOwnProperty(d)){var e=emotesTwitch.emotes[d].image_id;c+='
',c+=' ',c+=" ",c+="
"}c+="
",c+="
",c+="
",c+="
",this.teContainer=c;var f="";f+='
',f+='
',f+='
',f+='
';for(var d in this.favoriteEmotes){var g=this.favoriteEmotes[d];f+='
',f+=' ",f+=" ",f+="
"}f+="
",f+="
",f+="
",f+="
",this.faContainer=f},QuickEmoteMenu.prototype.favContext=function(a,b){a.stopPropagation();var c=$("
",{id:"rmenu","data-emoteid":$(b).prop("title"),text:"Remove"});return c.css({top:a.pageY-$("#bda-qem-favourite-container").offset().top,left:a.pageX-$("#bda-qem-favourite-container").offset().left}),$(b).parent().append(c),c.on("click",function(a){return a.preventDefault(),a.stopPropagation(),$(this).remove(),delete quickEmoteMenu.favoriteEmotes[$(this).data("emoteid")],quickEmoteMenu.updateFavorites(),!1}),!1},QuickEmoteMenu.prototype.switchHandler=function(a){this.switchQem($(a).attr("id"))},QuickEmoteMenu.prototype.switchQem=function(a){var b=$("#bda-qem-twitch"),c=$("#bda-qem-favourite"),d=$("#bda-qem-emojis");switch(b.removeClass("active"),c.removeClass("active"),d.removeClass("active"),$(".emoji-picker").hide(),$("#bda-qem-favourite-container").hide(),$("#bda-qem-twitch-container").hide(),a){case"bda-qem-twitch":b.addClass("active"),$("#bda-qem-twitch-container").show();break;case"bda-qem-favourite":c.addClass("active"),$("#bda-qem-favourite-container").show();break;case"bda-qem-emojis":d.addClass("active"),$(".emoji-picker").show()}this.lastTab=a;var e=$(".emote-icon");e.off(),e.on("click",function(){var a=$(this).attr("title"),b=$(".channel-textarea-inner textarea");b.val(" "==b.val().slice(-1)?b.val()+a:b.val()+" "+a)})},QuickEmoteMenu.prototype.obsCallback=function(a){if(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),void 0==this.lastTab&&(this.lastTab="bda-qem-favourite"),this.switchQem(this.lastTab)}},QuickEmoteMenu.prototype.favorite=function(a,b){this.favoriteEmotes.hasOwnProperty(a)||(this.favoriteEmotes[a]=b),this.updateFavorites()},QuickEmoteMenu.prototype.updateFavorites=function(){var a="";a+='
',a+='
',a+='
',a+='
';for(var b in this.favoriteEmotes){var c=this.favoriteEmotes[b];a+='
',a+=' ",a+=" ",a+="
"}a+="
",a+="
",a+="
",a+="
",this.faContainer=a,$("#bda-qem-favourite-container").replaceWith(a),window.localStorage.bdfavemotes=btoa(JSON.stringify(this.favoriteEmotes))},CustomCssEditor.prototype.init=function(){var a=this;a.hideBackdrop=!1,a.editor=CodeMirror.fromTextArea(document.getElementById("bd-custom-css-ta"),{ lineNumbers:!0,mode:"css",indentUnit:4,theme:"neat"}),a.editor.on("change",function(b){var c=b.getValue();a.applyCustomCss(c,!1,!1)});var b="";b+='
',b+='
    ',b+="
  • ",b+='
    ',b+='
    ",b+=' Live Update',b+="
    ",b+="
  • ",b+="
  • ",b+='
    ',b+='
    ",b+=' Autosave',b+="
    ",b+="
  • ",b+="
  • ",b+='
    ',b+='
    ",b+=' Hide Backdrop',b+="
    ",b+="
  • ",b+="
",b+='
',b+=' ',b+=' ',b+=' ',b+="
",b+="
",this.attachEditor=b,$("#bd-customcss-innerpane").append(b),$("#bd-customcss-detached-update").on("click",function(){return a.applyCustomCss(a.editor.getValue(),!0,!1),!1}),$("#bd-customcss-detached-save").on("click",function(){return a.applyCustomCss(a.editor.getValue(),!1,!0),!1});var c="";c+='
',c+='
',c+="
",c+="
",this.detachedEditor=c},CustomCssEditor.prototype.attach=function(){$("#editor-detached").hide(),$("#app-mount").removeClass("bd-detached-editor"),$("#bd-customcss-pane").append($("#bd-customcss-innerpane")),$("#bd-customcss-detached-detach").show(),$("#bd-customcss-detach-container").remove()},CustomCssEditor.prototype.detach=function(){this.attach(),$("#editor-detached").show(),$("#bd-customcss-detached-detach").hide(),$("#app-mount").addClass("bd-detached-editor"),$(".app").parent().append(this.detachedEditor),$("#bd-customcss-detach-editor").append($("#bd-customcss-innerpane"))},CustomCssEditor.prototype.applyCustomCss=function(a,b,c){0==$("#customcss").length&&$("head").append(''),(b||settingsCookie["bda-css-0"])&&$("#customcss").html(a),(c||settingsCookie["bda-css-1"])&&localStorage.setItem("bdcustomcss",btoa(a))};var settingsButton=null,panel=null;SettingsPanel.prototype.init=function(){var a=this;a.construct();var b=$("body");settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-2"]?b.addClass("bd-minimal"):b.removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?b.addClass("bd-minimal-chan"):b.removeClass("bd-minimal-chan"),settingsCookie["bda-gs-4"]&&voiceMode.enable(),settingsCookie["bda-gs-5"]&&$("#app-mount").addClass("bda-dark"),settingsCookie["bda-es-6"]?(emoteNamePopup=$("
"),$(document).on("mouseover",".emote",function(){var a=$(this).offset(),b=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(b),$(emoteNamePopup).css("left",a.left-25),$(emoteNamePopup).css("top",a.top-37),$(".app").append($(emoteNamePopup))}),$(document).on("mouseleave",".emote",function(){$(".tipsy").remove()})):$(document).off("mouseover",".emote"),settingsCookie["bda-gs-8"]?dMode.enable():dMode.disable()};var customCssInitialized=!1,lastTab="";SettingsPanel.prototype.changeTab=function(a){lastTab=a;$("#bd-control-groups");switch($(".bd-tab").removeClass("selected"),$(".bd-pane").hide(),$("#"+a).addClass("selected"),$("#"+a.replace("tab","pane")).show(),a){case"bd-settings-tab":$(".bda-slist-top").show();break;case"bd-emotes-tab":$(".bda-slist-top").show();break;case"bd-customcss-tab":$(".bda-slist-top").show(),customCssInitialized||(customCssEditor.init(),customCssInitialized=!0);break;case"bd-themes-tab":$(".bda-slist-top:first").hide();break;case"bd-plugins-tab":$(".bda-slist-top:first").hide();break;default:$(".bda-slist-top").show()}},SettingsPanel.prototype.updateSetting=function(a){var b=$(a).children().find('input[type="checkbox"]'),c=!b.is(":checked"),d=b.attr("id");b.prop("checked",c),"bda-css-2"==d&&($("#app-mount").removeClass("bd-hide-bd"),customCssEditor.hideBackdrop=c,c&&$("#app-mount").addClass("bd-hide-bd")),"bda-gs-8"==d&&c&&mainCore.alert("Developer Mode Enabled","Use F8 to break/resume execution
More coming soon"),settingsCookie[d]=c,this.updateSettings()},SettingsPanel.prototype.updateSettings=function(){settingsCookie["bda-es-0"]?$("#twitchcord-button-container").show():$("#twitchcord-button-container").hide(),settingsCookie["bda-gs-2"]?$("body").addClass("bd-minimal"):$("body").removeClass("bd-minimal"),settingsCookie["bda-gs-3"]?$("body").addClass("bd-minimal-chan"):$("body").removeClass("bd-minimal-chan"),settingsCookie["bda-gs-1"]?$("#bd-pub-li").show():$("#bd-pub-li").hide(),settingsCookie["bda-gs-4"]?voiceMode.enable():voiceMode.disable(),$("#app-mount").removeClass("bda-dark"),settingsCookie["bda-gs-5"]&&$("#app-mount").addClass("bda-dark"),settingsCookie["bda-es-6"]?(emoteNamePopup=$("
"),$(document).on("mouseover",".emote",function(){var a=$(this).offset(),b=$(this).attr("alt");$(emoteNamePopup).find(".tipsy-inner").text(b),$(emoteNamePopup).css("left",a.left-25),$(emoteNamePopup).css("top",a.top-32),$("div[data-reactid='.0.1.1']").append($(emoteNamePopup))}),$(document).on("mouseleave",".emote",function(){$(".tipsy").remove()})):$(document).off("mouseover",".emote"),settingsCookie["bda-gs-8"]?dMode.enable():dMode.disable(),mainCore.saveSettings()},SettingsPanel.prototype.construct=function(){function a(){$(".tab-bar-item").removeClass("selected"),settingsButton.addClass("selected"),$(".form .settings-right .settings-inner").first().hide(),panel.show(),""==lastTab?b.changeTab("bd-settings-tab"):b.changeTab(lastTab)}var b=this;panel=$("
",{id:"bd-pane",class:"settings-inner",css:{display:"none"}});var c='
Core
Emotes
Custom CSS
Plugins
Themes
",c+=' ";var g=atob(localStorage.getItem("bdcustomcss"));customCssEditor.applyCustomCss(g,!0,!1),c+=' ",c+='
    ',$.each(bdplugins,function(){var a=this.plugin,b=!1;"function"==typeof a.getSettingsPanel&&(b=null!=a.getSettingsPanel()&&""!=a.getSettingsPanel()),c+='
  • '+a.getName()+" v"+a.getVersion()+" by "+a.getAuthor()+'
    '+a.getDescription()+'
  • "}),c+="
",c+=' ",c+='
BetterDiscord v'+("undefined"==typeof version?bdVersion:version)+"(JSv"+jsVersion+') by Jiiks BetterDiscord.net changelog
',settingsButton=$("
",{class:"tab-bar-item",text:"BetterDiscord",id:"bd-settings-new",click:a}),panel.html(c),this.panel=panel},SettingsPanel.prototype.inject=function(a){if("childList"==a.type&&!(a.addedNodes.length<=0||$(a.addedNodes[0]).find(".user-settings-modal").length<=0)){var b=this;this.panel.hide();var c=$(".tab-bar.SIDE").first();$(".tab-bar.SIDE .tab-bar-item").click(function(){$(".form .settings-right .settings-inner").first().show(),$("#bd-settings-new").removeClass("selected"),b.panel.hide()}),c.append(settingsButton),$(".form .settings-right .settings-inner").last().after(b.panel),$("#bd-settings-new").removeClass("selected")}};var _hash;Utils.prototype.getTextArea=function(){return $(".channel-textarea-inner textarea")},Utils.prototype.jqDefer=function(a){window.jQuery?a():setTimeout(function(){this.jqDefer(a)},100)},Utils.prototype.getHash=function(){$.getJSON("https://api.github.com/repos/Jiiks/BetterDiscordApp/commits/master",function(a){_hash=a.sha,emoteModule.getBlacklist()})},Utils.prototype.loadHtml=function(a,b){var c=$("
",{class:"bd-container"}).appendTo("body");a="//cdn.rawgit.com/Jiiks/BetterDiscordApp/"+_hash+"/html/"+a+".html",c.load(a,b())},Utils.prototype.injectJs=function(a){$("