"tanx.io" === window.location.hostname && (!function(a, e, t, n, o, c, g) { a.GoogleAnalyticsObject = o, a.ga = a.ga || function() { (a.ga.q = a.ga.q || []).push(arguments) } , a.ga.l = 1 * new Date, c = e.createElement(t), g = e.getElementsByTagName(t)[0], c.async = 1, c.src = "https://www.google-analytics.com/analytics.js", g.parentNode.insertBefore(c, g) }(window, document, "script", 0, "ga"), ga("create", "UA-23605814-1", "auto"), ga("send", "pageview")); "use strict"; function Events() { Object.defineProperty(this, "_events", { enumerable: !1, configurable: !1, writable: !0, value: {} }) } function EventHandle(e, t, n) { this.owner = e, this.name = t, this.fn = n } Events.prototype.on = function(e, t) { var n = this._events[e]; return void 0 === n ? (this._events[e] = [t], this.emit("event:on", t)) : -1 == n.indexOf(t) && (n.push(t), this.emit("event:on", t)), new EventHandle(this,e,t) } , Events.prototype.once = function(e, t) { var n = this._events[e]; return t.once = !0, n ? -1 == n.indexOf(t) && (n.push(t), this.emit("event:once", t)) : (this._events[e] = [t], this.emit("event:once", t)), new EventHandle(this,e,t) } , Events.prototype.emit = function(e) { var t = this._events[e]; if (!t) return this; t = t.slice(0); for (var n = Array.prototype.slice.call(arguments, 1), i = 0; i < t.length; i++) if (t[i]) { try { t[i].apply(this, n) } catch (t) { console.info("%c%s %c(event error)", "color: #06f", e, "color: #f00"), console.log(t.stack) } t[i] && t[i].once && this._events[e] && this._events[e].splice(this._events[e].indexOf(t[i]), 1) } return this } , Events.prototype.unbind = function(e, t) { if (e) { var n = this._events[e]; if (!n) return this; if (t) { var i = n.indexOf(t); -1 !== i && (1 === n.length ? delete this._events[e] : n.splice(i, 1)) } else delete this._events[e] } else this._events = {}; return this } , EventHandle.prototype.unbind = function() { this.owner && (this.owner.unbind(this.name, this.fn), this.owner = null, this.name = null, this.fn = null) } , EventHandle.prototype.call = function() { this.fn && this.fn.apply(this.owner, arguments) } , EventHandle.prototype.on = function(e, t) { return this.owner.on(e, t) } ; pc.Angle = function(t) { this._theta = t * pc.Angle.RA || 0, this._normalize() } , pc.Angle.RA = 180 / Math.PI, pc.Angle.prototype = { copy: function(t) { return this._theta = t._theta, this }, dot: function(t) { return this.x * t.x + this.y * t.y }, lerp: function(t, e) { var n = this.distance(t); if (n) return Math.abs(n) < e ? (this._theta = t._theta, this) : (this._theta += Math.sign(n) * e, this._normalize(), this) }, distance: function(t) { var e = t._theta - this._theta; return Math.abs(e) > Math.PI ? (Math.PI2 - Math.abs(e)) * (-1 * Math.sign(e)) : e }, fromVec2: function(t) { return t instanceof Array || (t = t.data), this._theta = Math.atan2(t[0], t[1]), this }, _normalize: function() { return this._theta -= Math.PI2 * Math.floor((this._theta + Math.PI) / Math.PI2), this } }, Object.defineProperty(pc.Angle.prototype, "radians", { get: function() { return this._theta }, set: function(t) { this._theta = t, this._normalize() } }), Object.defineProperty(pc.Angle.prototype, "degrees", { get: function() { return this._theta * pc.Angle.RA }, set: function(t) { this._theta = t / pc.Angle.RA, this._normalize() } }), Object.defineProperty(pc.Angle.prototype, "x", { get: function() { return Math.sin(this._theta) } }), Object.defineProperty(pc.Angle.prototype, "y", { get: function() { return Math.cos(this._theta) } }), pc.Vec2.prototype.fromAngle = function(t) { return this.data[0] = Math.sin(t._theta), this.data[1] = Math.cos(t._theta), this } , Math.sign = Math.sign || function(t) { return 0 === t || isNaN(t) ? t : t > 0 ? 1 : -1 } , Math.PI2 = 2 * Math.PI; !function(e) { if ("object" == typeof exports && "undefined" != typeof module) module.exports = e(); else if ("function" == typeof define && define.amd) define([], e); else { var t; "undefined" != typeof window ? t = window : "undefined" != typeof global ? t = global : "undefined" != typeof self && (t = self), t.eio = e() } }(function() { return function e(t, r, n) { function s(i, a) { if (!r[i]) { if (!t[i]) { var c = "function" == typeof require && require; if (!a && c) return c(i, !0); if (o) return o(i, !0); var p = new Error("Cannot find module '" + i + "'"); throw p.code = "MODULE_NOT_FOUND", p } var u = r[i] = { exports: {} }; t[i][0].call(u.exports, function(e) { var r = t[i][1][e]; return s(r || e) }, u, u.exports, e, t, r, n) } return r[i].exports } for (var o = "function" == typeof require && require, i = 0; i < n.length; i++) s(n[i]); return s }({ 1: [function(e, t, r) { t.exports = e("./lib/") } , { "./lib/": 2 }], 2: [function(e, t, r) { t.exports = e("./socket"), t.exports.parser = e("engine.io-parser") } , { "./socket": 3, "engine.io-parser": 19 }], 3: [function(e, t, r) { (function(r) { var n = e("./transports") , o = e("component-emitter") , s = e("debug")("engine.io-client:socket") , i = e("indexof") , a = e("engine.io-parser") , c = e("parseuri") , p = e("parsejson") , u = e("parseqs"); function Socket(e, t) { if (!(this instanceof Socket)) return new Socket(e,t); t = t || {}, e && "object" == typeof e && (t = e, e = null), e ? (e = c(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 = c(t.host).host), this.secure = null != t.secure ? t.secure : r.location && "https:" == location.protocol, t.hostname && !t.port && (t.port = this.secure ? "443" : "80"), this.agent = t.agent || !1, this.hostname = t.hostname || (r.location ? location.hostname : "localhost"), this.port = t.port || (r.location && location.port ? location.port : this.secure ? 443 : 80), this.query = t.query || {}, "string" == typeof this.query && (this.query = u.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.policyPort = t.policyPort || 843, this.rememberUpgrade = t.rememberUpgrade || !1, this.binaryType = null, this.onlyBinaryUpgrades = t.onlyBinaryUpgrades, this.perMessageDeflate = !1 !== t.perMessageDeflate && (t.perMessageDeflate || {}), !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 n = "object" == typeof r && r; n.global === n && t.extraHeaders && Object.keys(t.extraHeaders).length > 0 && (this.extraHeaders = t.extraHeaders), this.open() } t.exports = Socket, Socket.priorWebsocketSuccess = !1, o(Socket.prototype), Socket.protocol = a.protocol, Socket.Socket = Socket, Socket.Transport = e("./transport"), Socket.transports = e("./transports"), Socket.parser = e("engine.io-parser"), Socket.prototype.createTransport = function(e) { s('creating transport "%s"', e); var t = function clone(e) { var t = {}; for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]); return t }(this.query); return t.EIO = a.protocol, t.transport = e, this.id && (t.sid = this.id), new n[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 }) } , Socket.prototype.open = function() { var e; if (this.rememberUpgrade && Socket.priorWebsocketSuccess && -1 != this.transports.indexOf("websocket")) e = "websocket"; else { if (0 === this.transports.length) { var t = this; return void setTimeout(function() { t.emit("error", "No transports available") }, 0) } e = this.transports[0] } this.readyState = "opening"; try { e = this.createTransport(e) } catch (e) { return this.transports.shift(), void this.open() } e.open(), this.setTransport(e) } , Socket.prototype.setTransport = function(e) { s("setting transport %s", e.name); var t = this; this.transport && (s("clearing existing transport %s", this.transport.name), this.transport.removeAllListeners()), this.transport = e, e.on("drain", function() { t.onDrain() }).on("packet", function(e) { t.onPacket(e) }).on("error", function(e) { t.onError(e) }).on("close", function() { t.onClose("transport close") }) } , Socket.prototype.probe = function(e) { s('probing transport "%s"', e); var t = this.createTransport(e, { probe: 1 }) , r = !1 , n = this; function onTransportOpen() { if (n.onlyBinaryUpgrades) { var o = !this.supportsBinary && n.transport.supportsBinary; r = r || o } r || (s('probe transport "%s" opened', e), t.send([{ type: "ping", data: "probe" }]), t.once("packet", function(o) { if (!r) if ("pong" == o.type && "probe" == o.data) { if (s('probe transport "%s" pong', e), n.upgrading = !0, n.emit("upgrading", t), !t) return; Socket.priorWebsocketSuccess = "websocket" == t.name, s('pausing current transport "%s"', n.transport.name), n.transport.pause(function() { r || "closed" != n.readyState && (s("changing transport and sending upgrade packet"), cleanup(), n.setTransport(t), t.send([{ type: "upgrade" }]), n.emit("upgrade", t), t = null, n.upgrading = !1, n.flush()) }) } else { s('probe transport "%s" failed', e); var i = new Error("probe error"); i.transport = t.name, n.emit("upgradeError", i) } })) } function freezeTransport() { r || (r = !0, cleanup(), t.close(), t = null) } function onerror(r) { var o = new Error("probe error: " + r); o.transport = t.name, freezeTransport(), s('probe transport "%s" failed because of error: %s', e, r), n.emit("upgradeError", o) } function onTransportClose() { onerror("transport closed") } function onclose() { onerror("socket closed") } function onupgrade(e) { t && e.name != t.name && (s('"%s" works - aborting "%s"', e.name, t.name), freezeTransport()) } function cleanup() { t.removeListener("open", onTransportOpen), t.removeListener("error", onerror), t.removeListener("close", onTransportClose), n.removeListener("close", onclose), n.removeListener("upgrading", onupgrade) } Socket.priorWebsocketSuccess = !1, t.once("open", onTransportOpen), t.once("error", onerror), t.once("close", onTransportClose), this.once("close", onclose), this.once("upgrading", onupgrade), t.open() } , Socket.prototype.onOpen = function() { if (s("socket open"), this.readyState = "open", Socket.priorWebsocketSuccess = "websocket" == this.transport.name, this.emit("open"), this.flush(), "open" == this.readyState && this.upgrade && this.transport.pause) { s("starting upgrade probes"); for (var e = 0, t = this.upgrades.length; e < t; e++) this.probe(this.upgrades[e]) } } , Socket.prototype.onPacket = function(e) { if ("opening" == this.readyState || "open" == this.readyState) switch (s('socket receive: type "%s", data "%s"', e.type, e.data), this.emit("packet", e), this.emit("heartbeat"), e.type) { case "open": this.onHandshake(p(e.data)); break; case "pong": this.setPing(), this.emit("pong"); break; case "error": var t = new Error("server error"); t.code = e.data, this.onError(t); break; case "message": this.emit("data", e.data), this.emit("message", e.data) } else s('packet received with socket readyState "%s"', this.readyState) } , Socket.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)) } , Socket.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) } , Socket.prototype.setPing = function() { var e = this; clearTimeout(e.pingIntervalTimer), e.pingIntervalTimer = setTimeout(function() { s("writing ping packet - expecting pong within %sms", e.pingTimeout), e.ping(), e.onHeartbeat(e.pingTimeout) }, e.pingInterval) } , Socket.prototype.ping = function() { var e = this; this.sendPacket("ping", function() { e.emit("ping") }) } , Socket.prototype.onDrain = function() { this.writeBuffer.splice(0, this.prevBufferLen), this.prevBufferLen = 0, 0 === this.writeBuffer.length ? this.emit("drain") : this.flush() } , Socket.prototype.flush = function() { "closed" != this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length && (s("flushing %d packets in socket", this.writeBuffer.length), this.transport.send(this.writeBuffer), this.prevBufferLen = this.writeBuffer.length, this.emit("flush")) } , Socket.prototype.write = Socket.prototype.send = function(e, t, r) { return this.sendPacket("message", e, t, r), this } , Socket.prototype.sendPacket = function(e, t, r, n) { if ("function" == typeof t && (n = t, t = void 0), "function" == typeof r && (n = r, r = null), "closing" != this.readyState && "closed" != this.readyState) { (r = r || {}).compress = !1 !== r.compress; var o = { type: e, data: t, options: r }; this.emit("packetCreate", o), this.writeBuffer.push(o), n && this.once("flush", n), this.flush() } } , Socket.prototype.close = function() { if ("opening" == this.readyState || "open" == this.readyState) { this.readyState = "closing"; var e = this; this.writeBuffer.length ? this.once("drain", function() { this.upgrading ? waitForUpgrade() : close() }) : this.upgrading ? waitForUpgrade() : close() } function close() { e.onClose("forced close"), s("socket closing - telling transport to close"), e.transport.close() } function cleanupAndClose() { e.removeListener("upgrade", cleanupAndClose), e.removeListener("upgradeError", cleanupAndClose), close() } function waitForUpgrade() { e.once("upgrade", cleanupAndClose), e.once("upgradeError", cleanupAndClose) } return this } , Socket.prototype.onError = function(e) { s("socket error %j", e), Socket.priorWebsocketSuccess = !1, this.emit("error", e), this.onClose("transport error", e) } , Socket.prototype.onClose = function(e, t) { if ("opening" == this.readyState || "open" == this.readyState || "closing" == this.readyState) { s('socket close with reason: "%s"', e); clearTimeout(this.pingIntervalTimer), clearTimeout(this.pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), this.readyState = "closed", this.id = null, this.emit("close", e, t), this.writeBuffer = [], this.prevBufferLen = 0 } } , Socket.prototype.filterUpgrades = function(e) { for (var t = [], r = 0, n = e.length; r < n; r++) ~i(this.transports, e[r]) && t.push(e[r]); return t } } ).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) } , { "./transport": 4, "./transports": 5, "component-emitter": 15, debug: 17, "engine.io-parser": 19, indexof: 24, parsejson: 27, parseqs: 28, parseuri: 29 }], 4: [function(e, t, r) { var n = e("engine.io-parser") , o = e("component-emitter"); function Transport(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, window.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 } t.exports = Transport, o(Transport.prototype), Transport.prototype.onError = function(e, t) { var r = new Error(e); return r.type = "TransportError", r.description = t, this.emit("error", r), this } , Transport.prototype.open = function() { return "closed" != this.readyState && "" != this.readyState || (this.readyState = "opening", this.doOpen()), this } , Transport.prototype.close = function() { return "opening" != this.readyState && "open" != this.readyState || (this.doClose(), this.onClose()), this } , Transport.prototype.send = function(e) { if ("open" != this.readyState) throw new Error("Transport not open"); this.write(e) } , Transport.prototype.onOpen = function() { this.readyState = "open", this.writable = !0, this.emit("open") } , Transport.prototype.onData = function(e) { var t = n.decodePacket(e, this.socket.binaryType); this.onPacket(t) } , Transport.prototype.onPacket = function(e) { this.emit("packet", e) } , Transport.prototype.onClose = function() { this.readyState = "closed", this.emit("close") } } , { "component-emitter": 15, "engine.io-parser": 19 }], 5: [function(e, t, r) { (function(t) { var n = e("xmlhttprequest-ssl") , o = e("./polling-xhr") , s = e("./polling-jsonp") , i = e("./websocket"); r.polling = function polling(e) { var r = !1 , i = !1 , a = !1 !== e.jsonp; if (t.location) { var c = "https:" == location.protocol , p = location.port; p || (p = c ? 443 : 80), r = e.hostname != location.hostname || p != e.port, i = e.secure != c } { if (e.xdomain = r, e.xscheme = i, "open"in new n(e) && !e.forceJSONP) return new o(e); if (!a) throw new Error("JSONP disabled"); return new s(e) } } , r.websocket = i } ).call(this, "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) } , { "./polling-jsonp": 6, "./polling-xhr": 7, "./websocket": 9, "xmlhttprequest-ssl": 10 }], 6: [function(e, t, r) { (function(r) { var n = e("./polling") , o = e("component-inherit"); t.exports = JSONPPolling; var s, i = /\n/g, a = /\\n/g; function empty() {} function JSONPPolling(e) { n.call(this, e), this.query = this.query || {}, s || (r.___eio || (r.___eio = []), s = r.___eio), this.index = s.length; var t = this; s.push(function(e) { t.onData(e) }), this.query.j = this.index, r.document && r.addEventListener && r.addEventListener("beforeunload", function() { t.script && (t.script.onerror = empty) }, !1) } o(JSONPPolling, n), JSONPPolling.prototype.supportsBinary = !1, JSONPPolling.prototype.doClose = function() { this.script && (this.script.parentNode.removeChild(this.script), this.script = null), this.form && (this.form.parentNode.removeChild(this.form), this.form = null, this.iframe = null), n.prototype.doClose.call(this) } , JSONPPolling.prototype.doPoll = function() { var e = this , t = document.createElement("script"); this.script && (this.script.parentNode.removeChild(this.script), this.script = null), t.async = !0, t.src = this.uri(), t.onerror = function(t) { e.onError("jsonp poll error", t) } ; var r = document.getElementsByTagName("script")[0]; r.parentNode.insertBefore(t, r), this.script = t, "undefined" != typeof navigator && /gecko/i.test(navigator.userAgent) && setTimeout(function() { var e = document.createElement("iframe"); document.body.appendChild(e), document.body.removeChild(e) }, 100) } , JSONPPolling.prototype.doWrite = function(e, t) { var r = this; if (!this.form) { var n, o = document.createElement("form"), s = document.createElement("textarea"), c = this.iframeId = "eio_iframe_" + this.index; o.className = "socketio", o.style.position = "absolute", o.style.top = "-1000px", o.style.left = "-1000px", o.target = c, o.method = "POST", o.setAttribute("accept-charset", "utf-8"), s.name = "d", o.appendChild(s), document.body.appendChild(o), this.form = o, this.area = s } function complete() { initIframe(), t() } function initIframe() { if (r.iframe) try { r.form.removeChild(r.iframe) } catch (e) { r.onError("jsonp polling iframe removal error", e) } try { var e = '