text: /*!
   * Pusher JavaScript Library v2.2.1
   * http://pusher.com/
   *
   * Copyright 2014, Pusher
   * Released under the MIT licence.
   */
  
  (function(){function c(b,a,c){Pusher.EventsDispatcher.call(this);this.hooks=b;this.method=a;this.url=c}var a=c.prototype;Pusher.Util.extend(a,Pusher.EventsDispatcher.prototype);a.start=function(a){var d=this;d.position=0;d.xhr=d.hooks.getRequest(d);d.unloader=function(){d.close()};Pusher.Util.addWindowListener("unload",d.unloader);d.xhr.open(d.method,d.url,!0);d.xhr.send(a)};a.close=function(){this.unloader&&(Pusher.Util.removeWindowListener("unload",this.unloader),this.unloader=null);this.xhr&&(this.hooks.abortRequest(this.xhr),
  this.xhr=null)};a.onChunk=function(a,d){for(;;){var c=this.advanceBuffer(d);if(c)this.emit("chunk",{status:a,data:c});else break}this.isBufferTooLong(d)&&this.emit("buffer_too_long")};a.advanceBuffer=function(a){a=a.slice(this.position);var d=a.indexOf("\n");return-1!==d?(this.position+=d+1,a.slice(0,d)):null};a.isBufferTooLong=function(a){return this.position===a.length&&262144<a.length};Pusher.HTTP.Request=c}).call(this);
  (function(){var c={getRequest:function(a){var b=new window.XMLHttpRequest;b.onreadystatechange=b.onprogress=function(){switch(b.readyState){case 3:if(b.responseText&&0<b.responseText.length)a.onChunk(b.status,b.responseText);break;case 4:if(b.responseText&&0<b.responseText.length)a.onChunk(b.status,b.responseText);a.emit("finished",b.status);a.close()}};return b},abortRequest:function(a){a.onreadystatechange=null;a.abort()}};Pusher.HTTP.getXHR=function(a,b){return new Pusher.HTTP.Request(c,a,b)}}).call(this);
  (function(){function c(f,a){this.hooks=f;var b=Math.floor(1E3*Math.random())+"/",c;c=[];for(var e=0;8>e;e++)c.push(Math.floor(32*Math.random()).toString(32));c=c.join("");this.session=b+c;b=/([^\?]*)\/*(\??.*)/.exec(a);this.location={base:b[1],queryString:b[2]};this.readyState=d;this.openStream()}function a(f){var a=-1===f.indexOf("?")?"?":"&";return f+a+"t="+ +new Date+"&n="+g++}function b(a,b){if(Pusher.Util.isXHRSupported())return Pusher.HTTP.getXHR(a,b);if(Pusher.Util.isXDRSupported(0===b.indexOf("https:")))return Pusher.HTTP.getXDR(a,
  b);throw"Cross-origin HTTP requests are not supported";}var d=0,g=1,e=c.prototype;e.send=function(a){return this.sendRaw(JSON.stringify([a]))};e.ping=function(){this.hooks.sendHeartbeat(this)};e.close=function(a,b){this.onClose(a,b,!0)};e.sendRaw=function(f){if(1===this.readyState)try{return b("POST",a(this.location.base+"/"+this.session+"/xhr_send")).start(f),!0}catch(c){return!1}else return!1};e.reconnect=function(){this.closeStream();this.openStream()};e.onClose=function(a,b,c){this.closeStream();
  this.readyState=3;if(this.onclose)this.onclose({code:a,reason:b,wasClean:c})};e.onChunk=function(a){if(200===a.status){if(1===this.readyState)this.onActivity();switch(a.data.slice(0,1)){case "o":a=JSON.parse(a.data.slice(1)||"{}");this.onOpen(a);break;case "a":a=JSON.parse(a.data.slice(1)||"[]");for(var b=0;b<a.length;b++)this.onEvent(a[b]);break;case "m":a=JSON.parse(a.data.slice(1)||"null");this.onEvent(a);break;case "h":this.hooks.onHeartbeat(this);break;case "c":a=JSON.parse(a.data.slice(1)||
  "[]"),this.onClose(a[0],a[1],!0)}}};e.onOpen=function(a){if(this.readyState===d){if(a&&a.hostname){var b=this.location;a=a.hostname;var c=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(this.location.base);b.base=c[1]+a+c[3]}this.readyState=1;if(this.onopen)this.onopen()}else this.onClose(1006,"Server lost session",!0)};e.onEvent=function(a){if(1===this.readyState&&this.onmessage)this.onmessage({data:a})};e.onActivity=function(){if(this.onactivity)this.onactivity()};e.onError=function(a){if(this.onerror)this.onerror(a)};
  e.openStream=function(){var c=this;c.stream=b("POST",a(c.hooks.getReceiveURL(c.location,c.session)));c.stream.bind("chunk",function(a){c.onChunk(a)});c.stream.bind("finished",function(a){c.hooks.onFinished(c,a)});c.stream.bind("buffer_too_long",function(){c.reconnect()});try{c.stream.start()}catch(d){Pusher.Util.defer(function(){c.onError(d);c.onClose(1006,"Could not start streaming",!1)})}};e.closeStream=function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)};Pusher.HTTP.Socket=
  c}).call(this);(function(){var c={getReceiveURL:function(a,b){return a.base+"/"+b+"/xhr_streaming"+a.queryString},onHeartbeat:function(a){a.sendRaw("[]")},sendHeartbeat:function(a){a.sendRaw("h")},onFinished:function(a,b){a.onClose(1006,"Connection interrupted ("+b+")",!1)}};Pusher.HTTP.getStreamingSocket=function(a){return new Pusher.HTTP.Socket(c,a)}}).call(this);
  (function(){var c={getReceiveURL:function(a,b){return a.base+"/"+b+"/xhr"+a.queryString},onHeartbeat:function(){},sendHeartbeat:function(a){a.sendRaw("h")},onFinished:function(a,b){if(200===b)a.reconnect();else a.onClose(1006,"Connection interrupted ("+b+")",!1)}};Pusher.HTTP.getPollingSocket=function(a){return new Pusher.HTTP.Socket(c,a)}}).call(this);
  