-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdisplay.e56fc128.js
132 lines (129 loc) · 99.5 KB
/
display.e56fc128.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({"WoD8":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=function(){function r(){}return r.randColor=function(){return"hsl("+Math.floor(360*Math.random())+", 90%, 50%)"},r}();exports.Utils=r;
},{}],"S1TJ":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./Utils"),r=function(){function r(t){this.minTimePerFrame=0,this.borderColors=[],this.lastUpdated=Date.now(),this.ctx=t,this.randomizeBorderColors()}return r.prototype.update=function(){Date.now()-this.lastUpdated>this.minTimePerFrame&&(this.advanceFrame(),this.draw(),this.lastUpdated=Date.now())},r.prototype.advanceFrame=function(){},r.prototype.start=function(){},r.prototype.fillScreen=function(t){this.ctx.g2D.fillStyle=t,this.ctx.g2D.fillRect(0,0,this.ctx.width,this.ctx.height)},r.prototype.drawSquare=function(t,r){this.ctx.g2D.fillStyle=r,this.ctx.g2D.fillRect(t[1]*this.ctx.tileSize,t[0]*this.ctx.tileSize,this.ctx.tileSize,this.ctx.tileSize)},r.prototype.drawArt=function(t,r,o,e){for(var i=0;i<t.length;i++)for(var s=0;s<t[i].length;s++)" "!==t[i][s]&&this.drawSquare([r+i,o+s],e)},r.prototype.drawCenteredArt=function(t,r){var o=(this.ctx.rows-t.length)/2,e=(this.ctx.cols-t[0].length)/2;this.drawArt(t,o,e,r)},r.prototype.randomizeBorderColors=function(){for(var r=0,o=0;o<this.ctx.rows;o++,r+=2)this.borderColors[r]=t.Utils.randColor(),this.borderColors[r+1]=t.Utils.randColor();for(var e=0;e<this.ctx.cols;e++,r+=2)this.borderColors[r]=t.Utils.randColor(),this.borderColors[r+1]=t.Utils.randColor()},r.prototype.drawBorder=function(t){void 0===t&&(t="checker");for(var r=0,o=0;o<this.ctx.rows;o++,r+=2){var e=void 0,i=void 0;"colorful"===t?(e=this.borderColors[r],i=this.borderColors[r+1]):"checker"===t?(e=o%2?"grey":"lightgrey",i=(this.ctx.cols-1+o)%2?"grey":"lightgrey"):e=i=t,this.drawSquare([o,0],e),this.drawSquare([o,this.ctx.cols-1],i)}for(var s=0;s<this.ctx.cols;s++,r+=2){e=void 0,i=void 0;"colorful"===t?(e=this.borderColors[r],i=this.borderColors[r+1]):"checker"===t?(e=s%2?"grey":"lightgrey",i=(this.ctx.rows-1+s)%2?"grey":"lightgrey"):e=i=t,this.drawSquare([0,s],e),this.drawSquare([this.ctx.rows-1,s],i)}},r.prototype.drawText=function(t,r,o,e,i){var s=this.ctx.g2D;s.font=i+"px monospace",s.textBaseline="top",s.fillStyle=e,s.fillText(t,r,o)},r}();exports.GameState=r;
},{"./Utils":"WoD8"}],"AUT8":[function(require,module,exports) {
"use strict";var o=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./GameState"),e=function(t){function e(o){var e=t.call(this,o)||this;return e.gameOverArt=["ooooo ooooo ","o o o ","o oooo ooooo oooo o o o o oooo oooo","o oo o o o o o o o o o o o o o ","o o oooo o o o oooo o o o o oooo o ","o o o o o o o o o o o o o o ","ooooo oooo o o o oooo ooooo o oooo o "],e}return o(e,t),e.prototype.advanceFrame=function(){},e.prototype.draw=function(){this.fillScreen("black"),this.drawBorder("red");for(var o=0,t=this.snake;o<t.length;o++){var e=t[o];this.drawSquare(e,"darkred")}this.drawCenteredArt(this.gameOverArt,"red")},e.prototype.start=function(){this.snake=this.ctx.sharedData,setTimeout(function(){location.reload(!0)},3e3)},e.Name="game over",e}(t.GameState);exports.GameOverScreen=e;
},{"./GameState":"S1TJ"}],"dDLu":[function(require,module,exports) {
"use strict";var t=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])};return function(r,s){function e(){this.constructor=r}t(r,s),r.prototype=null===s?Object.create(s):(e.prototype=s.prototype,new e)}}();Object.defineProperty(exports,"__esModule",{value:!0});var r=require("./GameOverScreen"),s=require("./GameState"),e=require("./Utils"),i=function(s){function i(){var t=null!==s&&s.apply(this,arguments)||this;return t.forbidden={d:"u",l:"r",r:"l",u:"d"},t}return t(i,s),i.prototype.advanceFrame=function(){var t=this.snake[this.snake.length-1].slice(),r="u"===this.direction||"d"===this.direction,s="r"===this.direction||"d"===this.direction;if(t[r?0:1]+=s?1:-1,0!==t[0]&&t[0]!==this.ctx.rows-1&&0!==t[1]&&t[1]!==this.ctx.cols-1){for(var i=0;i<this.snake.length-1;i++)if(this.sameloc(this.snake[i],t))return void this.die();this.snake.push(t),this.lastMove=this.direction;var o=!1;for(i=0;i<this.powerups.length;i++)this.sameloc(t,this.powerups[i])&&(this.snakeColors[this.snake.length-1]=this.powerupColors[i],this.powerups[i]=this.randloc(),this.powerupColors[i]=e.Utils.randColor(),this.minTimePerFrame>50&&(this.minTimePerFrame-=25),o=!0);o||this.snake.shift()}else this.die()},i.prototype.draw=function(){this.fillScreen("black"),this.drawBorder("#F66733");for(var t=0;t<this.snake.length;t++)this.drawSquare(this.snake[t],this.snakeColors[t]);for(t=0;t<this.powerups.length;t++)this.drawSquare(this.powerups[t],this.powerupColors[t])},i.prototype.start=function(){var t=this;this.minTimePerFrame=200,this.snake=[[Math.floor(this.ctx.rows/2),Math.floor(this.ctx.cols/2)]],this.snakeColors=[e.Utils.randColor()],this.direction="l",this.powerups=[this.randloc()],this.powerupColors=[e.Utils.randColor()];for(var r=0;r<4;r++)this.powerups.push(this.randloc()),this.powerupColors.push(e.Utils.randColor());this.ctx.io.addListener(function(r,s){r===t.ctx.sharedData&&(console.log(s),s&&t.forbidden[t.lastMove]!==s&&(t.direction=s))})},i.prototype.randi=function(t,r){return Math.floor(t+(r-t+1)*Math.random())},i.prototype.sameloc=function(t,r){return t[0]===r[0]&&t[1]===r[1]},i.prototype.randloc=function(){for(var t=[this.randi(1,this.ctx.rows-2),this.randi(1,this.ctx.cols-2)],r=0,s=this.snake;r<s.length;r++){var e=s[r];if(this.sameloc(t,e))return this.randloc()}return t},i.prototype.die=function(){this.ctx.io.sendMessage(this.ctx.sharedData,"stop-playing"),this.ctx.sharedData=this.snake,this.ctx.switchState(r.GameOverScreen.Name)},i.Name="play",i}(s.GameState);exports.PlayScreen=i;
},{"./GameOverScreen":"AUT8","./GameState":"S1TJ","./Utils":"WoD8"}],"t8a0":[function(require,module,exports) {
"use strict";var t=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var e in o)o.hasOwnProperty(e)&&(t[e]=o[e])};return function(o,e){function r(){this.constructor=o}t(o,e),o.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var o=require("./GameState"),e=require("./PlayScreen"),r=function(o){function r(){var t=null!==o&&o.apply(this,arguments)||this;return t.numberArt=[["oooo"," o"," o","oooo"," o"," o","oooo"],["oooo"," o"," o","oooo","o ","o ","oooo"],[" o ","oo "," o "," o "," o "," o ","ooo"]],t.currentArt=0,t.offset=0,t}return t(r,o),r.prototype.advanceFrame=function(){var t=Math.floor((Date.now()-this.startTime)/1e3);t>2?this.ctx.switchState(e.PlayScreen.Name):this.currentArt=t,this.offset+=1},r.prototype.draw=function(){for(var t=this.ctx.g2D,o=0;o<this.ctx.rows;o++)for(var e=0;e<this.ctx.cols;e++){var r=(o-this.ctx.rows/2)/2,i=(e-this.ctx.cols/2)/2;t.fillStyle="hsl("+Math.floor(this.offset+10*Math.sqrt(r*r+i*i))+",80%,50%)",t.fillRect(e*this.ctx.tileSize,o*this.ctx.tileSize,10,10)}t.fillStyle="black",t.beginPath(),t.arc(this.ctx.width/2,this.ctx.height/2,24,0,2*Math.PI,!1),t.fill(),this.drawCenteredArt(this.numberArt[this.currentArt],"white")},r.prototype.start=function(){this.startTime=Date.now()},r.Name="count down",r}(o.GameState);exports.CountDownScreen=r;
},{"./GameState":"S1TJ","./PlayScreen":"dDLu"}],"wREK":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){function t(t){this.stateSwitcher=t,this.rows=18,this.cols=157,this.tileSize=4,this.width=this.cols*this.tileSize,this.height=this.rows*this.tileSize}return t.prototype.switchState=function(t){this.stateSwitcher(t,this)},t}();exports.GameContext=t;
},{}],"966K":[function(require,module,exports) {
var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];module.exports=function(t){var s=t,o=t.indexOf("["),a=t.indexOf("]");-1!=o&&-1!=a&&(t=t.substring(0,o)+t.substring(o,a).replace(/:/g,";")+t.substring(a,t.length));for(var u=r.exec(t||""),i={},h=14;h--;)i[e[h]]=u[h]||"";return-1!=o&&-1!=a&&(i.source=s,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i};
},{}],"umfd":[function(require,module,exports) {
var s=1e3,e=60*s,r=60*e,a=24*r,n=365.25*a;function c(c){if(!((c=String(c)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(c);if(t){var i=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*n;case"days":case"day":case"d":return i*a;case"hours":case"hour":case"hrs":case"hr":case"h":return i*r;case"minutes":case"minute":case"mins":case"min":case"m":return i*e;case"seconds":case"second":case"secs":case"sec":case"s":return i*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function t(n){return n>=a?Math.round(n/a)+"d":n>=r?Math.round(n/r)+"h":n>=e?Math.round(n/e)+"m":n>=s?Math.round(n/s)+"s":n+"ms"}function i(n){return o(n,a,"day")||o(n,r,"hour")||o(n,e,"minute")||o(n,s,"second")||n+" ms"}function o(s,e,r){if(!(s<e))return s<1.5*e?Math.floor(s/e)+" "+r:Math.ceil(s/e)+" "+r+"s"}module.exports=function(s,e){e=e||{};var r=typeof s;if("string"===r&&s.length>0)return c(s);if("number"===r&&!1===isNaN(s))return e.long?i(s):t(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))};
},{}],"QpVL":[function(require,module,exports) {
function e(e){var r,s=0;for(r in e)s=(s<<5)-s+e.charCodeAt(r),s|=0;return exports.colors[Math.abs(s)%exports.colors.length]}function r(r){var t;function o(){if(o.enabled){var e=o,r=+new Date,s=r-(t||r);e.diff=s,e.prev=t,e.curr=r,t=r;for(var n=new Array(arguments.length),p=0;p<n.length;p++)n[p]=arguments[p];n[0]=exports.coerce(n[0]),"string"!=typeof n[0]&&n.unshift("%O");var a=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,function(r,s){if("%%"===r)return r;a++;var t=exports.formatters[s];if("function"==typeof t){var o=n[a];r=t.call(e,o),n.splice(a,1),a--}return r}),exports.formatArgs.call(e,n),(o.log||exports.log||console.log.bind(console)).apply(e,n)}}return o.namespace=r,o.enabled=exports.enabled(r),o.useColors=exports.useColors(),o.color=e(r),o.destroy=s,"function"==typeof exports.init&&exports.init(o),exports.instances.push(o),o}function s(){var e=exports.instances.indexOf(this);return-1!==e&&(exports.instances.splice(e,1),!0)}function t(e){var r;exports.save(e),exports.names=[],exports.skips=[];var s=("string"==typeof e?e:"").split(/[\s,]+/),t=s.length;for(r=0;r<t;r++)s[r]&&("-"===(e=s[r].replace(/\*/g,".*?"))[0]?exports.skips.push(new RegExp("^"+e.substr(1)+"$")):exports.names.push(new RegExp("^"+e+"$")));for(r=0;r<exports.instances.length;r++){var o=exports.instances[r];o.enabled=exports.enabled(o.namespace)}}function o(){exports.enable("")}function n(e){if("*"===e[e.length-1])return!0;var r,s;for(r=0,s=exports.skips.length;r<s;r++)if(exports.skips[r].test(e))return!1;for(r=0,s=exports.names.length;r<s;r++)if(exports.names[r].test(e))return!0;return!1}function p(e){return e instanceof Error?e.stack||e.message:e}exports=module.exports=r.debug=r.default=r,exports.coerce=p,exports.disable=o,exports.enable=t,exports.enabled=n,exports.humanize=require("ms"),exports.instances=[],exports.names=[],exports.skips=[],exports.formatters={};
},{"ms":"umfd"}],"qC85":[function(require,module,exports) {
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],"zvTR":[function(require,module,exports) {
var process = require("process");
var e=require("process");function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function C(e){var o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+exports.humanize(this.diff),o){var C="color: "+this.color;e.splice(1,0,C,"color: inherit");var t=0,r=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(t++,"%c"===e&&(r=t))}),e.splice(r,0,C)}}function t(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function r(e){try{null==e?exports.storage.removeItem("debug"):exports.storage.debug=e}catch(e){}}function n(){var o;try{o=exports.storage.debug}catch(e){}return!o&&void 0!==e&&"env"in e&&(o=void 0),o}function F(){try{return window.localStorage}catch(e){}}exports=module.exports=require("./debug"),exports.log=t,exports.formatArgs=C,exports.save=r,exports.load=n,exports.useColors=o,exports.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:F(),exports.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},exports.enable(n());
},{"./debug":"QpVL","process":"qC85"}],"vmAD":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],o=require("parseuri"),r=require("debug")("socket.io-client:url");function p(p,s){var e=p;s=s||t.location,null==p&&(p=s.protocol+"//"+s.host),"string"==typeof p&&("/"===p.charAt(0)&&(p="/"===p.charAt(1)?s.protocol+p:s.host+p),/^(https?|wss?):\/\//.test(p)||(r("protocol-less url %s",p),p=void 0!==s?s.protocol+"//"+p:"https://"+p),r("parse %s",p),e=o(p)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";var l=-1!==e.host.indexOf(":")?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+l+":"+e.port,e.href=e.protocol+"://"+l+(s&&s.port===e.port?"":":"+e.port),e}module.exports=p;
},{"parseuri":"966K","debug":"zvTR"}],"B9tp":[function(require,module,exports) {
function t(t){if(t)return e(t)}function e(e){for(var s in t.prototype)e[s]=t.prototype[s];return e}"undefined"!=typeof module&&(module.exports=t),t.prototype.on=t.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},t.prototype.once=function(t,e){function s(){this.off(t,s),e.apply(this,arguments)}return s.fn=e,this.on(t,s),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s,i=this._callbacks["$"+t];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r=0;r<i.length;r++)if((s=i[r])===e||s.fn===e){i.splice(r,1);break}return this},t.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),s=this._callbacks["$"+t];if(s)for(var i=0,r=(s=s.slice(0)).length;i<r;++i)s[i].apply(this,e);return this},t.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},t.prototype.hasListeners=function(t){return!!this.listeners(t).length};
},{}],"Gi+N":[function(require,module,exports) {
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
},{}],"r1JP":[function(require,module,exports) {
var global = arguments[3];
var f=arguments[3];module.exports=n;var r="function"==typeof f.Buffer&&"function"==typeof f.Buffer.isBuffer,e="function"==typeof f.ArrayBuffer,u=e&&"function"==typeof f.ArrayBuffer.isView?f.ArrayBuffer.isView:function(r){return r.buffer instanceof f.ArrayBuffer};function n(n){return r&&f.Buffer.isBuffer(n)||e&&(n instanceof f.ArrayBuffer||u(n))}
},{}],"KqqY":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3],t=require("isarray"),r=require("./is-buffer"),n=Object.prototype.toString,o="function"==typeof e.Blob||"[object BlobConstructor]"===n.call(e.Blob),a="function"==typeof e.File||"[object FileConstructor]"===n.call(e.File);function f(e,n){if(!e)return e;if(r(e)){var o={_placeholder:!0,num:n.length};return n.push(e),o}if(t(e)){for(var a=new Array(e.length),i=0;i<e.length;i++)a[i]=f(e[i],n);return a}if("object"==typeof e&&!(e instanceof Date)){a={};for(var u in e)a[u]=f(e[u],n);return a}return e}function i(e,r){if(!e)return e;if(e&&e._placeholder)return r[e.num];if(t(e))for(var n=0;n<e.length;n++)e[n]=i(e[n],r);else if("object"==typeof e)for(var o in e)e[o]=i(e[o],r);return e}exports.deconstructPacket=function(e){var t=[],r=e.data,n=e;return n.data=f(r,t),n.attachments=t.length,{packet:n,buffers:t}},exports.reconstructPacket=function(e,t){return e.data=i(e.data,t),e.attachments=void 0,e},exports.removeBlobs=function(e,n){var f=0,i=e;!function e(u,c,l){if(!u)return u;if(o&&u instanceof Blob||a&&u instanceof File){f++;var s=new FileReader;s.onload=function(){l?l[c]=this.result:i=this.result,--f||n(i)},s.readAsArrayBuffer(u)}else if(t(u))for(var p=0;p<u.length;p++)e(u[p],p,u);else if("object"==typeof u&&!r(u))for(var b in u)e(u[b],b,u)}(i),f||n(i)};
},{"isarray":"Gi+N","./is-buffer":"r1JP"}],"waZo":[function(require,module,exports) {
var t=require("debug")("socket.io-parser"),r=require("component-emitter"),e=require("./binary"),n=require("isarray"),o=require("./is-buffer");function s(){}exports.protocol=4,exports.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],exports.CONNECT=0,exports.DISCONNECT=1,exports.EVENT=2,exports.ACK=3,exports.ERROR=4,exports.BINARY_EVENT=5,exports.BINARY_ACK=6,exports.Encoder=s,exports.Decoder=p;var i=exports.ERROR+'"encode error"';function c(r){var e=""+r.type;if(exports.BINARY_EVENT!==r.type&&exports.BINARY_ACK!==r.type||(e+=r.attachments+"-"),r.nsp&&"/"!==r.nsp&&(e+=r.nsp+","),null!=r.id&&(e+=r.id),null!=r.data){var n=a(r.data);if(!1===n)return i;e+=n}return t("encoded %j as %s",r,e),e}function a(t){try{return JSON.stringify(t)}catch(t){return!1}}function u(t,r){e.removeBlobs(t,function(t){var n=e.deconstructPacket(t),o=c(n.packet),s=n.buffers;s.unshift(o),r(s)})}function p(){this.reconstructor=null}function f(r){var e=0,o={type:Number(r.charAt(0))};if(null==exports.types[o.type])return N("unknown packet type "+o.type);if(exports.BINARY_EVENT===o.type||exports.BINARY_ACK===o.type){for(var s="";"-"!==r.charAt(++e)&&(s+=r.charAt(e),e!=r.length););if(s!=Number(s)||"-"!==r.charAt(e))throw new Error("Illegal attachments");o.attachments=Number(s)}if("/"===r.charAt(e+1))for(o.nsp="";++e;){if(","===(c=r.charAt(e)))break;if(o.nsp+=c,e===r.length)break}else o.nsp="/";var i=r.charAt(e+1);if(""!==i&&Number(i)==i){for(o.id="";++e;){var c;if(null==(c=r.charAt(e))||Number(c)!=c){--e;break}if(o.id+=r.charAt(e),e===r.length)break}o.id=Number(o.id)}if(r.charAt(++e)){var a=h(r.substr(e));if(!(!1!==a&&(o.type===exports.ERROR||n(a))))return N("invalid payload");o.data=a}return t("decoded %s as %j",r,o),o}function h(t){try{return JSON.parse(t)}catch(t){return!1}}function d(t){this.reconPack=t,this.buffers=[]}function N(t){return{type:exports.ERROR,data:"parser error: "+t}}s.prototype.encode=function(r,e){(t("encoding packet %j",r),exports.BINARY_EVENT===r.type||exports.BINARY_ACK===r.type)?u(r,e):e([c(r)])},r(p.prototype),p.prototype.add=function(t){var r;if("string"==typeof t)r=f(t),exports.BINARY_EVENT===r.type||exports.BINARY_ACK===r.type?(this.reconstructor=new d(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!o(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(r=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,this.emit("decoded",r))}},p.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},d.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var r=e.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null},d.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]};
},{"debug":"zvTR","component-emitter":"B9tp","./binary":"KqqY","isarray":"Gi+N","./is-buffer":"r1JP"}],"Qc5Z":[function(require,module,exports) {
try{module.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){module.exports=!1}
},{}],"oOlW":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3],t=require("has-cors");module.exports=function(n){var r=n.xdomain,c=n.xscheme,i=n.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!r||t))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!c&&i)return new XDomainRequest}catch(e){}if(!r)try{return new(e[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}};
},{"has-cors":"Qc5Z"}],"5GaI":[function(require,module,exports) {
module.exports=Object.keys||function(r){var e=[],t=Object.prototype.hasOwnProperty;for(var o in r)t.call(r,o)&&e.push(o);return e};
},{}],"XV+c":[function(require,module,exports) {
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){for(var n,o=h(r),a=o[0],u=o[1],i=new e(c(r,a,u)),f=0,A=u>0?a-4:a,d=0;d<A;d+=4)n=t[r.charCodeAt(d)]<<18|t[r.charCodeAt(d+1)]<<12|t[r.charCodeAt(d+2)]<<6|t[r.charCodeAt(d+3)],i[f++]=n>>16&255,i[f++]=n>>8&255,i[f++]=255&n;return 2===u&&(n=t[r.charCodeAt(d)]<<2|t[r.charCodeAt(d+1)]>>4,i[f++]=255&n),1===u&&(n=t[r.charCodeAt(d)]<<10|t[r.charCodeAt(d+1)]<<4|t[r.charCodeAt(d+2)]>>2,i[f++]=n>>8&255,i[f++]=255&n),i}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
},{}],"QT34":[function(require,module,exports) {
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
},{}],"D+m+":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t}
},{"base64-js":"XV+c","ieee754":"QT34","isarray":"Gi+N","buffer":"D+m+"}],"FFbL":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer,t=require("isarray"),r=Object.prototype.toString,o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===r.call(Blob),f="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===r.call(File);function n(r){if(!r||"object"!=typeof r)return!1;if(t(r)){for(var i=0,u=r.length;i<u;i++)if(n(r[i]))return!0;return!1}if("function"==typeof e&&e.isBuffer&&e.isBuffer(r)||"function"==typeof ArrayBuffer&&r instanceof ArrayBuffer||o&&r instanceof Blob||f&&r instanceof File)return!0;if(r.toJSON&&"function"==typeof r.toJSON&&1===arguments.length)return n(r.toJSON(),!0);for(var c in r)if(Object.prototype.hasOwnProperty.call(r,c)&&n(r[c]))return!0;return!1}module.exports=n;
},{"isarray":"Gi+N","buffer":"D+m+"}],"Lxo8":[function(require,module,exports) {
module.exports=function(r,e,n){var t=r.byteLength;if(e=e||0,n=n||t,r.slice)return r.slice(e,n);if(e<0&&(e+=t),n<0&&(n+=t),n>t&&(n=t),e>=t||e>=n||0===t)return new ArrayBuffer(0);for(var f=new Uint8Array(r),i=new Uint8Array(n-e),u=e,a=0;u<n;u++,a++)i[a]=f[u];return i.buffer};
},{}],"v5bu":[function(require,module,exports) {
function n(n,t,u){var r=!1;return u=u||o,c.count=n,0===n?t():c;function c(n,o){if(c.count<=0)throw new Error("after called too many times");--c.count,n?(r=!0,t(n),t=u):0!==c.count||r||t(null,o)}}function o(){}module.exports=n;
},{}],"vqwc":[function(require,module,exports) {
var global = arguments[3];
var define;
var r,t=arguments[3];!function(n){var e="object"==typeof exports&&exports,o="object"==typeof module&&module&&module.exports==e&&module,i="object"==typeof t&&t;i.global!==i&&i.window!==i||(n=i);var u,f,a,c=String.fromCharCode;function d(r){for(var t,n,e=[],o=0,i=r.length;o<i;)(t=r.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=r.charCodeAt(o++)))?e.push(((1023&t)<<10)+(1023&n)+65536):(e.push(t),o--):e.push(t);return e}function l(r,t){if(r>=55296&&r<=57343){if(t)throw Error("Lone surrogate U+"+r.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function v(r,t){return c(r>>t&63|128)}function s(r,t){if(0==(4294967168&r))return c(r);var n="";return 0==(4294965248&r)?n=c(r>>6&31|192):0==(4294901760&r)?(l(r,t)||(r=65533),n=c(r>>12&15|224),n+=v(r,6)):0==(4292870144&r)&&(n=c(r>>18&7|240),n+=v(r,12),n+=v(r,6)),n+=c(63&r|128)}function h(){if(a>=f)throw Error("Invalid byte index");var r=255&u[a];if(a++,128==(192&r))return 63&r;throw Error("Invalid continuation byte")}function p(r){var t,n;if(a>f)throw Error("Invalid byte index");if(a==f)return!1;if(t=255&u[a],a++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|h())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|h()<<6|h())>=2048)return l(n,r)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|h()<<12|h()<<6|h())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}var y={version:"2.1.2",encode:function(r,t){for(var n=!1!==(t=t||{}).strict,e=d(r),o=e.length,i=-1,u="";++i<o;)u+=s(e[i],n);return u},decode:function(r,t){var n=!1!==(t=t||{}).strict;u=d(r),f=u.length,a=0;for(var e,o=[];!1!==(e=p(n));)o.push(e);return function(r){for(var t,n=r.length,e=-1,o="";++e<n;)(t=r[e])>65535&&(o+=c((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=c(t);return o}(o)}};if("function"==typeof r&&"object"==typeof r.amd&&r.amd)r(function(){return y});else if(e&&!e.nodeType)if(o)o.exports=y;else{var b={}.hasOwnProperty;for(var w in y)b.call(y,w)&&(e[w]=y[w])}else n.utf8=y}(this);
},{}],"U+mA":[function(require,module,exports) {
!function(){"use strict";for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(256),t=0;t<r.length;t++)e[r.charCodeAt(t)]=t;exports.encode=function(e){var t,n=new Uint8Array(e),o=n.length,a="";for(t=0;t<o;t+=3)a+=r[n[t]>>2],a+=r[(3&n[t])<<4|n[t+1]>>4],a+=r[(15&n[t+1])<<2|n[t+2]>>6],a+=r[63&n[t+2]];return o%3==2?a=a.substring(0,a.length-1)+"=":o%3==1&&(a=a.substring(0,a.length-2)+"=="),a},exports.decode=function(r){var t,n,o,a,h,c=.75*r.length,g=r.length,i=0;"="===r[r.length-1]&&(c--,"="===r[r.length-2]&&c--);var u=new ArrayBuffer(c),A=new Uint8Array(u);for(t=0;t<g;t+=4)n=e[r.charCodeAt(t)],o=e[r.charCodeAt(t+1)],a=e[r.charCodeAt(t+2)],h=e[r.charCodeAt(t+3)],A[i++]=n<<2|o>>4,A[i++]=(15&o)<<4|a>>2,A[i++]=(3&a)<<6|63&h;return u}}();
},{}],"LjgI":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3],t=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,r=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),n=r&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),o=t&&t.prototype.append&&t.prototype.getBlob;function u(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.buffer instanceof ArrayBuffer){var n=r.buffer;if(r.byteLength!==n.byteLength){var o=new Uint8Array(r.byteLength);o.set(new Uint8Array(n,r.byteOffset,r.byteLength)),n=o.buffer}e[t]=n}}}function b(e,r){r=r||{};var n=new t;u(e);for(var o=0;o<e.length;o++)n.append(e[o]);return r.type?n.getBlob(r.type):n.getBlob()}function f(e,t){return u(e),new Blob(e,t||{})}module.exports=r?n?e.Blob:f:o?b:void 0;
},{}],"qbs8":[function(require,module,exports) {
var global = arguments[3];
var e,r=arguments[3],t=require("./keys"),n=require("has-binary2"),a=require("arraybuffer.slice"),o=require("after"),f=require("./utf8");r&&r.ArrayBuffer&&(e=require("base64-arraybuffer"));var i="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),u="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),c=i||u;exports.protocol=3;var d=exports.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},s=t(d),l={type:"error",data:"parser error"},y=require("blob");function p(e,r){return r("b"+exports.packets[e.type]+e.data.data)}function g(e,r,t){if(!r)return exports.encodeBase64Packet(e,t);var n=e.data,a=new Uint8Array(n),o=new Uint8Array(1+n.byteLength);o[0]=d[e.type];for(var f=0;f<a.length;f++)o[f+1]=a[f];return t(o.buffer)}function h(e,r,t){if(!r)return exports.encodeBase64Packet(e,t);var n=new FileReader;return n.onload=function(){e.data=n.result,exports.encodePacket(e,r,!0,t)},n.readAsArrayBuffer(e.data)}function v(e,r,t){if(!r)return exports.encodeBase64Packet(e,t);if(c)return h(e,r,t);var n=new Uint8Array(1);return n[0]=d[e.type],t(new y([n.buffer,e.data]))}function A(e){try{e=f.decode(e,{strict:!1})}catch(e){return!1}return e}function b(e,r,t){for(var n=new Array(e.length),a=o(e.length,t),f=function(e,t,a){r(t,function(r,t){n[e]=t,a(r,n)})},i=0;i<e.length;i++)f(i,e[i],a)}exports.encodePacket=function(e,t,n,a){"function"==typeof t&&(a=t,t=!1),"function"==typeof n&&(a=n,n=null);var o=void 0===e.data?void 0:e.data.buffer||e.data;if(r.ArrayBuffer&&o instanceof ArrayBuffer)return g(e,t,a);if(y&&o instanceof r.Blob)return v(e,t,a);if(o&&o.base64)return p(e,a);var i=d[e.type];return void 0!==e.data&&(i+=n?f.encode(String(e.data),{strict:!1}):String(e.data)),a(""+i)},exports.encodeBase64Packet=function(e,t){var n,a="b"+exports.packets[e.type];if(y&&e.data instanceof r.Blob){var o=new FileReader;return o.onload=function(){var e=o.result.split(",")[1];t(a+e)},o.readAsDataURL(e.data)}try{n=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(r){for(var f=new Uint8Array(e.data),i=new Array(f.length),u=0;u<f.length;u++)i[u]=f[u];n=String.fromCharCode.apply(null,i)}return a+=r.btoa(n),t(a)},exports.decodePacket=function(e,r,t){if(void 0===e)return l;if("string"==typeof e){if("b"===e.charAt(0))return exports.decodeBase64Packet(e.substr(1),r);if(t&&!1===(e=A(e)))return l;var n=e.charAt(0);return Number(n)==n&&s[n]?e.length>1?{type:s[n],data:e.substring(1)}:{type:s[n]}:l}n=new Uint8Array(e)[0];var o=a(e,1);return y&&"blob"===r&&(o=new y([o])),{type:s[n],data:o}},exports.decodeBase64Packet=function(r,t){var n=s[r.charAt(0)];if(!e)return{type:n,data:{base64:!0,data:r.substr(1)}};var a=e.decode(r.substr(1));return"blob"===t&&y&&(a=new y([a])),{type:n,data:a}},exports.encodePayload=function(e,r,t){"function"==typeof r&&(t=r,r=null);var a=n(e);if(r&&a)return y&&!c?exports.encodePayloadAsBlob(e,t):exports.encodePayloadAsArrayBuffer(e,t);if(!e.length)return t("0:");b(e,function(e,t){exports.encodePacket(e,!!a&&r,!1,function(e){t(null,function(e){return e.length+":"+e}(e))})},function(e,r){return t(r.join(""))})},exports.decodePayload=function(e,r,t){if("string"!=typeof e)return exports.decodePayloadAsBinary(e,r,t);var n;if("function"==typeof r&&(t=r,r=null),""===e)return t(l,0,1);for(var a,o,f="",i=0,u=e.length;i<u;i++){var c=e.charAt(i);if(":"===c){if(""===f||f!=(a=Number(f)))return t(l,0,1);if(f!=(o=e.substr(i+1,a)).length)return t(l,0,1);if(o.length){if(n=exports.decodePacket(o,r,!1),l.type===n.type&&l.data===n.data)return t(l,0,1);if(!1===t(n,i+a,u))return}i+=a,f=""}else f+=c}return""!==f?t(l,0,1):void 0},exports.encodePayloadAsArrayBuffer=function(e,r){if(!e.length)return r(new ArrayBuffer(0));b(e,function(e,r){exports.encodePacket(e,!0,!0,function(e){return r(null,e)})},function(e,t){var n=t.reduce(function(e,r){var t;return e+(t="string"==typeof r?r.length:r.byteLength).toString().length+t+2},0),a=new Uint8Array(n),o=0;return t.forEach(function(e){var r="string"==typeof e,t=e;if(r){for(var n=new Uint8Array(e.length),f=0;f<e.length;f++)n[f]=e.charCodeAt(f);t=n.buffer}a[o++]=r?0:1;var i=t.byteLength.toString();for(f=0;f<i.length;f++)a[o++]=parseInt(i[f]);a[o++]=255;for(n=new Uint8Array(t),f=0;f<n.length;f++)a[o++]=n[f]}),r(a.buffer)})},exports.encodePayloadAsBlob=function(e,r){b(e,function(e,r){exports.encodePacket(e,!0,!0,function(e){var t=new Uint8Array(1);if(t[0]=1,"string"==typeof e){for(var n=new Uint8Array(e.length),a=0;a<e.length;a++)n[a]=e.charCodeAt(a);e=n.buffer,t[0]=0}var o=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),f=new Uint8Array(o.length+1);for(a=0;a<o.length;a++)f[a]=parseInt(o[a]);if(f[o.length]=255,y){var i=new y([t.buffer,f.buffer,e]);r(null,i)}})},function(e,t){return r(new y(t))})},exports.decodePayloadAsBinary=function(e,r,t){"function"==typeof r&&(t=r,r=null);for(var n=e,o=[];n.byteLength>0;){for(var f=new Uint8Array(n),i=0===f[0],u="",c=1;255!==f[c];c++){if(u.length>310)return t(l,0,1);u+=f[c]}n=a(n,2+u.length),u=parseInt(u);var d=a(n,0,u);if(i)try{d=String.fromCharCode.apply(null,new Uint8Array(d))}catch(e){var s=new Uint8Array(d);d="";for(c=0;c<s.length;c++)d+=String.fromCharCode(s[c])}o.push(d),n=a(n,u)}var y=o.length;o.forEach(function(e,n){t(exports.decodePacket(e,r,!0),n,y)})};
},{"./keys":"5GaI","has-binary2":"FFbL","arraybuffer.slice":"Lxo8","after":"v5bu","./utf8":"vqwc","base64-arraybuffer":"U+mA","blob":"LjgI"}],"qszk":[function(require,module,exports) {
var t=require("engine.io-parser"),e=require("component-emitter");function s(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="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}module.exports=s,e(s.prototype),s.prototype.onError=function(t,e){var s=new Error(t);return s.type="TransportError",s.description=e,this.emit("error",s),this},s.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},s.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},s.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},s.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},s.prototype.onData=function(e){var s=t.decodePacket(e,this.socket.binaryType);this.onPacket(s)},s.prototype.onPacket=function(t){this.emit("packet",t)},s.prototype.onClose=function(){this.readyState="closed",this.emit("close")};
},{"engine.io-parser":"qbs8","component-emitter":"B9tp"}],"nvZV":[function(require,module,exports) {
exports.encode=function(e){var n="";for(var o in e)e.hasOwnProperty(o)&&(n.length&&(n+="&"),n+=encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return n},exports.decode=function(e){for(var n={},o=e.split("&"),t=0,r=o.length;t<r;t++){var d=o[t].split("=");n[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return n};
},{}],"BDf2":[function(require,module,exports) {
module.exports=function(o,t){var p=function(){};p.prototype=t.prototype,o.prototype=new p,o.prototype.constructor=o};
},{}],"jpD4":[function(require,module,exports) {
"use strict";var r,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),t=64,n={},o=0,u=0;function a(r){var n="";do{n=e[r%t]+n,r=Math.floor(r/t)}while(r>0);return n}function c(r){var e=0;for(u=0;u<r.length;u++)e=e*t+n[r.charAt(u)];return e}function f(){var e=a(+new Date);return e!==r?(o=0,r=e):e+"."+a(o++)}for(;u<t;u++)n[e[u]]=u;f.encode=a,f.decode=c,module.exports=f;
},{}],"L5G+":[function(require,module,exports) {
var t=require("../transport"),e=require("parseqs"),i=require("engine.io-parser"),o=require("component-inherit"),n=require("yeast"),r=require("debug")("engine.io-client:polling");module.exports=p;var s=null!=new(require("xmlhttprequest-ssl"))({xdomain:!1}).responseType;function p(e){var i=e&&e.forceBase64;s&&!i||(this.supportsBinary=!1),t.call(this,e)}o(p,t),p.prototype.name="polling",p.prototype.doOpen=function(){this.poll()},p.prototype.pause=function(t){var e=this;function i(){r("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var o=0;this.polling&&(r("we are currently polling - waiting to pause"),o++,this.once("pollComplete",function(){r("pre-pause polling complete"),--o||i()})),this.writable||(r("we are currently writing - waiting to pause"),o++,this.once("drain",function(){r("pre-pause writing complete"),--o||i()}))}else i()},p.prototype.poll=function(){r("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},p.prototype.onData=function(t){var e=this;r("polling got data %s",t);i.decodePayload(t,this.socket.binaryType,function(t,i,o){if("opening"===e.readyState&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():r('ignoring poll - transport state "%s"',this.readyState))},p.prototype.doClose=function(){var t=this;function e(){r("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(r("transport open - closing"),e()):(r("transport not open - deferring close"),this.once("open",e))},p.prototype.write=function(t){var e=this;this.writable=!1;var o=function(){e.writable=!0,e.emit("drain")};i.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,o)})},p.prototype.uri=function(){var t=this.query||{},i=this.secure?"https":"http",o="";return!1!==this.timestampRequests&&(t[this.timestampParam]=n()),this.supportsBinary||t.sid||(t.b64=1),t=e.encode(t),this.port&&("https"===i&&443!==Number(this.port)||"http"===i&&80!==Number(this.port))&&(o=":"+this.port),t.length&&(t="?"+t),i+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+o+this.path+t};
},{"../transport":"qszk","parseqs":"nvZV","engine.io-parser":"qbs8","component-inherit":"BDf2","yeast":"jpD4","debug":"zvTR","xmlhttprequest-ssl":"oOlW"}],"tX0X":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],e=require("xmlhttprequest-ssl"),s=require("./polling"),r=require("component-emitter"),i=require("component-inherit"),o=require("debug")("engine.io-client:polling-xhr");function a(){}function n(e){if(s.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,t.location){var r="https:"===location.protocol,i=location.port;i||(i=r?443:80),this.xd=e.hostname!==t.location.hostname||i!==e.port,this.xs=e.secure!==r}}function h(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}function u(){for(var t in h.requests)h.requests.hasOwnProperty(t)&&h.requests[t].abort()}module.exports=n,module.exports.Request=h,i(n,s),n.prototype.supportsBinary=!0,n.prototype.request=function(t){return(t=t||{}).uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new h(t)},n.prototype.doWrite=function(t,e){var s="string"!=typeof t&&void 0!==t,r=this.request({method:"POST",data:t,isBinary:s}),i=this;r.on("success",e),r.on("error",function(t){i.onError("xhr post error",t)}),this.sendXhr=r},n.prototype.doPoll=function(){o("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},r(h.prototype),h.prototype.create=function(){var s={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};s.pfx=this.pfx,s.key=this.key,s.passphrase=this.passphrase,s.cert=this.cert,s.ca=this.ca,s.ciphers=this.ciphers,s.rejectUnauthorized=this.rejectUnauthorized;var r=this.xhr=new e(s),i=this;try{o("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var a in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this.extraHeaders[a])}catch(t){}if("POST"===this.method)try{this.isBinary?r.setRequestHeader("Content-type","application/octet-stream"):r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{r.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in r&&(r.withCredentials=!0),this.requestTimeout&&(r.timeout=this.requestTimeout),this.hasXDR()?(r.onload=function(){i.onLoad()},r.onerror=function(){i.onError(r.responseText)}):r.onreadystatechange=function(){if(2===r.readyState)try{var t=r.getResponseHeader("Content-Type");i.supportsBinary&&"application/octet-stream"===t&&(r.responseType="arraybuffer")}catch(t){}4===r.readyState&&(200===r.status||1223===r.status?i.onLoad():setTimeout(function(){i.onError(r.status)},0))},o("xhr data %s",this.data),r.send(this.data)}catch(t){return void setTimeout(function(){i.onError(t)},0)}t.document&&(this.index=h.requestsCount++,h.requests[this.index]=this)},h.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},h.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},h.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},h.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=a:this.xhr.onreadystatechange=a,e)try{this.xhr.abort()}catch(t){}t.document&&delete h.requests[this.index],this.xhr=null}},h.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch(t){}t="application/octet-stream"===e&&this.xhr.response||this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},h.prototype.hasXDR=function(){return void 0!==t.XDomainRequest&&!this.xs&&this.enablesXDR},h.prototype.abort=function(){this.cleanup()},h.requestsCount=0,h.requests={},t.document&&(t.attachEvent?t.attachEvent("onunload",u):t.addEventListener&&t.addEventListener("beforeunload",u,!1));
},{"xmlhttprequest-ssl":"oOlW","./polling":"L5G+","component-emitter":"B9tp","component-inherit":"BDf2","debug":"zvTR"}],"2gyO":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3],t=require("./polling"),r=require("component-inherit");module.exports=s;var i,o=/\n/g,n=/\\n/g;function a(){}function s(r){t.call(this,r),this.query=this.query||{},i||(e.___eio||(e.___eio=[]),i=e.___eio),this.index=i.length;var o=this;i.push(function(e){o.onData(e)}),this.query.j=this.index,e.document&&e.addEventListener&&e.addEventListener("beforeunload",function(){o.script&&(o.script.onerror=a)},!1)}r(s,t),s.prototype.supportsBinary=!1,s.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,this.iframe=null),t.prototype.doClose.call(this)},s.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(t,r):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},s.prototype.doWrite=function(e,t){var r=this;if(!this.form){var i,a=document.createElement("form"),s=document.createElement("textarea"),c=this.iframeId="eio_iframe_"+this.index;a.className="socketio",a.style.position="absolute",a.style.top="-1000px",a.style.left="-1000px",a.target=c,a.method="POST",a.setAttribute("accept-charset","utf-8"),s.name="d",a.appendChild(s),document.body.appendChild(a),this.form=a,this.area=s}function m(){d(),t()}function d(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(e){r.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+r.iframeId+'">';i=document.createElement(e)}catch(e){(i=document.createElement("iframe")).name=r.iframeId,i.src="javascript:0"}i.id=r.iframeId,r.form.appendChild(i),r.iframe=i}this.form.action=this.uri(),d(),e=e.replace(n,"\\\n"),this.area.value=e.replace(o,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&m()}:this.iframe.onload=m};
},{"./polling":"L5G+","component-inherit":"BDf2"}],"alhG":[function(require,module,exports) {
},{}],"HxIz":[function(require,module,exports) {
var global = arguments[3];
var e,t=arguments[3],s=require("../transport"),r=require("engine.io-parser"),o=require("parseqs"),i=require("component-inherit"),n=require("yeast"),a=require("debug")("engine.io-client:websocket"),h=t.WebSocket||t.MozWebSocket;if("undefined"==typeof window)try{e=require("ws")}catch(e){}var p=h;function c(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=h&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(p=e),s.call(this,t)}p||"undefined"!=typeof window||(p=e),module.exports=c,i(c,s),c.prototype.name="websocket",c.prototype.supportsBinary=!0,c.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,s={agent:this.agent,perMessageDeflate:this.perMessageDeflate};s.pfx=this.pfx,s.key=this.key,s.passphrase=this.passphrase,s.cert=this.cert,s.ca=this.ca,s.ciphers=this.ciphers,s.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(s.headers=this.extraHeaders),this.localAddress&&(s.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?t?new p(e,t):new p(e):new p(e,t,s)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},c.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},c.prototype.write=function(e){var s=this;this.writable=!1;for(var o=e.length,i=0,n=o;i<n;i++)!function(e){r.encodePacket(e,s.supportsBinary,function(r){if(!s.usingBrowserWebSocket){var i={};if(e.options&&(i.compress=e.options.compress),s.perMessageDeflate)("string"==typeof r?t.Buffer.byteLength(r):r.length)<s.perMessageDeflate.threshold&&(i.compress=!1)}try{s.usingBrowserWebSocket?s.ws.send(r):s.ws.send(r,i)}catch(e){a("websocket closed before onclose event")}--o||h()})}(e[i]);function h(){s.emit("flush"),setTimeout(function(){s.writable=!0,s.emit("drain")},0)}},c.prototype.onClose=function(){s.prototype.onClose.call(this)},c.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},c.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",s="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(s=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=n()),this.supportsBinary||(e.b64=1),(e=o.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+s+this.path+e},c.prototype.check=function(){return!(!p||"__initialize"in p&&this.name===c.prototype.name)};
},{"../transport":"qszk","engine.io-parser":"qbs8","parseqs":"nvZV","component-inherit":"BDf2","yeast":"jpD4","debug":"zvTR","ws":"alhG"}],"aUr/":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3],o=require("xmlhttprequest-ssl"),r=require("./polling-xhr"),n=require("./polling-jsonp"),t=require("./websocket");function i(t){var i=!1,s=!1,l=!1!==t.jsonp;if(e.location){var p="https:"===location.protocol,a=location.port;a||(a=p?443:80),i=t.hostname!==location.hostname||a!==t.port,s=t.secure!==p}if(t.xdomain=i,t.xscheme=s,"open"in new o(t)&&!t.forceJSONP)return new r(t);if(!l)throw new Error("JSONP disabled");return new n(t)}exports.polling=i,exports.websocket=t;
},{"xmlhttprequest-ssl":"oOlW","./polling-xhr":"tX0X","./polling-jsonp":"2gyO","./websocket":"HxIz"}],"5HcG":[function(require,module,exports) {
var r=[].indexOf;module.exports=function(e,n){if(r)return e.indexOf(n);for(var f=0;f<e.length;++f)if(e[f]===n)return f;return-1};
},{}],"h7UJ":[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3],t=require("./transports/index"),r=require("component-emitter"),s=require("debug")("engine.io-client:socket"),i=require("indexof"),o=require("engine.io-parser"),n=require("parseuri"),a=require("parseqs");function p(t,r){if(!(this instanceof p))return new p(t,r);r=r||{},t&&"object"==typeof t&&(r=t,t=null),t?(t=n(t),r.hostname=t.host,r.secure="https"===t.protocol||"wss"===t.protocol,r.port=t.port,t.query&&(r.query=t.query)):r.host&&(r.hostname=n(r.host).host),this.secure=null!=r.secure?r.secure:e.location&&"https:"===location.protocol,r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.agent=r.agent||!1,this.hostname=r.hostname||(e.location?location.hostname:"localhost"),this.port=r.port||(e.location&&location.port?location.port:this.secure?443:80),this.query=r.query||{},"string"==typeof this.query&&(this.query=a.decode(this.query)),this.upgrade=!1!==r.upgrade,this.path=(r.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!r.forceJSONP,this.jsonp=!1!==r.jsonp,this.forceBase64=!!r.forceBase64,this.enablesXDR=!!r.enablesXDR,this.timestampParam=r.timestampParam||"t",this.timestampRequests=r.timestampRequests,this.transports=r.transports||["polling","websocket"],this.transportOptions=r.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=r.policyPort||843,this.rememberUpgrade=r.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=r.onlyBinaryUpgrades,this.perMessageDeflate=!1!==r.perMessageDeflate&&(r.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=r.pfx||null,this.key=r.key||null,this.passphrase=r.passphrase||null,this.cert=r.cert||null,this.ca=r.ca||null,this.ciphers=r.ciphers||null,this.rejectUnauthorized=void 0===r.rejectUnauthorized||r.rejectUnauthorized,this.forceNode=!!r.forceNode;var s="object"==typeof e&&e;s.global===s&&(r.extraHeaders&&Object.keys(r.extraHeaders).length>0&&(this.extraHeaders=r.extraHeaders),r.localAddress&&(this.localAddress=r.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function h(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}module.exports=p,p.priorWebsocketSuccess=!1,r(p.prototype),p.protocol=o.protocol,p.Socket=p,p.Transport=require("./transport"),p.transports=require("./transports/index"),p.parser=require("engine.io-parser"),p.prototype.createTransport=function(e){s('creating transport "%s"',e);var r=h(this.query);r.EIO=o.protocol,r.transport=e;var i=this.transportOptions[e]||{};return this.id&&(r.sid=this.id),new t[e]({query:r,socket:this,agent:i.agent||this.agent,hostname:i.hostname||this.hostname,port:i.port||this.port,secure:i.secure||this.secure,path:i.path||this.path,forceJSONP:i.forceJSONP||this.forceJSONP,jsonp:i.jsonp||this.jsonp,forceBase64:i.forceBase64||this.forceBase64,enablesXDR:i.enablesXDR||this.enablesXDR,timestampRequests:i.timestampRequests||this.timestampRequests,timestampParam:i.timestampParam||this.timestampParam,policyPort:i.policyPort||this.policyPort,pfx:i.pfx||this.pfx,key:i.key||this.key,passphrase:i.passphrase||this.passphrase,cert:i.cert||this.cert,ca:i.ca||this.ca,ciphers:i.ciphers||this.ciphers,rejectUnauthorized:i.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:i.perMessageDeflate||this.perMessageDeflate,extraHeaders:i.extraHeaders||this.extraHeaders,forceNode:i.forceNode||this.forceNode,localAddress:i.localAddress||this.localAddress,requestTimeout:i.requestTimeout||this.requestTimeout,protocols:i.protocols||void 0})},p.prototype.open=function(){var e;if(this.rememberUpgrade&&p.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout(function(){t.emit("error","No transports available")},0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},p.prototype.setTransport=function(e){s("setting transport %s",e.name);var t=this;this.transport&&(s("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},p.prototype.probe=function(e){s('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),r=!1,i=this;function o(){if(i.onlyBinaryUpgrades){var o=!this.supportsBinary&&i.transport.supportsBinary;r=r||o}r||(s('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",function(o){if(!r)if("pong"===o.type&&"probe"===o.data){if(s('probe transport "%s" pong',e),i.upgrading=!0,i.emit("upgrading",t),!t)return;p.priorWebsocketSuccess="websocket"===t.name,s('pausing current transport "%s"',i.transport.name),i.transport.pause(function(){r||"closed"!==i.readyState&&(s("changing transport and sending upgrade packet"),l(),i.setTransport(t),t.send([{type:"upgrade"}]),i.emit("upgrade",t),t=null,i.upgrading=!1,i.flush())})}else{s('probe transport "%s" failed',e);var n=new Error("probe error");n.transport=t.name,i.emit("upgradeError",n)}}))}function n(){r||(r=!0,l(),t.close(),t=null)}function a(r){var o=new Error("probe error: "+r);o.transport=t.name,n(),s('probe transport "%s" failed because of error: %s',e,r),i.emit("upgradeError",o)}function h(){a("transport closed")}function c(){a("socket closed")}function u(e){t&&e.name!==t.name&&(s('"%s" works - aborting "%s"',e.name,t.name),n())}function l(){t.removeListener("open",o),t.removeListener("error",a),t.removeListener("close",h),i.removeListener("close",c),i.removeListener("upgrading",u)}p.priorWebsocketSuccess=!1,t.once("open",o),t.once("error",a),t.once("close",h),this.once("close",c),this.once("upgrading",u),t.open()},p.prototype.onOpen=function(){if(s("socket open"),this.readyState="open",p.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){s("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},p.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(s('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else s('packet received with socket readyState "%s"',this.readyState)},p.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},p.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){"closed"!==t.readyState&&t.onClose("ping timeout")},e||t.pingInterval+t.pingTimeout)},p.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){s("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},p.prototype.ping=function(){var e=this;this.sendPacket("ping",function(){e.emit("ping")})},p.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},p.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(s("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},p.prototype.write=p.prototype.send=function(e,t,r){return this.sendPacket("message",e,t,r),this},p.prototype.sendPacket=function(e,t,r,s){if("function"==typeof t&&(s=t,t=void 0),"function"==typeof r&&(s=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){(r=r||{}).compress=!1!==r.compress;var i={type:e,data:t,options:r};this.emit("packetCreate",i),this.writeBuffer.push(i),s&&this.once("flush",s),this.flush()}},p.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?i():t()}):this.upgrading?i():t()}function t(){e.onClose("forced close"),s("socket closing - telling transport to close"),e.transport.close()}function r(){e.removeListener("upgrade",r),e.removeListener("upgradeError",r),t()}function i(){e.once("upgrade",r),e.once("upgradeError",r)}return this},p.prototype.onError=function(e){s("socket error %j",e),p.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},p.prototype.onClose=function(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){s('socket close with reason: "%s"',e);clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0}},p.prototype.filterUpgrades=function(e){for(var t=[],r=0,s=e.length;r<s;r++)~i(this.transports,e[r])&&t.push(e[r]);return t};
},{"./transports/index":"aUr/","component-emitter":"B9tp","debug":"zvTR","indexof":"5HcG","engine.io-parser":"qbs8","parseuri":"966K","parseqs":"nvZV","./transport":"qszk"}],"PinU":[function(require,module,exports) {
module.exports=require("./socket"),module.exports.parser=require("engine.io-parser");
},{"./socket":"h7UJ","engine.io-parser":"qbs8"}],"1Or/":[function(require,module,exports) {
function r(r,e){for(var n=[],o=(e=e||0)||0;o<r.length;o++)n[o-e]=r[o];return n}module.exports=r;
},{}],"OtVK":[function(require,module,exports) {
function e(e,n,o){return e.on(n,o),{destroy:function(){e.removeListener(n,o)}}}module.exports=e;
},{}],"Roop":[function(require,module,exports) {
var n=[].slice;module.exports=function(r,t){if("string"==typeof t&&(t=r[t]),"function"!=typeof t)throw new Error("bind() requires a function");var o=n.call(arguments,2);return function(){return t.apply(r,o.concat(n.call(arguments)))}};
},{}],"m7/q":[function(require,module,exports) {
var t=require("socket.io-parser"),e=require("component-emitter"),i=require("to-array"),s=require("./on"),n=require("component-bind"),o=require("debug")("socket.io-client:socket"),c=require("parseqs"),r=require("has-binary2");module.exports=exports=a;var h={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},p=e.prototype.emit;function a(t,e,i){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},i&&i.query&&(this.query=i.query),this.io.autoConnect&&this.open()}e(a.prototype),a.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[s(t,"open",n(this,"onopen")),s(t,"packet",n(this,"onpacket")),s(t,"close",n(this,"onclose"))]}},a.prototype.open=a.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},a.prototype.send=function(){var t=i(arguments);return t.unshift("message"),this.emit.apply(this,t),this},a.prototype.emit=function(e){if(h.hasOwnProperty(e))return p.apply(this,arguments),this;var s=i(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:r(s))?t.BINARY_EVENT:t.EVENT,data:s,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof s[s.length-1]&&(o("emitting packet with ack id %d",this.ids),this.acks[this.ids]=s.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},a.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},a.prototype.onopen=function(){if(o("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?c.encode(this.query):this.query;o("sending connect packet with query %s",e),this.packet({type:t.CONNECT,query:e})}else this.packet({type:t.CONNECT})},a.prototype.onclose=function(t){o("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},a.prototype.onpacket=function(e){var i=e.nsp===this.nsp,s=e.type===t.ERROR&&"/"===e.nsp;if(i||s)switch(e.type){case t.CONNECT:this.onconnect();break;case t.EVENT:case t.BINARY_EVENT:this.onevent(e);break;case t.ACK:case t.BINARY_ACK:this.onack(e);break;case t.DISCONNECT:this.ondisconnect();break;case t.ERROR:this.emit("error",e.data)}},a.prototype.onevent=function(t){var e=t.data||[];o("emitting event %j",e),null!=t.id&&(o("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?p.apply(this,e):this.receiveBuffer.push(e)},a.prototype.ack=function(e){var s=this,n=!1;return function(){if(!n){n=!0;var c=i(arguments);o("sending ack %j",c),s.packet({type:r(c)?t.BINARY_ACK:t.ACK,id:e,data:c})}}},a.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(o("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):o("bad ack %s",t.id)},a.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},a.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)p.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},a.prototype.ondisconnect=function(){o("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},a.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},a.prototype.close=a.prototype.disconnect=function(){return this.connected&&(o("performing disconnect (%s)",this.nsp),this.packet({type:t.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},a.prototype.compress=function(t){return this.flags.compress=t,this},a.prototype.binary=function(t){return this.flags.binary=t,this};
},{"socket.io-parser":"waZo","component-emitter":"B9tp","to-array":"1Or/","./on":"OtVK","component-bind":"Roop","debug":"zvTR","parseqs":"nvZV","has-binary2":"FFbL"}],"PMsN":[function(require,module,exports) {
function t(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}module.exports=t,t.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),o=Math.floor(i*this.jitter*t);t=0==(1&Math.floor(10*i))?t-o:t+o}return 0|Math.min(t,this.max)},t.prototype.reset=function(){this.attempts=0},t.prototype.setMin=function(t){this.ms=t},t.prototype.setMax=function(t){this.max=t},t.prototype.setJitter=function(t){this.jitter=t};
},{}],"WL16":[function(require,module,exports) {
var t=require("engine.io-client"),e=require("./socket"),n=require("component-emitter"),o=require("socket.io-parser"),i=require("./on"),s=require("component-bind"),c=require("debug")("socket.io-client:manager"),r=require("indexof"),h=require("backo2"),a=Object.prototype.hasOwnProperty;function p(t,e){if(!(this instanceof p))return new p(t,e);t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new h({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=e.parser||o;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==e.autoConnect,this.autoConnect&&this.open()}module.exports=p,p.prototype.emitAll=function(){for(var t in this.emit.apply(this,arguments),this.nsps)a.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},p.prototype.updateSocketIds=function(){for(var t in this.nsps)a.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},p.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},n(p.prototype),p.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},p.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},p.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},p.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},p.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},p.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},p.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},p.prototype.open=p.prototype.connect=function(e,n){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=t(this.uri,this.opts);var o=this.engine,s=this;this.readyState="opening",this.skipReconnect=!1;var r=i(o,"open",function(){s.onopen(),e&&e()}),h=i(o,"error",function(t){if(c("connect_error"),s.cleanup(),s.readyState="closed",s.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else s.maybeReconnectOnOpen()});if(!1!==this._timeout){var a=this._timeout;c("connect attempt will timeout after %d",a);var p=setTimeout(function(){c("connect attempt timed out after %d",a),r.destroy(),o.close(),o.emit("error","timeout"),s.emitAll("connect_timeout",a)},a);this.subs.push({destroy:function(){clearTimeout(p)}})}return this.subs.push(r),this.subs.push(h),this},p.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(i(t,"data",s(this,"ondata"))),this.subs.push(i(t,"ping",s(this,"onping"))),this.subs.push(i(t,"pong",s(this,"onpong"))),this.subs.push(i(t,"error",s(this,"onerror"))),this.subs.push(i(t,"close",s(this,"onclose"))),this.subs.push(i(this.decoder,"decoded",s(this,"ondecoded")))},p.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},p.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},p.prototype.ondata=function(t){this.decoder.add(t)},p.prototype.ondecoded=function(t){this.emit("packet",t)},p.prototype.onerror=function(t){c("error",t),this.emitAll("error",t)},p.prototype.socket=function(t,n){var o=this.nsps[t];if(!o){o=new e(this,t,n),this.nsps[t]=o;var i=this;o.on("connecting",s),o.on("connect",function(){o.id=i.generateId(t)}),this.autoConnect&&s()}function s(){~r(i.connecting,o)||i.connecting.push(o)}return o},p.prototype.destroy=function(t){var e=r(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},p.prototype.packet=function(t){c("writing packet %j",t);var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(n){for(var o=0;o<n.length;o++)e.engine.write(n[o],t.options);e.encoding=!1,e.processPacketQueue()}))},p.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},p.prototype.cleanup=function(){c("cleanup");for(var t=this.subs.length,e=0;e<t;e++){this.subs.shift().destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},p.prototype.close=p.prototype.disconnect=function(){c("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},p.prototype.onclose=function(t){c("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},p.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();c("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(c("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(c("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(c("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},p.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)};
},{"engine.io-client":"PinU","./socket":"m7/q","component-emitter":"B9tp","socket.io-parser":"waZo","./on":"OtVK","component-bind":"Roop","debug":"zvTR","indexof":"5HcG","backo2":"PMsN"}],"Hof/":[function(require,module,exports) {
var e=require("./url"),r=require("socket.io-parser"),o=require("./manager"),t=require("debug")("socket.io-client");module.exports=exports=n;var c=exports.managers={};function n(r,n){"object"==typeof r&&(n=r,r=void 0),n=n||{};var s,i=e(r),u=i.source,a=i.id,p=i.path,q=c[a]&&p in c[a].nsps;return n.forceNew||n["force new connection"]||!1===n.multiplex||q?(t("ignoring socket cache for %s",u),s=o(u,n)):(c[a]||(t("new io instance for %s",u),c[a]=o(u,n)),s=c[a]),i.query&&!n.query&&(n.query=i.query),s.socket(i.path,n)}exports.protocol=r.protocol,exports.connect=n,exports.Manager=require("./manager"),exports.Socket=require("./socket");
},{"./url":"vmAD","socket.io-parser":"waZo","./manager":"WL16","debug":"zvTR","./socket":"m7/q"}],"Ap3z":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="https://watt-center-snake.herokuapp.com";exports.default=e;
},{}],"sskR":[function(require,module,exports) {
"use strict";var e=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)Object.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t.default=e,t},t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var s=e(require("socket.io-client")),r=t(require("../serverSettings")),i=function(){function e(){this.listeners=[],this.socket=s.connect(r.default+"/display")}return e.prototype.addListener=function(e){this.socket.on("message",e),this.listeners.push(e)},e.prototype.clearListeners=function(){for(var e=0,t=this.listeners;e<t.length;e++){var s=t[e];this.socket.removeListener("message",s)}this.listeners=[]},e.prototype.sendMessage=function(e,t){this.socket.emit(e,t)},e}();exports.IO=i;
},{"socket.io-client":"Hof/","../serverSettings":"Ap3z"}],"DOlx":[function(require,module,exports) {
module.exports="logo.fdc5de28.png";
},{}],"ok8D":[function(require,module,exports) {
"use strict";var t=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),e=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var r=require("./CountDownScreen"),o=require("./GameState"),n=e(require("../../img/logo.png")),a=function(e){function o(t){var r=e.call(this,t)||this;return r.minTimePerFrame=250,r.logo=new Image,r.logo.src=n.default,r.passcode=(1e3+Math.floor(9e3*Math.random())).toString(),r}return t(o,e),o.prototype.draw=function(){this.fillScreen("white"),this.ctx.g2D.drawImage(this.logo,6,6),this.drawText("cuhack.it/#/snake "+this.passcode,108,12,"black",40)},o.prototype.start=function(){var t=this;this.ctx.io.addListener(function(e,o){o===t.passcode&&(t.ctx.sharedData=e,t.ctx.switchState(r.CountDownScreen.Name),t.ctx.io.sendMessage(e,"playing"))})},o.Name="start",o}(o.GameState);exports.StartScreen=a;
},{"./CountDownScreen":"t8a0","./GameState":"S1TJ","../../img/logo.png":"DOlx"}],"VZLE":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./CountDownScreen"),e=require("./GameContext"),r=require("./GameOverScreen"),n=require("./IO"),s=require("./PlayScreen"),i=require("./StartScreen"),a=function(){function a(a){var c=this;this.canvas=a,this.states={},this.ctx=new e.GameContext(function(t,e){e.io.clearListeners(),e.currState=t,c.states[t].start()}),a.width=this.ctx.width,a.height=this.ctx.height,this.ctx.g2D=a.getContext("2d"),this.ctx.g2D.imageSmoothingEnabled=!1,this.ctx.g2D.webkitImageSmoothingEnabled=!1,this.ctx.io=new n.IO,this.states[i.StartScreen.Name]=new i.StartScreen(this.ctx),this.states[t.CountDownScreen.Name]=new t.CountDownScreen(this.ctx),this.states[s.PlayScreen.Name]=new s.PlayScreen(this.ctx),this.states[r.GameOverScreen.Name]=new r.GameOverScreen(this.ctx),this.ctx.currState=i.StartScreen.Name,this.states[i.StartScreen.Name].start()}return a.prototype.run=function(){var t=this;this.states[this.ctx.currState].update(),requestAnimationFrame(function(){t.run()})},a}();exports.GameRunner=a;
},{"./CountDownScreen":"t8a0","./GameContext":"wREK","./GameOverScreen":"AUT8","./IO":"sskR","./PlayScreen":"dDLu","./StartScreen":"ok8D"}],"ZpMN":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./display/GameRunner"),n=document.createElement("canvas");document.body.appendChild(n);var r=new e.GameRunner(n);r.run();
},{"./display/GameRunner":"VZLE"}]},{},["ZpMN"], null)
//# sourceMappingURL=display.0fcb9144.map