function Core(){}function EmoteModule(){}function PublicServers(){}function QuickEmoteMenu(){}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(){}var settingsPanel,emoteModule,utils,quickEmoteMenu,opublicServers,voiceMode,pluginModule,themeModule,jsVersion=1.57,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},"Public Servers":{id:"bda-gs-1",info:"Display public servers button",implemented:!0},"Minimal Mode":{id:"bda-gs-2",info:"Hide elements and reduce the size of elements.",implemented:!0},"Voice Mode":{id:"bda-gs-4",info:"Only show voice chat",implemented:!0},"Hide Channels":{id:"bda-gs-3",info:"Hide channels in minimal mode",implemented:!0},"Quick Emote Menu":{id:"bda-es-0",info:"Show quick emote menu for adding emotes",implemented:!0},"Show Emotes":{id:"bda-es-7",info:"Show any emotes",implemented:!0},"FrankerFaceZ Emotes":{id:"bda-es-1",info:"Show FrankerFaceZ Emotes",implemented:!0},"BetterTTV Emotes":{id:"bda-es-2",info:"Show BetterTTV Emotes",implemented:!0},"Emote Autocomplete":{id:"bda-es-3",info:"Autocomplete emote commands",implemented:!1},"Emote Auto Capitalization":{id:"bda-es-4",info:"Autocapitalize emote commands",implemented:!0},"Override Default Emotes":{id:"bda-es-5",info:"Override default emotes",implemented:!1},"Show Names":{id:"bda-es-6",info:"Show emote names on hover",implemented:!0}},links={"Jiiks.net":{text:"Jiiks.net",href:"http://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-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-jd":!0},bdchangelog={changes:{api:{title:"Api Functions!",text:"New api events!",img:""},dec:{title:"Decorations&Snow!",text:"Decorations and snow have been removed.",img:""}},fixes:{emotes:{title:"Sub emotes!",text:"Discord sub emotes are now replaced by BetterDiscord sub emotes and can be favorited!",img:""}},upcoming:{ignore:{title:"Ignore User!",text:"Ignore users you don't like!",img:""}}},settingsCookie={};Core.prototype.init=function(){function e(){if(console.log((new Date).getTime()+" Defer"),$(".guilds-wrapper .guilds").children().length>0){console.log((new Date).getTime()+" Defer Loaded");var i=$(".guilds>li:first-child");i.after($("
  • ",{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"})))));var o=$("
    ';if(null!=bdchangelog.changes){e+='

    New Stuff

      ';for(var t in bdchangelog.changes)t=bdchangelog.changes[t],e+="
    • "+t.title+"
      "+t.text+"
    • ";e+="
    "}if(null!=bdchangelog.fixes){e+='

    Fixed

      ';for(var i in bdchangelog.fixes)i=bdchangelog.fixes[i],e+="
    • "+i.title+"
      "+i.text+"
    • ";e+="
    "}if(null!=bdchangelog.upcoming){e+='

    Coming Soon

      ';for(var o in bdchangelog.upcoming)o=bdchangelog.upcoming[o],e+="
    • "+o.title+"
      "+o.text+"
    • ";e+="
    "}return e+='
    '},Core.prototype.alert=function(e,t){$("body").append('
    '+e+'
    ×
    '+t+"
    ")};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(e){bemotes=e.blacklist})},EmoteModule.prototype.obsCallback=function(e){var t=this;if(settingsCookie["bda-es-7"]){$(".emoji").each(function(){var e=$(this);-1!=e.attr("src").indexOf(".png")&&e.replaceWith(""+e.attr("alt")+"")});for(var i=0;i-1)return;return o.addClass("spoiler"),void o.on("click",function(){$(this).removeClass("spoiler"),spoilered.push($(this).attr("data-reactid"))})}if(!(t.length<4)){if("ClauZ"==t)return void(e=e.replace("ClauZ",''));if(-1==$.inArray(t,bemotes)){if(emotesTwitch.emotes.hasOwnProperty(t)){var s=Math.round(t.length/4),a=t.substr(0,s)+"﷙"+t.substr(s,s)+"﷙"+t.substr(2*s,s)+"﷙"+t.substr(3*s),r=twitchEmoteUrlStart+emotesTwitch.emotes[t].image_id+twitchEmoteUrlEnd;return void(e=e.replace(t,'
    '+a+'
    '))}if("undefined"!=typeof emotesFfz&&settingsCookie["bda-es-1"]&&emotesFfz.hasOwnProperty(t)){var s=Math.round(t.length/4),a=t.substr(0,s)+"﷙"+t.substr(s,s)+"﷙"+t.substr(2*s,s)+"﷙"+t.substr(3*s),r=ffzEmoteUrlStart+emotesFfz[t]+ffzEmoteUrlEnd;return void(e=e.replace(t,'
    '+a+'
    '))}if("undefined"!=typeof emotesBTTV&&settingsCookie["bda-es-2"]&&emotesBTTV.hasOwnProperty(t)){var s=Math.round(t.length/4),a=t.substr(0,s)+"﷙"+t.substr(s,s)+"﷙"+t.substr(2*s,s)+"﷙"+t.substr(3*s),r=emotesBTTV[t];return void(e=e.replace(t,'
    '+a+'
    '))}if("undefined"!=typeof emotesBTTV2&&settingsCookie["bda-es-2"]&&emotesBTTV2.hasOwnProperty(t)){var s=Math.round(t.length/4),a=t.substr(0,s)+"﷙"+t.substr(s,s)+"﷙"+t.substr(2*s,s)+"﷙"+t.substr(3*s),r=bttvEmoteUrlStart+emotesBTTV2[t]+bttvEmoteUrlEnd;return void(e=e.replace(t,'
    '+a+'
    '))}if(subEmotesTwitch.hasOwnProperty(t)){var s=Math.round(t.length/4),a=t.substr(0,s)+"﷙"+t.substr(s,s)+"﷙"+t.substr(2*s,s)+"﷙"+t.substr(3*s),r=twitchEmoteUrlStart+subEmotesTwitch[t]+twitchEmoteUrlEnd;return void(e=e.replace(t,'
    '+a+'
    '))}}}}),null!=i.parentElement)){var o=i.parentElement.offsetHeight;i.innerHTML=e.replace(new RegExp("﷙","g"),"");var n=i.parentElement.offsetHeight,s=$(".scroller.messages").first();s.scrollTop(s.scrollTop()+(n-o))}}}if("undefined"!=typeof emotesTwitch&&e.parentElement){var i=e.parentElement;if("SPAN"==i.tagName){var o=!1;$(i.parentElement).hasClass("edited")&&(i=i.parentElement.parentElement.firstChild,o=!0),o?setTimeout(t,250):t()}}},EmoteModule.prototype.autoCapitalize=function(){var e=this;$("body").delegate($(".channel-textarea-inner textarea"),"keyup change paste",function(){if(settingsCookie["bda-es-4"]){var t=$(".channel-textarea-inner textarea").val();if(void 0!=t){var i=t.split(" ").pop();if(i.length>3){if("danSgame"==i)return;var o=e.capitalize(i.toLowerCase());null!==o&&void 0!==o&&$(".channel-textarea-inner textarea").val(t.replace(i,o))}}}})},EmoteModule.prototype.capitalize=function(e){var t=emotesTwitch.emotes;for(var i in t)if(t.hasOwnProperty(i)&&e==(i+"").toLowerCase())return i};var publicServers={servers:{server:{code:0,icon:null,title:"title",language:"EN",description:"description"}}};PublicServers.prototype.getPanel=function(){return this.container},PublicServers.prototype.init=function(){var e=this;this.container=$("
    ",{id:"bd-ps-container",style:"display:none"});var t=$("
    ",{id:"bd-ps-header"});$("

    ",{text:"Public Servers"}).appendTo(t),$("",{id:"bd-ps-close",style:"cursor:pointer;",text:"X"}).appendTo(t),t.appendTo(this.getPanel());var i=$("
    ",{id:"bd-ps-body"});i.appendTo(this.getPanel());var o=$("",{border:"0"}),n=$("");n.appendTo(o);var s=$("",{}).append($("",{id:"bd-ps-tbody"});a.appendTo(o),o.appendTo(i),$("body").append(this.getPanel()),$("#bd-ps-close").on("click",function(){e.show()});var r=publicServers.servers;for(var d in r)if(r.hasOwnProperty(d)){var l=r[d],c=l.code,p=l.title,u=l.language,m=l.description;this.addServer(d,c,p,u,m)}},PublicServers.prototype.addServer=function(e,t,i,o,n){var s=this,a=$("#bd-ps-tbody"),r=$("");d.append($("
    ",{text:"Name"})).append($("",{text:"Code"})).append($("",{text:"Language"})).append($("",{text:"Description"})).append($("",{text:"Join"}));s.appendTo(n);var a=$("
    ").append($("
    ",{"class":"bd-ps-description",text:n})),d=$("
    ",{text:i})),d.append($("",{css:{"-webkit-user-select":"initial","user-select":"initial"},text:t})),d.append($("",{text:o})),d.append(r),d.append($("").append($("