!function(e){!functiont(e,o,n){functions(a,i){if(!o[a]){if(!e[a]){varl="function"==typeofrequire&&require;if(!i&&l)returnl(a,!0);if(r)returnr(a,!0);thrownewError("Cannot find module '"+a+"'")}varc=o[a]={exports:{}};e[a][0].call(c.exports,function(t){varo=e[a][1][t];returns(o?o:t)},c,c.exports,t,e,o,n)}returno[a].exports}for(varr="function"==typeofrequire&&require,a=0;a<n.length;a++)s(n[a]);returns}({1:[function(t){varo=e.FrankerFaceZ,n=t("./constants"),s=t("./utils");o.prototype.setup_badges=function(){this.log("Preparing badge system."),this.badges={},this.log("Creating badge style element.");vare=this._badge_style=document.createElement("style");e.id="ffz-badge-css",document.head.appendChild(e),this.log("Adding legacy donor badges."),this._legacy_add_donors()};varr=function(e){return".badges .ffz-badge-"+e.id+" { background-color: "+e.color+'; background-image: url("'+e.image+'"); '+(e.extra_css||"")+"}"};o.prototype.bttv_badges=function(e){vart=e.sender,o=this.users[t],n=[],s=-1;if(o&&o.badges){for(varr=0;r<e.badges.length;r++){vara=e.badges[r];if("subscriber"==a.type||"turbo"==a.type){s=r;break}}for(variino.badges)if(o.badges.hasOwnProperty(i)){vara=o.badges[i],l=this.badges[a.id]||{},c=a.title||l.title,u="",d=BetterTTV.settings.get("alphaTags");a.image&&(u+='background-image: url(\\"'+a.image+'\\"); '),a.color&&!d&&(u+="background-color: "+a.color+"; "),a.extra_css&&(u+=a.extra_css),u&&(c+='" style="'+u),n.push([(-1==s?1:-1)*i,{type:"ffz-badge-"+a.id+(d?" alpha":""),name:"",description:c}])}if(n.sort(function(e,t){returne[0]-t[0]}),-1==s)for(;n.length;)e.badges.push(n.shift()[1]);elsefor(;n.length;)e.badges.insertAt(s,n.shift()[1])}},o.prototype.render_badge=function(e){vart=e.get("context.model.from"),o=(e.get("context.parentController.content.id"),e.$(".badges")),n=this.users[t];if(n&&n.badges){vars=o.find(".badge").filter(function(){vare=this.title.toLowerCase();return"subscriber"==e||"turbo"==e}).first(),r=[],a=!!s.length;for(variinn.badges)if(n.badges.hasOwnProperty(i)){varl=n.badges[i],c=this.badges[l.id]||{},u=document.createElement("div");u.className="badge float-left tooltip ffz-badge-"+l.id,u.setAttribute("title",l.title||c.title),l.image&&(u.style.backgroundImage='url("'+l.image+'")'),l.color&&(u.style.backgroundColor=l.color),l.extra_css&&(u.style.cssText+=l.extra_css),r.push([(a?1:-1)*i,u])}if(r.sort(function(e,t){returne[0]-t[0]}),a)for(;r.length;)s.before(r.shift()[1]);elsefor(;r.length;)o.append(r.shift()[1])}},o.prototype._legacy_add_donors=function(e){this.badges[1]={id:1,title:"FFZ Donor",color:"#755000",image:"//cdn.frankerfacez.com/channel/global/donoricon.png"},s.update_css(this._badge_style,1,r(this.badges[1])),this.badges[0]={id:0,title:"FFZ Developer",color:"#FAAF19",image:"//cdn.frankerfacez.com/channel/global/devicon.png"},s.update_css(this._badge_style,0,r(this.badges[0])),this.users.sirstendec={badges:{0:{id:0}}},jQuery.ajax(n.SERVER+"script/donors.txt",{cache:!1,context:this}).done(function(e){this._legacy_parse_donors(e)}).fail(function(t){return404!=t.status?(e=(e||0)+1,10>e?this._legacy_add_donors(e):void0):void0})},o.prototype._legacy_parse_donors=function(e){vart=0;if(null!=e)for(varo=e.trim().split(/\W+/),n=0;n<o.length;n++){varr=o[n],a=this.users[r]=this.users[r]||{},i=a.badges=a.badges||{};i[0]||(i[0]={id:1},t+=1)}this.log("Added donor badge to "+s.number_commas(t)+" users.")}},{"./constants":3,"./utils":23}],2:[function(){vart=e.FrankerFaceZ;t.chat_commands.massunmod=function(e,t){if(t=t.join(" ").trim(),!t.length)return"You must provide a list of users to unmod.";t=t.split(/\W*,\W*/);varo=this.get_user();if(!o||!o.login==e.id)return"You must be the broadcaster to use massunmod.";if(t.length>50)return"Each user you unmod counts as a single message. To avoid being globally banned, please limit yourself to 50 at a time and wait between uses.";for(varn=t.length;t.length;){vars=t.shift();e.room.tmiRoom.sendMessage("/unmod "+s)}return"Sent unmod command for "+n+" users."},t.chat_commands.massunmod.help="Usage:/ffzmassunmod<list,of,
if(t)returnt.parentElement.removeChild(t),voiddeletethis._popup;varo=document.createElement("div"),n=document.createElement("div");o.className="emoticon-selector chat-menu ffz-ui-popup",n.className="emoticon-selector-box dropmenu",o.appendChild(n);vars=e.get("controller.currentRoom.id"),r=this.rooms[s];this.log("Menu for Room: "+s,r),this.track("trackEvent","Menu","Open",s);vara=document.createElement("a");a.className="button glyph-only ffz-button",a.title="Advertise for FrankerFaceZ in chat!",a.href="#",a.innerHTML='<svg class="svg-followers" height="16px" version="1.1" viewBox="0 0 16 16" width="16px" x="0px" y="0px"><path clip-rule="evenodd" d="M8,13.5L1.5,7V4l2-2h3L8,3.5L9.5,2h3l2,2v3L8,13.5z" fill-rule="evenodd"></path></svg>';vari=document.createElement("div");i.className="list-header first",i.appendChild(a),i.appendChild(document.createTextNode("FrankerFaceZ")),n.appendChild(i);varl=this._emotes_for_sets(n,e,r&&r.menu_sets||[]);0===l?a.addEventListener("click",this._add_emote.bind(this,e,"To use custom emoticons in tons of channels, get FrankerFaceZ from http://www.frankerfacez.com")):a.addEventListener("click",this._add_emote.bind(this,e,"To view this channel's emoticons, get FrankerFaceZ from http://www.frankerfacez.com")),this._feature_friday_ui(s,n,e),this._popup=o,n.style.maxHeight=Math.max(300,e.$().height()-171)+"px",e.$(".chat-interface").append(o)},t.prototype._emotes_for_sets=function(e,t,o,n,s){if(null!=n){varr=document.createElement("div");r.className="list-header",r.appendChild(document.createTextNode(n)),s&&r.appendChild(s),e.appendChild(r)}vara=document.createElement("div"),i=0;a.className="emoticon-grid";for(varl=0;l<o.length;l++){varc=this.emote_sets[o[l]];if(c&&c.emotes)for(varuinc.emotes){vard=c.emotes[u];if(c.emotes.hasOwnProperty(u)&&!d.hidden){i++;varh=document.createElement("span");h.className="emoticon tooltip",h.style.backgroundImage='url("'+d.url+'")',h.style.width=d.width+"px",h.style.height=d.height+"px",h.title=d.name,h.addEventListener("click",this._add_emote.bind(this,t,d.name)),a.appendChild(h)}}}i||(a.innerHTML="This channel has no emoticons.",a.className="chat-menu-content ffz-no-emotes center"),e.appendChild(a)},t.prototype._add_emote=function(e,t){varo=e.get("controller.currentRoom"),n=o.get("messageToSend")||"";n&&" "!==n.substr(-1)&&(n+=" "),o.set("messageToSend",n+(t.name||t))}},{}],19:[function(t){varo=e.FrankerFaceZ,n=t("../constants");o.prototype.build_ui_link=function(e){vart=document.createElement("a");returnt.className="ffz-ui-toggle",t.innerHTML=n.CHAT_BUTTON,t.addEventListener("click",this.build_ui_popup.bind(this,e)),this.update_ui_link(t),t},o.prototype.update_ui_link=function(e){vart=App.__container__.lookup("controller:chat");if(e=e||document.querySelector("a.ffz-ui-toggle"),e&&t){varo=t.get("currentRoom.id"),n=this.rooms[o],s=!1,r=this.has_bttv?BetterTTV.settings.get("darkenedMode"):!1,a=this.has_bttv?BetterTTV.settings.get("showBlueButtons"):!1,i=this.feature_friday&&this.feature_friday.live;if(n&&n.sets.length)for(varl=0;l<n.sets.length;l++){varc=this.emote_sets[n.sets[l]];if(c&&c.count>0){s=!0;break}}e.classList.toggle("no-emotes",!s),e.classList.toggle("live",i),e.classList.toggle("dark",r),e.classList.toggle("blue",a)}}},{"../constants":3}],20:[function(){vart=e.FrankerFaceZ;t.prototype.show_notification=function(t){e.noty({text:t,theme:"ffzTheme",layout:"bottomCenter",closeWith:["button"]}).show()},t.ws_commands.message=function(e){this.show_notification(e)}},{}],21:[function(t){varo=e.FrankerFaceZ,n=t("../constants");o.prototype.setup_css=function(){this.log("Injecting main FrankerFaceZ CSS.");vare=this._main_style=document.createElement("link");e.id="ffz-ui-css",e.setAttribute("rel","stylesheet"),e.setAttribute("href",n.SERVER+"script/style.css"),document.head.appendChild(e),jQuery.noty.themes.ffzTheme={name:"ffzTheme",style:function(){this.$bar.removeClass().addClass("noty_bar").addClass("ffz-noty").addClass(this.options.type)},callback:{onShow:function(){},onClose:function(){}}}}},{"../constants":3}],22:[function(t){varo=e.