UNPKG

kpiplus

Version:

KPI+

2 lines 1.14 MB
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.io=t()}}(function(){var t;return function t(e,a,l){function i(s,o){if(!a[s]){if(!e[s]){var d="function"==typeof require&&require;if(!o&&d)return d(s,!0);if(n)return n(s,!0);var r=new Error("Cannot find module '"+s+"'");throw r.code="MODULE_NOT_FOUND",r}var c=a[s]={exports:{}};e[s][0].call(c.exports,function(t){var a=e[s][1][t];return i(a?a:t)},c,c.exports,t,e,a,l)}return a[s].exports}for(var n="function"==typeof require&&require,s=0;s<l.length;s++)i(l[s]);return i}({1:[function(t,e,a){e.exports=t("./lib/")},{"./lib/":2}],2:[function(t,e,a){e.exports=t("./socket"),e.exports.parser=t("engine.io-parser")},{"./socket":3,"engine.io-parser":19}],3:[function(t,e,a){(function(a){function l(t,e){if(!(this instanceof l))return new l(t,e);e=e||{},t&&"object"==typeof t&&(e=t,t=null),t?(t=c(t),e.hostname=t.host,e.secure="https"==t.protocol||"wss"==t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=c(e.host).host),this.secure=null!=e.secure?e.secure:a.location&&"https:"==location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||(a.location?location.hostname:"localhost"),this.port=e.port||(a.location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=m.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=!1!==e.perMessageDeflate&&(e.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||null,this.key=e.key||null,this.passphrase=e.passphrase||null,this.cert=e.cert||null,this.ca=e.ca||null,this.ciphers=e.ciphers||null,this.rejectUnauthorized=void 0===e.rejectUnauthorized?null:e.rejectUnauthorized;var i="object"==typeof a&&a;i.global===i&&e.extraHeaders&&Object.keys(e.extraHeaders).length>0&&(this.extraHeaders=e.extraHeaders),this.open()}function i(t){var e={};for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);return e}var n=t("./transports"),s=t("component-emitter"),o=t("debug")("engine.io-client:socket"),d=t("indexof"),r=t("engine.io-parser"),c=t("parseuri"),p=t("parsejson"),m=t("parseqs");e.exports=l,l.priorWebsocketSuccess=!1,s(l.prototype),l.protocol=r.protocol,l.Socket=l,l.Transport=t("./transport"),l.transports=t("./transports"),l.parser=t("engine.io-parser"),l.prototype.createTransport=function(t){o('creating transport "%s"',t);var e=i(this.query);e.EIO=r.protocol,e.transport=t,this.id&&(e.sid=this.id);var a=new n[t]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:e,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized,perMessageDeflate:this.perMessageDeflate,extraHeaders:this.extraHeaders});return a},l.prototype.open=function(){var t;if(this.rememberUpgrade&&l.priorWebsocketSuccess&&this.transports.indexOf("websocket")!=-1)t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},l.prototype.setTransport=function(t){o("setting transport %s",t.name);var e=this;this.transport&&(o("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},l.prototype.probe=function(t){function e(){if(m.onlyBinaryUpgrades){var e=!this.supportsBinary&&m.transport.supportsBinary;p=p||e}p||(o('probe transport "%s" opened',t),c.send([{type:"ping",data:"probe"}]),c.once("packet",function(e){if(!p)if("pong"==e.type&&"probe"==e.data){if(o('probe transport "%s" pong',t),m.upgrading=!0,m.emit("upgrading",c),!c)return;l.priorWebsocketSuccess="websocket"==c.name,o('pausing current transport "%s"',m.transport.name),m.transport.pause(function(){p||"closed"!=m.readyState&&(o("changing transport and sending upgrade packet"),r(),m.setTransport(c),c.send([{type:"upgrade"}]),m.emit("upgrade",c),c=null,m.upgrading=!1,m.flush())})}else{o('probe transport "%s" failed',t);var a=new Error("probe error");a.transport=c.name,m.emit("upgradeError",a)}}))}function a(){p||(p=!0,r(),c.close(),c=null)}function i(e){var l=new Error("probe error: "+e);l.transport=c.name,a(),o('probe transport "%s" failed because of error: %s',t,e),m.emit("upgradeError",l)}function n(){i("transport closed")}function s(){i("socket closed")}function d(t){c&&t.name!=c.name&&(o('"%s" works - aborting "%s"',t.name,c.name),a())}function r(){c.removeListener("open",e),c.removeListener("error",i),c.removeListener("close",n),m.removeListener("close",s),m.removeListener("upgrading",d)}o('probing transport "%s"',t);var c=this.createTransport(t,{probe:1}),p=!1,m=this;l.priorWebsocketSuccess=!1,c.once("open",e),c.once("error",i),c.once("close",n),this.once("close",s),this.once("upgrading",d),c.open()},l.prototype.onOpen=function(){if(o("socket open"),this.readyState="open",l.priorWebsocketSuccess="websocket"==this.transport.name,this.emit("open"),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){o("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},l.prototype.onPacket=function(t){if("opening"==this.readyState||"open"==this.readyState)switch(o('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(p(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else o('packet received with socket readyState "%s"',this.readyState)},l.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!=this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},l.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!=e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},l.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){o("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},l.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})},l.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},l.prototype.flush=function(){"closed"!=this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(o("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},l.prototype.write=l.prototype.send=function(t,e,a){return this.sendPacket("message",t,e,a),this},l.prototype.sendPacket=function(t,e,a,l){if("function"==typeof e&&(l=e,e=void 0),"function"==typeof a&&(l=a,a=null),"closing"!=this.readyState&&"closed"!=this.readyState){a=a||{},a.compress=!1!==a.compress;var i={type:t,data:e,options:a};this.emit("packetCreate",i),this.writeBuffer.push(i),l&&this.once("flush",l),this.flush()}},l.prototype.close=function(){function t(){l.onClose("forced close"),o("socket closing - telling transport to close"),l.transport.close()}function e(){l.removeListener("upgrade",e),l.removeListener("upgradeError",e),t()}function a(){l.once("upgrade",e),l.once("upgradeError",e)}if("opening"==this.readyState||"open"==this.readyState){this.readyState="closing";var l=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?a():t()}):this.upgrading?a():t()}return this},l.prototype.onError=function(t){o("socket error %j",t),l.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},l.prototype.onClose=function(t,e){if("opening"==this.readyState||"open"==this.readyState||"closing"==this.readyState){o('socket close with reason: "%s"',t);var a=this;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",t,e),a.writeBuffer=[],a.prevBufferLen=0}},l.prototype.filterUpgrades=function(t){for(var e=[],a=0,l=t.length;a<l;a++)~d(this.transports,t[a])&&e.push(t[a]);return e}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},{"./transport":4,"./transports":5,"component-emitter":15,debug:17,"engine.io-parser":19,indexof:23,parsejson:26,parseqs:27,parseuri:28}],4:[function(t,e,a){function l(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.extraHeaders=t.extraHeaders}var i=t("engine.io-parser"),n=t("component-emitter");e.exports=l,n(l.prototype),l.prototype.onError=function(t,e){var a=new Error(t);return a.type="TransportError",a.description=e,this.emit("error",a),this},l.prototype.open=function(){return"closed"!=this.readyState&&""!=this.readyState||(this.readyState="opening",this.doOpen()),this},l.prototype.close=function(){return"opening"!=this.readyState&&"open"!=this.readyState||(this.doClose(),this.onClose()),this},l.prototype.send=function(t){if("open"!=this.readyState)throw new Error("Transport not open");this.write(t)},l.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},l.prototype.onData=function(t){var e=i.decodePacket(t,this.socket.binaryType);this.onPacket(e)},l.prototype.onPacket=function(t){this.emit("packet",t)},l.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":15,"engine.io-parser":19}],5:[function(t,e,a){(function(e){function l(t){var a,l=!1,o=!1,d=!1!==t.jsonp;if(e.location){var r="https:"==location.protocol,c=location.port;c||(c=r?443:80),l=t.hostname!=location.hostname||c!=t.port,o=t.secure!=r}if(t.xdomain=l,t.xscheme=o,a=new i(t),"open"in a&&!t.forceJSONP)return new n(t);if(!d)throw new Error("JSONP disabled");return new s(t)}var i=t("xmlhttprequest-ssl"),n=t("./polling-xhr"),s=t("./polling-jsonp"),o=t("./websocket");a.polling=l,a.websocket=o}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},{"./polling-jsonp":6,"./polling-xhr":7,"./websocket":9,"xmlhttprequest-ssl":10}],6:[function(t,e,a){(function(a){function l(){}function i(t){n.call(this,t),this.query=this.query||{},o||(a.___eio||(a.___eio=[]),o=a.___eio),this.index=o.length;var e=this;o.push(function(t){e.onData(t)}),this.query.j=this.index,a.document&&a.addEventListener&&a.addEventListener("beforeunload",function(){e.script&&(e.script.onerror=l)},!1)}var n=t("./polling"),s=t("component-inherit");e.exports=i;var o,d=/\n/g,r=/\\n/g;s(i,n),i.prototype.supportsBinary=!1,i.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),n.prototype.doClose.call(this)},i.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var a=document.getElementsByTagName("script")[0];a?a.parentNode.insertBefore(e,a):(document.head||document.body).appendChild(e),this.script=e;var l="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);l&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},i.prototype.doWrite=function(t,e){function a(){l(),e()}function l(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(t){i.onError("jsonp polling iframe removal error",t)}try{var t='<iframe src="javascript:0" name="'+i.iframeId+'">';n=document.createElement(t)}catch(t){n=document.createElement("iframe"),n.name=i.iframeId,n.src="javascript:0"}n.id=i.iframeId,i.form.appendChild(n),i.iframe=n}var i=this;if(!this.form){var n,s=document.createElement("form"),o=document.createElement("textarea"),c=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=c,s.method="POST",s.setAttribute("accept-charset","utf-8"),o.name="d",s.appendChild(o),document.body.appendChild(s),this.form=s,this.area=o}this.form.action=this.uri(),l(),t=t.replace(r,"\\\n"),this.area.value=t.replace(d,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"==i.iframe.readyState&&a()}:this.iframe.onload=a}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},{"./polling":8,"component-inherit":16}],7:[function(t,e,a){(function(a){function l(){}function i(t){if(d.call(this,t),a.location){var e="https:"==location.protocol,l=location.port;l||(l=e?443:80),this.xd=t.hostname!=a.location.hostname||l!=t.port,this.xs=t.secure!=e}else this.extraHeaders=t.extraHeaders}function n(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.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 s(){for(var t in n.requests)n.requests.hasOwnProperty(t)&&n.requests[t].abort()}var o=t("xmlhttprequest-ssl"),d=t("./polling"),r=t("component-emitter"),c=t("component-inherit"),p=t("debug")("engine.io-client:polling-xhr");e.exports=i,e.exports.Request=n,c(i,d),i.prototype.supportsBinary=!0,i.prototype.request=function(t){return t=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.extraHeaders=this.extraHeaders,new n(t)},i.prototype.doWrite=function(t,e){var a="string"!=typeof t&&void 0!==t,l=this.request({method:"POST",data:t,isBinary:a}),i=this;l.on("success",e),l.on("error",function(t){i.onError("xhr post error",t)}),this.sendXhr=l},i.prototype.doPoll=function(){p("xhr poll");var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},r(n.prototype),n.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,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;var e=this.xhr=new o(t),l=this;try{p("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.extraHeaders){e.setDisableHeaderCheck(!0);for(var i in this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&e.setRequestHeader(i,this.extraHeaders[i])}}catch(t){}if(this.supportsBinary&&(e.responseType="arraybuffer"),"POST"==this.method)try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}"withCredentials"in e&&(e.withCredentials=!0),this.hasXDR()?(e.onload=function(){l.onLoad()},e.onerror=function(){l.onError(e.responseText)}):e.onreadystatechange=function(){4==e.readyState&&(200==e.status||1223==e.status?l.onLoad():setTimeout(function(){l.onError(e.status)},0))},p("xhr data %s",this.data),e.send(this.data)}catch(t){return void setTimeout(function(){l.onError(t)},0)}a.document&&(this.index=n.requestsCount++,n.requests[this.index]=this)},n.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},n.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},n.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},n.prototype.cleanup=function(t){if("undefined"!=typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=l:this.xhr.onreadystatechange=l,t)try{this.xhr.abort()}catch(t){}a.document&&delete n.requests[this.index],this.xhr=null}},n.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(t){}if("application/octet-stream"===e)t=this.xhr.response;else if(this.supportsBinary)try{t=String.fromCharCode.apply(null,new Uint8Array(this.xhr.response))}catch(e){for(var a=new Uint8Array(this.xhr.response),l=[],i=0,n=a.length;i<n;i++)l.push(a[i]);t=String.fromCharCode.apply(null,l)}else t=this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},n.prototype.hasXDR=function(){return"undefined"!=typeof a.XDomainRequest&&!this.xs&&this.enablesXDR},n.prototype.abort=function(){this.cleanup()},a.document&&(n.requestsCount=0,n.requests={},a.attachEvent?a.attachEvent("onunload",s):a.addEventListener&&a.addEventListener("beforeunload",s,!1))}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},{"./polling":8,"component-emitter":15,"component-inherit":16,debug:17,"xmlhttprequest-ssl":10}],8:[function(t,e,a){function l(t){var e=t&&t.forceBase64;c&&!e||(this.supportsBinary=!1),i.call(this,t)}var i=t("../transport"),n=t("parseqs"),s=t("engine.io-parser"),o=t("component-inherit"),d=t("yeast"),r=t("debug")("engine.io-client:polling");e.exports=l;var c=function(){var e=t("xmlhttprequest-ssl"),a=new e({xdomain:!1});return null!=a.responseType}();o(l,i),l.prototype.name="polling",l.prototype.doOpen=function(){this.poll()},l.prototype.pause=function(t){function e(){r("paused"),a.readyState="paused",t()}var a=this;if(this.readyState="pausing",this.polling||!this.writable){var l=0;this.polling&&(r("we are currently polling - waiting to pause"),l++,this.once("pollComplete",function(){r("pre-pause polling complete"),--l||e()})),this.writable||(r("we are currently writing - waiting to pause"),l++,this.once("drain",function(){r("pre-pause writing complete"),--l||e()}))}else e()},l.prototype.poll=function(){r("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},l.prototype.onData=function(t){var e=this;r("polling got data %s",t);var a=function(t,a,l){return"opening"==e.readyState&&e.onOpen(),"close"==t.type?(e.onClose(),!1):void e.onPacket(t)};s.decodePayload(t,this.socket.binaryType,a),"closed"!=this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():r('ignoring poll - transport state "%s"',this.readyState))},l.prototype.doClose=function(){function t(){r("writing close packet"),e.write([{type:"close"}])}var e=this;"open"==this.readyState?(r("transport open - closing"),t()):(r("transport not open - deferring close"),this.once("open",t))},l.prototype.write=function(t){var e=this;this.writable=!1;var a=function(){e.writable=!0,e.emit("drain")},e=this;s.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,a)})},l.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",a="";!1!==this.timestampRequests&&(t[this.timestampParam]=d()),this.supportsBinary||t.sid||(t.b64=1),t=n.encode(t),this.port&&("https"==e&&443!=this.port||"http"==e&&80!=this.port)&&(a=":"+this.port),t.length&&(t="?"+t);var l=this.hostname.indexOf(":")!==-1;return e+"://"+(l?"["+this.hostname+"]":this.hostname)+a+this.path+t}},{"../transport":4,"component-inherit":16,debug:17,"engine.io-parser":19,parseqs:27,"xmlhttprequest-ssl":10,yeast:30}],9:[function(t,e,a){(function(a){function l(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,i.call(this,t)}var i=t("../transport"),n=t("engine.io-parser"),s=t("parseqs"),o=t("component-inherit"),d=t("yeast"),r=t("debug")("engine.io-client:websocket"),c=a.WebSocket||a.MozWebSocket,p=c;if(!p&&"undefined"==typeof window)try{p=t("ws")}catch(t){}e.exports=l,o(l,i),l.prototype.name="websocket",l.prototype.supportsBinary=!0,l.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=void 0,a={agent:this.agent,perMessageDeflate:this.perMessageDeflate};a.pfx=this.pfx,a.key=this.key,a.passphrase=this.passphrase,a.cert=this.cert,a.ca=this.ca,a.ciphers=this.ciphers,a.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(a.headers=this.extraHeaders),this.ws=c?new p(t):new p(t,e,a),void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="buffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},l.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},"undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(l.prototype.onData=function(t){var e=this;setTimeout(function(){i.prototype.onData.call(e,t)},0)}),l.prototype.write=function(t){function e(){l.emit("flush"),setTimeout(function(){l.writable=!0,l.emit("drain")},0)}var l=this;this.writable=!1;for(var i=t.length,s=0,o=i;s<o;s++)!function(t){n.encodePacket(t,l.supportsBinary,function(n){if(!c){var s={};if(t.options&&(s.compress=t.options.compress),l.perMessageDeflate){var o="string"==typeof n?a.Buffer.byteLength(n):n.length;o<l.perMessageDeflate.threshold&&(s.compress=!1)}}try{c?l.ws.send(n):l.ws.send(n,s)}catch(t){r("websocket closed before onclose event")}--i||e()})}(t[s])},l.prototype.onClose=function(){i.prototype.onClose.call(this)},l.prototype.doClose=function(){"undefined"!=typeof this.ws&&this.ws.close()},l.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",a="";this.port&&("wss"==e&&443!=this.port||"ws"==e&&80!=this.port)&&(a=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=d()),this.supportsBinary||(t.b64=1),t=s.encode(t),t.length&&(t="?"+t);var l=this.hostname.indexOf(":")!==-1;return e+"://"+(l?"["+this.hostname+"]":this.hostname)+a+this.path+t},l.prototype.check=function(){return!(!p||"__initialize"in p&&this.name===l.prototype.name)}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},{"../transport":4,"component-inherit":16,debug:17,"engine.io-parser":19,parseqs:27,ws:void 0,yeast:30}],10:[function(t,e,a){var l=t("has-cors");e.exports=function(t){var e=t.xdomain,a=t.xscheme,i=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!e||l))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!a&&i)return new XDomainRequest}catch(t){}if(!e)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}},{"has-cors":22}],11:[function(t,e,a){function l(t,e,a){function l(t,i){if(l.count<=0)throw new Error("after called too many times");--l.count,t?(n=!0,e(t),e=a):0!==l.count||n||e(null,i)}var n=!1;return a=a||i,l.count=t,0===t?e():l}function i(){}e.exports=l},{}],12:[function(t,e,a){e.exports=function(t,e,a){var l=t.byteLength;if(e=e||0,a=a||l,t.slice)return t.slice(e,a);if(e<0&&(e+=l),a<0&&(a+=l),a>l&&(a=l),e>=l||e>=a||0===l)return new ArrayBuffer(0);for(var i=new Uint8Array(t),n=new Uint8Array(a-e),s=e,o=0;s<a;s++,o++)n[o]=i[s];return n.buffer}},{}],13:[function(t,e,a){!function(t){"use strict";a.encode=function(e){var a,l=new Uint8Array(e),i=l.length,n="";for(a=0;a<i;a+=3)n+=t[l[a]>>2],n+=t[(3&l[a])<<4|l[a+1]>>4],n+=t[(15&l[a+1])<<2|l[a+2]>>6],n+=t[63&l[a+2]];return i%3===2?n=n.substring(0,n.length-1)+"=":i%3===1&&(n=n.substring(0,n.length-2)+"=="),n},a.decode=function(e){var a,l,i,n,s,o=.75*e.length,d=e.length,r=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var c=new ArrayBuffer(o),p=new Uint8Array(c);for(a=0;a<d;a+=4)l=t.indexOf(e[a]),i=t.indexOf(e[a+1]),n=t.indexOf(e[a+2]),s=t.indexOf(e[a+3]),p[r++]=l<<2|i>>4,p[r++]=(15&i)<<4|n>>2,p[r++]=(3&n)<<6|63&s;return c}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],14:[function(t,e,a){(function(t){function a(t){for(var e=0;e<t.length;e++){var a=t[e];if(a.buffer instanceof ArrayBuffer){var l=a.buffer;if(a.byteLength!==l.byteLength){var i=new Uint8Array(a.byteLength);i.set(new Uint8Array(l,a.byteOffset,a.byteLength)),l=i.buffer}t[e]=l}}}function l(t,e){e=e||{};var l=new n;a(t);for(var i=0;i<t.length;i++)l.append(t[i]);return e.type?l.getBlob(e.type):l.getBlob()}function i(t,e){return a(t),new Blob(t,e||{})}var n=t.BlobBuilder||t.WebKitBlobBuilder||t.MSBlobBuilder||t.MozBlobBuilder,s=function(){try{var t=new Blob(["hi"]);return 2===t.size}catch(t){return!1}}(),o=s&&function(){try{var t=new Blob([new Uint8Array([1,2])]);return 2===t.size}catch(t){return!1}}(),d=n&&n.prototype.append&&n.prototype.getBlob;e.exports=function(){return s?o?t.Blob:i:d?l:void 0}()}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},{}],15:[function(t,e,a){function l(t){if(t)return i(t)}function i(t){for(var e in l.prototype)t[e]=l.prototype[e];return t}e.exports=l,l.prototype.on=l.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},l.prototype.once=function(t,e){function a(){l.off(t,a),e.apply(this,arguments)}var l=this;return this._callbacks=this._callbacks||{},a.fn=e,this.on(t,a),this},l.prototype.off=l.prototype.removeListener=l.prototype.removeAllListeners=l.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var a=this._callbacks[t];if(!a)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var l,i=0;i<a.length;i++)if(l=a[i],l===e||l.fn===e){a.splice(i,1);break}return this},l.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),a=this._callbacks[t];if(a){a=a.slice(0);for(var l=0,i=a.length;l<i;++l)a[l].apply(this,e)}return this},l.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},l.prototype.hasListeners=function(t){return!!this.listeners(t).length}},{}],16:[function(t,e,a){e.exports=function(t,e){var a=function(){};a.prototype=e.prototype,t.prototype=new a,t.prototype.constructor=t}},{}],17:[function(t,e,a){function l(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function i(){var t=arguments,e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+a.humanize(this.diff),!e)return t;var l="color: "+this.color;t=[t[0],l,"color: inherit"].concat(Array.prototype.slice.call(t,1));var i=0,n=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(n=i))}),t.splice(n,0,l),t}function n(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(t){try{null==t?a.storage.removeItem("debug"):a.storage.debug=t}catch(t){}}function o(){var t;try{t=a.storage.debug}catch(t){}return t}function d(){try{return window.localStorage}catch(t){}}a=e.exports=t("./debug"),a.log=n,a.formatArgs=i,a.save=s,a.load=o,a.useColors=l,a.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:d(),a.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],a.formatters.j=function(t){return JSON.stringify(t)},a.enable(o())},{"./debug":18}],18:[function(t,e,a){function l(){return a.colors[c++%a.colors.length]}function i(t){function e(){}function i(){var t=i,e=+new Date,n=e-(r||e);t.diff=n,t.prev=r,t.curr=e,r=e,null==t.useColors&&(t.useColors=a.useColors()),null==t.color&&t.useColors&&(t.color=l());var s=Array.prototype.slice.call(arguments);s[0]=a.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var o=0;s[0]=s[0].replace(/%([a-z%])/g,function(e,l){if("%%"===e)return e;o++;var i=a.formatters[l];if("function"==typeof i){var n=s[o];e=i.call(t,n),s.splice(o,1),o--}return e}),"function"==typeof a.formatArgs&&(s=a.formatArgs.apply(t,s));var d=i.log||a.log||console.log.bind(console);d.apply(t,s)}e.enabled=!1,i.enabled=!0;var n=a.enabled(t)?i:e;return n.namespace=t,n}function n(t){a.save(t);for(var e=(t||"").split(/[\s,]+/),l=e.length,i=0;i<l;i++)e[i]&&(t=e[i].replace(/\*/g,".*?"),"-"===t[0]?a.skips.push(new RegExp("^"+t.substr(1)+"$")):a.names.push(new RegExp("^"+t+"$")))}function s(){a.enable("")}function o(t){var e,l;for(e=0,l=a.skips.length;e<l;e++)if(a.skips[e].test(t))return!1;for(e=0,l=a.names.length;e<l;e++)if(a.names[e].test(t))return!0;return!1}function d(t){return t instanceof Error?t.stack||t.message:t}a=e.exports=i,a.coerce=d,a.disable=s,a.enable=n,a.enabled=o,a.humanize=t("ms"),a.names=[],a.skips=[],a.formatters={};var r,c=0},{ms:25}],19:[function(t,e,a){(function(e){function l(t,e){var l="b"+a.packets[t.type]+t.data.data;return e(l)}function i(t,e,l){if(!e)return a.encodeBase64Packet(t,l);var i=t.data,n=new Uint8Array(i),s=new Uint8Array(1+i.byteLength);s[0]=b[t.type];for(var o=0;o<n.length;o++)s[o+1]=n[o];return l(s.buffer)}function n(t,e,l){if(!e)return a.encodeBase64Packet(t,l);var i=new FileReader;return i.onload=function(){t.data=i.result,a.encodePacket(t,e,!0,l)},i.readAsArrayBuffer(t.data)}function s(t,e,l){if(!e)return a.encodeBase64Packet(t,l);if(v)return n(t,e,l);var i=new Uint8Array(1);i[0]=b[t.type];var s=new y([i.buffer,t.data]);return l(s)}function o(t,e,a){for(var l=new Array(t.length),i=m(t.length,a),n=function(t,a,i){e(a,function(e,a){l[t]=a,i(e,l)})},s=0;s<t.length;s++)n(s,t[s],i)}var d=t("./keys"),r=t("has-binary"),c=t("arraybuffer.slice"),p=t("base64-arraybuffer"),m=t("after"),u=t("utf8"),h=navigator.userAgent.match(/Android/i),g=/PhantomJS/i.test(navigator.userAgent),v=h||g;a.protocol=3;var b=a.packets={open:0,close:1,ping:2, pong:3,message:4,upgrade:5,noop:6},f=d(b),_={type:"error",data:"parser error"},y=t("blob");a.encodePacket=function(t,a,n,o){"function"==typeof a&&(o=a,a=!1),"function"==typeof n&&(o=n,n=null);var d=void 0===t.data?void 0:t.data.buffer||t.data;if(e.ArrayBuffer&&d instanceof ArrayBuffer)return i(t,a,o);if(y&&d instanceof e.Blob)return s(t,a,o);if(d&&d.base64)return l(t,o);var r=b[t.type];return void 0!==t.data&&(r+=n?u.encode(String(t.data)):String(t.data)),o(""+r)},a.encodeBase64Packet=function(t,l){var i="b"+a.packets[t.type];if(y&&t.data instanceof e.Blob){var n=new FileReader;return n.onload=function(){var t=n.result.split(",")[1];l(i+t)},n.readAsDataURL(t.data)}var s;try{s=String.fromCharCode.apply(null,new Uint8Array(t.data))}catch(e){for(var o=new Uint8Array(t.data),d=new Array(o.length),r=0;r<o.length;r++)d[r]=o[r];s=String.fromCharCode.apply(null,d)}return i+=e.btoa(s),l(i)},a.decodePacket=function(t,e,l){if("string"==typeof t||void 0===t){if("b"==t.charAt(0))return a.decodeBase64Packet(t.substr(1),e);if(l)try{t=u.decode(t)}catch(t){return _}var i=t.charAt(0);return Number(i)==i&&f[i]?t.length>1?{type:f[i],data:t.substring(1)}:{type:f[i]}:_}var n=new Uint8Array(t),i=n[0],s=c(t,1);return y&&"blob"===e&&(s=new y([s])),{type:f[i],data:s}},a.decodeBase64Packet=function(t,a){var l=f[t.charAt(0)];if(!e.ArrayBuffer)return{type:l,data:{base64:!0,data:t.substr(1)}};var i=p.decode(t.substr(1));return"blob"===a&&y&&(i=new y([i])),{type:l,data:i}},a.encodePayload=function(t,e,l){function i(t){return t.length+":"+t}function n(t,l){a.encodePacket(t,!!s&&e,!0,function(t){l(null,i(t))})}"function"==typeof e&&(l=e,e=null);var s=r(t);return e&&s?y&&!v?a.encodePayloadAsBlob(t,l):a.encodePayloadAsArrayBuffer(t,l):t.length?void o(t,n,function(t,e){return l(e.join(""))}):l("0:")},a.decodePayload=function(t,e,l){if("string"!=typeof t)return a.decodePayloadAsBinary(t,e,l);"function"==typeof e&&(l=e,e=null);var i;if(""==t)return l(_,0,1);for(var n,s,o="",d=0,r=t.length;d<r;d++){var c=t.charAt(d);if(":"!=c)o+=c;else{if(""==o||o!=(n=Number(o)))return l(_,0,1);if(s=t.substr(d+1,n),o!=s.length)return l(_,0,1);if(s.length){if(i=a.decodePacket(s,e,!0),_.type==i.type&&_.data==i.data)return l(_,0,1);var p=l(i,d+n,r);if(!1===p)return}d+=n,o=""}}return""!=o?l(_,0,1):void 0},a.encodePayloadAsArrayBuffer=function(t,e){function l(t,e){a.encodePacket(t,!0,!0,function(t){return e(null,t)})}return t.length?void o(t,l,function(t,a){var l=a.reduce(function(t,e){var a;return a="string"==typeof e?e.length:e.byteLength,t+a.toString().length+a+2},0),i=new Uint8Array(l),n=0;return a.forEach(function(t){var e="string"==typeof t,a=t;if(e){for(var l=new Uint8Array(t.length),s=0;s<t.length;s++)l[s]=t.charCodeAt(s);a=l.buffer}e?i[n++]=0:i[n++]=1;for(var o=a.byteLength.toString(),s=0;s<o.length;s++)i[n++]=parseInt(o[s]);i[n++]=255;for(var l=new Uint8Array(a),s=0;s<l.length;s++)i[n++]=l[s]}),e(i.buffer)}):e(new ArrayBuffer(0))},a.encodePayloadAsBlob=function(t,e){function l(t,e){a.encodePacket(t,!0,!0,function(t){var a=new Uint8Array(1);if(a[0]=1,"string"==typeof t){for(var l=new Uint8Array(t.length),i=0;i<t.length;i++)l[i]=t.charCodeAt(i);t=l.buffer,a[0]=0}for(var n=t instanceof ArrayBuffer?t.byteLength:t.size,s=n.toString(),o=new Uint8Array(s.length+1),i=0;i<s.length;i++)o[i]=parseInt(s[i]);if(o[s.length]=255,y){var d=new y([a.buffer,o.buffer,t]);e(null,d)}})}o(t,l,function(t,a){return e(new y(a))})},a.decodePayloadAsBinary=function(t,e,l){"function"==typeof e&&(l=e,e=null);for(var i=t,n=[],s=!1;i.byteLength>0;){for(var o=new Uint8Array(i),d=0===o[0],r="",p=1;255!=o[p];p++){if(r.length>310){s=!0;break}r+=o[p]}if(s)return l(_,0,1);i=c(i,2+r.length),r=parseInt(r);var m=c(i,0,r);if(d)try{m=String.fromCharCode.apply(null,new Uint8Array(m))}catch(t){var u=new Uint8Array(m);m="";for(var p=0;p<u.length;p++)m+=String.fromCharCode(u[p])}n.push(m),i=c(i,r)}var h=n.length;n.forEach(function(t,i){l(a.decodePacket(t,e,!0),i,h)})}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},{"./keys":20,after:11,"arraybuffer.slice":12,"base64-arraybuffer":13,blob:14,"has-binary":21,utf8:29}],20:[function(t,e,a){e.exports=Object.keys||function(t){var e=[],a=Object.prototype.hasOwnProperty;for(var l in t)a.call(t,l)&&e.push(l);return e}},{}],21:[function(t,e,a){(function(a){function l(t){function e(t){if(!t)return!1;if(a.Buffer&&a.Buffer.isBuffer(t)||a.ArrayBuffer&&t instanceof ArrayBuffer||a.Blob&&t instanceof Blob||a.File&&t instanceof File)return!0;if(i(t)){for(var l=0;l<t.length;l++)if(e(t[l]))return!0}else if(t&&"object"==typeof t){t.toJSON&&(t=t.toJSON());for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return!0}return!1}return e(t)}var i=t("isarray");e.exports=l}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},{isarray:24}],22:[function(t,e,a){try{e.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){e.exports=!1}},{}],23:[function(t,e,a){var l=[].indexOf;e.exports=function(t,e){if(l)return t.indexOf(e);for(var a=0;a<t.length;++a)if(t[a]===e)return a;return-1}},{}],24:[function(t,e,a){e.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},{}],25:[function(t,e,a){function l(t){if(t=""+t,!(t.length>1e4)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var a=parseFloat(e[1]),l=(e[2]||"ms").toLowerCase();switch(l){case"years":case"year":case"yrs":case"yr":case"y":return a*p;case"days":case"day":case"d":return a*c;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*d;case"seconds":case"second":case"secs":case"sec":case"s":return a*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a}}}}function i(t){return t>=c?Math.round(t/c)+"d":t>=r?Math.round(t/r)+"h":t>=d?Math.round(t/d)+"m":t>=o?Math.round(t/o)+"s":t+"ms"}function n(t){return s(t,c,"day")||s(t,r,"hour")||s(t,d,"minute")||s(t,o,"second")||t+" ms"}function s(t,e,a){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+a:Math.ceil(t/e)+" "+a+"s"}var o=1e3,d=60*o,r=60*d,c=24*r,p=365.25*c;e.exports=function(t,e){return e=e||{},"string"==typeof t?l(t):e.long?n(t):i(t)}},{}],26:[function(t,e,a){(function(t){var a=/^[\],:{}\s]*$/,l=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,n=/(?:^|:|,)(?:\s*\[)+/g,s=/^\s+/,o=/\s+$/;e.exports=function(e){return"string"==typeof e&&e?(e=e.replace(s,"").replace(o,""),t.JSON&&JSON.parse?JSON.parse(e):a.test(e.replace(l,"@").replace(i,"]").replace(n,""))?new Function("return "+e)():void 0):null}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},{}],27:[function(t,e,a){a.encode=function(t){var e="";for(var a in t)t.hasOwnProperty(a)&&(e.length&&(e+="&"),e+=encodeURIComponent(a)+"="+encodeURIComponent(t[a]));return e},a.decode=function(t){for(var e={},a=t.split("&"),l=0,i=a.length;l<i;l++){var n=a[l].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}},{}],28:[function(t,e,a){var l=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(t){var e=t,a=t.indexOf("["),n=t.indexOf("]");a!=-1&&n!=-1&&(t=t.substring(0,a)+t.substring(a,n).replace(/:/g,";")+t.substring(n,t.length));for(var s=l.exec(t||""),o={},d=14;d--;)o[i[d]]=s[d]||"";return a!=-1&&n!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o}},{}],29:[function(e,a,l){(function(e){!function(i){function n(t){for(var e,a,l=[],i=0,n=t.length;i<n;)e=t.charCodeAt(i++),e>=55296&&e<=56319&&i<n?(a=t.charCodeAt(i++),56320==(64512&a)?l.push(((1023&e)<<10)+(1023&a)+65536):(l.push(e),i--)):l.push(e);return l}function s(t){for(var e,a=t.length,l=-1,i="";++l<a;)e=t[l],e>65535&&(e-=65536,i+=y(e>>>10&1023|55296),e=56320|1023&e),i+=y(e);return i}function o(t){if(t>=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function d(t,e){return y(t>>e&63|128)}function r(t){if(0==(4294967168&t))return y(t);var e="";return 0==(4294965248&t)?e=y(t>>6&31|192):0==(4294901760&t)?(o(t),e=y(t>>12&15|224),e+=d(t,6)):0==(4292870144&t)&&(e=y(t>>18&7|240),e+=d(t,12),e+=d(t,6)),e+=y(63&t|128)}function c(t){for(var e,a=n(t),l=a.length,i=-1,s="";++i<l;)e=a[i],s+=r(e);return s}function p(){if(_>=f)throw Error("Invalid byte index");var t=255&b[_];if(_++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function m(){var t,e,a,l,i;if(_>f)throw Error("Invalid byte index");if(_==f)return!1;if(t=255&b[_],_++,0==(128&t))return t;if(192==(224&t)){var e=p();if(i=(31&t)<<6|e,i>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&t)){if(e=p(),a=p(),i=(15&t)<<12|e<<6|a,i>=2048)return o(i),i;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=p(),a=p(),l=p(),i=(15&t)<<18|e<<12|a<<6|l,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}function u(t){b=n(t),f=b.length,_=0;for(var e,a=[];(e=m())!==!1;)a.push(e);return s(a)}var h="object"==typeof l&&l,g="object"==typeof a&&a&&a.exports==h&&a,v="object"==typeof e&&e;v.global!==v&&v.window!==v||(i=v);var b,f,_,y=String.fromCharCode,k={version:"2.0.0",encode:c,decode:u};if("function"==typeof t&&"object"==typeof t.amd&&t.amd)t(function(){return k});else if(h&&!h.nodeType)if(g)g.exports=k;else{var x={},w=x.hasOwnProperty;for(var $ in k)w.call(k,$)&&(h[$]=k[$])}else i.utf8=k}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{})},{}],30:[function(t,e,a){"use strict";function l(t){var e="";do e=o[t%d]+e,t=Math.floor(t/d);while(t>0);return e}function i(t){var e=0;for(p=0;p<t.length;p++)e=e*d+r[t.charAt(p)];return e}function n(){var t=l(+new Date);return t!==s?(c=0,s=t):t+"."+l(c++)}for(var s,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),d=64,r={},c=0,p=0;p<d;p++)r[o[p]]=p;n.encode=l,n.decode=i,e.exports=n},{}],31:[function(t,e,a){function l(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var a,l=i(t),n=l.source,r=l.id,c=l.path,p=d[r]&&c in d[r].nsps,m=e.forceNew||e["force new connection"]||!1===e.multiplex||p;return m?(o("ignoring socket cache for %s",n),a=s(n,e)):(d[r]||(o("new io instance for %s",n),d[r]=s(n,e)),a=d[r]),a.socket(l.path)}var i=t("./url"),n=t("socket.io-parser"),s=t("./manager"),o=t("debug")("socket.io-client");e.exports=a=l;var d=a.managers={};a.protocol=n.protocol,a.connect=l,a.Manager=t("./manager"),a.Socket=t("./socket")},{"./manager":32,"./socket":34,"./url":35,debug:39,"socket.io-parser":47}],32:[function(t,e,a){function l(t,e){return this instanceof l?(t&&"object"==typeof t&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new m({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=[],this.encoder=new o.Encoder,this.decoder=new o.Decoder,this.autoConnect=e.autoConnect!==!1,void(this.autoConnect&&this.open())):new l(t,e)}var i=t("engine.io-client"),n=t("./socket"),s=t("component-emitter"),o=t("socket.io-parser"),d=t("./on"),r=t("component-bind"),c=t("debug")("socket.io-client:manager"),p=t("indexof"),m=t("backo2"),u=Object.prototype.hasOwnProperty;e.exports=l,l.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var t in this.nsps)u.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},l.prototype.updateSocketIds=function(){for(var t in this.nsps)u.call(this.nsps,t)&&(this.nsps[t].id=this.engine.id)},s(l.prototype),l.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},l.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},l.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},l.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},l.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},l.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},l.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},l.prototype.open=l.prototype.connect=function(t){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=i(this.uri,this.opts);var e=this.engine,a=this;this.readyState="opening",this.skipReconnect=!1;var l=d(e,"open",function(){a.onopen(),t&&t()}),n=d(e,"error",function(e){if(c("connect_error"),a.cleanup(),a.readyState="closed",a.emitAll("connect_error",e),t){var l=new Error("Connection error");l.data=e,t(l)}else a.maybeReconnectOnOpen()});if(!1!==this._timeout){var s=this._timeout;c("connect attempt will timeout after %d",s);var o=setTimeout(function(){c("connect attempt timed out after %d",s),l.destroy(),e.close(),e.emit("error","timeout"),a.emitAll("connect_timeout",s)},s);this.subs.push({destroy:function(){clearTimeout(o)}})}return this.subs.push(l),this.subs.push(n),this},l.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(d(t,"data",r(this,"ondata"))),this.subs.push(d(t,"ping",r(this,"onping"))),this.subs.push(d(t,"pong",r(this,"onpong"))),this.subs.push(d(t,"error",r(this,"onerror"))),this.subs.push(d(t,"close",r(this,"onclose"))),this.subs.push(d(this.decoder,"decoded",r(this,"ondecoded")))},l.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},l.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},l.prototype.ondata=function(t){this.decoder.add(t)},l.prototype.ondecoded=function(t){this.emit("packet",t)},l.prototype.onerror=function(t){c("error",t),this.emitAll("error",t)},l.prototype.socket=function(t){function e(){~p(l.connecting,a)||l.connecting.push(a)}var a=this.nsps[t];if(!a){a=new n(this,t),this.nsps[t]=a;var l=this;a.on("connecting",e),a.on("connect",function(){a.id=l.engine.id}),this.autoConnect&&e()}return a},l.prototype.destroy=function(t){var e=p(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},l.prototype.packet=function(t){c("writing packet %j",t);var e=this;e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(a){for(var l=0;l<a.length;l++)e.engine.write(a[l],t.options);e.encoding=!1,e.processPacketQueue()}))},l.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},l.prototype.cleanup=function(){c("cleanup");for(var t;t=this.subs.shift();)t.destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},l.prototype.close=l.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()},l.prototype.onclose=function(t){c("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},l.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 a=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(a)}})}},l.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},{"./on":33,"./socket":34,backo2:36,"component-bind":37,"component-emitter":38,debug:39,"engine.io-client":1,indexof:42,"socket.io-parser":47}],33:[function(t,e,a){function l(t,e,a){return t.on(e,a),{destroy:function(){t.removeListener(e,a)}}}e.exports=l},{}],34:[function(t,e,a){function l(t,e){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.io.autoConnect&&this.open()}var i=t("socket.io-parser"),n=t("component-emitter"),s=t("to-array"),o=t("./on"),d=t("component-bind"),r=t("debug")("socket.io-client:socket"),c=t("has-binary");e.exp