!function(e){!functiont(e,o,n){functions(i,a){if(!o[i]){if(!e[i]){varl="function"==typeofrequire&&require;if(!a&&l)returnl(i,!0);if(r)returnr(i,!0);thrownewError("Cannot find module '"+i+"'")}varc=o[i]={exports:{}};e[i][0].call(c.exports,function(t){varo=e[i][1][t];returns(o?o:t)},c,c.exports,t,e,o,n)}returno[i].exports}for(varr="function"==typeofrequire&&require,i=0;i<n.length;i++)s(n[i]);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++){vari=e.badges[r];if("subscriber"==i.type||"turbo"==i.type){s=r;break}}for(varaino.badges)if(o.badges.hasOwnProperty(a)){vari=o.badges[a],l=this.badges[i.id]||{},c=i.title||l.title,u="",d=BetterTTV.settings.get("alphaTags");i.image&&(u+='background-image: url(\\"'+i.image+'\\"); '),i.color&&!d&&(u+="background-color: "+i.color+"; "),i.extra_css&&(u+=i.extra_css),u&&(c+='" style="'+u),n.push([(-1==s?1:-1)*a,{type:"ffz-badge-"+i.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=[],i=!!s.length;for(varainn.badges)if(n.badges.hasOwnProperty(a)){varl=n.badges[a],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([(i?1:-1)*a,u])}if(r.sort(function(e,t){returne[0]-t[0]}),i)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],i=this.users[r]=this.users[r]||{},a=i.badges=i.badges||{};a[0]||(a[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,
},o.chat_commands.analytics.help="Usage: /ffz analytics <on|off>\nEnable or disable FrankerFaceZ analytics. We collect some data about your browser and how you use FrankerFaceZ to help us improve the script. Turn off analytics if you'd rather we not.",o.prototype.track=function(){this._tracking&&e._paq&&_paq.push(Array.prototype.slice.call(arguments))},o.prototype.track_page=function(){if(this._tracking){this._old_url&&this.track("setReferrerUrl",this._old_url),this._old_url=document.location.toString(),this.track("setCustomUrl",this._old_url),this.track("deleteCustomVariable","1","page"),this.track("deleteCustomVariable","3","page");vare=App.__container__.resolve("router:main").router.currentHandlerInfos;if(e&&0!=e.length){vart=e[e.length-1];if("channel.index"==t.name&&t.context){varo=t.context.get("isFollowing.isFollowing");void0!==o&&null!==o&&this.track("setCustomVariable","1","Following",o?"Yes":"No","page");varn=t.context.get("game");n&&this.track("setCustomVariable","3","Game",n,"page"),this.track("trackPageView",document.title)}}}}},{"./constants":3}],18:[function(){vart=e.FrankerFaceZ;t.prototype.setup_menu=function(){this.log("Installing mouse-up event to auto-close menus.");vare=this;jQuery(document).mouseup(function(t){varo,n=e._popup;n&&(n=jQuery(n),o=n.parent(),o.is(t.target)||0!==o.has(t.target).length||(n.remove(),deletee._popup))})},t.prototype.build_ui_popup=function(t){varo=this._popup;if(o)returno.parentElement.removeChild(o),voiddeletethis._popup;varn=document.createElement("div"),s=document.createElement("div");n.className="emoticon-selector chat-menu ffz-ui-popup",s.className="emoticon-selector-box dropmenu",n.appendChild(s);varr=t.get("controller.currentRoom.id"),i=this.rooms[r];this.log("Menu for Room: "+r,i),this.track("trackEvent","Menu","Open",r);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>';varl=document.createElement("div");l.className="list-header first",l.appendChild(a),l.appendChild(document.createTextNode("FrankerFaceZ")),s.appendChild(l);varc=this._emotes_for_sets(s,t,i&&i.menu_sets||[]);this._ws_exists?0===c?a.addEventListener("click",this._add_emote.bind(this,t,"To use custom emoticons in tons of channels, get FrankerFaceZ from http://www.frankerfacez.com")):a.addEventListener("click",this._add_emote.bind(this,t,"To view this channel's emoticons, get FrankerFaceZ from http://www.frankerfacez.com")):(a.className="button ffz-button primary",a.innerHTML="Server Error",a.title="FFZ Server Error",a.addEventListener("click",alert.bind(e,"The FrankerFaceZ client was unable to create a WebSocket to communicate with the FrankerFaceZ server.\n\nThis is most likely due to your browser's configuration either disabling WebSockets entirely or limiting the number of simultaneous connections. Please ensure that WebSockets have not been disabled."))),this._feature_friday_ui(r,s,t),this._popup=n,s.style.maxHeight=Math.max(300,t.$().height()-171)+"px",t.$(".chat-interface").append(n)},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)}vari=document.createElement("div"),a=0;i.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){a++;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)),i.appendChild(h)}}}a||(i.innerHTML="This channel has no emoticons.",i.className="chat-menu-content ffz-no-emotes center"),e.appe