node-red-contrib-snap4city-user
Version:
Nodes for Snap4city project, targeted to standard user (no developer)
1,051 lines (1,025 loc) • 118 kB
JavaScript
/* sockjs-client v1.1.4 | http://sockjs.org | MIT license */ ! function (t) {
if ("object" == typeof exports && "undefined" != typeof module) module.exports = t();
else if ("function" == typeof define && define.amd) define([], t);
else {
var e;
e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, e.SockJS = t()
}
}(function () {
var t;
return function t(e, n, r) {
function i(s, a) {
if (!n[s]) {
if (!e[s]) {
var l = "function" == typeof require && require;
if (!a && l) return l(s, !0);
if (o) return o(s, !0);
var u = new Error("Cannot find module '" + s + "'");
throw u.code = "MODULE_NOT_FOUND", u
}
var c = n[s] = {
exports: {}
};
e[s][0].call(c.exports, function (t) {
var n = e[s][1][t];
return i(n || t)
}, c, c.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 (t, e, n) {
(function (n) {
"use strict";
var r = t("./transport-list");
e.exports = t("./main")(r), "_sockjs_onload" in n && setTimeout(n._sockjs_onload, 1)
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
"./main": 14,
"./transport-list": 16
}],
2: [function (t, e, n) {
"use strict";
function r() {
o.call(this), this.initEvent("close", !1, !1), this.wasClean = !1, this.code = 0, this.reason = ""
}
var i = t("inherits"),
o = t("./event");
i(r, o), e.exports = r
}, {
"./event": 4,
"inherits": 54
}],
3: [function (t, e, n) {
"use strict";
function r() {
o.call(this)
}
var i = t("inherits"),
o = t("./eventtarget");
i(r, o), r.prototype.removeAllListeners = function (t) {
t ? delete this._listeners[t] : this._listeners = {}
}, r.prototype.once = function (t, e) {
function n() {
r.removeListener(t, n), i || (i = !0, e.apply(this, arguments))
}
var r = this,
i = !1;
this.on(t, n)
}, r.prototype.emit = function () {
var t = arguments[0],
e = this._listeners[t];
if (e) {
for (var n = arguments.length, r = new Array(n - 1), i = 1; i < n; i++) r[i - 1] = arguments[i];
for (var o = 0; o < e.length; o++) e[o].apply(this, r)
}
}, r.prototype.on = r.prototype.addListener = o.prototype.addEventListener, r.prototype.removeListener = o.prototype.removeEventListener, e.exports.EventEmitter = r
}, {
"./eventtarget": 5,
"inherits": 54
}],
4: [function (t, e, n) {
"use strict";
function r(t) {
this.type = t
}
r.prototype.initEvent = function (t, e, n) {
return this.type = t, this.bubbles = e, this.cancelable = n, this.timeStamp = +new Date, this
}, r.prototype.stopPropagation = function () {}, r.prototype.preventDefault = function () {}, r.CAPTURING_PHASE = 1, r.AT_TARGET = 2, r.BUBBLING_PHASE = 3, e.exports = r
}, {}],
5: [function (t, e, n) {
"use strict";
function r() {
this._listeners = {}
}
r.prototype.addEventListener = function (t, e) {
t in this._listeners || (this._listeners[t] = []);
var n = this._listeners[t]; - 1 === n.indexOf(e) && (n = n.concat([e])), this._listeners[t] = n
}, r.prototype.removeEventListener = function (t, e) {
var n = this._listeners[t];
if (n) {
var r = n.indexOf(e);
return -1 !== r ? void(n.length > 1 ? this._listeners[t] = n.slice(0, r).concat(n.slice(r + 1)) : delete this._listeners[t]) : void 0
}
}, r.prototype.dispatchEvent = function () {
var t = arguments[0],
e = t.type,
n = 1 === arguments.length ? [t] : Array.apply(null, arguments);
if (this["on" + e] && this["on" + e].apply(this, n), e in this._listeners)
for (var r = this._listeners[e], i = 0; i < r.length; i++) r[i].apply(this, n)
}, e.exports = r
}, {}],
6: [function (t, e, n) {
"use strict";
function r(t) {
o.call(this), this.initEvent("message", !1, !1), this.data = t
}
var i = t("inherits"),
o = t("./event");
i(r, o), e.exports = r
}, {
"./event": 4,
"inherits": 54
}],
7: [function (t, e, n) {
"use strict";
function r(t) {
this._transport = t, t.on("message", this._transportMessage.bind(this)), t.on("close", this._transportClose.bind(this))
}
var i = t("json3"),
o = t("./utils/iframe");
r.prototype._transportClose = function (t, e) {
o.postMessage("c", i.stringify([t, e]))
}, r.prototype._transportMessage = function (t) {
o.postMessage("t", t)
}, r.prototype._send = function (t) {
this._transport.send(t)
}, r.prototype._close = function () {
this._transport.close(), this._transport.removeAllListeners()
}, e.exports = r
}, {
"./utils/iframe": 47,
"json3": 55
}],
8: [function (t, e, n) {
"use strict";
var r = t("./utils/url"),
i = t("./utils/event"),
o = t("json3"),
s = t("./facade"),
a = t("./info-iframe-receiver"),
l = t("./utils/iframe"),
u = t("./location");
e.exports = function (t, e) {
var n = {};
e.forEach(function (t) {
t.facadeTransport && (n[t.facadeTransport.transportName] = t.facadeTransport)
}), n[a.transportName] = a;
var c;
t.bootstrap_iframe = function () {
var e;
l.currentWindowId = u.hash.slice(1);
var a = function (i) {
if (i.source === parent && (void 0 === c && (c = i.origin), i.origin === c)) {
var a;
try {
a = o.parse(i.data)
} catch (t) {
return void i.data
}
if (a.windowId === l.currentWindowId) switch (a.type) {
case "s":
var f;
try {
f = o.parse(a.data)
} catch (t) {
a.data;
break
}
var h = f[0],
d = f[1],
p = f[2],
v = f[3];
if (h !== t.version) throw new Error('Incompatible SockJS! Main site uses: "' + h + '", the iframe: "' + t.version + '".');
if (!r.isOriginEqual(p, u.href) || !r.isOriginEqual(v, u.href)) throw new Error("Can't connect to different domain from within an iframe. (" + u.href + ", " + p + ", " + v + ")");
e = new s(new n[d](p, v));
break;
case "m":
e._send(a.data);
break;
case "c":
e && e._close(), e = null
}
}
};
i.attachEvent("message", a), l.postMessage("s")
}
}
}, {
"./facade": 7,
"./info-iframe-receiver": 10,
"./location": 13,
"./utils/event": 46,
"./utils/iframe": 47,
"./utils/url": 52,
"debug": void 0,
"json3": 55
}],
9: [function (t, e, n) {
"use strict";
function r(t, e) {
i.call(this);
var n = this,
r = +new Date;
this.xo = new e("GET", t), this.xo.once("finish", function (t, e) {
var i, o;
if (200 === t) {
if (o = +new Date - r, e) try {
i = s.parse(e)
} catch (t) {}
a.isObject(i) || (i = {})
}
n.emit("finish", i, o), n.removeAllListeners()
})
}
var i = t("events").EventEmitter,
o = t("inherits"),
s = t("json3"),
a = t("./utils/object");
o(r, i), r.prototype.close = function () {
this.removeAllListeners(), this.xo.close()
}, e.exports = r
}, {
"./utils/object": 49,
"debug": void 0,
"events": 3,
"inherits": 54,
"json3": 55
}],
10: [function (t, e, n) {
"use strict";
function r(t) {
var e = this;
o.call(this), this.ir = new l(t, a), this.ir.once("finish", function (t, n) {
e.ir = null, e.emit("message", s.stringify([t, n]))
})
}
var i = t("inherits"),
o = t("events").EventEmitter,
s = t("json3"),
a = t("./transport/sender/xhr-local"),
l = t("./info-ajax");
i(r, o), r.transportName = "iframe-info-receiver", r.prototype.close = function () {
this.ir && (this.ir.close(), this.ir = null), this.removeAllListeners()
}, e.exports = r
}, {
"./info-ajax": 9,
"./transport/sender/xhr-local": 37,
"events": 3,
"inherits": 54,
"json3": 55
}],
11: [function (t, e, n) {
(function (n) {
"use strict";
function r(t, e) {
var r = this;
i.call(this);
var o = function () {
var n = r.ifr = new l(u.transportName, e, t);
n.once("message", function (t) {
if (t) {
var e;
try {
e = s.parse(t)
} catch (t) {
return r.emit("finish"), void r.close()
}
var n = e[0],
i = e[1];
r.emit("finish", n, i)
}
r.close()
}), n.once("close", function () {
r.emit("finish"), r.close()
})
};
n.document.body ? o() : a.attachEvent("load", o)
}
var i = t("events").EventEmitter,
o = t("inherits"),
s = t("json3"),
a = t("./utils/event"),
l = t("./transport/iframe"),
u = t("./info-iframe-receiver");
o(r, i), r.enabled = function () {
return l.enabled()
}, r.prototype.close = function () {
this.ifr && this.ifr.close(), this.removeAllListeners(), this.ifr = null
}, e.exports = r
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
"./info-iframe-receiver": 10,
"./transport/iframe": 22,
"./utils/event": 46,
"debug": void 0,
"events": 3,
"inherits": 54,
"json3": 55
}],
12: [function (t, e, n) {
"use strict";
function r(t, e) {
var n = this;
i.call(this), setTimeout(function () {
n.doXhr(t, e)
}, 0)
}
var i = t("events").EventEmitter,
o = t("inherits"),
s = t("./utils/url"),
a = t("./transport/sender/xdr"),
l = t("./transport/sender/xhr-cors"),
u = t("./transport/sender/xhr-local"),
c = t("./transport/sender/xhr-fake"),
f = t("./info-iframe"),
h = t("./info-ajax");
o(r, i), r._getReceiver = function (t, e, n) {
return n.sameOrigin ? new h(e, u) : l.enabled ? new h(e, l) : a.enabled && n.sameScheme ? new h(e, a) : f.enabled() ? new f(t, e) : new h(e, c)
}, r.prototype.doXhr = function (t, e) {
var n = this,
i = s.addPath(t, "/info");
this.xo = r._getReceiver(t, i, e), this.timeoutRef = setTimeout(function () {
n._cleanup(!1), n.emit("finish")
}, r.timeout), this.xo.once("finish", function (t, e) {
n._cleanup(!0), n.emit("finish", t, e)
})
}, r.prototype._cleanup = function (t) {
clearTimeout(this.timeoutRef), this.timeoutRef = null, !t && this.xo && this.xo.close(), this.xo = null
}, r.prototype.close = function () {
this.removeAllListeners(), this._cleanup(!1)
}, r.timeout = 8e3, e.exports = r
}, {
"./info-ajax": 9,
"./info-iframe": 11,
"./transport/sender/xdr": 34,
"./transport/sender/xhr-cors": 35,
"./transport/sender/xhr-fake": 36,
"./transport/sender/xhr-local": 37,
"./utils/url": 52,
"debug": void 0,
"events": 3,
"inherits": 54
}],
13: [function (t, e, n) {
(function (t) {
"use strict";
e.exports = t.location || {
origin: "http://localhost:80",
protocol: "http",
host: "localhost",
port: 80,
href: "http://localhost/",
hash: ""
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {}],
14: [function (t, e, n) {
(function (n) {
"use strict";
function r(t, e, n) {
if (!(this instanceof r)) return new r(t, e, n);
if (arguments.length < 1) throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");
y.call(this), this.readyState = r.CONNECTING, this.extensions = "", this.protocol = "", n = n || {}, n.protocols_whitelist && m.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."), this._transportsWhitelist = n.transports, this._transportOptions = n.transportOptions || {};
var i = n.sessionId || 8;
if ("function" == typeof i) this._generateSessionId = i;
else {
if ("number" != typeof i) throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");
this._generateSessionId = function () {
return u.string(i)
}
}
this._server = n.server || u.numberString(1e3);
var o = new s(t);
if (!o.host || !o.protocol) throw new SyntaxError("The URL '" + t + "' is invalid");
if (o.hash) throw new SyntaxError("The URL must not contain a fragment");
if ("http:" !== o.protocol && "https:" !== o.protocol) throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '" + o.protocol + "' is not allowed.");
var a = "https:" === o.protocol;
if ("https" === g.protocol && !a) throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");
e ? Array.isArray(e) || (e = [e]) : e = [];
var l = e.sort();
l.forEach(function (t, e) {
if (!t) throw new SyntaxError("The protocols entry '" + t + "' is invalid.");
if (e < l.length - 1 && t === l[e + 1]) throw new SyntaxError("The protocols entry '" + t + "' is duplicated.")
});
var c = f.getOrigin(g.href);
this._origin = c ? c.toLowerCase() : null, o.set("pathname", o.pathname.replace(/\/+$/, "")), this.url = o.href, this.url, this._urlInfo = {
nullOrigin: !v.hasDomain(),
sameOrigin: f.isOriginEqual(this.url, g.href),
sameScheme: f.isSchemeEqual(this.url, g.href)
}, this._ir = new _(this.url, this._urlInfo), this._ir.once("finish", this._receiveInfo.bind(this))
}
function i(t) {
return 1e3 === t || t >= 3e3 && t <= 4999
}
t("./shims");
var o, s = t("url-parse"),
a = t("inherits"),
l = t("json3"),
u = t("./utils/random"),
c = t("./utils/escape"),
f = t("./utils/url"),
h = t("./utils/event"),
d = t("./utils/transport"),
p = t("./utils/object"),
v = t("./utils/browser"),
m = t("./utils/log"),
b = t("./event/event"),
y = t("./event/eventtarget"),
g = t("./location"),
w = t("./event/close"),
x = t("./event/trans-message"),
_ = t("./info-receiver");
a(r, y), r.prototype.close = function (t, e) {
if (t && !i(t)) throw new Error("InvalidAccessError: Invalid code");
if (e && e.length > 123) throw new SyntaxError("reason argument has an invalid length");
if (this.readyState !== r.CLOSING && this.readyState !== r.CLOSED) {
this._close(t || 1e3, e || "Normal closure", !0)
}
}, r.prototype.send = function (t) {
if ("string" != typeof t && (t = "" + t), this.readyState === r.CONNECTING) throw new Error("InvalidStateError: The connection has not been established yet");
this.readyState === r.OPEN && this._transport.send(c.quote(t))
}, r.version = t("./version"), r.CONNECTING = 0, r.OPEN = 1, r.CLOSING = 2, r.CLOSED = 3, r.prototype._receiveInfo = function (t, e) {
if (this._ir = null, !t) return void this._close(1002, "Cannot connect to server");
this._rto = this.countRTO(e), this._transUrl = t.base_url ? t.base_url : this.url, t = p.extend(t, this._urlInfo);
var n = o.filterToEnabled(this._transportsWhitelist, t);
this._transports = n.main, this._transports.length, this._connect()
}, r.prototype._connect = function () {
for (var t = this._transports.shift(); t; t = this._transports.shift()) {
if (t.transportName, t.needBody && (!n.document.body || void 0 !== n.document.readyState && "complete" !== n.document.readyState && "interactive" !== n.document.readyState)) return this._transports.unshift(t), void h.attachEvent("load", this._connect.bind(this));
var e = this._rto * t.roundTrips || 5e3;
this._transportTimeoutId = setTimeout(this._transportTimeout.bind(this), e);
var r = f.addPath(this._transUrl, "/" + this._server + "/" + this._generateSessionId()),
i = this._transportOptions[t.transportName],
o = new t(r, this._transUrl, i);
return o.on("message", this._transportMessage.bind(this)), o.once("close", this._transportClose.bind(this)), o.transportName = t.transportName, void(this._transport = o)
}
this._close(2e3, "All transports failed", !1)
}, r.prototype._transportTimeout = function () {
this.readyState === r.CONNECTING && this._transportClose(2007, "Transport timed out")
}, r.prototype._transportMessage = function (t) {
var e, n = this,
r = t.slice(0, 1),
i = t.slice(1);
switch (r) {
case "o":
return void this._open();
case "h":
return this.dispatchEvent(new b("heartbeat")), void this.transport
}
if (i) try {
e = l.parse(i)
} catch (t) {}
if (void 0 !== e) switch (r) {
case "a":
Array.isArray(e) && e.forEach(function (t) {
n.transport, n.dispatchEvent(new x(t))
});
break;
case "m":
this.transport, this.dispatchEvent(new x(e));
break;
case "c":
Array.isArray(e) && 2 === e.length && this._close(e[0], e[1], !0)
}
}, r.prototype._transportClose = function (t, e) {
if (this.transport, this._transport && (this._transport.removeAllListeners(), this._transport = null, this.transport = null), !i(t) && 2e3 !== t && this.readyState === r.CONNECTING) return void this._connect();
this._close(t, e)
}, r.prototype._open = function () {
this._transport.transportName, this.readyState, this.readyState === r.CONNECTING ? (this._transportTimeoutId && (clearTimeout(this._transportTimeoutId), this._transportTimeoutId = null), this.readyState = r.OPEN, this.transport = this._transport.transportName, this.dispatchEvent(new b("open")), this.transport) : this._close(1006, "Server lost session")
}, r.prototype._close = function (t, e, n) {
this.transport, this.readyState;
var i = !1;
if (this._ir && (i = !0, this._ir.close(), this._ir = null), this._transport && (this._transport.close(), this._transport = null, this.transport = null), this.readyState === r.CLOSED) throw new Error("InvalidStateError: SockJS has already been closed");
this.readyState = r.CLOSING, setTimeout(function () {
this.readyState = r.CLOSED, i && this.dispatchEvent(new b("error"));
var o = new w("close");
o.wasClean = n || !1, o.code = t || 1e3, o.reason = e, this.dispatchEvent(o), this.onmessage = this.onclose = this.onerror = null
}.bind(this), 0)
}, r.prototype.countRTO = function (t) {
return t > 100 ? 4 * t : 300 + t
}, e.exports = function (e) {
return o = d(e), t("./iframe-bootstrap")(r, e), r
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
"./event/close": 2,
"./event/event": 4,
"./event/eventtarget": 5,
"./event/trans-message": 6,
"./iframe-bootstrap": 8,
"./info-receiver": 12,
"./location": 13,
"./shims": 15,
"./utils/browser": 44,
"./utils/escape": 45,
"./utils/event": 46,
"./utils/log": 48,
"./utils/object": 49,
"./utils/random": 50,
"./utils/transport": 51,
"./utils/url": 52,
"./version": 53,
"debug": void 0,
"inherits": 54,
"json3": 55,
"url-parse": 58
}],
15: [function (t, e, n) {
"use strict";
function r(t) {
var e = +t;
return e !== e ? e = 0 : 0 !== e && e !== 1 / 0 && e !== -1 / 0 && (e = (e > 0 || -1) * Math.floor(Math.abs(e))), e
}
function i(t) {
return t >>> 0
}
function o() {}
var s, a = Array.prototype,
l = Object.prototype,
u = Function.prototype,
c = String.prototype,
f = a.slice,
h = l.toString,
d = function (t) {
return "[object Function]" === l.toString.call(t)
},
p = function (t) {
return "[object Array]" === h.call(t)
},
v = function (t) {
return "[object String]" === h.call(t)
},
m = Object.defineProperty && function () {
try {
return Object.defineProperty({}, "x", {}), !0
} catch (t) {
return !1
}
}();
s = m ? function (t, e, n, r) {
!r && e in t || Object.defineProperty(t, e, {
configurable: !0,
enumerable: !1,
writable: !0,
value: n
})
} : function (t, e, n, r) {
!r && e in t || (t[e] = n)
};
var b = function (t, e, n) {
for (var r in e) l.hasOwnProperty.call(e, r) && s(t, r, e[r], n)
},
y = function (t) {
if (null == t) throw new TypeError("can't convert " + t + " to object");
return Object(t)
};
b(u, {
bind: function (t) {
var e = this;
if (!d(e)) throw new TypeError("Function.prototype.bind called on incompatible " + e);
for (var n = f.call(arguments, 1), r = function () {
if (this instanceof l) {
var r = e.apply(this, n.concat(f.call(arguments)));
return Object(r) === r ? r : this
}
return e.apply(t, n.concat(f.call(arguments)))
}, i = Math.max(0, e.length - n.length), s = [], a = 0; a < i; a++) s.push("$" + a);
var l = Function("binder", "return function (" + s.join(",") + "){ return binder.apply(this, arguments); }")(r);
return e.prototype && (o.prototype = e.prototype, l.prototype = new o, o.prototype = null), l
}
}), b(Array, {
isArray: p
});
var g = Object("a"),
w = "a" !== g[0] || !(0 in g);
b(a, {
forEach: function (t) {
var e = y(this),
n = w && v(this) ? this.split("") : e,
r = arguments[1],
i = -1,
o = n.length >>> 0;
if (!d(t)) throw new TypeError;
for (; ++i < o;) i in n && t.call(r, n[i], i, e)
}
}, ! function (t) {
var e = !0,
n = !0;
return t && (t.call("foo", function (t, n, r) {
"object" != typeof r && (e = !1)
}), t.call([1], function () {
n = "string" == typeof this
}, "x")), !!t && e && n
}(a.forEach));
var x = Array.prototype.indexOf && -1 !== [0, 1].indexOf(1, 2);
b(a, {
indexOf: function (t) {
var e = w && v(this) ? this.split("") : y(this),
n = e.length >>> 0;
if (!n) return -1;
var i = 0;
for (arguments.length > 1 && (i = r(arguments[1])), i = i >= 0 ? i : Math.max(0, n + i); i < n; i++)
if (i in e && e[i] === t) return i;
return -1
}
}, x);
var _ = c.split;
2 !== "ab".split(/(?:ab)*/).length || 4 !== ".".split(/(.?)(.?)/).length || "t" === "tesst".split(/(s)*/)[1] || 4 !== "test".split(/(?:)/, -1).length || "".split(/.?/).length || ".".split(/()()/).length > 1 ? function () {
var t = void 0 === /()??/.exec("")[1];
c.split = function (e, n) {
var r = this;
if (void 0 === e && 0 === n) return [];
if ("[object RegExp]" !== h.call(e)) return _.call(this, e, n);
var o, s, l, u, c = [],
f = (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.extended ? "x" : "") + (e.sticky ? "y" : ""),
d = 0;
for (e = new RegExp(e.source, f + "g"), r += "", t || (o = new RegExp("^" + e.source + "$(?!\\s)", f)), n = void 0 === n ? -1 >>> 0 : i(n);
(s = e.exec(r)) && !((l = s.index + s[0].length) > d && (c.push(r.slice(d, s.index)), !t && s.length > 1 && s[0].replace(o, function () {
for (var t = 1; t < arguments.length - 2; t++) void 0 === arguments[t] && (s[t] = void 0)
}), s.length > 1 && s.index < r.length && a.push.apply(c, s.slice(1)), u = s[0].length, d = l, c.length >= n));) e.lastIndex === s.index && e.lastIndex++;
return d === r.length ? !u && e.test("") || c.push("") : c.push(r.slice(d)), c.length > n ? c.slice(0, n) : c
}
}() : "0".split(void 0, 0).length && (c.split = function (t, e) {
return void 0 === t && 0 === e ? [] : _.call(this, t, e)
});
var E = c.substr,
j = "".substr && "b" !== "0b".substr(-1);
b(c, {
substr: function (t, e) {
return E.call(this, t < 0 && (t = this.length + t) < 0 ? 0 : t, e)
}
}, j)
}, {}],
16: [function (t, e, n) {
"use strict";
e.exports = [t("./transport/websocket"), t("./transport/xhr-streaming"), t("./transport/xdr-streaming"), t("./transport/eventsource"), t("./transport/lib/iframe-wrap")(t("./transport/eventsource")), t("./transport/htmlfile"), t("./transport/lib/iframe-wrap")(t("./transport/htmlfile")), t("./transport/xhr-polling"), t("./transport/xdr-polling"), t("./transport/lib/iframe-wrap")(t("./transport/xhr-polling")), t("./transport/jsonp-polling")]
}, {
"./transport/eventsource": 20,
"./transport/htmlfile": 21,
"./transport/jsonp-polling": 23,
"./transport/lib/iframe-wrap": 26,
"./transport/websocket": 38,
"./transport/xdr-polling": 39,
"./transport/xdr-streaming": 40,
"./transport/xhr-polling": 41,
"./transport/xhr-streaming": 42
}],
17: [function (t, e, n) {
(function (n) {
"use strict";
function r(t, e, n, r) {
var o = this;
i.call(this), setTimeout(function () {
o._start(t, e, n, r)
}, 0)
}
var i = t("events").EventEmitter,
o = t("inherits"),
s = t("../../utils/event"),
a = t("../../utils/url"),
l = n.XMLHttpRequest;
o(r, i), r.prototype._start = function (t, e, n, i) {
var o = this;
try {
this.xhr = new l
} catch (t) {}
if (!this.xhr) return this.emit("finish", 0, "no xhr support"), void this._cleanup();
e = a.addQuery(e, "t=" + +new Date), this.unloadRef = s.unloadAdd(function () {
o._cleanup(!0)
});
try {
this.xhr.open(t, e, !0), this.timeout && "timeout" in this.xhr && (this.xhr.timeout = this.timeout, this.xhr.ontimeout = function () {
o.emit("finish", 0, ""), o._cleanup(!1)
})
} catch (t) {
return this.emit("finish", 0, ""), void this._cleanup(!1)
}
if (i && i.noCredentials || !r.supportsCORS || (this.xhr.withCredentials = "true"), i && i.headers)
for (var u in i.headers) this.xhr.setRequestHeader(u, i.headers[u]);
this.xhr.onreadystatechange = function () {
if (o.xhr) {
var t, e, n = o.xhr;
switch (n.readyState, n.readyState) {
case 3:
try {
e = n.status, t = n.responseText
} catch (t) {}
1223 === e && (e = 204), 200 === e && t && t.length > 0 && o.emit("chunk", e, t);
break;
case 4:
e = n.status, 1223 === e && (e = 204), 12005 !== e && 12029 !== e || (e = 0), n.responseText, o.emit("finish", e, n.responseText), o._cleanup(!1)
}
}
};
try {
o.xhr.send(n)
} catch (t) {
o.emit("finish", 0, ""), o._cleanup(!1)
}
}, r.prototype._cleanup = function (t) {
if (this.xhr) {
if (this.removeAllListeners(), s.unloadDel(this.unloadRef), this.xhr.onreadystatechange = function () {}, this.xhr.ontimeout && (this.xhr.ontimeout = null), t) try {
this.xhr.abort()
} catch (t) {}
this.unloadRef = this.xhr = null
}
}, r.prototype.close = function () {
this._cleanup(!0)
}, r.enabled = !!l;
var u = ["Active"].concat("Object").join("X");
!r.enabled && u in n && (l = function () {
try {
return new n[u]("Microsoft.XMLHTTP")
} catch (t) {
return null
}
}, r.enabled = !!new l);
var c = !1;
try {
c = "withCredentials" in new l
} catch (t) {}
r.supportsCORS = c, e.exports = r
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
"../../utils/event": 46,
"../../utils/url": 52,
"debug": void 0,
"events": 3,
"inherits": 54
}],
18: [function (t, e, n) {
(function (t) {
e.exports = t.EventSource
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {}],
19: [function (t, e, n) {
(function (t) {
"use strict";
var n = t.WebSocket || t.MozWebSocket;
e.exports = n ? function (t) {
return new n(t)
} : void 0
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {}],
20: [function (t, e, n) {
"use strict";
function r(t) {
if (!r.enabled()) throw new Error("Transport created when disabled");
o.call(this, t, "/eventsource", s, a)
}
var i = t("inherits"),
o = t("./lib/ajax-based"),
s = t("./receiver/eventsource"),
a = t("./sender/xhr-cors"),
l = t("eventsource");
i(r, o), r.enabled = function () {
return !!l
}, r.transportName = "eventsource", r.roundTrips = 2, e.exports = r
}, {
"./lib/ajax-based": 24,
"./receiver/eventsource": 29,
"./sender/xhr-cors": 35,
"eventsource": 18,
"inherits": 54
}],
21: [function (t, e, n) {
"use strict";
function r(t) {
if (!o.enabled) throw new Error("Transport created when disabled");
a.call(this, t, "/htmlfile", o, s)
}
var i = t("inherits"),
o = t("./receiver/htmlfile"),
s = t("./sender/xhr-local"),
a = t("./lib/ajax-based");
i(r, a), r.enabled = function (t) {
return o.enabled && t.sameOrigin
}, r.transportName = "htmlfile", r.roundTrips = 2, e.exports = r
}, {
"./lib/ajax-based": 24,
"./receiver/htmlfile": 30,
"./sender/xhr-local": 37,
"inherits": 54
}],
22: [function (t, e, n) {
"use strict";
function r(t, e, n) {
if (!r.enabled()) throw new Error("Transport created when disabled");
s.call(this);
var i = this;
this.origin = l.getOrigin(n), this.baseUrl = n, this.transUrl = e, this.transport = t, this.windowId = f.string(8);
var o = l.addPath(n, "/iframe.html") + "#" + this.windowId;
this.iframeObj = u.createIframe(o, function (t) {
i.emit("close", 1006, "Unable to load an iframe (" + t + ")"), i.close()
}), this.onmessageCallback = this._message.bind(this), c.attachEvent("message", this.onmessageCallback)
}
var i = t("inherits"),
o = t("json3"),
s = t("events").EventEmitter,
a = t("../version"),
l = t("../utils/url"),
u = t("../utils/iframe"),
c = t("../utils/event"),
f = t("../utils/random");
i(r, s), r.prototype.close = function () {
if (this.removeAllListeners(), this.iframeObj) {
c.detachEvent("message", this.onmessageCallback);
try {
this.postMessage("c")
} catch (t) {}
this.iframeObj.cleanup(), this.iframeObj = null, this.onmessageCallback = this.iframeObj = null
}
}, r.prototype._message = function (t) {
if (t.data, !l.isOriginEqual(t.origin, this.origin)) return t.origin, void this.origin;
var e;
try {
e = o.parse(t.data)
} catch (e) {
return void t.data
}
if (e.windowId !== this.windowId) return e.windowId, void this.windowId;
switch (e.type) {
case "s":
this.iframeObj.loaded(), this.postMessage("s", o.stringify([a, this.transport, this.transUrl, this.baseUrl]));
break;
case "t":
this.emit("message", e.data);
break;
case "c":
var n;
try {
n = o.parse(e.data)
} catch (t) {
return void e.data
}
this.emit("close", n[0], n[1]), this.close()
}
}, r.prototype.postMessage = function (t, e) {
this.iframeObj.post(o.stringify({
windowId: this.windowId,
type: t,
data: e || ""
}), this.origin)
}, r.prototype.send = function (t) {
this.postMessage("m", t)
}, r.enabled = function () {
return u.iframeEnabled
}, r.transportName = "iframe", r.roundTrips = 2, e.exports = r
}, {
"../utils/event": 46,
"../utils/iframe": 47,
"../utils/random": 50,
"../utils/url": 52,
"../version": 53,
"debug": void 0,
"events": 3,
"inherits": 54,
"json3": 55
}],
23: [function (t, e, n) {
(function (n) {
"use strict";
function r(t) {
if (!r.enabled()) throw new Error("Transport created when disabled");
o.call(this, t, "/jsonp", a, s)
}
var i = t("inherits"),
o = t("./lib/sender-receiver"),
s = t("./receiver/jsonp"),
a = t("./sender/jsonp");
i(r, o), r.enabled = function () {
return !!n.document
}, r.transportName = "jsonp-polling", r.roundTrips = 1, r.needBody = !0, e.exports = r
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
"./lib/sender-receiver": 28,
"./receiver/jsonp": 31,
"./sender/jsonp": 33,
"inherits": 54
}],
24: [function (t, e, n) {
"use strict";
function r(t) {
return function (e, n, r) {
var i = {};
"string" == typeof n && (i.headers = {
"Content-type": "text/plain"
});
var o = s.addPath(e, "/xhr_send"),
a = new t("POST", o, n, i);
return a.once("finish", function (t) {
if (a = null, 200 !== t && 204 !== t) return r(new Error("http status " + t));
r()
}),
function () {
a.close(), a = null;
var t = new Error("Aborted");
t.code = 1e3, r(t)
}
}
}
function i(t, e, n, i) {
a.call(this, t, e, r(i), n, i)
}
var o = t("inherits"),
s = t("../../utils/url"),
a = t("./sender-receiver");
o(i, a), e.exports = i
}, {
"../../utils/url": 52,
"./sender-receiver": 28,
"debug": void 0,
"inherits": 54
}],
25: [function (t, e, n) {
"use strict";
function r(t, e) {
o.call(this), this.sendBuffer = [], this.sender = e, this.url = t
}
var i = t("inherits"),
o = t("events").EventEmitter;
i(r, o), r.prototype.send = function (t) {
this.sendBuffer.push(t), this.sendStop || this.sendSchedule()
}, r.prototype.sendScheduleWait = function () {
var t, e = this;
this.sendStop = function () {
e.sendStop = null, clearTimeout(t)
}, t = setTimeout(function () {
e.sendStop = null, e.sendSchedule()
}, 25)
}, r.prototype.sendSchedule = function () {
this.sendBuffer.length;
var t = this;
if (this.sendBuffer.length > 0) {
var e = "[" + this.sendBuffer.join(",") + "]";
this.sendStop = this.sender(this.url, e, function (e) {
t.sendStop = null, e ? (t.emit("close", e.code || 1006, "Sending error: " + e), t.close()) : t.sendScheduleWait()
}), this.sendBuffer = []
}
}, r.prototype._cleanup = function () {
this.removeAllListeners()
}, r.prototype.close = function () {
this._cleanup(), this.sendStop && (this.sendStop(), this.sendStop = null)
}, e.exports = r
}, {
"debug": void 0,
"events": 3,
"inherits": 54
}],
26: [function (t, e, n) {
(function (n) {
"use strict";
var r = t("inherits"),
i = t("../iframe"),
o = t("../../utils/object");
e.exports = function (t) {
function e(e, n) {
i.call(this, t.transportName, e, n)
}
return r(e, i), e.enabled = function (e, r) {
if (!n.document) return !1;
var s = o.extend({}, r);
return s.sameOrigin = !0, t.enabled(s) && i.enabled()
}, e.transportName = "iframe-" + t.transportName, e.needBody = !0, e.roundTrips = i.roundTrips + t.roundTrips - 1, e.facadeTransport = t, e
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
"../../utils/object": 49,
"../iframe": 22,
"inherits": 54
}],
27: [function (t, e, n) {
"use strict";
function r(t, e, n) {
o.call(this), this.Receiver = t, this.receiveUrl = e, this.AjaxObject = n, this._scheduleReceiver()
}
var i = t("inherits"),
o = t("events").EventEmitter;
i(r, o), r.prototype._scheduleReceiver = function () {
var t = this,
e = this.poll = new this.Receiver(this.receiveUrl, this.AjaxObject);
e.on("message", function (e) {
t.emit("message", e)
}), e.once("close", function (n, r) {
t.pollIsClosing, t.poll = e = null, t.pollIsClosing || ("network" === r ? t._scheduleReceiver() : (t.emit("close", n || 1006, r), t.removeAllListeners()))
})
}, r.prototype.abort = function () {
this.removeAllListeners(), this.pollIsClosing = !0, this.poll && this.poll.abort()
}, e.exports = r
}, {
"debug": void 0,
"events": 3,
"inherits": 54
}],
28: [function (t, e, n) {
"use strict";
function r(t, e, n, r, i) {
var l = o.addPath(t, e),
u = this;
s.call(this, t, n), this.poll = new a(r, l, i), this.poll.on("message", function (t) {
u.emit("message", t)
}), this.poll.once("close", function (t, e) {
u.poll = null, u.emit("close", t, e), u.close()
})
}
var i = t("inherits"),
o = t("../../utils/url"),
s = t("./buffered-sender"),
a = t("./polling");
i(r, s), r.prototype.close = function () {
s.prototype.close.call(this), this.removeAllListeners(), this.poll && (this.poll.abort(), this.poll = null)
}, e.exports = r
}, {