-
Notifications
You must be signed in to change notification settings - Fork 6
/
bundle.js
5 lines (5 loc) · 137 KB
/
bundle.js
1
2
3
4
5
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.kiwiClient=e()}}(function(){var e;return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[s]={exports:{}};e[s][0].call(f.exports,function(t){var n=e[s][1][t];return i(n?n:t)},f,f.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t){"use strict";function n(e){if(!e)return void console.error("must have options parameter");var t=this;return t instanceof n?(a.call(t),t.client_id=e.client_id||o(23).toString("hex"),r("my cilent id is: "+t.client_id),t.ws_addr=e.addr||"localhost:3000/tracker",t.report_interval=e.report_interval||3e3,t.peers={},t.ws_conn=null,t.piecer_ok_percent=0,t._peers_num=0,t._peers_connected_num=0,t._openSocket(),t._reportStatus(),void t._send({type:"register",client_id:t.client_id})):new n(e)}t.exports=n;var r=e("debug")("kiwi-web-client"),i=e("simple-peer"),o=e("randombytes"),s=e("socket.io-client"),a=e("events").EventEmitter,c=e("inherits"),u=3e3;c(n,a),n.prototype._reportStatus=function(){var e=this;setInterval(function(){var t={type:"status",piecer_ok_percent:e._peers_num>0?e._peers_connected_num/e._peers_num:0,upload_kbs:0};e._send(t)},e.report_interval)},n.prototype._openSocket=function(){var e=this;e.ws_conn=s.connect(e.ws_addr),e.ws_conn.on("message",e._onSocketMessage.bind(e))},n.prototype._send=function(e){r("send message to server: ",JSON.stringify(e)),this.ws_conn.emit("message",e)},n.prototype._destroy=function(){var e=this;for(var t in e.peers)e.peers[t]&&e.peers[t].destroy();e.peers={},clearInterval(),e.ws_conn&&e.ws_conn.destroy()},n.prototype._generateOffers=function(e,t){function n(){var e=o(20).toString("hex");r("creating peer (from _generateOffers)");var t=a.peers[e]=new i({initiator:!0,trickle:!1});a._peers_num++,t.once("signal",function(t){c.push({offer:t,offer_id:e}),s()}),t.offerTimeout=setTimeout(function(){r("tracker timeout: destroying peer"),t.trackerTimeout=null,delete a.peers[e],a._peers_num--,t.destroy()},u),t.offerTimeout.unref&&t.offerTimeout.unref()}function s(){c.length===e&&(r("generated %s offers",e),t(c))}var a=this,c=[];r("generating %s offers",e);for(var f=0;e>f;++f)n();s()},n.prototype._handleGenOfferMessage=function(e){var t=this;t._generateOffers(e.numwant,function(e){e&&e.length>0&&t._send({type:"offers",offers:e,client_id:t.client_id})})},n.prototype._handleSdpMessage=function(e){var t=this;if(!e.client_id||e.client_id!=t.client_id){var n;if(e.offer&&e.client_id&&(r("creating peer (from remote offer)"),n=t.peers[e.offer_id]=new i({trickle:!1}),t._peers_num++,n.owner_id=t.client_id,n.signal(e.offer),n.once("signal",function(n){var r={type:"sdp",client_id:t.client_id,to_client_id:e.client_id,answer:n,offer_id:e.offer_id};t._send(r)}),n.on("connect",function(){t._peers_connected_num++,t.emit("peer",n),r("client "+e.client_id+" to me connected successful!")})),e.answer&&e.client_id){var o=e.offer_id;n=t.peers[o],n?(n.owner_id=t.client_id,n.signal(e.answer),n.on("connect",function(){t._peers_connected_num++,t.emit("peer",n),r("client i to "+e.client_id+" connected successful!")}),clearTimeout(n.offerTimeout),n.offerTimeout=null,delete t.peers[o]):r("got unexpected answer: "+JSON.stringify(e.answer))}}},n.prototype._onSocketMessage=function(e){r("received server message: "+JSON.stringify(e));var t=this;if(e.type)switch(e.type){case"sdp":t._handleSdpMessage(e);break;case"gen_offer":t._handleGenOfferMessage(e)}}},{debug:13,events:67,inherits:32,randombytes:41,"simple-peer":49,"socket.io-client":50}],2:[function(e,t){function n(e,t,n){function i(e,r){if(i.count<=0)throw new Error("after called too many times");--i.count,e?(o=!0,t(e),t=n):0!==i.count||o||t(null,r)}var o=!1;return n=n||r,i.count=e,0===e?t():i}function r(){}t.exports=n},{}],3:[function(e,t){t.exports=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(0>t&&(t+=r),0>n&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var i=new Uint8Array(e),o=new Uint8Array(n-t),s=t,a=0;n>s;s++,a++)o[a]=i[s];return o.buffer}},{}],4:[function(e,t){function n(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},{}],5:[function(e,t,n){!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),r=0;r<e.length;r++)t[e.charCodeAt(r)]=r;n.encode=function(t){var n,r=new Uint8Array(t),i=r.length,o="";for(n=0;i>n;n+=3)o+=e[r[n]>>2],o+=e[(3&r[n])<<4|r[n+1]>>4],o+=e[(15&r[n+1])<<2|r[n+2]>>6],o+=e[63&r[n+2]];return i%3===2?o=o.substring(0,o.length-1)+"=":i%3===1&&(o=o.substring(0,o.length-2)+"=="),o},n.decode=function(e){var n,r,i,o,s,a=.75*e.length,c=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var f=new ArrayBuffer(a),h=new Uint8Array(f);for(n=0;c>n;n+=4)r=t[e.charCodeAt(n)],i=t[e.charCodeAt(n+1)],o=t[e.charCodeAt(n+2)],s=t[e.charCodeAt(n+3)],h[u++]=r<<2|i>>4,h[u++]=(15&i)<<4|o>>2,h[u++]=(3&o)<<6|63&s;return f}}()},{}],6:[function(e,t){(function(e){function n(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.buffer instanceof ArrayBuffer){var r=n.buffer;if(n.byteLength!==r.byteLength){var i=new Uint8Array(n.byteLength);i.set(new Uint8Array(r,n.byteOffset,n.byteLength)),r=i.buffer}e[t]=r}}}function r(e,t){t=t||{};var r=new o;n(e);for(var i=0;i<e.length;i++)r.append(e[i]);return t.type?r.getBlob(t.type):r.getBlob()}function i(e,t){return n(e),new Blob(e,t||{})}var o=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,s=function(){try{var e=new Blob(["hi"]);return 2===e.size}catch(t){return!1}}(),a=s&&function(){try{var e=new Blob([new Uint8Array([1,2])]);return 2===e.size}catch(t){return!1}}(),c=o&&o.prototype.append&&o.prototype.getBlob;t.exports=function(){return s?a?e.Blob:i:c?r:void 0}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(e,t,n){(function(t){"use strict";var r=e("buffer"),i=r.Buffer,o=r.SlowBuffer,s=r.kMaxLength||2147483647;n.alloc=function(e,t,n){if("function"==typeof i.alloc)return i.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>s)throw new RangeError("size is too large");var r=n,o=t;void 0===o&&(r=void 0,o=0);var a=new i(e);if("string"==typeof o)for(var c=new i(o,r),u=c.length,f=-1;++f<e;)a[f]=c[f%u];else a.fill(o);return a},n.allocUnsafe=function(e){if("function"==typeof i.allocUnsafe)return i.allocUnsafe(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>s)throw new RangeError("size is too large");return new i(e)},n.from=function(e,n,r){if("function"==typeof i.from&&(!t.Uint8Array||Uint8Array.from!==i.from))return i.from(e,n,r);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new i(e,n);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var o=n;if(1===arguments.length)return new i(e);"undefined"==typeof o&&(o=0);var s=r;if("undefined"==typeof s&&(s=e.byteLength-o),o>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(s>e.byteLength-o)throw new RangeError("'length' is out of bounds");return new i(e.slice(o,o+s))}if(i.isBuffer(e)){var a=new i(e.length);return e.copy(a,0,0,e.length),a}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new i(e);if("Buffer"===e.type&&Array.isArray(e.data))return new i(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},n.allocUnsafeSlow=function(e){if("function"==typeof i.allocUnsafeSlow)return i.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=s)throw new RangeError("size is too large");return new o(e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:66}],8:[function(e,t){var n=[].slice;t.exports=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}},{}],9:[function(e,t){function n(e){return e?r(e):void 0}function r(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,i=n.length;i>r;++r)n[r].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],10:[function(e,t){function n(e){return e?r(e):void 0}function r(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n){n=n.slice(0);for(var r=0,i=n.length;i>r;++r)n[r].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],11:[function(e,t){t.exports=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],12:[function(e,t,n){(function(e){function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===y(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function s(e){return"number"==typeof e}function a(e){return"string"==typeof e}function c(e){return"symbol"==typeof e}function u(e){return void 0===e}function f(e){return"[object RegExp]"===y(e)}function h(e){return"object"==typeof e&&null!==e}function l(e){return"[object Date]"===y(e)}function p(e){return"[object Error]"===y(e)||e instanceof Error}function d(e){return"function"==typeof e}function g(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function y(e){return Object.prototype.toString.call(e)}n.isArray=t,n.isBoolean=r,n.isNull=i,n.isNullOrUndefined=o,n.isNumber=s,n.isString=a,n.isSymbol=c,n.isUndefined=u,n.isRegExp=f,n.isObject=h,n.isDate=l,n.isError=p,n.isFunction=d,n.isPrimitive=g,n.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../../../../../../../../../usr/local/lib/node_modules/.browserify_npminstall/is-buffer/1.1.4/is-buffer/index.js")})},{"../../../../../../../../../../usr/local/lib/node_modules/.browserify_npminstall/is-buffer/1.1.4/is-buffer/index.js":69}],13:[function(e,t,n){function r(){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 e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0,o=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))}),e.splice(o,0,r),e}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(t){}}function a(){var e;try{e=n.storage.debug}catch(t){}return e}function c(){try{return window.localStorage}catch(e){}}n=t.exports=e("./debug"),n.log=o,n.formatArgs=i,n.save=s,n.load=a,n.useColors=r,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(a())},{"./debug":14}],14:[function(e,t,n){function r(){return n.colors[f++%n.colors.length]}function i(e){function t(){}function i(){var e=i,t=+new Date,o=t-(u||t);e.diff=o,e.prev=u,e.curr=t,u=t,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=r());var s=Array.prototype.slice.call(arguments);s[0]=n.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var a=0;s[0]=s[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;a++;var i=n.formatters[r];if("function"==typeof i){var o=s[a];t=i.call(e,o),s.splice(a,1),a--}return t}),"function"==typeof n.formatArgs&&(s=n.formatArgs.apply(e,s));var c=i.log||n.log||console.log.bind(console);c.apply(e,s)}t.enabled=!1,i.enabled=!0;var o=n.enabled(e)?i:t;return o.namespace=e,o}function o(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,i=0;r>i;i++)t[i]&&(e=t[i].replace(/\*/g,".*?"),"-"===e[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))}function s(){n.enable("")}function a(e){var t,r;for(t=0,r=n.skips.length;r>t;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;r>t;t++)if(n.names[t].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}n=t.exports=i,n.coerce=c,n.disable=s,n.enable=o,n.enabled=a,n.humanize=e("ms"),n.names=[],n.skips=[],n.formatters={};var u,f=0},{ms:36}],15:[function(e,t){t.exports=e("./lib/index")},{"./lib/index":16}],16:[function(e,t){t.exports=e("./socket"),t.exports.parser=e("engine.io-parser")},{"./socket":17,"engine.io-parser":25}],17:[function(e,t){(function(n){function r(e,t){if(!(this instanceof r))return new r(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=f(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=f(t.host).host),this.secure=null!=t.secure?t.secure:n.location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||(n.location?location.hostname:"localhost"),this.port=t.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=l.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate?t.perMessageDeflate||{}:!1,!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized?null:t.rejectUnauthorized;var i="object"==typeof n&&n;i.global===i&&t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function i(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var o=e("./transports/index"),s=e("component-emitter"),a=e("debug")("engine.io-client:socket"),c=e("indexof"),u=e("engine.io-parser"),f=e("parseuri"),h=e("parsejson"),l=e("parseqs");t.exports=r,r.priorWebsocketSuccess=!1,s(r.prototype),r.protocol=u.protocol,r.Socket=r,r.Transport=e("./transport"),r.transports=e("./transports/index"),r.parser=e("engine.io-parser"),r.prototype.createTransport=function(e){a('creating transport "%s"',e);var t=i(this.query);t.EIO=u.protocol,t.transport=e,this.id&&(t.sid=this.id);var n=new o[e]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,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 n},r.prototype.open=function(){var e;if(this.rememberUpgrade&&r.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(n){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},r.prototype.setTransport=function(e){a("setting transport %s",e.name);var t=this;this.transport&&(a("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")})},r.prototype.probe=function(e){function t(){if(l.onlyBinaryUpgrades){var t=!this.supportsBinary&&l.transport.supportsBinary;h=h||t}h||(a('probe transport "%s" opened',e),f.send([{type:"ping",data:"probe"}]),f.once("packet",function(t){if(!h)if("pong"===t.type&&"probe"===t.data){if(a('probe transport "%s" pong',e),l.upgrading=!0,l.emit("upgrading",f),!f)return;r.priorWebsocketSuccess="websocket"===f.name,a('pausing current transport "%s"',l.transport.name),l.transport.pause(function(){h||"closed"!==l.readyState&&(a("changing transport and sending upgrade packet"),u(),l.setTransport(f),f.send([{type:"upgrade"}]),l.emit("upgrade",f),f=null,l.upgrading=!1,l.flush())})}else{a('probe transport "%s" failed',e);var n=new Error("probe error");n.transport=f.name,l.emit("upgradeError",n)}}))}function n(){h||(h=!0,u(),f.close(),f=null)}function i(t){var r=new Error("probe error: "+t);r.transport=f.name,n(),a('probe transport "%s" failed because of error: %s',e,t),l.emit("upgradeError",r)}function o(){i("transport closed")}function s(){i("socket closed")}function c(e){f&&e.name!==f.name&&(a('"%s" works - aborting "%s"',e.name,f.name),n())}function u(){f.removeListener("open",t),f.removeListener("error",i),f.removeListener("close",o),l.removeListener("close",s),l.removeListener("upgrading",c)}a('probing transport "%s"',e);var f=this.createTransport(e,{probe:1}),h=!1,l=this;r.priorWebsocketSuccess=!1,f.once("open",t),f.once("error",i),f.once("close",o),this.once("close",s),this.once("upgrading",c),f.open()},r.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var e=0,t=this.upgrades.length;t>e;e++)this.probe(this.upgrades[e])}},r.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(a('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(h(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 a('packet received with socket readyState "%s"',this.readyState)},r.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))},r.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)},r.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){a("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},r.prototype.ping=function(){var e=this;this.sendPacket("ping",function(){e.emit("ping")})},r.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},r.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(a("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},r.prototype.write=r.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},r.prototype.sendPacket=function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){n=n||{},n.compress=!1!==n.compress;var i={type:e,data:t,options:n};this.emit("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}},r.prototype.close=function(){function e(){r.onClose("forced close"),a("socket closing - telling transport to close"),r.transport.close()}function t(){r.removeListener("upgrade",t),r.removeListener("upgradeError",t),e()}function n(){r.once("upgrade",t),r.once("upgradeError",t)}if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var r=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?n():e()}):this.upgrading?n():e()}return this},r.prototype.onError=function(e){a("socket error %j",e),r.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},r.prototype.onClose=function(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){a('socket close with reason: "%s"',e);var n=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",e,t),n.writeBuffer=[],n.prevBufferLen=0}},r.prototype.filterUpgrades=function(e){for(var t=[],n=0,r=e.length;r>n;n++)~c(this.transports,e[n])&&t.push(e[n]);return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./transport":18,"./transports/index":19,"component-emitter":9,debug:13,"engine.io-parser":25,indexof:31,parsejson:37,parseqs:38,parseuri:39}],18:[function(e,t){function n(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders}var r=e("engine.io-parser"),i=e("component-emitter");t.exports=n,i(n.prototype),n.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},n.prototype.open=function(){return("closed"===this.readyState||""===this.readyState)&&(this.readyState="opening",this.doOpen()),this},n.prototype.close=function(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this},n.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},n.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},n.prototype.onData=function(e){var t=r.decodePacket(e,this.socket.binaryType);this.onPacket(t)},n.prototype.onPacket=function(e){this.emit("packet",e)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],19:[function(e,t,n){(function(t){function r(e){var n,r=!1,a=!1,c=!1!==e.jsonp;if(t.location){var u="https:"===location.protocol,f=location.port;f||(f=u?443:80),r=e.hostname!==location.hostname||f!==e.port,a=e.secure!==u}if(e.xdomain=r,e.xscheme=a,n=new i(e),"open"in n&&!e.forceJSONP)return new o(e);if(!c)throw new Error("JSONP disabled");return new s(e)}var i=e("xmlhttprequest-ssl"),o=e("./polling-xhr"),s=e("./polling-jsonp"),a=e("./websocket");n.polling=r,n.websocket=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling-jsonp":20,"./polling-xhr":21,"./websocket":23,"xmlhttprequest-ssl":24}],20:[function(e,t){(function(n){function r(){}function i(e){o.call(this,e),this.query=this.query||{},a||(n.___eio||(n.___eio=[]),a=n.___eio),this.index=a.length;var t=this;a.push(function(e){t.onData(e)}),this.query.j=this.index,n.document&&n.addEventListener&&n.addEventListener("beforeunload",function(){t.script&&(t.script.onerror=r)},!1)}var o=e("./polling"),s=e("component-inherit");t.exports=i;var a,c=/\n/g,u=/\\n/g;s(i,o),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),o.prototype.doClose.call(this)},i.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 n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t;var r="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);r&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},i.prototype.doWrite=function(e,t){function n(){r(),t()}function r(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(e){i.onError("jsonp polling iframe removal error",e)}try{var t='<iframe src="javascript:0" name="'+i.iframeId+'">';o=document.createElement(t)}catch(e){o=document.createElement("iframe"),o.name=i.iframeId,o.src="javascript:0"}o.id=i.iframeId,i.form.appendChild(o),i.iframe=o}var i=this;if(!this.form){var o,s=document.createElement("form"),a=document.createElement("textarea"),f=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=f,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}this.form.action=this.uri(),r(),e=e.replace(u,"\\\n"),this.area.value=e.replace(c,"\\n");try{this.form.submit()}catch(h){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===i.iframe.readyState&&n()}:this.iframe.onload=n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling":22,"component-inherit":11}],21:[function(e,t){(function(n){function r(){}function i(e){if(c.call(this,e),n.location){var t="https:"===location.protocol,r=location.port;r||(r=t?443:80),this.xd=e.hostname!==n.location.hostname||r!==e.port,this.xs=e.secure!==t}else this.extraHeaders=e.extraHeaders}function o(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function s(){for(var e in o.requests)o.requests.hasOwnProperty(e)&&o.requests[e].abort()}var a=e("xmlhttprequest-ssl"),c=e("./polling"),u=e("component-emitter"),f=e("component-inherit"),h=e("debug")("engine.io-client:polling-xhr");t.exports=i,t.exports.Request=o,f(i,c),i.prototype.supportsBinary=!0,i.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.extraHeaders=this.extraHeaders,new o(e)},i.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,r=this.request({method:"POST",data:e,isBinary:n}),i=this;r.on("success",t),r.on("error",function(e){i.onError("xhr post error",e)}),this.sendXhr=r},i.prototype.doPoll=function(){h("xhr poll");var e=this.request(),t=this;e.on("data",function(e){t.onData(e)}),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e},u(o.prototype),o.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new a(e),r=this;try{h("xhr open %s: %s",this.method,this.uri),
t.open(this.method,this.uri,this.async);try{if(this.extraHeaders){t.setDisableHeaderCheck(!0);for(var i in this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this.extraHeaders[i])}}catch(s){}if(this.supportsBinary&&(t.responseType="arraybuffer"),"POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(s){}try{t.setRequestHeader("Accept","*/*")}catch(s){}"withCredentials"in t&&(t.withCredentials=!0),this.hasXDR()?(t.onload=function(){r.onLoad()},t.onerror=function(){r.onError(t.responseText)}):t.onreadystatechange=function(){4===t.readyState&&(200===t.status||1223===t.status?r.onLoad():setTimeout(function(){r.onError(t.status)},0))},h("xhr data %s",this.data),t.send(this.data)}catch(s){return void setTimeout(function(){r.onError(s)},0)}n.document&&(this.index=o.requestsCount++,o.requests[this.index]=this)},o.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},o.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},o.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},o.prototype.cleanup=function(e){if("undefined"!=typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=r:this.xhr.onreadystatechange=r,e)try{this.xhr.abort()}catch(t){}n.document&&delete o.requests[this.index],this.xhr=null}},o.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(n){}if("application/octet-stream"===t)e=this.xhr.response||this.xhr.responseText;else if(this.supportsBinary)try{e=String.fromCharCode.apply(null,new Uint8Array(this.xhr.response))}catch(n){for(var r=new Uint8Array(this.xhr.response),i=[],o=0,s=r.length;s>o;o++)i.push(r[o]);e=String.fromCharCode.apply(null,i)}else e=this.xhr.responseText}catch(n){this.onError(n)}null!=e&&this.onData(e)},o.prototype.hasXDR=function(){return"undefined"!=typeof n.XDomainRequest&&!this.xs&&this.enablesXDR},o.prototype.abort=function(){this.cleanup()},o.requestsCount=0,o.requests={},n.document&&(n.attachEvent?n.attachEvent("onunload",s):n.addEventListener&&n.addEventListener("beforeunload",s,!1))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling":22,"component-emitter":9,"component-inherit":11,debug:13,"xmlhttprequest-ssl":24}],22:[function(e,t){function n(e){var t=e&&e.forceBase64;(!u||t)&&(this.supportsBinary=!1),r.call(this,e)}var r=e("../transport"),i=e("parseqs"),o=e("engine.io-parser"),s=e("component-inherit"),a=e("yeast"),c=e("debug")("engine.io-client:polling");t.exports=n;var u=function(){var t=e("xmlhttprequest-ssl"),n=new t({xdomain:!1});return null!=n.responseType}();s(n,r),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(e){function t(){c("paused"),n.readyState="paused",e()}var n=this;if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(c("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){c("pre-pause polling complete"),--r||t()})),this.writable||(c("we are currently writing - waiting to pause"),r++,this.once("drain",function(){c("pre-pause writing complete"),--r||t()}))}else t()},n.prototype.poll=function(){c("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},n.prototype.onData=function(e){var t=this;c("polling got data %s",e);var n=function(e){return"opening"===t.readyState&&t.onOpen(),"close"===e.type?(t.onClose(),!1):void t.onPacket(e)};o.decodePayload(e,this.socket.binaryType,n),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():c('ignoring poll - transport state "%s"',this.readyState))},n.prototype.doClose=function(){function e(){c("writing close packet"),t.write([{type:"close"}])}var t=this;"open"===this.readyState?(c("transport open - closing"),e()):(c("transport not open - deferring close"),this.once("open",e))},n.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};o.encodePayload(e,this.supportsBinary,function(e){t.doWrite(e,n)})},n.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";!1!==this.timestampRequests&&(e[this.timestampParam]=a()),this.supportsBinary||e.sid||(e.b64=1),e=i.encode(e),this.port&&("https"===t&&443!==this.port||"http"===t&&80!==this.port)&&(n=":"+this.port),e.length&&(e="?"+e);var r=-1!==this.hostname.indexOf(":");return t+"://"+(r?"["+this.hostname+"]":this.hostname)+n+this.path+e}},{"../transport":18,"component-inherit":11,debug:13,"engine.io-parser":25,parseqs:38,"xmlhttprequest-ssl":24,yeast:62}],23:[function(e,t){(function(n){function r(e){var t=e&&e.forceBase64;t&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,i.call(this,e)}var i=e("../transport"),o=e("engine.io-parser"),s=e("parseqs"),a=e("component-inherit"),c=e("yeast"),u=e("debug")("engine.io-client:websocket"),f=n.WebSocket||n.MozWebSocket,h=f;if(!h&&"undefined"==typeof window)try{h=e("ws")}catch(l){}t.exports=r,a(r,i),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=void 0,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders);try{this.ws=f?new h(e):new h(e,t,n)}catch(r){return this.emit("error",r)}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()}},r.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)}},r.prototype.write=function(e){function t(){r.emit("flush"),setTimeout(function(){r.writable=!0,r.emit("drain")},0)}var r=this;this.writable=!1;for(var i=e.length,s=0,a=i;a>s;s++)!function(e){o.encodePacket(e,r.supportsBinary,function(o){if(!f){var s={};if(e.options&&(s.compress=e.options.compress),r.perMessageDeflate){var a="string"==typeof o?n.Buffer.byteLength(o):o.length;a<r.perMessageDeflate.threshold&&(s.compress=!1)}}try{f?r.ws.send(o):r.ws.send(o,s)}catch(c){u("websocket closed before onclose event")}--i||t()})}(e[s])},r.prototype.onClose=function(){i.prototype.onClose.call(this)},r.prototype.doClose=function(){"undefined"!=typeof this.ws&&this.ws.close()},r.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";this.port&&("wss"===t&&443!==this.port||"ws"===t&&80!==this.port)&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=c()),this.supportsBinary||(e.b64=1),e=s.encode(e),e.length&&(e="?"+e);var r=-1!==this.hostname.indexOf(":");return t+"://"+(r?"["+this.hostname+"]":this.hostname)+n+this.path+e},r.prototype.check=function(){return!(!h||"__initialize"in h&&this.name===r.prototype.name)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../transport":18,"component-inherit":11,debug:13,"engine.io-parser":25,parseqs:38,ws:65,yeast:62}],24:[function(e,t){(function(n){var r=e("has-cors");t.exports=function(e){var t=e.xdomain,i=e.xscheme,o=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||r))return new XMLHttpRequest}catch(s){}try{if("undefined"!=typeof XDomainRequest&&!i&&o)return new XDomainRequest}catch(s){}if(!t)try{return new(n[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(s){}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"has-cors":30}],25:[function(e,t,n){(function(t){function r(e,t){var r="b"+n.packets[e.type]+e.data.data;return t(r)}function i(e,t,r){if(!t)return n.encodeBase64Packet(e,r);var i=e.data,o=new Uint8Array(i),s=new Uint8Array(1+i.byteLength);s[0]=b[e.type];for(var a=0;a<o.length;a++)s[a+1]=o[a];return r(s.buffer)}function o(e,t,r){if(!t)return n.encodeBase64Packet(e,r);var i=new FileReader;return i.onload=function(){e.data=i.result,n.encodePacket(e,t,!0,r)},i.readAsArrayBuffer(e.data)}function s(e,t,r){if(!t)return n.encodeBase64Packet(e,r);if(m)return o(e,t,r);var i=new Uint8Array(1);i[0]=b[e.type];var s=new _([i.buffer,e.data]);return r(s)}function a(e){try{e=d.decode(e)}catch(t){return!1}return e}function c(e,t,n){for(var r=new Array(e.length),i=p(e.length,n),o=function(e,n,i){t(n,function(t,n){r[e]=n,i(t,r)})},s=0;s<e.length;s++)o(s,e[s],i)}var u,f=e("./keys"),h=e("has-binary"),l=e("arraybuffer.slice"),p=e("after"),d=e("wtf-8");t&&t.ArrayBuffer&&(u=e("base64-arraybuffer"));var g="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),y="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),m=g||y;n.protocol=3;var b=n.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},v=f(b),w={type:"error",data:"parser error"},_=e("blob");n.encodePacket=function(e,n,o,a){"function"==typeof n&&(a=n,n=!1),"function"==typeof o&&(a=o,o=null);var c=void 0===e.data?void 0:e.data.buffer||e.data;if(t.ArrayBuffer&&c instanceof ArrayBuffer)return i(e,n,a);if(_&&c instanceof t.Blob)return s(e,n,a);if(c&&c.base64)return r(e,a);var u=b[e.type];return void 0!==e.data&&(u+=o?d.encode(String(e.data)):String(e.data)),a(""+u)},n.encodeBase64Packet=function(e,r){var i="b"+n.packets[e.type];if(_&&e.data instanceof t.Blob){var o=new FileReader;return o.onload=function(){var e=o.result.split(",")[1];r(i+e)},o.readAsDataURL(e.data)}var s;try{s=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(a){for(var c=new Uint8Array(e.data),u=new Array(c.length),f=0;f<c.length;f++)u[f]=c[f];s=String.fromCharCode.apply(null,u)}return i+=t.btoa(s),r(i)},n.decodePacket=function(e,t,r){if(void 0===e)return w;if("string"==typeof e){if("b"==e.charAt(0))return n.decodeBase64Packet(e.substr(1),t);if(r&&(e=a(e),e===!1))return w;var i=e.charAt(0);return Number(i)==i&&v[i]?e.length>1?{type:v[i],data:e.substring(1)}:{type:v[i]}:w}var o=new Uint8Array(e),i=o[0],s=l(e,1);return _&&"blob"===t&&(s=new _([s])),{type:v[i],data:s}},n.decodeBase64Packet=function(e,t){var n=v[e.charAt(0)];if(!u)return{type:n,data:{base64:!0,data:e.substr(1)}};var r=u.decode(e.substr(1));return"blob"===t&&_&&(r=new _([r])),{type:n,data:r}},n.encodePayload=function(e,t,r){function i(e){return e.length+":"+e}function o(e,r){n.encodePacket(e,s?t:!1,!0,function(e){r(null,i(e))})}"function"==typeof t&&(r=t,t=null);var s=h(e);return t&&s?_&&!m?n.encodePayloadAsBlob(e,r):n.encodePayloadAsArrayBuffer(e,r):e.length?void c(e,o,function(e,t){return r(t.join(""))}):r("0:")},n.decodePayload=function(e,t,r){if("string"!=typeof e)return n.decodePayloadAsBinary(e,t,r);"function"==typeof t&&(r=t,t=null);var i;if(""==e)return r(w,0,1);for(var o,s,a="",c=0,u=e.length;u>c;c++){var f=e.charAt(c);if(":"!=f)a+=f;else{if(""==a||a!=(o=Number(a)))return r(w,0,1);if(s=e.substr(c+1,o),a!=s.length)return r(w,0,1);if(s.length){if(i=n.decodePacket(s,t,!0),w.type==i.type&&w.data==i.data)return r(w,0,1);var h=r(i,c+o,u);if(!1===h)return}c+=o,a=""}}return""!=a?r(w,0,1):void 0},n.encodePayloadAsArrayBuffer=function(e,t){function r(e,t){n.encodePacket(e,!0,!0,function(e){return t(null,e)})}return e.length?void c(e,r,function(e,n){var r=n.reduce(function(e,t){var n;return n="string"==typeof t?t.length:t.byteLength,e+n.toString().length+n+2},0),i=new Uint8Array(r),o=0;return n.forEach(function(e){var t="string"==typeof e,n=e;if(t){for(var r=new Uint8Array(e.length),s=0;s<e.length;s++)r[s]=e.charCodeAt(s);n=r.buffer}i[o++]=t?0:1;for(var a=n.byteLength.toString(),s=0;s<a.length;s++)i[o++]=parseInt(a[s]);i[o++]=255;for(var r=new Uint8Array(n),s=0;s<r.length;s++)i[o++]=r[s]}),t(i.buffer)}):t(new ArrayBuffer(0))},n.encodePayloadAsBlob=function(e,t){function r(e,t){n.encodePacket(e,!0,!0,function(e){var n=new Uint8Array(1);if(n[0]=1,"string"==typeof e){for(var r=new Uint8Array(e.length),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);e=r.buffer,n[0]=0}for(var o=e instanceof ArrayBuffer?e.byteLength:e.size,s=o.toString(),a=new Uint8Array(s.length+1),i=0;i<s.length;i++)a[i]=parseInt(s[i]);if(a[s.length]=255,_){var c=new _([n.buffer,a.buffer,e]);t(null,c)}})}c(e,r,function(e,n){return t(new _(n))})},n.decodePayloadAsBinary=function(e,t,r){"function"==typeof t&&(r=t,t=null);for(var i=e,o=[],s=!1;i.byteLength>0;){for(var a=new Uint8Array(i),c=0===a[0],u="",f=1;255!=a[f];f++){if(u.length>310){s=!0;break}u+=a[f]}if(s)return r(w,0,1);i=l(i,2+u.length),u=parseInt(u);var h=l(i,0,u);if(c)try{h=String.fromCharCode.apply(null,new Uint8Array(h))}catch(p){var d=new Uint8Array(h);h="";for(var f=0;f<d.length;f++)h+=String.fromCharCode(d[f])}o.push(h),i=l(i,u)}var g=o.length;o.forEach(function(e,i){r(n.decodePacket(e,t,!0),i,g)})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./keys":26,after:2,"arraybuffer.slice":3,"base64-arraybuffer":5,blob:6,"has-binary":28,"wtf-8":61}],26:[function(e,t){t.exports=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t}},{}],27:[function(e,t){t.exports=function(){if("undefined"==typeof window)return null;var e={RTCPeerConnection:window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.RTCSessionDescription||window.mozRTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.RTCIceCandidate||window.mozRTCIceCandidate||window.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},{}],28:[function(e,t){(function(n){function r(e){function t(e){if(!e)return!1;if(n.Buffer&&n.Buffer.isBuffer(e)||n.ArrayBuffer&&e instanceof ArrayBuffer||n.Blob&&e instanceof Blob||n.File&&e instanceof File)return!0;if(i(e)){for(var r=0;r<e.length;r++)if(t(e[r]))return!0}else if(e&&"object"==typeof e){e.toJSON&&(e=e.toJSON());for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return!0}return!1}return t(e)}var i=e("isarray");t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{isarray:33}],29:[function(e,t){(function(n){function r(e){function t(e){if(!e)return!1;if(n.Buffer&&n.Buffer.isBuffer&&n.Buffer.isBuffer(e)||n.ArrayBuffer&&e instanceof ArrayBuffer||n.Blob&&e instanceof Blob||n.File&&e instanceof File)return!0;if(i(e)){for(var r=0;r<e.length;r++)if(t(e[r]))return!0}else if(e&&"object"==typeof e){e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON());for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return!0}return!1}return t(e)}var i=e("isarray");t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{isarray:33}],30:[function(e,t){try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(n){t.exports=!1}},{}],31:[function(e,t){var n=[].indexOf;t.exports=function(e,t){if(n)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}},{}],32:[function(e,t){t.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],33:[function(e,t){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],34:[function(e,t){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],35:[function(t,n,r){(function(t){(function(){function i(e,t){function n(e){if(n[e]!==y)return n[e];var i;if("bug-string-char-index"==e)i="a"!="a"[0];else if("json"==e)i=n("json-stringify")&&n("json-parse");else{var s,a='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var c=t.stringify,f="function"==typeof c&&v;if(f){(s=function(){return 1}).toJSON=s;try{f="0"===c(0)&&"0"===c(new r)&&'""'==c(new o)&&c(b)===y&&c(y)===y&&c()===y&&"1"===c(s)&&"[1]"==c([s])&&"[null]"==c([y])&&"null"==c(null)&&"[null,null,null]"==c([y,b,null])&&c({a:[s,!0,!1,null,"\x00\b\n\f\r "]})==a&&"1"===c(null,s)&&"[\n 1,\n 2\n]"==c([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==c(new u(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==c(new u(864e13))&&'"-000001-01-01T00:00:00.000Z"'==c(new u(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==c(new u(-1))}catch(h){f=!1}}i=f}if("json-parse"==e){var l=t.parse;if("function"==typeof l)try{if(0===l("0")&&!l(!1)){s=l(a);var p=5==s.a.length&&1===s.a[0];if(p){try{p=!l('" "')}catch(h){}if(p)try{p=1!==l("01")}catch(h){}if(p)try{p=1!==l("1.")}catch(h){}}}}catch(h){p=!1}i=p}}return n[e]=!!i}e||(e=c.Object()),t||(t=c.Object());var r=e.Number||c.Number,o=e.String||c.String,a=e.Object||c.Object,u=e.Date||c.Date,f=e.SyntaxError||c.SyntaxError,h=e.TypeError||c.TypeError,l=e.Math||c.Math,p=e.JSON||c.JSON;"object"==typeof p&&p&&(t.stringify=p.stringify,t.parse=p.parse);var d,g,y,m=a.prototype,b=m.toString,v=new u(-0xc782b5b800cec);try{v=-109252==v.getUTCFullYear()&&0===v.getUTCMonth()&&1===v.getUTCDate()&&10==v.getUTCHours()&&37==v.getUTCMinutes()&&6==v.getUTCSeconds()&&708==v.getUTCMilliseconds()}catch(w){}if(!n("json")){var _="[object Function]",k="[object Date]",A="[object Number]",E="[object String]",x="[object Array]",S="[object Boolean]",C=n("bug-string-char-index");if(!v)var R=l.floor,T=[0,31,59,90,120,151,181,212,243,273,304,334],B=function(e,t){return T[t]+365*(e-1970)+R((e-1969+(t=+(t>1)))/4)-R((e-1901+t)/100)+R((e-1601+t)/400)};if((d=m.hasOwnProperty)||(d=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=b?d=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,d=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,d.call(this,e)}),g=function(e,t){var n,r,i,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,r=new n;for(i in r)d.call(r,i)&&o++;return n=r=null,o?g=2==o?function(e,t){var n,r={},i=b.call(e)==_;for(n in e)i&&"prototype"==n||d.call(r,n)||!(r[n]=1)||!d.call(e,n)||t(n)}:function(e,t){var n,r,i=b.call(e)==_;for(n in e)i&&"prototype"==n||!d.call(e,n)||(r="constructor"===n)||t(n);(r||d.call(e,n="constructor"))&&t(n)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],g=function(e,t){var n,i,o=b.call(e)==_,a=!o&&"function"!=typeof e.constructor&&s[typeof e.hasOwnProperty]&&e.hasOwnProperty||d;for(n in e)o&&"prototype"==n||!a.call(e,n)||t(n);for(i=r.length;n=r[--i];a.call(e,n)&&t(n));}),g(e,t)},!n("json-stringify")){var P={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},L="000000",j=function(e,t){return(L+(t||0)).slice(-e)},O="\\u00",M=function(e){for(var t='"',n=0,r=e.length,i=!C||r>10,o=i&&(C?e.split(""):e);r>n;n++){var s=e.charCodeAt(n);switch(s){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=P[s];break;default:if(32>s){t+=O+j(2,s.toString(16));break}t+=i?o[n]:e.charAt(n)}}return t+'"'},U=function(e,t,n,r,i,o,s){var a,c,u,f,l,p,m,v,w,_,C,T,P,L,O,D;try{a=t[e]}catch(N){}if("object"==typeof a&&a)if(c=b.call(a),c!=k||d.call(a,"toJSON"))"function"==typeof a.toJSON&&(c!=A&&c!=E&&c!=x||d.call(a,"toJSON"))&&(a=a.toJSON(e));else if(a>-1/0&&1/0>a){if(B){for(l=R(a/864e5),u=R(l/365.2425)+1970-1;B(u+1,0)<=l;u++);for(f=R((l-B(u,0))/30.42);B(u,f+1)<=l;f++);l=1+l-B(u,f),p=(a%864e5+864e5)%864e5,m=R(p/36e5)%24,v=R(p/6e4)%60,w=R(p/1e3)%60,_=p%1e3}else u=a.getUTCFullYear(),f=a.getUTCMonth(),l=a.getUTCDate(),m=a.getUTCHours(),v=a.getUTCMinutes(),w=a.getUTCSeconds(),_=a.getUTCMilliseconds();a=(0>=u||u>=1e4?(0>u?"-":"+")+j(6,0>u?-u:u):j(4,u))+"-"+j(2,f+1)+"-"+j(2,l)+"T"+j(2,m)+":"+j(2,v)+":"+j(2,w)+"."+j(3,_)+"Z"}else a=null;if(n&&(a=n.call(t,e,a)),null===a)return"null";if(c=b.call(a),c==S)return""+a;if(c==A)return a>-1/0&&1/0>a?""+a:"null";if(c==E)return M(""+a);if("object"==typeof a){for(L=s.length;L--;)if(s[L]===a)throw h();if(s.push(a),C=[],O=o,o+=i,c==x){for(P=0,L=a.length;L>P;P++)T=U(P,a,n,r,i,o,s),C.push(T===y?"null":T);D=C.length?i?"[\n"+o+C.join(",\n"+o)+"\n"+O+"]":"["+C.join(",")+"]":"[]"}else g(r||a,function(e){var t=U(e,a,n,r,i,o,s);t!==y&&C.push(M(e)+":"+(i?" ":"")+t)}),D=C.length?i?"{\n"+o+C.join(",\n"+o)+"\n"+O+"}":"{"+C.join(",")+"}":"{}";return s.pop(),D}};t.stringify=function(e,t,n){var r,i,o,a;if(s[typeof t]&&t)if((a=b.call(t))==_)i=t;else if(a==x){o={};for(var c,u=0,f=t.length;f>u;c=t[u++],a=b.call(c),(a==E||a==A)&&(o[c]=1));}if(n)if((a=b.call(n))==A){if((n-=n%1)>0)for(r="",n>10&&(n=10);r.length<n;r+=" ");}else a==E&&(r=n.length<=10?n:n.slice(0,10));return U("",(c={},c[""]=e,c),i,o,r,"",[])}}if(!n("json-parse")){var D,N,I=o.fromCharCode,q={92:"\\",34:'"',47:"/",98:"\b",116:" ",110:"\n",102:"\f",114:"\r"},Y=function(){throw D=N=null,f()},z=function(){for(var e,t,n,r,i,o=N,s=o.length;s>D;)switch(i=o.charCodeAt(D)){case 9:case 10:case 13:case 32:D++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=C?o.charAt(D):o[D],D++,e;case 34:for(e="@",D++;s>D;)if(i=o.charCodeAt(D),32>i)Y();else if(92==i)switch(i=o.charCodeAt(++D)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=q[i],D++;break;case 117:for(t=++D,n=D+4;n>D;D++)i=o.charCodeAt(D),i>=48&&57>=i||i>=97&&102>=i||i>=65&&70>=i||Y();e+=I("0x"+o.slice(t,D));break;default:Y()}else{if(34==i)break;for(i=o.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=o.charCodeAt(++D);e+=o.slice(t,D)}if(34==o.charCodeAt(D))return D++,e;Y();default:if(t=D,45==i&&(r=!0,i=o.charCodeAt(++D)),i>=48&&57>=i){for(48==i&&(i=o.charCodeAt(D+1),i>=48&&57>=i)&&Y(),r=!1;s>D&&(i=o.charCodeAt(D),i>=48&&57>=i);D++);if(46==o.charCodeAt(D)){for(n=++D;s>n&&(i=o.charCodeAt(n),i>=48&&57>=i);n++);n==D&&Y(),D=n}if(i=o.charCodeAt(D),101==i||69==i){for(i=o.charCodeAt(++D),(43==i||45==i)&&D++,n=D;s>n&&(i=o.charCodeAt(n),i>=48&&57>=i);n++);n==D&&Y(),D=n}return+o.slice(t,D)}if(r&&Y(),"true"==o.slice(D,D+4))return D+=4,!0;if("false"==o.slice(D,D+5))return D+=5,!1;if("null"==o.slice(D,D+4))return D+=4,null;Y()}return"$"},F=function(e){var t,n;if("$"==e&&Y(),"string"==typeof e){if("@"==(C?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=z(),"]"!=e;n||(n=!0))n&&(","==e?(e=z(),"]"==e&&Y()):Y()),","==e&&Y(),t.push(F(e));return t}if("{"==e){for(t={};e=z(),"}"!=e;n||(n=!0))n&&(","==e?(e=z(),"}"==e&&Y()):Y()),(","==e||"string"!=typeof e||"@"!=(C?e.charAt(0):e[0])||":"!=z())&&Y(),t[e.slice(1)]=F(z());return t}Y()}return e},H=function(e,t,n){var r=W(e,t,n);r===y?delete e[t]:e[t]=r},W=function(e,t,n){var r,i=e[t];if("object"==typeof i&&i)if(b.call(i)==x)for(r=i.length;r--;)H(i,r,n);else g(i,function(e){H(i,e,n)});return n.call(e,t,i)};t.parse=function(e,t){var n,r;return D=0,N=""+e,n=F(z()),"$"!=z()&&Y(),D=N=null,t&&b.call(t)==_?W((r={},r[""]=n,r),"",t):n}}}return t.runInContext=i,t}var o="function"==typeof e&&e.amd,s={"function":!0,object:!0},a=s[typeof r]&&r&&!r.nodeType&&r,c=s[typeof window]&&window||this,u=a&&s[typeof n]&&n&&!n.nodeType&&"object"==typeof t&&t;if(!u||u.global!==u&&u.window!==u&&u.self!==u||(c=u),a&&!o)i(c,a);else{var f=c.JSON,h=c.JSON3,l=!1,p=i(c,c.JSON3={noConflict:function(){return l||(l=!0,c.JSON=f,c.JSON3=h,f=h=null),p}});c.JSON={parse:p.parse,stringify:p.stringify}}o&&e(function(){return p})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],36:[function(e,t){function n(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*f;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}function r(e){return e>=u?Math.round(e/u)+"d":e>=c?Math.round(e/c)+"h":e>=a?Math.round(e/a)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function i(e){return o(e,u,"day")||o(e,c,"hour")||o(e,a,"minute")||o(e,s,"second")||e+" ms"}function o(e,t,n){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var s=1e3,a=60*s,c=60*a,u=24*c,f=365.25*u;t.exports=function(e,t){return t=t||{},"string"==typeof e?n(e):t["long"]?i(e):r(e)}},{}],37:[function(e,t){(function(e){var n=/^[\],:{}\s]*$/,r=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,o=/(?:^|:|,)(?:\s*\[)+/g,s=/^\s+/,a=/\s+$/;t.exports=function(t){return"string"==typeof t&&t?(t=t.replace(s,"").replace(a,""),e.JSON&&JSON.parse?JSON.parse(t):n.test(t.replace(r,"@").replace(i,"]").replace(o,""))?new Function("return "+t)():void 0):null}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],38:[function(e,t,n){n.encode=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},n.decode=function(e){for(var t={},n=e.split("&"),r=0,i=n.length;i>r;r++){var o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}},{}],39:[function(e,t){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(e){var t=e,i=e.indexOf("["),o=e.indexOf("]");-1!=i&&-1!=o&&(e=e.substring(0,i)+e.substring(i,o).replace(/:/g,";")+e.substring(o,e.length));for(var s=n.exec(e||""),a={},c=14;c--;)a[r[c]]=s[c]||"";return-1!=i&&-1!=o&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},{}],40:[function(e,t){(function(e){"use strict";function n(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return e.nextTick(function(){t.apply(null,o)})}}t.exports=!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?n:e.nextTick}).call(this,e("_process"))},{_process:71}],41:[function(e,t){(function(e,n,r){"use strict";function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}function o(t,i){if(t>65536)throw new Error("requested too many random bytes");var o=new n.Uint8Array(t);t>0&&s.getRandomValues(o);var a=new r(o.buffer);return"function"==typeof i?e.nextTick(function(){i(null,a)}):a}var s=n.crypto||n.msCrypto;t.exports=s&&s.getRandomValues?o:i}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{_process:71,buffer:66}],42:[function(e,t){"use strict";function n(e){return this instanceof n?(c.call(this,e),u.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",r)):new n(e)}function r(){this.allowHalfOpen||this._writableState.ended||s(i,this)}function i(e){e.end()}var o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=n;var s=e("process-nextick-args"),a=e("core-util-is");a.inherits=e("inherits");var c=e("./_stream_readable"),u=e("./_stream_writable");a.inherits(n,c);for(var f=o(u.prototype),h=0;h<f.length;h++){var l=f[h];n.prototype[l]||(n.prototype[l]=u.prototype[l])}},{"./_stream_readable":44,"./_stream_writable":46,"core-util-is":12,inherits:32,"process-nextick-args":40}],43:[function(e,t){"use strict";function n(e){return this instanceof n?void r.call(this,e):new n(e)}t.exports=n;var r=e("./_stream_transform"),i=e("core-util-is");i.inherits=e("inherits"),i.inherits(n,r),n.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":45,"core-util-is":12,inherits:32}],44:[function(e,t){(function(n){"use strict";function r(e,t,n){return"function"==typeof e.prependListener?e.prependListener(t,n):void(e._events&&e._events[t]?B(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n))}function i(t,n){q=q||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,n instanceof q&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=~~this.highWaterMark,this.buffer=new I,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(N||(N=e("string_decoder/").StringDecoder),this.decoder=new N(t.encoding),this.encoding=t.encoding)}function o(t){return q=q||e("./_stream_duplex"),this instanceof o?(this._readableState=new i(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),void P.call(this)):new o(t)}function s(e,t,n,r,i){var o=f(t,n);if(o)e.emit("error",o);else if(null===n)t.reading=!1,h(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var c=new Error("stream.unshift() after end event");e.emit("error",c)}else{var u;!t.decoder||i||r||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&l(e))),d(e,t)}else i||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function c(e){return e>=Y?e=Y:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function u(e,t){return 0>=e||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=c(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function f(e,t){var n=null;return j.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,l(e)}}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(D("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?T(p,e):p(e))}function p(e){D("emit readable"),e.emit("readable"),w(e)}function d(e,t){t.readingMore||(t.readingMore=!0,T(g,e,t))}function g(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(D("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function y(e){return function(){var t=e._readableState;D("pipeOnDrain",t.awaitDrain),
t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&L(e,"data")&&(t.flowing=!0,w(e))}}function m(e){D("readable nexttick read 0"),e.read(0)}function b(e,t){t.resumeScheduled||(t.resumeScheduled=!0,T(v,e,t))}function v(e,t){t.reading||(D("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),w(e),t.flowing&&!t.reading&&e.read(0)}function w(e){var t=e._readableState;for(D("flow",t.flowing);t.flowing&&null!==e.read(););}function _(e,t){if(0===t.length)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=k(e,t.buffer,t.decoder),n}function k(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?A(e,t):E(e,t),r}function A(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(i+=s===o.length?o:o.slice(0,e),e-=s,0===e){s===o.length?(++r,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=o.slice(s));break}++r}return t.length-=r,i}function E(e,t){var n=O.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,s),e-=s,0===e){s===o.length?(++i,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(s));break}++i}return t.length-=i,n}function x(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,T(S,t,e))}function S(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function C(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function R(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}t.exports=o;var T=e("process-nextick-args"),B=e("isarray");o.ReadableState=i;var P,L=(e("events").EventEmitter,function(e,t){return e.listeners(t).length});!function(){try{P=e("stream")}catch(t){}finally{P||(P=e("events").EventEmitter)}}();var j=e("buffer").Buffer,O=e("buffer-shims"),M=e("core-util-is");M.inherits=e("inherits");var U=e("util"),D=void 0;D=U&&U.debuglog?U.debuglog("stream"):function(){};var N,I=e("./internal/streams/BufferList");M.inherits(o,P);var q,q;o.prototype.push=function(e,t){var n=this._readableState;return n.objectMode||"string"!=typeof e||(t=t||n.defaultEncoding,t!==n.encoding&&(e=O.from(e,t),t="")),s(this,n,e,t,!1)},o.prototype.unshift=function(e){var t=this._readableState;return s(this,t,e,"",!0)},o.prototype.isPaused=function(){return this._readableState.flowing===!1},o.prototype.setEncoding=function(t){return N||(N=e("string_decoder/").StringDecoder),this._readableState.decoder=new N(t),this._readableState.encoding=t,this};var Y=8388608;o.prototype.read=function(e){D("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return D("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?x(this):l(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&x(this),null;var r=t.needReadable;D("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,D("length less than watermark",r)),t.ended||t.reading?(r=!1,D("reading or ended",r)):r&&(D("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=u(n,t)));var i;return i=e>0?_(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&x(this)),null!==i&&this.emit("data",i),i},o.prototype._read=function(){this.emit("error",new Error("not implemented"))},o.prototype.pipe=function(e,t){function i(e){D("onunpipe"),e===l&&s()}function o(){D("onend"),e.end()}function s(){D("cleanup"),e.removeListener("close",u),e.removeListener("finish",f),e.removeListener("drain",m),e.removeListener("error",c),e.removeListener("unpipe",i),l.removeListener("end",o),l.removeListener("end",s),l.removeListener("data",a),b=!0,!p.awaitDrain||e._writableState&&!e._writableState.needDrain||m()}function a(t){D("ondata"),v=!1;var n=e.write(t);!1!==n||v||((1===p.pipesCount&&p.pipes===e||p.pipesCount>1&&-1!==R(p.pipes,e))&&!b&&(D("false write response, pause",l._readableState.awaitDrain),l._readableState.awaitDrain++,v=!0),l.pause())}function c(t){D("onerror",t),h(),e.removeListener("error",c),0===L(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",f),h()}function f(){D("onfinish"),e.removeListener("close",u),h()}function h(){D("unpipe"),l.unpipe(e)}var l=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=e;break;case 1:p.pipes=[p.pipes,e];break;default:p.pipes.push(e)}p.pipesCount+=1,D("pipe count=%d opts=%j",p.pipesCount,t);var d=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,g=d?o:s;p.endEmitted?T(g):l.once("end",g),e.on("unpipe",i);var m=y(l);e.on("drain",m);var b=!1,v=!1;return l.on("data",a),r(e,"error",c),e.once("close",u),e.once("finish",f),e.emit("pipe",l),p.flowing||(D("pipe resume"),l.resume()),e},o.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var o=R(t.pipes,e);return-1===o?this:(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},o.prototype.on=function(e,t){var n=P.prototype.on.call(this,e,t);if("data"===e)this._readableState.flowing!==!1&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&l(this,r):T(m,this))}return n},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){var e=this._readableState;return e.flowing||(D("resume"),e.flowing=!0,b(this,e)),this},o.prototype.pause=function(){return D("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(D("pause"),this._readableState.flowing=!1,this.emit("pause")),this},o.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(D("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(D("wrapped data"),t.decoder&&(i=t.decoder.write(i)),(!t.objectMode||null!==i&&void 0!==i)&&(t.objectMode||i&&i.length)){var o=r.push(i);o||(n=!0,e.pause())}});for(var i in e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return C(o,function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(t){D("wrapped _read",t),n&&(n=!1,e.resume())},r},o._fromList=_}).call(this,e("_process"))},{"./_stream_duplex":42,"./internal/streams/BufferList":47,_process:71,buffer:66,"buffer-shims":7,"core-util-is":12,events:67,inherits:32,isarray:34,"process-nextick-args":40,"string_decoder/":58,util:65}],45:[function(e,t){"use strict";function n(e){this.afterTransform=function(t,n){return r(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function r(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function i(e){if(!(this instanceof i))return new i(e);s.call(this,e),this._transformState=new n(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e){o(t,e)}):o(t)})}function o(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}t.exports=i;var s=e("./_stream_duplex"),a=e("core-util-is");a.inherits=e("inherits"),a.inherits(i,s),i.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},i.prototype._transform=function(){throw new Error("Not implemented")},i.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},i.prototype._read=function(){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0}},{"./_stream_duplex":42,"core-util-is":12,inherits:32}],46:[function(e,t){(function(n){"use strict";function r(){}function i(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function o(t,n){B=B||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,n instanceof B&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var o=t.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){d(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new k(this)}function s(t){return B=B||e("./_stream_duplex"),this instanceof s||this instanceof B?(this._writableState=new o(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),void S.call(this)):new s(t)}function a(e,t){var n=new Error("write after end");e.emit("error",n),A(t,n)}function c(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):R.isBuffer(n)||"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),A(r,o),i=!1),i}function u(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=T.from(t,n)),t}function f(e,t,n,r,o){n=u(t,n,r),R.isBuffer(n)&&(r="buffer");var s=t.objectMode?1:n.length;t.length+=s;var a=t.length<t.highWaterMark;if(a||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest=new i(n,r,o),c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else h(e,t,!1,s,n,r,o);return a}function h(e,t,n,r,i,o,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function l(e,t,n,r,i){--t.pendingcb,n?A(i,r):i(r),e._writableState.errorEmitted=!0,e.emit("error",r)}function p(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function d(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(p(n),t)l(e,n,r,t,i);else{var o=b(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||m(e,n),r?E(g,e,n,o,i):g(e,n,o,i)}}function g(e,t,n,r){n||y(e,t),t.pendingcb--,r(),w(e,t)}function y(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function m(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0;n;)i[s]=n,n=n.next,s+=1;h(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new k(t)}else{for(;n;){var a=n.chunk,c=n.encoding,u=n.callback,f=t.objectMode?1:a.length;if(h(e,t,!1,f,a,c,u),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function b(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function v(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function w(e,t){var n=b(t);return n&&(0===t.pendingcb?(v(e,t),t.finished=!0,e.emit("finish")):v(e,t)),n}function _(e,t,n){t.ending=!0,w(e,t),n&&(t.finished?A(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function k(e){var t=this;this.next=null,this.entry=null,this.finish=function(n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}t.exports=s;var A=e("process-nextick-args"),E=!n.browser&&["v0.10","v0.9."].indexOf(n.version.slice(0,5))>-1?setImmediate:A;s.WritableState=o;var x=e("core-util-is");x.inherits=e("inherits");var S,C={deprecate:e("util-deprecate")};!function(){try{S=e("stream")}catch(t){}finally{S||(S=e("events").EventEmitter)}}();var R=e("buffer").Buffer,T=e("buffer-shims");x.inherits(s,S);var B;o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:C.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var B;s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(e,t,n){var i=this._writableState,o=!1;return"function"==typeof t&&(n=t,t=null),R.isBuffer(e)?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=r),i.ended?a(this,n):c(this,i,e,n)&&(i.pendingcb++,o=f(this,i,e,t,n)),o},s.prototype.cork=function(){var e=this._writableState;e.corked++},s.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||m(this,e))},s.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},s.prototype._write=function(e,t,n){n(new Error("not implemented"))},s.prototype._writev=null,s.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||_(this,r,n)}}).call(this,e("_process"))},{"./_stream_duplex":42,_process:71,buffer:66,"buffer-shims":7,"core-util-is":12,events:67,inherits:32,"process-nextick-args":40,"util-deprecate":60}],47:[function(e,t){"use strict";function n(){this.head=null,this.tail=null,this.length=0}var r=(e("buffer").Buffer,e("buffer-shims"));t.exports=n,n.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},n.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},n.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},n.prototype.clear=function(){this.head=this.tail=null,this.length=0},n.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},n.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t=r.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t}},{buffer:66,"buffer-shims":7}],48:[function(e,t,n){(function(r){var i=function(){try{return e("stream")}catch(t){}}();n=t.exports=e("./lib/_stream_readable.js"),n.Stream=i||n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),!r.browser&&"disable"===r.env.READABLE_STREAM&&i&&(t.exports=i)}).call(this,e("_process"))},{"./lib/_stream_duplex.js":42,"./lib/_stream_passthrough.js":43,"./lib/_stream_readable.js":44,"./lib/_stream_transform.js":45,"./lib/_stream_writable.js":46,_process:71}],49:[function(e,t){(function(n){function r(e){var t=this;if(!(t instanceof r))return new r(e);if(t.channelName=e.initiator?e.channelName||c(20).toString("hex"):null,t._debug("new peer %o",e),e||(e={}),e.allowHalfOpen=!1,null==e.highWaterMark&&(e.highWaterMark=1048576),u.Duplex.call(t,e),t.initiator=e.initiator||!1,t.channelConfig=e.channelConfig||r.channelConfig,t.config=e.config||r.config,t.constraints=e.constraints||r.constraints,t.offerConstraints=e.offerConstraints||{},t.answerConstraints=e.answerConstraints||{},t.reconnectTimer=e.reconnectTimer||!1,t.sdpTransform=e.sdpTransform||function(e){return e},t.stream=e.stream||!1,t.trickle=void 0!==e.trickle?e.trickle:!0,t.destroyed=!1,t.connected=!1,t.remoteAddress=void 0,t.remoteFamily=void 0,t.remotePort=void 0,t.localAddress=void 0,t.localPort=void 0,t._isWrtc=!!e.wrtc,t._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:s(),!t._wrtc)throw new Error("undefined"==typeof window?"No WebRTC support: Specify `opts.wrtc` option in this environment":"No WebRTC support: Not a supported browser");if(t._maxBufferedAmount=e.highWaterMark,t._pcReady=!1,t._channelReady=!1,t._iceComplete=!1,t._channel=null,t._pendingCandidates=[],t._chunk=null,t._cb=null,t._interval=null,t._reconnectTimeout=null,t._pc=new t._wrtc.RTCPeerConnection(t.config,t.constraints),t._pc.oniceconnectionstatechange=function(){t._onIceConnectionStateChange()},t._pc.onsignalingstatechange=function(){t._onSignalingStateChange()},t._pc.onicecandidate=function(e){t._onIceCandidate(e)},t.stream&&t._pc.addStream(t.stream),"ontrack"in t._pc?t._pc.ontrack=function(e){t._onTrack(e)}:t._pc.onaddstream=function(e){t._onAddStream(e)},t.initiator){t._setupData({channel:t._pc.createDataChannel(t.channelName,t.channelConfig)});var n=!1;t._pc.onnegotiationneeded=function(){n||t._createOffer(),n=!0},"undefined"!=typeof window&&window.webkitRTCPeerConnection||t._pc.onnegotiationneeded()}else t._pc.ondatachannel=function(e){t._setupData(e)};t.on("finish",function(){t.connected?setTimeout(function(){t._destroy()},100):t.once("connect",function(){setTimeout(function(){t._destroy()},100)})})}function i(){}t.exports=r;var o=e("debug")("simple-peer"),s=e("get-browser-rtc"),a=e("inherits"),c=e("randombytes"),u=e("readable-stream");a(r,u.Duplex),r.WEBRTC_SUPPORT=!!s(),r.config={iceServers:[{url:"stun:23.21.150.121",urls:"stun:23.21.150.121"}]},r.constraints={},r.channelConfig={},Object.defineProperty(r.prototype,"bufferSize",{get:function(){var e=this;return e._channel&&e._channel.bufferedAmount||0}}),r.prototype.address=function(){var e=this;return{port:e.localPort,family:"IPv4",address:e.localAddress}},r.prototype.signal=function(e){function t(e){try{n._pc.addIceCandidate(new n._wrtc.RTCIceCandidate(e),i,function(e){n._onError(e)})}catch(t){n._destroy(new Error("error adding candidate: "+t.message))}}var n=this;if(n.destroyed)throw new Error("cannot signal after peer is destroyed");if("string"==typeof e)try{e=JSON.parse(e)}catch(r){e={}}n._debug("signal()"),e.sdp&&n._pc.setRemoteDescription(new n._wrtc.RTCSessionDescription(e),function(){n.destroyed||("offer"===n._pc.remoteDescription.type&&n._createAnswer(),n._pendingCandidates.forEach(t),n._pendingCandidates=[])},function(e){n._onError(e)}),e.candidate&&(n._pc.remoteDescription?t(e.candidate):n._pendingCandidates.push(e.candidate)),e.sdp||e.candidate||n._destroy(new Error("signal() called with invalid signal data"))},r.prototype.send=function(e){var t=this;n.isBuffer(e)&&t._isWrtc&&(e=new Uint8Array(e));var r=e.length||e.byteLength||e.size;t._channel.send(e),t._debug("write: %d bytes",r)},r.prototype.destroy=function(e){var t=this;t._destroy(null,e)},r.prototype._destroy=function(e,t){var n=this;if(!n.destroyed){if(t&&n.once("close",t),n._debug("destroy (error: %s)",e&&e.message),n.readable=n.writable=!1,n._readableState.ended||n.push(null),n._writableState.finished||n.end(),n.destroyed=!0,n.connected=!1,n._pcReady=!1,n._channelReady=!1,n._chunk=null,n._cb=null,clearInterval(n._interval),clearTimeout(n._reconnectTimeout),n._pc){try{n._pc.close()}catch(e){}n._pc.oniceconnectionstatechange=null,n._pc.onsignalingstatechange=null,n._pc.onicecandidate=null,"ontrack"in n._pc?n._pc.ontrack=null:n._pc.onaddstream=null,n._pc.onnegotiationneeded=null,n._pc.ondatachannel=null}if(n._channel){try{n._channel.close()}catch(e){}n._channel.onmessage=null,n._channel.onopen=null,n._channel.onclose=null}n._pc=null,n._channel=null,e&&n.emit("error",e),n.emit("close")}},r.prototype._setupData=function(e){var t=this;t._channel=e.channel,t.channelName=t._channel.label,t._channel.binaryType="arraybuffer",t._channel.onmessage=function(e){t._onChannelMessage(e)},t._channel.onopen=function(){t._onChannelOpen()},t._channel.onclose=function(){t._onChannelClose()}},r.prototype._read=function(){},r.prototype._write=function(e,t,n){var r=this;if(r.destroyed)return n(new Error("cannot write after peer is destroyed"));if(r.connected){try{r.send(e)}catch(i){return r._onError(i)}r._channel.bufferedAmount>r._maxBufferedAmount?(r._debug("start backpressure: bufferedAmount %d",r._channel.bufferedAmount),r._cb=n):n(null)}else r._debug("write before connect"),r._chunk=e,r._cb=n},r.prototype._createOffer=function(){var e=this;e.destroyed||e._pc.createOffer(function(t){if(!e.destroyed){t.sdp=e.sdpTransform(t.sdp),e._pc.setLocalDescription(t,i,function(t){e._onError(t)});var n=function(){var n=e._pc.localDescription||t;e._debug("signal"),e.emit("signal",{type:n.type,sdp:n.sdp})};e.trickle||e._iceComplete?n():e.once("_iceComplete",n)}},function(t){e._onError(t)},e.offerConstraints)},r.prototype._createAnswer=function(){var e=this;e.destroyed||e._pc.createAnswer(function(t){if(!e.destroyed){t.sdp=e.sdpTransform(t.sdp),e._pc.setLocalDescription(t,i,function(t){e._onError(t)});var n=function(){var n=e._pc.localDescription||t;e._debug("signal"),e.emit("signal",{type:n.type,sdp:n.sdp})};e.trickle||e._iceComplete?n():e.once("_iceComplete",n)}},function(t){e._onError(t)},e.answerConstraints)},r.prototype._onIceConnectionStateChange=function(){var e=this;if(!e.destroyed){var t=e._pc.iceGatheringState,n=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,n),e.emit("iceConnectionStateChange",t,n),("connected"===n||"completed"===n)&&(clearTimeout(e._reconnectTimeout),e._pcReady=!0,e._maybeReady()),"disconnected"===n&&(e.reconnectTimer?(clearTimeout(e._reconnectTimeout),e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)):e._destroy()),"failed"===n&&e._destroy(),"closed"===n&&e._destroy()}},r.prototype.getStats=function(e){var t=this;t._pc.getStats?"undefined"!=typeof window&&window.mozRTCPeerConnection?t._pc.getStats(null,function(t){var n=[];t.forEach(function(e){n.push(e)}),e(n)},function(e){t._onError(e)}):t._pc.getStats(function(t){var n=[];t.result().forEach(function(e){var t={};e.names().forEach(function(n){t[n]=e.stat(n)}),t.id=e.id,t.type=e.type,t.timestamp=e.timestamp,n.push(t)}),e(n)}):e([])},r.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady),!e.connected&&!e._connecting&&e._pcReady&&e._channelReady&&(e._connecting=!0,e.getStats(function(t){function n(t){var n=i[t.localCandidateId],o=r[t.remoteCandidateId];n?(e.localAddress=n.ipAddress,e.localPort=Number(n.portNumber)):"string"==typeof t.googLocalAddress&&(n=t.googLocalAddress.split(":"),e.localAddress=n[0],e.localPort=Number(n[1])),e._debug("connect local: %s:%s",e.localAddress,e.localPort),o?(e.remoteAddress=o.ipAddress,e.remotePort=Number(o.portNumber),e.remoteFamily="IPv4"):"string"==typeof t.googRemoteAddress&&(o=t.googRemoteAddress.split(":"),e.remoteAddress=o[0],e.remotePort=Number(o[1]),e.remoteFamily="IPv4"),e._debug("connect remote: %s:%s",e.remoteAddress,e.remotePort)}e._connecting=!1,e.connected=!0;var r={},i={};if(t.forEach(function(e){"remotecandidate"===e.type&&(r[e.id]=e),"localcandidate"===e.type&&(i[e.id]=e)}),t.forEach(function(e){var t="googCandidatePair"===e.type&&"true"===e.googActiveConnection||"candidatepair"===e.type&&e.selected;t&&n(e)}),e._chunk){try{e.send(e._chunk)}catch(o){return e._onError(o)}e._chunk=null,e._debug('sent chunk from "write before connect"');var s=e._cb;e._cb=null,s(null)}e._interval=setInterval(function(){if(e._cb&&e._channel&&!(e._channel.bufferedAmount>e._maxBufferedAmount)){e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null,t(null)}},150),e._interval.unref&&e._interval.unref(),e._debug("connect"),e.emit("connect")}))},r.prototype._onSignalingStateChange=function(){var e=this;e.destroyed||(e._debug("signalingStateChange %s",e._pc.signalingState),e.emit("signalingStateChange",e._pc.signalingState))},r.prototype._onIceCandidate=function(e){var t=this;t.destroyed||(e.candidate&&t.trickle?t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||(t._iceComplete=!0,t.emit("_iceComplete")))},r.prototype._onChannelMessage=function(e){var t=this;if(!t.destroyed){var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length),r instanceof ArrayBuffer&&(r=new n(r)),t.push(r)}},r.prototype._onChannelOpen=function(){var e=this;e.connected||e.destroyed||(e._debug("on channel open"),e._channelReady=!0,e._maybeReady())},r.prototype._onChannelClose=function(){var e=this;e.destroyed||(e._debug("on channel close"),e._destroy())},r.prototype._onAddStream=function(e){var t=this;t.destroyed||(t._debug("on add stream"),t.emit("stream",e.stream))},r.prototype._onTrack=function(e){var t=this;t.destroyed||(t._debug("on track"),t.emit("stream",e.streams[0]))},r.prototype._onError=function(e){var t=this;t.destroyed||(t._debug("error %s",e.message||e),t._destroy(e))},r.prototype._debug=function(){var e=this,t=[].slice.call(arguments),n=e.channelName&&e.channelName.substring(0,7);t[0]="["+n+"] "+t[0],o.apply(null,t)}}).call(this,e("buffer").Buffer)},{buffer:66,debug:13,"get-browser-rtc":27,inherits:32,randombytes:41,"readable-stream":48}],50:[function(e,t,n){function r(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r=o(e),s=r.source,f=r.id,h=r.path,l=u[f]&&h in u[f].nsps,p=t.forceNew||t["force new connection"]||!1===t.multiplex||l;return p?(c("ignoring socket cache for %s",s),n=a(s,t)):(u[f]||(c("new io instance for %s",s),u[f]=a(s,t)),n=u[f]),r.query&&!t.query?t.query=r.query:t&&"object"==typeof t.query&&(t.query=i(t.query)),n.socket(r.path,t)}function i(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}var o=e("./url"),s=e("socket.io-parser"),a=e("./manager"),c=e("debug")("socket.io-client");t.exports=n=r;var u=n.managers={};n.protocol=s.protocol,n.connect=r,n.Manager=e("./manager"),n.Socket=e("./socket")},{"./manager":51,"./socket":53,"./url":54,debug:13,"socket.io-parser":56}],51:[function(e,t){function n(e,t){return this instanceof n?(e&&"object"==typeof e&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new h({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[],this.encoder=new s.Encoder,this.decoder=new s.Decoder,this.autoConnect=t.autoConnect!==!1,void(this.autoConnect&&this.open())):new n(e,t)}var r=e("engine.io-client"),i=e("./socket"),o=e("component-emitter"),s=e("socket.io-parser"),a=e("./on"),c=e("component-bind"),u=e("debug")("socket.io-client:manager"),f=e("indexof"),h=e("backo2"),l=Object.prototype.hasOwnProperty;t.exports=n,n.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var e in this.nsps)l.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},n.prototype.updateSocketIds=function(){for(var e in this.nsps)l.call(this.nsps,e)&&(this.nsps[e].id=this.engine.id)},o(n.prototype),n.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},n.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},n.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},n.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},n.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},n.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},n.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},n.prototype.open=n.prototype.connect=function(e){if(u("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;u("opening %s",this.uri),this.engine=r(this.uri,this.opts);var t=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var i=a(t,"open",function(){n.onopen(),e&&e()}),o=a(t,"error",function(t){if(u("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}else n.maybeReconnectOnOpen()});if(!1!==this._timeout){var s=this._timeout;u("connect attempt will timeout after %d",s);var c=setTimeout(function(){u("connect attempt timed out after %d",s),i.destroy(),t.close(),t.emit("error","timeout"),n.emitAll("connect_timeout",s)},s);this.subs.push({destroy:function(){clearTimeout(c)}})}return this.subs.push(i),this.subs.push(o),this},n.prototype.onopen=function(){u("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(a(e,"data",c(this,"ondata"))),this.subs.push(a(e,"ping",c(this,"onping"))),this.subs.push(a(e,"pong",c(this,"onpong"))),this.subs.push(a(e,"error",c(this,"onerror"))),this.subs.push(a(e,"close",c(this,"onclose"))),this.subs.push(a(this.decoder,"decoded",c(this,"ondecoded")))},n.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},n.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},n.prototype.ondata=function(e){this.decoder.add(e)},n.prototype.ondecoded=function(e){this.emit("packet",e)},n.prototype.onerror=function(e){u("error",e),this.emitAll("error",e)},n.prototype.socket=function(e,t){function n(){~f(o.connecting,r)||o.connecting.push(r)}var r=this.nsps[e];if(!r){r=new i(this,e,t),this.nsps[e]=r;var o=this;r.on("connecting",n),r.on("connect",function(){r.id=o.engine.id}),this.autoConnect&&n()}return r},n.prototype.destroy=function(e){var t=f(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},n.prototype.packet=function(e){u("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,function(n){for(var r=0;r<n.length;r++)t.engine.write(n[r],e.options);t.encoding=!1,t.processPacketQueue()}))},
n.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},n.prototype.cleanup=function(){u("cleanup");for(var e=this.subs.length,t=0;e>t;t++){var n=this.subs.shift();n.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},n.prototype.close=n.prototype.disconnect=function(){u("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},n.prototype.onclose=function(e){u("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},n.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();u("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout(function(){e.skipReconnect||(u("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open(function(t){t?(u("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(u("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(n)}})}},n.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},{"./on":52,"./socket":53,backo2:4,"component-bind":8,"component-emitter":10,debug:13,"engine.io-client":15,indexof:31,"socket.io-parser":56}],52:[function(e,t){function n(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}t.exports=n},{}],53:[function(e,t,n){function r(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}var i=e("socket.io-parser"),o=e("component-emitter"),s=e("to-array"),a=e("./on"),c=e("component-bind"),u=e("debug")("socket.io-client:socket"),f=e("has-binary");t.exports=n=r;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},l=o.prototype.emit;o(r.prototype),r.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[a(e,"open",c(this,"onopen")),a(e,"packet",c(this,"onpacket")),a(e,"close",c(this,"onclose"))]}},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},r.prototype.send=function(){var e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},r.prototype.emit=function(e){if(h.hasOwnProperty(e))return l.apply(this,arguments),this;var t=s(arguments),n=i.EVENT;f(t)&&(n=i.BINARY_EVENT);var r={type:n,data:t};return r.options={},r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(u("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),delete this.flags,this},r.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},r.prototype.onopen=function(){u("transport is open - connecting"),"/"!==this.nsp&&this.packet(this.query?{type:i.CONNECT,query:this.query}:{type:i.CONNECT})},r.prototype.onclose=function(e){u("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},r.prototype.onpacket=function(e){if(e.nsp===this.nsp)switch(e.type){case i.CONNECT:this.onconnect();break;case i.EVENT:this.onevent(e);break;case i.BINARY_EVENT:this.onevent(e);break;case i.ACK:this.onack(e);break;case i.BINARY_ACK:this.onack(e);break;case i.DISCONNECT:this.ondisconnect();break;case i.ERROR:this.emit("error",e.data)}},r.prototype.onevent=function(e){var t=e.data||[];u("emitting event %j",t),null!=e.id&&(u("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?l.apply(this,t):this.receiveBuffer.push(t)},r.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var r=s(arguments);u("sending ack %j",r);var o=f(r)?i.BINARY_ACK:i.ACK;t.packet({type:o,id:e,data:r})}}},r.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(u("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):u("bad ack %s",e.id)},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)l.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},r.prototype.ondisconnect=function(){u("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},r.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},r.prototype.close=r.prototype.disconnect=function(){return this.connected&&(u("performing disconnect (%s)",this.nsp),this.packet({type:i.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},r.prototype.compress=function(e){return this.flags=this.flags||{},this.flags.compress=e,this}},{"./on":52,"component-bind":8,"component-emitter":10,debug:13,"has-binary":29,"socket.io-parser":56,"to-array":59}],54:[function(e,t){(function(n){function r(e,t){var r=e;t=t||n.location,null==e&&(e=t.protocol+"//"+t.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(o("protocol-less url %s",e),e="undefined"!=typeof t?t.protocol+"//"+e:"https://"+e),o("parse %s",e),r=i(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var s=-1!==r.host.indexOf(":"),a=s?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port,r.href=r.protocol+"://"+a+(t&&t.port===r.port?"":":"+r.port),r}var i=e("parseuri"),o=e("debug")("socket.io-client:url");t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{debug:13,parseuri:39}],55:[function(e,t,n){(function(t){var r=e("isarray"),i=e("./is-buffer");n.deconstructPacket=function(e){function t(e){if(!e)return e;if(i(e)){var o={_placeholder:!0,num:n.length};return n.push(e),o}if(r(e)){for(var s=new Array(e.length),a=0;a<e.length;a++)s[a]=t(e[a]);return s}if("object"==typeof e&&!(e instanceof Date)){var s={};for(var c in e)s[c]=t(e[c]);return s}return e}var n=[],o=e.data,s=e;return s.data=t(o),s.attachments=n.length,{packet:s,buffers:n}},n.reconstructPacket=function(e,t){function n(e){if(e&&e._placeholder){var i=t[e.num];return i}if(r(e)){for(var o=0;o<e.length;o++)e[o]=n(e[o]);return e}if(e&&"object"==typeof e){for(var s in e)e[s]=n(e[s]);return e}return e}return e.data=n(e.data),e.attachments=void 0,e},n.removeBlobs=function(e,n){function o(e,c,u){if(!e)return e;if(t.Blob&&e instanceof Blob||t.File&&e instanceof File){s++;var f=new FileReader;f.onload=function(){u?u[c]=this.result:a=this.result,--s||n(a)},f.readAsArrayBuffer(e)}else if(r(e))for(var h=0;h<e.length;h++)o(e[h],h,e);else if(e&&"object"==typeof e&&!i(e))for(var l in e)o(e[l],l,e)}var s=0,a=e;o(a),s||n(a)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./is-buffer":57,isarray:33}],56:[function(e,t,n){function r(){}function i(e){var t="",r=!1;return t+=e.type,(n.BINARY_EVENT==e.type||n.BINARY_ACK==e.type)&&(t+=e.attachments,t+="-"),e.nsp&&"/"!=e.nsp&&(r=!0,t+=e.nsp),null!=e.id&&(r&&(t+=",",r=!1),t+=e.id),null!=e.data&&(r&&(t+=","),t+=l.stringify(e.data)),h("encoded %j as %s",e,t),t}function o(e,t){function n(e){var n=d.deconstructPacket(e),r=i(n.packet),o=n.buffers;o.unshift(r),t(o)}d.removeBlobs(e,n)}function s(){this.reconstructor=null}function a(e){var t={},r=0;if(t.type=Number(e.charAt(0)),null==n.types[t.type])return f();if(n.BINARY_EVENT==t.type||n.BINARY_ACK==t.type){for(var i="";"-"!=e.charAt(++r)&&(i+=e.charAt(r),r!=e.length););if(i!=Number(i)||"-"!=e.charAt(r))throw new Error("Illegal attachments");t.attachments=Number(i)}if("/"==e.charAt(r+1))for(t.nsp="";++r;){var o=e.charAt(r);if(","==o)break;if(t.nsp+=o,r==e.length)break}else t.nsp="/";var s=e.charAt(r+1);if(""!==s&&Number(s)==s){for(t.id="";++r;){var o=e.charAt(r);if(null==o||Number(o)!=o){--r;break}if(t.id+=e.charAt(r),r==e.length)break}t.id=Number(t.id)}return e.charAt(++r)&&(t=c(t,e.substr(r))),h("decoded %s as %j",e,t),t}function c(e,t){try{e.data=l.parse(t)}catch(n){return f()}return e}function u(e){this.reconPack=e,this.buffers=[]}function f(){return{type:n.ERROR,data:"parser error"}}var h=e("debug")("socket.io-parser"),l=e("json3"),p=e("component-emitter"),d=e("./binary"),g=e("./is-buffer");n.protocol=4,n.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],n.CONNECT=0,n.DISCONNECT=1,n.EVENT=2,n.ACK=3,n.ERROR=4,n.BINARY_EVENT=5,n.BINARY_ACK=6,n.Encoder=r,n.Decoder=s,r.prototype.encode=function(e,t){if(h("encoding packet %j",e),n.BINARY_EVENT==e.type||n.BINARY_ACK==e.type)o(e,t);else{var r=i(e);t([r])}},p(s.prototype),s.prototype.add=function(e){var t;if("string"==typeof e)t=a(e),n.BINARY_EVENT==t.type||n.BINARY_ACK==t.type?(this.reconstructor=new u(t),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",t)):this.emit("decoded",t);else{if(!g(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,this.emit("decoded",t))}},s.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},u.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length==this.reconPack.attachments){var t=d.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},u.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},{"./binary":55,"./is-buffer":57,"component-emitter":9,debug:13,json3:35}],57:[function(e,t){(function(e){function n(t){return e.Buffer&&e.Buffer.isBuffer(t)||e.ArrayBuffer&&t instanceof ArrayBuffer}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],58:[function(e,t,n){function r(e){if(e&&!c(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function o(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function s(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=e("buffer").Buffer,c=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=i)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";e=e.slice(n,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var r=t.charCodeAt(t.length-1);if(!(r>=55296&&56319>=r)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,r=t.charCodeAt(i);if(r>=55296&&56319>=r){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,i)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(2>=t&&n>>4==14){this.charLength=3;break}if(3>=t&&n>>3==30){this.charLength=4;break}}this.charReceived=t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},{buffer:66}],59:[function(e,t){function n(e,t){var n=[];t=t||0;for(var r=t||0;r<e.length;r++)n[r-t]=e[r];return n}t.exports=n},{}],60:[function(e,t){(function(e){function n(e,t){function n(){if(!i){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}if(r("noDeprecation"))return e;var i=!1;return n}function r(t){try{if(!e.localStorage)return!1}catch(n){return!1}var r=e.localStorage[t];return null==r?!1:"true"===String(r).toLowerCase()}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],61:[function(t,n,r){(function(t){!function(i){function o(e){for(var t,n,r=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function s(e){for(var t,n=e.length,r=-1,i="";++r<n;)t=e[r],t>65535&&(t-=65536,i+=v(t>>>10&1023|55296),t=56320|1023&t),i+=v(t);return i}function a(e,t){return v(e>>t&63|128)}function c(e){if(0==(4294967168&e))return v(e);var t="";return 0==(4294965248&e)?t=v(e>>6&31|192):0==(4294901760&e)?(t=v(e>>12&15|224),t+=a(e,6)):0==(4292870144&e)&&(t=v(e>>18&7|240),t+=a(e,12),t+=a(e,6)),t+=v(63&e|128)}function u(e){for(var t,n=o(e),r=n.length,i=-1,s="";++i<r;)t=n[i],s+=c(t);return s}function f(){if(b>=m)throw Error("Invalid byte index");var e=255&y[b];if(b++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function h(){var e,t,n,r,i;if(b>m)throw Error("Invalid byte index");if(b==m)return!1;if(e=255&y[b],b++,0==(128&e))return e;if(192==(224&e)){var t=f();if(i=(31&e)<<6|t,i>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if(t=f(),n=f(),i=(15&e)<<12|t<<6|n,i>=2048)return i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=f(),n=f(),r=f(),i=(15&e)<<18|t<<12|n<<6|r,i>=65536&&1114111>=i))return i;throw Error("Invalid WTF-8 detected")}function l(e){y=o(e),m=y.length,b=0;for(var t,n=[];(t=h())!==!1;)n.push(t);return s(n)}var p="object"==typeof r&&r,d="object"==typeof n&&n&&n.exports==p&&n,g="object"==typeof t&&t;(g.global===g||g.window===g)&&(i=g);var y,m,b,v=String.fromCharCode,w={version:"1.0.0",encode:u,decode:l};if("function"==typeof e&&"object"==typeof e.amd&&e.amd)e(function(){return w});else if(p&&!p.nodeType)if(d)d.exports=w;else{var _={},k=_.hasOwnProperty;for(var A in w)k.call(w,A)&&(p[A]=w[A])}else i.wtf8=w}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],62:[function(e,t){"use strict";function n(e){var t="";do t=s[e%a]+t,e=Math.floor(e/a);while(e>0);return t}function r(e){var t=0;for(f=0;f<e.length;f++)t=t*a+c[e.charAt(f)];return t}function i(){var e=n(+new Date);return e!==o?(u=0,o=e):e+"."+n(u++)}for(var o,s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),a=64,c={},u=0,f=0;a>f;f++)c[s[f]]=f;i.encode=n,i.decode=r,t.exports=i},{}],63:[function(e){"use strict";function t(e){console.log("peer connected!!!"),e.send("client says: "+e.owner_id),e.on("data",function(e){console.log("received data: ",String.fromCharCode.apply(null,e))}),e.on("error",function(e){console.log(e)})}var n=e("./lib/client"),r=e("debug");r.enable("kiwi-web-client");var i=new n({addr:"192.168.1.243:3000/tracker"});i.on("peer",t)},{"./lib/client":1,debug:13}],64:[function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function o(e){var t,n,i,o,s,a,c=e.length;s=r(e),a=new h(3*c/4-s),i=s>0?c-4:c;var u=0;for(t=0,n=0;i>t;t+=4,n+=3)o=f[e.charCodeAt(t)]<<18|f[e.charCodeAt(t+1)]<<12|f[e.charCodeAt(t+2)]<<6|f[e.charCodeAt(t+3)],a[u++]=o>>16&255,a[u++]=o>>8&255,a[u++]=255&o;return 2===s?(o=f[e.charCodeAt(t)]<<2|f[e.charCodeAt(t+1)]>>4,a[u++]=255&o):1===s&&(o=f[e.charCodeAt(t)]<<10|f[e.charCodeAt(t+1)]<<4|f[e.charCodeAt(t+2)]>>2,a[u++]=o>>8&255,a[u++]=255&o),a}function s(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function a(e,t,n){for(var r,i=[],o=t;n>o;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(s(r));return i.join("")}function c(e){for(var t,n=e.length,r=n%3,i="",o=[],s=16383,c=0,f=n-r;f>c;c+=s)o.push(a(e,c,c+s>f?f:c+s));return 1===r?(t=e[n-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),o.push(i),o.join("")}n.byteLength=i,n.toByteArray=o,n.fromByteArray=c;for(var u=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,d=l.length;d>p;++p)u[p]=l[p],f[l.charCodeAt(p)]=p;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},{}],65:[function(){},{}],66:[function(e,t,n){(function(t){"use strict";function r(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function i(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=s.prototype):(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return a(this,e,t,n)}function a(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?p(e,t,n,r):"string"==typeof t?h(e,t,n):d(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(0>e)throw new RangeError('"size" argument must not be negative')}function u(e,t,n,r){return c(t),0>=t?o(e,t):void 0!==n?"string"==typeof r?o(e,t).fill(n,r):o(e,t).fill(n):o(e,t)}function f(e,t){if(c(t),e=o(e,0>t?0:0|g(t)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;t>n;++n)e[n]=0;return e}function h(e,t,n){if(("string"!=typeof n||""===n)&&(n="utf8"),!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|m(t,n);e=o(e,r);var i=e.write(t,n);return i!==r&&(e=e.slice(0,i)),e}function l(e,t){var n=t.length<0?0:0|g(t.length);e=o(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function p(e,t,n,r){if(t.byteLength,0>n||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),s.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=s.prototype):e=l(e,t),e}function d(e,t){if(s.isBuffer(t)){var n=0|g(t.length);return e=o(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||K(t.length)?o(e,0):l(e,t);if("Buffer"===t.type&&Q(t.data))return l(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function g(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function y(e){return+e!=e&&(e=0),s.alloc(+e)}function m(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(r)return W(e).length;t=(""+t).toLowerCase(),r=!0}}function b(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if(n>>>=0,t>>>=0,t>=n)return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return R(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function w(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:-2147483648>n&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(0>n){if(!i)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,i);if("number"==typeof t)return t=255&t,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,c=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}var u;if(i){var f=-1;for(u=n;a>u;u++)if(o(e,u)===o(t,-1===f?0:u-f)){if(-1===f&&(f=u),u-f+1===c)return f*s}else-1!==f&&(u-=u-f),f=-1}else for(n+c>a&&(n=a-c),u=n;u>=0;u--){for(var h=!0,l=0;c>l;l++)if(o(e,u+l)!==o(t,l)){h=!1;break}if(h)return u}return-1}function k(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;r>s;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function A(e,t,n,r){return V(W(t,e.length-n),e,n,r)}function E(e,t,n,r){return V(J(t),e,n,r)}function x(e,t,n,r){return E(e,t,n,r)}function S(e,t,n,r){return V($(t),e,n,r)}function C(e,t,n,r){return V(X(t,e.length-n),e,n,r)}function R(e,t,n){return Z.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;n>i;){var o=e[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(n>=i+a){var c,u,f,h;switch(a){case 1:128>o&&(s=o);break;case 2:c=e[i+1],128===(192&c)&&(h=(31&o)<<6|63&c,h>127&&(s=h));break;case 3:c=e[i+1],u=e[i+2],128===(192&c)&&128===(192&u)&&(h=(15&o)<<12|(63&c)<<6|63&u,h>2047&&(55296>h||h>57343)&&(s=h));break;case 4:c=e[i+1],u=e[i+2],f=e[i+3],128===(192&c)&&128===(192&u)&&128===(192&f)&&(h=(15&o)<<18|(63&c)<<12|(63&u)<<6|63&f,h>65535&&1114112>h&&(s=h))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return B(r)}function B(e){var t=e.length;if(ee>=t)return String.fromCharCode.apply(String,e);for(var n="",r=0;t>r;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ee));return n}function P(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;++i)r+=String.fromCharCode(127&e[i]);return r}function L(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;++i)r+=String.fromCharCode(e[i]);return r}function j(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=t;n>o;++o)i+=H(e[o]);return i}function O(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function M(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,n,r,i,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||o>t)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function D(e,t,n,r){0>t&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);o>i;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function N(e,t,n,r){0>t&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);o>i;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function I(e,t,n,r){if(n+r>e.length)throw new RangeError("Index out of range");if(0>n)throw new RangeError("Index out of range")}function q(e,t,n,r,i){return i||I(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),G.write(e,t,n,r,23,4),n+4}function Y(e,t,n,r,i){return i||I(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),G.write(e,t,n,r,52,8),n+8}function z(e){if(e=F(e).replace(te,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function F(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function H(e){return 16>e?"0"+e.toString(16):e.toString(16)}function W(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],s=0;r>s;++s){if(n=e.charCodeAt(s),n>55295&&57344>n){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(56320>n){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,128>n){if((t-=1)<0)break;o.push(n)}else if(2048>n){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function J(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function X(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function $(e){return Z.toByteArray(z(e))}function V(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function K(e){return e!==e}var Z=e("base64-js"),G=e("ieee754"),Q=e("isarray");n.Buffer=s,n.SlowBuffer=y,n.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),n.kMaxLength=i(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,n){return a(null,e,t,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,n){return u(null,e,t,n)},s.allocUnsafe=function(e){return f(null,e)},s.allocUnsafeSlow=function(e){return f(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);o>i;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return r>n?-1:n>r?1:0},s.isEncoding=function(e){switch(String(e).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}},s.concat=function(e,t){if(!Q(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},s.byteLength=m,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;e>t;t+=2)v(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;e>t;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;e>t;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},s.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):b.apply(this,arguments)},s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===s.compare(this,e)},s.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},s.prototype.compare=function(e,t,n,r,i){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),0>t||n>e.length||0>r||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var o=i-r,a=n-t,c=Math.min(o,a),u=this.slice(r,i),f=e.slice(t,n),h=0;c>h;++h)if(u[h]!==f[h]){o=u[h],a=f[h];break}return a>o?-1:o>a?1:0},s.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},s.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)},s.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(0>n||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return k(this,e,t,n);case"utf8":case"utf-8":return A(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var r;if(s.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=s.prototype;else{var i=t-e;r=new s(i,void 0);for(var o=0;i>o;++o)r[o]=this[o+e]}return r},s.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||M(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},s.prototype.readUIntBE=function(e,t,n){e=0|e,t=0|t,n||M(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUInt8=function(e,t){return t||M(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||M(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){
return t||M(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||M(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||M(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||M(e,4,this.length),G.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||M(e,4,this.length),G.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||M(e,8,this.length),G.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||M(e,8,this.length),G.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var i=Math.pow(2,8*n)-1;U(this,e,t,n,i,0)}var o=1,s=0;for(this[t]=255&e;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var i=Math.pow(2,8*n)-1;U(this,e,t,n,i,0)}var o=n-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||U(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||U(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||U(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||U(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||U(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);U(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)0>e&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);U(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)0>e&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||U(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||U(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||U(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||U(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||U(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return q(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return q(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return Y(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return Y(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&n>r&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&t>n&&r>t)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(1e3>o||!s.TYPED_ARRAY_SUPPORT)for(i=0;o>i;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},s.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);256>i&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e=255&e);if(0>t||this.length<t||this.length<n)throw new RangeError("Out of range index");if(t>=n)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;n>o;++o)this[o]=e;else{var a=s.isBuffer(e)?e:W(new s(e,r).toString()),c=a.length;for(o=0;n-t>o;++o)this[o+t]=a[o%c]}return this};var te=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":64,ieee754:68,isarray:70}],67:[function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,a,c,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}if(n=this._events[e],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(o(n))for(a=Array.prototype.slice.call(arguments,1),u=n.slice(),i=u.length,c=0;i>c;c++)u[c].apply(this,a);return!0},n.prototype.addListener=function(e,t){var i;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,s,a;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],s=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(a=s;a-->0;)if(n[a]===t||n[a].listener&&n[a].listener===t){i=a;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},{}],68:[function(e,t,n){n.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,f=-7,h=n?i-1:0,l=n?-1:1,p=e[t+h];for(h+=l,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+h],h+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+e[t+h],h+=l,f-=8);if(0===o)o=1-u;else{if(o===c)return s?0/0:(p?-1:1)*(1/0);s+=Math.pow(2,r),o-=u}return(p?-1:1)*s*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var s,a,c,u=8*o-i-1,f=(1<<u)-1,h=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),t+=s+h>=1?l/c:l*Math.pow(2,1-h),t*c>=2&&(s++,c/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(t*c-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[n+p]=255&s,p+=d,s/=256,u-=8);e[n+p-d]|=128*g}},{}],69:[function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function r(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}t.exports=function(e){return null!=e&&(n(e)||r(e)||!!e._isBuffer)}},{}],70:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{dup:34}],71:[function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function o(e){if(h===clearTimeout)return clearTimeout(e);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function s(){g&&p&&(g=!1,p.length?d=p.concat(d):y=-1,d.length&&a())}function a(){if(!g){var e=i(s);g=!0;for(var t=d.length;t;){for(p=d,d=[];++y<t;)p&&p[y].run();y=-1,t=d.length}p=null,g=!1,o(e)}}function c(e,t){this.fun=e,this.array=t}function u(){}var f,h,l=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(e){h=r}}();var p,d=[],g=!1,y=-1;l.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new c(e,t)),1!==d.length||g||i(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=u,l.addListener=u,l.once=u,l.off=u,l.removeListener=u,l.removeAllListeners=u,l.emit=u,l.binding=function(){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},{}]},{},[63])(63)});