forked from yocontra/holla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
holla.min.js
2 lines (2 loc) · 50.4 KB
/
holla.min.js
1
2
(function(){function t(e,n,o){var r=t.resolve(e);if(null==r){o=o||e,n=n||"root";var i=Error('Failed to require "'+o+'" from "'+n+'"');throw i.path=o,i.parent=n,i.require=!0,i}var s=t.modules[r];return s.exports||(s.exports={},s.client=s.component=!0,s.call(this,s.exports,t.relative(r),s)),s.exports}t.modules={},t.aliases={},t.resolve=function(e){"/"===e.charAt(0)&&(e=e.slice(1));for(var n=e+"/index.js",o=[e,e+".js",e+".json",e+"/index.js",e+"/index.json"],r=0;o.length>r;r++){var e=o[r];if(t.modules.hasOwnProperty(e))return e}return t.aliases.hasOwnProperty(n)?t.aliases[n]:void 0},t.normalize=function(t,e){var n=[];if("."!=e.charAt(0))return e;t=t.split("/"),e=e.split("/");for(var o=0;e.length>o;++o)".."==e[o]?t.pop():"."!=e[o]&&""!=e[o]&&n.push(e[o]);return t.concat(n).join("/")},t.register=function(e,n){t.modules[e]=n},t.alias=function(e,n){if(!t.modules.hasOwnProperty(e))throw Error('Failed to alias "'+e+'", it does not exist');t.aliases[n]=e},t.relative=function(e){function n(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function o(n){var r=o.resolve(n);return t(r,e,n)}var r=t.normalize(e,"..");return o.resolve=function(o){var i=o.charAt(0);if("/"==i)return o.slice(1);if("."==i)return t.normalize(r,o);var s=e.split("/"),a=n(s,"deps")+1;return a||(a=0),o=s.slice(0,a+1).join("/")+"/deps/"+o},o.exists=function(e){return t.modules.hasOwnProperty(o.resolve(e))},o},t.register("LearnBoost-engine.io-protocol/lib/index.js",function(t,e){var n=e("./keys");t.protocol=2;var o=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},r=n(o),i={type:"error",data:"parser error"};t.encodePacket=function(t){var e=o[t.type];return void 0!==t.data&&(e+=t.data+""),""+e},t.decodePacket=function(t){var e=t.charAt(0);return Number(e)==e&&r[e]?t.length>1?{type:r[e],data:t.substring(1)}:{type:r[e]}:i},t.encodePayload=function(e){if(!e.length)return"0:";for(var n,o="",r=0,i=e.length;i>r;r++)n=t.encodePacket(e[r]),o+=n.length+":"+n;return o},t.decodePayload=function(e,n){var o;if(""==e)return n(i,0,1);for(var r,s,a="",c=0,p=e.length;p>c;c++){var u=e.charAt(c);if(":"!=u)a+=u;else{if(""==a||a!=(r=Number(a)))return n(i,0,1);if(s=e.substr(c+1,r),a!=s.length)return n(i,0,1);if(s.length){if(o=t.decodePacket(s),i.type==o.type&&i.data==o.data)return n(i,0,1);var l=n(o,c+r,p);if(!1===l)return}c+=r,a=""}}return""!=a?n(i,0,1):void 0}}),t.register("LearnBoost-engine.io-protocol/lib/keys.js",function(t,e,n){n.exports=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e}}),t.register("visionmedia-debug/index.js",function(t,e,n){n.exports="undefined"==typeof window?e("./lib/debug"):e("./debug")}),t.register("visionmedia-debug/debug.js",function(t,e,n){function o(t){return o.enabled(t)?function(e){var n=new Date,r=n-(o[t]||n);o[t]=n,e=t+" "+e+" +"+o.humanize(r),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}n.exports=o,o.names=[],o.skips=[],o.enable=function(t){try{localStorage.debug=t}catch(e){}for(var n=(t||"").split(/[\s,]+/),r=n.length,i=0;r>i;i++)t=n[i].replace("*",".*?"),"-"===t[0]?o.skips.push(RegExp("^"+t.substr(1)+"$")):o.names.push(RegExp("^"+t+"$"))},o.disable=function(){o.enable("")},o.humanize=function(t){var e=1e3,n=6e4,o=60*n;return t>=o?(t/o).toFixed(1)+"h":t>=n?(t/n).toFixed(1)+"m":t>=e?(0|t/e)+"s":t+"ms"},o.enabled=function(t){for(var e=0,n=o.skips.length;n>e;e++)if(o.skips[e].test(t))return!1;for(var e=0,n=o.names.length;n>e;e++)if(o.names[e].test(t))return!0;return!1},window.localStorage&&o.enable(localStorage.debug)}),t.register("LearnBoost-engine.io-client/lib/index.js",function(t,e,n){n.exports=e("./socket"),n.exports.parser=e("engine.io-parser")}),t.register("LearnBoost-engine.io-client/lib/socket.js",function(t,e,n){function o(t,e){if(!(this instanceof o))return new o(t,e);if(e=e||{},"object"==typeof t&&(e=t,t=null),t&&(t=i.parseUri(t),e.host=t.host,e.secure="https"==t.protocol||"wss"==t.protocol,e.port=t.port,t.query&&(e.query=t.query)),this.secure=null!=e.secure?e.secure:u.location&&"https:"==location.protocol,e.host){var n=e.host.split(":");e.hostname=n.shift(),n.length&&(e.port=n.pop())}this.hostname=e.hostname||(u.location?location.hostname:"localhost"),this.port=e.port||(u.location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=i.qsParse(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.timestampParam=e.timestampParam||"t",this.timestampRequests=!!e.timestampRequests,this.flashPath=e.flashPath||"",this.transports=e.transports||["polling","websocket","flashsocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=e.policyPort||843,this.open(),o.sockets.push(this),o.sockets.evs.emit("add",this)}function r(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var i=e("./util"),s=e("./transports"),a=e("./emitter"),c=e("debug")("engine-client:socket"),p=e("engine.io-parser");n.exports=o;var u=i.global();a(o.prototype),o.protocol=p.protocol,o.sockets=[],o.sockets.evs=new a,o.Socket=o,o.Transport=e("./transport"),o.Emitter=e("./emitter"),o.transports=e("./transports"),o.util=e("./util"),o.parser=e("engine.io-parser"),o.prototype.createTransport=function(t){c('creating transport "%s"',t);var e=r(this.query);e.EIO=p.protocol,e.transport=t,this.id&&(e.sid=this.id);var n=new s[t]({hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:e,forceJSONP:this.forceJSONP,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,flashPath:this.flashPath,policyPort:this.policyPort});return n},o.prototype.open=function(){this.readyState="opening";var t=this.createTransport(this.transports[0]);t.open(),this.setTransport(t)},o.prototype.setTransport=function(t){var e=this;this.transport&&(c("clearing existing transport"),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},o.prototype.probe=function(t){function e(e){if(!o){o=!0;var i=Error("probe error: "+e);i.transport=n.name,n.close(),n=null,c('probe transport "%s" failed because of error: %s',t,e),r.emit("error",i)}}c('probing transport "%s"',t);var n=this.createTransport(t,{probe:1}),o=!1,r=this;n.once("open",function(){o||(c('probe transport "%s" opened',t),n.send([{type:"ping",data:"probe"}]),n.once("packet",function(i){if(!o)if("pong"==i.type&&"probe"==i.data)c('probe transport "%s" pong',t),r.upgrading=!0,r.emit("upgrading",n),c('pausing current transport "%s"',r.transport.name),r.transport.pause(function(){o||"closed"!=r.readyState&&"closing"!=r.readyState&&(c("changing transport and sending upgrade packet"),n.removeListener("error",e),r.emit("upgrade",n),r.setTransport(n),n.send([{type:"upgrade"}]),n=null,r.upgrading=!1,r.flush())});else{c('probe transport "%s" failed',t);var s=Error("probe error");s.transport=n.name,r.emit("error",s)}}))}),n.once("error",e),n.open(),this.once("close",function(){n&&(c("socket closed prematurely - aborting probe"),o=!0,n.close(),n=null)}),this.once("upgrading",function(t){n&&t.name!=n.name&&(c('"%s" works - aborting "%s"',t.name,n.name),n.close(),n=null)})},o.prototype.onOpen=function(){if(c("socket open"),this.readyState="open",this.emit("open"),this.onopen&&this.onopen.call(this),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){c("starting upgrade probes");for(var t=0,e=this.upgrades.length;e>t;t++)this.probe(this.upgrades[t])}},o.prototype.onPacket=function(t){if("opening"==this.readyState||"open"==this.readyState)switch(c('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(i.parseJSON(t.data));break;case"pong":this.ping();break;case"error":var e=Error("server error");e.code=t.data,this.emit("error",e);break;case"message":this.emit("data",t.data),this.emit("message",t.data);var n={data:t.data};n.toString=function(){return t.data},this.onmessage&&this.onmessage.call(this,n)}else c('packet received with socket readyState "%s"',this.readyState)},o.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),this.ping(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat)},o.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!=e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},o.prototype.ping=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){c("writing ping packet - expecting pong within %sms",t.pingTimeout),t.sendPacket("ping"),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},o.prototype.onDrain=function(){this.callbacks(),this.writeBuffer.splice(0,this.prevBufferLen),this.callbackBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0==this.writeBuffer.length?this.emit("drain"):this.flush()},o.prototype.callbacks=function(){for(var t=0;this.prevBufferLen>t;t++)this.callbackBuffer[t]&&this.callbackBuffer[t]()},o.prototype.flush=function(){"closed"!=this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(c("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},o.prototype.write=o.prototype.send=function(t,e){return this.sendPacket("message",t,e),this},o.prototype.sendPacket=function(t,e,n){var o={type:t,data:e};this.emit("packetCreate",o),this.writeBuffer.push(o),this.callbackBuffer.push(n),this.flush()},o.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.onClose("forced close"),c("socket closing - telling transport to close"),this.transport.close(),this.transport.removeAllListeners()),this},o.prototype.onError=function(t){c("socket error %j",t),this.emit("error",t),this.onClose("transport error",t)},o.prototype.onClose=function(t,e){if("opening"==this.readyState||"open"==this.readyState){c('socket close with reason: "%s"',t);var n=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),setTimeout(function(){n.writeBuffer=[],n.callbackBuffer=[]},0),this.readyState="closed",this.emit("close",t,e),this.onclose&&this.onclose.call(this),this.id=null}},o.prototype.filterUpgrades=function(t){for(var e=[],n=0,o=t.length;o>n;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e}}),t.register("LearnBoost-engine.io-client/lib/transport.js",function(t,e,n){function o(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState=""}var r=(e("./util"),e("engine.io-parser")),i=e("./emitter");n.exports=o,i(o.prototype),o.prototype.onError=function(t,e){var n=Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},o.prototype.open=function(){return("closed"==this.readyState||""==this.readyState)&&(this.readyState="opening",this.doOpen()),this},o.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.doClose(),this.onClose()),this},o.prototype.send=function(t){if("open"!=this.readyState)throw Error("Transport not open");this.write(t)},o.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},o.prototype.onData=function(t){this.onPacket(r.decodePacket(t))},o.prototype.onPacket=function(t){this.emit("packet",t)},o.prototype.onClose=function(){this.readyState="closed",this.emit("close")}}),t.register("LearnBoost-engine.io-client/lib/emitter.js",function(t,e,n){var o=e("emitter");n.exports=o,o.prototype.addEventListener=o.prototype.on,o.prototype.removeEventListener=o.prototype.off,o.prototype.removeListener=o.prototype.off}),t.register("LearnBoost-engine.io-client/lib/util.js",function(t,e){var n=!1;t.global=function(){return"undefined"!=typeof window?window:global},t.inherits=function(t,e){function n(){}n.prototype=e.prototype,t.prototype=new n},t.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},t.on=function(t,e,n,o){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener&&t.addEventListener(e,n,o)},t.load=function(e){var o=t.global();return o.document&&"complete"===document.readyState||n?e():(t.on(o,"load",e,!1),void 0)},"undefined"!=typeof window&&t.load(function(){n=!0}),t.defer=function(e){return t.ua.webkit&&"undefined"==typeof importScripts?(t.load(function(){setTimeout(e,100)}),void 0):e()};var o=/^[\],:{}\s]*$/,r=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,s=/(?:^|:|,)(?:\s*\[)+/g,a=/^\s+/,c=/\s+$/;t.parseJSON=function(e){var n=t.global();return"string"==typeof e&&e?(e=e.replace(a,"").replace(c,""),n.JSON&&JSON.parse?JSON.parse(e):o.test(e.replace(r,"@").replace(i,"]").replace(s,""))?Function("return "+e)():void 0):null},t.ua={},t.ua.hasCORS="undefined"!=typeof XMLHttpRequest&&function(){var t;try{t=new XMLHttpRequest}catch(e){return!1}return void 0!=t.withCredentials}(),t.ua.webkit="undefined"!=typeof navigator&&/webkit/i.test(navigator.userAgent),t.ua.gecko="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent),t.ua.android="undefined"!=typeof navigator&&/android/i.test(navigator.userAgent),t.ua.ios="undefined"!=typeof navigator&&/^(iPad|iPhone|iPod)$/.test(navigator.platform),t.ua.ios6=t.ua.ios&&/OS 6_/.test(navigator.userAgent),t.request=function(n){try{var o=e("xmlhttprequest").XMLHttpRequest;return new o}catch(r){}if(n&&"undefined"!=typeof XDomainRequest&&!t.ua.hasCORS)return new XDomainRequest;try{if("undefined"!=typeof XMLHttpRequest&&(!n||t.ua.hasCORS))return new XMLHttpRequest}catch(r){}if(!n)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(r){}};var p=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,u=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.parseUri=function(t){for(var e=p.exec(t||""),n={},o=14;o--;)n[u[o]]=e[o]||"";return n},t.qs=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},t.qsParse=function(t){for(var e={},n=t.split("&"),o=0,r=n.length;r>o;o++){var i=n[o].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}}),t.register("LearnBoost-engine.io-client/lib/transports/index.js",function(t,e){function n(t){var e,n=!1,i=!1;if(c.location){var s="https:"==location.protocol,p=location.port;Number(p)!==p&&(p=s?443:80),n=t.hostname!=location.hostname||p!=t.port,i=t.secure!=s}return e=a.request(n),i&&c.XDomainRequest&&e instanceof c.XDomainRequest?new r(t):e&&!t.forceJSONP?new o(t):new r(t)}var o=e("./polling-xhr"),r=e("./polling-jsonp"),i=e("./websocket"),s=e("./flashsocket"),a=e("../util");t.polling=n,t.websocket=i,t.flashsocket=s;var c=a.global()}),t.register("LearnBoost-engine.io-client/lib/transports/polling.js",function(t,e,n){function o(t){r.call(this,t)}var r=e("../transport"),i=e("../util"),s=e("engine.io-parser"),a=e("debug")("engine.io-client:polling");n.exports=o;var c=i.global();i.inherits(o,r),o.prototype.name="polling",o.prototype.doOpen=function(){this.poll()},o.prototype.pause=function(t){function e(){a("paused"),n.readyState="paused",t()}var n=this;if(this.readyState="pausing",this.polling||!this.writable){var o=0;this.polling&&(a("we are currently polling - waiting to pause"),o++,this.once("pollComplete",function(){a("pre-pause polling complete"),--o||e()})),this.writable||(a("we are currently writing - waiting to pause"),o++,this.once("drain",function(){a("pre-pause writing complete"),--o||e()}))}else e()},o.prototype.poll=function(){a("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},o.prototype.onData=function(t){var e=this;a("polling got data %s",t),s.decodePayload(t,function(t){return"opening"==e.readyState&&e.onOpen(),"close"==t.type?(e.onClose(),!1):(e.onPacket(t),void 0)}),"closed"!=this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():a('ignoring poll - transport state "%s"',this.readyState))},o.prototype.doClose=function(){a("sending close packet"),this.send([{type:"close"}])},o.prototype.write=function(t){var e=this;this.writable=!1,this.doWrite(s.encodePayload(t),function(){e.writable=!0,e.emit("drain")})},o.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";return(c.ActiveXObject||i.ua.android||i.ua.ios6||this.timestampRequests)&&(t[this.timestampParam]=+new Date),t=i.qs(t),this.port&&("https"==e&&443!=this.port||"http"==e&&80!=this.port)&&(n=":"+this.port),t.length&&(t="?"+t),e+"://"+this.hostname+n+this.path+t}}),t.register("LearnBoost-engine.io-client/lib/transports/polling-xhr.js",function(t,e,n){function o(){}function r(t){if(s.call(this,t),u.location){var e="https:"==location.protocol,n=location.port;Number(n)!==n&&(n=e?443:80),this.xd=t.hostname!=u.location.hostname||n!=t.port}}function i(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.async=!1!==t.async,this.data=void 0!=t.data?t.data:null,this.create()}var s=e("./polling"),a=e("../util"),c=e("../emitter"),p=e("debug")("engine.io-client:polling-xhr");n.exports=r,n.exports.Request=i;var u=a.global(),l=u[["Active"].concat("Object").join("X")];a.inherits(r,s),r.prototype.doOpen=function(){var t=this;a.defer(function(){s.prototype.doOpen.call(t)})},r.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,new i(t)},r.prototype.doWrite=function(t,e){var n=this.request({method:"POST",data:t}),o=this;n.on("success",e),n.on("error",function(t){o.onError("xhr post error",t)}),this.sendXhr=n},r.prototype.doPoll=function(){p("xhr poll");var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},c(i.prototype),i.prototype.create=function(){var t=this.xhr=a.request(this.xd),e=this;if(t.open(this.method,this.uri,this.async),"POST"==this.method)try{t.setRequestHeader?t.setRequestHeader("Content-type","text/plain;charset=UTF-8"):t.contentType="text/plain"}catch(n){}this.xd&&u.XDomainRequest&&t instanceof XDomainRequest?(t.onerror=function(t){e.onError(t)},t.onload=function(){e.onData(t.responseText)},t.onprogress=o):("withCredentials"in t&&(t.withCredentials=!0),t.onreadystatechange=function(){var n;try{if(4!=t.readyState)return;200==t.status||1223==t.status?n=t.responseText:e.onError(t.status)}catch(o){e.onError(o)}void 0!==n&&e.onData(n)}),p("sending xhr with url %s | data %s",this.uri,this.data),t.send(this.data),l&&(this.index=i.requestsCount++,i.requests[this.index]=this)},i.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},i.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},i.prototype.onError=function(t){this.emit("error",t),this.cleanup()},i.prototype.cleanup=function(){if(void 0!==this.xhr){this.xhr.onreadystatechange=o,this.xhr.onload=this.xhr.onerror=o;try{this.xhr.abort()}catch(t){}l&&delete i.requests[this.index],this.xhr=null}},i.prototype.abort=function(){this.cleanup()},l&&(i.requestsCount=0,i.requests={},u.attachEvent("onunload",function(){for(var t in i.requests)i.requests.hasOwnProperty(t)&&i.requests[t].abort()}))}),t.register("LearnBoost-engine.io-client/lib/transports/polling-jsonp.js",function(t,e,n){function o(t){r.call(this,t),s||(a.___eio||(a.___eio=[]),s=a.___eio),this.index=s.length;var e=this;s.push(function(t){e.onData(t)}),this.query.j=this.index}var r=e("./polling"),i=e("../util");n.exports=o;var s,a=i.global(),c=/\n/g;i.inherits(o,r),o.prototype.doOpen=function(){var t=this;i.defer(function(){r.prototype.doOpen.call(t)})},o.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null),r.prototype.doClose.call(this)},o.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n),this.script=e,i.ua.gecko&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},o.prototype.doWrite=function(t,e){function n(){o(),e()}function o(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(t){r.onError("jsonp polling iframe removal error",t)}try{var e='<iframe src="javascript:0" name="'+r.iframeId+'">';i=document.createElement(e)}catch(t){i=document.createElement("iframe"),i.name=r.iframeId,i.src="javascript:0"}i.id=r.iframeId,r.form.appendChild(i),r.iframe=i}var r=this;if(!this.form){var i,s=document.createElement("form"),a=document.createElement("textarea"),p=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=p,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}this.form.action=this.uri(),o(),this.area.value=t.replace(c,"\\n");try{this.form.submit()}catch(u){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"==r.iframe.readyState&&n()}:this.iframe.onload=n}}),t.register("LearnBoost-engine.io-client/lib/transports/websocket.js",function(t,e,n){function o(t){i.call(this,t)}function r(){return"undefined"==typeof window?e("ws"):c.WebSocket||c.MozWebSocket}var i=e("../transport"),s=e("engine.io-parser"),a=e("../util");e("debug")("engine.io-client:websocket"),n.exports=o;var c=a.global();a.inherits(o,i),o.prototype.name="websocket",o.prototype.doOpen=function(){if(this.check()){var t=this;this.socket=new(r())(this.uri()),this.socket.onopen=function(){t.onOpen()},this.socket.onclose=function(){t.onClose()},this.socket.onmessage=function(e){t.onData(e.data)},this.socket.onerror=function(e){t.onError("websocket error",e)}}},o.prototype.write=function(t){function e(){n.writable=!0,n.emit("drain")}var n=this;this.writable=!1;for(var o=0,r=t.length;r>o;o++)this.socket.send(s.encodePacket(t[o]));"bufferedAmount"in this.socket?this.bufferedAmountId=setInterval(function(){0==n.socket.bufferedAmount&&(clearInterval(n.bufferedAmountId),e())},50):setTimeout(e,0)},o.prototype.onClose=function(){clearInterval(this.bufferedAmountId),i.prototype.onClose.call(this)},o.prototype.doClose=function(){this.socket!==void 0&&this.socket.close()},o.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",n="";return this.port&&("wss"==e&&443!=this.port||"ws"==e&&80!=this.port)&&(n=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=+new Date),t=a.qs(t),t.length&&(t="?"+t),e+"://"+this.hostname+n+this.path+t},o.prototype.check=function(){var t=r();return!(!t||"__initialize"in t&&this.name===o.prototype.name)}}),t.register("LearnBoost-engine.io-client/lib/transports/flashsocket.js",function(t,e,n){function o(t){s.call(this,t),this.flashPath=t.flashPath,this.policyPort=t.policyPort}function r(t,e){if(l[t])return e();var n=document.createElement("script"),o=!1;c('loading "%s"',t),n.onload=n.onreadystatechange=function(){if(!o&&!l[t]){var r=n.readyState;r&&"loaded"!=r&&"complete"!=r||(c('loaded "%s"',t),n.onload=n.onreadystatechange=null,o=!0,l[t]=!0,e())}},n.async=1,n.src=t;var r=document.getElementsByTagName("head")[0];r.insertBefore(n,r.firstChild)}function i(t,e){function n(o){return t[o]?(r(t[o],function(){n(++o)}),void 0):e()}n(0)}var s=e("./websocket"),a=e("../util"),c=e("debug")("engine.io-client:flashsocket");n.exports=o;var p=a.global(),u=p[["Active"].concat("Object").join("X")];a.inherits(o,s),o.prototype.name="flashsocket",o.prototype.doOpen=function(){function t(t){return function(){var e=Array.prototype.join.call(arguments," ");c("[websocketjs %s] %s",t,e)}}if(this.check()){WEB_SOCKET_LOGGER={log:t("debug"),error:t("error")},WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR=!0,WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0,"undefined"==typeof WEB_SOCKET_SWF_LOCATION&&(WEB_SOCKET_SWF_LOCATION=this.flashPath+"WebSocketMainInsecure.swf");var e=[this.flashPath+"web_socket.js"];"undefined"==typeof swfobject&&e.unshift(this.flashPath+"swfobject.js");var n=this;i(e,function(){n.ready(function(){WebSocket.__addTask(function(){s.prototype.doOpen.call(n)})})})}},o.prototype.doClose=function(){if(this.socket){var t=this;WebSocket.__addTask(function(){s.prototype.doClose.call(t)})}},o.prototype.write=function(){var t=this,e=arguments;WebSocket.__addTask(function(){s.prototype.write.apply(t,e)})},o.prototype.ready=function(t){function e(){o.loaded||(843!=n.policyPort&&WebSocket.loadFlashPolicyFile("xmlsocket://"+n.host+":"+n.policyPort),WebSocket.__initialize(),o.loaded=!0),t.call(n)}if("undefined"!=typeof WebSocket&&"__initialize"in WebSocket&&swfobject&&!(10>swfobject.getFlashPlayerVersion().major)){var n=this;return document.body?e():(a.load(e),void 0)}},o.prototype.check=function(){if("undefined"==typeof window)return!1;if("undefined"!=typeof WebSocket&&!("__initialize"in WebSocket))return!1;if(u){var t=null;try{t=new u("ShockwaveFlash.ShockwaveFlash")}catch(e){}if(t)return!0}else for(var n=0,o=navigator.plugins.length;o>n;n++)for(var r=0,i=navigator.plugins[n].length;i>r;r++)if("Shockwave Flash"==navigator.plugins[n][r].description)return!0;return!1};var l={}}),t.register("wearefractal-protosock/dist/main.js",function(t,e,n){(function(){var t,o,r,i,s,a;a=e("./util"),t=e("./Client"),r=e("./defaultClient"),s={createClientWrapper:function(t){return function(e){return s.createClient(t,e)}},createClient:function(e,n){var o;return o=a.mergePlugins(r,e),new t(o,n)}},("undefined"==typeof window||null===window)&&(o=e("./Server"),i=e("./defaultServer"),e("http").globalAgent.maxSockets=999,s.createServer=function(t,e,n){var r;return r=a.mergePlugins(i,e),new o(t,r,n)},s.createServerWrapper=function(t){return function(e,n){return s.createServer(e,t,n)}}),n.exports=s}).call(this)}),t.register("wearefractal-protosock/dist/Socket.js",function(t,e,n){(function(){var t;t={write:function(t){var e=this;return this.parent.outbound(this,t,function(t){return e.send(t)}),this},disconnect:function(t){return this.close(t),this}},n.exports=t}).call(this)}),t.register("wearefractal-protosock/dist/util.js",function(t,e,n){(function(){var t,o,r={}.hasOwnProperty,i=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s=[].slice;t=e("./Socket"),o={extendSocket:function(e){return i(e.prototype,t)},mergePlugins:function(){var t,e,n,r,i,a,c;for(t=arguments.length>=1?s.call(arguments,0):[],n={},a=0,c=t.length;c>a;a++){r=t[a];for(e in r)i=r[e],n[e]="object"==typeof i&&"server"!==e?o.mergePlugins(n[e],i):i}return n}},n.exports=o}).call(this)}),t.register("wearefractal-protosock/dist/defaultClient.js",function(t,e,n){(function(){var t;t={options:{},start:function(){},inbound:function(t,e,n){var o;try{o=JSON.parse(e)}catch(r){this.error(t,r)}n(o)},outbound:function(t,e,n){var o;try{o=JSON.stringify(e)}catch(r){this.error(t,r)}n(o)},validate:function(t,e,n){return n(!0)},invalid:function(){},connect:function(){},message:function(){},error:function(){},close:function(){}},"undefined"!=typeof window&&null!==window&&(t.options={host:window.location.hostname,port:window.location.port.length>0?parseInt(window.location.port):80,secure:"https:"===window.location.protocol},t.options.secure&&(t.options.port=443)),n.exports=t}).call(this)}),t.register("wearefractal-protosock/dist/Client.js",function(t,e,n){(function(){var t,o,r,i,s,a=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty,p=function(t,e){function n(){this.constructor=t}for(var o in e)c.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};s=e("./util"),"undefined"!=typeof window&&null!==window?(r=e("engine.io"),o=e("emitter")):(r=e("engine.io-client"),o=e("events").EventEmitter),s.extendSocket(r.Socket),i=function(t){return t>10?15e3:t>5?5e3:t>3?1e3:1e3},t=function(t){function e(t,e){var n,o,i,s,c,p,u,l,h;null==e&&(e={}),this.reconnect=a(this.reconnect,this),this.handleClose=a(this.handleClose,this),this.handleError=a(this.handleError,this),this.handleMessage=a(this.handleMessage,this),this.handleConnection=a(this.handleConnection,this);for(o in t)i=t[o],this[o]=i;for(o in e)i=e[o],this.options[o]=i;null==(u=(s=this.options).reconnect)&&(s.reconnect=!0),null==(l=(c=this.options).reconnectLimit)&&(c.reconnectLimit=1/0),null==(h=(p=this.options).reconnectTimeout)&&(p.reconnectTimeout=1/0),this.isServer=!1,this.isClient=!0,this.isBrowser="undefined"!=typeof window&&null!==window,n={host:this.options.host,port:this.options.port,secure:this.options.secure,path:"/"+this.options.namespace,resource:this.options.resource,transports:this.options.transports,upgrade:this.options.upgrade,flashPath:this.options.flashPath,policyPort:this.options.policyPort,forceJSONP:this.options.forceJSONP,forceBust:this.options.forceBust,debug:this.options.debug},this.ssocket=new r(n),this.ssocket.parent=this,this.ssocket.once("open",this.handleConnection),this.ssocket.on("error",this.handleError),this.ssocket.on("message",this.handleMessage),this.ssocket.on("close",this.handleClose),this.start()}return p(e,t),e.prototype.disconnect=function(){return this.ssocket.disconnect(),this},e.prototype.destroy=function(){return this.options.reconnect=!1,this.ssocket.disconnect(),this.emit("destroyed"),this},e.prototype.handleConnection=function(){return this.emit("connected"),this.connect(this.ssocket)},e.prototype.handleMessage=function(t){var e=this;return this.emit("inbound",this.ssocket,t),this.inbound(this.ssocket,t,function(t){return e.validate(e.ssocket,t,function(n){return n?(e.emit("message",e.ssocket,t),e.message(e.ssocket,t)):(e.emit("invalid",e.ssocket,t),e.invalid(e.ssocket,t))})})},e.prototype.handleError=function(t){return"string"==typeof t&&(t=Error(t)),this.error(this.ssocket,t)},e.prototype.handleClose=function(t){var e=this;if(!this.ssocket.reconnecting)return this.options.reconnect?this.reconnect(function(n){return null!=n?(e.emit("close",e.ssocket,t),e.close(e.ssocket,t)):void 0}):(this.emit("close",this.ssocket,t),this.close(this.ssocket,t))},e.prototype.reconnect=function(t){var e,n,o,r,s,a,c,p=this;return this.ssocket.reconnecting?t("Already reconnecting"):(this.ssocket.reconnecting=!0,"open"===this.ssocket.readyState&&this.ssocket.disconnect(),a=Date.now(),s=this.options.reconnectLimit,c=this.options.reconnectTimeout,e=0,o=function(){return p.ssocket.reconnecting=!1,p.emit("reconnected"),t()},r=function(e){return p.ssocket.reconnecting=!1,t(e)},this.ssocket.once("open",o),n=function(){return p.ssocket.reconnecting?e>=s?r("Exceeded max attempts"):Date.now()-a>c?r("Timeout on reconnect"):(e++,p.ssocket.open(),setTimeout(n,i(e))):void 0},setTimeout(n,i(e)))},e}(o),n.exports=t}).call(this)}),t.register("component-indexof/index.js",function(t,e,n){var o=[].indexOf;n.exports=function(t,e){if(o)return t.indexOf(e);for(var n=0;t.length>n;++n)if(t[n]===e)return n;return-1}}),t.register("component-emitter/index.js",function(t,e,n){function o(t){return t?r(t):void 0}function r(t){for(var e in o.prototype)t[e]=o.prototype[e];
return t}var i=e("indexof");n.exports=o,o.prototype.on=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},o.prototype.once=function(t,e){function n(){o.off(t,n),e.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},e._off=n,this.on(t,n),this},o.prototype.off=o.prototype.removeListener=o.prototype.removeAllListeners=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[t];if(!n)return this;if(1==arguments.length)return delete this._callbacks[t],this;var o=i(n,e._off||e);return~o&&n.splice(o,1),this},o.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks[t];if(n){n=n.slice(0);for(var o=0,r=n.length;r>o;++o)n[o].apply(this,e)}return this},o.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},o.prototype.hasListeners=function(t){return!!this.listeners(t).length}}),t.register("holla/dist/holla.js",function(t,e,n){(function(){var t,o,r,i,s;t=e("./Call"),s=e("./shims"),o=e("protosock"),r={options:{namespace:"holla",resource:"default",debug:!1},register:function(t,e){var n=this;return this.ssocket.write({type:"register",args:{name:t}}),this.once("register",function(o){return o&&(n.user=t,n.emit("authorized")),n.authorized=o,"function"==typeof e?e(o):void 0})},call:function(e){return new t(this,e,!0)},chat:function(t,e){return this.ssocket.write({type:"chat",to:t,args:{message:e}}),this},ready:function(t){return this.authorized?t():this.once("authorized",t),this},validate:function(t,e,n){if(this.options.debug&&console.log(e),"object"!=typeof e)return n(!1);if("string"!=typeof e.type)return n(!1);if("register"===e.type){if("object"!=typeof e.args)return n(!1);if("boolean"!=typeof e.args.result)return n(!1)}else if("offer"===e.type){if("string"!=typeof e.from)return n(!1)}else if("answer"===e.type){if("object"!=typeof e.args)return n(!1);if("string"!=typeof e.from)return n(!1);if("boolean"!=typeof e.args.accepted)return n(!1)}else if("sdp"===e.type){if("object"!=typeof e.args)return n(!1);if("string"!=typeof e.from)return n(!1);if(!e.args.sdp)return n(!1);if(!e.args.type)return n(!1)}else if("candidate"===e.type){if("object"!=typeof e.args)return n(!1);if("string"!=typeof e.from)return n(!1);if("object"!=typeof e.args.candidate)return n(!1)}else if("chat"===e.type){if("object"!=typeof e.args)return n(!1);if("string"!=typeof e.from)return n(!1);if("string"!=typeof e.args.message)return n(!1)}else if("hangup"===e.type){if("string"!=typeof e.from)return n(!1)}else{if("presence"!==e.type)return n(!1);if("object"!=typeof e.args)return n(!1);if("string"!=typeof e.args.name)return n(!1);if("boolean"!=typeof e.args.online)return n(!1)}return n(!0)},error:function(t,e){return this.emit("error",e,t)},message:function(e,n){var o;switch(n.type){case"register":return this.emit("register",n.args.result);case"offer":return o=new t(this,n.from,!1),this.emit("call",o);case"presence":return this.emit("presence",n.args),this.emit("presence."+n.args.name,n.args.online);case"chat":return this.emit("chat",{from:n.from,message:n.args.message}),this.emit("chat."+n.from,n.args.message);case"hangup":return this.emit("hangup",{from:n.from}),this.emit("hangup."+n.from);case"answer":return this.emit("answer",{from:n.from,accepted:n.args.accepted}),this.emit("answer."+n.from,n.args.accepted);case"candidate":return this.emit("candidate",{from:n.from,candidate:n.args.candidate}),this.emit("candidate."+n.from,n.args.candidate);case"sdp":return this.emit("sdp",{from:n.from,sdp:n.args.sdp,type:n.args.type}),this.emit("sdp."+n.from,n.args)}}},i={createClient:o.createClientWrapper(r),Call:t,supported:s.supported,config:s.PeerConnConfig,streamToBlob:function(t){return s.URL.createObjectURL(t)},pipe:function(t,e){var n;return n=i.streamToBlob(t),s.attachStream(n,e)},record:s.recordVideo,createStream:function(t,e){var n,o;return null==s.getUserMedia?e("Missing getUserMedia"):(n=e,o=function(t){return e(null,t)},s.getUserMedia(t,o,n),i)},createFullStream:function(t){return i.createStream({video:!0,audio:!0},t)},createVideoStream:function(t){return i.createStream({video:!0,audio:!1},t)},createAudioStream:function(t){return i.createStream({video:!1,audio:!0},t)}},n.exports=i}).call(this)}),t.register("holla/dist/Call.js",function(t,e,n){(function(){var t,o,r,i=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty,a=function(t,e){function n(){this.constructor=t}for(var o in e)s.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=e("./shims"),o=e("emitter"),t=function(t){function e(t,e,n){var o=this;this.parent=t,this.user=e,this.isCaller=n,this.initSDP=i(this.initSDP,this),this.unmute=i(this.unmute,this),this.mute=i(this.mute,this),this.end=i(this.end,this),this.releaseStream=i(this.releaseStream,this),this.decline=i(this.decline,this),this.answer=i(this.answer,this),this.chat=i(this.chat,this),this.duration=i(this.duration,this),this.ready=i(this.ready,this),this.addStream=i(this.addStream,this),this.createConnection=i(this.createConnection,this),this.processRemoteSDP=i(this.processRemoteSDP,this),this.startTime=new Date,this.socket=this.parent.ssocket,this.pc=this.createConnection(),this.isCaller&&this.socket.write({type:"offer",to:this.user}),this.emit("calling"),this.parent.on("answer."+this.user,function(t){return t?(o.emit("answered"),o.isCaller?o.initSDP():void 0):o.emit("rejected")}),this.parent.on("candidate."+this.user,function(t){return o.pc.addIceCandidate(new r.IceCandidate(t))}),this.parent.on("sdp."+this.user,this.processRemoteSDP),this.parent.on("hangup."+this.user,function(){return o.emit("hangup")}),this.parent.on("chat."+this.user,function(t){return o.emit("chat",t)})}return a(e,t),e.prototype.processRemoteSDP=function(t){var e,n,o=this;if(!this.pc.remoteDescription)return console.log(""+this.isCaller+" remote",t),t.sdp=r.processSDPIn(t.sdp),e=function(t){throw t},n=function(){return o.emit("sdp"),o.isCaller?void 0:o.initSDP()},this.pc.setRemoteDescription(new r.SessionDescription(t),n,e)},e.prototype.createConnection=function(){var t,e=this;return t=new r.PeerConnection(r.PeerConnConfig,r.constraints),t.onconnecting=function(){e.emit("connecting")},t.onopen=function(){e.emit("connected")},t.onicecandidate=function(t){t.candidate&&e.socket.write({type:"candidate",to:e.user,args:{candidate:t.candidate}})},t.onaddstream=function(t){e.remoteStream=t.stream,e._ready=!0,e.emit("ready",e.remoteStream)},t.onremovestream=function(t){console.log("removestream",t),e.end(),e.emit("hangup")},t},e.prototype.addStream=function(t){return this.localStream=t,this.pc.addStream(t),this},e.prototype.ready=function(t){return this._ready?t(this.remoteStream):this.once("ready",t),this},e.prototype.duration=function(){var t,e;return null!=this.endTime&&(e=this.endTime.getTime()),null==e&&(e=Date.now()),t=this.startTime.getTime(),(e-t)/1e3},e.prototype.chat=function(t){return this.parent.chat(this.user,t),this},e.prototype.answer=function(){return this.startTime=new Date,this.socket.write({type:"answer",to:this.user,args:{accepted:!0}}),this},e.prototype.decline=function(){return this.socket.write({type:"answer",to:this.user,args:{accepted:!1}}),this},e.prototype.releaseStream=function(){return this.localStream.stop()},e.prototype.end=function(){this.endTime=new Date;try{this.pc.close()}catch(t){}return this.socket.write({type:"hangup",to:this.user}),this.emit("hangup"),this},e.prototype.mute=function(){var t,e,n,o,r;for(o=this.localStream.getAudioTracks(),r=[],e=0,n=o.length;n>e;e++)t=o[e],r.push(t.enabled=!1);return r},e.prototype.unmute=function(){var t,e,n,o,r;for(o=this.localStream.getAudioTracks(),r=[],e=0,n=o.length;n>e;e++)t=o[e],r.push(t.enabled=!0);return r},e.prototype.initSDP=function(){var t,e,n=this;return t=function(t){return t.sdp=r.processSDPOut(t.sdp),console.log(""+n.isCaller+" local",t),n.pc.setLocalDescription(t),n.socket.write({type:"sdp",to:n.user,args:t})},e=function(t){throw t},this.isCaller?this.pc.createOffer(t,e,r.constraints):this.pc.remoteDescription?this.pc.createAnswer(t,e,r.constraints):this.once("sdp",function(){return n.pc.createAnswer(t,e,r.constraints)})},e}(o),n.exports=t}).call(this)}),t.register("holla/dist/shims.js",function(t,e,n){(function(){var t,e,o,r,i,s,a,c,p,u,l,h,d,f,m,g,y,v,w;o=window.mozRTCPeerConnection||window.PeerConnection||window.webkitPeerConnection00||window.webkitRTCPeerConnection,t=window.mozRTCIceCandidate||window.RTCIceCandidate,r=window.mozRTCSessionDescription||window.RTCSessionDescription,e=window.MediaStream||window.webkitMediaStream,p=navigator.mozGetUserMedia||navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia,i=window.URL||window.webkitURL||window.msURL||window.oURL,null!=p&&(p=p.bind(navigator)),a=navigator.mozGetUserMedia?"firefox":"chrome",v=null!=o&&null!=p,c=function(t,e){var n;return n=t.match(e),null!=n?n[1]:null},m=function(t,e){var n,o,r,i,s,a;for(o=t.split(" "),i=[],r=s=0,a=o.length;a>s;r=++s)n=o[r],3===r&&(i[r++]=e),n!==e&&(i[r++]=n);return i.join(" ")},f=function(t,e){var n,o,r,i,s,a,p;for(i=t[e].split(" "),o=a=0,p=t.length;p>a;o=++a)r=t[o],null!=r&&(s=c(r,/a=rtpmap:(\d+) CN\/\d+/i),null!=s&&(n=i.indexOf(s),-1!==n&&i.splice(n,1),t.splice(o,1)));return t[e]=i.join(" "),t},w=function(t){var e,n,o,r,i,s,a;if(o=t.split("\r\n"),r=function(){var t,r,i;for(i=[],e=t=0,r=o.length;r>t;e=++t)n=o[e],-1!==n.indexOf("m=audio")&&i.push(e);return i}()[0],null==r)return t;for(e=s=0,a=o.length;a>s;e=++s)if(n=o[e],-1!==n.indexOf("opus/48000")){i=c(n,/:(\d+) opus\/48000/i),null!=i&&(o[r]=m(o[r],i));break}return o=f(o,r),o.join("\r\n")},h=function(t){var e,n,o,r,i,s,c,p,u;if(o=[],"firefox"===a)for(e="a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:BAADBAADBAADBAADBAADBAADBAADBAADBAADBAAD",p=t.split("\r\n"),r=0,s=p.length;s>r;r++)n=p[r],o.push(n),0===n.indexOf("m=")&&o.push(e);else for(u=t.split("\r\n"),i=0,c=u.length;c>i;i++)n=u[i],-1===n.indexOf("a=ice-options:google-ice")&&o.push(n);return w(o.join("\r\n"))},l=function(t){return t},s=function(t,e){var n,o,r;if("string"==typeof e)return s(t,document.getElementById(e));if(e.jquery)for(e.attr("src",t),o=0,r=e.length;r>o;o++)n=e[o],n.play();else e.src=t,e.play();return e},g=function(t,e){var n,o;o=document.createElement("a"),o.href=e,o.target="_blank",o.download=t,n=document.createEvent("Event"),n.initEvent("click",!0,!0),o.dispatchEvent(n),i.revokeObjectURL(o.href)},u=function(t,e){var n;return n=new FileReader,n.readAsDataURL(t),n.onload=function(t){return e(t.target.result)}},d=function(t){var e,n,o,r,i,s,a,c,p,l,h;return t.jquery?(c=t.height(),h=t.width(),t=t[0]):(c=t.height,h=t.width),e=document.createElement("canvas"),o=e.getContext("2d"),e.width=h,e.height=c,i=[],a=function(){var n;n=requestAnimationFrame(a),o.drawImage(t,0,0,h,c),i.push(e.toDataURL("image/webp",1))},s=function(t){var e;return e=b.fromImageArray(i,1e3/60),u(e,t),n},l=function(t){return null==t&&(t="recording.webp"),s(function(e){return g(t,e)}),n},r=function(){return cancelAnimationFrame(p),n},p=requestAnimationFrame(a),n={save:l,getBlob:s,end:r}},y=function(){var n,c,f;if(v)return"firefox"===a?(n={iceServers:[{url:"stun:23.21.150.121"}]},c={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0,MozDontOfferDataChannel:!0}},e.prototype.getVideoTracks=function(){return[]},e.prototype.getAudioTracks=function(){return[]}):(n={iceServers:[{url:"stun:stun.l.google.com:19302"}]},c={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0},optional:[{DtlsSrtpKeyAgreement:!0}]},e.prototype.getVideoTracks||(e.prototype.getVideoTracks=function(){return this.videoTracks},e.prototype.getAudioTracks=function(){return this.audioTracks}),o.prototype.getLocalStreams||(o.prototype.getLocalStreams=function(){return this.localStreams},o.prototype.getRemoteStreams=function(){return this.remoteStreams})),f={PeerConnection:o,IceCandidate:t,SessionDescription:r,MediaStream:e,getUserMedia:p,URL:i,attachStream:s,processSDPIn:l,processSDPOut:h,PeerConnConfig:n,browser:a,supported:v,constraints:c,recordVideo:d,loadBlob:u,saveBlob:g}},function(){for(var t=0,e=["ms","moz","webkit","o"],n=0;e.length>n&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[e[n]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[n]+"CancelAnimationFrame"]||window[e[n]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e){var n=(new Date).getTime(),o=Math.max(0,16-(n-t)),r=window.setTimeout(function(){e(n+o)},o);return t=n+o,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var b=function(){function t(t){for(var e=t[0].width,n=t[0].height,r=t[0].duration,i=1;t.length>i;i++){if(t[i].width!=e)throw"Frame "+(i+1)+" has a different width";if(t[i].height!=n)throw"Frame "+(i+1)+" has a different height";if(0>t[i].duration)throw"Frame "+(i+1)+" has a weird duration";r+=t[i].duration}var s=0,t=[{id:440786851,data:[{data:1,id:17030},{data:1,id:17143},{data:4,id:17138},{data:8,id:17139},{data:"webm",id:17026},{data:2,id:17031},{data:2,id:17029}]},{id:408125543,data:[{id:357149030,data:[{data:1e6,id:2807729},{data:"whammy",id:19840},{data:"whammy",id:22337},{data:[].slice.call(new Uint8Array(new Float64Array([r]).buffer),0).map(function(t){return String.fromCharCode(t)}).reverse().join(""),id:17545}]},{id:374648427,data:[{id:174,data:[{data:1,id:215},{data:1,id:25541},{data:0,id:156},{data:"und",id:2274716},{data:"V_VP8",id:134},{data:"VP8",id:2459272},{data:1,id:131},{id:224,data:[{data:e,id:176},{data:n,id:186}]}]}]},{id:524531317,data:[{data:0,id:231}].concat(t.map(function(t){var e;e=t.data.slice(4);var n=Math.round(s);return e=[129,n>>8,255&n,128].map(function(t){return String.fromCharCode(t)}).join("")+e,s+=t.duration,{data:e,id:163}}))}]}];return o(t)}function e(t){for(var e=[];t>0;)e.push(255&t),t>>=8;return new Uint8Array(e.reverse())}function n(t){for(var e=[],t=(t.length%8?Array(9-t.length%8).join("0"):"")+t,n=0;t.length>n;n+=8)e.push(parseInt(t.substr(n,8),2));return new Uint8Array(e)}function o(t){for(var r=[],i=0;t.length>i;i++){var s=t[i].data;if("object"==typeof s&&(s=o(s)),"number"==typeof s&&(s=n(s.toString(2))),"string"==typeof s){for(var a=new Uint8Array(s.length),c=0;s.length>c;c++)a[c]=s.charCodeAt(c);s=a}c=s.size||s.byteLength,a=Math.ceil(Math.ceil(Math.log(c)/Math.log(2))/8),c=c.toString(2),c=Array(7*a+8-c.length).join("0")+c,a=Array(a).join("0")+"1"+c,r.push(e(t[i].id)),r.push(n(a)),r.push(s)}return new Blob(r,{type:"video/webm"})}function r(t){for(var e=t.RIFF[0].WEBP[0],n=e.indexOf("*"),o=0,r=[];4>o;o++)r[o]=e.charCodeAt(n+3+o);return o=r[1]<<8|r[0],n=16383&o,o=r[3]<<8|r[2],{width:n,height:16383&o,data:e,riff:t}}function i(t){for(var e=0,n={};t.length>e;){var o=t.substr(e,4),r=parseInt(t.substr(e+4,4).split("").map(function(t){return t=t.charCodeAt(0).toString(2),Array(8-t.length+1).join("0")+t}).join(""),2),s=t.substr(e+4+4,r),e=e+(8+r);n[o]=n[o]||[],"RIFF"==o||"LIST"==o?n[o].push(i(s)):n[o].push(s)}return n}function s(t,e){this.frames=[],this.duration=1e3/t,this.quality=e||.8}return s.prototype.add=function(t,e){if(e!==void 0&&this.duration)throw"you can't pass a duration if the fps is set";if(e===void 0&&!this.duration)throw"if you don't have the fps set, you ned to have durations here.";if(t.canvas&&(t=t.canvas),t.toDataURL)t=t.toDataURL("image/webp",this.quality);else if("string"!=typeof t)throw"frame must be a a HTMLCanvasElement, a CanvasRenderingContext2D or a DataURI formatted string";if(!/^data:image\/webp;base64,/gi.test(t))throw"Input must be formatted properly as a base64 encoded DataURI of type image/webp";this.frames.push({image:t,duration:e||this.duration})},s.prototype.compile=function(){return new t(this.frames.map(function(t){var e=r(i(atob(t.image.slice(23))));return e.duration=t.duration,e}))},{Video:s,fromImageArray:function(e,n){return t(e.map(function(t){return t=r(i(atob(t.slice(23)))),t.duration=1e3/n,t}))},toWebM:t}}();n.exports=y()}).call(this)}),t.alias("wearefractal-protosock/dist/main.js","holla/deps/protosock/dist/main.js"),t.alias("wearefractal-protosock/dist/Socket.js","holla/deps/protosock/dist/Socket.js"),t.alias("wearefractal-protosock/dist/util.js","holla/deps/protosock/dist/util.js"),t.alias("wearefractal-protosock/dist/defaultClient.js","holla/deps/protosock/dist/defaultClient.js"),t.alias("wearefractal-protosock/dist/Client.js","holla/deps/protosock/dist/Client.js"),t.alias("wearefractal-protosock/dist/main.js","holla/deps/protosock/index.js"),t.alias("component-emitter/index.js","wearefractal-protosock/deps/emitter/index.js"),t.alias("component-indexof/index.js","component-emitter/deps/indexof/index.js"),t.alias("LearnBoost-engine.io-client/lib/index.js","wearefractal-protosock/deps/engine.io/lib/index.js"),t.alias("LearnBoost-engine.io-client/lib/socket.js","wearefractal-protosock/deps/engine.io/lib/socket.js"),t.alias("LearnBoost-engine.io-client/lib/transport.js","wearefractal-protosock/deps/engine.io/lib/transport.js"),t.alias("LearnBoost-engine.io-client/lib/emitter.js","wearefractal-protosock/deps/engine.io/lib/emitter.js"),t.alias("LearnBoost-engine.io-client/lib/util.js","wearefractal-protosock/deps/engine.io/lib/util.js"),t.alias("LearnBoost-engine.io-client/lib/transports/index.js","wearefractal-protosock/deps/engine.io/lib/transports/index.js"),t.alias("LearnBoost-engine.io-client/lib/transports/polling.js","wearefractal-protosock/deps/engine.io/lib/transports/polling.js"),t.alias("LearnBoost-engine.io-client/lib/transports/polling-xhr.js","wearefractal-protosock/deps/engine.io/lib/transports/polling-xhr.js"),t.alias("LearnBoost-engine.io-client/lib/transports/polling-jsonp.js","wearefractal-protosock/deps/engine.io/lib/transports/polling-jsonp.js"),t.alias("LearnBoost-engine.io-client/lib/transports/websocket.js","wearefractal-protosock/deps/engine.io/lib/transports/websocket.js"),t.alias("LearnBoost-engine.io-client/lib/transports/flashsocket.js","wearefractal-protosock/deps/engine.io/lib/transports/flashsocket.js"),t.alias("LearnBoost-engine.io-client/lib/index.js","wearefractal-protosock/deps/engine.io/index.js"),t.alias("component-emitter/index.js","LearnBoost-engine.io-client/deps/emitter/index.js"),t.alias("component-indexof/index.js","component-emitter/deps/indexof/index.js"),t.alias("LearnBoost-engine.io-protocol/lib/index.js","LearnBoost-engine.io-client/deps/engine.io-parser/lib/index.js"),t.alias("LearnBoost-engine.io-protocol/lib/keys.js","LearnBoost-engine.io-client/deps/engine.io-parser/lib/keys.js"),t.alias("LearnBoost-engine.io-protocol/lib/index.js","LearnBoost-engine.io-client/deps/engine.io-parser/index.js"),t.alias("LearnBoost-engine.io-protocol/lib/index.js","LearnBoost-engine.io-protocol/index.js"),t.alias("visionmedia-debug/index.js","LearnBoost-engine.io-client/deps/debug/index.js"),t.alias("visionmedia-debug/debug.js","LearnBoost-engine.io-client/deps/debug/debug.js"),t.alias("LearnBoost-engine.io-client/lib/index.js","LearnBoost-engine.io-client/index.js"),t.alias("wearefractal-protosock/dist/main.js","wearefractal-protosock/index.js"),t.alias("component-emitter/index.js","holla/deps/emitter/index.js"),t.alias("component-indexof/index.js","component-emitter/deps/indexof/index.js"),t.alias("holla/dist/holla.js","holla/index.js"),"object"==typeof exports?module.exports=t("holla"):"function"==typeof define&&define.amd?define(function(){return t("holla")}):window.holla=t("holla")})();