Skip to content

Instantly share code, notes, and snippets.

@shermozle
Last active July 19, 2021 14:12
Show Gist options
  • Save shermozle/7a7c664df3c7369cf064a27479d7145c to your computer and use it in GitHub Desktop.
Save shermozle/7a7c664df3c7369cf064a27479d7145c to your computer and use it in GitHub Desktop.
/* dd: 2019-09-11__05-31-14 */
/* version: 2.12.0.5273.b96c35cc Wed Jul 03 2019 15:53:11 */
new function a() {
"use strict";
var e, t, n, r, i, o, s, u, c, h, l, d, f, _, p, g, v, m, y, w, S, b, E, k, C, T, M, D, R, x, F, A, P, L, I, U, B, N, O, W, Q, H, z, q, j, V, Y, K, G, X, Z, J, $, ee, te, ne, ie, se, re, ae, oe, ue, ce, he, le, de, fe, _e, pe, ge, ve, me, ye, we, Se, be, Ee, ke, Ce, Te, Me, De, Re, xe, Fe, Ae, Pe, Le, Ie, Ue, Be, Ne, Oe, We, Qe, He, ze, qe, je, Ve, Ye, Ke, Ge, Xe, Ze, Je, $e, et, tt, nt, it, st, rt, at, ot, ut, ct, ht, lt, dt, ft, _t, pt, gt, vt, mt, yt, wt, St, bt, Et, kt, Ct, Tt, Mt, Dt, Rt, xt, Ft, At, Pt, Lt, It, Ut, Bt, Nt, Ot, Wt, Qt, Ht, zt, qt, jt, Vt, Yt, Kt, Gt, Xt, Zt, Jt, $t, en, tn, nn, sn, rn, an, on, un, cn, hn, ln, dn, fn, _n, pn, gn, vn, mn, yn, wn, Sn, bn, En, kn, Cn, Tn, Mn, Dn, Rn = this,
xn = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
return t && i(e.prototype, t), n && i(e, n), e
}
}(),
Fn = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
function An(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}
function Pn(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}
function Ln(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
e = self, t = Date.now ? Date.now() : +new Date, n = e.performance || {}, r = [], i = {}, o = function o(e, t) {
for (var n = 0, i = r.length, s = []; n < i; n++) r[n][e] == t && s.push(r[n]);
return s
}, s = function s(e, t) {
for (var n, i = r.length; i--;)(n = r[i]).entryType != e || void 0 !== t && n.name != t || r.splice(i, 1)
}, n.now || (n.now = n.webkitNow || n.mozNow || n.msNow || function() {
return (Date.now ? Date.now() : +new Date) - t
}), n.mark || (n.mark = n.webkitMark || function(e) {
var t = {
name: e,
entryType: "mark",
startTime: n.now(),
duration: 0
};
r.push(t), i[e] = t
}), n.measure || (n.measure = n.webkitMeasure || function(e, t, n) {
t = i[t].startTime, n = i[n].startTime, r.push({
name: e,
entryType: "measure",
startTime: t,
duration: n - t
})
}), n.getEntriesByType || (n.getEntriesByType = n.webkitGetEntriesByType || function(e) {
return o("entryType", e)
}), n.getEntriesByName || (n.getEntriesByName = n.webkitGetEntriesByName || function(e) {
return o("name", e)
}), n.clearMarks || (n.clearMarks = n.webkitClearMarks || function(e) {
s("mark", e)
}), n.clearMeasures || (n.clearMeasures = n.webkitClearMeasures || function(e) {
s("measure", e)
}), e.performance = n, "function" == typeof define && (define.amd || define.ajs) && define("performance", [], function() {
return n
}),
function(e) {
if (Object.getOwnPropertyNames || (Object.getOwnPropertyNames = function(e) {
var t = [];
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n);
return t
}), !Object.defineProperty || ! function() {
try {
return Object.defineProperty({}, "x", {}), !0
} catch (e) {
return !1
}
}()) {
var s = Object.defineProperty;
Object.defineProperty = function(e, t, n) {
if (s) try {
return s(e, t, n)
} catch (i) {}
if (e !== Object(e)) throw TypeError("Object.defineProperty called on non-object");
return Object.prototype.__defineGetter__ && "get" in n && Object.prototype.__defineGetter__.call(e, t, n.get), Object.prototype.__defineSetter__ && "set" in n && Object.prototype.__defineSetter__.call(e, t, n.set), "value" in n && (e[t] = n.value), e
}
}
var t, u, n, i, c;
"function" != typeof Object.defineProperties && (Object.defineProperties = function(e, t) {
if (e !== Object(e)) throw TypeError("Object.defineProperties called on non-object");
var n;
for (n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.defineProperty(e, n, t[n]);
return e
}), "function" != typeof Object.create && (Object.create = function(e, t) {
if ("object" !== ("undefined" == typeof e ? "undefined" : Fn(e))) throw TypeError();
function n() {}
n.prototype = e;
var i = new n;
if (e && (i.constructor = n), t !== undefined) {
if (t !== Object(t)) throw TypeError();
Object.defineProperties(i, t)
}
return i
}), Object.keys || (Object.keys = function(e) {
if (e !== Object(e)) throw TypeError("Object.keys called on non-object");
var t, n = [];
for (t in e) Object.prototype.hasOwnProperty.call(e, t) && n.push(t);
return n
}), Array.prototype.forEach || (Array.prototype.forEach = function(e, t) {
var n, i;
if (null == this) throw new TypeError(" this is null or not defined");
var s = Object(this),
r = s.length >>> 0;
if ("function" != typeof e) throw new TypeError(e + " is not a function");
for (1 < arguments.length && (n = t), i = 0; i < r;) {
var a;
i in s && (a = s[i], e.call(n, a, i, s)), i++
}
}), Array.isArray || (Array.isArray = function(e) {
return "[object Array]" === Object.prototype.toString.call(e)
}), Function.prototype.bind || (Function.prototype.bind = function(e) {
if ("function" != typeof this) throw TypeError("Bind must be called on a function");
var t = [].slice,
n = t.call(arguments, 1),
i = this,
s = function s() {
return i.apply(this.prototype && this instanceof r ? this : e, n.concat(t.call(arguments)))
};
function r() {}
return r.prototype = i.prototype, s.prototype = new r, s
}), "function" != typeof String.prototype.trim && (String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, "")
}), Array.from || (Array.from = (t = Object.prototype.toString, u = function u(e) {
return "function" == typeof e || "[object Function]" === t.call(e)
}, n = function n(e) {
var t = Number(e);
return isNaN(t) ? 0 : 0 !== t && isFinite(t) ? (0 < t ? 1 : -1) * Math.floor(Math.abs(t)) : t
}, i = Math.pow(2, 53) - 1, c = function c(e) {
var t = n(e);
return Math.min(Math.max(t, 0), i)
}, function(e) {
var t = Object(e);
if (null == e) throw new TypeError("Array.from requires an array-like object - not null or undefined");
var n, i = 1 < arguments.length ? arguments[1] : void undefined;
if ("undefined" != typeof i) {
if (!u(i)) throw new TypeError("Array.from: when provided, the second argument must be a function");
2 < arguments.length && (n = arguments[2])
}
for (var s, r = c(t.length), a = u(this) ? Object(new this(r)) : new Array(r), o = 0; o < r;) s = t[o], a[o] = i ? "undefined" == typeof n ? i(s, o) : i.call(n, s, o) : s, o += 1;
return a.length = r, a
})), Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
value: function(e) {
if (null == this) throw new TypeError('"this" is null or not defined');
var t = Object(this),
n = t.length >>> 0;
if ("function" != typeof e) throw new TypeError("predicate must be a function");
for (var i = arguments[1], s = 0; s < n;) {
var r = t[s];
if (e.call(i, r, s, t)) return r;
s++
}
return undefined
},
configurable: !0,
writable: !0
}), Array.prototype.includes || Object.defineProperty(Array.prototype, "includes", {
value: function(e, t) {
if (null == this) throw new TypeError('"this" is null or not defined');
var n = Object(this),
i = n.length >>> 0;
if (0 === i) return !1;
for (var s, r, a = 0 | t, o = Math.max(0 <= a ? a : i - Math.abs(a), 0); o < i;) {
if ((s = n[o]) === (r = e) || "number" == typeof s && "number" == typeof r && isNaN(s) && isNaN(r)) return !0;
o++
}
return !1
}
}), Element.prototype.matches || (Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function(e) {
for (var t = (this.document || this.ownerDocument).querySelectorAll(e), n = t.length; 0 <= --n && t.item(n) !== this;);
return -1 < n
}), "function" != typeof Object.assign && Object.defineProperty(Object, "assign", {
value: function(e, t) {
if (null == e) throw new TypeError("Cannot convert undefined or null to object");
for (var n = Object(e), i = 1; i < arguments.length; i++) {
var s = arguments[i];
if (null != s)
for (var r in s) Object.prototype.hasOwnProperty.call(s, r) && (n[r] = s[r])
}
return n
},
writable: !0,
configurable: !0
}), String.prototype.startsWith || (String.prototype.startsWith = function(e, t) {
return this.substr(!t || t < 0 ? 0 : +t, e.length) === e
}), self.MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
}(),
function(e) {
if (!e.WeakMap) {
var s = Object.prototype.hasOwnProperty,
r = function r(e, t, n) {
Object.defineProperty ? Object.defineProperty(e, t, {
configurable: !0,
writable: !0,
value: n
}) : e[t] = n
};
e.WeakMap = function() {
function e() {
if (void 0 === this) throw new TypeError("Constructor WeakMap requires 'new'");
if (r(this, "_id", function t(e) {
return e + "_" + n() + "." + n()
}("_WeakMap")), 0 < arguments.length) throw new TypeError("WeakMap iterable is not supported")
}
function i(e, t) {
if (!a(e) || !s.call(e, "_id")) throw new TypeError(t + " method called on incompatible receiver " + ("undefined" == typeof e ? "undefined" : Fn(e)))
}
function n() {
return Math.random().toString().substring(2)
}
return r(e.prototype, "delete", function(e) {
if (i(this, "delete"), !a(e)) return !1;
var t = e[this._id];
return !(!t || t[0] !== e || (delete e[this._id], 0))
}), r(e.prototype, "get", function(e) {
if (i(this, "get"), a(e)) {
var t = e[this._id];
return t && t[0] === e ? t[1] : void 0
}
}), r(e.prototype, "has", function(e) {
if (i(this, "has"), !a(e)) return !1;
var t = e[this._id];
return !(!t || t[0] !== e)
}), r(e.prototype, "set", function(e, t) {
if (i(this, "set"), !a(e)) throw new TypeError("Invalid value used as weak map key");
var n = e[this._id];
return n && n[0] === e ? n[1] = t : r(e, this._id, [e, t]), this
}), r(e, "_polyfill", !0), e
}()
}
function a(e) {
return Object(e) === e
}
}("undefined" != typeof self ? self : "undefined" != typeof window ? window : undefined), u = Rn, c = function() {
function e() {
Ln(this, e)
}
return xn(e, [{
key: "create",
value: function(e) {
var t = ["(", e, ")()"];
if (window.Blob) return new window.Blob(t, {
type: "application/javascript"
});
if (window.MSBlobBuilder) {
for (var n = new window.MSBlobBuilder, i = 0; i < t.length; i++) n.append(t[i]);
return n.getBlob("application/javascript")
}
throw new Error("Unable to create Blob. Neither Blob nor BlobBuilder are supported by the browser.")
}
}]), e
}(), u.BlobFactory = c, h = Rn, l = function() {
function e() {
Ln(this, e)
}
return xn(e, [{
key: "create",
value: function(e) {
var t = window.URL || window.webkitURL;
if (t) return t.createObjectURL(e);
throw new Error("Unable to create BlobUrl. Neither Url nor webkitUrl are supported by the browser")
}
}]), e
}(), h.BlobUrlFactory = l,
function(e) {
function t() {
this._listeners = []
}
e.CDEvent || (t.prototype = {
subscribe: function(e) {
this._listeners.push(e)
},
publish: function(e) {
for (var t = 0, n = this._listeners.length; t < n; t++) this._listeners[t](e)
},
unsubscribe: function(e) {
for (var t = 0, n = this._listeners.length; t < n; t++)
if (e === this._listeners[t]) {
this._listeners.splice(t, 1);
break
}
}
}, e.CDEvent = t)
}(Rn), d = Rn, f = function() {
function e() {
Ln(this, e), this._pairs = [], this.size = 0
}
return xn(e, [{
key: "has",
value: function(e) {
return -1 < this._indexOf(e)
}
}, {
key: "get",
value: function(e) {
var t = this._indexOf(e);
return -1 < t ? this._pairs[t][1] : undefined
}
}, {
key: "set",
value: function(e, t) {
var n = this._indexOf(e); - 1 < n ? this._pairs[n][1] = t : (this._pairs.push([e, t]), this.size++)
}
}, {
key: "delete",
value: function(e) {
var t = this._indexOf(e);
return -1 < t && (this._pairs.splice(t, 1), this.size--, !0)
}
}, {
key: "forEach",
value: function(e) {
for (var t = 0; t < this._pairs.length; t++) e(this._pairs[t][1], this._pairs[t][0])
}
}, {
key: "clear",
value: function() {
this._pairs = []
}
}, {
key: "_indexOf",
value: function(e) {
for (var t = 0; t < this._pairs.length; t++)
if (this._pairs[t][0] === e) return t;
return -1
}
}]), e
}(), d.Map = self.Map || f,
function(e) {
function t(e, t) {
this._portNativeWorker = e, this._useShared = t
}
t.prototype = {
start: function() {
this._useShared && this._portNativeWorker.port.start()
},
postMessage: function() {
var e = this._portNativeWorker.port;
this._useShared ? e.postMessage.apply(e, arguments) : this._portNativeWorker.postMessage.apply(this._portNativeWorker, arguments)
},
close: function() {
this._useShared ? this._portNativeWorker.port.close() : this._portNativeWorker.terminate()
},
setonmessage: function(e) {
this._useShared ? this._portNativeWorker.port.onmessage = e : this._portNativeWorker.onmessage = e
}
}, e.CDPort = t
}(Rn), _ = Rn, p = function() {
function e() {
Ln(this, e), this._set = [], this.size = 0
}
return xn(e, [{
key: "add",
value: function(e) {
return this._set.push(e), this.size++, this
}
}, {
key: "has",
value: function(e) {
return -1 < this._set.indexOf(e)
}
}, {
key: "delete",
value: function(e) {
for (var t = 0; t < this._set.length; t++)
if (this._set[t] === e) return this._set.splice(t, 1), this.size--, !0;
return !1
}
}, {
key: "forEach",
value: function(e) {
for (var t = 0; t < this._set.length; t++) e(this._set[t])
}
}, {
key: "clear",
value: function() {
this._set = []
}
}]), e
}(), _.Set = self.Set || p, Rn.DataMappingDefs = {
ELEMENT_EVENT_MAP: ["eventSequence", "timestamp", "eventType", "isTrusted", "elementHash", "length", "elementValues", "selected", "hashedValue", "relativeTime"],
ELEMENT_MAP: ["elementHash", "tagName", "id", "name", "type", "leftPosition", "topPosition", "width", "height", "className", "href", "title", "alt", "selectValues", "elementValue", "checked", "timestamp"],
CLIPBOARD_EVENT_MAP: ["eventSequence", "timestamp", "clipboardEventType", "elementHash", "copiedText"],
KEY_EVENT_MAP: ["eventSequence", "timestamp", "eventType", "isTrusted", "elementHash", "charCode", "character", "keyComboType", "isCtrl", "isShift", "isAlt", "isMetaKey", "keyLocation", "code", "key", "isRepeat", "keyRegion", "relativeTime"],
MOUSE_EVENT_MAP: ["eventSequence", "timestamp", "eventType", "isTrusted", "elementHash", "pageX", "pageY", "screenX", "screenY", "button", "wheelDelta", "clientX", "clientY", "eventDetail", "buttonNew", "relativeTime"],
WINDOW_EVENT_MAP: ["eventSequence", "timestamp", "eventType", "isTrusted", "screenWidth", "screenHeight", "clientWidth", "clientHeight", "documentWidth", "documentHeight", "scrollTop", "scrollLeft", "windowInnerWidth", "windowInnerHeight", "windowOuterWidth", "windowOuterHeight"],
TOUCH_EVENT_MAP: ["eventSequence", "timestamp", "eventType", "isTrusted", "elementHash", "clientX", "clientY", "touchIndex", "touchSizeMajor", "touchSizeMinor", "pageX", "pageY", "screenX", "screenY", "relativeTime"],
PINCH_ZOOM_EVENT_MAP: ["eventSequence", "timestamp", "focusX", "focusY", "scaleFactor"],
ACCELEROMETER_EVENT_MAP: ["eventSequence", "timestamp", "x", "y", "z"],
GESTURE_EVENT_MAP: ["eventSequence", "timestamp", "eventType", "scale", "rotation", "pointerType", "overallVelocity", "direction", "pageX", "pageY", "screenX", "screenY", "clientX", "clientY"],
GYRO_EVENT_MAP: ["eventSequence", "timestamp", "absolute", "alpha", "beta", "gamma"],
ORIENTATION_EVENT_MAP: ["eventSequence", "timestamp", "absolute", "alpha", "beta", "gamma"],
SCRIPT_EVENT_MAP: ["eventSequence", "timestamp", "eventType", "scriptId", "namespaceURI", "outerHTML", "scriptSource", "scriptType"],
SCREEN_ORIENTATION_EVENT_MAP: ["eventSequence", "timestamp", "orientation"],
TAP_EVENT_MAP: ["eventSequence", "timestamp", "screenX", "screenY", "pageX", "pageY", "clientX", "clientY", "isTrusted", "elementHash", "touchIndex", "touchSizeMajor", "touchSizeMinor"],
LONGPRESS_EVENT_MAP: ["eventSequence", "timestamp", "screenX", "screenY", "pageX", "pageY", "clientX", "clientY", "isTrusted", "elementHash", "touchIndex", "touchSizeMajor", "touchSizeMinor"],
TAB_EVENT_MAP: ["eventSequence", "timestamp", "type", "id", "href", "referrer", "currentTabsList"],
NETINFO_EVENT_MAP: ["eventSequence", "timestamp", "connectionType", "effectiveType", "downlinkMax", "downlink", "rtt", "isSaveData"],
STORAGE_EVENT_MAP: ["eventSequence", "timestamp", "keys", "action", "tabsOpened"],
PRINT_EVENT_MAP: ["eventSequence", "timestamp", "printDialogState"],
HISTORY_NAVIGATION_EVENT_MAP: ["eventSequence", "timestamp", "navigationDirection"],
AMBIENT_LIGHT_EVENT_MAP: ["eventSequence", "timestamp", "illuminance"],
BEFORE_INSTALL_PROMPT_EVENT_MAP: ["eventSequence", "timestamp", "platforms", "relativeTime"],
CROSS_MUID_EVENT_MAP: ["eventSequence", "timestamp", "eventType", "domainUrl", "muid"]
}, g = Rn, v = function() {
function n(e, t) {
Ln(this, n), this._cdUtils = e, this._scriptName = t, this._cdUtils.addEventListener(window, "error", this._handleException.bind(this))
}
return xn(n, [{
key: "_handleException",
value: function(e) {
if (this._scriptName && this._scriptName === e.filename) {
var t = this._buildErrorMessage(e);
log.error("caught unhandled exception. " + t)
}
}
}, {
key: "_buildErrorMessage",
value: function(e) {
if (!e.error) return e.message;
var t = e.error.toString(),
n = e.error.stack ? e.error.stack : "";
return t + ", Line: " + e.lineno + ", Column: " + e.colno + ". Stacktrace: " + n
}
}]), n
}(), g.GlobalExceptionHandler = v, m = Rn, y = function() {
function e() {
Ln(this, e)
}
return xn(e, null, [{
key: "create",
value: function() {
if (self.XMLHttpRequest && Object.prototype.hasOwnProperty.call(XMLHttpRequest.prototype, "withCredentials")) return new XMLHttpRequest;
if (self.XDomainRequest) return new XDomainRequest;
if (self.XMLHttpRequest) return new XMLHttpRequest;
throw new Error("There is no supported http request object")
}
}]), e
}(), m.HttpRequestFactory = y, w = Rn, S = function() {
function t(e) {
if (Ln(this, t), !e) throw new Error("utils param must be defined");
this._msgListeners = new w.Map, self.window && e.addEventListener && (this._windowId = "Window_" + e.generateUUID(), e.addEventListener(self.window, "message", this._onMessageReceived.bind(this), !0))
}
return xn(t, [{
key: "subscribe",
value: function(e, t) {
var n = 2 < arguments.length && arguments[2] !== undefined && arguments[2],
i = null;
this._msgListeners.has(e) ? i = this._msgListeners.get(e) : (i = new w.Set, this._msgListeners.set(e, i)), i.add({
callback: t,
isOneTime: n
})
}
}, {
key: "unsubscribe",
value: function(e, t) {
if (e && this._msgListeners.has(e)) {
var n = this._msgListeners.get(e);
n && n.forEach(function(e) {
t === e.callback && n["delete"](e)
}), 0 === n.size && this._msgListeners["delete"](e)
}
}
}, {
key: "publish",
value: function(e, t) {
if (!e) throw new Error("invalid argument msgType must be defined");
this._publishMessage(e, t)
}
}, {
key: "publishAsync",
value: function(e, t) {
if (!e) throw new Error("invalid argument msgType must be defined");
self.window && self.window.postMessage({
msgID: this._windowId,
msgType: e,
message: t
}, window.location.href)
}
}, {
key: "_publishMessage",
value: function(e, t) {
var n = this._msgListeners.get(e);
n && n.forEach(function(e) {
e.callback(t), e.isOneTime && n["delete"](e)
})
}
}, {
key: "_onMessageReceived",
value: function(e) {
e.data.msgID && e.data.msgID === this._windowId && (e.stopPropagation && e.stopPropagation(), e.returnValue && (e.returnValue = !1), e.cancelBubble && (e.cancelBubble = !0), this._publishMessage(e.data.msgType, e.data.message))
}
}]), t
}(), w.MessageBus = S, Rn.MessageBusEventType = {
TouchEvent: "touchEvent",
KeyEvent: "keyEvent",
ConfigurationLoadedEvent: "ConfigurationLoadedEvent",
NewSessionStartedEvent: "NewSessionStartedEvent",
WupDispatchRateUpdatedEvent: "WupDispatchRateUpdatedEvent",
ApiContextChangeEvent: "ApiContextChangeEvent",
ApiResetSessionEvent: "ApiResetSessionEvent",
ApiCustomerMetadataEvent: "ApiCustomerMetadataEvent",
ApiChangeStateEvent: "ApiChangeStateEvent",
ApiSetCsidEvent: "ApiSetCsidEvent",
ApiSetPsidEvent: "ApiSetPsidEvent",
ServerStateUpdatedEvent: "ServerStateUpdatedEvent",
StateChangedEvent: "StateChangedEvent"
}, b = Rn, E = function() {
function t(e) {
Ln(this, t), this._perfDataQ = e, this._now = window.performance && window.performance.now ? window.performance.now.bind(window.performance) : b.CDUtils.dateNow.bind(Date), this._monitors = new b.Map
}
return xn(t, [{
key: "startMonitor",
value: function(e) {
log.debug("PerfMonitor:startMonitor on " + e), this._monitors.set(e, this._now())
}
}, {
key: "stopMonitor",
value: function(e) {
var t = 1 < arguments.length && arguments[1] !== undefined ? arguments[1] : "main";
if (this._monitors.has(e)) {
var n = this._now() - this._monitors.get(e);
this._perfDataQ.addToQueue("perf", {
orig: t,
name: e,
val: n
}), log.debug("PerfMonitor:stopMonitor on " + e + ": time = " + n), this._monitors["delete"](e)
}
}
}, {
key: "cancelMonitor",
value: function(e) {
log.debug("PerfMonitor:cancelMonitor on " + e), this._monitors.has(e) && this._monitors["delete"](e)
}
}, {
key: "reportMonitor",
value: function(e, t) {
var n = 2 < arguments.length && arguments[2] !== undefined ? arguments[2] : "main";
log.debug("PerfMonitor:reportMonitor on " + e), this._perfDataQ.addToQueue("perf", {
orig: n,
name: e,
val: t
})
}
}]), t
}(), b.PerfMonitor = E, k = Rn, C = function() {
function e() {
Ln(this, e), this._buffer = []
}
return xn(e, [{
key: "hasItems",
value: function() {
return 0 < this.length()
}
}, {
key: "length",
value: function() {
return this._buffer.length
}
}, {
key: "enqueue",
value: function(e) {
this._buffer.push(e)
}
}, {
key: "enqueueToHead",
value: function(e) {
this._buffer.unshift(e)
}
}, {
key: "dequeue",
value: function(e) {
return this._buffer.shift()
}
}, {
key: "getItem",
value: function(e) {
return this._buffer[e]
}
}]), e
}(), k.Queue = C,
function(s) {
function e() {
this._msgListeners = new s.Map
}
s.WorkerCommunicator || (e.prototype.setMessagingPort = function(e) {
this._messagePort = e;
var s = this;
e.setonmessage(function(e) {
var t = e.data,
n = [],
i = s._msgListeners.get(t.msgType);
i && i.forEach(function(e) {
e.callback(t.data), e.isOneTime && n.push(e)
}), n.forEach(function(e) {
i["delete"](e)
})
})
}, e.prototype.sendAsync = function(e, t, n, i, s) {
i && n && this.addMessageListener(n, i, s), this._messagePort.postMessage({
msgType: e,
data: t
})
}, e.prototype.addMessageListener = function(e, t, n) {
var i = null;
this._msgListeners.has(e) ? i = this._msgListeners.get(e) : (i = new s.Set, this._msgListeners.set(e, i)), i.add({
callback: t,
isOneTime: n
})
}, s.WorkerCommunicator = e)
}(Rn), T = Rn, M = function() {
function n(e) {
Ln(this, n), this._nativeWorker = e;
var t = !!window.SharedWorker && this._nativeWorker instanceof window.SharedWorker;
this.port = new T.CDPort(this._nativeWorker, t)
}
return xn(n, [{
key: "close",
value: function() {
this.port && this.port.close()
}
}]), n
}(), T.WorkerWrapper = M, D = Rn, R = function() {
function e() {
Ln(this, e)
}
return xn(e, [{
key: "create",
value: function(e) {
var t = new(window.Worker || window.SharedWorker)(e);
return new D.WorkerWrapper(t)
}
}]), e
}(), D.WorkerWrapperFactory = R, Rn.EnumDefs = {
Events: {
isTrusted: {
"false": 0,
"true": 1,
undefined: 2,
"null": 2
},
elementEventType: {
input: 0,
initial: 1,
focus: 2,
blur: 3,
change: 4,
click: 5,
submit: 6
},
clipboardEventType: {
copy: 0,
paste: 1,
cut: 2
},
keyEventType: {
keyup: 0,
keydown: 1,
keypress: 2
},
mouseEventType: {
mousemove: 0,
mousedown: 1,
mouseup: 2,
click: 3,
dblclick: 4,
mouseleave: 5,
mouseenter: 6,
wheel: 7,
mouseout: 8,
mouseover: 9
},
windowEventType: {
DOMContentLoaded: 0,
scroll: 1,
resize: 2,
focus: 3,
blur: 4,
tabFocus: 5,
tabBlur: 6
},
touchEventIEType: {
pointerdown: "touchstart",
pointerup: "touchend",
pointermove: "touchmove",
MSPointerDown: "touchstart",
MSPointerUp: "touchend",
MSPointerMove: "touchmove"
},
touchEventType: {
touchstart: 0,
touchmove: 1,
touchend: 2,
touchcancel: 3
},
pinchZoomEventType: {
pointerdown: 0,
pointermove: 1,
pointerup: 2
},
getstureEventType: {
pinch: 0,
press: 1,
swipe: 2,
rotate: 3
},
scriptEventType: {
load: 0
},
screenOrientationType: {
undefined: 0,
"portrait-primary": 1,
"landscape-primary": 2,
"portrait-secondary": 3,
"landscape-secondary": 4
},
tabEventType: {
openTab: 0,
newTab: 1,
closeTab: 2
},
storageEventType: {
storage: 0
},
printEventType: {
printDialogOpened: 1,
printDialogClosed: 0
},
crossmuidEventType: {
found: 0,
"new": 1
}
},
SNUM_CHANGE_TYPE: {
none: "none",
init: "init",
configuration: "config",
configurationFromSlave: "configFromSlave",
customerApi: "customerApi",
pageTimeout: "timeout",
unknown: "unknown"
},
MasterSlaveMessage: {
dataFromSlave: "dataFromSlave",
registerSlave: "registerSlave",
logPerfSlave: "logPerfSlave",
updateSlaveConf: "updateSlaveConf",
updateSlaveState: "updateSlaveState",
updateMasterContext: "updateMasterContext",
resetSessionTriggerFromSlave: "resetSessionTriggerFromSlave",
mouseChallengeTriggerFromSlave: "mouseChallengeTriggerFromSlave"
},
SystemFrameName: {
rtcframe: "cd__rtcframe",
fontDetectionFrame: "cd__fontDetectionFrame"
},
State: {
stopped: "stopped",
starting: "starting",
started: "started",
paused: "paused",
faulted: "faulted"
}
}, (x = Rn).DomUtils = {
outerHTML: function(e) {
return e.outerHTML || (new XMLSerializer).serializeToString(e)
},
onDocumentBody: function(e, t) {
e.document.body ? t() : (window.addEventListener ? window.addEventListener("DOMContentLoaded", t, !0) : window.attachEvent("onload", t), log.debug("DomUtils:onDocumentBody - no document body found, listening"))
},
onPageLoad: function(e, t) {
x.CDUtils.addEventListener(e, "load", t, !0), (e.contentWindow && "complete" === e.contentWindow.document.readyState || e.document && "complete" === e.document.readyState) && t()
},
waitUntilDocumentIsReady: function(i) {
var s = this;
return new Promise(function(e, t) {
try {
s.onWindowDocumentReady(i, function() {
return e()
})
} catch (n) {
t(n)
}
})
},
onWindowDocumentReady: function(e, t) {
var n = window.addEventListener ? "DOMContentLoaded" : "load";
if ("complete" === e.document.readyState || "interactive" === e.document.readyState) t();
else {
var i = function i() {
x.CDUtils.removeEventListener(e, n, i, !0), t()
};
x.CDUtils.addEventListener(e, n, i, !0)
}
},
isWindowDocumentReady: function(e) {
return e && "complete" === e.document.readyState
},
canAccessIFrame: function(e) {
var t = null;
try {
t = (e.contentDocument || e.contentWindow.document).body.innerHTML
} catch (n) {}
return null !== t
},
matches: function(e, t) {
return (e.matches || e.matchesSelector || e.mozMatchesSelector || e.msMatchesSelector || e.oMatchesSelector || e.webkitMatchesSelector || function(e) {
for (var t = (this.document || this.ownerDocument).querySelectorAll(e), n = t.length; 0 <= --n && t.item(n) !== this;);
return -1 < n
}).call(e, t)
}
}, A = null, P = function(s, e, r) {
var a = function a() {
return e
};
if (function t() {
return -1 < e.toString().indexOf("[native code]")
}()) r(a());
else {
var o = 0,
u = function u() {
if (A.contentWindow) {
for (var e = A.contentWindow, t = s.split("."), n = e, i = 0; i < t.length; i++) n = n[t[i]];
r(n)
} else o < 45 ? (setTimeout(u, o), o++) : r(a())
};
A || ((A = document.createElement("IFRAME")).style.display = "none", document.documentElement.appendChild(A)), u()
}
}, (F = Rn).CDUtils = {
scriptVersion: "2.12.0.5273.b96c35cc",
isPassiveSupported: function In() {
var e = !1;
try {
var t = Object.defineProperty({}, "passive", {
get: function() {
e = !0
}
});
window.addEventListener("test", null, t)
} catch (n) {}
return e
}(),
dateNow: Date.now,
isUndefinedNull: function(e) {
return null === e || e === undefined || "undefined" == typeof e
},
addEventListener: function(e, t, n) {
var i = 3 < arguments.length && arguments[3] !== undefined && arguments[3],
s = !(4 < arguments.length && arguments[4] !== undefined) || arguments[4],
r = 5 < arguments.length && arguments[5] !== undefined && arguments[5];
this.isPassiveSupported ? e.addEventListener(t, n, {
capture: i,
passive: s,
once: r
}) : e.addEventListener ? e.addEventListener(t, n, i) : e.attachEvent("on" + t, n)
},
matchRegEx: function(e, t) {
return new RegExp(e).test(t)
},
removeEventListener: function(e, t, n) {
var i = 3 < arguments.length && arguments[3] !== undefined && arguments[3];
e.removeEventListener ? e.removeEventListener(t, n, i) : e.detachEvent("on" + t, n)
},
clearTextFromNumbers: function(e) {
return e ? e.replace(/(\d)/g, "*") : ""
},
maskText: function(e) {
return e.replace(/[\d]/g, "1").replace(/[a-zA-Z]/g, "a").replace(/[^a-zA-Z\d\u0000-\u0080]/g, "*")
},
getDropDownListValues: function(e) {
for (var t = [], n = 0; n < e.length; n++) {
var i = e.options[n].text || e.options[n].value;
t.push(F.CDUtils.maskText(i))
}
return t
},
getDocUrl: function() {
var e = window.location;
return e.protocol + "//" + e.hostname + (e.port ? ":" + e.port : "") + F.CDUtils.clearTextFromNumbers(e.pathname)
},
getHash: function(e) {
for (var t = 0, n = 0, i = e.length; n < i; n++) t = (t << 5) - t + e.charCodeAt(n), t &= t;
return t
},
getTruncatedHash: function(e, t) {
return e ? this.murmurhash3(e).toString().substring(t) : ""
},
murmurhash3: function(e, t) {
var n, i, s, r, a, o, u, c;
for (n = 3 & e.length, i = e.length - n, s = t, a = 3432918353, o = 461845907, c = 0; c < i;) u = 255 & e.charCodeAt(c) | (255 & e.charCodeAt(++c)) << 8 | (255 & e.charCodeAt(++c)) << 16 | (255 & e.charCodeAt(++c)) << 24, ++c, s = 27492 + (65535 & (r = 5 * (65535 & (s = (s ^= u = (65535 & (u = (u = (65535 & u) * a + (((u >>> 16) * a & 65535) << 16) & 4294967295) << 15 | u >>> 17)) * o + (((u >>> 16) * o & 65535) << 16) & 4294967295) << 13 | s >>> 19)) + ((5 * (s >>> 16) & 65535) << 16) & 4294967295)) + ((58964 + (r >>> 16) & 65535) << 16);
switch (u = 0, n) {
case 3:
u ^= (255 & e.charCodeAt(c + 2)) << 16;
case 2:
u ^= (255 & e.charCodeAt(c + 1)) << 8;
case 1:
s ^= u = (65535 & (u = (u = (65535 & (u ^= 255 & e.charCodeAt(c))) * a + (((u >>> 16) * a & 65535) << 16) & 4294967295) << 15 | u >>> 17)) * o + (((u >>> 16) * o & 65535) << 16) & 4294967295
}
return s ^= e.length, s = 2246822507 * (65535 & (s ^= s >>> 16)) + ((2246822507 * (s >>> 16) & 65535) << 16) & 4294967295, s = 3266489909 * (65535 & (s ^= s >>> 13)) + ((3266489909 * (s >>> 16) & 65535) << 16) & 4294967295, (s ^= s >>> 16) >>> 0
},
generateUUID: function() {
var n = F.CDUtils.dateNow();
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
var t = (n + 16 * Math.random()) % 16 | 0;
return n = Math.floor(n / 16), ("x" == e ? t : 3 & t | 8).toString(16)
})
},
convertToArrayByMap: function(e, t) {
for (var n = [null], i = 0, s = e.length; i < s; i++) n[i + 1] = t[e[i]];
return n
},
getMapCode: function(e) {
var t = String.fromCharCode(e);
return /[0-9]/.test(t) ? 49 : /[a-zA-Z]/.test(t) ? 65 : /[^\u0000-\u0080]/.test(t) ? 66 : e
},
getPostUrl: function(e, t, n, i, s, r, a) {
var o = F.HttpRequestFactory.create();
o instanceof self.XMLHttpRequest ? (o.open(t, e, !0), a !== undefined && (o.timeout = a), o.withCredentials = !1 !== r, "POST" === t && o.setRequestHeader("Content-Type", "application/json; charset=utf-8"), o.onreadystatechange = function() {
if (4 === o.readyState) {
if (204 === o.status) return;
200 === o.status ? i && i(o.responseText) : s && s(o.responseText)
}
}, o.ontimeout = function() {
s && s("timeout", n)
}, o.send(n)) : (o.onload = function() {
i && i(o.responseText)
}, o.onerror = function() {
s && s()
}, o.onprogress = function() {}, o.ontimeout = function() {}, o.open(t, e, !0), setTimeout(function() {
o.send(n)
}, 0))
},
minutesToMilliseconds: function(e) {
return 60 * e * 1e3
},
cutDecimalPointDigits: function(e, t) {
var n = Math.pow(10, t);
return Math.round(e * n) / n
},
DomUtils: F.DomUtils,
EnumDefs: F.EnumDefs,
StorageUtils: {
counter: 0,
getAndUpdateEventSequenceNumber: function() {
return this.counter++
},
deserialize: function(e) {
if ("string" != typeof e) return null;
try {
return JSON.parse(e)
} catch (t) {
return e || null
}
},
getFromLocalStorage: function(e, t) {
try {
var n = this.deserialize(window.localStorage.getItem(e));
return n ? n.exp && F.CDUtils.dateNow() - n.time > n.exp ? null : t === undefined || t ? n.val : n : null
} catch (i) {
return null
}
},
saveToLocalStorage: function(e, t, n) {
var i = {
val: t
};
n && (i.exp = n, i.time = F.CDUtils.dateNow());
try {
window.localStorage.setItem(e, JSON.stringify(i))
} catch (s) {
return null
}
return i
},
removeFromLocalStorage: function(e) {
try {
window.localStorage.removeItem(e)
} catch (t) {
return null
}
},
getFromSessionStorage: function(e) {
try {
var t = this.deserialize(window.sessionStorage.getItem(e));
return t || null
} catch (n) {
return null
}
},
saveToSessionStorage: function(e, t) {
try {
return t ? (window.sessionStorage.setItem(e, JSON.stringify(t)), t) : window.sessionStorage.removeItem(e)
} catch (n) {
return null
}
},
removeFromSessionStorage: function(e) {
try {
window.sessionStorage.removeItem(e)
} catch (t) {
return null
}
},
getCookie: function(e) {
var t = new RegExp("(?:^|; )" + encodeURIComponent(e) + "=([^;]*)").exec(document.cookie);
return t ? decodeURIComponent(t[1]) : ""
},
setCookie: function(e, t, n) {
var i = "";
if (n) {
var s = new Date;
s.setTime(s.getTime() + n), i = "; expires=" + s.toUTCString()
}
for (var r = 0, a = location.hostname, o = a.split("."), u = "", c = !1; r <= o.length - 1 && !c;) "localhost" === (a = o.slice(-1 - ++r).join(".")) ? u = "" : "" !== a && (u = "; domain=." + a), c = this.setCookieWithAttributes(e, t, i, u);
return c || (u = "; domain=" + location.hostname, c = this.setCookieWithAttributes(e, t, i, u)), c
},
setCookieWithAttributes: function(e, t, n, i) {
return document.cookie = encodeURIComponent(e) + "=" + encodeURIComponent(t) + n + i + "; path=/", this.getCookie(e) == t
},
validateBcId: function(e) {
return /^([0-9]{13,}-)?[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e) ? e : null
}
},
getNativeWindowFn: P,
JQueryUtils: {
isJQueryAvailable: function() {
return window.jQuery !== undefined
},
addEventListener: function(e, t, n) {
jQuery(e).on(t, n)
},
removeEventListener: function(e, t, n) {
jQuery(e).off(t, n)
}
}
}, Date.now ? P("Date.now", Date.now, function(e) {
F.CDUtils.dateNow = e
}) : F.CDUtils.dateNow = function() {
return (new Date).getTime()
},
function(e) {
var t, n;
if (!Function.prototype.cdCallAsync && (Object.extend = function(e, t) {
if (e && t && "object" == ("undefined" == typeof t ? "undefined" : Fn(t)))
for (var n in t)
if (t.hasOwnProperty(n)) try {
"" != n && Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n))
} catch (i) {
e[n] = t[n]
}
return e
}, e.btoa = self.btoa ? self.btoa.bind(self) : function(e) {
for (var t, n, i = String(e), s = "", r = 0, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; i.charAt(0 | r) || (a = "=", r % 1); s += a.charAt(63 & t >> 8 - r % 1 * 8)) {
if (255 < (n = i.charCodeAt(r += .75))) throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
t = t << 8 | n
}
return s
}, self.importScripts == undefined)) {
var a = (t = [], n = "Window_" + e.CDUtils.generateUUID(), e.CDUtils.addEventListener(window, "message", function i(e) {
e.data == n && (e.stopPropagation && e.stopPropagation(), e.returnValue && (e.returnValue = !1), e.cancelBubble && (e.cancelBubble = !0), t.shift()())
}, !0), function(e) {
t.push(e), window.postMessage(n, self.location.href)
});
Function.prototype.cdCallAsync = function(e) {
for (var t = arguments.length, n = Array(1 < t ? t - 1 : 0), i = 1; i < t; i++) n[i - 1] = arguments[i];
var s = this;
a(function() {
s.apply(e || window, n)
})
}, Function.prototype.cdCallAsyncWithErrorHandling = function(t, n) {
for (var e = arguments.length, i = Array(2 < e ? e - 2 : 0), s = 2; s < e; s++) i[s - 2] = arguments[s];
var r = this;
a(function() {
try {
r.apply(t || window, i)
} catch (e) {
n && n(e)
}
})
}
}
}(Rn),
function(e) {
if (!e.Logger) {
var t = function() {
function n(e, t) {
Ln(this, n), this._logBridge = e, this._logLevel = t || n.LOG_LEVEL.INFO
}
return xn(n, [{
key: "trace",
value: function(e) {
this._sendToLogBridge(e, n.LOG_LEVEL.DEBUG)
}
}, {
key: "debug",
value: function(e) {
this._sendToLogBridge(e, n.LOG_LEVEL.DEBUG)
}
}, {
key: "info",
value: function(e) {
this._sendToLogBridge(e, n.LOG_LEVEL.INFO)
}
}, {
key: "warn",
value: function(e, t) {
this._sendToLogBridge(e, n.LOG_LEVEL.WARN, t)
}
}, {
key: "error",
value: function(e, t) {
this._sendToLogBridge(e, n.LOG_LEVEL.ERROR, t)
}
}, {
key: "isDebug",
value: function() {
return this._logLevel == n.LOG_LEVEL.DEBUG
}
}, {
key: "updateLogConfig",
value: function(e) {
this._logLevel = e.get("logLevel") || this._logLevel
}
}, {
key: "_sendToLogBridge",
value: function(e, t, n) {
t >= this._logLevel && (n && n.stack && (e += " ;stack: " + n.stack), this._logBridge.log(e, t))
}
}]), n
}();
Object.extend(t, {
LOG_LEVEL: {
DEBUG: 10,
INFO: 20,
WARN: 30,
ERROR: 40,
CRITICAL: 50,
OFF: 80
}
}), e.Logger = t, e.log = {
setLogger: function(e) {
this._logger = e
},
isDebug: function() {
return this._logger.isDebug()
},
error: function(e, t) {
this._logger.error(e, t || null)
},
warn: function(e, t) {
this._logger.warn(e, t || null)
},
trace: function(e) {
this._logger.trace(e)
},
debug: function(e) {
this._logger.debug(e)
},
info: function(e) {
this._logger.info(e)
}
}
}
}(Rn), Rn.WorkerCommand = {
requestConfigurationsCommand: "requestConfigurationsCommand",
startNewSessionCommand: "startNewSessionCommand",
resumeSessionCommand: "resumeSessionCommand",
changeContextCommand: "changeContextCommand",
updateCsidCommand: "updateCsidCommand",
updatePsidCommand: "updatePsidCommand",
updateLogUrlCommand: "updateLogUrl",
sendDataCommand: "sendDataCommand",
sendLogCommand: "sendLogCommand"
}, Rn.WorkerEvent = {
NewSessionStartedEvent: "NewSessionStartedEvent",
ConfigurationLoadedEvent: "ConfigurationLoadedEvent",
ServerStateUpdatedEvent: "ServerStateUpdatedEvent"
}, L = Rn, I = function() {
function e() {
Ln(this, e), this._onmessageSubscribers = []
}
return xn(e, [{
key: "start",
value: function() {}
}, {
key: "postMessage",
value: function(e) {
for (var t = 0; t < this._onmessageSubscribers.length; t++) this._onmessageSubscribers[t]({
data: e
})
}
}, {
key: "close",
value: function() {
this._onmessageSubscribers = []
}
}, {
key: "setonmessage",
value: function(e) {
this._onmessageSubscribers.push(e)
}
}]), e
}(), L.UnsPort = I, U = Rn, B = function() {
function t(e) {
Ln(this, t), U.isUnsupportedMode = !0, this._unsPort = e, this._unsFrameHandler = {
startFeatures: function() {},
startFeature: function() {},
stopFeatures: function() {},
stopFeature: function() {},
updateFeatureConfig: function() {}
}
}
return xn(t, [{
key: "getUnsPort",
value: function() {
return this._unsPort
}
}, {
key: "getUnsFrameHandler",
value: function() {
return this._unsFrameHandler
}
}, {
key: "adjustFeatureList",
value: function(e) {
function t(e) {
for (var t in e) e.hasOwnProperty(t) && !e[t].runInUns && delete e[t]
}
t(e.defaultFeatures), t(e.nonDefaultFeatures), t(e.perSessionFeatures), t(e.perContextFeatures), t(e.perPageReloadFeatures), t(e.nonDefaultFeatures), e.perSessionFeatures.IsUnsupportedFeature = {
configKey: "isUnsupportedReport",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !0,
isRunning: !1,
init: function() {
var e = function(e) {
function t() {
return Ln(this, t), An(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
return Pn(t, U.AbstractFeature), xn(t, [{
key: "startFeature",
value: function() {
this._dataQ.addToQueue("static_fields", ["is_supported", !1], !1)
}
}]), t
}();
this._features.perSessionFeatures.IsUnsupportedFeature.instance = new e(this._dataQ)
},
instance: null
}
}
}]), t
}(), U.UnsupportedMgr = B, N = Rn, O = function() {
function n(e, t) {
Ln(this, n), this._dataQ = e, this._perfMonitor = t
}
return xn(n, [{
key: "preFeature",
value: function(e) {
this._perfMonitor.startMonitor(e)
}
}, {
key: "postFeature",
value: function(e, t) {
this._perfMonitor.stopMonitor(e, t)
}
}, {
key: "cancelMonitor",
value: function(e) {
this._perfMonitor.cancelMonitor(e)
}
}, {
key: "stopFeature",
value: function() {}
}, {
key: "updateFeatureConfig",
value: function() {}
}]), n
}(), N.AbstractFeature = O, W = Rn, Q = function() {
function t(e) {
Ln(this, t), this._perfMonitor = e, this.isPassive = W.CDUtils.isPassiveSupported
}
return xn(t, [{
key: "getEventTimestamp",
value: function() {
return W.CDUtils.dateNow()
}
}, {
key: "getTimestampFromEvent",
value: function(e) {
return e.timeStamp ? W.CDUtils.cutDecimalPointDigits(e.timeStamp, 3) : 0
}
}, {
key: "handlerProlog",
value: function(e) {
log.isDebug() && this._perfMonitor.startMonitor(e)
}
}, {
key: "handlerEpilog",
value: function(e) {
log.isDebug() && this._perfMonitor.stopMonitor(e)
}
}, {
key: "handlerCancelog",
value: function(e) {
log.isDebug() && this._perfMonitor.cancelMonitor(e)
}
}, {
key: "updateFeatureConfig",
value: function() {}
}]), t
}(), W.Events = Q, H = Rn, z = function(e) {
function a(e, t, n, i, s) {
Ln(this, a);
var r = An(this, (a.__proto__ || Object.getPrototypeOf(a)).call(this, s));
return r._configurationRepository = e, r._utils = t, r._dataQueue = n, r._contextMgr = i, r._elementHashWMap = new WeakMap, r._collectPosition = !0, r._collectClassName = !0, r._collectTitle = !0, r._collectHref = !0, r._maxElemValLength = 30, r._XPathHashProducer = new H.XPathHashProducer, r
}
return Pn(a, H.Events), xn(a, [{
key: "getElement",
value: function(e) {
if (this._utils.isUndefinedNull(e) || e === document || e === document.body) return -1;
var t = -1;
if (this._elementHashWMap.has(e)) t = this._elementHashWMap.get(e).hash;
else {
this.handlerProlog("t.E_get");
var n = this._XPathHashProducer.produce(e);
t = n ? this._utils.getHash(n) : -1, this._elementHashWMap.set(e, {
hash: t,
contextList: [this._contextMgr.contextName]
}), this._sendElementToServer(e, t), this.handlerEpilog("t.E_get")
}
return t
}
}, {
key: "resendElementPerContext",
value: function(e) {
if (this._elementHashWMap.has(e)) {
var t = this._elementHashWMap.get(e),
n = t.hash;
t.contextList.indexOf(this._contextMgr.contextName) < 0 && (t.contextList.push(this._contextMgr.contextName), this._elementHashWMap.set(e, {
hash: t.hash,
contextList: t.contextList
}), this._sendElementToServer(e, n))
} else log.error("received for resendElementPerContext bad element, not in hash map. id=" + e.id)
}
}, {
key: "isListed",
value: function(e) {
return this._elementHashWMap.has(e)
}
}, {
key: "getElementData",
value: function(e) {
return this._elementHashWMap.get(e)
}
}, {
key: "getElementContextList",
value: function(e) {
return this._elementHashWMap.get(e).contextList
}
}, {
key: "_sendElementToServer",
value: function(e, t) {
var n = this._collectPosition ? e.getBoundingClientRect && e.getBoundingClientRect() : null,
i = -1,
s = -1,
r = -1,
a = -1;
n && (i = Math.round(n.left), s = Math.round(n.top), r = Math.round(n.right - n.left), a = Math.round(n.bottom - n.top));
var o = this._verifyNoPrivateData(e.id || ""),
u = this._verifyNoPrivateData(e.name || ""),
c = this._collectClassName && e.getAttribute && this._verifyNoPrivateData(e.getAttribute("class")) || "",
h = this._collectTitle && this._verifyNoPrivateData(e.title) || "",
l = this._verifyNoPrivateData(e.nodeName) || "",
d = this._collectHref && this._verifyNoPrivateData(e.href) || "";
0 < d.length && (d = this._utils.clearTextFromNumbers(d));
var f = "";
"SELECT" === e.nodeName && (f = this._utils.getDropDownListValues(e).join(";"));
var _ = e.value || e.textContent || e.innerHTML || "";
_ = _.length > this._maxElemValLength ? "" : ("string" != typeof _ && (_ = _.toString()), this._utils.maskText(_));
var p = this._utils.isUndefinedNull(e.checked) ? -1 : e.checked ? 1 : 0,
g = this.getEventTimestamp();
this._dataQueue.addToQueue("elements", [this._contextMgr.contextId, t, l || "", o || "", u || "", e.type || "", i || 0, s || 0, r || 0, a || 0, c || "", d || "", h || "", e.alt || "", f || "", _ || "", p, g], !1), log.isDebug() && log.debug("adding element id:" + o + ", name:" + u + ", type:" + e.type + ", width:" + r + ", height:" + a + ", left:" + i + ", top:" + s + ", hash: " + t)
}
}, {
key: "_verifyNoPrivateData",
value: function(e) {
return /\d\d\d/.test(e) ? this._utils.clearTextFromNumbers(e) : e
}
}, {
key: "updateFeatureConfig",
value: function() {
this._collectPosition = "boolean" == typeof this._configurationRepository.get("isElementsPosition") ? this._configurationRepository.get("isElementsPosition") : this._collectPosition, this._collectClassName = "boolean" == typeof this._configurationRepository.get("isElementsClassName") ? this._configurationRepository.get("isElementsClassName") : this._collectClassName, this._collectTitle = "boolean" == typeof this._configurationRepository.get("isElementsTitle") ? this._configurationRepository.get("isElementsTitle") : this._collectTitle, this._collectHref = "boolean" == typeof this._configurationRepository.get("isElementsHref") ? this._configurationRepository.get("isElementsHref") : this._collectHref, this._maxElemValLength = this._configurationRepository.get("maxElValLen") ? this._configurationRepository.get("maxElValLen") : this._maxElemValLength
}
}]), a
}(), H.Elements = z,
function(s) {
function e(t, e, n, i) {
var r, a = this;
this._utils = t, this._elements = e, this._dataQueue = n, this._perfMonitor = i;
var o = function o(e) {
return t.dateNow()
},
u = a._utils.StorageUtils,
c = s.EnumDefs.Events.mouseEventType,
h = s.EnumDefs.Events.isTrusted;
this.getMouseEvent = function(e) {
var t = e.which;
"mouseup" === e.type ? r = t : "click" === e.type && 0 === t && (t = r);
var n = c[e.type];
a._utils.isUndefinedNull(n) && (n = -1);
var i = e.deltaY || e.deltaX || e.deltaZ || e.wheelDelta || 0,
s = a.getTimestampFromEvent(e);
a._dataQueue.addToQueue("mouse_events", [null, u.getAndUpdateEventSequenceNumber(), o(e), n, h[e.isTrusted], "mousemove" === e.type ? 0 : a._elements.getElement(e.target), e.pageX ? Math.round(e.pageX) : -1, e.pageY ? Math.round(e.pageY) : -1, e.screenX ? Math.round(e.screenX) : -1, e.screenY ? Math.round(e.screenY) : -1, null === t || t === undefined ? -1 : t, Math.round(i), e.clientX ? Math.round(e.clientX) : -1, e.clientY ? Math.round(e.clientY) : -1, e.detail || 0, null === e.button || e.button === undefined ? -1 : e.button, s])
}
}(e.prototype = Object.create(s.Events.prototype)).startFeature = function(e) {
var t = this;
try {
this._perfMonitor.stopMonitor("t.timeTillDataCollect"), e || (e = window.self);
var n = e.document || e.contentDocument;
this._utils.addEventListener(n, "mousemove", this.getMouseEvent, !0), this._utils.addEventListener(n, "mousedown", this.getMouseEvent, !0), this._utils.addEventListener(n, "mouseup", this.getMouseEvent, !0), this._utils.addEventListener(n, "click", this.getMouseEvent, !0), this._utils.addEventListener(n, "dblclick", this.getMouseEvent, !0), this._isIE = !!document.documentMode || /edge/.test(window.navigator.userAgent.toLowerCase()), this._isIE ? s.CDUtils.DomUtils.onDocumentBody(e, function() {
t._utils.addEventListener(n.body, "mouseleave", t.getMouseEvent), t._utils.addEventListener(n.body, "mouseenter", t.getMouseEvent)
}) : (this._utils.addEventListener(n, "mouseleave", this.getMouseEvent), this._utils.addEventListener(n, "mouseenter", this.getMouseEvent)), this._utils.addEventListener(n, "wheel", this.getMouseEvent, !0)
} catch (i) {
log.error("MouseEvents:startFeature failed. msg:" + i.message, i)
}
}, e.prototype.stopFeature = function(e) {
try {
e || (e = window.self);
var t = e.document || e.contentDocument;
this._utils.removeEventListener(t, "mousemove", this.getMouseEvent, !0), this._utils.removeEventListener(t, "mousedown", this.getMouseEvent, !0), this._utils.removeEventListener(t, "mouseup", this.getMouseEvent, !0), this._utils.removeEventListener(t, "click", this.getMouseEvent, !0), this._utils.removeEventListener(t, "dblclick", this.getMouseEvent, !0), this._isIE ? (this._utils.removeEventListener(t.body, "mouseleave", this.getMouseEvent), this._utils.removeEventListener(t.body, "mouseenter", this.getMouseEvent)) : (this._utils.removeEventListener(t, "mouseleave", this.getMouseEvent), this._utils.removeEventListener(t, "mouseenter", this.getMouseEvent)), this._utils.removeEventListener(t, "wheel", this.getMouseEvent, !0)
} catch (n) {
log.error("MouseEvents:stopFeature failed. msg:" + n.message, n)
}
}, s.MouseEvents = e
}(Rn), q = Rn, j = function(e) {
function a(e, t, n, i, s) {
Ln(this, a);
var r = An(this, (a.__proto__ || Object.getPrototypeOf(a)).call(this, i));
return r._utils = e, r._dataQ = n, r._elements = t, r._msgBus = s, r._onAllBrowsersTouchEventBinded = r._onAllBrowsersTouchEvent.bind(r), r
}
return Pn(a, q.Events), xn(a, [{
key: "startFeature",
value: function(e) {
e || (e = window.self), this._bind(e)
}
}, {
key: "stopFeature",
value: function(e) {
e || (e = window.self), this._unbind(e)
}
}, {
key: "_addToCommunicationQueue",
value: function(e, t, n, i) {
e !== q.EnumDefs.Events.touchEventType.touchstart && e !== q.EnumDefs.Events.touchEventType.touchend || this._msgBus.publish(q.MessageBusEventType.TouchEvent, {
action: e
});
var s = this.getEventTimestamp(i),
r = q.EnumDefs.Events.isTrusted[i.isTrusted],
a = this._elements.getElement(i.target),
o = this._utils.StorageUtils.getAndUpdateEventSequenceNumber();
this._utils.isUndefinedNull(e) && (e = -1), this._utils.isUndefinedNull(t) && (t = -1);
var u = this.getTimestampFromEvent(i);
this._dataQ.addToQueue("touch_events", q.CDUtils.convertToArrayByMap(q.DataMappingDefs.TOUCH_EVENT_MAP, {
eventSequence: o,
timestamp: s,
eventType: e,
isTrusted: r,
elementHash: a,
clientX: n.clientX ? Math.round(n.clientX) : 0,
clientY: n.clientY ? Math.round(n.clientY) : 0,
touchIndex: t,
touchSizeMajor: n.radiusX ? 2 * n.radiusX : 0,
touchSizeMinor: n.radiusY ? 2 * n.radiusY : 0,
pageX: n.pageX || 0,
pageY: n.pageY || 0,
screenX: n.screenX || 0,
screenY: n.screenY || 0,
relativeTime: u
}))
}
}, {
key: "_bind",
value: function(e) {
var t = e.document || e.contentDocument,
n = void 0;
if (window.TouchEvent ? n = ["touchstart", "touchmove", "touchend", "touchcancel"] : window.PointerEvent && (n = ["pointerdown", "pointermove", "pointerup"]), this._listeningToEvents = n, this._listeningToEvents)
for (var i = 0; i < this._listeningToEvents.length; i++) this._utils.addEventListener(t, this._listeningToEvents[i], this._onAllBrowsersTouchEventBinded)
}
}, {
key: "_unbind",
value: function(e) {
var t = e.document || e.contentDocument;
if (this._listeningToEvents)
for (var n = 0; n < this._listeningToEvents.length; n++) this._utils.removeEventListener(t, this._listeningToEvents[n], this._onAllBrowsersTouchEventBinded)
}
}, {
key: "_onAllBrowsersTouchEvent",
value: function(e) {
return this.handlerProlog("t.TE"), this._onIeTouchEvent(e), this._onTouchEvent(e), this.handlerEpilog("t.TE"), !0
}
}, {
key: "_onTouchEvent",
value: function(e) {
if ((null === e.pointerType || e.pointerType === undefined) && e.changedTouches !== undefined)
for (var t = q.EnumDefs.Events.touchEventType[e.type], n = 0; n < e.changedTouches.length; n++) {
var i = e.changedTouches[n],
s = i.identifier % 1e4;
this._addToCommunicationQueue(t, s, i, e)
}
}
}, {
key: "_onIeTouchEvent",
value: function(e) {
if (null != e.pointerType && ("touch" === e.pointerType || "pen" === e.pointerType || e.pointerType === e.MSPOINTER_TYPE_TOUCH || e.pointerType === e.MSPOINTER_TYPE_PEN)) {
var t = q.EnumDefs.Events.touchEventIEType[e.type] || "touchcancel",
n = e.pointerId ? e.pointerId % 1e4 : 0,
i = q.EnumDefs.Events.touchEventType[t];
this._addToCommunicationQueue(i, n, e, e)
}
}
}]), a
}(), q.TouchEvents = j, V = Rn, Y = ["clientX", "clientY"], K = ["screenX", "screenY"], G = function G(t, n, s) {
function i(e, t) {
var n = t[s[0]] - e[s[0]],
i = t[s[1]] - e[s[1]];
return Math.sqrt(n * n + i * i)
}
return {
getScale: function() {
return function e() {
return i(t[0], t[1]) / i(n[0], n[1])
}()
},
getFocusPoint: function() {
return function n(e, t) {
return Object.assign({}, {
x: (e[s[0]] + t[s[0]]) / 2,
y: (e[s[1]] + t[s[1]]) / 2
})
}(t[1], t[0])
}
}
}, X = function(e) {
function a(e, t, n, i, s) {
Ln(this, a);
var r = An(this, (a.__proto__ || Object.getPrototypeOf(a)).call(this, i));
return r._utils = e, r._dataQ = n, r._elements = t, r._msgBus = s, r._evGesturesCache = [], r._prevEventDiff = -1, r._prevEvGestureSet = [], r._prevTouchEvents = [], r._onAllBrowsersPinchZoomEventBinded = r._onAllBrowsersPinchZoomEvent.bind(r), r
}
return Pn(a, V.Events), xn(a, [{
key: "startFeature",
value: function(e) {
e || (e = window.self), this._bind(e), this._isReady = !0
}
}, {
key: "stopFeature",
value: function(e) {
e || (e = window.self), this._unbind(e)
}
}, {
key: "_addToCommunicationQueue",
value: function(e, t, n, i) {
e !== V.EnumDefs.Events.pinchZoomEventType.pointerdown && e !== V.EnumDefs.Events.pinchZoomEventType.pointerup || this._msgBus.publish("pinchEvent", {
action: e
});
var s = this.getEventTimestamp(i),
r = this._utils.StorageUtils.getAndUpdateEventSequenceNumber();
this._dataQ.addToQueue("pinch_events", V.CDUtils.convertToArrayByMap(V.DataMappingDefs.PINCH_ZOOM_EVENT_MAP, {
eventSequence: r,
timestamp: s,
focusX: n.x,
focusY: n.y,
scaleFactor: t
}))
}
}, {
key: "_bind",
value: function(e) {
var t = e.document || e.contentDocument,
n = void 0;
if (window.PointerEvent ? n = ["pointerdown", "pointermove", "pointerup"] : window.TouchEvent && (n = ["touchstart", "touchend", "touchcancel", "touchmove"]), this._listeningToEvents = n, this._listeningToEvents)
for (var i = 0; i < this._listeningToEvents.length; i++) this._utils.addEventListener(t, this._listeningToEvents[i], this._onAllBrowsersPinchZoomEventBinded)
}
}, {
key: "_unbind",
value: function(e) {
var t = e.document || e.contentDocument;
if (this._listeningToEvents)
for (var n = 0; n < this._listeningToEvents.length; n++) this._utils.removeEventListener(t, this._listeningToEvents[n], this._onAllBrowsersPinchZoomEventBinded);
this._evGesturesCache = [], this._prevEventDiff = -1
}
}, {
key: "_onAllBrowsersPinchZoomEvent",
value: function(e) {
switch (this.handlerProlog("t.TE"), e.type) {
case "pointerdown":
this._onPointerDownEvent(e);
break;
case "pointermove":
this._onPointerMoveEvent(e);
break;
case "pointerup":
this._onPointerUpEvent(e);
break;
case "touchstart":
this._onTouchStartEvent(e);
break;
case "touchend":
this._onTouchEndEvent(e);
break;
case "touchmove":
this._onTouchMoveEvent(e)
}
return this.handlerEpilog("t.TE"), !0
}
}, {
key: "_onPointerDownEvent",
value: function(e) {
this._evGesturesCache.push(e)
}
}, {
key: "_onPointerMoveEvent",
value: function(e) {
for (var t = 0; t < this._evGesturesCache.length; t++)
if (e.pointerId == this._evGesturesCache[t].pointerId) {
this._evGesturesCache[t] = e;
break
}
if (2 == this._evGesturesCache.length && this._evGesturesCache[0].pointerId != this._evGesturesCache[1].pointerId) {
var n = Math.abs(this._evGesturesCache[0].clientX - this._evGesturesCache[1].clientX);
if (0 < this._prevEventDiff && (this._prevEventDiff, this._prevEventDiff, 2 == this._prevEvGestureSet.length)) {
var i = G(this._evGesturesCache, this._prevEvGestureSet, Y),
s = i.getScale();
this._addToCommunicationQueue(V.EnumDefs.Events.pinchZoomEventType[e.type], s, i.getFocusPoint(), e)
}
this._prevEventDiff = n, this._prevEvGestureSet = this._evGesturesCache.slice(0)
} else 2 < this._evGesturesCache.length && (this._evGesturesCache = [], this._prevEvGestureSet = [])
}
}, {
key: "_onPointerUpEvent",
value: function(e) {
for (var t = 0; t < this._evGesturesCache.length; t++)
if (this._evGesturesCache[t].pointerId == e.pointerId) {
this._evGesturesCache.splice(t, 1);
break
}
this._evGesturesCache.length < 2 && (this._prevEventDiff = -1, this._prevEvGestureSet = [])
}
}, {
key: "_onTouchStartEvent",
value: function(e) {
this._prevTouchEvents[0] = e.touches.item(0), this._prevTouchEvents[1] = e.touches.item(1)
}
}, {
key: "_onTouchEndEvent",
value: function(e) {
this._prevTouchEvents = []
}
}, {
key: "_onTouchCancelEvent",
value: function(e) {}
}, {
key: "_onTouchMoveEvent",
value: function(e) {
if (2 == e.touches.length) {
if (2 == this._prevTouchEvents.length) {
var t = [e.touches.item(0), e.touches.item(1)],
n = G(t, this._prevTouchEvents.splice(0), K),
i = n.getScale();
this._addToCommunicationQueue(V.EnumDefs.Events.pinchZoomEventType[e.type], i, n.getFocusPoint(), e)
}
this._prevTouchEvents[0] = e.touches.item(0), this._prevTouchEvents[1] = e.touches.item(1)
}
}
}]), a
}(), V.PinchZoomEvents = X, Z = Rn, J = function(e) {
function a(e, t, n, i, s) {
Ln(this, a);
var r = An(this, (a.__proto__ || Object.getPrototypeOf(a)).call(this, i));
return r._utils = e, r._dataQ = n, r._elements = t, r._msgBus = s, r._onAllStorageEventBinded = r._onAllStorageEvent.bind(r), r
}
return Pn(a, Z.Events), xn(a, [{
key: "startFeature",
value: function(e) {
e || (e = window.self), this._bind(e)
}
}, {
key: "stopFeature",
value: function(e) {
e || (e = window.self), this._unbind(e)
}
}, {
key: "_addToCommunicationQueue",
value: function(e, t, n, i, s) {
e === Z.EnumDefs.Events.storageEventType.storage && this._msgBus.publish("storageEvent", {
action: e
});
var r = this.getEventTimestamp(s),
a = this._utils.StorageUtils.getAndUpdateEventSequenceNumber();
this._dataQ.addToQueue("storage_events", Z.CDUtils.convertToArrayByMap(Z.DataMappingDefs.STORAGE_EVENT_MAP, {
eventSequence: a,
timestamp: r,
keys: t,
action: n,
tabsOpened: i
}))
}
}, {
key: "_bind",
value: function(e) {
var t = void 0;
if ((e.localStorage || e.sessionStorage) && (t = ["storage"]), this._listeningToEvents = t, 0 < this._listeningToEvents.length)
for (var n = 0; n < this._listeningToEvents.length; n++) this._utils.addEventListener(e, this._listeningToEvents[n], this._onAllStorageEventBinded, !0)
}
}, {
key: "_unbind",
value: function(e) {
if (this._listeningToEvents)
for (var t = 0; t < this._listeningToEvents.length; t++) this._utils.removeEventListener(e, this._listeningToEvents[t], this._onAllStorageEventBinded, !0)
}
}, {
key: "_onAllStorageEvent",
value: function(e) {
switch (e.type) {
case "storage":
this._onStorageEvent(e)
}
return !0
}
}, {
key: "_onStorageEvent",
value: function(e) {
var t = !1,
n = null,
i = null;
null === e.key && (n = null), i = "string" == typeof e.key && null === e.newValue ? (n = e.key, "delete") : (n = e.key, "update");
var s = this._utils.StorageUtils.getFromLocalStorage("cdTabList");
s && "object" === Fn(s[0]) && (t = !0), t = t ? 1 : 0, this._addToCommunicationQueue(e.type, n, i, t, e)
}
}]), a
}(), Z.StorageEvents = J, $ = Rn, ee = function(e) {
function _(e, t, n, i, s, r) {
Ln(this, _);
var a = An(this, (_.__proto__ || Object.getPrototypeOf(_)).call(this, s));
return a._configurationRepository = e, a._utils = t, a._elements = n, a._dataQueue = i, a._perfMonitor = s, a._msgBus = r, a.comboCode = [67, 86, 65, 88, 90, 80, 83], a._onKeyEvent = a._onKeyEvent.bind(a), a._onTestKeyEvent = a._onTestKeyEvent.bind(a), a
}
return Pn(_, $.Events), xn(_, [{
key: "startFeature",
value: function(e) {
try {
e || (e = window.self);
var t = e.document || e.contentDocument;
this._bind(t, this._onKeyEvent, !1), this._configurationRepository.get("isCaptureKeyEvents") && this._bind(t, this._onTestKeyEvent, !0)
} catch (n) {
log.error("KeyEvents:startFeature failed, msg: " + n.message, n)
}
}
}, {
key: "stopFeature",
value: function(e) {
try {
e || (e = window.self);
var t = e.document || e.contentDocument;
this._unbind(t, this._onKeyEvent, !1), this._configurationRepository.get("isCaptureKeyEvents") && this._unbind(t, this._onTestKeyEvent, !0)
} catch (n) {
log.error("KeyEvents:stopFeature failed, msg: " + n.message, n)
}
}
}, {
key: "_maskKeyAndCode",
value: function(e) {
if (1 === e.key.length) {
var t = this._utils.getMapCode(e.key.charCodeAt(0));
e.key = String.fromCharCode(t)
} - 1 !== e.code.indexOf("Numpad") ? e.code = "Numpad" : -1 !== e.code.indexOf("Digit") ? e.code = "Digit" : -1 !== e.code.indexOf("Key") && (e.code = "Key")
}
}, {
key: "_analyzeKey",
value: function(e) {
var t = -1;
return t = "keypress" !== e.type && 95 < e.which ? e.which < 106 ? 96 : e.which || e.keyCode : this._utils.getMapCode(e.which || e.keyCode), this._utils.isUndefinedNull(t) && (t = -1), t
}
}, {
key: "updateFeatureConfig",
value: function(e) {
try {
if (this._configurationRepository.get("isCaptureKeyEvents")) {
e || (e = window.self);
var t = e.document || e.contentDocument;
this._unbind(t, this._onTestKeyEvent, !0), this._bind(t, this._onTestKeyEvent, !0)
}
} catch (n) {
log.error("KeyEvents:startFeature failed, msg: " + n.message, n)
}
}
}, {
key: "_bind",
value: function(e, t, n) {
e.addEventListener("keyup", t, n), e.addEventListener("keydown", t, n), e.addEventListener("keypress", t, n)
}
}, {
key: "_unbind",
value: function(e, t, n) {
e.removeEventListener("keyup", t, n), e.removeEventListener("keydown", t, n), e.removeEventListener("keypress", t, n)
}
}, {
key: "_onTestKeyEvent",
value: function(e) {
this._handleKeyEvent(e, "test_key_events")
}
}, {
key: "_onKeyEvent",
value: function(e) {
this.handlerProlog("t.KE");
var t = $.EnumDefs.Events.keyEventType[e.type];
t !== $.EnumDefs.Events.keyEventType.keydown && t !== $.EnumDefs.Events.keyEventType.keyup || this._msgBus.publish($.MessageBusEventType.KeyEvent, {
action: t
}), this._handleKeyEvent(e, "key_events"), this.handlerEpilog("t.KE")
}
}, {
key: "_handleKeyEvent",
value: function(e, t) {
var n = this._analyzeKey(e),
i = $.EnumDefs.Events.isTrusted[e.isTrusted],
s = this.getEventTimestamp(e),
r = -1 === n || "keypress" !== e.type ? "" : String.fromCharCode(n),
a = this._elements.getElement(e.target),
o = $.EnumDefs.Events.keyEventType[e.type];
this._utils.isUndefinedNull(o) && (o = -1);
var u = e.ctrlKey && "keyup" !== e.type || e.metaKey ? this.comboCode.indexOf(e.which) : -1,
c = "Meta" === e.key || "OS" === e.key || "Win" === e.key || e.metaKey || 91 === e.keyCode || 92 === e.keyCode,
h = this._utils.StorageUtils.getAndUpdateEventSequenceNumber(),
l = {
key: e.key || "",
code: e.code || ""
};
this._maskKeyAndCode(l);
var d = "-1";
this._configurationRepository.get($.ConfigurationFields.collectKeyRegionValue) && (d = _._getKeyRegion(e)), log.isDebug() && log.trace("onKeyEvent: got event: " + o + ", at time:" + s + ", key: " + l.key + ", code:" + l.code + ", old charCode:" + n);
var f = this.getTimestampFromEvent(e);
this._dataQueue.addToQueue(t, $.CDUtils.convertToArrayByMap($.DataMappingDefs.KEY_EVENT_MAP, {
eventType: o,
eventSequence: h,
timestamp: s,
charCode: n,
character: r || "",
elementHash: a,
keyComboType: u,
isTrusted: i,
isCtrl: e.ctrlKey || !1,
isShift: e.shiftKey || !1,
isAlt: e.altKey || !1,
isMetaKey: c || !1,
keyLocation: e.location || 0,
code: l.code || "",
key: l.key || "",
location: e.location || "",
isRepeat: e.repeat || !1,
keyRegion: d,
relativeTime: f
}))
}
}], [{
key: "_getKeyRegion",
value: function(e) {
var t = e.which || e.keyCode;
for (var n in $.KeyRegionsTable)
if ($.KeyRegionsTable.hasOwnProperty(n) && -1 < $.KeyRegionsTable[n].indexOf(t)) return n;
return "-1"
}
}]), _
}(), $.KeyEvents = ee, Rn.KeyRegionsTable = {
0: [192, 49, 50, 51],
1: [52, 53, 54, 55],
2: [56, 57, 48],
3: [81, 87, 69, 65, 83, 68, 90, 88, 67],
4: [82, 84, 70, 71, 86, 66],
5: [89, 85, 72, 74, 78, 77],
6: [73, 79, 80, 75, 76, 188, 190],
7: [186, 189, 187, 191, 219, 220, 221, 222]
}, te = Rn, ne = function(e) {
function s(e, t, n) {
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, n));
return i._utils = e, i._dataQueue = t, i._addToEventQueueFunc = i._addToEventQueue.bind(i), i._myAfterPrintFunc = i._myAfterPrint.bind(i), i
}
return Pn(s, te.Events), xn(s, [{
key: "_myAfterPrint",
value: function() {
this._addToEventQueueFunc(te.EnumDefs.Events.printEventType.printDialogClosed), window.removeEventListener("focus", this._myAfterPrintFunc)
}
}, {
key: "_onBeforePrintEvent",
value: function(e) {
this._addToEventQueueFunc(te.EnumDefs.Events.printEventType.printDialogOpened), te.CDUtils.addEventListener(window, "focus", this._myAfterPrintFunc.bind(this))
}
}, {
key: "_addToEventQueue",
value: function(e) {
var t = this.getEventTimestamp(),
n = this._utils.StorageUtils.getAndUpdateEventSequenceNumber();
this._dataQueue.addToQueue("print_events", te.CDUtils.convertToArrayByMap(te.DataMappingDefs.PRINT_EVENT_MAP, {
eventSequence: n,
timestamp: t,
printDialogState: e
}))
}
}, {
key: "startFeature",
value: function() {
te.CDUtils.addEventListener(window, "beforeprint", this._onBeforePrintEvent.bind(this))
}
}, {
key: "stopFeature",
value: function() {
te.CDUtils.removeEventListener(window, "beforeprint", this._onBeforePrintEvent.bind(this), !0)
}
}]), s
}(), te.PrintEvents = ne, ie = Rn, se = function(e) {
function i(e, t) {
Ln(this, i);
var n = An(this, (i.__proto__ || Object.getPrototypeOf(i)).call(this, t));
return n._dataQueue = e, n._historyHandlerModernFunc = n._historyHandlerModern.bind(n), n._addHistoryEventFunc = n._addHistoryEventToQueue.bind(n), n
}
return Pn(i, ie.Events), xn(i, [{
key: "_historyHandlerModern",
value: function() {
var e = sessionStorage.getItem("stateLastUrl"),
t = window.location.href,
n = history.state;
if (null !== e) {
var i = void 0,
s = 0;
if (null === n) {
var r = history.length - 1;
i = 1, n = String(r), history.replaceState(n, "")
} else {
var a = sessionStorage.getItem("stateLastShown"),
o = Number(a);
i = 0 == (s = Number(n) - o) ? 0 : s / Math.abs(s)
}
sessionStorage.setItem("stateLastShown", n), 0 < Math.abs(i) && 0 < Math.abs(s) && this._addHistoryEventFunc(i)
}
sessionStorage.setItem("stateLastUrl", t)
}
}, {
key: "_addHistoryEventToQueue",
value: function(e) {
log.debug("HistoryNavigationEvents:addHistoryEventToQueue");
var t = this.getEventTimestamp(),
n = ie.CDUtils.StorageUtils.getAndUpdateEventSequenceNumber();
this._dataQueue.addToQueue("history_navigation_events", ie.CDUtils.convertToArrayByMap(ie.DataMappingDefs.HISTORY_NAVIGATION_EVENT_MAP, {
eventSequence: n,
timestamp: t,
navigationDirection: e
}))
}
}, {
key: "startFeature",
value: function() {
ie.CDUtils.addEventListener(window, "hashchange", this._historyHandlerModernFunc), this._historyHandlerModernFunc()
}
}, {
key: "stopFeature",
value: function() {
ie.CDUtils.removeEventListener(window, "hashchange", this._historyHandlerModernFunc)
}
}]), i
}(), ie.HistoryNavigationEvents = se, re = Rn, ae = function(e) {
function r(e, t, n, i) {
Ln(this, r);
var s = An(this, (r.__proto__ || Object.getPrototypeOf(r)).call(this, i));
return s._configurationRepository = e, s._utils = t, s._dataQueue = n, s._storageUtils = s._utils.StorageUtils, s._samplePeriod = s._configurationRepository.get("accelerometerEventsSamplePeriod") || 0, s._samplePeriodGyro = s._configurationRepository.get("gyroEventsSamplePeriod") || 0, s._lastX = 0, s._lastY = 0, s._lastZ = 0, s._lastTime = 0, s._lastAlpha = 0, s._lastBeta = 0, s._lastGamma = 0, s._lastTimeGyro = 0, s._onAccelerometerventFunc = s._onAccelerometerEvent.bind(s), s
}
return Pn(r, re.Events), xn(r, [{
key: "_onAccelerometerEvent",
value: function(e) {
var t = this._utils.dateNow();
if (e && e.accelerationIncludingGravity && t - this._lastTime > this._samplePeriod) {
var n = e.accelerationIncludingGravity.x,
i = e.accelerationIncludingGravity.y,
s = e.accelerationIncludingGravity.z;
if (!(this._utils.isUndefinedNull(n) && this._utils.isUndefinedNull(i) && this._utils.isUndefinedNull(s) || (n = this._utils.isUndefinedNull(n) ? -1 : this._utils.cutDecimalPointDigits(n, 4), i = this._utils.isUndefinedNull(i) ? -1 : this._utils.cutDecimalPointDigits(i, 4), s = this._utils.isUndefinedNull(s) ? -1 : this._utils.cutDecimalPointDigits(s, 4), n === this._lastX && i === this._lastY && s === this._lastZ))) {
var r = this._storageUtils.getAndUpdateEventSequenceNumber();
this._lastTime = t, this._lastX = n, this._lastY = i, this._lastZ = s, this._dataQueue.addToQueue("accelerometer_events", [null, r, t, n, i, s]), log.isDebug() && log.debug("AccelerometerEvents:_onAccelerometerEvent, sending data: timestamp:" + t + " x,y,z:" + n + "," + i + "," + s + ", prevTime:" + this._lastTime)
}
}
if (e && e.rotationRate && t - this._lastTimeGyro > this._samplePeriodGyro) {
var a = e.rotationRate.alpha,
o = e.rotationRate.beta,
u = e.rotationRate.gamma;
if (!this._utils.isUndefinedNull(a) || !this._utils.isUndefinedNull(o) || !this._utils.isUndefinedNull(u)) {
var c = e.absolute || !1;
if (a = this._utils.isUndefinedNull(a) ? 0 : this._utils.cutDecimalPointDigits(a, 4), o = this._utils.isUndefinedNull(o) ? 0 : this._utils.cutDecimalPointDigits(o, 4), u = this._utils.isUndefinedNull(u) ? 0 : this._utils.cutDecimalPointDigits(u, 4), a !== this._lastAlpha || o !== this._lastBeta || u !== this._lastGamma) {
this._lastTimeGyro = t, this._lastAlpha = a, this._lastBeta = o, this._lastGamma = u;
var h = this._utils.StorageUtils.getAndUpdateEventSequenceNumber();
this._dataQueue.addToQueue("gyro_events", [null, h, t, c, a, o, u]), log.isDebug() && log.debug("GyroEvents:_onGyroEvent, sending data: timestamp:" + t + " alpha,betta,gamma:" + a + "," + o + "," + u + ", prevTime:" + this._lastTimeGyro)
}
}
}
return !0
}
}, {
key: "startFeature",
value: function() {
window.DeviceMotionEvent && this._utils.addEventListener(window, "devicemotion", this._onAccelerometerventFunc)
}
}, {
key: "stopFeature",
value: function() {
window.DeviceMotionEvent && this._utils.removeEventListener(window, "devicemotion", this._onAccelerometerventFunc)
}
}, {
key: "updateFeatureConfig",
value: function() {
this._samplePeriod = this._configurationRepository.get("accelerometerEventsSamplePeriod") !== undefined ? this._configurationRepository.get("accelerometerEventsSamplePeriod") : this._samplePeriod, this._samplePeriodGyro = this._configurationRepository.get("gyroEventsSamplePeriod") !== undefined ? this._configurationRepository.get("gyroEventsSamplePeriod") : this._samplePeriodGyro
}
}]), r
}(), re.AccelerometerEvents = ae, oe = Rn, ue = function(e) {
function s(e, t, n) {
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, n));
return i._dataQ = t, i._utils = e, i._lastScreenOrientation = oe.EnumDefs.Events.screenOrientationType.undefined, i._onScreenOrientationEventFunc = i._onScreenOrientationEvent.bind(i), screen.mozOrientation && screen.addEventListener ? (i._eventTarget = screen, i._eventName = "mozorientationchange") : screen.msOrientation && screen.addEventListener ? (i._eventTarget = screen, i._eventName = "msorientationchange") : (i._eventTarget = window, i._eventName = "orientationchange"), i
}
return Pn(s, oe.Events), xn(s, [{
key: "startFeature",
value: function() {
this._utils.addEventListener(this._eventTarget, this._eventName, this._onScreenOrientationEventFunc), this._handleScreenOrientationEvent(screen)
}
}, {
key: "stopFeature",
value: function() {
this._utils.removeEventListener(this._eventTarget, this._eventName, this._onScreenOrientationEventFunc)
}
}, {
key: "_onScreenOrientationEvent",
value: function(e) {
var t = void 0;
t = e && e.target ? e.target.screen || e.target : screen, this._handleScreenOrientationEvent(t)
}
}, {
key: "_handleScreenOrientationEvent",
value: function(e) {
var t = e.mozOrientation || e.msOrientation || e.orientation;
if (t !== undefined) {
var n = t.type || t,
i = oe.EnumDefs.Events.screenOrientationType[n];
if (i !== undefined) {
if (this._lastScreenOrientationType != i) {
var s = this.getEventTimestamp(),
r = this._utils.StorageUtils.getAndUpdateEventSequenceNumber();
this._lastScreenOrientationType = i, log.trace("onScreenOrientationEvent: Orientation changed to " + i + " at time " + s), this._dataQ.addToQueue("screen_orientation", oe.CDUtils.convertToArrayByMap(oe.DataMappingDefs.SCREEN_ORIENTATION_EVENT_MAP, {
eventSequence: r,
timestamp: s,
orientation: i
}))
}
} else log.error("onScreenOrientationEvent: Unknown orientation " + n + " value.")
} else log.debug("onScreenOrientationEvent: Unable to find orientation data.")
}
}]), s
}(), oe.ScreenOrientationEvents = ue, ce = Rn, he = function(e) {
function a(e, t, n, i, s) {
Ln(this, a);
var r = An(this, (a.__proto__ || Object.getPrototypeOf(a)).call(this, s));
return r._configurationRepository = e, r._utils = t, r._dataQ = i, r._elements = n, r._activeTouchActions = {},
r._tapMaxSlop = r._configurationRepository.get("tapEventsTapMaxSlop") || 20, r._longPressTimeout = r._configurationRepository.get("tapEventsLongPressTimeout") || 500, r._handleStartEventBind = r._handleStartEvent.bind(r), r._handleMoveEventBind = r._handleMoveEvent.bind(r), r._handleEndEventBind = r._handleEndEvent.bind(r), r._handleCancelEventBind = r._handleCancelEvent.bind(r), r._eventDefinitions = a.getSupportedTouchEvents(), r
}
return Pn(a, ce.Events), xn(a, [{
key: "startFeature",
value: function(e) {
e || (e = window.self), this._bind(e)
}
}, {
key: "stopFeature",
value: function(e) {
e || (e = window.self), this._unbind(e)
}
}, {
key: "updateFeatureConfig",
value: function() {
this._tapMaxSlop = this._configurationRepository.get("tapEventsTapMaxSlop") !== undefined ? this._configurationRepository.get("tapEventsTapMaxSlop") : this._tapMaxSlop, this._longPressTimeout = this._configurationRepository.get("tapEventsLongPressTimeout") !== undefined ? this._configurationRepository.get("tapEventsLongPressTimeout") : this._longPressTimeout
}
}, {
key: "_bind",
value: function(e) {
if (this._eventDefinitions) {
var t = e.document || e.contentDocument;
this._utils.addEventListener(t, this._eventDefinitions.startEvent, this._handleStartEventBind), this._utils.addEventListener(t, this._eventDefinitions.moveEvent, this._handleMoveEventBind), this._utils.addEventListener(t, this._eventDefinitions.endEvent, this._handleEndEventBind), this._utils.addEventListener(t, this._eventDefinitions.cancelEvent, this._handleCancelEventBind)
} else log.debug("TapEvents:_bind - No event definitions. Might be a legacy browser. Aborting bind operation.")
}
}, {
key: "_unbind",
value: function(e) {
if (this._eventDefinitions) {
var t = e.document || e.contentDocument;
this._utils.removeEventListener(t, this._eventDefinitions.startEvent, this._handleStartEventBind), this._utils.removeEventListener(t, this._eventDefinitions.moveEvent, this._handleMoveEventBind), this._utils.removeEventListener(t, this._eventDefinitions.endEvent, this._handleEndEventBind), this._utils.removeEventListener(t, this._eventDefinitions.cancelEvent, this._handleCancelEventBind)
}
}
}, {
key: "_handleStartEvent",
value: function(e) {
this.handlerProlog("t.TapStartE");
for (var t = this._getEventData(e), n = 0; n < t.length; n++) this._activeTouchActions[t[n].identifier] = {
startTime: this.getEventTimestamp(),
startX: t[n].touchData.pageX,
startY: t[n].touchData.pageY,
offsetX: 0,
offsetY: 0
};
this.handlerEpilog("t.TapStartE")
}
}, {
key: "_handleMoveEvent",
value: function(e) {
this.handlerProlog("t.TapMoveE");
for (var t = this._getEventData(e), n = 0; n < t.length; n++) {
var i = this._activeTouchActions[t[n].identifier];
i.offsetX = Math.abs(t[n].touchData.pageX - i.startX), i.offsetY = Math.abs(t[n].touchData.pageY - i.startY)
}
this.handlerEpilog("t.TapMoveE")
}
}, {
key: "_handleEndEvent",
value: function(e) {
this.handlerProlog("t.TapEndE");
for (var t = this._getEventData(e), n = 0; n < t.length; n++) {
var i = this._activeTouchActions[t[n].identifier];
i.offsetX < this._tapMaxSlop && i.offsetY < this._tapMaxSlop && (this.getEventTimestamp() - i.startTime < this._longPressTimeout ? this._sendEvent("tap_events", ce.DataMappingDefs.TAP_EVENT_MAP, t[n].identifier, t[n].touchData, t[n].eventArgs) : this._sendEvent("longpress_events", ce.DataMappingDefs.LONGPRESS_EVENT_MAP, t[n].identifier, t[n].touchData, t[n].eventArgs)), delete this._activeTouchActions[t[n].identifier]
}
this.handlerEpilog("t.TapEndE")
}
}, {
key: "_handleCancelEvent",
value: function(e) {
this.handlerProlog("t.TapCancelE");
for (var t = this._getEventData(e), n = 0; n < t.length; n++) delete this._activeTouchActions[t[n].identifier];
this.handlerEpilog("t.TapCancelE")
}
}, {
key: "_getEventData",
value: function(e) {
if (e.changedTouches == undefined) return null == e.pointerType || "touch" != e.pointerType && "pen" != e.pointerType && e.pointerType != e.MSPOINTER_TYPE_TOUCH && e.pointerType != e.MSPOINTER_TYPE_PEN ? [] : [{
identifier: e.pointerId ? e.pointerId : 0,
touchData: e,
eventArgs: e
}];
for (var t = [], n = 0; n < e.changedTouches.length; n++) {
var i = e.changedTouches[n],
s = i.identifier;
t.push({
identifier: s,
touchData: i,
eventArgs: e
})
}
return t
}
}, {
key: "_sendEvent",
value: function(e, t, n, i, s) {
var r = this.getEventTimestamp(),
a = ce.EnumDefs.Events.isTrusted[s.isTrusted],
o = this._elements.getElement(s.target),
u = this._utils.StorageUtils.getAndUpdateEventSequenceNumber();
this._utils.isUndefinedNull(n) && (n = 0), this._dataQ.addToQueue(e, ce.CDUtils.convertToArrayByMap(t, {
eventSequence: u,
timestamp: r,
screenX: i.screenX ? Math.round(i.screenX) : 0,
screenY: i.screenY ? Math.round(i.screenY) : 0,
pageX: i.pageX || 0,
pageY: i.pageY || 0,
clientX: i.clientX || 0,
clientY: i.clientY || 0,
isTrusted: a,
elementHash: o,
touchIndex: n % 1e4,
touchSizeMajor: i.radiusX ? 2 * i.radiusX : 0,
touchSizeMinor: i.radiusY ? 2 * i.radiusY : 0
}))
}
}], [{
key: "getSupportedTouchEvents",
value: function() {
return window.TouchEvent ? {
startEvent: "touchstart",
moveEvent: "touchmove",
endEvent: "touchend",
cancelEvent: "touchcancel"
} : window.PointerEvent ? {
startEvent: "pointerdown",
moveEvent: "pointermove",
endEvent: "pointerup",
cancelEvent: "pointercancel"
} : void log.debug("TapEvents:_createEventsToListenList - No touch support for browser.")
}
}]), a
}(), ce.TapEvents = he, le = Rn, de = function(e) {
function s(e, t, n) {
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, n));
return i._onScriptExecuteEventFunc = i._onScriptExecuteEvent.bind(i), i._dataQueue = t, i._utils = e, i
}
return Pn(s, le.Events), xn(s, [{
key: "_onScriptExecuteEvent",
value: function(e) {
if (e && e.target && ("load" !== e.type || "script" === e.target.nodeName.toLowerCase())) try {
this.handlerProlog("t.SE_E");
var t = this.getEventTimestamp(e),
n = this._utils.StorageUtils.getAndUpdateEventSequenceNumber(),
i = le.EnumDefs.Events.scriptEventType[e.type];
this._utils.isUndefinedNull(i) && (i = -1), log.isDebug() && log.trace("got event " + e.type + ", " + i + ", scriptSrc: " + e.target.src + " at time " + t), this._dataQueue.addToQueue("script_events", le.CDUtils.convertToArrayByMap(le.DataMappingDefs.SCRIPT_EVENT_MAP, {
eventSequence: n,
timestamp: t,
eventType: i,
scriptId: e.target.id || "",
namespaceURI: e.target.namespaceURI || "",
outerHTML: e.target.outerHTML || "",
scriptSource: e.target.src || "",
scriptType: e.target.type || ""
})), this.handlerEpilog("t.SE_E")
} catch (s) {
this.handlerCancelog("t.SE_E"), log.error("error on getScriptExecuteEvent " + s.toString())
}
}
}, {
key: "startFeature",
value: function() {
this._utils.addEventListener(document, "load", this._onScriptExecuteEventFunc, !0)
}
}, {
key: "stopFeature",
value: function() {
this._utils.removeEventListener(document, "load", this._onScriptExecuteEventFunc, !0)
}
}]), s
}(), le.ScriptEvents = de, fe = Rn, _e = function() {
function i(e, t, n) {
Ln(this, i), this._historyBuffer = [], this._isTouchInProgress = !1, this._touchStartCount = 0, this._isPostTouch = !1, this._touchEndTime = 0, this._dataQueue = t, this._configurationRepository = e, this._msgBus = n, this._msgBus.subscribe(fe.MessageBusEventType.TouchEvent, this._onTouch.bind(this)), this._msgBus.subscribe(fe.MessageBusEventType.KeyEvent, this._onTouch.bind(this)), this._isMotionAroundTouchEnabled = this._configurationRepository.get("isMotionAroundTouchEnabled") === undefined || this._configurationRepository.get("isMotionAroundTouchEnabled"), this._aroundTouchInterval = this._configurationRepository.get("motionPaddingAroundTouchMSec") !== undefined ? this._configurationRepository.get("motionPaddingAroundTouchMSec") : 1e3
}
return xn(i, [{
key: "addToQueue",
value: function(e, t, n, i) {
var s = fe.CDUtils.dateNow();
if (this._isPostTouch && s - this._touchEndTime > this._aroundTouchInterval && (log.debug("SensorsDataQueue: stopped post touch events, time has passed (" + this._aroundTouchInterval + " millisec)"), this._isPostTouch = !1), !this._isMotionAroundTouchEnabled || this._isTouchInProgress || this._isPostTouch) this._dataQueue.addToQueue(e, t, n, i);
else {
this._historyBuffer.push({
name: e,
data: t,
addCtxId: n,
isImmediateWup: i,
timestamp: s
});
for (var r = 0, a = this._historyBuffer.length; r < a && s - this._historyBuffer[0].timestamp > this._aroundTouchInterval; r++) this._historyBuffer.shift()
}
}
}, {
key: "onConfigUpdate",
value: function() {
this._aroundTouchInterval = this._configurationRepository.get("motionPaddingAroundTouchMSec") !== undefined ? this._configurationRepository.get("motionPaddingAroundTouchMSec") : this._aroundTouchInterval, this._isMotionAroundTouchEnabled = this._configurationRepository.get("isMotionAroundTouchEnabled") !== undefined ? this._configurationRepository.get("isMotionAroundTouchEnabled") : this._isMotionAroundTouchEnabled
}
}, {
key: "_sendBuffer",
value: function() {
var e = fe.CDUtils.dateNow();
log.debug("sending history sensors buffer ts=" + e);
for (var t = 0, n = this._historyBuffer.length; t < n; t++) e - this._historyBuffer[t].timestamp <= this._aroundTouchInterval && this._dataQueue.addToQueue(this._historyBuffer[t].name, this._historyBuffer[t].data, this._historyBuffer[t].addCtxId, this._historyBuffer[t].isImmediateWup);
this._historyBuffer = []
}
}, {
key: "_onTouch",
value: function(e) {
return this._isMotionAroundTouchEnabled && (this._isTouchInProgress || e.action !== fe.EnumDefs.Events.touchEventType.touchstart && e.action !== fe.EnumDefs.Events.keyEventType.keydown ? e.action === fe.EnumDefs.Events.touchEventType.touchend || e.action === fe.EnumDefs.Events.keyEventType.keyup ? (this._touchStartCount--, this._touchStartCount <= 0 && (this._isTouchInProgress = !1, this._isPostTouch = !0, this._touchEndTime = fe.CDUtils.dateNow(), log.debug("stopped touch event in sensors data q ts=" + fe.CDUtils.dateNow()))) : e.action !== fe.EnumDefs.Events.touchEventType.touchstart && e.action !== fe.EnumDefs.Events.keyEventType.keydown || this._touchStartCount++ : (log.debug("Started touch event in sensors data q ts=" + fe.CDUtils.dateNow()), this._isTouchInProgress = !0, this._touchStartCount = 1, this._sendBuffer())), !1
}
}]), i
}(), fe.SensorsDataQueue = _e, pe = Rn, ge = function(e) {
function s(e, t, n) {
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, n));
return i._dataQueue = t, i._utils = e, i._connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection, i
}
return Pn(s, pe.Events), xn(s, [{
key: "onChangeNetworkInfo",
value: function() {
log.debug("NetInfoEvents:onChangeNetworkInfo");
var e = this._utils.isUndefinedNull(this._connection.saveData) ? "" : this._connection.saveData.toString(),
t = this.getEventTimestamp(),
n = this._utils.StorageUtils.getAndUpdateEventSequenceNumber();
this._dataQueue.addToQueue("net_info_events", pe.CDUtils.convertToArrayByMap(pe.DataMappingDefs.NETINFO_EVENT_MAP, {
eventSequence: n,
timestamp: t,
connectionType: this._connection.type ? this._connection.type : "",
effectiveType: this._connection.effectiveType ? this._connection.effectiveType : "",
downlinkMax: this._connection.downlinkMax ? this._connection.downlinkMax.toString() : "",
downlink: this._connection.downlink ? this._connection.downlink.toString() : "",
rtt: this._connection.rtt ? this._connection.rtt.toString() : "",
isSaveData: e
}))
}
}, {
key: "startFeature",
value: function() {
this._connection && (this._connection.addEventListener("change", this.onChangeNetworkInfo.bind(this), !0), this.onChangeNetworkInfo())
}
}, {
key: "stopFeature",
value: function() {
this._connection && this._connection.removeEventListener("change", this.onChangeNetworkInfo.bind(this))
}
}]), s
}(), pe.NetInfoEvents = ge, ve = Rn, me = function(e) {
function i(e, t) {
Ln(this, i);
var n = An(this, (i.__proto__ || Object.getPrototypeOf(i)).call(this));
return n._utils = e, n._currState = null, n._dataQueue = t, n._tabData = {
id: "",
openTabTS: 0
}, n
}
return Pn(i, ve.Events), xn(i, [{
key: "startFeature",
value: function() {
log.info("Starting tab events feature"), this._initTabInfo(), ve.CDUtils.addEventListener(window, "beforeunload", this._onUnloadTab.bind(this))
}
}, {
key: "stopFeature",
value: function() {
log.info("Stopping tab events feature"), this._utils.removeEventListener(window, "beforeunload", this._onUnloadTab.bind(this))
}
}, {
key: "_initTabInfo",
value: function() {
var e = this._utils.StorageUtils.getFromLocalStorage("cdTabList");
e || (e = []);
var t = ve.EnumDefs.Events.tabEventType.openTab;
this._tabData = this._utils.StorageUtils.getFromSessionStorage("cdTabData") || this._tabData.id, this._tabData || (this._updateTabData(), t = ve.EnumDefs.Events.tabEventType.newTab);
for (var n = -1, i = 0, s = e.length; i < s; i++)
if (e[i][0] === this._tabData.id) {
n = i;
break
} - 1 !== n && n !== e.length || (e.push([this._tabData.id, this._tabData.openTabTS]), this._utils.StorageUtils.saveToLocalStorage("cdTabList", e), log.debug("added tab to list. " + this._tabData.id + ", tab index=" + e.length));
var r = this._utils.getDocUrl(),
a = this._utils.StorageUtils.getAndUpdateEventSequenceNumber(),
o = JSON.stringify(e);
this._dataQueue.addToQueue("tab_events", ve.CDUtils.convertToArrayByMap(ve.DataMappingDefs.TAB_EVENT_MAP, {
eventSequence: a,
timestamp: this._tabData.openTabTS,
type: t,
id: this._tabData.id || "",
href: r || "",
referrer: ve.CDUtils.clearTextFromNumbers(document.referrer),
currentTabsList: o || ""
}))
}
}, {
key: "_onUnloadTab",
value: function(e) {
var t = this._utils.StorageUtils.getFromLocalStorage("cdTabList");
t || (t = []);
var n = this.getEventTimestamp(),
i = this._utils.StorageUtils.getAndUpdateEventSequenceNumber(),
s = this._utils.getDocUrl(),
r = ve.EnumDefs.Events.tabEventType.closeTab,
a = JSON.stringify(t);
log.debug("removing tab from list. id:" + this._tabData.id + ", timestamp:" + n), this._dataQueue.addToQueue("tab_events", ve.CDUtils.convertToArrayByMap(ve.DataMappingDefs.TAB_EVENT_MAP, {
eventSequence: i,
timestamp: n,
type: r,
id: this._tabData.id || "",
href: s || "",
referrer: ve.CDUtils.clearTextFromNumbers(document.referrer),
currentTabsList: a || ""
}), !0, !0);
for (var o = 0, u = t.length; o < u; o++)
if (t[o][0] === this._tabData.id) {
t.splice(o, 1);
break
}
this._utils.StorageUtils.saveToLocalStorage("cdTabList", t)
}
}, {
key: "_updateTabData",
value: function() {
this._tabData = {}, this._tabData = {
id: this._utils.generateUUID(),
openTabTS: this.getEventTimestamp()
}, log.debug("initialize tab data: id:" + this._tabData.id + ", timestamp:" + this._tabData.openTabTS), this._utils.StorageUtils.saveToSessionStorage("cdTabData", this._tabData)
}
}]), i
}(), ve.TabsEvents = me, ye = Rn, we = function(e) {
function i(e, t) {
Ln(this, i);
var n = An(this, (i.__proto__ || Object.getPrototypeOf(i)).call(this));
return n._dataQueue = e, n._configurationRepository = t, n._eventThreshold = n._configurationRepository.get("lightSensorEventThreshold") || 5e3, n._lastTime = 0, n
}
return Pn(i, ye.Events), xn(i, [{
key: "_onReadingSensor",
value: function() {
var e = this.getEventTimestamp();
if (e - this._lastTime > this._eventThreshold) {
var t = ye.CDUtils.StorageUtils.getAndUpdateEventSequenceNumber();
this._lastTime = e, this._dataQueue.addToQueue("ambient_light_level", ye.CDUtils.convertToArrayByMap(ye.DataMappingDefs.AMBIENT_LIGHT_EVENT_MAP, {
eventSequence: t,
timestamp: e,
illuminance: this._sensor.illuminance
}))
}
}
}, {
key: "startFeature",
value: function() {
window.AmbientLightSensor ? (log.info("AmbientLightSensor exists and collected"), this._sensor = new AmbientLightSensor, ye.CDUtils.addEventListener(this._sensor, "reading", this._onReadingSensor.bind(this)), ye.CDUtils.addEventListener(this._sensor, "error", i._onSensorError), this._sensor.start()) : log.debug("LightSensor does not exist, not collecting")
}
}, {
key: "stopFeature",
value: function() {
this._sensor && (ye.CDUtils.removeEventListener(this._sensor, "reading", this._onReadingSensor.bind(this)), ye.CDUtils.removeEventListener(this._sensor, "error", i._onSensorError), this._sensor = null)
}
}, {
key: "updateFeatureConfig",
value: function() {
this._eventThreshold = this._configurationRepository.get("lightSensorEventThreshold") ? this._configurationRepository.get("lightSensorEventThreshold") : this._eventThreshold
}
}], [{
key: "_onSensorError",
value: function(e) {
log.debug("Error connecting LightSensor " + e.error)
}
}]), i
}(), ye.LightSensorEvents = we, Se = Rn, be = function() {
function e() {
Ln(this, e), this._initialize()
}
return xn(e, [{
key: "_initialize",
value: function() {
this._nodeParentHash = new WeakMap, this._nodeNameOccurencesPerParent = [], this._nodeNameOccurencesPerParent.push({})
}
}, {
key: "getUniqueElementName",
value: function(e) {
return e.nodeName.toLowerCase() + (e.id || "") + (e.name || "") + (e.href || "") + (e.getAttribute && e.getAttribute("class") || "") + (e.title || "")
}
}, {
key: "produce",
value: function(e) {
var t = [],
n = e,
i = (e.id || "") + (e.name || "") + (e.nodeName || "") + (e.className || "") + (e.title || "") + (e.href || ""),
s = !1;
if (e.parentNode && this._nodeParentHash.has(e.parentNode)) {
var r = e.nodeName.toLowerCase(),
a = this._nodeParentHash.get(e.parentNode),
o = a.occurrencesIndex,
u = 0;
return this._nodeNameOccurencesPerParent[o] && ("undefined" != typeof this._nodeNameOccurencesPerParent[o][r] ? u = this._nodeNameOccurencesPerParent[o][r] = ++this._nodeNameOccurencesPerParent[o][r] : this._nodeNameOccurencesPerParent[o][r] = 0), i += a.hash + "," + this.getUniqueElementName(e) + (u || "")
}
s = !!e.parentNode && e.parentNode;
for (var c = 0; e && 1 === e.nodeType; e = e.parentNode) {
for (var h = 0, l = e.previousSibling; l; l = l.previousSibling) l.nodeType !== Node.DOCUMENT_TYPE_NODE && l.nodeName === e.nodeName && (c = ++h);
var d = this.getUniqueElementName(e),
f = h || "";
t.splice(0, 0, d + f)
}
i += t.length ? "/" + t.join() : "";
var _ = [];
if (0 < t.length && (_ = t.slice(0, t.length - 1)), s) {
var p = {};
p[n.nodeName.toLowerCase()] = c;
var g = this._nodeNameOccurencesPerParent.push(p) - 1;
this._nodeParentHash.set(s, {
hash: "/" + _.join(),
occurrencesIndex: g
})
}
return i
}
}]), e
}(), Se.XPathHashProducer = be, Ee = Rn, ke = function(e) {
function t() {
return Ln(this, t), An(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
}
return Pn(t, Ee.AbstractFeature), xn(t, [{
key: "startFeature",
value: function() {
this.preFeature("dnt");
var e = navigator.doNotTrack;
e === undefined && (e = window.doNotTrack) === undefined && (e = navigator.msDoNotTrack), e = null === e || "unspecified" === e || "0" === e ? 0 : "1" === e ? 1 : 2, this._dataQ.addToQueue("static_fields", ["dnt", e], !1), this.postFeature("dnt")
}
}]), t
}(), Ee.DoNotTrackFeature = ke, Ce = Rn, Te = function(e) {
function c(e, t, n, i, s) {
Ln(this, c);
var r = An(this, (c.__proto__ || Object.getPrototypeOf(c)).call(this, e, t));
return r._pointerHoverDetector = n, r._utils = i, r._configurationRepository = s, r
}
return Pn(c, Ce.AbstractFeature), xn(c, [{
key: "startFeature",
value: function() {
var t = this;
log.info("Collecting Browser Props"), this.preFeature("BrowserPropsFeature"), this._dataQ.addToQueue("static_fields", ["version_client", Ce.CDUtils.scriptVersion], !1), this._dataQ.addToQueue("static_fields", ["device_source", "js"], !1), log.info("SDK Version is " + Ce.CDUtils.scriptVersion);
var e = void 0;
(e = c.getLanguage()) && (this._configurationRepository.get("browserPropsShouldHashLanguageField") && (log.debug("Hashing language field according to configuration"), e = this._utils.getHash(e).toString()), this._dataQ.addToQueue("static_fields", ["main_lang", e], !1)), this._dataQ.addToQueue("static_fields", ["os", window.navigator.platform], !1);
var n = c.getOperatingSystem();
this._dataQ.addToQueue("static_fields", ["os_version", n.version], !1), this._dataQ.addToQueue("static_fields", ["os_family", n.name], !1);
var i = this._pointerHoverDetector.getPointerHover();
if (this._dataQ.addToQueue("static_fields", ["input_mech", [i.pointer, i.hover]], !1), this._dataQ.addToQueue("static_fields", ["cores", window.navigator.hardwareConcurrency || 0], !1), navigator.languages) {
var s = navigator.languages;
this._configurationRepository.get("browserPropsShouldHashLanguageField") && (log.debug("Hashing languages field according to configuration"), s = Array.from(s, function(e) {
return t._utils.getHash(e).toString()
})), this._dataQ.addToQueue("static_fields", ["languages", s], !1)
}
var r = c.getPlugins();
r && 0 < r.length && this._dataQ.addToQueue("static_fields", ["plugins", r], !1), this._dataQ.addToQueue("static_fields", ["js_ua", navigator.userAgent], !1);
var a = -1 * (new Date).getTimezoneOffset();
this._dataQ.addToQueue("static_fields", ["time_zone", a], !1);
var o = c.checkCookie();
this._dataQ.addToQueue("static_fields", ["cookie_enabled", o], !1);
var u = navigator.deviceMemory || 0;
this._dataQ.addToQueue("static_fields", ["device_memory", u], !1), log.info("Browser Props collected"), this.postFeature("BrowserPropsFeature")
}
}], [{
key: "getLanguage",
value: function() {
if (navigator) {
if (navigator.language) return navigator.language;
if (navigator.userLanguage) return navigator.userLanguage
}
return undefined
}
}, {
key: "getPlugins",
value: function() {
try {
var e = [];
if (window.navigator.plugins && 0 < window.navigator.plugins.length)
for (var t = 0, n = window.navigator.plugins.length; t < n; t++) e.push([navigator.plugins[t].name, navigator.plugins[t].filename, navigator.plugins[t].description, navigator.plugins[t].version ? navigator.plugins[t].version : ""]);
else if (window.navigator.mimeTypes && 0 < window.navigator.mimeTypes.length)
for (var i = 0; i < window.navigator.mimeTypes.length; i++) e.push([window.navigator.mimeTypes[i].type, "", window.navigator.mimeTypes[i].description, ""]);
return e
} catch (s) {
log.warn("getPlugins error: " + s.message + " e:" + s)
}
}
}, {
key: "checkCookie",
value: function() {
var e = navigator.cookieEnabled;
return e || (Ce.CDUtils.StorageUtils.setCookie("testcookie", "1", 6e4), e = -1 != document.cookie.indexOf("testcookie")), e
}
}, {
key: "getOperatingSystem",
value: function() {
for (var e = [{
name: "Windows Phone",
value: "Windows Phone",
version: "OS"
}, {
name: "Windows",
value: "Win",
version: "NT"
}, {
name: "iPhone",
value: "iPhone",
version: "OS"
}, {
name: "iPad",
value: "iPad",
version: "OS"
}, {
name: "Kindle",
value: "Silk",
version: "Silk"
}, {
name: "Android",
value: "Android",
version: "Android"
}, {
name: "PlayBook",
value: "PlayBook",
version: "OS"
}, {
name: "BlackBerry",
value: "BlackBerry",
version: "/"
}, {
name: "Macintosh",
value: "Mac",
version: "OS X"
}, {
name: "Linux",
value: "Linux",
version: "rv"
}, {
name: "Palm",
value: "Palm",
version: "PalmOS"
}], t = [navigator.platform, navigator.oscpu || navigator.appVersion].join(" "), n = "", i = "Unknown", s = void 0, r = void 0, a = 0; a < e.length; a++)
if (new RegExp(e[a].value, "i").test(t)) {
if (s = new RegExp(e[a].version + "[- /:;]([\\d._]+)", "i"), r = t.match(s)) {
r[1] && (r = r[1]), r = r.split(/[._]+/);
for (var o = 0; o < r.length; o++) n += 0 === o ? r[o] + "." : r[o]
}
i = e[a].name;
break
}
return {
version: parseFloat(n) || null,
name: i
}
}
}]), c
}(), Ce.BrowserPropsFeature = Te, Me = Rn, De = function() {
function e() {
Ln(this, e)
}
return xn(e, [{
key: "detectPrivateMode",
value: function(e) {
this._isWebkitBrowser() ? this._detectPrivateBrowsingOnWebkit(e) : this._isMozillaBrowser() ? this._detectPrivateBrowsingOnMozilla(e) : this._isIE10OrLater(window.navigator.userAgent) ? this._detectPrivateBrowsingOnIESinceVersion10(e) : window.localStorage && /Safari/.test(window.navigator.userAgent) ? this._detectPrivateBrowsingOnSafari(e) : e(null)
}
}, {
key: "_isWebkitBrowser",
value: function() {
return !!window.webkitRequestFileSystem
}
}, {
key: "_isMozillaBrowser",
value: function() {
return "MozAppearance" in document.documentElement.style
}
}, {
key: "_isIE10OrLater",
value: function(e) {
var t = e.toLowerCase();
if (0 === t.indexOf("msie") && 0 === t.indexOf("trident")) return !1;
var n = /(?:msie|rv:)\s?([\d\.]+)/.exec(t);
if (n && 10 <= parseInt(n[1], 10)) return !0;
if (1 == (n = "documentElement" in document && ("filters" in document.documentElement || "documentMode" in document)) && document.documentMode && 10 <= parseFloat((t.match(/.+(?:ie|rv)[\/: ]([\d.]+)/) || [])[1])) return !0;
n = /edge/.test(t);
var i = !!t.match(/trident\/7\./);
return !!((n || i) && 10 <= parseFloat((t.match(/.+(?:edge|rv)[\/: ]([\d.]+)/) || [])[1]))
}
}, {
key: "_detectPrivateBrowsingOnWebkit",
value: function(e) {
window.webkitRequestFileSystem(window.TEMPORARY, 1, function() {
e(!1)
}, function() {
e(!0)
})
}
}, {
key: "_detectPrivateBrowsingOnMozilla",
value: function(e) {
try {
var t = (indexedDB || window.indexedDB).open("test");
t.onerror = function() {
e(!0)
}, t.onsuccess = function() {
e(!1)
}
} catch (n) {
e(!0)
}
}
}, {
key: "_detectPrivateBrowsingOnIESinceVersion10",
value: function(e) {
var t = !1;
try {
window.indexedDB || (t = !0)
} catch (n) {
t = !0
}
e(t)
}
}, {
key: "_detectPrivateBrowsingOnSafari",
value: function(e) {
var t = void 0;
try {
window.openDatabase(null, null, null, null)
} catch (n) {
t = !0
}
try {
window.localStorage.setItem("test", 1)
} catch (n) {
t = !0
}
t || (t = !1, window.localStorage.removeItem("test")), e(t)
}
}]), e
}(), Me.PrivateBrowsingDetector = De, Re = Rn, xe = function(e) {
function s(e, t, n) {
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, e, t));
return i._privateBrowsingDetector = n, i
}
return Pn(s, Re.AbstractFeature), xn(s, [{
key: "startFeature",
value: function() {
var t = this;
this._privateBrowsingDetector.detectPrivateMode(function(e) {
t._dataQ.addToQueue("static_fields", ["is_private_browsing", e], !1)
})
}
}]), s
}(), Re.IsPrivateBrowsingFeature = xe, Fe = Rn, Ae = function() {
function n() {
Ln(this, n)
}
return xn(n, null, [{
key: "getPointerHover",
value: function() {
var e = {
pointer: n.POINTER_TYPE.NOT_SUPPORTED,
hover: n.POINTER_TYPE.NOT_SUPPORTED
};
if (window.matchMedia) {
var t = window.matchMedia;
t("( any-pointer: fine )").matches ? e.pointer = n.POINTER_TYPE.FINE : t("( any-pointer: coarse )").matches ? e.pointer = n.POINTER_TYPE.COARSE : t("( any-pointer: none )").matches ? e.pointer = n.POINTER_TYPE.NONE : t("( any-pointer )").matches && (e.pointer = n.POINTER_TYPE.ANY), t("( any-hover: hover )").matches ? e.hover = n.HOVER_TYPE.HOVER : t("( any-hover: on-demand )").matches ? e.hover = n.HOVER_TYPE.ON_DEMAND : t("( any-hove: none )").matches ? e.hover = n.HOVER_TYPE.NONE : window.matchMedia("( any-hover )").matches && (e.hover = n.HOVER_TYPE.ANY)
}
return e
}
}]), n
}(), Object.extend(Ae, {
POINTER_TYPE: {
FINE: 1,
COARSE: 2,
NONE: 3,
ANY: 4,
NOT_SUPPORTED: 5
},
HOVER_TYPE: {
HOVER: 1,
ON_DEMAND: 2,
NONE: 3,
ANY: 4,
NOT_SUPPORTED: 5
}
}), Fe.PointerHoverDetector = Ae, Pe = Rn, Le = function(e) {
function s(e, t, n) {
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, e, t));
return i._configurationRepository = n, i._addrsLocal = {
"0.0.0.0": !1,
"127.0.0.1": !1
}, i._addrsGlobal = {}, i._ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/, i
}
return Pn(s, Pe.AbstractFeature), xn(s, [{
key: "startFeature",
value: function() {
var n = this;
Pe.CDUtils.DomUtils.onDocumentBody(window, function() {
n.preFeature("lg_ips");
try {
n._calculateIps()
} catch (e) {
log.error("Unable to collect ip information. " + e)
}
n._timer = setTimeout(function() {
n._rtcIframe && (document.body.removeChild(n._rtcIframe), n._rtcIframe = null);
var e = n._getLocalIps();
0 < e.length && n._dataQ.addToQueue("static_fields", ["l_ips", e], !1);
var t = n._getGlobalIps();
0 < t.length && n._dataQ.addToQueue("static_fields", ["g_ips", t], !1), n.postFeature("lg_ips")
}, n._configurationRepository.get(Pe.ConfigurationFields.ipDetectorTimeout))
})
}
}, {
key: "stopFeature",
value: function() {
this._timer && clearTimeout(this._timer)
}
}, {
key: "_calculateIps",
value: function() {
var n = this,
e = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
if (!e) {
this._rtcIframe = document.createElement("iframe"), this._rtcIframe.sandbox = "allow-same-origin allow-scripts", this._rtcIframe.id = Pe.EnumDefs.SystemFrameName.rtcframe, this._rtcIframe.style.display = "none", this._rtcIframe.style.position = "absolute", this._rtcIframe.style.zIndex = "-1", this._rtcIframe.height = 0, this._rtcIframe.width = 0, document.body.appendChild(this._rtcIframe);
var t = this._rtcIframe.contentWindow;
e = t.RTCPeerConnection || t.mozRTCPeerConnection || t.webkitRTCPeerConnection
}
if (!e) return log.info("Browser has no RTC support. Unable to detect IP."), document.body.removeChild(this._rtcIframe), void(this._rtcIframe = null);
var i = new e({
iceServers: [{
url: "stun:stun.l.google.com:19302",
urls: "stun:stun.l.google.com:19302"
}],
sdpSemantics: "plan-b"
}, {
optional: [{
RtpDataChannels: !0
}]
});
i.createDataChannel && i.createDataChannel("");
var s = function s(e) {
var t = n._ip_regex.exec(e);
t && t[1] && n._addIpToList(t[1])
};
i.onicecandidate = function(e) {
e.candidate && s(e.candidate.candidate)
}, this._createOffer(i)
}
}, {
key: "_createOffer",
value: function(t) {
try {
t.createOffer().then(function(e) {
return t.setLocalDescription(e)
})["catch"](function(e) {
log.warn("LocalIpDetect, offer failed " + e.message, e)
})
} catch (e) {
t.createOffer(function(e) {
t.setLocalDescription(e, function() {}, function() {})
}, function(e) {
log.warn("LocalIpDetect, offer failed " + e.message, e)
})
}
}
}, {
key: "_getLocalIps",
value: function() {
var t = this;
return Object.keys(this._addrsLocal).filter(function(e) {
return t._addrsLocal[e]
})
}
}, {
key: "_getGlobalIps",
value: function() {
return Object.keys(this._addrsGlobal)
}
}, {
key: "_addIpToList",
value: function(e) {
e in this._addrsLocal || e in this._addrsGlobal || (e.match(/^(192\.168\.|169\.254\.|10\.|172\.(1[6-9]|2\d|3[01]))/) ? this._addrsLocal[e] = !0 : this._addrsGlobal[e] = !0)
}
}]), s
}(), Pe.IpDetectorFeature = Le, Ie = Rn, Ue = function() {
function e() {
Ln(this, e), this._baseFonts = ["monospace", "sans-serif", "serif"], this._testString = "mmmmmmmmmmlli", this._testSize = "72px", this._chunkSize = 30, this._defaultWidth = {}, this._defaultHeight = {}, this._body = null, this._iframe = null, this._spanArray = null, this._allFontsDiffs = []
}
return xn(e, [{
key: "clear",
value: function() {
this._body.removeChild(this._iframe), this._iframe = null, this._spanArray = null, this._allFontsDiffs = []
}
}, {
key: "init",
value: function(e) {
if (this._body = document.body, !this._body) return "";
this._iframe = document.createElement("iframe"), this._iframe.id = Ie.EnumDefs.SystemFrameName.fontDetectionFrame, this._iframe.style.visibility = "hidden", this._iframe.style.zIndex = "-1", this._iframe.style.width = 0, this._iframe.style.height = 0, this._body.appendChild(this._iframe), this._iframe.contentDocument.body || (this._iframe.style.width = null, this._iframe.style.height = null, this._iframe.contentDocument.appendChild(document.createElement("body")));
var t = this;
Ie.CDUtils.DomUtils.onWindowDocumentReady(this._iframe.contentWindow, function() {
t._createCalculationElements(e)
})
}
}, {
key: "_createCalculationElements",
value: function(e) {
var t = document.createElement("span");
t.style.fontSize = this._testSize, t.style.visibility = "hidden", t.style.position = "absolute", t.style.zIndex = "-1", t.style.lineHeight = "normal", t.innerHTML = this._testString;
for (var n = 0; n < this._baseFonts.length; n++) t.style.fontFamily = this._baseFonts[n], this._iframe.contentDocument.body.appendChild(t), this._defaultWidth[this._baseFonts[n]] = t.offsetWidth, this._defaultHeight[this._baseFonts[n]] = t.offsetHeight, this._iframe.contentDocument.body.removeChild(t);
log.debug("FontsDetector:init - base fonts width: \n " + this._baseFonts[0] + ":" + this._defaultWidth[this._baseFonts[0]] + ";\n " + this._baseFonts[1] + ":" + this._defaultWidth[this._baseFonts[1]] + ";\n " + this._baseFonts[2] + ":" + this._defaultWidth[this._baseFonts[2]]), log.debug("FontsDetector:init - base fonts height: \n " + this._baseFonts[0] + ":" + this._defaultHeight[this._baseFonts[0]] + ";\n " + this._baseFonts[1] + ":" + this._defaultHeight[this._baseFonts[1]] + ";\n " + this._baseFonts[2] + ":" + this._defaultHeight[this._baseFonts[2]]), this._createSpanArray(), e()
}
}, {
key: "_createSpanArray",
value: function() {
var e = document.createElement("div");
e.id = "currentDiv", e.style.position = "absolute", e.style.visibility = "hidden";
for (var t = 0; t < this._chunkSize; t++) {
var n = document.createElement("span");
n.style.lineHeight = "normal", n.style.position = "absolute", n.style.zIndex = "-1", n.style.fontSize = this._testSize, n.innerHTML = this._testString, e.appendChild(n);
var i = document.createElement("br");
e.appendChild(i)
}
this._iframe.contentDocument.body.appendChild(e), this._spanArray = e
}
}, {
key: "detectByChunksWithIndex",
value: function(e, t, n) {
var i = [],
s = 0,
r = 0;
if (!this._spanArray) return i;
for (var a = this._spanArray.getElementsByTagName("span"), o = this._defaultWidth[this._baseFonts[t]], u = this._defaultHeight[this._baseFonts[t]], c = 0; c < e.length; c++) {
if (r >= this._chunkSize)
for (var h = r = 0; h < a.length; h++) {
var l = Math.abs(a[h].offsetWidth - o),
d = Math.abs(a[h].offsetHeight - u);
this._allFontsDiffs.push([a[h].id, l, d]), (1 < l || 1 < d) && (i[s] = a[h].id, s++)
}
a[r].style.fontFamily = e[c] + "," + this._baseFonts[t], a[r].id = e[c], r++
}
n(i)
}
}, {
key: "getAllFontsDiffs",
value: function() {
return this._allFontsDiffs
}
}]), e
}(), Ie.FontsDetector = Ue, Be = Rn, Ne = function(e) {
function r(e, t, n, i) {
Ln(this, r);
var s = An(this, (r.__proto__ || Object.getPrototypeOf(r)).call(this, t, n));
return s._utils = e, s._fontDetectorCtor = i, s._storageKeyName = "detectedFonts_2.1.5", s._legacyStorageKeyName = "detectedFonts", s._serif_fonts = ["adobe jenson", "adobe text", "albertus", "aldus", "alexandria", "algerian", "american typewriter", "antiqua", "arno", "aster", "aurora", "baskerville", "bell", "bembo", "bembo schoolbook", "benguiat", "berkeley old style", "bernhard modern", "bodoni", "book antiqua", "bookman", "bordeaux roman", "californian fb", "calisto", "capitals", "cambria", "cartier", "caslon", "caslon antique", "catull", "centaur", "century old style", "century schoolbook", "new century schoolbook", "chaparral", "charis sil", "cheltenham", "clearface", "cochin", "colonna", "computer modern", "concrete roman", "constantia", "cooper black", "corona", "dejavu fonts", "ecotype", "elephant", "espy serif", "excelsior", "fairfield", "ff scala", "footlight", "freeserif", "friz quadrata", "garamond", "gentium", "georgia", "gloucester", "goudy old style", "goudy schoolbook", "goudy pro font", "granjon", "heather", "hercules", "high tower text", "hiroshige", "hoefler text", "humana serif", "imprint", "ionic no. 5", "janson", "jenson", "joanna", "korinna", "kursivschrift", "legacy serif", "lexicon",
"liberation fonts", "linux libertine", "literaturnaya", "lucida", "melior", "memphis", "miller", "minion", "didone", "mona lisa", "mrs eaves", "ms serif", "new york", "nimbus roman", "nps rawlinson roadway", "ocr a extended", "palatino", "perpetua", "plantin", "plantin schoolbook", "playbill", "poor richard", "rawlinson roadway", "renault", "requiem", "roman", "rotis serif", "sabon", "seagull", "sistina", "souvenir", "stix", "stone informal", "stone serif", "sylfaen", "times new roman", "times", "trajan", "trinité", "trump mediaeval", "utopia", "vale type", "bitstream vera", "versailles", "wanted", "weiss", "wide latin", "windsor", "xits", "apex", "archer", "athens", "city", "cholla slab", "clarendon", "courier", "egyptienne", "guardian egyptian", "lexia", "museo slab", "rockwell", "nilland", "skeleton antique", "tower"
], s._sans_serif_fonts = ["abadi", "agency fb", "akzidenz grotesk", "aptifer", "arial", "arial unicode ms", "avant garde", "avenir", "bank gothic", "barmeno", "bauhaus", "bell centennial", "bell gothic", "benguiat gothic", "berlin sans", "beteckna", "brandon grotesque", "cabin", "cafeteria", "calibri", "century gothic", "charcoal", "chicago", "clearface gothic", "clearview", "co headline", "co text", "compacta", "corbel", "ff dax", "dotum", "droid", "dyslexie", "ecofont", "eras", "espy sans", "nu sans", "eurocrat", "eurostile", "ff meta", "flama", "formata", "freesans", "franklin gothic", "frutiger", "futura", "geneva", "gill sans", "gill sans schoolbook", "gotham", "handel gothic", "denmark", "haettenschweiler", "hei", "helvetica", "helvetica neue", "swiss 721", "highway gothic", "hiroshige sans", "hobo", "impact", "industria", "interstate", "johnston", "kabel", "lato", "legacy sans", "lexia readable", "meiryo", "microgramma", "motorway", "ms sans serif", "museo sans", "myriad", "neutraface", "neuzeit s", "news gothic", "nimbus sans l", "nina", "optima", "parisine", "pricedown", "prima sans", "pt sans", "rail alphabet", "revue", "roboto", "rotis sans", "ff scala sans", "segoe", "skia", "souvenir gothic", "stone sans", "syntax", "tahoma", "template gothic", "tiresias", "trade gothic", "transport alphabet", "trebuchet ms", "trump gothic", "tw cen", "twentieth century", "ubuntu font family", "univers", "zurich", "verdana", "virtue"], s._monospace_fonts = ["andale mono", "anonymous", "consolas", "courierhp", "courier new", "courierps", "fontcraft courier", "everson mono", "fedra mono", "fixed", "fixedsys", "fixedsys excelsior", "inconsolata", "hyperfont", "letter gothic", "magnetic ink character recognition", "menlo", "miriam fixed", "monaco", "monofur", "monospace", "ms gothic", "ms mincho", "nimbus mono l", "ocr-a", "ocr-b", "orator", "ormaxx", "pragmatapro", "prestige elite", "profont", "proggy programming fonts", "small fonts", "sydnie", "terminal", "tex gyre cursor", "um typewriter", "william monospace", "balloon", "brush script", "dragonwick", "choc", "dom casual", "mistral", "papyrus", "tempus sans", "amazone", "ams euler", "apple chancery", "aristocrat", "bickley script", "civitype", "codex", "edwardian script", "forte", "french script", "kuenstler script", "monotype corsiva", "old english text mt", "palace script", "park avenue", "scriptina", "shelley volante", "vivaldi", "vladimir script", "zapf chancery", "zapfino", "andy", "ashley script", "chalkboard", "comic sans", "cezanne", "fontoon", "irregularis", "jefferson", "kristen", "lucida handwriting", "rage italic", "rufscript", "scribble", "soupbone", "tekton", "alecko", "cinderella", "cupola", "curlz", "magnificat", "script", "american text", "cloister black", "fraktur", "goudy text", "old english text", "wedding text", "aegyptus", "aharoni", "aisha", "amienne", "batak script", "chandas", "hanacaraka", "japanese gothic typeface", "jomolhari", "kochi font", "lontara script", "maiola", "minchō", "mona font", "nassim", "nastaliq navees", "neacademia", "perpetua greek", "simsun", "skolar", "skolar devanagari", "sundanese unicode", "sutturah", "tai le valentinium", "tengwar", "tibetan machine uni", "tunga", "wadalab", "apple symbols", "bookshelf symbol 7", "braille", "commercial pi", "corel", "erler dingbats", "hm phonetic", "mathematical pi", "morse code", "opensymbol", "richstyle", "symbol", "symbolps", "wingdings", "wingdings 2", "wingdings 3", "webdings", "zapf dingbats", "abracadabra", "ad lib", "allegro", "andreas", "arnold böcklin", "astur", "balloon pop outlaw black", "banco", "beat", "braggadocio", "broadway", "ellington", "exablock", "exocet", "fig script", "gigi", "harlow solid", "harrington", "horizon", "jim crow", "jokerman", "juice", "lo-type", "magneto", "megadeth", "neuland", "peignot", "ravie", "san francisco", "showcard gothic", "snap", "stencil", "umbra", "westminster", "willow", "bagel", "lithos", "aldhabi", "andalus", "angsana new", "angsanaupc", "aparajita", "arabic typesetting", "arial black", "arial narrow", "arial rounded mt bold", "baskerville old face", "batang", "batangche", "bauhaus 93", "bell mt", "berlin sans fb", "berlin sans fb demi", "bernard mt condensed", "blackadder itc", "bodoni mt", "bodoni mt black", "bodoni mt condensed", "bodoni mt poster compressed", "bookman old style", "bradley hand itc", "britannic bold", "browallia new", "browalliaupc", "brush script mt", "buxton sketch", "calibri light", "calisto mt", "cambria math", "candara", "castellar", "century", "chiller", "colonna mt", "comic sans ms", "copperplate gothic bold", "copperplate gothic light", "cordia new", "cordiaupc", "curlz mt", "daunpenh", "david", "dfkai-sb", "dilleniaupc", "dokchampa", "dotumche", "ebrima", "edwardian script itc", "engravers mt", "eras bold itc", "eras demi itc", "eras light itc", "eras medium itc", "estrangelo edessa", "eucrosiaupc", "euphemia", "fangsong", "felix titling", "footlight mt light", "franklin gothic book", "franklin gothic demi", "franklin gothic demi cond", "franklin gothic heavy", "franklin gothic medium", "franklin gothic medium cond", "frankruehl", "freesiaupc", "freestyle script", "french script mt", "gabriola", "gadugi", "gautami", "gill sans mt", "gill sans mt condensed", "gill sans mt ext condensed bold", "gill sans ultra bold", "gill sans ultra bold condensed", "gisha", "gloucester mt extra condensed", "goudy stout", "gulim", "gulimche", "gungsuh", "gungsuhche", "harlow solid italic", "imprint mt shadow", "informal roman", "irisupc", "iskoola pota", "jasmineupc", "javanese text", "juice itc", "kaiti", "kalinga", "kartika", "khmer ui", "kodchiangupc", "kokila", "kristen itc", "kunstler script", "lao ui", "latha", "leelawadee", "leelawadee ui", "leelawadee ui semilight", "levenim mt", "lilyupc", "lucida bright", "lucida calligraphy", "lucida console", "lucida fax", "lucida sans", "lucida sans typewriter", "lucida sans unicode", "maiandra gd", "malgun gothic", "mangal", "marlett", "matura mt script capitals", "meiryo ui", "microsoft himalaya", "microsoft jhenghei", "microsoft jhenghei light", "microsoft jhenghei ui", "microsoft jhenghei ui light", "microsoft new tai lue", "microsoft phagspa", "microsoft sans serif", "microsoft tai le", "microsoft uighur", "microsoft yahei", "microsoft yahei light", "microsoft yahei ui", "microsoft yahei ui light", "microsoft yi baiti", "mingliu", "mingliu-extb", "mingliu_hkscs", "mingliu_hkscs-extb", "miriam", "modern", "modern no. 20", "mongolian baiti", "moolboran", "ms outlook", "ms pgothic", "ms pmincho", "ms reference sans serif", "ms reference specialty", "ms ui gothic", "mt extra", "mv boli", "myanmar text", "narkisim", "niagara engraved", "niagara solid", "nirmala ui", "nirmala ui semilight", "nsimsun", "nyala", "onyx", "palace script mt", "palatino linotype", "parchment", "perpetua titling mt", "plantagenet cherokee", "pmingliu", "pmingliu-extb", "pristina", "raavi", "rockwell condensed", "rockwell extra bold", "rod", "sakkal majalla", "script mt bold", "segoe marker", "segoe print", "segoe script", "segoe ui", "segoe ui black", "segoe ui emoji", "segoe ui light", "segoe ui semibold", "segoe ui semilight", "segoe ui symbol", "shonar bangla", "shruti", "simhei", "simplified arabic", "simplified arabic fixed", "simsun-extb", "sitka banner", "sitka display", "sitka heading", "sitka small", "sitka subheading", "sitka text", "sketchflow print", "snap itc", "system", "tempus sans itc", "traditional arabic", "tw cen mt", "tw cen mt condensed", "tw cen mt condensed extra bold", "urdu typesetting", "utsaah", "vani", "vijaya", "viner hand itc", "vrinda", "yu gothic", "yu gothic light", "yu mincho", "yu mincho demibold", "yu mincho light"], s
}
return Pn(r, Be.AbstractFeature), xn(r, [{
key: "startFeature",
value: function() {
var t = this;
log.info("Collecting Fonts"), this.preFeature("fonts");
var n = this._utils.StorageUtils.getFromLocalStorage(this._storageKeyName);
n || (n = this._utils.StorageUtils.getFromLocalStorage(this._legacyStorageKeyName));
var i = this._utils.StorageUtils.getFromLocalStorage(this._legacyStorageKeyName, !1);
i && log.info("Detected legacy fonts data in the local storage. Will send them to server."), n && this._utils.StorageUtils.saveToLocalStorage(this._storageKeyName, n), this._detectFonts(function(e) {
(!n || 600 <= n.split(",").length) && (n = e, t._utils.StorageUtils.saveToLocalStorage(t._storageKeyName, n)), t._updateFonts(n, e, i), log.info("Fonts collected")
})
}
}, {
key: "_detectFonts",
value: function(r) {
var e = this;
Be.CDUtils.DomUtils.onDocumentBody(window, function() {
var s = new e._fontDetectorCtor;
s.init(function() {
var n = e,
i = void 0;
s.detectByChunksWithIndex.cdCallAsync(s, n._serif_fonts, 2, function(e) {
i = e, s.detectByChunksWithIndex.cdCallAsync(s, n._sans_serif_fonts, 1, function(e) {
i = i.concat(e), s.detectByChunksWithIndex.cdCallAsync(s, n._monospace_fonts, 0, function(e) {
if (600 <= (i = i.concat(e)).length) {
var t = s.getAllFontsDiffs();
n._dataQ.addToQueue("static_fields", ["problematic_fonts", t], !1), n.cancelMonitor("fonts")
} else r(i.toString());
s.clear()
})
})
})
})
})
}
}, {
key: "_updateFonts",
value: function(e, t, n) {
this._dataQ.addToQueue("static_fields", ["fonts", e], !1), this._dataQ.addToQueue("static_fields", ["fonts_not_cached", t], !1), n && this._dataQ.addToQueue("static_fields", ["legacy_fonts", n], !1), this.postFeature("fonts")
}
}]), r
}(), Be.FontsDetectionFeature = Ne, Oe = Rn, We = function(e) {
function i(e, t) {
Ln(this, i);
var n = An(this, (i.__proto__ || Object.getPrototypeOf(i)).call(this, e, t));
return n.canvasId = "cd_canvas", n
}
return Pn(i, Oe.AbstractFeature), xn(i, [{
key: "startFeature",
value: function() {
this.preFeature("grph_card");
try {
this._getMappedRenderInfo()
} catch (e) {
log.error("Failed collecting Graphic Card information. " + e)
}
}
}, {
key: "_getMappedRenderInfo",
value: function() {
log.info("Collecting Graphic Card props");
var e = {
renderer: "unknown",
vendor: "",
version: "unknown"
};
if (window.WebGLRenderingContext || window.WebGL2RenderingContext) {
var t = document.createElement("canvas");
t.id = this.canvasId;
var n = t.getContext("experimental-webgl");
if (n) {
var i = n.getExtension("WEBGL_debug_renderer_info");
if (null != i && (e.renderer = n.getParameter(i.UNMASKED_RENDERER_WEBGL), e.vendor = n.getParameter(i.UNMASKED_VENDOR_WEBGL), -1 < e.renderer.indexOf("Intel") && -1 < e.renderer.indexOf("HD Graphics"))) {
var s = e.renderer.match(/\d+/g);
if (s) {
var r = s[0];
500 < r && r < 599 && (e.version = "SKL (6th gen core)"), 5300 < r && r < 6999 && (e.version = "BDW (5th gen core)")
}
}
}
}
this._dataQ.addToQueue("static_fields", ["grph_card", [e.renderer, e.vendor, e.version]], !1), log.info("Graphic Card props collected"), this.postFeature("grph_card")
}
}]), i
}(), Oe.GraphicDetectFeature = We, Qe = Rn, He = function(e) {
function s(e, t, n) {
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, t, n));
return i._utils = e, i.audioCtx = window.AudioContext || window.webkitAudioContext ? new(window.AudioContext || window.webkitAudioContext) : null, i
}
return Pn(s, Qe.AbstractFeature), xn(s, [{
key: "startFeature",
value: function() {
var t = this;
this.audioCtx && this.audioCtx.createGain ? Qe.CDUtils.DomUtils.onDocumentBody(window, function() {
log.info("Starting AudioFeature");
var e = document.createElement("canvas");
e.id = "cdCanvas", t.context = e.getContext("2d"), t.counter = 3, t.getAudioInfo(), t.getPxiSum(), t.getHybridOscFp()
}) : log.info("AudioFeature is unsupported")
}
}, {
key: "getAudioInfo",
value: function() {
var e = void 0;
this.preFeature("au_info");
try {
if (this.audioCtx) {
var t = this.audioCtx,
n = t.createAnalyser();
e = s.getOutput({}, t, "ac-"), e = s.getOutput(e, t.destination, "ac-"), e = s.getOutput(e, t.listener, "ac-"), e = s.getOutput(e, n, "an-"), e = window.JSON.stringify(e)
} else e = "Not available";
this._dataQ.addToQueue("static_fields", ["au_context_info", e], !1)
} catch (i) {
log.error("AudioContext.getAudioInfo failed: " + i.message)
}
this.postFeature("au_info")
}
}, {
key: "getPxiSum",
value: function() {
this.preFeature("au_osc_sum");
var n = void 0,
i = this;
try {
var e = window.OfflineAudioContext || window.webkitOfflineAudioContext ? new(window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 44100, 44100) : null;
if (!e) return void i.cancelMonitor("au_osc_sum");
var t = e.createOscillator();
t.type = "triangle", t.frequency.setTargetAtTime(1e4, this.audioCtx.currentTime, 1e-7);
var s = e.createDynamicsCompressor();
s.threshold && s.threshold.setValueAtTime(-50, this.audioCtx.currentTime), s.knee && s.knee.setValueAtTime(40, this.audioCtx.currentTime), s.ratio && s.ratio.setValueAtTime(12, this.audioCtx.currentTime), s.reduction && (s.reduction.value = -20), s.attack && s.attack.setValueAtTime(0, this.audioCtx.currentTime), s.release && s.release.setValueAtTime(.25, this.audioCtx.currentTime), t.connect(s), s.connect(e.destination), t.start(0), e.startRendering(), e.oncomplete = function(e) {
n = 0;
for (var t = 4500; t < 5e3; t++) n += Math.abs(e.renderedBuffer.getChannelData(0)[t]);
s.disconnect(), i._dataQ.addToQueue("static_fields", ["au_osc_sum", n], !1), i.postFeature("au_osc_sum")
}
} catch (r) {
i.cancelMonitor("au_osc_sum"), log.error("AudioContext.getPxiResult failed: " + r.message)
}
}
}, {
key: "getHybridOscFp",
value: function() {
this.preFeature("au_osc");
var n = this,
i = [],
s = void 0;
if (this.audioCtx) {
var e = this.audioCtx.createOscillator(),
r = this.audioCtx.createAnalyser(),
a = this.audioCtx.createGain(),
o = this.audioCtx.createScriptProcessor(4096, 1, 1),
t = this.audioCtx.createDynamicsCompressor();
t.threshold && t.threshold.setValueAtTime(-50, this.audioCtx.currentTime), t.knee && t.knee.setValueAtTime(40, this.audioCtx.currentTime), t.ratio && t.ratio.setValueAtTime(12, this.audioCtx.currentTime), t.reduction && (t.reduction.value = -20), t.attack && t.attack.setValueAtTime(0, this.audioCtx.currentTime), t.release && t.release.setValueAtTime(.25, this.audioCtx.currentTime), a.gain.setValueAtTime(0, this.audioCtx.currentTime), e.type = "triangle", e.connect(t), t.connect(r), r.connect(o), o.connect(a), a.connect(this.audioCtx.destination), o.onaudioprocess = function(e) {
e = new Float32Array(r.frequencyBinCount), r.getFloatFrequencyData(e);
for (var t = 0; t < e.length; t += 1) i.push(e[t]);
r.disconnect(), o.disconnect(), a.disconnect(), i = i.slice(0, 30), s = n._utils.getHash(i.toString()), n._dataQ.addToQueue("static_fields", ["au_osc_output", i], !1), n._dataQ.addToQueue("static_fields", ["au_osc_output_hash", s], !1), log.info("Calculated AudioFeature au_osc_output (length=" + i.length + "), au_osc_output_hash fields"), n.postFeature("au_osc")
}, e.start(0)
} else n.cancelMonitor("au_osc")
}
}], [{
key: "getOutput",
value: function(e, t, n) {
for (var i in t) "dopplerFactor" === i || "speedOfSound" === i || "currentTime" === i || "number" != typeof t[i] && "string" != typeof t[i] || (e[(n || "") + i] = t[i]);
return e
}
}]), s
}(), Qe.AudioFeature = He, ze = Rn, qe = function(e) {
function n(e, t) {
return Ln(this, n), An(this, (n.__proto__ || Object.getPrototypeOf(n)).call(this, e, t))
}
return Pn(n, ze.AbstractFeature), xn(n, [{
key: "startFeature",
value: function() {
this.preFeature("browser_spoof");
var e = !!window.opr && !!opr.addons || !!window.opera || 0 <= navigator.userAgent.indexOf(" OPR/"),
t = "undefined" != typeof InstallTrigger,
n = /constructor/i.test(window.HTMLElement) || "[object SafariRemoteNotification]" === (!window.safari || "undefined" != typeof safari && safari.pushNotification).toString(),
i = !!document.documentMode,
s = !i && !!window.StyleMedia,
r = !!window.chrome && !!window.chrome.webstore,
a = (r || e) && !!window.CSS;
this._dataQ.addToQueue("static_fields", ["browser_spoofing", [r, t, s, i, n, e, a]], !1), this.postFeature("browser_spoof")
}
}]), n
}(), ze.BrowserDetect = qe, je = Rn, Ve = function(e) {
function s(e, t) {
var n = 2 < arguments.length && arguments[2] !== undefined ? arguments[2] : window.navigator;
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, e, t));
return i._permDefs = {
granted: 1,
prompt: 2,
denied: 3,
"true": 1,
"false": 3
}, i._permissions = ["geolocation", "midi", "notifications", "push"], i._navigator = n, i
}
return Pn(s, je.AbstractFeature), xn(s, [{
key: "startFeature",
value: function() {
this._reportQueryPermissions(), this._reportStoragePermission(), this._reportMicCameraPermissions()
}
}, {
key: "_reportQueryPermissions",
value: function() {
var i = this;
if (this._navigator.permissions && this._navigator.permissions.query)
for (var t = function t(e) {
var n = i._permissions[e];
i._navigator.permissions.query({
name: n
}).then(function(e) {
var t = i._permDefs[e.state] || -1;
i._dataQ.addToQueue("static_fields", ["per_" + n, t], !1)
})["catch"](function(e) {
log.debug("Failed to query permissions " + e.message)
})
}, e = 0; e < this._permissions.length; e++) t(e)
}
}, {
key: "_reportStoragePermission",
value: function() {
var t = this;
this._navigator.storage && this._navigator.storage.persisted && this._navigator.storage.persisted().then(function(e) {
t._dataQ.addToQueue("static_fields", ["per_storage", t._permDefs[e] || -1], !1)
})["catch"](function(e) {
log.debug("Failed to check storage persisted: " + e.message)
})
}
}, {
key: "_reportMicCameraPermissions",
value: function() {
var r = this,
a = {
audio: !1,
video: !1
};
this._navigator.mediaDevices && this._navigator.mediaDevices.enumerateDevices && this._navigator.mediaDevices.enumerateDevices().then(function(e) {
e.forEach(function(e) {
if (! function i(e) {
return e.includes("audio") && a.audio || e.includes("video") && a.video
}(e.kind)) {
var t = function s(e) {
return e.includes("audio") ? (a.audio = !0, "audio") : e.includes("video") ? (a.video = !0, "video") : void 0
}(e.kind),
n = "" !== e.label ? r._permDefs.granted : r._permDefs.denied;
r._dataQ.addToQueue("static_fields", ["per_" + t, n], !1)
}
})
})["catch"](function(e) {
log.debug("UserPermissions:startFeature failed to enumerateDevices: " + e.message)
})
}
}]), s
}(), je.UserPermissions = Ve, Ye = Rn, Ke = function(e) {
function s(e, t) {
var n = 2 < arguments.length && arguments[2] !== undefined ? arguments[2] : window.navigator;
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, e, t));
return i._navigator = n, i._metric = "MediaDevicesFeature", i
}
return Pn(s, Ye.AbstractFeature), xn(s, [{
key: "startFeature",
value: function() {
var t = this;
this.preFeature(this._metric), this._navigator.mediaDevices && this._navigator.mediaDevices.enumerateDevices && this._navigator.mediaDevices.enumerateDevices().then(function(e) {
var n = [];
e.forEach(function(e) {
var t = [e.kind || "", e.label || "", e.deviceId || "", e.groupId || ""];
n.push(t)
}), t._dataQ.addToQueue("static_fields", ["media_devices", n], !1), t.postFeature(t._metric)
})["catch"](function(e) {
t.cancelMonitor(t._metric), log.error("MediaDevicesFeature:startFeature failed to enumerateDevices: " + e.message)
})
}
}]), s
}(), Ye.MediaDevicesFeature = Ke, Ge = Rn, Xe = function(e) {
function s(e, t, n) {
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, e, t));
return i._utils = n, i
}
return Pn(s, Ge.AbstractFeature), xn(s, [{
key: "startFeature",
value: function() {
var e, t;
this.preFeature("contextPropsFeature"), self.screen && (e = t = window.devicePixelRatio ? window.devicePixelRatio : -1, this._dataQ.addToQueue("static_fields", ["display", [screen.colorDepth, screen.width, screen.height, screen.availHeight || -1, screen.availWidth || -1, e, t]], !1)), this.reportPageLoadTime(), this.postFeature("contextPropsFeature")
}
}, {
key: "reportPageLoadTime",
value: function() {
var e = this;
if (window.performance && window.performance.timing) {
var t = function t() {
window.performance.timing.loadEventEnd && window.performance.timing.navigationStart && e._perfMonitor.reportMonitor("t.timeTillPageLoad", window.performance.timing.loadEventEnd - window.performance.timing.navigationStart)
};
window.performance.timing.loadEventEnd ? t() : this._utils.DomUtils.onPageLoad(self, t)
}
}
}]), s
}(), Ge.ContextPropsFeature = Xe, Ze = Rn, Je = function(e) {
function s(e, t, n) {
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, e, n));
return i._timeoutValue = 1e3, i._scriptsRepository = t, i._runDetectionLoopBinded = i._runDetectionLoop.bind(i), i
}
return Pn(s, Ze.AbstractFeature), xn(s, [{
key: "_checkScriptsData",
value: function() {
for (var e = document.scripts, t = 0; t < e.length; t++) {
var n = {
src: e[t].src,
text: e[t].text
};
this._scriptsRepository.exists(n) || (this._scriptsRepository.add(n), this._dataQ.addToQueue("scripts", [null, n.src, n.textHash]))
}
}
}, {
key: "_runDetectionLoop",
value: function() {
this._checkScriptsData(), this._timer = setTimeout(this._runDetectionLoopBinded, this._timeoutValue), this._timeoutValue < 536870911 && (this._timeoutValue *= 4)
}
}, {
key: "startFeature",
value: function() {
this.preFeature("scripts"), this._runDetectionLoop(), this.postFeature("scripts")
}
}, {
key: "stopFeature",
value: function() {
this._timer && clearTimeout(this._timer)
}
}]), s
}(), Ze.ScriptsFeature = Je, $e = Rn, et = function() {
function t(e) {
Ln(this, t), this._utils = e, this._scriptList = []
}
return xn(t, [{
key: "count",
value: function() {
return this._scriptList.length
}
}, {
key: "exists",
value: function(e) {
/\d\d\d/.test(e.src) && (e.src = this._utils.clearTextFromNumbers(e.src));
for (var t = this._utils.getHash(e.text), n = 0; n < this._scriptList.length; n++)
if (e.src && e.src === this._scriptList[n].src || t && t === this._scriptList[n].textHash) return !0;
return !1
}
}, {
key: "add",
value: function(e) {
e.textHash = this._utils.getHash(e.text), /\d\d\d/.test(e.src) && (e.src = this._utils.clearTextFromNumbers(e.src)), this._scriptList.push({
src: e.src,
textHash: e.textHash
})
}
}]), t
}(), $e.ScriptsRepository = et, tt = Rn, nt = function(e) {
function r(e, t, n, i) {
Ln(this, r);
var s = An(this, (r.__proto__ || Object.getPrototypeOf(r)).call(this, t, n));
return s._configurationRepository = e, s._metaDataSiteMapper = i, s._metaDataSiteMapper.updateObserver(s.onSiteMapperMatch.bind(s)), s
}
return Pn(r, tt.AbstractFeature), xn(r, [{
key: "startFeature",
value: function() {
this._metaDataSiteMapper.initTracking()
}
}, {
key: "stopFeature",
value: function() {
this._metaDataSiteMapper.stopTracking()
}
}, {
key: "onSiteMapperMatch",
value: function(e) {
log.debug("Metadata Collector mapper match - " + JSON.stringify(e)), e.metaVal && this._dataQ.addToQueue("metadata_map", [null, e.metaVal, tt.CDUtils.dateNow()])
}
}, {
key: "updateFeatureConfig",
value: function() {
this._metaDataSiteMapper.onConfigUpdate(this._configurationRepository)
}
}]), r
}(), tt.MetadataCollector = nt, it = Rn, st = function(e) {
function o(e, t, n, i, s, r) {
Ln(this, o);
var a = An(this, (o.__proto__ || Object.getPrototypeOf(o)).call(this, null, s));
return a._utils = t, a._configurationRepository = e, a._sessionService = n, a._muidMgr = i, a._cidCache = r, a
}
return Pn(o, it.AbstractFeature), xn(o, [{
key: "getFiles",
value: function() {
if (this._customerId && this._muid && this._sid && this._addrList && 0 < this._addrList.length)
for (var e = void 0, t = 0; t < this._addrList.length; t++) e = this._addrList[t] + "?cid=" + this._customerId + "&snum=" + this._sid + "&muid=" + this._muid, this._utils.getPostUrl(e, "GET", null, null, null), this._isSent = !0;
this.postFeature("get_files")
}
}, {
key: "startFeature",
value: function() {
this.preFeature("get_files"), this._isSent = !1;
try {
this._addrList = JSON.parse(this._configurationRepository.get("getAddrList"))
} catch (e) {
this._addrList = ""
}
this._customerId = this._cidCache.get() || "", this._muid = this._muidMgr.muid || "", this._sid = this._sessionService.sessionId || "", this.getFiles()
}
}, {
key: "updateFeatureConfig",
value: function() {
try {
this._addrList = JSON.parse(this._configurationRepository.get("getAddrList"))
} catch (e) {
this._addrList = ""
}
this._customerId = this._cidCache.get() || "", this._muid = this._muidMgr.muid || "", this._sid = this._sessionService.sessionId || "", this._isSent || this.getFiles()
}
}]), o
}(), it.FilesFeature = st, rt = Rn, at = function(e) {
function r(e, t, n, i) {
Ln(this, r);
var s = An(this, (r.__proto__ || Object.getPrototypeOf(r)).call(this, n, null));
return s._utils = t, s._timers = {}, s._isRunning = !1, s._challengeSiteMapper = i, s._challengeSiteMapper.updateObserver(s._onSiteMapperMatch.bind(s)), s._onMouseEventBinded = s._onMouseEvent.bind(s), s._onKeyEventBinded = s._onKeyEvent.bind(s), s._configurationRepository = e, s
}
return Pn(r, rt.AbstractFeature), xn(r, [{
key: "startFeature",
value: function() {
this._challengeSiteMapper.initTracking()
}
}, {
key: "stopFeature",
value: function() {
this._challengeSiteMapper.stopTracking(), this._stopHiding("featureStopped")
}
}, {
key: "updateFeatureConfig",
value: function() {
this._challengeSiteMapper.onConfigUpdate(this._configurationRepository)
}
}, {
key: "startHiding",
value: function(e) {
try {
log.info("Mouse Challenge starting to hide on: " + rt.CDUtils.dateNow()), this._timers = e, this._dataQ.addToQueue("challenge", [null, "invisible_mouse", "start", "", rt.CDUtils.dateNow()]), this._isRunning = !0, this._runFuncForFrames(top, r.createDiv), this._runFuncForFrames(top, this._hideMouse.bind(this))
} catch (t) {
log.error("Mouse Challenge error occurred - " + t.message, t)
}
}
}, {
key: "_runFuncForFrames",
value: function(e, t) {
if (e) {
t(e);
try {
for (var n = 0; n < e.frames.length; n++) {
var i = e.frames[n];
this._runFuncForFrames(i, t)
}
} catch (s) {
log.error("Mouse Challenge error occurred - " + s.message, s)
}
}
}
}, {
key: "_stopHiding",
value: function(e) {
this._isRunning && (this._isRunning = !1, this._runFuncForFrames(top, r.removeDiv.bind(this)), log.info("Mouse Challenge stopHiding sending message time=" + rt.CDUtils.dateNow()), this._dataQ.addToQueue("challenge", [null, "invisible_mouse", "stop", e, rt.CDUtils.dateNow()]))
}
}, {
key: "_stopListening",
value: function(e) {
var t = e.document || e.contentDocument;
this._utils.removeEventListener(t, "mousemove", this._onMouseEventBinded, !0, !0, !0), this._utils.removeEventListener(t, "keydown", this._onKeyEventBinded, !0, !0, !0)
}
}, {
key: "_hideMouse",
value: function(e) {
var t = this,
n = e.document || e.contentDocument;
n.getElementById("coverDivMouse").style.visibility = "visible", this._timers.mouseTimer && this._utils.addEventListener(n, "mousemove", this._onMouseEventBinded, !0, !0, !0), this._timers.keyTimer && this._utils.addEventListener(document, "keydown", this._onKeyEventBinded, !0, !0, !0), this._timers.time && setTimeout(function() {
log.info("Mouse Challenge timeout timer occurred time=" + rt.CDUtils.dateNow()), t._runFuncForFrames(top, t._stopListening.bind(t)), t._stopHiding("timeout")
}, this._timers.time)
}
}, {
key: "_onMouseEvent",
value: function(e) {
var t = this;
this._runFuncForFrames(top, this._stopListening.bind(this)), setTimeout(function() {
log.info("Mouse Challenge mouse event timeout occurred"), t._stopHiding("mouseEvent")
}, this._timers.mouseTimer)
}
}, {
key: "_onKeyEvent",
value: function(e) {
var t = this;
this._runFuncForFrames(top, this._stopListening.bind(this)), setTimeout(function() {
log.info("Mouse Challenge key event timeout occurred"), t._stopHiding("keyEvent")
}, this._timers.keyTimer)
}
}, {
key: "_onSiteMapperMatch",
value: function(e) {
log.debug("Mouse challenge mapper match - " + JSON.stringify(e)), e.timers && this.startHiding(e.timers)
}
}], [{
key: "createDiv",
value: function(e) {
var t = e.document || e.contentDocument,
n = t.createElement("div");
n.id = "coverDivMouse", n.style.cursor = "none", n.style.position = "fixed", n.style.top = 0, n.style.left = 0, n.style.width = "100%", n.style.height = "100%", n.style.zIndex = 2147483647, n.style.visibility = "hidden";
var i = t.body.firstChild;
t.body.insertBefore(n, i)
}
}, {
key: "removeDiv",
value: function(e) {
var t = e.document || e.contentDocument,
n = t.getElementById("coverDivMouse");
n && t.body.removeChild(n)
}
}]), r
}(), rt.MouseChallengeFeature = at, ot = Rn, ut = function(e) {
function a(e, t, n, i, s) {
Ln(this, a);
var r = An(this, (a.__proto__ || Object.getPrototypeOf(a)).call(this, i));
return r._configurationRepository = e, r._dataQueue = n, r._utils = t, r._onVideoPausedCallback = r._onVideoPauseEvent.bind(r), r._onVideoStartedCallback = r._onVideoStartedEvent.bind(r), r._onTouchCallback = r._onTouchEvent.bind(r), r._video = null, r._msgBus = s, r
}
return Pn(a, ot.Events), xn(a, [{
key: "startFeature",
value: function() {
var e = this._configurationRepository.get("videoSource") || "",
t = this._configurationRepository.get("videoUserAgentFilter") || "",
n = this._configurationRepository.get("maxAllowedVideoDurationSec") || 5;
this._shouldStartVideo(t) && (this._video = this._createVideoElement(e, n), this._video && (this._utils.addEventListener(this._video, "pause", this._onVideoPausedCallback), this._utils.addEventListener(this._video, "play", this._onVideoStartedCallback), this._msgBus.subscribe(ot.MessageBusEventType.TouchEvent, this._onTouchCallback)))
}
}, {
key: "stopFeature",
value: function() {
this._video && this._video.parentNode === document.body && (this._utils.removeEventListener(this._video, "pause", this._onVideoPausedCallback), this._utils.removeEventListener(this._video, "play", this._onVideoStartedCallback), document.body.removeChild(this._video), this._video = null)
}
}, {
key: "_shouldStartVideo",
value: function(e) {
return this._utils.matchRegEx(e, navigator.userAgent)
}
}, {
key: "_onVideoStartedEvent",
value: function() {
this._reportVideoEvent(!0)
}
}, {
key: "_onVideoPauseEvent",
value: function() {
this._reportVideoEvent(!1)
}
}, {
key: "_reportVideoEvent",
value: function(e) {
var t = this._utils.dateNow(),
n = this._utils.StorageUtils.getAndUpdateEventSequenceNumber();
this._dataQueue.addToQueue("video_events", [n, t, e])
}
}, {
key: "_createVideoElement",
value: function(e, t) {
var n = document.createElement("video");
return n.style.height = 0, n.style.width = 0, n.style.visibility = "hidden", n.src = e, n.zIndex = -1, n.display = "none", n.loop = !0, n.muted = !0, n.setAttribute("playsinline", "true"), n.duration > t && (log.warn("video duration of " + n.duration + " is higher the maximum of " + t), n = null), n
}
}, {
key: "_onTouchEvent",
value: function(e) {
if (null !== this._video && e.action === ot.EnumDefs.Events.touchEventType.touchstart) {
this._msgBus.unsubscribe(ot.MessageBusEventType.TouchEvent, this._onTouchCallback), document.body.appendChild(this._video), this._video.play();
var t = this._configurationRepository.get("videoPlaybackDurationSec") || 5;
setTimeout(this.stopFeature.bind(this), 1e3 * t)
}
}
}]), a
}(), ot.VideoEvents = ut, ct = Rn, ht = function() {
function i(e, t, n) {
Ln(this, i), this._framesCache = e, this._framesDetector = t, this._framesDetector.frameAdded.subscribe(this._onFrameAdded.bind(this)), this._framesDetector.frameRemoved.subscribe(this._onFrameRemoved.bind(this)), this._framesDetector.frameInaccessible.subscribe(this._onFrameInaccessible.bind(this)), this._featuresList = [], this._cdUtils = n, this._framesDetector.addToIgnoreList(ct.EnumDefs.SystemFrameName.rtcframe), this._framesDetector.addToIgnoreList(ct.EnumDefs.SystemFrameName.fontDetectionFrame), this._framesDetector.start(window.self), this._buildFramesCache()
}
return xn(i, [{
key: "startFeatures",
value: function(e) {
try {
if (this._buildFeaturesMap(e), 0 === this._featuresList.length) return;
log.debug("startFeatures:Running features on " + this._framesCache.count + " frames"), this._startFeaturesOnFrames(this._framesCache.frames, e)
} catch (t) {
log.debug("Failed to start features in FrameHandler.startFeatures: " + t.message, t)
}
}
}, {
key: "startFeature",
value: function(e) {
try {
this._featuresList.push(e), e.isRunning = !0, this._startFeaturesOnFrames(this._framesCache.frames, [e])
} catch (t) {
log.debug("Failed to start feature in FrameHandler.startFeature: " + t.message, t)
}
}
}, {
key: "stopFeatures",
value: function(e) {
try {
this._stopFeaturesOnFrames(e, this._framesCache.frames)
} catch (t) {
log.debug("Failed to stop features in FrameHandler.stopFeatures: " + t.message, t)
}
}
}, {
key: "stopFeature",
value: function(e) {
try {
e.isRunning = !1, this._stopFeaturesOnFrames([e], this._framesCache.frames)
} catch (t) {
log.debug("Failed to stop feature in FrameHandler.stopFeature: " + t.message, t)
}
}
}, {
key: "updateFeatureConfig",
value: function(e) {
e.instance.updateFeatureConfig && this._updateFeaturesConfigOnFrames([e], this._framesCache.frames)
}
}, {
key: "_onFrameAdded",
value: function(e) {
try {
log.debug("Frame:" + e.name + ", id:" + e.id + ". was loaded."), this._framesCache.exists(e) ? this._framesCache.unRegisterFrameFeatures(e, this._featuresList) : this._framesCache.add(e), this._startFeaturesOnFrames([e], this._featuresList)
} catch (t) {
log.warn("Failed to start features on frame " + e.id + ": " + t.message, t)
}
}
}, {
key: "_onFrameRemoved",
value: function(e) {
try {
log.debug("Frame:" + e.name + ", id:" + e.id + ". was removed."), this._stopFeaturesOnFrames(this._featuresList, [e])
} catch (t) {
log.warn("Failed to stop features on frame " + e.id + ": " + t.message, t)
}
}
}, {
key: "_onFrameInaccessible",
value: function(e) {
log.debug("Frame:" + e.name + ", id:" + e.id + ". was detected as inaccessible.")
}
}, {
key: "_buildFeaturesMap",
value: function(e) {
var t = this;
this._featuresList = [], e.forEach(function(e) {
t._featuresList.push(e)
})
}
}, {
key: "_buildFramesCache",
value: function() {
var t = this;
this._framesDetector.frames.forEach(function(e) {
t._framesCache.exists(e) || t._framesCache.add(e)
})
}
}, {
key: "_startFeaturesOnFrames",
value: function(e, s) {
var r = this;
e.forEach(function(e) {
try {
if (!r._cdUtils.DomUtils.canAccessIFrame(e)) return;
for (var t = 0; t < s.length; t++) {
var n = s[t];
n.shouldRun && !r._framesCache.hasFeature(e, n) && (r._framesCache.registerFrameFeature(e, n),
ct.CDUtils.DomUtils.isWindowDocumentReady(e.contentWindow) && (log.debug("_startFeaturesOnFrames: run feature on frame:" + e.name + ", id:" + e.id + ". feature:" + n.configKey), r._runFeatureOnFrame.cdCallAsync(r, e, n), n.isRunning = !0))
}
} catch (i) {
log.error("An error has occurred while starting features on frame " + e.name + " with id: " + e.id + ". Error: " + i.message, i)
}
})
}
}, {
key: "_runFeatureOnFrame",
value: function(e, t) {
try {
this._cdUtils.DomUtils.canAccessIFrame(e) ? t.instance.startFeature(e.contentWindow) : log.debug("Not starting features on frame " + e.name + " with id: " + e.id + " as it is not accessible")
} catch (n) {
log.error("An error has occurred while starting feature " + t.configKey + " on frame " + e.name + " with id: " + e.id + ". Error: " + n.message, n)
}
}
}, {
key: "_stopFeaturesOnFrames",
value: function(s, e) {
var r = this;
try {
e.forEach(function(e) {
try {
if (!r._cdUtils.DomUtils.canAccessIFrame(e)) return;
if (e.contentWindow && e.contentWindow.document)
for (var t = 0, n = s.length; t < n; t++) r._framesCache.hasFeature(e, s[t]) && r._stopFeatureOnFrame.cdCallAsync(r, e, s[t]), s[t].isRunning = !1
} catch (i) {
log.error("An error has occurred while stopping features on frame " + e.name + " with id: " + e.id + ". Error: " + i.message, i)
}
r._framesCache.exists(e) && r._framesCache.unRegisterFrameFeatures(e, s), r._framesCache.remove(e)
})
} catch (t) {
log.warn("Failed stopping features on frames " + t.message, t)
}
}
}, {
key: "_stopFeatureOnFrame",
value: function(e, t) {
try {
this._cdUtils.DomUtils.canAccessIFrame(e) ? t.instance.stopFeature(e.contentWindow) : log.debug("Not stopping feature " + t.configKey + " on frame " + e.name + " with id: " + e.id + " as it is not accessible")
} catch (n) {
log.error("An error has occurred while stopping feature " + t.configKey + " " + func + " on frame " + e.name + " with id: " + e.id + ". Error: " + n.message, n)
}
}
}, {
key: "_updateFeaturesConfigOnFrames",
value: function(s, e) {
var r = this;
e.forEach(function(e) {
try {
if (!r._cdUtils.DomUtils.canAccessIFrame(e)) return;
for (var t = 0, n = s.length; t < n; t++) r._framesCache.hasFeature(e, s[t]) && r._updateFeatureConfigOnFrame.cdCallAsync(r, e, s[t])
} catch (i) {
log.error("An error has occurred while updating features configuration on frame " + e.name + " with id: " + e.id + ". Error: " + i.message, i)
}
})
}
}, {
key: "_updateFeatureConfigOnFrame",
value: function(e, t) {
try {
this._cdUtils.DomUtils.canAccessIFrame(e) ? t.instance.updateFeatureConfig(e.contentWindow) : log.debug("Not updating feature " + t.configKey + " config on frame " + e.name + " with id: " + e.id + " as it is not accessible")
} catch (n) {
log.error("An error has occurred while updating feature " + t.configKey + " config on frame " + e.name + " with id: " + e.id + ". Error: " + n.message, n)
}
}
}]), i
}(), ct.FramesHandler = ht, lt = Rn, dt = function() {
function e() {
Ln(this, e), this._frames = new lt.Map
}
return xn(e, [{
key: "add",
value: function(e) {
this._frames.set(e, {
registered: !0,
features: new lt.Map
})
}
}, {
key: "remove",
value: function(e) {
this.exists(e) && 0 === this._frames.get(e).features.size && this._frames["delete"](e)
}
}, {
key: "get",
value: function(e) {
return this._frames.get(e)
}
}, {
key: "exists",
value: function(e) {
return this._frames.has(e) && this._frames.get(e).registered
}
}, {
key: "registerFrameFeature",
value: function(e, t) {
this.exists(e) && this._frames.get(e).features.set(t.configKey, !0)
}
}, {
key: "unRegisterFrameFeature",
value: function(e, t) {
this.exists(e, t) && this._frames.get(e).features["delete"](t.configKey)
}
}, {
key: "unRegisterFrameFeatures",
value: function(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
this.unRegisterFrameFeature(e, i)
}
}
}, {
key: "hasFeature",
value: function(e, t) {
return this.exists(e) && this._frames.get(e).features.has(t.configKey)
}
}, {
key: "frames",
get: function() {
var n = [];
return this._frames.forEach(function(e, t) {
n.push(t)
}), n
}
}, {
key: "count",
get: function() {
return this._frames.size
}
}]), e
}(), lt.FramesCache = dt, ft = Rn, _t = function() {
function n(e, t) {
Ln(this, n), this._mutationObserverFactory = e, this._cdUtils = t, this._windowMutationObservers = new ft.Map, this._loadedFrames = new ft.Map, this._framesToIgnore = new ft.Set, this._frameSelector = "frame, iframe", this._frameLoadedCallback = this._onFrameLoad.bind(this), this.frameAdded = new ft.CDEvent, this.frameRemoved = new ft.CDEvent, this.frameInaccessible = new ft.CDEvent
}
return xn(n, [{
key: "start",
value: function(e) {
var t = this;
this._monitorWindow(e), this._findFrames(e.document).forEach(function(e) {
t._processNewFrame(e)
})
}
}, {
key: "stop",
value: function() {
this._windowMutationObservers.forEach(function(e) {
e.disconnect()
}), this._windowMutationObservers.clear(), this._loadedFrames.clear(), this._framesToIgnore.clear()
}
}, {
key: "addToIgnoreList",
value: function(e) {
this._framesToIgnore.add(e)
}
}, {
key: "_monitorWindow",
value: function(e) {
if (!this._windowMutationObservers.has(e)) {
var t = new this._mutationObserverFactory(this._mutationObserved.bind(this));
t.observe(e.document, {
childList: !0,
subtree: !0
}), this._windowMutationObservers.set(e, t)
}
}
}, {
key: "_unMonitorWindow",
value: function(e) {
var t = this._windowMutationObservers.get(e);
t && t.disconnect(), this._windowMutationObservers["delete"](e)
}
}, {
key: "_mutationObserved",
value: function(e) {
var t = this;
e.forEach(function(e) {
t._processMutation(e)
})
}
}, {
key: "_processMutation",
value: function(e) {
this._processAddedNodes(e.addedNodes), this._processRemovedNodes(e.removedNodes)
}
}, {
key: "_processAddedNodes",
value: function(e) {
for (var t = this, n = 0; n < e.length; n++) {
var i = e[n];
if (this._cdUtils.DomUtils.matches(i, this._frameSelector)) this._processNewFrame(i);
else {
if (!i.hasChildNodes()) continue;
this._findFrames(i).forEach(function(e) {
t._processNewFrame(e)
})
}
}
}
}, {
key: "_processNewFrame",
value: function(e) {
this._framesToIgnore.has(e.id) || this._loadedFrames.has(e) || (this._cdUtils.addEventListener(e, "load", this._frameLoadedCallback), this._cdUtils.DomUtils.canAccessIFrame(e) ? this._cdUtils.DomUtils.isWindowDocumentReady(e.contentWindow) && this._addFrame(e) : this.frameInaccessible.publish(e))
}
}, {
key: "_addFrame",
value: function(e) {
var t = this;
this._monitorWindow(e.contentWindow), this._findFrames(e.contentWindow.document).forEach(function(e) {
t._processNewFrame(e)
}), this._loadedFrames.set(e, e.contentDocument), this.frameAdded.publish(e)
}
}, {
key: "_processRemovedNodes",
value: function(e) {
for (var t = this, n = 0; n < e.length; n++) {
var i = e[n];
if (this._cdUtils.DomUtils.matches(i, this._frameSelector)) this._removeFrame(i);
else {
if (!i.hasChildNodes()) continue;
this._findFrames(i).forEach(function(e) {
t._removeFrame(e)
})
}
}
}
}, {
key: "_removeFrame",
value: function(e) {
this._unMonitorWindow(e.contentWindow), this._cdUtils.removeEventListener(e, "load", this._frameLoadedCallback), this._loadedFrames["delete"](e) && this.frameRemoved.publish(e)
}
}, {
key: "_onFrameLoad",
value: function(e) {
var t = e.target;
this._loadedFrames.has(t) && this._removeFrame(t), this._processNewFrame(t)
}
}, {
key: "_findFrames",
value: function(e) {
for (var t = [], n = [], i = e.querySelectorAll(this._frameSelector), s = 0; s < i.length; s++) n.push(i[s]);
for (var r = 0; r < n.length; r++) {
var a, o = n[r];
t.push(o), this._cdUtils.DomUtils.canAccessIFrame(o) ? 0 < (a = this._findFrames(o.contentWindow.document)).length && (t = t.concat(a)) : this.frameInaccessible.publish(o)
}
return t
}
}, {
key: "frames",
get: function() {
var n = [];
return this._loadedFrames.forEach(function(e, t) {
n.push(t)
}), n
}
}]), n
}(), ft.FramesDetector = _t, (pt = Rn).FeaturesList = {
defaultFeatures: {
MouseEvents: {
configKey: "isMouseEvents",
shouldRun: !0,
isFrameRelated: !0,
runInUns: !1,
runInSlave: !0,
isRunning: !1,
init: function() {
this._features.defaultFeatures.MouseEvents.instance = new pt.MouseEvents(this._utils, this._elements, this._dataQ, this._perfMonitor)
},
instance: null
},
KeyEvents: {
configKey: "isKeyEvents",
shouldRun: !0,
isFrameRelated: !0,
runInUns: !1,
runInSlave: !0,
isRunning: !1,
init: function() {
this._features.defaultFeatures.KeyEvents.instance = new pt.KeyEvents(this._configurationRepository, this._utils, this._elements, this._dataQ, this._perfMonitor, this._msgBus)
},
instance: null
},
TouchEvents: {
configKey: "isTouchEvents",
shouldRun: !0,
isFrameRelated: !0,
runInUns: !1,
runInSlave: !0,
isRunning: !1,
init: function() {
this._features.defaultFeatures.TouchEvents.instance = new pt.TouchEvents(this._utils, this._elements, this._dataQ, this._perfMonitor, this._msgBus)
},
instance: null
},
MetadataCollector: {
configKey: "isMetadataCollect",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
runInSlave: !0,
isRunning: !1,
init: function() {
var e = new pt.SiteMapper(MutationObserver, this._utils, "metadataConfig", null, !1);
this._features.defaultFeatures.MetadataCollector.instance = new pt.MetadataCollector(this._configurationRepository, this._dataQ, this._perfMonitor, e)
},
instance: null
},
TabsEvents: {
configKey: "isTabsEvents",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
runInSlave: !1,
isRunning: !1,
init: function() {
this._features.defaultFeatures.TabsEvents.instance = new pt.TabsEvents(this._utils, this._dataQ)
},
instance: null
}
},
perSessionFeatures: {
DoNotTrack: {
configKey: "isDoNotTrack",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !0,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.DoNotTrack.instance = new pt.DoNotTrackFeature(this._dataQ, this._perfMonitor)
},
instance: null
},
BrowserProps: {
configKey: "collectBrowserProps",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !0,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.BrowserProps.instance = new pt.BrowserPropsFeature(this._dataQ, this._perfMonitor, pt.PointerHoverDetector, this._utils, this._configurationRepository)
},
instance: null
},
IsPrivateBrowsing: {
configKey: "isPrivateBrowsing",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !0,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.IsPrivateBrowsing.instance = new pt.IsPrivateBrowsingFeature(this._dataQ, this._perfMonitor, new pt.PrivateBrowsingDetector)
},
instance: null
},
IpDetectorFeature: {
configKey: "isIpCollection",
shouldRun: !0,
isFrameRelated: !1,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.IpDetectorFeature.instance = new pt.IpDetectorFeature(this._dataQ, this._perfMonitor, this._configurationRepository)
},
instance: null
},
FontsDetectionFeature: {
configKey: "isFonts",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !0,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.FontsDetectionFeature.instance = new pt.FontsDetectionFeature(this._utils, this._dataQ, this._perfMonitor, pt.FontsDetector)
},
instance: null
},
GraphicDetectFeature: {
configKey: "isVMDetection",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.GraphicDetectFeature.instance = new pt.GraphicDetectFeature(this._dataQ, this._perfMonitor)
},
instance: null
},
AudioFeature: {
configKey: "isAudioDetection",
shouldRun: !1,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.AudioFeature.instance = new pt.AudioFeature(this._utils, this._dataQ, this._perfMonitor)
},
instance: null
},
BrowserDetect: {
configKey: "isBrowserDetect",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !0,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.BrowserDetect.instance = new pt.BrowserDetect(this._dataQ, this._perfMonitor)
},
instance: null
},
FilesFeature: {
configKey: "isFilesFeature",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.FilesFeature.instance = new pt.FilesFeature(this._configurationRepository, this._utils, this._sessionService, this._muidMgr, this._perfMonitor, this._cidCache)
},
instance: null
},
UserPermissions: {
configKey: "isUserPermissions",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.UserPermissions.instance = new pt.UserPermissions(this._dataQ, this._perfMonitor)
},
instance: null
},
MediaDevicesFeature: {
configKey: "isMediaDevices",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.perSessionFeatures.MediaDevicesFeature.instance = new pt.MediaDevicesFeature(this._dataQ, this._perfMonitor)
},
instance: null
}
},
perContextFeatures: {
ContextPropsFeature: {
configKey: "isContextPropsFeature",
shouldRun: !0,
isFrameRelated: !1,
isRunning: !1,
runInUns: !0,
init: function() {
this._features.perContextFeatures.ContextPropsFeature.instance = new pt.ContextPropsFeature(this._dataQ, this._perfMonitor, this._utils)
},
instance: null
},
ScriptsFeature: {
configKey: "isScriptsFeature",
shouldRun: !0,
isFrameRelated: !1,
isRunning: !1,
runInUns: !0,
init: function() {
this._features.perContextFeatures.ScriptsFeature.instance = new pt.ScriptsFeature(this._dataQ, this._scriptsRepository, this._perfMonitor)
},
instance: null
}
},
perPageReloadFeatures: {},
nonDefaultFeatures: {
AccelerometerEvents: {
configKey: "isAccelerometerEvents",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.AccelerometerEvents.instance = new pt.AccelerometerEvents(this._configurationRepository, this._utils, this._sensorDataQ, this._perfMonitor)
},
instance: null
},
PinchZoomEvents: {
configKey: "isPinchZoomEvents",
shouldRun: !0,
isFrameRelated: !0,
runInUns: !1,
runInSlave: !0,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.PinchZoomEvents.instance = new pt.PinchZoomEvents(this._utils, this._elements, this._dataQ, this._perfMonitor, this._msgBus)
},
instance: null
},
ScriptEvents: {
configKey: "isScriptExecuteEve",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.ScriptEvents.instance = new pt.ScriptEvents(this._utils, this._dataQ, this._perfMonitor)
},
instance: null
},
MouseChallengeFeature: {
configKey: "isChallengeFeature",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
var e = new pt.SiteMapper(MutationObserver, this._utils, "challengeConfig");
this._features.nonDefaultFeatures.MouseChallengeFeature.instance = new pt.MouseChallengeFeature(this._configurationRepository, this._utils, this._dataQ, e)
},
instance: null
},
NetInfoEvents: {
configKey: "isNetInfoEvents",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.NetInfoEvents.instance = new pt.NetInfoEvents(this._utils, this._dataQ, this._perfMonitor)
},
instance: null
},
ScreenOrientationEvents: {
configKey: "isScreenOrientationEvents",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.ScreenOrientationEvents.instance = new pt.ScreenOrientationEvents(this._utils, this._dataQ, this._perfMonitor)
},
instance: null
},
TapEvents: {
configKey: "isTapEvents",
shouldRun: !0,
isFrameRelated: !0,
runInUns: !1,
runInSlave: !0,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.TapEvents.instance = new pt.TapEvents(this._configurationRepository, this._utils, this._elements, this._dataQ, this._perfMonitor)
},
instance: null
},
VideoEvents: {
configKey: "isVideoEvents",
shouldRun: !1,
isFrameRelated: !1,
runInUns: !1,
runInSlave: !1,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.VideoEvents.instance = new pt.VideoEvents(this._configurationRepository, this._utils, this._dataQ, this._perfMonitor, this._msgBus)
},
instance: null
},
StorageEvents: {
configKey: "isStorageEvents",
shouldRun: !1,
isFrameRelated: !1,
runInUns: !1,
runInSlave: !1,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.StorageEvents.instance = new pt.StorageEvents(this._utils, this._elements, this._dataQ, this._perfMonitor, this._msgBus)
},
instance: null
},
PrintEvents: {
configKey: "isPrintEvents",
shouldRun: !1,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.PrintEvents.instance = new pt.PrintEvents(this._utils, this._dataQ, this._perfMonitor)
},
instance: null
},
HistoryNavigationEvents: {
configKey: "isHistoryNavigationEvent",
shouldRun: !1,
isFrameRelated: !1,
runInUns: !1,
runInSlave: !1,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.HistoryNavigationEvents.instance = new pt.HistoryNavigationEvents(this._dataQ, this._perfMonitor)
},
instance: null
},
LightSensorEvents: {
configKey: "isLightSensor",
shouldRun: !1,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
init: function() {
this._features.nonDefaultFeatures.LightSensorEvents.instance = new pt.LightSensorEvents(this._dataQ, this._configurationRepository)
},
instance: null
}
}
}, gt = Rn, vt = function() {
function i(e, t, n) {
Ln(this, i), this._features = e, this._frameHandler = t, this._configurationRepository = n, this.buildFrameRelatedLists()
}
return xn(i, [{
key: "buildFrameRelatedLists",
value: function() {
this._frameRelatedDefaultFeatures = this._collectFrameRelated(this._features.defaultFeatures), this._frameRelatedNonDefaultFeatures = this._collectFrameRelated(this._features.nonDefaultFeatures)
}
}, {
key: "runDefault",
value: function() {
log.info("Running default features"), this._runFeatures(this._features.defaultFeatures, this._frameRelatedDefaultFeatures)
}
}, {
key: "stopDefault",
value: function() {
log.info("Stopping default features"), this._stopFeatures(this._features.defaultFeatures, this._frameRelatedDefaultFeatures)
}
}, {
key: "runPerSessionFeatures",
value: function() {
log.info("Running per session features"), this._configurationRepository.isConfigurationUpdatedFromServer() ? this._startFeatures(this._features.perSessionFeatures) : log.info("We didn't receive configurations from the server yet. Skipping per session features start until configuration arrives.")
}
}, {
key: "stopPerSessionFeatures",
value: function() {
log.info("Stopping per session features"), this._stopFeatures(this._features.perSessionFeatures)
}
}, {
key: "runNonDefault",
value: function() {
log.info("Running non default features"), this._configurationRepository.isConfigurationUpdatedFromServer() ? this._runFeatures(this._features.nonDefaultFeatures, this._frameRelatedNonDefaultFeatures) : log.info("We didn't receive configurations from the server yet. Skipping non default features start until configuration arrives.")
}
}, {
key: "stopNonDefault",
value: function() {
log.info("Stopping non default features"), this._stopFeatures(this._features.nonDefaultFeatures, this._frameRelatedNonDefaultFeatures)
}
}, {
key: "runPerContextFeatures",
value: function(e) {
log.info("Running per context features"), this._configurationRepository.isConfigurationUpdatedFromServer() ? (this._runFeatures(this._features.perContextFeatures), "cd_auto" !== e.name && this._frameRelatedDefaultFeatures && this._frameHandler.startFeatures(this._frameRelatedDefaultFeatures)) : log.info("We didn't receive configurations from the server yet. Skipping per context features start until configuration arrives.")
}
}, {
key: "stopPerContextFeatures",
value: function() {
log.info("Stopping per context features"), this._stopFeatures(this._features.perContextFeatures)
}
}, {
key: "stopAllFeatures",
value: function() {
log.info("Stopping all features"), this.stopDefault(), this.stopNonDefault(), this.stopPerSessionFeatures(), this.stopPerContextFeatures()
}
}, {
key: "updateRunByConfig",
value: function(e) {
log.info("Updating features configuration"), this._updateFeatures(this._features.defaultFeatures, e), this._updateFeatures(this._features.nonDefaultFeatures, e), this._updateFeatures(this._features.perContextFeatures, e)
}
}, {
key: "_runFeatures",
value: function(e, t) {
var n = this;
for (var i in e) e.hasOwnProperty(i) && e[i].shouldRun && !e[i].isFrameRelated && (e[i].instance.startFeature.cdCallAsync(e[i].instance, window.self), e[i].isRunning = !0);
if (t) {
for (var s = 0, r = t.length; s < r; s++) t[s].shouldRun && (t[s].instance.startFeature.cdCallAsync(t[s].instance, window.self), t[s].isRunning = !0);
this._frameHandler.startFeatures(t), gt.CDUtils.DomUtils.onPageLoad(window, function() {
n._frameHandler.startFeatures(t)
})
}
}
}, {
key: "_stopFeatures",
value: function(e, t) {
for (var n in e) e.hasOwnProperty(n) && (e[n].isFrameRelated || (e[n].instance.stopFeature && e[n].instance.stopFeature.cdCallAsync(e[n].instance), e[n].isRunning = !1));
if (t) {
for (var i = 0, s = t.length; i < s; i++) t[i].instance.stopFeature.cdCallAsync(t[i].instance), t[i].isRunning = !1;
this._frameHandler.stopFeatures(t)
}
}
}, {
key: "_actOnFeature",
value: function(e, t) {
e.isFrameRelated && this._frameHandler[t](e), e.instance[t] && e.instance[t].cdCallAsync(e.instance)
}
}, {
key: "_startFeatures",
value: function(e) {
for (var t in e) {
var n = e[t],
i = this._configurationRepository.get(n.configKey);
"boolean" == typeof i && (n.shouldRun = i), n.shouldRun && (this._actOnFeature(n, "startFeature"), n.isRunning = !0)
}
}
}, {
key: "_updateFeatures",
value: function(e, t) {
for (var n in e)
if (e.hasOwnProperty(n)) {
var i = e[n],
s = t.get(i.configKey);
"boolean" == typeof s && (i.shouldRun = s), i.isRunning && !i.shouldRun ? (this._actOnFeature(i, "stopFeature"), i.isRunning = !1) : !i.isRunning && i.shouldRun && (this._actOnFeature(i, "startFeature"), i.isRunning = !0), i.isRunning && this._actOnFeature(i, "updateFeatureConfig")
}
}
}, {
key: "_collectFrameRelated",
value: function(e) {
var t = [];
for (var n in e) e.hasOwnProperty(n) && e[n].isFrameRelated && t.push(e[n]);
return t
}
}]), i
}(), gt.FeatureService = vt,
function(e) {
function i(e, t, n, i, s, r, a, o, u, c, h, l, d) {
this._features = e, this._configurationRepository = t, this._utils = n, this._elements = i, this._mutationObserver = s, this._dataQ = r, this._sessionService = a, this._muidMgr = o, this._perfMonitor = u, this._sensorDataQ = c, this._msgBus = h, this._scriptsRepository = l, this._cidCache = d
}
Object.extend(i, {
BUILD_DEFAULT_ONLY: 1,
BUILD_NON_DEFAULT_ONLY: 2,
BUILD_PER_SESSION_ONLY: 4,
BUILD_PER_PAGE_RELOAD_ONLY: 8,
BUILD_PER_CONTEXT_ONLY: 16
}), i.BUILD_ALL = i.BUILD_DEFAULT_ONLY | i.BUILD_NON_DEFAULT_ONLY | i.BUILD_PER_SESSION_ONLY | i.BUILD_PER_PAGE_RELOAD_ONLY | i.BUILD_PER_CONTEXT_ONLY, i.prototype.buildFeatures = function(e) {
function t(e) {
for (var t in e) e.hasOwnProperty(t) && e[t].init.apply(n)
}
var n = this;
e & i.BUILD_DEFAULT_ONLY && t(this._features.defaultFeatures), e & i.BUILD_PER_SESSION_ONLY && t(this._features.perSessionFeatures), e & i.BUILD_NON_DEFAULT_ONLY && t(this._features.nonDefaultFeatures), e & i.BUILD_PER_PAGE_RELOAD_ONLY && t(this._features.perPageReloadFeatures), e & i.BUILD_PER_CONTEXT_ONLY && t(this._features.perContextFeatures)
}, e.FeaturesBuilder = i
}(Rn), mt = Rn, yt = function() {
function i(e, t, n) {
Ln(this, i), this._utils = e, this._contextSiteMapper = t, this.contextName = "", this.referrer = "", this.historyLen = -1, this.onContextChange = new mt.CDEvent, this._contextSiteMapper.updateObserver(this.onSiteMapperMatch.bind(this)), this._workerComm = n
}
return xn(i, [{
key: "contextData",
value: function() {
return {
contextId: this.contextId,
url: this.url,
name: this.contextName,
referrer: this.referrer,
hLength: this.historyLen,
timestamp: this.timestamp
}
}
}, {
key: "setContext",
value: function(e) {
this.contextName = e.name, this._genContext(), this.url = e.url, this.referrer = e.referrer, this.historyLen = e.hLength, this.timestamp = e.timestamp, this._publishContext()
}
}, {
key: "changeContext",
value: function(e) {
e ? e !== this.contextName ? (this.contextName = e, this._updateContext(), this._publishContext(), log.info("Context changed to " + e)) : log.warn("Received context " + e + " but this is already the current context. Aborting operation.") : log.error("Received an invalid context name " + e + ". Aborting context change operation")
}
}, {
key: "onSiteMapperMatch",
value: function(e) {
e.contextName !== this.contextName && this.changeContext(e.contextName)
}
}, {
key: "_updateContext",
value: function() {
this._genContext(), this.url = this._utils.getDocUrl(), this.referrer = mt.CDUtils.clearTextFromNumbers(document.referrer), this.historyLen = window.history.length, this.timestamp = this._utils.dateNow()
}
}, {
key: "_genContext",
value: function() {
this.contextId = this._utils.StorageUtils.getCookie("cdContextId"), this.contextId ? this.contextId = parseInt(this.contextId) : this.contextId = 0, this._utils.StorageUtils.setCookie("cdContextId", this.contextId + 1)
}
}, {
key: "_publishContext",
value: function() {
var e = {
contextName: this.contextName
};
this._workerComm.sendAsync(mt.WorkerCommand.changeContextCommand, e), this.onContextChange.publish(this.contextData())
}
}, {
key: "initContextHandling",
value: function() {
this._contextSiteMapper.initTracking()
}
}, {
key: "clearContextHandling",
value: function() {
this._contextSiteMapper.stopTracking()
}
}, {
key: "onConfigUpdate",
value: function(e) {
this._contextSiteMapper.onConfigUpdate(e)
}
}, {
key: "onSessionReset",
value: function() {
this._publishContext()
}
}]), i
}(), mt.ContextMgr = yt, wt = Rn, (St = function() {
function n(e, t) {
Ln(this, n), this._contextMgr = e, this._dataQ = t, this._contextMgr.onContextChange.subscribe(this.sendContextToServer.bind(this)), this.handleContextChange({
context: "cd_auto"
})
}
return xn(n, [{
key: "handleContextChange",
value: function(e) {
this._contextMgr.changeContext(e.context || e.activityType)
}
}, {
key: "sendContextToServer",
value: function(e) {
e && this._dataQ.addToQueue("contextChange", [null, e.url, e.name, e.timestamp, e.referrer, e.hLength])
}
}]), n
}()).apiName = "ContextChange", wt.ContextApiHandler = St, bt = Rn, (Et = function(e) {
function s(e, t, n) {
Ln(this, s);
var i = An(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this, t, n));
return i._configurationRepository = e, i._isEnabled = i._configurationRepository.get("isCustMetadata"), i
}
return Pn(s, bt.AbstractFeature), xn(s, [{
key: "onCustomerMetadata",
value: function(e) {
this._isEnabled != undefined && null != this._isEnabled && 1 != this._isEnabled || (log.debug("HandleMetadata:onCustomerMetadata. data=" + JSON.stringify(e.data)), e.data && this._dataQ.addToQueue("customer_metadata", [null, e.data]))
}
}, {
key: "onConfigUpdate",
value: function() {
this._isEnabled = this._configurationRepository.get("isCustMetadata")
}
}]), s
}()).apiName = "cdCustomerMetadata", bt.HandleMetadata = Et, kt = Rn, Ct = function() {
function n(e, t) {
Ln(this, n), this._pauseResumeMgr = e, this._messageBus = t, this._createCommandToBusMessageMapping()
}
return xn(n, [{
key: "enableApi",
value: function() {
log.info("Enabling api calls"), this._onApiMessageBinded = this._onApiMessage.bind(this), kt.CDUtils.addEventListener(window, "message", this._onApiMessageBinded, !0)
}
}, {
key: "disableApi",
value: function() {
log.info("Disabling api calls"), kt.CDUtils.removeEventListener(window, "message", this._onApiMessageBinded, !0)
}
}, {
key: "getCustomerSessionID",
value: function(t) {
kt.CustomerApiBridge._getFromApiOrEmpty("getCustomerSessionID", function(e) {
t(e)
})
}
}, {
key: "getLogServerAddress",
value: function(t) {
kt.CustomerApiBridge._getFromApiOrEmpty("getLogServerAddress", function(e) {
t(e)
})
}
}, {
key: "getServerAddress",
value: function(s) {
kt.CustomerApiBridge._getFromApiOrEmpty("getCustomerConfigLocation", function(e) {
!e || -1 < e.indexOf("wup") ? s(e) : (log.debug("CustomerApiBridge:getServerAddress: getting customer configuration file, url= " + e), kt.CDUtils.getPostUrl(e, "GET", null, function(e) {
try {
var t = JSON.parse(e),
n = t.serverAddress;
n ? n.indexOf("cid") < 0 && (n += "cid=" + t.customerId) : (log.error("CustomerApiBridge:getServerAddress - no server address in response"), n = ""), s(n)
} catch (i) {
log.error("CustomerApiBridge:getServerAddress - error getting server address: " + i.message)
}
}, function() {
log.error("CustomerApiBridge:getServerAddress - failed getting configuration file"), s("")
}, !1))
})
}
}, {
key: "notifySessionReset",
value: function(e) {
this._pauseResumeMgr.isCustomerApiEnabled() && window.postMessage({
type: "SNumNotification",
cdSNum: e
}, window.location.href)
}
}, {
key: "isApiAvailable",
value: function(e) {
return !!window.cdApi && !!window.cdApi[e]
}
}, {
key: "_onApiMessage",
value: function(e) {
var t = e.data,
n = t.type;
if (n === undefined) try {
n = (t = JSON.parse(t)).type
} catch (i) {}(n === kt.ApiCommandType.ChangeStateCommand || this._pauseResumeMgr.isCustomerApiEnabled() && this._apiCommandToBusMessageMapping[n]) && (e.preventDefault && e.preventDefault(), e.stopPropagation && e.stopPropagation(), this._messageBus.publish(this._apiCommandToBusMessageMapping[n], t))
}
}, {
key: "_createCommandToBusMessageMapping",
value: function() {
this._apiCommandToBusMessageMapping = {}, this._apiCommandToBusMessageMapping[kt.ApiCommandType.ContextChangeCommand] = kt.MessageBusEventType.ApiContextChangeEvent, this._apiCommandToBusMessageMapping[kt.ApiCommandType.ResetSessionCommand] = kt.MessageBusEventType.ApiResetSessionEvent, this._apiCommandToBusMessageMapping[kt.ApiCommandType.CustomerMetadataCommand] = kt.MessageBusEventType.ApiCustomerMetadataEvent, this._apiCommandToBusMessageMapping[kt.ApiCommandType.ChangeStateCommand] = kt.MessageBusEventType.ApiChangeStateEvent, this._apiCommandToBusMessageMapping[kt.ApiCommandType.SetCsidCommand] = kt.MessageBusEventType.ApiSetCsidEvent, this._apiCommandToBusMessageMapping[kt.ApiCommandType.SetPsidCommand] = kt.MessageBusEventType.ApiSetPsidEvent
}
}], [{
key: "_getFromApiOrEmpty",
value: function(e, t) {
var n = 2 < arguments.length && arguments[2] !== undefined ? arguments[2] : 0;
if (!window.cdApi) return 20 <= n ? void log.error("Failed getting cdApi after all retries.") : (0 === n && log.warn("cdApi not found in retry " + n), n++, void setTimeout(this._getFromApiOrEmpty.bind(this, e, t, n), 100));
if (!window.cdApi[e]) return log.warn("User did not implement cdApi method: " + e), void t("");
try {
window.cdApi[e](t)
} catch (i) {
throw log.error("An error has occurred while calling cdApi " + e + " function. Exception was thrown from client implementation.", i), i
}
}
}]), n
}(), kt.CustomerApiBridge = Ct, Tt = Rn, Mt = function() {
function e() {
Ln(this, e)
}
return xn(e, [{
key: "publishNewSessionStartedEvent",
value: function(e) {
window.postMessage({
type: Tt.ApiEventType.NewSessionStartedEvent,
event: {
sessionID: e
}
}, window.location.href)
}
}, {
key: "publishStateChangedEvent",
value: function(e) {
window.postMessage({
type: Tt.ApiEventType.StateChangedEvent,
event: {
state: e
}
}, window.location.href)
}
}]), e
}(), Tt.ClientEventService = Mt, Rn.ApiCommandType = {
ContextChangeCommand: "ContextChange",
ResetSessionCommand: "ResetSession",
CustomerMetadataCommand: "cdCustomerMetadata",
ChangeStateCommand: "cdChangeState",
SetCsidCommand: "cdSetCsid",
SetPsidCommand: "cdSetPsid"
}, Rn.ApiEventType = {
NewSessionStartedEvent: "cdNewSessionStartedEvent",
StateChangedEvent: "cdStateChangedEvent"
}, Dt = Rn, Rt = function() {
function s(e, t, n, i) {
if (Ln(this, s), !t) throw new Error("messageBus param must be defined");
this._configurationLoadedCallback = null, this._configurationRepository = e, this._messageBus = t, this._cidCache = n, i && i.addMessageListener(Dt.WorkerEvent.ConfigurationLoadedEvent, this._onConfigurationLoadedEvent.bind(this))
}
return xn(s, [{
key: "updateLogUrlToWorker",
value: function(e, t, n, i) {
if (i && this._configurationRepository.set("logAddress", i), this._configurationRepository.get("logAddress")) {
var s = {
logAddress: this._configurationRepository.get("logAddress") + "?cid=" + this._cidCache.get() + "&cdsnum=" + e + "&csid=" + t + "&ds=js&sdkVer=" + Dt.CDUtils.scriptVersion
};
n.sendAsync(Dt.WorkerCommand.updateLogUrlCommand, s)
}
}
}, {
key: "setServerUrl",
value: function(e) {
this._configurationRepository.set("serverAddress", e);
var t = e.indexOf("cid=") + 4,
n = e.indexOf("&", t);
n = -1 == n ? undefined : n, this._cidCache.set(e.substring(t, n))
}
}, {
key: "setConfigurationLoadedCallback",
value: function(e) {
this._configurationLoadedCallback = e
}
}, {
key: "_onConfigurationLoadedEvent",
value: function(e) {
this._configurationRepository.loadConfigurations(e), this._configurationLoadedCallback && this._configurationLoadedCallback(this._configurationRepository.get(Dt.ConfigurationFields.isEnabled)), this._messageBus.publish(Dt.MessageBusEventType.ConfigurationLoadedEvent, this._configurationRepository)
}
}]), s
}(), Dt.ConfigurationService = Rt,
function(t) {
t.ConfigurationFields = {
resetSessionApiThreshold: "resetSessionApiThreshold",
dataWupDispatchRateSettings: "dataWupDispatchRateSettings",
logWupDispatchRateSettings: "logWupDispatchRateSettings",
forceDynamicDataWupDispatchSettings: "forceDynamicDataWupDispatchSettings",
wupStatisticsLogIntervalMs: "wupStatisticsLogIntervalMs",
serverCommunicationSettings: "serverCommunicationSettings",
wupResponseTimeout: "wupResponseTimeout",
wupMessageRequestTimeout: "wupMessageRequestTimeout",
logMessageRequestTimeout: "logMessageRequestTimeout",
collectKeyRegionValue: "collectKeyRegionValue",
ipDetectorTimeout: "ipDetectorTimeout",
crossDomainsList: "crossDomainsList",
crossDomainsTimeout: "crossDomainsTimeout",
isMutationObserver: "isMutationObserver",
isEnabled: "isEnabled"
}, t.ConfigurationDefaultTemplates = {
defaultDynamicWupDispatchRateConfiguration: {
type: "dynamic"
},
defaultIncrementalWupDispatchRateConfiguration: {
type: "incremental",
initialRateValueMs: 500,
incrementStepMs: 500,
incrementStopMs: 5e3,
incrementStartWupSendCount: 20
}
};
var e = function() {
function e() {
Ln(this, e), this._requireParseFields = new t.Map, this._requireParseFields.set(t.ConfigurationFields.dataWupDispatchRateSettings, t.ConfigurationFields.dataWupDispatchRateSettings), this._requireParseFields.set(t.ConfigurationFields.logWupDispatchRateSettings, t.ConfigurationFields.logWupDispatchRateSettings), this._requireParseFields.set(t.ConfigurationFields.serverCommunicationSettings, t.ConfigurationFields.serverCommunicationSettings), this._requireParseFields.set(t.ConfigurationFields.crossDomainsList, t.ConfigurationFields.crossDomainsList), this._configurationList = {}, this.configDefault = {
logLevel: t.Logger.LOG_LEVEL.INFO,
isCrossdomain: !1,
crossDomainsList: [],
crossDomainsTimeout: 5e3,
orientationEventsSamplePeriod: 300,
orientationEventsThreshold: 1,
stateChangeEnabled: !1,
accelerometerEventsSamplePeriod: 0,
dataQPassWorkerInterval: 500,
gyroEventsSamplePeriod: 0,
gyroEventsThreshold: .3,
isContextPropsFeature: !0,
isEnabled: !0,
isResetEveryLoad: !1,
isScrollCollect: !0,
isUnsupportedReport: !0,
isVMDetection: !0,
isAudioDetection: !1,
isHistoryNavigationEvent: !1,
wupStatisticsLogIntervalMs: 3e4,
resetSessionApiThreshold: 2e4,
wupMessageRequestTimeout: 5e3,
logMessageRequestTimeout: 5e3,
forceDynamicDataWupDispatchSettings: !0,
dataWupDispatchRateSettings: t.ConfigurationDefaultTemplates.defaultDynamicWupDispatchRateConfiguration,
logWupDispatchRateSettings: {
type: "constant",
initialRateValueMs: 2500
},
serverCommunicationSettings: {
sendRetryRate: 1e3,
queueLoadThreshold: 100
},
ipDetectorTimeout: 2e3,
collectKeyRegionValue: !1,
isMutationObserver: !0
}, this.loadConfigurations(this.configDefault)
}
return xn(e, [{
key: "isConfigurationUpdatedFromServer",
value: function() {
return !this._isDefaultConfiguration
}
}, {
key: "loadConfigurations",
value: function(e) {
for (var t in this._isDefaultConfiguration = e === this.configDefault, e)
if (e.hasOwnProperty(t)) {
var n = e[t];
if (this._requireParseFields.has(t)) {
var i = this._tryParseConfigurationValue(n);
i && (n = i)
}
this._configurationList[t] = n
}
}
}, {
key: "get",
value: function(e) {
return this._configurationList[e]
}
}, {
key: "set",
value: function(e, t) {
this._configurationList[e] = t
}
}, {
key: "getAll",
value: function() {
return this._configurationList
}
}, {
key: "_tryParseConfigurationValue",
value: function(e) {
if ("string" != typeof e) return null;
try {
return JSON.parse(e)
} catch (t) {}
return null
}
}]), e
}();
t.ConfigurationRepository = e
}(Rn), xt = Rn, Ft = function() {
function e() {
Ln(this, e), this._cid = null
}
return xn(e, [{
key: "get",
value: function() {
return this._cid
}
}, {
key: "set",
value: function(e) {
if (!e) throw new Error("Invalid cid value of undefined");
this._cid = e
}
}]), e
}(), xt.CidCache = Ft, At = Rn, (Pt = function() {
function f(e, t, n, i, s, r, a, o, u, c, h, l, d) {
Ln(this, f), this._messageBus = e, this._configurationService = t, this._configurationRepository = n, this._utils = i, this._workerComm = s, this._contextMgr = r, this._muidMgr = a, this._serverStateMgr = o, this._resetSessionSiteMapper = u, this._sidRepository = c, this._csidService = h, this._csidCache = l, this._psidCache = d, this.lastExternalResetCallTime = null, this.sessionId = null, this._resetSessionSiteMapper.updateObserver(this._onSiteMapperMatch.bind(this)), s.addMessageListener(At.WorkerEvent.NewSessionStartedEvent, this._onNewSessionStartedEvent.bind(this))
}
return xn(f, [{
key: "resumeOrStartSession",
value: function() {
var e = this._getSessionId();
e && !this._configurationRepository.get("isResetEveryLoad") ? this._resumeSession(e) : this._startNewSession()
}
}, {
key: "onConfigUpdate",
value: function(e) {
this._resetSessionSiteMapper.onConfigUpdate(e), this._configurationRepository.get("logAddress") && this._configurationService.updateLogUrlToWorker(this.sessionId, this._csidCache.get(), this._workerComm)
}
}, {
key: "resetSession",
value: function(e) {
this.onResetSession(e)
}
}, {
key: "onResetSession",
value: function(e) {
var t = e.resetReason ? e.resetReason : At.EnumDefs.SNUM_CHANGE_TYPE.unknown;
At.EnumDefs.SNUM_CHANGE_TYPE.hasOwnProperty(t) || (t = At.EnumDefs.SNUM_CHANGE_TYPE.customerApi), log.info("Received a Reset Session event, reason: " + t), this._utils.dateNow() - this.lastExternalResetCallTime > this._configurationRepository.get(At.ConfigurationFields.resetSessionApiThreshold) ? (this._startNewSession(), this._configurationService.updateLogUrlToWorker(this.sessionId, this._csidCache.get(), this._workerComm), this.lastExternalResetCallTime = this._utils.dateNow()) : log.info("Ignoring external reset session call since resetSessionApiThreshold hasn't passed")
}
}, {
key: "_startNewSession",
value: function() {
log.info("Starting a new session. Previous session was " + this.sessionId), this.sessionId = null, this._csidCache.set(null), this._psidCache.set(null), this._serverStateMgr.onSessionIdChange(), this._onStartedNewSession()
}
}, {
key: "_resumeSession",
value: function(e) {
log.info("Resuming an existing session with sid " + e), this.sessionId = e, this._saveSidToStorage(this.sessionId), this._onResumedSession(), this._handleCsid()
}
}, {
key: "_getSessionId",
value: function() {
var e;
return log.info("Attempting to get sid from storage"), (e = this._sidRepository.get()) && log.info("Read sid " + e + " from storage"), e
}
}, {
key: "_saveSidToStorage",
value: function(e) {
log.info("Saving sid " + e + " to storage"), this._sidRepository.set(e)
}
}, {
key: "_onStartedNewSession",
value: function() {
if (this._configurationRepository.get("serverAddress")) {
var e = {
serverAddress: this._configurationRepository.get("serverAddress"),
csid: this._csidCache.get(),
psid: this._psidCache.get(),
muid: this._muidMgr.muid,
context_name: this._contextMgr.contextName
};
this._workerComm.sendAsync(At.WorkerCommand.startNewSessionCommand, e), this._configurationService.updateLogUrlToWorker(this.sessionId, this._csidCache.get(), this._workerComm)
}
}
}, {
key: "_onResumedSession",
value: function() {
if (this._configurationRepository.get("serverAddress")) {
var e = this._serverStateMgr.getServerState(this.sessionId),
t = {
serverAddress: this._configurationRepository.get("serverAddress"),
csid: this._csidCache.get(),
psid: this._psidCache.get(),
cdsnum: this.sessionId,
muid: this._muidMgr.muid,
context_name: this._contextMgr.contextName,
serverState: e
};
this._workerComm.sendAsync(At.WorkerCommand.resumeSessionCommand, t), this._configurationService.updateLogUrlToWorker(this.sessionId, this._csidCache.get(), this._workerComm)
}
}
}, {
key: "_handleCsid",
value: function() {
var e = this;
this._utils.DomUtils.onDocumentBody(self, function() {
log.debug("SessionService:_sessionIdRegeneration, onDocumentBody callback: cdSNum: " + e.sessionId), e._csidService.get(function() {
log.info("Received csid from client. csid: " + e._csidCache.get() + ", sid:" + e.sessionId), e._sendCsidToServer()
})
})
}
}, {
key: "_sendCsidToServer",
value: function() {
this._configurationRepository.get("serverAddress") && (log.info("Sending csid to worker. csid: " + this._csidCache.get() + ", sid:" + this.sessionId), this._workerComm.sendAsync(At.WorkerCommand.updateCsidCommand, {
csid: this._csidCache.get()
}), this._configurationService.updateLogUrlToWorker(this.sessionId, this._csidCache.get(), this._workerComm))
}
}, {
key: "_onSiteMapperMatch",
value: function() {
this.onResetSession({
resetReason: At.EnumDefs.SNUM_CHANGE_TYPE.configuration
})
}
}, {
key: "_onNewSessionStartedEvent",
value: function(e) {
this.sessionId = e, this._saveSidToStorage(this.sessionId), this._configurationService.updateLogUrlToWorker(this.sessionId, this._csidCache.get(), this._workerComm), this._notifyNewSessionStarted(), this._handleCsid(), log.info("A new session " + e + " has started")
}
}, {
key: "_notifyNewSessionStarted",
value: function() {
this._messageBus.publish(At.MessageBusEventType.NewSessionStartedEvent, this.sessionId)
}
}]), f
}()).apiName = "ResetSession", At.SessionService = Pt, Lt = Rn, It = function() {
function t(e) {
Ln(this, t), this.sidKey = "cdSNum", this._utils = e, this.COOKIE_EXPIRATION_IN_MILLISECONDS = this._utils.minutesToMilliseconds(525600)
}
return xn(t, [{
key: "get",
value: function() {
var e = this._utils.StorageUtils.getCookie(this.sidKey),
t = this._validateSid(e);
if (!t) {
log.info("Sid was not found in cookie. Trying to get it from the local storage.");
var n = this._utils.StorageUtils.getFromLocalStorage(this.sidKey);
if (!(t = this._validateSid(n))) return log.info("Sid was not found in local storage."), null
}
return t
}
}, {
key: "set",
value: function(e) {
var t = e;
(t = this._validateSid(t)) ? (this._utils.StorageUtils.saveToLocalStorage(this.sidKey, t) || log.error("Failed saving sid " + e + " to local storage."), this._utils.StorageUtils.setCookie(this.sidKey, t, this.COOKIE_EXPIRATION_IN_MILLISECONDS) || log.error("Failed saving sid " + e + " to cookie.")) : log.error("Sid " + e + " is invalid. Will not save it.")
}
}, {
key: "_validateSid",
value: function(e) {
return e || null
}
}]), t
}(), Lt.SidRepository = It, Ut = Rn, Bt = function() {
function i(e, t, n) {
Ln(this, i), this._customerApi = e, this._csidCache = t, this._workerCommunicator = n
}
return xn(i, [{
key: "set",
value: function(e) {
if (e === undefined) throw new Error("Invalid csid value of undefined");
this._csidCache.set(e), this._workerCommunicator.sendAsync(Ut.WorkerCommand.updateCsidCommand, {
csid: e
})
}
}, {
key: "get",
value: function(e) {
this._customerApi.isApiAvailable("getCustomerSessionID") ? this._getCsidWithRetries(0, e) : log.debug("getCustomerSessionID API is unavailable. Hopefully this is because the setCustomerSessionId API is being used")
}
}, {
key: "_getCsidWithRetries",
value: function(t, n) {
var i = this;
try {
this._customerApi.getCustomerSessionID(function(e) {
if (!e) return 20 <= t ? void log.error("Failed getting csid after all retries. Received csid is empty") : (0 === t && log.warn("Received csid was empty in retry " + t), t++, void setTimeout(i._getCsidWithRetries.bind(i, t, n), 200));
log.debug("Got csid after " + t + " retries. csid: " + e), i._csidCache.set(e), n()
})
} catch (e) {
log.error("Failed to get csid: " + e.message + ". retryCount: " + t + ".", e), ++t <= 20 && setTimeout(this._getCsidWithRetries.bind(this, t, n), 200)
}
}
}]), i
}(), Ut.CsidService = Bt, Nt = Rn, Ot = function() {
function e() {
Ln(this, e), this._csid = null
}
return xn(e, [{
key: "get",
value: function() {
return this._csid
}
}, {
key: "set",
value: function(e) {
if (e === undefined) throw new Error("Invalid csid value of undefined");
this._csid = e
}
}]), e
}(), Nt.CsidCache = Ot, Wt = Rn, Qt = function() {
function n(e, t) {
Ln(this, n), this._psidCache = e, this._workerCommunicator = t
}
return xn(n, [{
key: "set",
value: function(e) {
if (e === undefined) throw new Error("Invalid psid value of undefined");
this._psidCache.set(e), this._workerCommunicator.sendAsync(Wt.WorkerCommand.updatePsidCommand, {
psid: e
})
}
}]), n
}(), Wt.PsidService = Qt, Ht = Rn, zt = function() {
function e() {
Ln(this, e), this._psid = null
}
return xn(e, [{
key: "get",
value: function() {
return this._psid
}
}, {
key: "set",
value: function(e) {
if (e === undefined) throw new Error("Invalid psid value of undefined");
this._psid = e
}
}]), e
}(), Ht.PsidCache = zt, qt = Rn, jt = function() {
function n(e, t) {
Ln(this, n), this.muid = null, this._utils = e, this._dataQ = t, this.EXPIRATION = e.minutesToMilliseconds(525600)
}
return xn(n, [{
key: "initMuid",
value: function() {
var e = this._utils.StorageUtils.getCookie("bmuid"),
t = this._utils.StorageUtils.getFromLocalStorage("bmuid");
this.muid = t || e, this.muid = this._utils.StorageUtils.validateBcId(this.muid), this.muid || (this.muid = this._utils.dateNow() + "-" + this._utils.generateUUID().toUpperCase(), log.info("Generated a new muid: " + this.muid)), this._utils.StorageUtils.setCookie("bmuid", this.muid, this.EXPIRATION), this._utils.StorageUtils.saveToLocalStorage("bmuid", this.muid), this._dataQ.addToQueue("static_fields", ["muid", this.muid], !1), log.info("Muid is: " + this.muid)
}
}]), n
}(), qt.MuidManager = jt, Vt = Rn, Yt = function() {
function n(e, t) {
Ln(this, n), this._workerComm = e, this._utils = t, this._currState = null, e.addMessageListener(Vt.WorkerEvent.ServerStateUpdatedEvent, this._onStateUpdateFromWorker.bind(this)), Vt.CDUtils.addEventListener(window, "storage", this._onStateUpdateFromStorage.bind(this), !0)
}
return xn(n, [{
key: "getServerState",
value: function(e) {
if (this._utils.isUndefinedNull(e)) throw new Error("Invalid sid param of " + e);
return this._currState = this._currState || this._utils.StorageUtils.getFromLocalStorage("cdSrvrState"), this._currState && this._currState.sid !== e ? null : this._currState
}
}, {
key: "onSessionIdChange",
value: function() {
this._utils.StorageUtils.removeFromLocalStorage("cdSrvrState"), this._currState = null
}
}, {
key: "_onStateUpdateFromWorker",
value: function(e) {
this._updateServerState(e)
}
}, {
key: "_updateServerState",
value: function(e) {
this._currState = e, this._utils.StorageUtils.saveToLocalStorage("cdSrvrState", e)
}
}, {
key: "_onStateUpdateFromStorage",
value: function(e) {
if (e && e.storageArea && e.storageArea.cdSrvrState) {
var t = JSON.parse(e.storageArea.cdSrvrState);
this._workerComm.sendAsync("stateUpdateFromStorage", {
requestId: t.val.requestId,
sts: t.val.sts,
std: t.val.std
})
}
}
}]), n
}(), Vt.ServerStateMgr = Yt, (Kt = Rn).startSloth = function(e, t) {
var n = this;
Kt.CDWPTCD["default"].setExport(Kt);
var i = new Kt.CDWPTCD["default"].Application,
s = new Kt.SystemLoader;
(Kt.sysLoader = s).loadSystem(Kt.getServerWorkerCode(), Kt.FeaturesList, Kt.log);
var r = s.getPerfMonitor();
return r.startMonitor("t.timeTillSrvrConf"), r.startMonitor("t.timeTillDataCollect"), this.configurationService = s.getConfigurationService(), this.sessionService = s.getSessionService(), this.configurationService.setConfigurationLoadedCallback(t), i.initialize("undefined" != typeof s.getUnsupportedMgr()), s.getFeatureService().buildFrameRelatedLists(), s.getFeatureBuilder().buildFeatures(Kt.FeaturesBuilder.BUILD_ALL), s.getFeatureService().runDefault(), s.getApiBridge().enableApi(), s.getContextMgr().initContextHandling(), s.registerPostLoadEvents(Kt.FeaturesList), s.getApiBridge().getLogServerAddress(function(e) {
e && n.configurationService.updateLogUrlToWorker(n.sessionService.sessionId, s.getCsidCache().get(), s.getServerWorkerCommunicator(), e), log.info("Started default features collection"), s.getApiBridge().getServerAddress(function(e) {
if (!e) throw log.error("startSloth.getServerAddress: error getting URL"), new Error("Unable to complete the startup. Missing server url");
log.info("Got server address: " + e), s.getMuidMgr().initMuid(), n.configurationService.setServerUrl(e), n.sessionService.resumeOrStartSession()
})
}), s
},
function(a) {
function e(e, t, n, i, s) {
var r = this;
this._sendQToServerWorker = function() {
try {
this._Q.length && (this._serverWorkerCommunicator.sendAsync(this._msgToWorker, this._Q), this._Q = [])
} catch (e) {
log.error("Failed sending data to worker. " + e), this._sendQInSingleMessagesToServerWorker()
}
}, this._sendQInSingleMessagesToServerWorker = function() {
for (var e = 0; e < this._Q.length; e++) try {
this._serverWorkerCommunicator.sendAsync(this._msgToWorker, this._Q[e])
} catch (t) {
log.error("Failed sending single message data to worker. " + t)
}
this._Q = []
}, this._onUnload = function() {
this._Q.push({
eventName: "flushData"
}), this._sendQToServerWorker()
}, this._serverWorkerCommunicator = e, this._contextManager = t, this._passToWorkerInterval = s || 0, this._intervalConfigKey = n, this._msgToWorker = i, this._Q = [], this._passToWorkerInterval && (this._intervalId = setInterval(this._sendQToServerWorker.bind(this), this._passToWorkerInterval)), a.CDUtils.addEventListener(window, "beforeunload", function() {
r._onUnload()
}, !0)
}
e.prototype.addToQueue = function(e, t, n, i) {
(n = !(n !== undefined && null !== n && !0 !== n)) && t.push && (t[0] = this._contextManager.contextId), 0 !== this._passToWorkerInterval ? (this._Q.push({
eventName: e,
data: t,
shouldFlush: i
}), i && this._sendQToServerWorker()) : this._serverWorkerCommunicator.sendAsync(this._msgToWorker, {
eventName: e,
data: t,
shouldFlush: i
})
}, e.prototype.updateWithConfig = function(e) {
var t = e.get(this._intervalConfigKey);
t !== undefined && t !== this._passToWorkerInterval && (this._passToWorkerInterval = t, clearInterval(this._intervalId), this._intervalId = null, 0 !== this._passToWorkerInterval && (this._intervalId = setInterval(this._sendQToServerWorker.bind(this), this._passToWorkerInterval)))
}, a.DataQ = e
}(Rn), Gt = Rn, Xt = function() {
function i(e, t, n) {
Ln(this, i), this._featureMgr = e, this._dataQ = n, this._configurationRepository = t, this._pauseResumeEnabled = t.get("stateChangeEnabled") || !1, this._sdkState = i.STATE.RUNNING
}
return xn(i, [{
key: "onResume",
value: function() {
this._sdkState === i.STATE.PAUSED ? (log.info("Resuming JS SDK"), this._featureMgr.updateRunByConfig(this._configurationRepository), this._sdkState = i.STATE.RUNNING) : log.warn("PauseResumeManager:onResume - resume api called when SDK already running")
}
}, {
key: "onPause",
value: function() {
this._sdkState === i.STATE.RUNNING ? (log.info("Pausing JS SDK"), this._featureMgr.stopAllFeatures(), this._sdkState = i.STATE.PAUSED) : log.warn("Pause api called when SDK already paused")
}
}, {
key: "onStateChange",
value: function(e) {
e.toState && this._verifyApiAllowed(e.toState) && ("pause" === e.toState ? this.onPause() : "run" === e.toState ? this.onResume() : log.warn("stateChange api called with non valid toState: " + e.toState))
}
}, {
key: "isCustomerApiEnabled",
value: function() {
return this._sdkState === i.STATE.RUNNING
}
}, {
key: "_verifyApiAllowed",
value: function(e) {
return !!this._pauseResumeEnabled || (this._dataQ.addToQueue("forbidden_api_call", [null, e]), !1)
}
}, {
key: "onConfigUpdate",
value: function() {
this._pauseResumeEnabled = this._configurationRepository.get("stateChangeEnabled") || !1, !1 === this._configurationRepository.get("isEnabled") && this.onPause()
}
}]), i
}(), Object.extend(Xt, {
STATE: {
RUNNING: 0,
PAUSED: 1
}
}), Gt.PauseResumeManager = Xt, Zt = Rn, Jt = function() {
function t(e) {
Ln(this, t), this._messageBus = e, this._state = Zt.EnumDefs.State.stopped
}
return xn(t, [{
key: "getState",
value: function() {
return this._state
}
}, {
key: "updateState",
value: function(e) {
var t = Zt.EnumDefs.State[e];
if (!t) throw new Error("Uknown state " + e);
this._state = t, this._messageBus.publish(Zt.MessageBusEventType.StateChangedEvent, {
state: t
})
}
}]), t
}(), Zt.StateService = Jt, $t = Rn, en = function() {
function r(e, t, n, i) {
var s = !(4 < arguments.length && arguments[4] !== undefined) || arguments[4];
Ln(this, r), this._mutationObserver = e, this._siteMapKey = n, this._keyUrl = n + "_isUrlNonMasked", this._stopOnFirstMappingMatch = s, this._siteMap = null, this._observers = [], this._utils = t, this._onMatchCB = i, this._maxMappings = 200, this._maxTriggers = 10
}
return xn(r, [{
key: "updateObserver",
value: function(e) {
this._onMatchCB = e
}
}, {
key: "_observeChange",
value: function(e, t) {
if (e) try {
var n = window.document.querySelector(e);
if (n) {
var i = new this._mutationObserver(function(e) {
0 < e.length && t()
});
i.observe(n, {
childList: !0,
characterData: !0,
attributes: !0,
subtree: !0
}), this._observers.push(i)
} else log.error("Selector:" + JSON.stringify(e) + " not found on page. Check " + this._siteMapKey + " configuration")
} catch (s) {
log.error("SiteMapper._observeChange: " + s.message, s)
}
}
}, {
key: "initTracking",
value: function() {
var s = this,
r = function r() {
try {
for (var e = 0; e < s._siteMap.mappings.length; e++) {
var t = s._siteMap.mappings[e];
if (!t.url || -1 < s._url.indexOf(t.url))
if (t.selector) {
var n = window.document.querySelector(t.selector);
if (n)
if (t.byText) {
if ((n.innerText !== undefined && -1 !== n.innerText.indexOf(t.byText) || n.value === t.byText || n.textContent === t.byText) && (s._onMatchCB(t), s._stopOnFirstMappingMatch)) return
} else if (s._onMatchCB(t), s._stopOnFirstMappingMatch) return
} else if (-1 < s._url.indexOf(t.url) && (s._onMatchCB(t), s._stopOnFirstMappingMatch)) return
}
} catch (i) {
log.error("SiteMapper:testQuerySelector failed. ex:" + i.message, i)
}
};
if (!this._siteMap) {
var e = this._utils.StorageUtils.getFromSessionStorage(this._siteMapKey);
e && e.triggers.length <= this._maxTriggers && e.mappings.length <= this._maxMappings && (this._siteMap = e), this._isNonMaskedUrl = this._utils.StorageUtils.getFromSessionStorage(this._keyUrl)
}
this._siteMap && (this._url = this._isNonMaskedUrl ? window.document.location.href : this._utils.getDocUrl(), this._utils.DomUtils.onDocumentBody(window, function() {
s._mutationObserver && s._siteMap.triggers.forEach(function(e) {
(!e.url || -1 < s._url.indexOf(e.url)) && s._observeChange(e.selector, r)
}), r()
}))
}
}, {
key: "onConfigUpdate",
value: function(e) {
try {
if (!this._siteMap && e.get(this._siteMapKey)) {
this.stopTracking();
var t = e.get(this._siteMapKey) && JSON.parse(e.get(this._siteMapKey));
this._isNonMaskedUrl = e.get("useNonMaskedUrlInMappings"), t && t.triggers.length <= this._maxTriggers && t.mappings.length <= this._maxMappings ? (this._siteMap = t, this._utils.StorageUtils.saveToSessionStorage(this._siteMapKey, this._siteMap), this._utils.StorageUtils.saveToSessionStorage(this._keyUrl, this._isNonMaskedUrl), this.initTracking()) : log.warn("Configuration " + this._siteMapKey + " contains an illegal amount of triggers or mappings. Max Allowed Triggers: " + this._maxTriggers + ", Max Allowed Mappings: " + this._maxMappings)
}
} catch (n) {
log.error("SiteMapper:onConfigUpdate: " + n.message, n)
}
}
}, {
key: "stopTracking",
value: function() {
for (var e = 0; e < this._observers.length; e++) this._observers[e].disconnect();
this._observers = [], this._siteMap = null
}
}]), r
}(), $t.SiteMapper = en, (tn = Rn).SlaveListener = function() {
function a(e, t, n, i, s, r) {
Ln(this, a), this._slaves = [], this._dataQ = e, this._configurationRepository = t, this._utils = n, this._logPerfDataQ = i, this._contextMgr = s, this._sessionService = r, this.onResetSessionTrigger = new tn.CDEvent, this.onMouseChallengeTrigger = new tn.CDEvent, this._msgRouter = {
dataFromSlave: this._onDataFromSlave,
registerSlave: this._onRegisterSlave,
logPerfSlave: this._onLogPerfSlave,
updateMasterContext: this._onUpdateMasterContext,
resetSessionTriggerFromSlave: this._onResetSessionTriggerFromSlave,
mouseChallengeTriggerFromSlave: this._onMouseChallengeTriggerFromSlave
}
}
return xn(a, [{
key: "listen",
value: function() {
var n = this;
log.debug("SlaveListener:listen"), this._utils.addEventListener(window, "message", function(e) {
var t = e.data.msgType;
t && n._msgRouter[t] && n._msgRouter[t].call(n, e)
})
}
}, {
key: "sendToSlaves",
value: function(t, n) {
log.debug("SlaveListener:sendToSlaves"), this._slaves.forEach(function(e) {
e.source.postMessage({
msgType: t,
data: n
}, e.origin)
})
}
}, {
key: "onConfigUpdate",
value: function() {
log.debug("SlaveListener:onConfigUpdate, updating " + this._slaves.length + " slaves"), this.sendToSlaves(tn.EnumDefs.MasterSlaveMessage.updateSlaveConf, this._configurationRepository.getAll())
}
}, {
key: "notifyStateChange",
value: function(e) {
log.info("SlaveListener:notifyStateChange, updating " + this._slaves.length + " slaves that the new state is " + e.toState), this.sendToSlaves(tn.EnumDefs.MasterSlaveMessage.updateSlaveState, e)
}
}, {
key: "_onDataFromSlave",
value: function(e) {
var t = e.data;
"flushData" !== t.data.eventName && t.data.eventName && this._dataQ.addToQueue(t.data.eventName, t.data.data)
}
}, {
key: "_onRegisterSlave",
value: function(e) {
log.info("SlaveListener:_onRegisterSlave - slave registered, origin " + e.origin), this._slaves.push({
source: e.source,
origin: e.origin
}), e.source.postMessage({
msgType: "updateSlaveConf",
data: this._configurationRepository.getAll()
}, e.origin)
}
}, {
key: "_onLogPerfSlave",
value: function(e) {
var t = e.data;
"flushData" !== t.data.eventName && t.data.eventName && this._logPerfDataQ.addToQueue(t.data.eventName, t.data.data)
}
}, {
key: "_onUpdateMasterContext",
value: function(e) {
log.debug("SlaveListener:_onUpdateMasterContext");
var t = e.data;
this._contextMgr.setContext(t.data)
}
}, {
key: "_onResetSessionTriggerFromSlave",
value: function(e) {
log.debug("SlaveListener:_onResetSessionTriggerFromSlave");
var t = e.data;
this.onResetSessionTrigger.publish(t.data)
}
}, {
key: "_onMouseChallengeTriggerFromSlave",
value: function(e) {
log.debug("SlaveListener:_onMouseChallengeTriggerFromSlave");
var t = e.data;
this.onMouseChallengeTrigger.publish(t.data)
}
}]), a
}(),
function(g) {
function e() {
this._serverWorker = null, this._serverWorkerCommunicator = null, this._configurationService = null, this._featureBuilder = null, this._featureService = null, this._dataQ = null, this._frameHandler = null, this._eventHandlers = [], this._runWorker = function(e) {
var t = (new g.BlobFactory).create(e),
n = (new g.BlobUrlFactory).create(t);
return (new g.WorkerWrapperFactory).create(n)
}
}
e.prototype.loadSystem = function(e, t, n) {
var i = "";
try {
e && (this.runServerWorker(e), this._serverWorkerCommunicator = new g.WorkerCommunicator, this._serverWorkerCommunicator.setMessagingPort(this._serverWorker.port))
} catch (p) {
i = p.message, this._unsupportedMgr = new g.UnsupportedMgr(new g.UnsPort), g.executeServerWorkerCodeInMain(), this._serverWorkerCommunicator = new g.WorkerCommunicator, this._serverWorkerCommunicator.setMessagingPort(this._unsupportedMgr.getUnsPort()), this._unsupportedMgr.adjustFeatureList(t)
}
var s = new g.DataQ(this._serverWorkerCommunicator, null, "logPerfQPassWorkerInterval", g.WorkerCommand.sendLogCommand),
r = this._perfMonitor = new g.PerfMonitor(s),
a = new g.SiteMapper(self.MutationObserver, g.CDUtils, "contextConfiguration"),
o = this._contextMgr = new g.ContextMgr(g.CDUtils, a, this._serverWorkerCommunicator),
u = new(function() {
function e() {
Ln(this, e)
}
return xn(e, [{
key: "log",
value: function log(e, t) {
s.addToQueue("log", {
msg: e,
url: o.url,
level: t,
sn: this.sn++
})
}
}]), e
}());
u.sn = 0;
var c = new g.Logger(u);
n.setLogger(c), this._currScriptName = document.currentScript ? document.currentScript.src : "", this._globalexceptionHandler = new g.GlobalExceptionHandler(g.CDUtils, this._currScriptName), this._msgBus = new g.MessageBus(g.CDUtils), this._dataQ = new g.DataQ(this._serverWorkerCommunicator, this._contextMgr, "dataQPassWorkerInterval", g.WorkerCommand.sendDataCommand), this._cidCache = new g.CidCache, this._serverStateMgr = new g.ServerStateMgr(this._serverWorkerCommunicator, g.CDUtils), this._configurationRepository = new g.ConfigurationRepository, this._configurationService = new g.ConfigurationService(this._configurationRepository, this._msgBus, this._cidCache, this._serverWorkerCommunicator), this._sensorDataQ = new g.SensorsDataQueue(this._configurationRepository, this._dataQ, this._msgBus), this._unsupportedMgr ? log.warn("moving to unsupported mode since workers were not able to be loaded. error=" + i) : this._elementsUtils = new g.Elements(this._configurationRepository, g.CDUtils, this._dataQ, this._contextMgr, r), this._framesCache = new g.FramesCache, this._framesDetector = new g.FramesDetector(self.MutationObserver, g.CDUtils), this._frameHandler = this._unsupportedMgr ? this._unsupportedMgr.getUnsFrameHandler() : new g.FramesHandler(this._framesCache, this._framesDetector, g.CDUtils), this._featureService = new g.FeatureService(t, this._frameHandler, this._configurationRepository), this._pauseResumeMgr = new g.PauseResumeManager(this._featureService, this._configurationRepository, this._dataQ), this._customerApiBridge = new g.CustomerApiBridge(this._pauseResumeMgr, this._msgBus), this._muidManager = new g.MuidManager(g.CDUtils, this._dataQ), this._psidCache = new g.PsidCache;
var h = new g.PsidService(this._psidCache, this._serverWorkerCommunicator),
l = new g.SiteMapper(self.MutationObserver, g.CDUtils, "resetSessionConfig"),
d = new g.SidRepository(g.CDUtils);
this._csidCache = new g.CsidCache;
var f = new g.CsidService(this._customerApiBridge, this._csidCache, this._serverWorkerCommunicator);
this._sessionService = new g.SessionService(this._msgBus, this._configurationService, this._configurationRepository, g.CDUtils, this._serverWorkerCommunicator, this._contextMgr, this._muidManager, this._serverStateMgr, l, d, f, this._csidCache, this._psidCache), this._handleMetadata = new g.HandleMetadata(this._configurationRepository, this._dataQ, r), this._scriptsRepository = new g.ScriptsRepository(g.CDUtils), this._slaveListener = new g.SlaveListener(this._dataQ, this._configurationRepository, g.CDUtils, s, o), this._slaveListener.listen(), this._featureBuilder = new g.FeaturesBuilder(t, this._configurationRepository, g.CDUtils, this._elementsUtils, self.MutationObserver, this._dataQ, this._sessionService, this._muidManager, r, this._sensorDataQ, this._msgBus, this._scriptsRepository, this._cidCache), this._contextApiHandler = new g.ContextApiHandler(this._contextMgr, this._dataQ), this._contextMgr.onContextChange.subscribe(this._featureService.runPerContextFeatures.bind(this._featureService)), this._stateService = new g.StateService(this._msgBus);
var _ = new g.ClientEventService;
this._eventHandlers.push(new g.ApiContextChangeEventHandler(this._msgBus, this._contextMgr)), this._eventHandlers.push(new g.ApiResetSessionEventHandler(this._msgBus, this._sessionService)), this._eventHandlers.push(new g.ApiCustomerMetadataEventHandler(this._msgBus, this._handleMetadata)), this._eventHandlers.push(new g.ApiChangeStateEventHandler(this._msgBus, this._pauseResumeMgr, this._slaveListener)), this._eventHandlers.push(new g.ApiSetCsidEventHandler(this._msgBus, f)), this._eventHandlers.push(new g.ApiSetPsidEventHandler(this._msgBus, h)), this._eventHandlers.push(new g.StateChangedEventHandler(this._msgBus, _)), this._eventHandlers.push(new g.ConfigurationLoadedEventHandler(this._msgBus, this._featureService, this._dataQ, this._pauseResumeMgr, this._handleMetadata, c, this._contextMgr, this._sessionService, this._sensorDataQ, this._slaveListener, this._stateService, this._perfMonitor)), this._eventHandlers.push(new g.NewSessionStartedEventHandler(this._msgBus, this._featureService, this._customerApiBridge, this._contextMgr, _)), this._stateService.updateState(g.EnumDefs.State.starting)
}, e.prototype.runServerWorker = function(e) {
this._serverWorker = this._runWorker(e)
}, e.prototype.registerPostLoadEvents = function(e) {
if (e.nonDefaultFeatures.MouseChallengeFeature) {
var t = e.nonDefaultFeatures.MouseChallengeFeature.instance;
this._slaveListener.onMouseChallengeTrigger.subscribe(t.startHiding.bind(t))
}
this._slaveListener.onResetSessionTrigger.subscribe(this._sessionService.resetSession.bind(this._sessionService))
}, e.prototype.getServerWorkerCommunicator = function() {
return this._serverWorkerCommunicator
}, e.prototype.getFeatureBuilder = function() {
return this._featureBuilder
}, e.prototype.getFeatureService = function() {
return this._featureService
}, e.prototype.getConfigurationService = function() {
return this._configurationService
}, e.prototype.getConfigurationRepository = function() {
return this._configurationRepository
}, e.prototype.getSessionService = function() {
return this._sessionService
}, e.prototype.getContextMgr = function() {
return this._contextMgr
}, e.prototype.getMuidMgr = function() {
return this._muidManager
}, e.prototype.getApiBridge = function() {
return this._customerApiBridge
}, e.prototype.getUnsupportedMgr = function() {
return this._unsupportedMgr
}, e.prototype.getPerfMonitor = function() {
return this._perfMonitor
}, e.prototype.getServerStateMgr = function() {
return this._serverStateMgr
}, e.prototype.getMessageBus = function() {
return this._msgBus
}, e.prototype.getCsidCache = function() {
return this._csidCache
}, e.prototype.getPsidCache = function() {
return this._psidCache
}, g.SystemLoader = e
}(Rn), nn = Rn, sn = function() {
function n(e, t) {
Ln(this, n), this._messageBus = e, this._clientEventService = t, this._messageBus.subscribe(nn.MessageBusEventType.StateChangedEvent, this._handle.bind(this))
}
return xn(n, [{
key: "_handle",
value: function(e) {
log.info("SDK state changed to " + e.state), this._clientEventService.publishStateChangedEvent(e.state)
}
}]), n
}(), nn.StateChangedEventHandler = sn, rn = Rn, an = function() {
function d(e, t, n, i, s, r, a, o, u, c, h, l) {
Ln(this, d), this._messageBus = e, this._featureService = t, this._dataQ = n, this._pauseResumeMgr = i, this._handleMetadata = s, this._logger = r, this._contextMgr = a, this._sessionService = o, this._sensorDataQ = u, this._slaveListener = c, this._stateService = h, this._performanceMonitor = l, this._messageBus.subscribe(rn.MessageBusEventType.ConfigurationLoadedEvent, this._handle.bind(this))
}
return xn(d, [{
key: "_handle",
value: function(e) {
log.info("Configurations were loaded from the server."), this._performanceMonitor.stopMonitor("t.timeTillSrvrConf"), this._featureService.updateRunByConfig(e), this._dataQ.updateWithConfig(e), this._pauseResumeMgr.onConfigUpdate(e), this._handleMetadata.onConfigUpdate(e), this._logger.updateLogConfig(e), this._contextMgr.onConfigUpdate(e), this._sessionService.onConfigUpdate(e), this._sensorDataQ.onConfigUpdate(e), this._slaveListener.onConfigUpdate(e), this._stateService.updateState(rn.EnumDefs.State.started), log.info("Successfully configured system")
}
}]), d
}(), rn.ConfigurationLoadedEventHandler = an, on = Rn, un = function() {
function r(e, t, n, i, s) {
Ln(this, r), this._messageBus = e, this._featureService = t, this._customerApiBridge = n, this._contextMgr = i, this._clientEventService = s, this._messageBus.subscribe(on.MessageBusEventType.NewSessionStartedEvent, this._handle.bind(this))
}
return xn(r, [{
key: "_handle",
value: function(e) {
this._featureService.runPerSessionFeatures(), this._customerApiBridge.notifySessionReset(e), this._contextMgr.onSessionReset(), this._clientEventService.publishNewSessionStartedEvent(e)
}
}]), r
}(), on.NewSessionStartedEventHandler = un, cn = Rn, hn = function() {
function i(e, t, n) {
Ln(this, i), this._messageBus = e, this._pauseResumeManager = t, this._slaveListener = n, this._messageBus.subscribe(cn.MessageBusEventType.ApiChangeStateEvent, this._handle.bind(this))
}
return xn(i, [{
key: "_handle",
value: function(e) {
this._pauseResumeManager.onStateChange(e), this._slaveListener.notifyStateChange(e)
}
}]), i
}(), cn.ApiChangeStateEventHandler = hn, ln = Rn, dn = function() {
function n(e, t) {
Ln(this, n), this._messageBus = e, this._contextMgr = t, this._messageBus.subscribe(ln.MessageBusEventType.ApiContextChangeEvent, this._handle.bind(this))
}
return xn(n, [{
key: "_handle",
value: function(e) {
this._contextMgr.changeContext(e.context || e.activityType)
}
}]), n
}(), ln.ApiContextChangeEventHandler = dn, fn = Rn, _n = function() {
function n(e, t) {
Ln(this, n), this._messageBus = e, this._handleMetadata = t, this._messageBus.subscribe(fn.MessageBusEventType.ApiCustomerMetadataEvent, this._handle.bind(this))
}
return xn(n, [{
key: "_handle",
value: function(e) {
this._handleMetadata.onCustomerMetadata(e)
}
}]), n
}(), fn.ApiCustomerMetadataEventHandler = _n, pn = Rn, gn = function() {
function n(e, t) {
Ln(this, n), this._messageBus = e, this._sessionService = t, this._messageBus.subscribe(pn.MessageBusEventType.ApiResetSessionEvent,
this._handle.bind(this))
}
return xn(n, [{
key: "_handle",
value: function(e) {
this._sessionService.onResetSession(e)
}
}]), n
}(), pn.ApiResetSessionEventHandler = gn, vn = Rn, mn = function() {
function n(e, t) {
Ln(this, n), this._messageBus = e, this._csidService = t, this._messageBus.subscribe(vn.MessageBusEventType.ApiSetCsidEvent, this._handle.bind(this))
}
return xn(n, [{
key: "_handle",
value: function(e) {
e.csid ? this._csidService.set(e.csid) : log.warn("Received an invalid csid of " + e.csid + ". Ignoring api call")
}
}]), n
}(), vn.ApiSetCsidEventHandler = mn, yn = Rn, wn = function() {
function n(e, t) {
Ln(this, n), this._messageBus = e, this._psidService = t, this._messageBus.subscribe(yn.MessageBusEventType.ApiSetPsidEvent, this._handle.bind(this))
}
return xn(n, [{
key: "_handle",
value: function(e) {
e.psid ? this._psidService.set(e.psid) : log.warn("Received an invalid psid of " + e.psid + ". Ignoring api call")
}
}]), n
}(), yn.ApiSetPsidEventHandler = wn, Sn = Rn, bn = null, En = function En(e) {
return null === bn && (bn = new kn(e)), bn
}, kn = function() {
function t(e) {
Ln(this, t), this._utils = e, this.handle = this._handle.bind(this), this.subscribers = [], this.subscribe = this.subscribe.bind(this), this._selector = null, this._elementBindingWMap = new WeakMap
}
return xn(t, [{
key: "start",
value: function(e, n) {
var i = this,
t = (n = n || window.self).document || n.contentDocument;
this._selector = e, Array.from(t.querySelectorAll(e)).forEach(function(e) {
if (i.hasjQueryAutoTab(e, n)) {
if (i._elementBindingWMap.get(e)) return;
var t = function t(e) {
i.handle(e, n)
};
i._utils.addEventListener(e, "keypress", t), i._elementBindingWMap.set(e, {
isBinded: !0,
listener: t
})
}
})
}
}, {
key: "_stop",
value: function(e) {
var n = this,
t = (e = e || window.self).document || e.contentDocument;
Array.from(t.querySelectorAll(this._selector)).forEach(function(e) {
var t = n._elementBindingWMap.get(e);
t && t.isBinded && (n._utils.removeEventListener(e, "keypress", t.listener), n._elementBindingWMap["delete"](e))
})
}
}, {
key: "stop",
value: function(e) {
return this._stop(e), !0
}
}, {
key: "subscribe",
value: function(e) {
for (var t = 0; t < this.subscribers.length; t++)
if (this.subscribers[t].handler === e) return;
this.subscribers.push({
handler: e
})
}
}, {
key: "unsubscribe",
value: function(e) {
for (var t = 0; t < this.subscribers.length; t++) this.subscribers[t].handler === e && delete this.subscribers[t]
}
}, {
key: "hasjQueryAutoTab",
value: function(e, t) {
if (!t.jQuery || !t.jQuery._data) return !1;
if ("undefined" == typeof t.jQuery._data(e, "events")) return !1;
for (var n = Object.keys(t.jQuery._data(e, "events")), i = 0; i < n.length; i++)
if (-1 !== n[i].indexOf("autotab")) return !0;
return !1
}
}, {
key: "_handle",
value: function(e, t) {
var n = this.hasjQueryAutoTab(e.target, t) ? "autotab" : "";
if ("autotab" === n) {
var i = "insertText",
s = e.key;
if (8 != e.keyCode || (i = "deleteContentBackward", s = null, "autotab" !== n))
for (var r = Object.assign({}, {
bubbles: !0,
cancelBubble: !1,
cancelable: !1,
composed: !0,
currentTarget: null,
data: s,
dataTransfer: null,
defaultPrevented: !1,
detail: 0,
eventPhase: 0,
inputType: i,
isComposing: !1,
isTrusted: !0,
jQueryMask: n,
returnValue: !0,
sourceCapabilities: null,
srcElement: Object.assign(e.target || e.srcElement, {}),
target: Object.assign(e.target, {}),
timestamp: e.timestamp,
type: "input",
view: null,
which: 0
}), a = 0; a < this.subscribers.length; a++) this.subscribers[a].handler(r)
}
}
}]), t
}(), Sn.CustomInputFieldsEventHandler = En, Cn = Rn, Tn = null, Mn = function Mn(e) {
return null === Tn && (Tn = new Dn(e)), Tn
}, Dn = function() {
function t(e) {
Ln(this, t), this._utils = e, this.handle = this._handle.bind(this), this.subscribers = [], this.subscribe = this.subscribe.bind(this), this._selector = null, this._elementBindingWMap = new WeakMap
}
return xn(t, [{
key: "start",
value: function(e, n) {
var i = this,
t = (n = n || window.self).document || n.contentDocument;
this._selector = e, Array.from(t.querySelectorAll(e)).forEach(function(e) {
if (i.hasUnmaskEvent(e, n)) {
if (i._elementBindingWMap.get(e)) return;
var t = function t(e) {
i.handle(e, n)
};
i._utils.addEventListener(e, "keypress", t), i._elementBindingWMap.set(e, {
isBinded: !0,
listener: t
})
}
})
}
}, {
key: "_stop",
value: function(e) {
var n = this,
t = (e = e || window.self).document || e.contentDocument;
Array.from(t.querySelectorAll(this._selector)).forEach(function(e) {
var t = n._elementBindingWMap.get(e);
t && t.isBinded && (n._utils.removeEventListener(e, "keypress", t.listener), n._elementBindingWMap["delete"](e))
})
}
}, {
key: "stop",
value: function(e) {
return this._stop(e), !0
}
}, {
key: "subscribe",
value: function(e) {
for (var t = 0; t < this.subscribers.length; t++)
if (this.subscribers[t].handler === e) return;
this.subscribers.push({
handler: e
})
}
}, {
key: "unsubscribe",
value: function(e) {
for (var t = 0; t < this.subscribers.length; t++) this.subscribers[t].handler === e && delete this.subscribers[t]
}
}, {
key: "hasUnmaskEvent",
value: function(e, t) {
if (!t.jQuery || !t.jQuery._data) return !1;
var n = t.jQuery._data(e, "events");
if ("undefined" == typeof n) return !1;
for (var i = Object.keys(n), s = 0; s < i.length; s++)
if ("unmask" === i[s]) return !0;
return !1
}
}, {
key: "_handle",
value: function(e, t) {
var n = this.hasUnmaskEvent(e.target, t) ? "maskedInput" : "";
if ("maskedInput" === n)
for (var i = e.key, s = Object.assign({}, {
bubbles: !0,
cancelBubble: !1,
cancelable: !1,
composed: !0,
currentTarget: null,
data: i,
dataTransfer: null,
defaultPrevented: !1,
detail: 0,
eventPhase: 0,
inputType: "insertText",
isComposing: !1,
isTrusted: !0,
jQueryMask: n,
returnValue: !0,
sourceCapabilities: null,
srcElement: Object.assign(e.target || e.srcElement, {}),
target: Object.assign(e.target, {}),
timestamp: e.timestamp,
type: "input",
view: null,
which: 0
}), r = 0; r < this.subscribers.length; r++) this.subscribers[r].handler(s)
}
}]), t
}(), Cn.CustomMaskedInputFieldsEventHandler = Mn, Rn.CDWPTCD = function(n) {
var r = {};
function __webpack_require__(e) {
if (r[e]) return r[e].exports;
var t = r[e] = {
i: e,
l: !1,
exports: {}
};
return n[e].call(t.exports, t, t.exports, __webpack_require__), t.l = !0, t.exports
}
return __webpack_require__.m = n, __webpack_require__.c = r, __webpack_require__.d = function(e, t, n) {
__webpack_require__.o(e, t) || Object.defineProperty(e, t, {
enumerable: !0,
get: n
})
}, __webpack_require__.r = function(e) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
value: "Module"
}), Object.defineProperty(e, "__esModule", {
value: !0
})
}, __webpack_require__.t = function(t, e) {
if (1 & e && (t = __webpack_require__(t)), 8 & e) return t;
if (4 & e && "object" == typeof t && t && t.__esModule) return t;
var n = Object.create(null);
if (__webpack_require__.r(n), Object.defineProperty(n, "default", {
enumerable: !0,
value: t
}), 2 & e && "string" != typeof t)
for (var r in t) __webpack_require__.d(n, r, function(e) {
return t[e]
}.bind(null, r));
return n
}, __webpack_require__.n = function(e) {
var t = e && e.__esModule ? function getDefault() {
return e["default"]
} : function getModuleExports() {
return e
};
return __webpack_require__.d(t, "a", t), t
}, __webpack_require__.o = function(e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 33)
}([function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(DataCollector, function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(1))["default"]), r(DataCollector, [{
key: "startFeature",
value: function startFeature() {}
}, {
key: "stopFeature",
value: function stopFeature() {}
}, {
key: "updateFeatureConfig",
value: function updateFeatureConfig() {}
}, {
key: "sendToQueue",
value: function sendToQueue() {}
}]), DataCollector);
function DataCollector(e) {
return function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, DataCollector),
function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (DataCollector.__proto__ || Object.getPrototypeOf(DataCollector)).call(this, e))
}
t["default"] = i
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = n(2),
s = n(3);
var a = (r(Event, [{
key: "getEventTimestamp",
value: function getEventTimestamp() {
return this.getExports().CDUtils.dateNow()
}
}, {
key: "getTimestampFromEvent",
value: function getTimestampFromEvent(e) {
return e.timeStamp ? this.getExports().CDUtils.cutDecimalPointDigits(e.timeStamp, 3) : 0
}
}, {
key: "handlerProlog",
value: function handlerProlog(e) {
log.isDebug() && this._perfMonitor.startMonitor(e)
}
}, {
key: "handlerEpilog",
value: function handlerEpilog(e) {
log.isDebug() && this._perfMonitor.stopMonitor(e)
}
}, {
key: "handlerCancelog",
value: function handlerCancelog(e) {
log.isDebug() && this._perfMonitor.cancelMonitor(e)
}
}, {
key: "updateFeatureConfig",
value: function updateFeatureConfig() {}
}]), Event);
function Event(e) {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, Event), this._perfMonitor = e, this.session = (0, i.inject)("Session")
}
t["default"] = (0, s.WithExportsMixin)(a)
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t.serviceContainer = undefined, t.inject = function inject(e) {
var t = "service:" + e;
return i.lookup(t)
}, t.register = function register(e, t) {
var n = "service:" + e;
i.lookup(n) || (i.register(n, t), (0, r["default"])(t));
return i.lookup(n)
};
var r = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(3));
var i = null;
t.serviceContainer = function na(e) {
i = i || e
};
var s = function s(e) {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, s);
var t = "service:" + e;
return i.lookup(t) || (i.register(t, this), (0, r["default"])(this)), i.lookup(t)
};
t["default"] = s
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = {};
t.injectExports = function Fa(e) {
i = e
}, t.WithExportsMixin = function Ga(e) {
return function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(_class2, e), r(_class2, [{
key: "getExports",
value: function getExports() {
return i
}
}]), _class2;
function _class2() {
return function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, _class2),
function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (_class2.__proto__ || Object.getPrototypeOf(_class2)).apply(this, arguments))
}
};
t["default"] = function(e) {
e.exports = i
}
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = null,
i = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(Container, [{
key: "register",
value: function register(e, t) {
var n = this.normalize(e);
if (r.hasOwnProperty(n)) throw new Error(n + " has already been registered");
r[n] = t
}
}, {
key: "keys",
value: function keys() {
return Object.keys(r)
}
}, {
key: "lookup",
value: function lookup(e) {
var t = this.normalize(e);
return r.hasOwnProperty(t) ? r[t] : null
}
}, {
key: "normalize",
value: function normalize(e) {
return e.toLowerCase()
}
}, {
key: "toString",
value: function toString() {
return this.keys().join(",")
}
}]), Container);
function Container() {
var e = 0 < arguments.length && arguments[0] !== undefined ? arguments[0] : {};
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, Container), r = Object.create(e)
}
t["default"] = i
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
},
r = _interopRequireDefault(n(16)),
i = _interopRequireDefault(n(10)),
s = _interopRequireDefault(n(8)),
o = _interopRequireDefault(n(11)),
u = _interopRequireDefault(n(12)),
l = _interopRequireDefault(n(1)),
c = _interopRequireDefault(n(6)),
d = _interopRequireDefault(n(0)),
f = _interopRequireDefault(n(7)),
v = _interopRequireDefault(n(13)),
h = _interopRequireDefault(n(14)),
E = _interopRequireDefault(n(9)),
p = _interopRequireDefault(n(17)),
m = _interopRequireDefault(n(18)),
g = n(2),
_ = n(11),
y = _interopRequireDefault(_),
b = n(13),
C = _interopRequireDefault(b),
w = n(14),
O = _interopRequireDefault(w),
S = n(12),
B = _interopRequireDefault(S);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}
var M = {};
M.Index = r["default"], M.WindowEventCollector = i["default"], M.OrientationEventCollector = s["default"], M.InputEvents = o["default"], M.FormEvents = u["default"], M.Event = l["default"], M.ElementEventCollector = c["default"], M.DataCollector = d["default"], M.ClipboardEventCollector = f["default"], M.ClickEvents = v["default"], M.ChangeEvents = h["default"], M.BeforeInstallPromptEventCollector = E["default"];
var P = {
defaultFeatures: [{
name: "ClipboardEvents",
className: M.ClipboardEventCollector,
init: function init() {
return function() {
var e = new M.ClipboardEventCollector.Builder(this._utils, this._elements, this._dataQ, this._perfMonitor);
e.withMessageBus((0, g.inject)("MessageBus")).withCutEventEmitter((0, g.inject)("CutEventEmitter")).withCopyEventEmitter((0, g.inject)("CopyEventEmitter")).withPasteEventEmitter((0, g.inject)("PasteEventEmitter")), this._features.defaultFeatures.ClipboardEvents.instance = e.build()
}
}
}, {
name: "ElementEvents",
className: M.ElementEventCollector,
init: function init(r) {
return function() {
var e = new r.SiteMapper(MutationObserver, this._utils, "jQueryElementListenerConfig", null, !1),
t = (0, p["default"])((0, g.inject)("StandardInputEventsEmitter"), (0, g.inject)("StandardOnClickEventsEmitter"), (0, g.inject)("StandardOnChangeEventsEmitter"), (0, g.inject)("StandardOnFormEventsEmitter")),
n = new M.ElementEventCollector.Builder(this._configurationRepository, this._utils, this._elements, this._dataQ, this._perfMonitor);
n.withjQueryElementListenerSiteMapper(e), n.withMessageBus((0, g.inject)("MessageBus")), n.withMutationEmitter((0, g.inject)("MutationEmitter")), n.withjQueryElementsHandler(t), n.withInputEvents(y["default"], _.inputSelectors), n.withStandardInputEventsEmitter((0, g.inject)("StandardInputEventsEmitter")), n.withSyntheticMaskInputEventsHandler((0, g.inject)("SyntheticMaskInputEventsHandler")), n.withSyntheticAutotabInputEventsHandler((0, g.inject)("SyntheticAutotabInputEventsHandler")), n.withClickEvents(C["default"], b.onClickSelectors), n.withStandardOnClickEventsEmitter((0, g.inject)("StandardOnClickEventsEmitter")), n.withChangeEvents(O["default"], w.onChangeSelectors), n.withStandardOnChangeEventsEmitter((0, g.inject)("StandardOnChangeEventsEmitter")), n.withFormEvents(B["default"], S.onFormSelectors), n.withStandardOnFormEventsEmitter((0, g.inject)("StandardOnFormEventsEmitter")), this._features.defaultFeatures.ElementEvents.instance = n.build()
}
}
}, {
name: "WindowEvents",
className: M.WindowEventCollector,
init: function init() {
return function() {
var e = new M.WindowEventCollector.Builder(this._configurationRepository, this._utils, this._dataQ, this._perfMonitor);
e.withMessageBus((0, g.inject)("MessageBus")), e.withFocusEventEmitter((0, g.inject)("FocusEventEmitter")), e.withBlurEventEmitter((0, g.inject)("BlurEventEmitter")), e.withResizeEventEmitter((0, g.inject)("ResizeEventEmitter")), e.withDOMContentLoadedEventEmitter((0, g.inject)("DOMContentLoadedEventEmitter")), e.withVisibilityChangeEventEmitter((0, g.inject)("VisibilityChangeEventEmitter")), e.withScrollEventEmitter((0, g.inject)("ScrollEventEmitter")), this._features.defaultFeatures.WindowEvents.instance = e.build()
}
}
}],
perContextFeatures: [{
name: "ElementEvents",
className: M.ElementEventCollector,
init: function init() {
this._features.perContextFeatures.ElementEvents.instance = this._features.defaultFeatures.ElementEvents.instance
}
}],
nonDefaultFeatures: [{
name: "CrossDomain",
className: m["default"],
init: function init(t) {
return function() {
var e = new m["default"].Builder(this._configurationRepository, this._dataQ, this._perfMonitor, this._utils, t.Map, t.DataMappingDefs.CROSS_MUID_EVENT_MAP, t.EnumDefs.Events.crossmuidEventType);
e.withMessageBus((0, g.inject)("MessageBus")), e.withWindowMessageEventEmitter((0, g.inject)("WindowMessageEventEmitter")), this._features.nonDefaultFeatures.CrossDomain.instance = e.build()
}
}
}, {
name: "OrientationEvents",
className: M.OrientationEventCollector,
init: function init() {
return function() {
this._features.nonDefaultFeatures.OrientationEvents.instance = new M.OrientationEventCollector(this._configurationRepository, this._utils, this._sensorDataQ, this._perfMonitor, (0, g.inject)("MessageBus"), (0, g.inject)("DeviceOrientationEventEmitter"))
}
}
}, {
name: "BeforeInstallPromptEvents",
className: M.BeforeInstallPromptEventCollector,
init: function init() {
return function() {
this._features.nonDefaultFeatures.BeforeInstallPromptEvents.instance = new M.BeforeInstallPromptEventCollector(this._dataQ, this._utils, (0, g.inject)("MessageBus"), (0, g.inject)("BeforeInstallPromptEventEmitter"))
}
}
}]
},
k = function k(t, n) {
var r = !0;
return Object.keys(t).forEach(function(e) {
n.hasOwnProperty(e) && n[e] === t[e] && (r = !1)
}), r
};
t["default"] = function(i, s) {
P.defaultFeatures.forEach(function(e) {
var t = "defaultFeatures",
n = e.className.getDefaultSettings()[t];
if (!("object" === (void 0 === s ? "undefined" : a(s)) && 0 < Object.keys(s).length && k(s, n))) {
var r = e.name;
n.init = e.init(i), i.FeaturesList[t][r] = n
}
}), P.perContextFeatures.forEach(function(e) {
var t = "perContextFeatures",
n = e.className.getDefaultSettings()[t];
if (!("object" === (void 0 === s ? "undefined" : a(s)) && 0 < Object.keys(s).length && k(s, n))) {
var r = e.name;
n.init = e.init, i.FeaturesList[t][r] = n
}
}), P.nonDefaultFeatures.forEach(function(e) {
var t = "nonDefaultFeatures",
n = e.className.getDefaultSettings()[t];
if (!("object" === (void 0 === s ? "undefined" : a(s)) && 0 < Object.keys(s).length && k(s, n))) {
var r = e.name;
n.init = e.init(i), i.FeaturesList[t][r] = n
}
})
}
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(0));
function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var s = {
defaultFeatures: {
configKey: "isElementsEvent",
shouldRun: !0,
isFrameRelated: !0,
runInUns: !1,
runInSlave: !0,
isRunning: !1,
instance: null
},
perContextFeatures: {
configKey: "isElementsEvent",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
isRunning: !0,
instance: null
}
},
a = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(ElementEventCollector, i["default"]), r(ElementEventCollector, null, [{
key: "getDefaultSettings",
value: function getDefaultSettings() {
return s
}
}, {
key: "Builder",
get: function get() {
function Builder(e, t, n, r, i) {
_classCallCheck(this, Builder), this.configurationRepository = e, this.utils = t, this.elements = n, this.dataQ = r, this.perfMonitor = i
}
return r(Builder, [{
key: "withMessageBus",
value: function withMessageBus(e) {
return this.messageBus = e, this
}
}, {
key: "withMutationEmitter",
value: function withMutationEmitter(e) {
return this.mutationEmitter = e, this
}
}, {
key: "withjQueryElementListenerSiteMapper",
value: function withjQueryElementListenerSiteMapper(e) {
return this.jQueryElementListenerSiteMapper = e, this
}
}, {
key: "withjQueryElementsHandler",
value: function withjQueryElementsHandler(e) {
return this.JqueryElementsHandler = e, this
}
}, {
key: "withInputEvents",
value: function withInputEvents(e, t) {
return this.InputEvents = e, this.inputSelectors = t, this
}
}, {
key: "withStandardInputEventsEmitter",
value: function withStandardInputEventsEmitter(e) {
return this.StandardInputEventsEmitter = e, this
}
}, {
key: "withSyntheticMaskInputEventsHandler",
value: function withSyntheticMaskInputEventsHandler(e) {
return this.SyntheticMaskInputEventsHandler = e, this
}
}, {
key: "withSyntheticAutotabInputEventsHandler",
value: function withSyntheticAutotabInputEventsHandler(e) {
return this.SyntheticAutotabInputEventsHandler = e, this
}
}, {
key: "withClickEvents",
value: function withClickEvents(e, t) {
return this.ClickEvents = e, this.onClickSelectors = t, this
}
}, {
key: "withStandardOnClickEventsEmitter",
value: function withStandardOnClickEventsEmitter(e) {
return this.StandardOnClickEventsEmitter = e, this
}
}, {
key: "withChangeEvents",
value: function withChangeEvents(e, t) {
return this.ChangeEvents = e, this.onChangeSelectors = t, this
}
}, {
key: "withStandardOnChangeEventsEmitter",
value: function withStandardOnChangeEventsEmitter(e) {
return this.StandardOnChangeEventsEmitter = e, this
}
}, {
key: "withFormEvents",
value: function withFormEvents(e, t) {
return this.FormEvents = e, this.onFormSelectors = t, this
}
}, {
key: "withStandardOnFormEventsEmitter",
value: function withStandardOnFormEventsEmitter(e) {
return this.StandardOnFormEventsEmitter = e, this
}
}, {
key: "build",
value: function build() {
return new ElementEventCollector(this)
}
}]), Builder
}
}]), r(ElementEventCollector, [{
key: "stopFeature",
value: function stopFeature(e) {
e = e || window.self, this._inputEvents.unbind(e), this._clickEvents.unbind(e), this._changeEvents.unbind(e), this._formEvents.unbind(e), this._jQueryElementListenerSiteMapper.stopTracking(), this._mutationEmitter.stopObserver(e)
}
}, {
key: "updateFeatureConfig",
value: function updateFeatureConfig(e) {
e = e || window.self, this._configurationRepository.get("isMutationObserver") && this._mutationEmitter && (this._mutationEmitter.startObserver(e), this._jQueryElementListenerSiteMapper.onConfigUpdate(this._configurationRepository)), this._isHashedValue = this._configurationRepository.get("isElementHashedValue") !== undefined ? this._configurationRepository.get("isElementHashedValue") : this._isHashedValue, this._hashTruncationLength = this._configurationRepository.get("elementHashTruncationLength") !== undefined ? this._configurationRepository.get("elementHashTruncationLength") : this._hashTruncationLength, this._elements.updateFeatureConfig()
}
}, {
key: "sendToQueue",
value: function sendToQueue(e, t) {
var n = this.getExports().EnumDefs.Events.isTrusted[e.isTrusted],
r = this.getEventTimestamp(e),
i = this.getTimestampFromEvent(e),
s = this.getExports().EnumDefs.Events.elementEventType[e.type];
this._utils.isUndefinedNull(s) && (s = -1);
var a = this._elements.getElement(e.target),
o = this._utils.StorageUtils.getAndUpdateEventSequenceNumber();
(t = t || {}).elementValues && t.elementValues.length > this._maxElemValLength && (t.elementValues = "");
var u = this._isHashedValue && (e.target.value || e.target.innerHTML) ? this._utils.getTruncatedHash(e.target.value, this._hashTruncationLength) : "";
Object.extend(t, {
eventType: s,
eventSequence: o,
timestamp: r,
elementHash: a,
isTrusted: n,
hashedValue: u,
relativeTime: i
}), this._dataQ.addToQueue("element_events", this._utils.convertToArrayByMap(this.getExports().DataMappingDefs.ELEMENT_EVENT_MAP, t), !0)
}
}]), ElementEventCollector);
function ElementEventCollector(e) {
_classCallCheck(this, ElementEventCollector);
var i = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (ElementEventCollector.__proto__ || Object.getPrototypeOf(ElementEventCollector)).call(this, e.perfMonitor));
return i.mutationMessageHandler = function(e) {
e.frame && (i._inputEvents.addOnLoadInputData(e.frame, !0), i._inputEvents.bind(e.frame), i._clickEvents.bind(e.frame), i._changeEvents.bind(e.frame), i._formEvents.bind(e.frame))
}, i.startFeature = function(e) {
e = e || window.self, i._inputEvents.addOnLoadInputData(e, !1), i._inputEvents.bind(e), i._clickEvents.bind(e), i._changeEvents.bind(e), i._formEvents.bind(e), i._configurationRepository.get(i.getExports().ConfigurationFields.isMutationObserver) && i._mutationEmitter && (i._mutationEmitter.startObserver(e), i._jQueryElementListenerSiteMapper.initTracking())
}, i._onSiteMapperMatch = function(e) {
var t = e.selector;
if (t) try {
var n = window.document.querySelector(t);
if (!n) return void log.error("ElementEvents._onSiteMapperMatch - selector:" + JSON.stringify(t) + " not found on page");
if (i._utils.DomUtils.matches(n, i._inputSelectors)) i._jqueryEventHandler.bindInputEvents(n);
else if (i._utils.DomUtils.matches(n, i._onClickSelectors)) i._jqueryEventHandler.bindOnClickEvents(n);
else if (i._utils.DomUtils.matches(n, i._onChangeSelectors)) i._jqueryEventHandler.bindOnChangeEvents(n);
else {
if (!i._utils.DomUtils.matches(n, i._onFormSelectors)) return void log.error("ElementEvents._onSiteMapperMatch - Unable to match the element with selector:\n " + JSON.stringify(t) + " to any selectors group. Aborting jQuery element listening process.");
i._jqueryEventHandler.bindOnFormsEvents(n)
}
} catch (r) {
log.error("ElementEvents._onSiteMapperMatch - " + r.message, r)
} else log.warn("ElementEvents._onSiteMapperMatch - No selector defined for match. Aborting jQuery element listening process.")
}, i._configurationRepository = e.configurationRepository, i._utils = e.utils, i._dataQ = e.dataQ, i._perfMonitor = e.perfMonitor, i._elements = e.elements, i._jQueryElementListenerSiteMapper = e.jQueryElementListenerSiteMapper, i._jQueryElementListenerSiteMapper.updateObserver(i._onSiteMapperMatch), i._messageBus = e.messageBus, i._mutationEmitter = e.mutationEmitter, i._messageBus.subscribe(i._messageBus.getChannels().MUTATIONSINGLE, i.mutationMessageHandler), i._StandardInputEventsEmitter = e.StandardInputEventsEmitter, i._SyntheticMaskInputEventsHandler = e.SyntheticMaskInputEventsHandler, i._SyntheticAutotabInputEventsHandler = e.SyntheticAutotabInputEventsHandler, i._inputEvents = new e.InputEvents(i._perfMonitor, i._elements, i.sendToQueue.bind(i), i._utils, i._messageBus, i._StandardInputEventsEmitter, i._SyntheticMaskInputEventsHandler, i._SyntheticAutotabInputEventsHandler), i._inputSelectors = e.inputSelectors, i._StandardOnClickEventsEmitter = e.StandardOnClickEventsEmitter, i._clickEvents = new e.ClickEvents(i._perfMonitor, i.sendToQueue.bind(i), i._utils, i._messageBus, i._StandardOnClickEventsEmitter), i._onClickSelectors = e.onClickSelectors, i._StandardOnChangeEventsEmitter = e.StandardOnChangeEventsEmitter, i._changeEvents = new e.ChangeEvents(i._perfMonitor, i.sendToQueue.bind(i), i._utils, i._messageBus, i._StandardOnChangeEventsEmitter), i._onChangeSelectors = e.onChangeSelectors, i._StandardOnFormEventsEmitter = e.StandardOnFormEventsEmitter, i._formEvents = new e.FormEvents(i._perfMonitor, i.sendToQueue.bind(i), i._messageBus, i._StandardOnFormEventsEmitter), i._onFormSelectors = e.onFormSelectors, i._jqueryEventHandler = e.JqueryElementsHandler, i._maxElemValLength = 200, i._isHashedValue = i._configurationRepository.get("isElementHashedValue") || !1, i._hashTruncationLength = i._configurationRepository.get("elementHashTruncationLength") || 2, i
}
t["default"] = a
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(0));
function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var s = {
defaultFeatures: {
configKey: "isClipboardEvent",
shouldRun: !0,
isFrameRelated: !0,
runInUns: !1,
runInSlave: !0,
isRunning: !1,
instance: null
}
},
a = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(ClipboardEventCollector, i["default"]), r(ClipboardEventCollector, null, [{
key: "getDefaultSettings",
value: function getDefaultSettings() {
return s
}
}, {
key: "Builder",
get: function get() {
function Builder(e, t, n, r) {
_classCallCheck(this, Builder), this.utils = e, this.dataQueue = n, this.perfMonitor = r, this.elements = t
}
return r(Builder, [{
key: "withMessageBus",
value: function withMessageBus(e) {
return this.messageBus = e, this
}
}, {
key: "withCutEventEmitter",
value: function withCutEventEmitter(e) {
return this.cutEventEmitter = e, this
}
}, {
key: "withCopyEventEmitter",
value: function withCopyEventEmitter(e) {
return this.copyEventEmitter = e, this
}
}, {
key: "withPasteEventEmitter",
value: function withPasteEventEmitter(e) {
return this.pasteEventEmitter = e, this
}
}, {
key: "build",
value: function build() {
return new ClipboardEventCollector(this)
}
}]), Builder
}
}]), r(ClipboardEventCollector, [{
key: "stopFeature",
value: function stopFeature(e) {
try {
var t = (e = e || window.self).document || e.contentDocument;
this._cutEventEmitter.stop(t), this._messageBus.unsubscribe(this._messageBus.getChannels().CUTEVENT, this._handleClipboardEvent), this._copyEventEmitter.stop(t), this._messageBus.unsubscribe(this._messageBus.getChannels().COPYEVENT, this._handleClipboardEvent), this._pasteEventEmitter.stop(t), this._messageBus.unsubscribe(this._messageBus.getChannels().PASTEEVENT, this._handleClipboardEvent)
} catch (n) {
log.error("Failed stopping the ClipboardEvents feature. msg: " + n.message, n)
}
}
}]), ClipboardEventCollector);
function ClipboardEventCollector(e) {
_classCallCheck(this, ClipboardEventCollector);
var o = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (ClipboardEventCollector.__proto__ || Object.getPrototypeOf(ClipboardEventCollector)).call(this, e.perfMonitor));
return o.startFeature = function(e) {
try {
var t = (e = e || window.self).document || e.contentDocument;
o._cutEventEmitter.start(t), o._messageBus.subscribe(o._messageBus.getChannels().CUTEVENT, o._handleClipboardEvent), o._copyEventEmitter.start(t), o._messageBus.subscribe(o._messageBus.getChannels().COPYEVENT, o._handleClipboardEvent), o._pasteEventEmitter.start(t), o._messageBus.subscribe(o._messageBus.getChannels().PASTEEVENT, o._handleClipboardEvent)
} catch (n) {
log.error("Failed starting the ClipboardEvents feature. msg: " + n.message, n)
}
}, o._handleClipboardEvent = function(e) {
o._sendToQueue(e)
}, o._sendToQueue = function(e) {
try {
var t = o.getEventTimestamp(e),
n = o._elements.getElement(e.target),
r = o._utils.StorageUtils.getAndUpdateEventSequenceNumber(),
i = e.clipboardData ? e.clipboardData.getData("text") : window.clipboardData ? window.clipboardData.getData("text") : "";
"" !== (i = i || "") && (i = i.replace(/[\d]/g, "1").replace(/[a-zA-Z]/g, "a").replace(/[^a-zA-Z\d]/g, "*"));
var s = o.getExports().EnumDefs.Events.clipboardEventType[e.type];
o._utils.isUndefinedNull(s) && (s = -1), o._dataQueue.addToQueue("clipboard_events", o.getExports().CDUtils.convertToArrayByMap(o.getExports().DataMappingDefs.CLIPBOARD_EVENT_MAP, {
eventSequence: r,
timestamp: t,
elementHash: n,
copiedText: i,
clipboardEventType: s
}))
} catch (a) {
log.error("Failed handling ClipboardEvent. msg: " + a.message, a)
}
}, o._utils = e.utils, o._dataQueue = e.dataQueue, o._perfMonitor = e.perfMonitor, o._elements = e.elements, o._messageBus = e.messageBus, o._cutEventEmitter = e.cutEventEmitter, o._copyEventEmitter = e.copyEventEmitter, o._pasteEventEmitter = e.pasteEventEmitter, o
}
t["default"] = a
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(0));
var s = {
nonDefaultFeatures: {
configKey: "isOrientationEvents",
shouldRun: !0,
isFrameRelated: !1,
runInSlave: !1,
runInUns: !1,
isRunning: !1,
instance: null
}
},
a = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(OrientationEventCollector, i["default"]), r(OrientationEventCollector, null, [{
key: "getDefaultSettings",
value: function getDefaultSettings() {
return s
}
}]), r(OrientationEventCollector, [{
key: "startFeature",
value: function startFeature() {
window.DeviceOrientationEvent && (this._deviceOrientationEventEmitter.start(), this._messageBus.subscribe(this._messageBus.getChannels().DEVICEORIENATIONEVENT, this._handleDeviceOrientationEvent))
}
}, {
key: "stopFeature",
value: function stopFeature() {
window.DeviceOrientationEvent && (this._deviceOrientationEventEmitter.stop(), this._messageBus.unsubscribe(this._messageBus.getChannels().DEVICEORIENATIONEVENT, this._handleDeviceOrientationEvent))
}
}, {
key: "updateFeatureConfig",
value: function updateFeatureConfig() {
var e = this._configurationRepository.get("orientationEventsSamplePeriod");
this._samplePeriod = e !== undefined ? e : this._samplePeriod
}
}]), OrientationEventCollector);
function OrientationEventCollector(e, t, n, r, i, s) {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, OrientationEventCollector);
var o = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (OrientationEventCollector.__proto__ || Object.getPrototypeOf(OrientationEventCollector)).call(this, r));
return o._handleDeviceOrientationEvent = function(e) {
var t = o._utils.dateNow();
if (e && t - o._lastTime > o._samplePeriod) {
var n = e.absolute || !1,
r = o._utils.isUndefinedNull(e.alpha) ? 0 : o._utils.cutDecimalPointDigits(e.alpha, 4),
i = o._utils.isUndefinedNull(e.beta) ? 0 : o._utils.cutDecimalPointDigits(e.beta, 4),
s = o._utils.isUndefinedNull(e.gamma) ? 0 : o._utils.cutDecimalPointDigits(e.gamma, 4);
if (r !== o._lastAlpha || i !== o._lastBeta || s !== o._lastGamma) {
log.isDebug() && log.debug("OrientationEvents:_onOrientationEvent, sending data: timestamp: " + t + "\n alpha,betta,gamma: " + r + "," + i + "," + s + ",prevTime:" + o._lastTime), o._lastTime = t, o._lastAlpha = r, o._lastBeta = i, o._lastGamma = s;
var a = o._utils.StorageUtils.getAndUpdateEventSequenceNumber();
o._dataQ.addToQueue("orientation_events", [null, a, t, n, r, i, s])
}
}
}, o._dataQ = n, o._configurationRepository = e, o._utils = t, o._samplePeriod = o._configurationRepository.get("orientationEventsSamplePeriod") || 0, o._lastAlpha = 0, o._lastBeta = 0, o._lastGamma = 0, o._lastTime = 0, o._messageBus = i, o._deviceOrientationEventEmitter = s, o
}
t["default"] = a
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(0));
var s = {
nonDefaultFeatures: {
configKey: "isBeforeInstallPrompt",
shouldRun: !1,
isFrameRelated: !1,
runInUns: !1,
isRunning: !1,
instance: null
}
},
a = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(BeforeInstallPromptEventCollector, i["default"]), r(BeforeInstallPromptEventCollector, null, [{
key: "getDefaultSettings",
value: function getDefaultSettings() {
return s
}
}]), r(BeforeInstallPromptEventCollector, [{
key: "startFeature",
value: function startFeature() {
this._eventEmitter.start(window), this._messageBus.subscribe(this._messageBus.getChannels().BEFOREINSTALLPROMPTEVENT, this._onBeforeInstallPrompt)
}
}, {
key: "stopFeature",
value: function stopFeature() {
this._eventEmitter.stop(window), this._messageBus.unsubscribe(this._messageBus.getChannels().BEFOREINSTALLPROMPTEVENT, this._onBeforeInstallPrompt)
}
}]), BeforeInstallPromptEventCollector);
function BeforeInstallPromptEventCollector(e, t, n, r) {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, BeforeInstallPromptEventCollector);
var s = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (BeforeInstallPromptEventCollector.__proto__ || Object.getPrototypeOf(BeforeInstallPromptEventCollector)).call(this));
return s._onBeforeInstallPrompt = function(e) {
var t = s._utils.StorageUtils.getAndUpdateEventSequenceNumber(),
n = s.getEventTimestamp(),
r = s.getTimestampFromEvent(e),
i = e.platforms ? e.platforms.join(",") : "";
s._dataQueue.addToQueue("before_install_prompt", s.getExports().CDUtils.convertToArrayByMap(s.getExports().DataMappingDefs.BEFORE_INSTALL_PROMPT_EVENT_MAP, {
eventSequence: t,
timestamp: n,
platforms: i,
relativeTime: r
}))
}, s._messageBus = n, s._eventEmitter = r, s._dataQueue = e, s._utils = t, s
}
t["default"] = a
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(0));
function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var s = {
defaultFeatures: {
configKey: "isWindowEvents",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
runInSlave: !1,
isRunning: !1,
instance: null
}
},
a = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(WindowEventCollector, i["default"]), r(WindowEventCollector, null, [{
key: "getDefaultSettings",
value: function getDefaultSettings() {
return s
}
}, {
key: "Builder",
get: function get() {
function Builder(e, t, n, r) {
_classCallCheck(this, Builder), this.configurationRepository = e, this.utils = t, this.dataQueue = n, this.perfMonitor = r
}
return r(Builder, [{
key: "withMessageBus",
value: function withMessageBus(e) {
return this.messageBus = e, this
}
}, {
key: "withFocusEventEmitter",
value: function withFocusEventEmitter(e) {
return this.focusEventEmitter = e, this
}
}, {
key: "withBlurEventEmitter",
value: function withBlurEventEmitter(e) {
return this.blurEventEmitter = e, this
}
}, {
key: "withResizeEventEmitter",
value: function withResizeEventEmitter(e) {
return this.resizeEventEmitter = e, this
}
}, {
key: "withDOMContentLoadedEventEmitter",
value: function withDOMContentLoadedEventEmitter(e) {
return this.domContentLoadedEventEmitter = e, this
}
}, {
key: "withVisibilityChangeEventEmitter",
value: function withVisibilityChangeEventEmitter(e) {
return this.visibilityChangeEventEmitter = e, this
}
}, {
key: "withScrollEventEmitter",
value: function withScrollEventEmitter(e) {
return this.scrollEventEmitter = e, this
}
}, {
key: "build",
value: function build() {
return new WindowEventCollector(this)
}
}]), Builder
}
}]), WindowEventCollector);
function WindowEventCollector(e) {
_classCallCheck(this, WindowEventCollector);
var a = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (WindowEventCollector.__proto__ || Object.getPrototypeOf(WindowEventCollector)).call(this, e.perfMonitor));
return a.startFeature = function(e) {
try {
e = e || window.self, a._resizeEventEmitter.start(e), a._messageBus.subscribe(a._messageBus.getChannels().RESIZEEVENT, a._onWindowEvent), a._focusEventEmitter.start(e), a._messageBus.subscribe(a._messageBus.getChannels().FOCUSEVENT, a._onWindowEvent), a._blurEventEmitter.start(e), a._messageBus.subscribe(a._messageBus.getChannels().BLUREVENT, a._onWindowEvent), a._domContentLoadedEventEmitter.start(e.document), a._messageBus.subscribe(a._messageBus.getChannels().DOMCONTENTLOADEDEVENT, a._onWindowEvent), a._visibilityChangeEventEmitter.start(e.document), a._messageBus.subscribe(a._messageBus.getChannels().VISIBILITYCHANGEEVENT, a._onWindowEvent), a._configurationRepository.get("isScrollCollect") && (a._scrollEventEmitter.start(e), a._messageBus.subscribe(a._messageBus.getChannels().SCROLLEVENT, a._onWindowEvent))
} catch (t) {
log.error("Failed starting the WindowEventCollector. msg: " + t.message, t)
}
}, a.stopFeature = function(e) {
try {
e = e || window.self, a._resizeEventEmitter.stop(e), a._messageBus.unsubscribe(a._messageBus.getChannels().RESIZEEVENT, a._onWindowEvent), a._focusEventEmitter.stop(e), a._messageBus.unsubscribe(a._messageBus.getChannels().FOCUSEVENT, a._onWindowEvent), a._blurEventEmitter.stop(e), a._messageBus.unsubscribe(a._messageBus.getChannels().BLUREVENT, a._onWindowEvent), a._domContentLoadedEventEmitter.stop(e.document), a._messageBus.unsubscribe(a._messageBus.getChannels().DOMCONTENTLOADEDEVENT, a._onWindowEvent), a._visibilityChangeEventEmitter.stop(e.document), a._messageBus.unsubscribe(a._messageBus.getChannels().VISIBILITYCHANGEEVENT, a._onWindowEvent), a._configurationRepository.get("isScrollCollect") && (a._scrollEventEmitter.stop(e), a._messageBus.unsubscribe(a._messageBus.getChannels().SCROLLEVENT, a._onWindowEvent))
} catch (t) {
log.error("Failed stopping the ClipboardEvents feature. msg: " + t.message, t)
}
}, a.updateFeatureConfig = function(e) {
e = e || window.self, a._configurationRepository.get("isScrollCollect") ? a._configurationRepository.get("isScrollCollect") && (a._scrollEventEmitter.start(e), a._messageBus.subscribe(a._messageBus.getChannels().SCROLLEVENT, a._onWindowEvent)) : (a._scrollEventEmitter.stop(e), a._messageBus.unsubscribe(a._messageBus.getChannels().SCROLLEVENT, a._onWindowEvent))
}, a._onWindowEvent = function(e) {
return a._sendToQueue(e), !0
}, a._sendToQueue = function(e) {
var t = void 0,
n = a.getExports().EnumDefs.Events.isTrusted[undefined];
"DOMContentLoaded" === e.type ? t = (new Date).getTime() : (t = a.getEventTimestamp(e), n = a.getExports().EnumDefs.Events.isTrusted[e.isTrusted]), log.isDebug() && (log.trace("got event " + e.type + " at time " + t), log.trace("adding to queue - screen(width,height): " + screen.width + "," + screen.height + " window(width,height): " + window.innerWidth + "," + window.innerHeight));
var r = a._utils.StorageUtils.getAndUpdateEventSequenceNumber(),
i = "visibilitychange" !== e.type ? e.type : "hidden" === document.visibilityState ? "tabBlur" : "tabFocus",
s = a.getExports().EnumDefs.Events.windowEventType[i];
null != s && s !== undefined || (s = -1), a._dataQueue.addToQueue("window_events", a.getExports().CDUtils.convertToArrayByMap(a.getExports().DataMappingDefs.WINDOW_EVENT_MAP, {
eventType: s,
eventSequence: r,
timestamp: t,
screenWidth: screen.width ? Math.round(screen.width) : -1,
screenHeight: screen.height ? Math.round(screen.height) : -1,
clientWidth: window.innerWidth ? Math.round(window.innerWidth) : -1,
clientHeight: window.innerHeight ? Math.round(window.innerHeight) : -1,
documentWidth: document.body && document.body.clientWidth ? Math.round(document.body.clientWidth) : -1,
documentHeight: document.body && document.body.clientHeight ? Math.round(document.body.clientHeight) : -1,
scrollTop: document.body && document.body.scrollTop ? Math.round(document.body.scrollTop) : 0,
scrollLeft: document.body && document.body.scrollLeft ? Math.round(document.body.scrollLeft) : 0,
windowInnerWidth: window.innerWidth ? Math.round(window.innerWidth) : -1,
windowInnerHeight: window.innerHeight ? Math.round(window.innerHeight) : -1,
windowOuterWidth: window.outerWidth ? Math.round(window.outerWidth) : -1,
windowOuterHeight: window.outerHeight ? Math.round(window.outerHeight) : -1,
isTrusted: n
}))
}, a._configurationRepository = e.configurationRepository, a._utils = e.utils, a._dataQueue = e.dataQueue, a._perfMonitor = e.perfMonitor, a._messageBus = e.messageBus, a._focusEventEmitter = e.focusEventEmitter, a._blurEventEmitter = e.blurEventEmitter, a._resizeEventEmitter = e.resizeEventEmitter, a._domContentLoadedEventEmitter = e.domContentLoadedEventEmitter, a._visibilityChangeEventEmitter = e.visibilityChangeEventEmitter, a._scrollEventEmitter = e.scrollEventEmitter, a
}
t["default"] = a
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t.inputSelectors = undefined;
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(1));
var o = t.inputSelectors = "input:not([type='color']):not([type='hidden']):not([type='file']):not([type='image']):not([type='button']):not([type='radio']):not([type='checkbox']), textarea",
s = function s(a) {
return {
applyAction: function _applyAction(e, t, n) {
if (!["start", "stop"].includes(t)) return !1;
for (var r = [], i = ((e = e || window.self).document || e.contentDocument).querySelectorAll(o), s = 0; s < i.length; s++) r.push(i[s]);
0 < r.length && a[t](r, e, n)
}
}
},
a = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(InputEvents, i["default"]), r(InputEvents, [{
key: "bind",
value: function bind(e) {
e = e || window.self, this._messageBus.subscribe(this._messageBus.getChannels().STANDARDINPUTEVENTINPUT, this.handleInputEvents), this._messageBus.subscribe(this._messageBus.getChannels().STANDARDINPUTEVENTFOCUS, this.handleFocusBlurEvents), this._messageBus.subscribe(this._messageBus.getChannels().STANDARDINPUTEVENTBLUR, this.handleFocusBlurEvents), this._messageBus.subscribe(this._messageBus.getChannels().SYNTHETICINPUTMASKEVENT, this.handleSyntheticInputEvents), s(this._StandardInputEventsEmitter).applyAction(e, "start"), s(this._SyntheticMaskInputEventsHandler).applyAction(e, "start"), s(this._SyntheticAutotabInputEventsHandler).applyAction(e, "start")
}
}, {
key: "unbind",
value: function unbind(e) {
e = e || window.self, s(this._StandardInputEventsEmitter).applyAction(e, "stop"), s(this._SyntheticMaskInputEventsHandler).applyAction(e, "stop"), s(this._SyntheticAutotabInputEventsHandler).applyAction(e, "stop"), this._messageBus.unsubscribe(this._messageBus.getChannels().STANDARDINPUTEVENTINPUT, this.handleInputEvents), this._messageBus.unsubscribe(this._messageBus.getChannels().STANDARDINPUTEVENTFOCUS, this.handleFocusBlurEvents), this._messageBus.unsubscribe(this._messageBus.getChannels().STANDARDINPUTEVENTBLUR, this.handleFocusBlurEvents), this._messageBus.unsubscribe(this._messageBus.getChannels().SYNTHETICINPUTMASKEVENT, this.handleSyntheticInputEvents)
}
}, {
key: "addOnLoadInputData",
value: function addOnLoadInputData(e, t) {
this.handlerProlog("t.EE_OnLoad");
for (var n = (e = e || window.self).document.querySelectorAll(o), r = 0; r < n.length; r++) {
var i = n[r];
this._elements.isListed(i) ? t || this._elements.resendElementPerContext(i) : this._elements.getElement(i, !1)
}
this.handlerEpilog("t.EE_OnLoad")
}
}]), InputEvents);
function InputEvents(e, t, n, r, i, s, a, o) {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, InputEvents);
var u = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (InputEvents.__proto__ || Object.getPrototypeOf(InputEvents)).call(this, e));
return u.handleInputEvents = function(e) {
"InputEvent" === e.constructor.name && u._inputEventsPerElement.set(e.target, {}), u.handlerProlog("t.EE_InputChange");
var t = e.target.value || "";
"" !== t && (t = u._CDUtils.maskText(t)), u._sendToQueue(e, {
length: t ? t.length : 0,
elementValues: t,
selected: -1
}), u.handlerEpilog("t.EE_InputChange")
}, u.handleFocusBlurEvents = function(e) {
u.handlerProlog("t.EE_FocusBlurChange"), u._sendToQueue(e, {
length: 0,
selected: -1,
elementValues: ""
}), u.handlerEpilog("t.EE_FocusBlurChange")
}, u.handleSyntheticInputEvents = function(e) {
if (!u._inputEventsPerElement.has(e.target) || "undefined" != typeof e.jQueryMask && ("autotab" === e.jQueryMask || "prasleyValidator" === e.jQueryMask)) {
u.handlerProlog("t.EE_InputChangeSynthetic");
var t = e.target.value || "";
"" !== t && (t = u._CDUtils.maskText(t)), u._sendToQueue(e, {
length: t ? t.length : 0,
elementValues: t,
selected: -1
}), u.handlerEpilog("t.EE_InputChangeSynthetic")
}
}, u._elements = t, u._sendToQueue = n, u._messageBus = i, u._CDUtils = r, u._StandardInputEventsEmitter = s, u._SyntheticMaskInputEventsHandler = a, u._SyntheticAutotabInputEventsHandler = o, u._inputEventsPerElement = new WeakMap, u
}
t["default"] = a
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t.onFormSelectors = undefined;
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(1));
var s = t.onFormSelectors = "form",
a = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(FormEvents, i["default"]), r(FormEvents, [{
key: "bind",
value: function bind(e) {
var t = (e = e || window.self).document || e.contentDocument;
this._messageBus.subscribe(this._messageBus.getChannels().STANDARDONFORMSUBMITEVENT, this.handleOnFormEvents), this.addListenersBySelector(t)
}
}, {
key: "unbind",
value: function unbind(e) {
for (var t = [], n = ((e = e || window.self).document || e.contentDocument).querySelectorAll(s), r = 0; r < n.length; r++) t.push(n[r]);
this._StandardOnFormEventsEmitter.stop(t), this._messageBus.unsubscribe(this._messageBus.getChannels().STANDARDONFORMSUBMITEVENT, this.handleOnFormEvents)
}
}, {
key: "addListenersBySelector",
value: function addListenersBySelector(e) {
for (var t = [], n = e.querySelectorAll(s), r = 0; r < n.length; r++) t.push(n[r]);
this._StandardOnFormEventsEmitter.start(t)
}
}]), FormEvents);
function FormEvents(e, t, n, r) {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, FormEvents);
var i = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (FormEvents.__proto__ || Object.getPrototypeOf(FormEvents)).call(this, e));
return i.handleOnFormEvents = function(e) {
log.trace("ElementEvents:_onFormSubmitEvent"), i._sendToQueue(e, {
length: 0,
selected: -1,
elementValues: ""
})
}, i._perfMonitor = e, i._sendToQueue = t, i._messageBus = n, i._StandardOnFormEventsEmitter = r, i
}
t["default"] = a
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t.onClickSelectors = undefined;
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(1));
var s = t.onClickSelectors = "input[type='button'], input[type='radio'], input[type='checkbox'], button",
a = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(ClickEvents, i["default"]), r(ClickEvents, [{
key: "bind",
value: function bind(e) {
var t = (e = e || window.self).document || e.contentDocument;
this._messageBus.subscribe(this._messageBus.getChannels().STANDARDONCLICKEVENT, this.handleOnClickEvents), this.addListenersBySelector(t)
}
}, {
key: "unbind",
value: function unbind(e) {
for (var t = [], n = ((e = e || window.self).document || e.contentDocument).querySelectorAll(s), r = 0; r < n.length; r++) t.push(n[r]);
this._StandardOnClickEventsEmitter.stop(t), this._messageBus.unsubscribe(this._messageBus.getChannels().STANDARDONCLICKEVENT, this.handleOnClickEvents)
}
}, {
key: "addListenersBySelector",
value: function addListenersBySelector(e) {
for (var t = [], n = e.querySelectorAll(s), r = 0; r < n.length; r++) t.push(n[r]);
this._StandardOnClickEventsEmitter.start(t)
}
}]), ClickEvents);
function ClickEvents(e, t, n, r, i) {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, ClickEvents);
var s = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (ClickEvents.__proto__ || Object.getPrototypeOf(ClickEvents)).call(this, e));
return s.handleOnClickEvents = function(e) {
s.handlerProlog("t.EE_Click");
var t = e.target,
n = t.value || t.innerHTML;
n = s._CDUtils.clearTextFromNumbers(n), s._sendToQueue(e, {
length: n.length,
elementValues: n,
selected: t.checked === undefined ? -1 : t.checked ? 1 : 0
}), s.handlerEpilog("t.EE_Click")
}, s._perfMonitor = e, s._sendToQueue = t, s._CDUtils = n, s._messageBus = r, s._StandardOnClickEventsEmitter = i, s
}
t["default"] = a
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t.onChangeSelectors = undefined;
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(1));
var s = t.onChangeSelectors = "select",
a = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(ChangeEvents, i["default"]), r(ChangeEvents, [{
key: "bind",
value: function bind(e) {
var t = (e = e || window.self).document || e.contentDocument;
this._messageBus.subscribe(this._messageBus.getChannels().STANDARDONCHANGEEVENT, this.handleOnChangeEvents), this.addListenersBySelector(t)
}
}, {
key: "unbind",
value: function unbind(e) {
for (var t = [], n = ((e = e || window.self).document || e.contentDocument).querySelectorAll(s), r = 0; r < n.length; r++) t.push(n[r]);
this._StandardOnChangeEventsEmitter.stop(t), this._messageBus.unsubscribe(this._messageBus.getChannels().STANDARDONCHANGEEVENT, this.handleOnChangeEvents)
}
}, {
key: "addListenersBySelector",
value: function addListenersBySelector(e) {
for (var t = [], n = e.querySelectorAll(s), r = 0; r < n.length; r++) t.push(n[r]);
this._StandardOnChangeEventsEmitter.start(t)
}
}]), ChangeEvents);
function ChangeEvents(e, t, n, r, i) {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, ChangeEvents);
var s = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (ChangeEvents.__proto__ || Object.getPrototypeOf(ChangeEvents)).call(this, e));
return s.handleOnChangeEvents = function(e) {
s.handlerProlog("t.EE_Change");
var t = s._CDUtils.getDropDownListValues(e.target).join(";");
t = s._CDUtils.clearTextFromNumbers(t);
var n = e.target.selectedIndex,
r = e.target.value.length;
s._sendToQueue(e, {
length: r,
selected: n,
elementValues: t
}), s.handlerEpilog("t.EE_Change")
}, s._perfMonitor = e, s._sendToQueue = t, s._CDUtils = n, s._messageBus = r, s._StandardOnChangeEventsEmitter = i, s
}
t["default"] = a
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = n(5);
Object.defineProperty(t, "FeaturesListInitializer", {
enumerable: !0,
get: function get() {
return function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(r)["default"]
}
})
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = n(6);
Object.defineProperty(t, "ElementEventCollector", {
enumerable: !0,
get: function get() {
return _interopRequireDefault(r)["default"]
}
});
var i = n(7);
Object.defineProperty(t, "ClipboardEventCollector", {
enumerable: !0,
get: function get() {
return _interopRequireDefault(i)["default"]
}
});
var s = n(8);
Object.defineProperty(t, "OrientationEventCollector", {
enumerable: !0,
get: function get() {
return _interopRequireDefault(s)["default"]
}
});
var a = n(9);
Object.defineProperty(t, "BeforeInstallPromptEventCollector", {
enumerable: !0,
get: function get() {
return _interopRequireDefault(a)["default"]
}
});
var o = n(10);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}
Object.defineProperty(t, "WindowEventCollector", {
enumerable: !0,
get: function get() {
return _interopRequireDefault(o)["default"]
}
})
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t["default"] = function JqueryElementsHandler(e, t, n, r) {
return i = e, s = t, a = n, o = r, {
bindInputEvents: _bindInputEvents,
bindOnClickEvents: _bindOnClickEvents,
bindOnChangeEvents: _bindOnChangeEvents,
bindOnFormsEvents: _bindOnFormsEvents
}
};
var i = null,
s = null,
a = null,
o = null;
function _bindInputEvents(e) {
i.removeElementEvents(e), i.addElementEvents(e, !0)
}
function _bindOnClickEvents(e) {
s.removeElementEvents(e), s.addElementEvents(e, !0)
}
function _bindOnChangeEvents(e) {
a.removeElementEvents(e), a.addElementEvents(e, !0)
}
function _bindOnFormsEvents(e) {
o.removeElementEvents(e), o.addElementEvents(e, !0)
}
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t.DOMAIN_STATES_PROPS = t.DOMAIN_REGEX = t.CSP_REGEX = undefined;
var r = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
}
return e
},
i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
},
s = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var a = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(0));
function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}
var o = {
nonDefaultFeatures: {
configKey: "isCrossdomain",
shouldRun: !0,
isFrameRelated: !1,
runInUns: !1,
runInSlave: !1,
isRunning: !1,
instance: null
}
},
u = t.CSP_REGEX = /(?=(child\-src)|(frame\-src))([^;]+)/gi,
l = t.DOMAIN_REGEX = /http[s]?:\/\/([^\/]+)/gi,
c = t.DOMAIN_STATES_PROPS = {
resource: null,
iframeElement: !1,
blockedByCSP: !1,
iframeLoaded: !1,
ACKMessageSent: !1,
ACKMessageRecieved: !1,
unavailable: !1
},
d = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(CrossDomain, a["default"]), s(CrossDomain, null, [{
key: "getDefaultSettings",
value: function getDefaultSettings() {
return o
}
}, {
key: "generateRandomID",
value: function generateRandomID() {
for (var e = "abcdefghijklmnopqrstuvwxyz0123456789", t = "", n = 0; n < 16; n++) t += e.charAt(Math.floor(Math.random() * e.length));
return t
}
}, {
key: "Builder",
get: function get() {
function Builder(e, t, n, r, i, s, a) {
_classCallCheck(this, Builder), this.configurationRepository = e, this.dataQ = t, this.perfMonitor = n, this.utils = r, this.Map = i, this.dataMappingDefs = s, this.eventType = a
}
return s(Builder, [{
key: "withMessageBus",
value: function withMessageBus(e) {
return this.messageBus = e, this
}
}, {
key: "withWindowMessageEventEmitter",
value: function withWindowMessageEventEmitter(e) {
return this.windowMessageEventEmitter = e, this
}
}, {
key: "build",
value: function build() {
return new CrossDomain(this)
}
}]), Builder
}
}]), CrossDomain);
function CrossDomain(e) {
_classCallCheck(this, CrossDomain);
var o = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (CrossDomain.__proto__ || Object.getPrototypeOf(CrossDomain)).call(this, e.perfMonitor));
return o.startFeature = function(e) {
e = e || window.self, o._domainsResources = o._configurationRepository.get("crossDomainsList"), o._crossDomainsTimeout = o._configurationRepository.get("crossDomainsTimeout"), Array.isArray(o._domainsResources) && 0 < o._domainsResources.length && (o._windowMessageEmitter.startObserver(e), o._domainsResources.map(function(e) {
var t = e.match(l);
if (null !== t && "string" == typeof t[0]) {
var n = t[0];
if ("object" === i(o._domainsStates[n])) return;
o._domainsStates[n] = r({}, c), o._domainsStates[n].resource = e, o._domains.push(n)
}
}), Array.isArray(o._domains) && 0 < o._domains.length && (o.isBlockedByCSP(e, o._domains), o._utils.DomUtils.onDocumentBody(e, function() {
o.connectDomains(e)
})))
}, o.stopFeature = function(e) {
e = e || window.self, o.clearFeaturesObjects(e)
}, o.clearFeaturesObjects = function(t) {
t = t || window.self, o._windowMessageEmitter.stopObserver(t), Array.isArray(o._domains) && 0 < o._domains.length && (o._domains.forEach(function(e) {
o.clearDomElements(t, e)
}), o._domains = [], o._domainsStates = {})
}, o.connectDomains = function(t) {
Array.isArray(o._domains) && 0 < o._domains.length && (o._domains.forEach(function(e) {
o._domainsStates[e].blockedByCSP || !1 !== o._domainsStates[e].iframeElement || o.createIframe(t, e)
}), setTimeout(function() {
o._domains.forEach(function(e) {
"object" === i(o._domainsStates[e]) && !1 === o._domainsStates[e].ACKMessageRecieved && !1 === o._domainsStates[e].unavailable && (log.warn("Cross Domain feature - domain " + e + " is unavailable"), o._domainsStates[e].unavailable = !0, o.clearDomElements(t, e))
})
}, o._crossDomainsTimeout))
}, o.createIframe = function(e, t) {
var n = e.document.createElement("iframe");
n.onload = function() {
o.postNextMessage(t)
}, n.id = CrossDomain.generateRandomID(), n.src = o._domainsStates[t].resource, n.style.display = "none", n.style.opacity = "0", n.width = "1", n.height = "1", e.document.body.appendChild(n), o._domainsStates[t].iframeElement = n
}, o.clearDomElements = function(e, t) {
e = e || window.self;
var n = o._domainsStates[t].iframeElement;
"object" === (void 0 === n ? "undefined" : i(n)) && null !== e.document.getElementById(o._domainsStates[t].iframeElement.id) && e.document.body.removeChild(n)
}, o.postNextMessage = function(e) {
if (!o._domainsStates[e].ACKMessageRecieved && o._domainsStates[e].iframeElement) {
var t = {
muid: o._generatedMUID
};
o._domainsStates[e].iframeElement.contentWindow.postMessage(JSON.stringify(t), e), o._domainsStates[e].ACKMessageSent = !0
}
}, o.isBlockedByCSP = function(e, n) {
if (!Array.isArray(n) || n.length < 1) throw new Error("Domains are expected for content security policy assertion");
e = e || window.self;
var r = !1;
[].slice.call(e.document.getElementsByTagName("meta")).forEach(function(e) {
if ("Content-Security-Policy" === e.getAttribute("http-equiv")) {
r = !0;
var t = e.getAttribute("content").match(u);
n.forEach(function(e) {
t && -1 === t[0].indexOf(e) && "object" === i(o._domainsStates[e]) && (o._domainsStates[e].blockedByCSP = !0, log.warn("Cross Domain feature - domain " + e + " is blocked by CSP"))
})
}
if (r) return !1
})
}, o.windowMessageHandler = function(e) {
var t = e.message.origin;
if (o._domainsStates.hasOwnProperty(t)) {
if (!0 === o._domainsStates[t].ACKMessageRecieved) return;
o._domainsStates[t].ACKMessageRecieved = !0, o.clearDomElements(e.message.currentTarget, t);
var n = e.message.data;
o.sendToQueue(t, n)
}
}, o.sendToQueue = function(e, s) {
var a = e.replace(/http[s]?:\/\//i, "");
"object" === i(s.found) && Object.keys(s.found).forEach(function(e) {
var t = o._utils.StorageUtils.getAndUpdateEventSequenceNumber(),
n = a,
r = s.found[e].split("__"),
i = {
eventType: o._eventType.found,
eventSequence: t,
domainUrl: n,
muid: r[0],
timestamp: r[1]
};
o._dataQ.addToQueue("crossmuid_event", o._utils.convertToArrayByMap(o._dataMappingDefs, i), !0)
}), "object" === i(s["new"]) && Object.keys(s["new"]).forEach(function(e) {
var t = o._utils.StorageUtils.getAndUpdateEventSequenceNumber(),
n = a,
r = s["new"][e].split("__"),
i = {
eventType: o._eventType["new"],
eventSequence: t,
domainUrl: n,
muid: r[0],
timestamp: r[1]
};
o._dataQ.addToQueue("crossmuid_event", o._utils.convertToArrayByMap(o._dataMappingDefs, i))
}), "object" === i(s.error_message) && log.warn("Cross Domain feature - domain " + a + " error. Error Message: \n " + s.error_message + " Code: " + s.error_code)
}, o.updateFeatureConfig = function(e) {
e = e || window.self, o._domainsResources = o._configurationRepository.get("crossDomainsList"), o.updateDomainStates(e)
}, o.updateDomainStates = function(e) {
Array.isArray(o._domainsResources) && 0 < o._domainsResources.length && (o._domains = [], o._domainsResources.map(function(e) {
var t = e.match(l);
if (null !== t && "string" == typeof t[0]) {
var n = t[0];
"object" !== i(o._domainsStates[n]) && (o._domainsStates[n] = r({}, c), o._domainsStates[n].resource = e), o._domains.push(n)
}
}), Array.isArray(o._domains) && 0 < o._domains.length && (o.isBlockedByCSP(e, o._domains), o._utils.DomUtils.onDocumentBody(e, function() {
o.connectDomains(e)
})))
}, o._configurationRepository = e.configurationRepository, o._dataQ = e.dataQ, o._perfMonitor = e.perfMonitor, o._utils = e.utils, o._dataMappingDefs = e.dataMappingDefs, o._eventType = e.eventType, o._messageBus = e.messageBus, o._windowMessageEmitter = e.windowMessageEventEmitter, o._messageBus.subscribe(o._messageBus.getChannels().WINDOWMESSAGEEVENT, o.windowMessageHandler), o._generatedMUID = o._utils.dateNow() + "-" + o._utils.generateUUID().toUpperCase(), o._domainsStates = {}, o._domainsResources = [], o._domains = [], o
}
t["default"] = d
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var a = !1;
! function() {
try {
var e = Object.defineProperty({}, "passive", {
get: function get() {
a = !0
}
});
window.addEventListener("test", null, e)
} catch (t) {}
}();
var i = (r(EventAggregator, null, [{
key: "addEventListener",
value: function addEventListener(e, t, n) {
var r = 3 < arguments.length && arguments[3] !== undefined && arguments[3],
i = !(4 < arguments.length && arguments[4] !== undefined) || arguments[4],
s = 5 < arguments.length && arguments[5] !== undefined && arguments[5];
a ? e.addEventListener(t, n, {
capture: r,
passive: i,
once: s
}) : e.addEventListener ? e.addEventListener(t, n, r) : e.attachEvent("on" + t, n)
}
}, {
key: "removeEventListener",
value: function removeEventListener(e, t, n) {
var r = 3 < arguments.length && arguments[3] !== undefined && arguments[3];
e.removeEventListener ? e.removeEventListener(t, n, r) : e.detachEvent("on" + t, n)
}
}]), EventAggregator);
function EventAggregator() {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, EventAggregator)
}
t["default"] = i
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var a = function a(e) {
return !(!e.jQuery || !e.jQuery._data)
},
r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(SyntheticMaskInputEventsHandler, [{
key: "start",
value: function start(e, i) {
var s = this;
i = i || window.self, e.forEach(function(e) {
if (a(i) && s.hasMaskEventSupported(e, i) && !s._elementBindingWMap.has(e)) {
var r = {};
s.defaultEventListener.forEach(function(t) {
var n = function n(e) {
t.handler(e, i)
};
r[t.event] = n, s._eventAggregator.addEventListener(e, t.event, n)
}), s._elementBindingWMap.set(e, {
isBinded: !0,
listeners: r
})
}
})
}
}, {
key: "stop",
value: function stop(e) {
var r = this;
e.forEach(function(t) {
var n = r._elementBindingWMap.get(t);
n && n.isBinded && (r.defaultEventListener.forEach(function(e) {
r._eventAggregator.removeEventListener(t, e.event, n.listeners[e.event])
}), r._elementBindingWMap["delete"](t))
})
}
}, {
key: "hasMaskEventSupported",
value: function hasMaskEventSupported(e, t) {
var n = t.jQuery._data(e, "events");
if (void 0 === n) return !1;
for (var r = Object.keys(n), i = 0; i < r.length; i++)
if ("unmask" === r[i]) return !0;
return !1
}
}]), SyntheticMaskInputEventsHandler);
function SyntheticMaskInputEventsHandler(e, t, n) {
var i = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, SyntheticMaskInputEventsHandler), this.handleKeypressEvents = function(e, t) {
if (a(t) && i.hasMaskEventSupported(e.target, t)) {
var n = e.key,
r = Object.assign({}, {
bubbles: !0,
cancelBubble: !1,
cancelable: !1,
composed: !0,
currentTarget: null,
data: n,
dataTransfer: null,
defaultPrevented: !1,
detail: 0,
eventPhase: 0,
inputType: "insertText",
isComposing: !1,
isTrusted: !0,
jQueryMask: "maskedInput",
returnValue: !0,
sourceCapabilities: null,
srcElement: Object.assign(e.target || e.srcElement, {}),
target: Object.assign(e.target, {}),
timeStamp: e.timeStamp,
type: "input",
view: null,
which: 0
});
i._messageBus.publish(i._messageBus.getChannels().SYNTHETICINPUTMASKEVENT, r)
}
}, this._messageBus = e, this._eventAggregator = t, this._elementBindingWMap = new WeakMap, this._utils = n, this.defaultEventListener = [{
event: "keypress",
handler: this.handleKeypressEvents
}]
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var a = function a(e) {
return !(!e.jQuery || !e.jQuery._data)
},
r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(SyntheticAutotabInputEventsHandler, [{
key: "start",
value: function start(e, i) {
var s = this;
i = i || window.self, e.forEach(function(e) {
if (a(i) && s.hasjQueryAutoTab(e, i) && !s._elementBindingWMap.has(e)) {
var r = {};
s.defaultEventListener.forEach(function(t) {
var n = function n(e) {
t.handler(e, i)
};
r[t.event] = n, s._eventAggregator.addEventListener(e, t.event, n)
}), s._elementBindingWMap.set(e, {
isBinded: !0,
listeners: r
})
}
})
}
}, {
key: "stop",
value: function stop(e) {
var r = this;
e.forEach(function(t) {
var n = r._elementBindingWMap.get(t);
n && n.isBinded && (r.defaultEventListener.forEach(function(e) {
r._eventAggregator.removeEventListener(t, e.event, n.listeners[e.event])
}), r._elementBindingWMap["delete"](t))
})
}
}, {
key: "hasjQueryAutoTab",
value: function hasjQueryAutoTab(e, t) {
if (void 0 === t.jQuery._data(e, "events")) return !1;
for (var n = Object.keys(t.jQuery._data(e, "events")), r = 0; r < n.length; r++)
if (-1 !== n[r].indexOf("autotab")) return !0;
return !1
}
}]), SyntheticAutotabInputEventsHandler);
function SyntheticAutotabInputEventsHandler(e, t, n) {
var s = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, SyntheticAutotabInputEventsHandler), this.handleKeypressEvents = function(e, t) {
if (a(t) && s.hasjQueryAutoTab(e.target, t)) {
var n = "insertText",
r = e.key;
if (8 === e.keyCode) return n = "deleteContentBackward", void(r = null);
var i = Object.assign({}, {
bubbles: !0,
cancelBubble: !1,
cancelable: !1,
composed: !0,
currentTarget: null,
data: r,
dataTransfer: null,
defaultPrevented: !1,
detail: 0,
eventPhase: 0,
inputType: n,
isComposing: !1,
isTrusted: !0,
jQueryMask: "autotab",
returnValue: !0,
sourceCapabilities: null,
srcElement: Object.assign(e.target || e.srcElement, {}),
target: Object.assign(e.target, {}),
timeStamp: e.timeStamp,
type: "input",
view: null,
which: 0
});
s._messageBus.publish(s._messageBus.getChannels().SYNTHETICINPUTMASKEVENT, i)
}
}, this._messageBus = e, this._eventAggregator = t, this._elementBindingWMap = new WeakMap, this._utils = n, this.defaultEventListener = [{
event: "keypress",
handler: this.handleKeypressEvents
}]
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(StandardOnFormEventsEmitter, [{
key: "start",
value: function start(e) {
var n = this;
e.forEach(function(t) {
n._elementBindingWMap.has(t) || (n.defaultOnFormEventListener.forEach(function(e) {
n._eventAggregator.addEventListener(t, e.event, e.handler)
}), n._elementBindingWMap.set(t, {
isBinded: !0,
listeners: [n.handleOnFormSubmitEvents],
isUsingJQuery: !1
}))
})
}
}, {
key: "stop",
value: function stop(e) {
var n = this;
e.forEach(function(t) {
var e = n._elementBindingWMap.get(t);
e && e.isBinded && (n.defaultOnFormEventListener.forEach(function(e) {
n._eventAggregator.removeEventListener(t, e.event, e.handler)
}), n._elementBindingWMap["delete"](t))
})
}
}, {
key: "addElementEvents",
value: function addElementEvents(t) {
var n = this,
e = 1 < arguments.length && arguments[1] !== undefined && arguments[1];
if (!this._elementBindingWMap.has(t)) {
if (e) {
if (!this._utils.JQueryUtils.isJQueryAvailable()) return void log.error("Unable to add event listeners for element using jQuery because jQuery is not available");
this.defaultOnFormEventListener.forEach(function(e) {
n._utils.JQueryUtils.addEventListener(t, e.event, e.handler)
})
} else this.defaultOnFormEventListener.forEach(function(e) {
n._eventAggregator.addEventListener(t, e.event, e.handler)
});
this._elementBindingWMap.set(t, {
isBinded: !0,
listeners: [this.handleOnFormSubmitEvents],
isUsingJQuery: e
})
}
}
}, {
key: "removeElementEvents",
value: function removeElementEvents(t) {
var n = this,
e = this._elementBindingWMap.get(t);
if (e && e.isBinded) {
if (e.isUsingJQuery) {
if (!this._utils.JQueryUtils.isJQueryAvailable()) return void log.error("Unable to remove event listeners for element using jQuery because jQuery is not available");
this.defaultOnFormEventListener.forEach(function(e) {
n._utils.JQueryUtils.removeEventListener(t, e.event, e.handler)
})
} else this.defaultOnFormEventListener.forEach(function(e) {
n._eventAggregator.removeEventListener(elements, e.event, e.handler)
});
this._elementBindingWMap["delete"](t)
}
}
}]), StandardOnFormEventsEmitter);
function StandardOnFormEventsEmitter(e, t, n) {
var r = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, StandardOnFormEventsEmitter), this.handleOnFormSubmitEvents = function(e) {
r._messageBus.publish(r._messageBus.getChannels().STANDARDONFORMSUBMITEVENT, e)
}, this._messageBus = e, this._eventAggregator = t, this._elementBindingWMap = new WeakMap, this._utils = n, this.defaultOnFormEventListener = [{
event: "submit",
handler: this.handleOnFormSubmitEvents
}]
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(StandardOnClickEventsEmitter, [{
key: "start",
value: function start(e) {
var n = this;
e.forEach(function(t) {
n._elementBindingWMap.has(t) || (n.defaultOnClickEventListener.forEach(function(e) {
n._eventAggregator.addEventListener(t, e.event, e.handler)
}), n._elementBindingWMap.set(t, {
isBinded: !0,
listeners: [n.handleOnClickEvents],
isUsingJQuery: !1
}))
})
}
}, {
key: "stop",
value: function stop(e) {
var n = this;
e.forEach(function(t) {
var e = n._elementBindingWMap.get(t);
e && e.isBinded && (n.defaultOnClickEventListener.forEach(function(e) {
n._eventAggregator.removeEventListener(t, e.event, e.handler)
}), n._elementBindingWMap["delete"](t))
})
}
}, {
key: "addElementEvents",
value: function addElementEvents(t) {
var n = this,
e = 1 < arguments.length && arguments[1] !== undefined && arguments[1];
if (!this._elementBindingWMap.has(t)) {
if (e) {
if (!this._utils.JQueryUtils.isJQueryAvailable()) return void log.error("Unable to add event listeners for element using jQuery because jQuery is not available");
this.defaultOnClickEventListener.forEach(function(e) {
n._utils.JQueryUtils.addEventListener(t, e.event, e.handler)
})
} else this.defaultOnClickEventListener.forEach(function(e) {
n._eventAggregator.addEventListener(t, e.event, e.handler)
});
this._elementBindingWMap.set(t, {
isBinded: !0,
listeners: [this.handleOnClickEvents],
isUsingJQuery: e
})
}
}
}, {
key: "removeElementEvents",
value: function removeElementEvents(t) {
var n = this,
e = this._elementBindingWMap.get(t);
if (e && e.isBinded) {
if (e.isUsingJQuery) {
if (!this._utils.JQueryUtils.isJQueryAvailable()) return void log.error("Unable to remove event listeners for element using jQuery because jQuery is not available");
this.defaultOnClickEventListener.forEach(function(e) {
n._utils.JQueryUtils.removeEventListener(t, e.event, e.handler)
})
} else this.defaultOnClickEventListener.forEach(function(e) {
n._eventAggregator.removeEventListener(elements, e.event, e.handler)
});
this._elementBindingWMap["delete"](t)
}
}
}]), StandardOnClickEventsEmitter);
function StandardOnClickEventsEmitter(e, t, n) {
var r = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, StandardOnClickEventsEmitter), this.handleOnClickEvents = function(e) {
r._messageBus.publish(r._messageBus.getChannels().STANDARDONCLICKEVENT, e)
}, this._messageBus = e, this._eventAggregator = t, this._elementBindingWMap = new WeakMap, this._utils = n, this.defaultOnClickEventListener = [{
event: "click",
handler: this.handleOnClickEvents
}]
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(StandardOnChangeEventsEmitter, [{
key: "start",
value: function start(e) {
var n = this;
e.forEach(function(t) {
n._elementBindingWMap.has(t) || (n.defaultOnChangeEventListener.forEach(function(e) {
n._eventAggregator.addEventListener(t, e.event, e.handler)
}), n._elementBindingWMap.set(t, {
isBinded: !0,
listeners: [n.handleOnChangeEvents],
isUsingJQuery: !1
}))
})
}
}, {
key: "stop",
value: function stop(e) {
var n = this;
e.forEach(function(t) {
var e = n._elementBindingWMap.get(t);
e && e.isBinded && (n.defaultOnChangeEventListener.forEach(function(e) {
n._eventAggregator.removeEventListener(t, e.event, e.handler)
}), n._elementBindingWMap["delete"](t))
})
}
}, {
key: "addElementEvents",
value: function addElementEvents(t) {
var n = this,
e = 1 < arguments.length && arguments[1] !== undefined && arguments[1];
if (!this._elementBindingWMap.has(t)) {
if (e) {
if (!this._utils.JQueryUtils.isJQueryAvailable()) return void log.error("Unable to add event listeners for element using jQuery because jQuery is not available");
this.defaultOnChangeEventListener.forEach(function(e) {
n._utils.JQueryUtils.addEventListener(t, e.event, e.handler)
})
} else this.defaultOnChangeEventListener.forEach(function(e) {
n._eventAggregator.addEventListener(t, e.event, e.handler)
});
this._elementBindingWMap.set(t, {
isBinded: !0,
listeners: [this.handleOnChangeEvents],
isUsingJQuery: e
})
}
}
}, {
key: "removeElementEvents",
value: function removeElementEvents(t) {
var n = this,
e = this._elementBindingWMap.get(t);
if (e && e.isBinded) {
if (e.isUsingJQuery) {
if (!this._utils.JQueryUtils.isJQueryAvailable()) return void log.error("Unable to remove event listeners for element using jQuery because jQuery is not available");
this.defaultOnChangeEventListener.forEach(function(e) {
n._utils.JQueryUtils.removeEventListener(t, e.event, e.handler)
})
} else this.defaultOnChangeEventListener.forEach(function(e) {
n._eventAggregator.removeEventListener(elements, e.event, e.handler)
});
this._elementBindingWMap["delete"](t)
}
}
}]), StandardOnChangeEventsEmitter);
function StandardOnChangeEventsEmitter(e, t, n) {
var r = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, StandardOnChangeEventsEmitter), this.handleOnChangeEvents = function(e) {
r._messageBus.publish(r._messageBus.getChannels().STANDARDONCHANGEEVENT, e)
}, this._messageBus = e, this._eventAggregator = t, this._elementBindingWMap = new WeakMap, this._utils = n, this.defaultOnChangeEventListener = [{
event: "change",
handler: this.handleOnChangeEvents
}]
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(StandardInputEventsEmitter, [{
key: "start",
value: function start(e, r, i) {
var s = this;
e.forEach(function(t) {
if (!s._elementBindingWMap.has(t)) {
var n = [];
void 0 !== i ? "function" == typeof i.func && Array.isArray(i.allowedEvents) && 0 < i.allowedEvents.length && (i.func(r, t) ? s.defaultInputEventListener.forEach(function(e) {
i.allowedEvents.includes(e.event) && n.push(e)
}) : n = Array.from(s.defaultInputEventListener)) : n = Array.from(s.defaultInputEventListener), n.forEach(function(e) {
s._eventAggregator.addEventListener(t, e.event, e.handler)
}), s._elementBindingWMap.set(t, {
isBinded: !0,
listeners: [s.handleInputEvents, s.handleFocusEvents, s.handleBlurEvents],
isUsingJQuery: !1
})
}
})
}
}, {
key: "stop",
value: function stop(e) {
var n = this;
e.forEach(function(t) {
var e = n._elementBindingWMap.get(t);
e && e.isBinded && (n.defaultInputEventListener.forEach(function(e) {
n._eventAggregator.removeEventListener(t, e.event, e.handler)
}), n._elementBindingWMap["delete"](t))
})
}
}, {
key: "addElementEvents",
value: function addElementEvents(t) {
var n = this,
e = 1 < arguments.length && arguments[1] !== undefined && arguments[1];
if (!this._elementBindingWMap.has(t)) {
if (e) {
if (!this._utils.JQueryUtils.isJQueryAvailable()) return void log.error("Unable to add event listeners for element using jQuery because jQuery is not available");
this.defaultInputEventListener.forEach(function(e) {
n._utils.JQueryUtils.addEventListener(t, e.event, e.handler)
})
} else this.defaultInputEventListener.forEach(function(e) {
n._eventAggregator.addEventListener(t, e.event, e.handler)
});
this._elementBindingWMap.set(t, {
isBinded: !0,
listeners: [this.handleInputEvents, this.handleFocusEvents, this.handleBlurEvents],
isUsingJQuery: e
})
}
}
}, {
key: "removeElementEvents",
value: function removeElementEvents(t) {
var n = this,
e = this._elementBindingWMap.get(t);
if (e && e.isBinded) {
if (e.isUsingJQuery) {
if (!this._utils.JQueryUtils.isJQueryAvailable()) return void log.error("Unable to remove event listeners for element using jQuery because jQuery is not available");
this.defaultInputEventListener.forEach(function(e) {
n._utils.JQueryUtils.removeEventListener(t, e.event, e.handler)
})
} else this.defaultInputEventListener.forEach(function(e) {
n._eventAggregator.removeEventListener(elements, e.event, e.handler)
});
this._elementBindingWMap["delete"](t)
}
}
}]), StandardInputEventsEmitter);
function StandardInputEventsEmitter(e, t, n) {
var r = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, StandardInputEventsEmitter), this.handleInputEvents = function(e) {
r._messageBus.publish(r._messageBus.getChannels().STANDARDINPUTEVENTINPUT, e)
}, this.handleFocusEvents = function(e) {
r._messageBus.publish(r._messageBus.getChannels().STANDARDINPUTEVENTFOCUS, e)
}, this.handleBlurEvents = function(e) {
r._messageBus.publish(r._messageBus.getChannels().STANDARDINPUTEVENTBLUR, e)
}, this._messageBus = e, this._eventAggregator = t, this._elementBindingWMap = new WeakMap, this._utils = n, this.defaultInputEventListener = [{
event: "input",
handler: this.handleInputEvents
}, {
event: "focus",
handler: this.handleFocusEvents
}, {
event: "blur",
handler: this.handleBlurEvents
}]
}
t["default"] = r
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
},
i = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var s = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(27));
var a = (i(MutationEmitter, [{
key: "startObserver",
value: function startObserver(i) {
var s = this,
e = (i = i || window.self).document || i.contentDocument;
if (!this._documentObservers.has(e)) {
var t = new window.MutationObserver(function(e) {
try {
for (var t = 0; t < e.length; t++) {
var n = e[t];
if (0 < n.addedNodes.length) {
s.handleMutationEvent(n, i);
break
}
}
} catch (r) {
log.error("An error has occurred: " + r.message)
}
});
t.observe(e, {
childList: !0,
subtree: !0
}), this._documentObservers.set(e, {
instance: t
})
}
}
}, {
key: "stopObserver",
value: function stopObserver(e) {
var t = (e = e || window.self).document || e.contentDocument,
n = void 0;
this._documentObservers.has(t) && (n = this._documentObservers.get(t)) && (n.instance && n.instance.disconnect(), this._documentObservers["delete"](t))
}
}]), MutationEmitter);
function MutationEmitter(e) {
var n = this;
if (function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, MutationEmitter), this.handleMutationEvent = function(e, t) {
return e && t && n._messageBus.publish(n._messageBus.getChannels().MUTATIONSINGLE, {
mutation: e,
frame: t
})
}, this._messageBus = e, "object" !== r(this._messageBus)) throw new Error("Bootstrap aborted! MessageBus missing for MutationEmitter");
this._documentObservers = new WeakMap
}
t["default"] = (0, s["default"])(a)
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
t["default"] = function(e) {
return function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(_class2, e), r(_class2, [{
key: "hasInstance",
value: function hasInstance(e) {}
}, {
key: "getInstance",
value: function getInstance(e) {}
}, {
key: "deleteInstance",
value: function deleteInstance(e) {}
}]), _class2;
function _class2() {
var e;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, _class2);
for (var t = arguments.length, n = Array(t), r = 0; r < t; r++) n[r] = arguments[r];
var i = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (e = _class2.__proto__ || Object.getPrototypeOf(_class2)).call.apply(e, [this].concat(n)));
return i._frameInstances = new WeakMap, i
}
}
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(n(29));
var s = (r(MessageBus, [{
key: "getChannels",
value: function getChannels() {
return i["default"]
}
}, {
key: "subscribe",
value: function subscribe(e, t) {
var n = 2 < arguments.length && arguments[2] !== undefined && arguments[2],
r = null,
i = !1;
this.subscribers.has(e) ? (r = this.subscribers.get(e)) && r.forEach(function(e) {
t === e.handler && (i = !0)
}) : (r = new this._SET, this.subscribers.set(e, r)), i || r.add({
handler: t,
isOneTime: n
})
}
}, {
key: "unsubscribe",
value: function unsubscribe(e, t) {
if (e && this.subscribers.has(e)) {
var n = this.subscribers.get(e);
n && n.forEach(function(e) {
t === e.handler && n["delete"](e)
}), 0 === n.size && this.subscribers["delete"](e)
}
}
}, {
key: "publish",
value: function publish(e, t) {
this.notifySubscribers({
channel: e,
data: t
})
}
}, {
key: "notifySubscribers",
value: function notifySubscribers(t) {
var e = t.channel;
if (e && this.subscribers.has(e)) {
var n = this.subscribers.get(e);
n && n.forEach(function(e) {
e.handler(t.data), e.isOneTime && n["delete"](e)
})
}
}
}]), MessageBus);
function MessageBus(e, t) {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, MessageBus), this._MAP = e, this._SET = t, this.subscribers = new this._MAP
}
t["default"] = s
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
}), t["default"] = {
MUTATIONSINGLE: "mutation:single",
MUTATIONALL: "mutation:all",
CONFIGUPDATED: "config:loaded",
CONFIGFAILED: "config:failed",
STANDARDINPUTEVENTINPUT: "events:standardinputeventinput",
STANDARDINPUTEVENTFOCUS: "events:standardinputeventfocus",
STANDARDINPUTEVENTBLUR: "events:standardinputeventblur",
STANDARDONCLICKEVENT: "events:standardonclickevent",
STANDARDONCHANGEEVENT: "events:standardonchangeevent",
STANDARDONFORMSUBMITEVENT: "events:standardoformsubmiteevent",
SYNTHETICINPUTMASKEVENT: "events:syntheticinputmaskevent",
CUTEVENT: "events:cutevent",
COPYEVENT: "events:copyevent",
PASTEEVENT: "events:pasteevent",
DEVICEORIENATIONEVENT: "events:deviceorientationevent",
BEFOREINSTALLPROMPTEVENT: "events:beforeinstallpromptevent",
FOCUSEVENT: "events:focusevent",
BLUREVENT: "events:blurevent",
RESIZEEVENT: "events:resizeevent",
DOMCONTENTLOADEDEVENT: "events:domcontentloadedevent",
VISIBILITYCHANGEEVENT: "events:visibilitychangeevent",
SCROLLEVENT: "events:scroll",
WINDOWMESSAGEEVENT: "events:windowmessageevent"
}
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(PasteEventEmitter, [{
key: "start",
value: function start(e) {
if (!e) throw new Error("invalid document parameter");
this._eventAggregator.addEventListener(e, "paste", this.handlePasteEvent)
}
}, {
key: "stop",
value: function stop(e) {
if (!e) throw new Error("invalid document parameter");
this._eventAggregator.removeEventListener(e, "paste", this.handlePasteEvent)
}
}]), PasteEventEmitter);
function PasteEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, PasteEventEmitter), this.handlePasteEvent = function(e) {
n._messageBus.publish(n._messageBus.getChannels().PASTEEVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(CutEventEmitter, [{
key: "start",
value: function start(e) {
if (!e) throw new Error("invalid document parameter");
this._eventAggregator.addEventListener(e, "cut", this.handleCutEvent)
}
}, {
key: "stop",
value: function stop(e) {
if (!e) throw new Error("invalid document parameter");
this._eventAggregator.removeEventListener(e, "cut", this.handleCutEvent)
}
}]), CutEventEmitter);
function CutEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, CutEventEmitter), this.handleCutEvent = function(e) {
n._messageBus.publish(n._messageBus.getChannels().CUTEVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(CopyEventEmitter, [{
key: "start",
value: function start(e) {
if (!e) throw new Error("invalid document parameter");
this._eventAggregator.addEventListener(e, "copy", this.handleCopyEvent)
}
}, {
key: "stop",
value: function stop(e) {
if (!e) throw new Error("invalid document parameter");
this._eventAggregator.removeEventListener(e, "copy", this.handleCopyEvent)
}
}]), CopyEventEmitter);
function CopyEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, CopyEventEmitter), this.handleCopyEvent = function(e) {
n._messageBus.publish(n._messageBus.getChannels().COPYEVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = n(34),
i = function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(r);
t["default"] = {
setExport: r.setExport,
Application: i["default"]
}
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
t.setExport = function setExport(e) {
j = e, (0, a.injectExports)(j)
};
var i = n(2),
s = _interopRequireDefault(n(4)),
a = n(3),
o = _interopRequireDefault(n(15)),
u = _interopRequireDefault(n(5)),
l = _interopRequireDefault(n(19)),
c = _interopRequireDefault(n(35)),
d = _interopRequireDefault(n(20)),
f = _interopRequireDefault(n(21)),
v = _interopRequireDefault(n(22)),
h = _interopRequireDefault(n(23)),
E = _interopRequireDefault(n(24)),
p = _interopRequireDefault(n(25)),
m = _interopRequireDefault(n(36)),
g = _interopRequireDefault(n(26)),
_ = _interopRequireDefault(n(28)),
y = _interopRequireDefault(n(37)),
b = _interopRequireDefault(n(38)),
C = _interopRequireDefault(n(39)),
w = _interopRequireDefault(n(30)),
O = _interopRequireDefault(n(40)),
S = _interopRequireDefault(n(41)),
B = _interopRequireDefault(n(42)),
M = _interopRequireDefault(n(31)),
P = _interopRequireDefault(n(32)),
k = _interopRequireDefault(n(43)),
T = _interopRequireDefault(n(44));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}
var D = {};
D.Index = o["default"], D.FeaturesList = u["default"];
var j = {};
var A = {
MessageBus: _["default"],
MutationEmitter: g["default"],
CutEventEmitter: M["default"],
CopyEventEmitter: P["default"],
PasteEventEmitter: w["default"],
DeviceOrientationEventEmitter: S["default"],
StandardInputEventsEmitter: p["default"],
StandardOnClickEventsEmitter: h["default"],
StandardOnChangeEventsEmitter: E["default"],
StandardOnFormEventsEmitter: v["default"],
SyntheticMaskInputEventsHandler: d["default"],
SyntheticAutotabInputEventsHandler: f["default"],
BeforeInstallPromptEventEmitter: T["default"],
WindowMessageEventEmitter: c["default"],
BlurEventEmitter: k["default"],
FocusEventEmitter: O["default"],
DOMContentLoadedEventEmitter: B["default"],
ResizeEventEmitter: C["default"],
VisibilityChangeEventEmitter: y["default"],
ScrollEventEmitter: b["default"],
EventAggregator: l["default"]
},
I = [{
service: "MutationEmitter",
deps: ["MessageBus"],
exportDeps: []
}, {
service: "CutEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "CopyEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "PasteEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "DeviceOrientationEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "StandardInputEventsEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: ["CDUtils"]
}, {
service: "StandardOnClickEventsEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: ["CDUtils"]
}, {
service: "StandardOnChangeEventsEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: ["CDUtils"]
}, {
service: "StandardOnFormEventsEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: ["CDUtils"]
}, {
service: "SyntheticMaskInputEventsHandler",
deps: ["MessageBus", "EventAggregator"],
exportDeps: ["CDUtils"]
}, {
service: "SyntheticAutotabInputEventsHandler",
deps: ["MessageBus", "EventAggregator"],
exportDeps: ["CDUtils"]
}, {
service: "BeforeInstallPromptEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "WindowMessageEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "BlurEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "FocusEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "DOMContentLoadedEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "ResizeEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "VisibilityChangeEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}, {
service: "ScrollEventEmitter",
deps: ["MessageBus", "EventAggregator"],
exportDeps: []
}],
R = (r(Application, [{
key: "initialize",
value: function initialize(e) {
if (e) return this._unSupportedMode();
try {
this.registerServices()
} catch (t) {
throw new Error("Bootstrap aborted! " + t.message)
}
this.registerFeatures()
}
}, {
key: "registerServices",
value: function registerServices() {
var e = new _["default"](j.Map, j.Set);
(0, i.register)("MessageBus", e), (0, i.register)("EventAggregator", l["default"]), I.forEach(function(t) {
var n = [],
r = [],
e = A[t.service];
t.deps.forEach(function(e) {
if (null === (0, i.inject)(e)) throw new Error("Missing service dependency , " + e + ", for service " + t.service);
n.push((0, i.inject)(e))
}), t.exportDeps.forEach(function(e) {
r.push(j[e])
}), (0, i.register)(t.service, new(Function.prototype.bind.apply(e, [null].concat(n, r))))
})
}
}, {
key: "registerFeatures",
value: function registerFeatures() {
Object.getOwnPropertyNames(D).forEach(function(e) {
"function" == typeof D[e] && D[e](j)
})
}
}, {
key: "_unSupportedMode",
value: function _unSupportedMode() {
new _["default"](j.Map, j.Set), new m["default"]
}
}, {
key: "lookup",
value: function lookup(e) {
return this.APP_CONTAINER.lookup(e)
}
}]), Application);
function Application(e, t) {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, Application), this.configurations = {}, this.APP_CONTAINER = new s["default"], (0, i.serviceContainer)(this.APP_CONTAINER), "function" == typeof t && t(this)
}
t["default"] = R
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(WindowMessageEventEmitter, [{
key: "startObserver",
value: function startObserver(t) {
var n = this;
t = t || window.self, this._windowListeners.has(t) || (this.defaultPostMessageEventListener.forEach(function(e) {
n._EventAggregator.addEventListener(t, e.event, e.handler)
}), this._windowListeners.set(t, {
isBinded: !0,
listeners: [this.handleWindowMessage]
}))
}
}, {
key: "stopObserver",
value: function stopObserver(t) {
var n = this;
t = t || window.self;
var e = this._windowListeners.get(t);
e && e.isBinded && (this.defaultPostMessageEventListener.forEach(function(e) {
n._EventAggregator.removeEventListener(t, e.event, e.handler)
}), this._windowListeners["delete"](t))
}
}]), WindowMessageEventEmitter);
function WindowMessageEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, WindowMessageEventEmitter), this.handleWindowMessage = function(e) {
return e && n._messageBus.publish(n._messageBus.getChannels().WINDOWMESSAGEEVENT, {
message: e
})
}, this._messageBus = e, this._EventAggregator = t, this._windowListeners = new WeakMap, this.defaultPostMessageEventListener = [{
event: "message",
handler: this.handleWindowMessage
}]
}
t["default"] = r
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
};
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
var i = n(2);
var s = (function _inherits(e, t) {
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: !1,
writable: !0,
configurable: !0
}
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
}(Session, function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
"default": e
}
}(i)["default"]), r(Session, [{
key: "init",
value: function init() {
return this.messageBus = (0, i.inject)("MessageBus"), !!this.exports.sysLoader && this.exports.sysLoader.getSessionService()
}
}]), Session);
function Session() {
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, Session);
var e = function _possibleConstructorReturn(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || "object" != typeof t && "function" != typeof t ? e : t
}(this, (Session.__proto__ || Object.getPrototypeOf(Session)).call(this, "Session"));
return e.init = e.init.bind(e), e
}
t["default"] = s
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(VisibilityChangeEventEmitter, [{
key: "start",
value: function start(e) {
if (!e) throw new Error("invalid document parameter");
this._eventAggregator.addEventListener(e, "visibilitychange", this.handleVisibilityChangeEvent, !1, !0)
}
}, {
key: "stop",
value: function stop(e) {
if (!e) throw new Error("invalid document parameter");
this._eventAggregator.removeEventListener(e, "visibilitychange", this.handleVisibilityChangeEvent)
}
}]), VisibilityChangeEventEmitter);
function VisibilityChangeEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, VisibilityChangeEventEmitter), this.handleVisibilityChangeEvent = function(e) {
n._messageBus.publish(n._messageBus.getChannels().VISIBILITYCHANGEEVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(ScrollEventEmitter, [{
key: "start",
value: function start(e) {
if (!e) throw new Error("invalid window parameter");
this._eventAggregator.addEventListener(e, "scroll", this.handleScrollEvent, !1, !0)
}
}, {
key: "stop",
value: function stop(e) {
if (!e) throw new Error("invalid window parameter");
this._eventAggregator.removeEventListener(e, "scroll", this.handleScrollEvent)
}
}]), ScrollEventEmitter);
function ScrollEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, ScrollEventEmitter), this.handleScrollEvent = function(e) {
n._messageBus.publish(n._messageBus.getChannels().SCROLLEVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(ResizeEventEmitter, [{
key: "start",
value: function start(e) {
if (!e) throw new Error("invalid window parameter");
this._eventAggregator.addEventListener(e, "resize", this.handleResizeEvent, !1, !0)
}
}, {
key: "stop",
value: function stop(e) {
if (!e) throw new Error("invalid window parameter");
this._eventAggregator.removeEventListener(e, "resize", this.handleResizeEvent)
}
}]), ResizeEventEmitter);
function ResizeEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, ResizeEventEmitter), this.handleResizeEvent = function(e) {
n._messageBus.publish(n._messageBus.getChannels().RESIZEEVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(FocusEventEmitter, [{
key: "start",
value: function start(e) {
if (!e) throw new Error("invalid window parameter");
this._eventAggregator.addEventListener(e, "focus", this.handleFocusEvent, !1, !0)
}
}, {
key: "stop",
value: function stop(e) {
if (!e) throw new Error("invalid window parameter");
this._eventAggregator.removeEventListener(e, "focus", this.handleFocusEvent)
}
}]), FocusEventEmitter);
function FocusEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, FocusEventEmitter), this.handleFocusEvent = function(e) {
n._messageBus.publish(n._messageBus.getChannels().FOCUSEVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(DeviceOrientationEventEmitter, [{
key: "start",
value: function start() {
this._eventAggregator.addEventListener(window, "deviceorientation", this.handleDeviceOrientationEvent)
}
}, {
key: "stop",
value: function stop() {
this._eventAggregator.removeEventListener(window, "deviceorientation", this.handleDeviceOrientationEvent)
}
}]), DeviceOrientationEventEmitter);
function DeviceOrientationEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, DeviceOrientationEventEmitter), this.handleDeviceOrientationEvent = function(e) {
n._messageBus.publish(n._messageBus.getChannels().DEVICEORIENATIONEVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(DOMContentLoadedEventEmitter, [{
key: "start",
value: function start(e) {
if (!e) throw new Error("invalid document parameter");
this._eventAggregator.addEventListener(e, "DOMContentLoaded", this.handleDOMContentLoadedEvent)
}
}, {
key: "stop",
value: function stop(e) {
if (!e) throw new Error("invalid document parameter");
this._eventAggregator.removeEventListener(e, "DOMContentLoaded", this.handleDOMContentLoadedEvent)
}
}]), DOMContentLoadedEventEmitter);
function DOMContentLoadedEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, DOMContentLoadedEventEmitter), this.handleDOMContentLoadedEvent = function(e) {
n._messageBus.publish(n._messageBus.getChannels().DOMCONTENTLOADEDEVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(BlurEventEmitter, [{
key: "start",
value: function start(e) {
if (!e) throw new Error("invalid window parameter");
this._eventAggregator.addEventListener(e, "blur", this.handleBlurEvent, !1, !0)
}
}, {
key: "stop",
value: function stop(e) {
if (!e) throw new Error("invalid window parameter");
this._eventAggregator.removeEventListener(e, "blur", this.handleBlurEvent)
}
}]), BlurEventEmitter);
function BlurEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, BlurEventEmitter), this.handleBlurEvent = function(e) {
n._messageBus.publish(n._messageBus.getChannels().BLUREVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}, function(e, t, n) {
"use strict";
function defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
}
}
Object.defineProperty(t, "__esModule", {
value: !0
});
var r = (function(e, t, n) {
return t && defineProperties(e.prototype, t), n && defineProperties(e, n), e
}(BeforeInstallPromptEventEmitter, [{
key: "start",
value: function start(e) {
if (!e) throw new Error("invalid window parameter");
this._eventAggregator.addEventListener(e, "beforeinstallprompt", this.handleBeforeInstallPrompt)
}
}, {
key: "stop",
value: function stop(e) {
if (!e) throw new Error("invalid window parameter");
this._eventAggregator.removeEventListener(e, "beforeinstallprompt", this.handleBeforeInstallPrompt)
}
}]), BeforeInstallPromptEventEmitter);
function BeforeInstallPromptEventEmitter(e, t) {
var n = this;
! function _classCallCheck(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(this, BeforeInstallPromptEventEmitter), this.handleBeforeInstallPrompt = function(e) {
n._messageBus.publish(n._messageBus.getChannels().BEFOREINSTALLPROMPTEVENT, e)
}, this._messageBus = e, this._eventAggregator = t
}
t["default"] = r
}]),
function(fe) {
function e() {
var e, t, n, i, s, r, a, o, u, c, h, l, d, f, _, p, g, v, m, y, w, S, b, E, k, C, T, M, D, R, x, F, A, P, L, I, U, B, N, O, W, Q, H, z, q, j, V, Y, K, G, X, Z, J, $, ee, te, ne, ie, se, re, ae, oe, ue, ce, he = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
return t && i(e.prototype, t), n && i(e, n), e
}
}(),
le = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
function de(e, t) {
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}(function(e) {
var t, n;
if (!Function.prototype.cdCallAsync && (Object.extend = function(e, t) {
if (e && t && "object" == ("undefined" == typeof t ? "undefined" : le(t)))
for (var n in t)
if (t.hasOwnProperty(n)) try {
"" != n && Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n))
} catch (i) {
e[n] = t[n]
}
return e
}, e.btoa = self.btoa ? self.btoa.bind(self) : function(e) {
for (var t, n, i = String(e), s = "", r = 0, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; i.charAt(0 | r) || (a = "=", r % 1); s += a.charAt(63 & t >> 8 - r % 1 * 8)) {
if (255 < (n = i.charCodeAt(r += .75))) throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
t = t << 8 | n
}
return s
}, self.importScripts == undefined)) {
var a = (t = [], n = "Window_" + e.CDUtils.generateUUID(), e.CDUtils.addEventListener(window, "message", function i(e) {
e.data == n && (e.stopPropagation && e.stopPropagation(), e.returnValue && (e.returnValue = !1), e.cancelBubble && (e.cancelBubble = !0), t.shift()())
}, !0), function(e) {
t.push(e), window.postMessage(n, self.location.href)
});
Function.prototype.cdCallAsync = function(e) {
for (var t = arguments.length, n = Array(1 < t ? t - 1 : 0), i = 1; i < t; i++) n[i - 1] = arguments[i];
var s = this;
a(function() {
s.apply(e || window, n)
})
}, Function.prototype.cdCallAsyncWithErrorHandling = function(t, n) {
for (var e = arguments.length, i = Array(2 < e ? e - 2 : 0), s = 2; s < e; s++) i[s - 2] = arguments[s];
var r = this;
a(function() {
try {
r.apply(t || window, i)
} catch (e) {
n && n(e)
}
})
}
}
})(e = "undefined" == typeof fe ? self : fe),
function(e) {
function t(e, t) {
this._portNativeWorker = e, this._useShared = t
}
t.prototype = {
start: function() {
this._useShared && this._portNativeWorker.port.start()
},
postMessage: function() {
var e = this._portNativeWorker.port;
this._useShared ? e.postMessage.apply(e, arguments) : this._portNativeWorker.postMessage.apply(this._portNativeWorker, arguments)
},
close: function() {
this._useShared ? this._portNativeWorker.port.close() : this._portNativeWorker.terminate()
},
setonmessage: function(e) {
this._useShared ? this._portNativeWorker.port.onmessage = e : this._portNativeWorker.onmessage = e
}
}, e.CDPort = t
}(e), t = e, n = function() {
function e() {
de(this, e), this._pairs = [], this.size = 0
}
return he(e, [{
key: "has",
value: function(e) {
return -1 < this._indexOf(e)
}
}, {
key: "get",
value: function(e) {
var t = this._indexOf(e);
return -1 < t ? this._pairs[t][1] : undefined
}
}, {
key: "set",
value: function(e, t) {
var n = this._indexOf(e); - 1 < n ? this._pairs[n][1] = t : (this._pairs.push([e, t]), this.size++)
}
}, {
key: "delete",
value: function(e) {
var t = this._indexOf(e);
return -1 < t && (this._pairs.splice(t, 1), this.size--, !0)
}
}, {
key: "forEach",
value: function(e) {
for (var t = 0; t < this._pairs.length; t++) e(this._pairs[t][1], this._pairs[t][0])
}
}, {
key: "clear",
value: function() {
this._pairs = []
}
}, {
key: "_indexOf",
value: function(e) {
for (var t = 0; t < this._pairs.length; t++)
if (this._pairs[t][0] === e) return t;
return -1
}
}]), e
}(), t.Map = self.Map || n, i = e, s = function() {
function e() {
de(this, e), this._set = [], this.size = 0
}
return he(e, [{
key: "add",
value: function(e) {
return this._set.push(e), this.size++, this
}
}, {
key: "has",
value: function(e) {
return -1 < this._set.indexOf(e)
}
}, {
key: "delete",
value: function(e) {
for (var t = 0; t < this._set.length; t++)
if (this._set[t] === e) return this._set.splice(t, 1), this.size--, !0;
return !1
}
}, {
key: "forEach",
value: function(e) {
for (var t = 0; t < this._set.length; t++) e(this._set[t])
}
}, {
key: "clear",
value: function() {
this._set = []
}
}]), e
}(), i.Set = self.Set || s,
function(s) {
function e() {
this._msgListeners = new s.Map
}
s.WorkerCommunicator || (e.prototype.setMessagingPort = function(e) {
this._messagePort = e;
var s = this;
e.setonmessage(function(e) {
var t = e.data,
n = [],
i = s._msgListeners.get(t.msgType);
i && i.forEach(function(e) {
e.callback(t.data), e.isOneTime && n.push(e)
}), n.forEach(function(e) {
i["delete"](e)
})
})
}, e.prototype.sendAsync = function(e, t, n, i, s) {
i && n && this.addMessageListener(n, i, s), this._messagePort.postMessage({
msgType: e,
data: t
})
}, e.prototype.addMessageListener = function(e, t, n) {
var i = null;
this._msgListeners.has(e) ? i = this._msgListeners.get(e) : (i = new s.Set, this._msgListeners.set(e, i)), i.add({
callback: t,
isOneTime: n
})
}, s.WorkerCommunicator = e)
}(e), r = e, a = function() {
function t(e) {
if (de(this, t), !e) throw new Error("utils param must be defined");
this._msgListeners = new r.Map, self.window && e.addEventListener && (this._windowId = "Window_" + e.generateUUID(), e.addEventListener(self.window, "message", this._onMessageReceived.bind(this), !0))
}
return he(t, [{
key: "subscribe",
value: function(e, t) {
var n = 2 < arguments.length && arguments[2] !== undefined && arguments[2],
i = null;
this._msgListeners.has(e) ? i = this._msgListeners.get(e) : (i = new r.Set, this._msgListeners.set(e, i)), i.add({
callback: t,
isOneTime: n
})
}
}, {
key: "unsubscribe",
value: function(e, t) {
if (e && this._msgListeners.has(e)) {
var n = this._msgListeners.get(e);
n && n.forEach(function(e) {
t === e.callback && n["delete"](e)
}), 0 === n.size && this._msgListeners["delete"](e)
}
}
}, {
key: "publish",
value: function(e, t) {
if (!e) throw new Error("invalid argument msgType must be defined");
this._publishMessage(e, t)
}
}, {
key: "publishAsync",
value: function(e, t) {
if (!e) throw new Error("invalid argument msgType must be defined");
self.window && self.window.postMessage({
msgID: this._windowId,
msgType: e,
message: t
}, window.location.href)
}
}, {
key: "_publishMessage",
value: function(e, t) {
var n = this._msgListeners.get(e);
n && n.forEach(function(e) {
e.callback(t), e.isOneTime && n["delete"](e)
})
}
}, {
key: "_onMessageReceived",
value: function(e) {
e.data.msgID && e.data.msgID === this._windowId && (e.stopPropagation && e.stopPropagation(), e.returnValue && (e.returnValue = !1), e.cancelBubble && (e.cancelBubble = !0), this._publishMessage(e.data.msgType, e.data.message))
}
}]), t
}(), r.MessageBus = a, e.MessageBusEventType = {
TouchEvent: "touchEvent",
KeyEvent: "keyEvent",
ConfigurationLoadedEvent: "ConfigurationLoadedEvent",
NewSessionStartedEvent: "NewSessionStartedEvent",
WupDispatchRateUpdatedEvent: "WupDispatchRateUpdatedEvent",
ApiContextChangeEvent: "ApiContextChangeEvent",
ApiResetSessionEvent: "ApiResetSessionEvent",
ApiCustomerMetadataEvent: "ApiCustomerMetadataEvent",
ApiChangeStateEvent: "ApiChangeStateEvent",
ApiSetCsidEvent: "ApiSetCsidEvent",
ApiSetPsidEvent: "ApiSetPsidEvent",
ServerStateUpdatedEvent: "ServerStateUpdatedEvent",
StateChangedEvent: "StateChangedEvent"
}, o = e, u = function() {
function e() {
de(this, e), this._buffer = []
}
return he(e, [{
key: "hasItems",
value: function() {
return 0 < this.length()
}
}, {
key: "length",
value: function() {
return this._buffer.length
}
}, {
key: "enqueue",
value: function(e) {
this._buffer.push(e)
}
}, {
key: "enqueueToHead",
value: function(e) {
this._buffer.unshift(e)
}
}, {
key: "dequeue",
value: function(e) {
return this._buffer.shift()
}
}, {
key: "getItem",
value: function(e) {
return this._buffer[e]
}
}]), e
}(), o.Queue = u, c = e, h = function() {
function e() {
de(this, e)
}
return he(e, null, [{
key: "create",
value: function() {
if (self.XMLHttpRequest && Object.prototype.hasOwnProperty.call(XMLHttpRequest.prototype, "withCredentials")) return new XMLHttpRequest;
if (self.XDomainRequest) return new XDomainRequest;
if (self.XMLHttpRequest) return new XMLHttpRequest;
throw new Error("There is no supported http request object")
}
}]), e
}(), c.HttpRequestFactory = h, l = e, d = function() {
function t(e) {
de(this, t), this._wupServerSessionState = e, this.reset()
}
return he(t, [{
key: "add",
value: function(e) {
var t = e.eventName,
n = e.data;
if (!t) throw new Error("Unable to add data message. Missing eventName field");
if (!n) throw new Error("Unable to add data message. Missing data field");
this._isEmpty = !1, this._dataObj[t] = this._dataObj[t] || [], this._dataObj[t].push(n)
}
}, {
key: "take",
value: function() {
this._isEmpty || this._dataObj.static_fields.push(["requestId", this._wupServerSessionState.incrementRequestId()]);
var e = this._dataObj;
return this.reset(), e
}
}, {
key: "reset",
value: function() {
this._isEmpty = !0, this._dataObj = this.getFreshDataObj()
}
}, {
key: "isEmpty",
value: function() {
return this._isEmpty
}
}, {
key: "getFreshDataObj",
value: function() {
return {
static_fields: [],
key_events: [],
mouse_events: []
}
}
}]), t
}(), l.DataAggregator = d, f = e, _ = function() {
function e() {
de(this, e), this.reset()
}
return he(e, [{
key: "add",
value: function(e) {
var t = e.data;
if (!t) throw new Error("Unable to add log message. Missing data field");
this._Q.push(t)
}
}, {
key: "take",
value: function() {
var e = this._Q;
return this.reset(), e
}
}, {
key: "reset",
value: function() {
this._Q = []
}
}, {
key: "isEmpty",
value: function() {
return 0 === this._Q.length
}
}]), e
}(), f.LogAggregator = _, p = e, g = function() {
function t(e) {
de(this, t), this._statisticsLogIntervalMs = e, this.resetCounters(), this._setPeriodicStatisticsLog()
}
return he(t, [{
key: "getSentWupsCount",
value: function() {
return this._sentWupsCount
}
}, {
key: "incrementSentWupCount",
value: function() {
this._sentWupsCount++, this._sentWupsInCurrentIntervalCount++
}
}, {
key: "updateSettings",
value: function(e) {
this._statisticsLogIntervalMs = e, this._setPeriodicStatisticsLog()
}
}, {
key: "resetCounters",
value: function() {
this._sentWupsCount = 0, this._sentWupsInCurrentIntervalCount = 0
}
}, {
key: "stop",
value: function() {
this._stopPeriodicStatisticsLog()
}
}, {
key: "_writeStatisticsLog",
value: function() {
0 !== this._sentWupsInCurrentIntervalCount && (log.info("Sent " + this._sentWupsInCurrentIntervalCount + " wup in the last " + this._statisticsLogIntervalMs + " ms. Sent a total of " + this._sentWupsCount + " in the session"), this._sentWupsInCurrentIntervalCount = 0)
}
}, {
key: "_stopPeriodicStatisticsLog",
value: function() {
this._periodicLogIntervalId && clearInterval(this._periodicLogIntervalId)
}
}, {
key: "_setPeriodicStatisticsLog",
value: function() {
this._stopPeriodicStatisticsLog(), this._periodicLogIntervalId = setInterval(this._writeStatisticsLog.bind(this), this._statisticsLogIntervalMs)
}
}]), t
}(), p.WupStatisticsService = g, e.WupDispatchRateType = {
incremental: "incremental",
constant: "constant",
dynamic: "dynamic"
}, v = e, m = function() {
function n(e, t) {
de(this, n), this._wupStatisticsService = t, this.updateSettings(e)
}
return he(n, [{
key: "getRate",
value: function() {
if (this._wupStatisticsService.getSentWupsCount() < this._incrementStartWupSendCount) return this._currentRate;
var e = this._currentRate + this._incrementStepMs;
return e <= this._incrementStopMs && (this._currentRate = e), this._currentRate
}
}, {
key: "updateSettings",
value: function(e) {
if (e.type !== v.WupDispatchRateType.incremental) throw new Error("Invalid settings provided to incremental calculator");
this._currentRate = e.initialRateValueMs, this._incrementStepMs = e.incrementStepMs, this._incrementStopMs = e.incrementStopMs, this._incrementStartWupSendCount = e.incrementStartWupSendCount
}
}]), n
}(), v.WupDispatchIncrementalRateCalculator = m, y = e, w = function() {
function t(e) {
de(this, t), this.updateSettings(e)
}
return he(t, [{
key: "getRate",
value: function() {
return this._currentRate
}
}, {
key: "updateSettings",
value: function(e) {
if (e.type !== y.WupDispatchRateType.constant) throw new Error("Invalid settings provided to constant calculator");
this._currentRate = e.initialRateValueMs
}
}]), t
}(), y.WupDispatchConstantRateCalculator = w, S = e, b = function() {
function t(e) {
de(this, t), this._wupServerSessionState = e
}
return he(t, [{
key: "getRate",
value: function() {
return this._wupServerSessionState.getWupDispatchRate()
}
}, {
key: "updateSettings",
value: function() {}
}]), t
}(), S.WupDispatchDynamicRateCalculator = b, E = e, k = function() {
function n(e, t) {
de(this, n), this._wupStatisticsService = e, this._wupServerSessionState = t
}
return he(n, [{
key: "create",
value: function(e) {
if (e.type === E.WupDispatchRateType.constant) return new E.WupDispatchConstantRateCalculator(e);
if (e.type === E.WupDispatchRateType.incremental) return new E.WupDispatchIncrementalRateCalculator(e, this._wupStatisticsService);
if (e.type === E.WupDispatchRateType.dynamic) return new E.WupDispatchDynamicRateCalculator(this._wupServerSessionState);
throw new Error("Unsupported dispatch rate type " + e.type)
}
}]), n
}(), E.WupDispatchRateCalculatorFactory = k, C = e, T = function() {
function s(e, t, n, i) {
de(this, s), this._serverClient = e, this._aggregator = t, this._wupDispatchRateCalculatorFactory = n, this._wupDispatchRateSettings = i, this._wupDispatchRateCalculator = this._wupDispatchRateCalculatorFactory.create(this._wupDispatchRateSettings), this._sendToServerInterval = this._wupDispatchRateCalculator.getRate(), this._setDispatchInterval(this._sendToServerInterval)
}
return he(s, [{
key: "add",
value: function(e) {
this._aggregator.add(e)
}
}, {
key: "sendIfRequired",
value: function() {
var e = 0 < arguments.length && arguments[0] !== undefined && arguments[0];
(0 == this._sendToServerInterval || e) && this._sendToServer(e)
}
}, {
key: "updateByConfig",
value: function(e) {
e && (e.type !== this._wupDispatchRateSettings.type ? this._wupDispatchRateCalculator = this._wupDispatchRateCalculatorFactory.create(e) : this._wupDispatchRateCalculator.updateSettings(e), this._sendToServerInterval = this._wupDispatchRateCalculator.getRate(), this._setDispatchInterval(this._sendToServerInterval), this._wupDispatchRateSettings = e)
}
}, {
key: "scheduleNextDispatching",
value: function() {
var e = this._wupDispatchRateCalculator.getRate();
e !== this._sendToServerInterval && (this._sendToServerInterval = e, this._setDispatchInterval(this._sendToServerInterval))
}
}, {
key: "_sendToServer",
value: function() {
var e = 0 < arguments.length && arguments[0] !== undefined && arguments[0];
log.debug("Sending a message to the server"), this._serverClient.isReady() ? this._aggregator.isEmpty() || (this._serverClient.sendData(this._aggregator.take(), e), this.scheduleNextDispatching()) : log.info(this._serverClient.constructor.name + " is not ready. Message will not be sent to server")
}
}, {
key: "_setDispatchInterval",
value: function(e) {
this._sendIntervalId && (clearInterval(this._sendIntervalId), this._sendIntervalId = null), 0 !== e && (this._sendIntervalId = setInterval(this._sendToServer.bind(this), e))
}
}]), s
}(), C.DataDispatcher = T, M = e, D = function() {
function t(e) {
de(this, t), this._dataDispatcher = e
}
return he(t, [{
key: "process",
value: function(e) {
if (!e) throw new Error("Invalid message received for processing.");
var t = !1;
if (Array.isArray(e))
for (var n = 0, i = e.length; n < i; n++) t = this._processSingleMessage(e[n]) || t;
else t = this._processSingleMessage(e) || t;
this._dataDispatcher.sendIfRequired(t)
}
}, {
key: "_processSingleMessage",
value: function(e) {
if (this._isEmptyFlushMessage(e)) return !0;
var t = !1;
if (e.shouldFlush && (t = !0), this._isDataValid(e)) return this._dataDispatcher.add(e), t;
var n = "Received a message with invalid structure. Missing eventName or Data fields";
throw log.error(n), new Error(n)
}
}, {
key: "_isEmptyFlushMessage",
value: function(e) {
return "flushData" === e.eventName
}
}, {
key: "_isDataValid",
value: function(e) {
return e.eventName && e.data
}
}]), t
}(), M.MessageProcessor = D,
function(e) {
if (!e.Logger) {
var t = function() {
function n(e, t) {
de(this, n), this._logBridge = e, this._logLevel = t || n.LOG_LEVEL.INFO
}
return he(n, [{
key: "trace",
value: function(e) {
this._sendToLogBridge(e, n.LOG_LEVEL.DEBUG)
}
}, {
key: "debug",
value: function(e) {
this._sendToLogBridge(e, n.LOG_LEVEL.DEBUG)
}
}, {
key: "info",
value: function(e) {
this._sendToLogBridge(e, n.LOG_LEVEL.INFO)
}
}, {
key: "warn",
value: function(e, t) {
this._sendToLogBridge(e, n.LOG_LEVEL.WARN, t)
}
}, {
key: "error",
value: function(e, t) {
this._sendToLogBridge(e, n.LOG_LEVEL.ERROR, t)
}
}, {
key: "isDebug",
value: function() {
return this._logLevel == n.LOG_LEVEL.DEBUG
}
}, {
key: "updateLogConfig",
value: function(e) {
this._logLevel = e.get("logLevel") || this._logLevel
}
}, {
key: "_sendToLogBridge",
value: function(e, t, n) {
t >= this._logLevel && (n && n.stack && (e += " ;stack: " + n.stack), this._logBridge.log(e, t))
}
}]), n
}();
Object.extend(t, {
LOG_LEVEL: {
DEBUG: 10,
INFO: 20,
WARN: 30,
ERROR: 40,
CRITICAL: 50,
OFF: 80
}
}), e.Logger = t, e.log = {
setLogger: function(e) {
this._logger = e
},
isDebug: function() {
return this._logger.isDebug()
},
error: function(e, t) {
this._logger.error(e, t || null)
},
warn: function(e, t) {
this._logger.warn(e, t || null)
},
trace: function(e) {
this._logger.trace(e)
},
debug: function(e) {
this._logger.debug(e)
},
info: function(e) {
this._logger.info(e)
}
}
}
}(e),
function(t) {
t.ConfigurationFields = {
resetSessionApiThreshold: "resetSessionApiThreshold",
dataWupDispatchRateSettings: "dataWupDispatchRateSettings",
logWupDispatchRateSettings: "logWupDispatchRateSettings",
forceDynamicDataWupDispatchSettings: "forceDynamicDataWupDispatchSettings",
wupStatisticsLogIntervalMs: "wupStatisticsLogIntervalMs",
serverCommunicationSettings: "serverCommunicationSettings",
wupResponseTimeout: "wupResponseTimeout",
wupMessageRequestTimeout: "wupMessageRequestTimeout",
logMessageRequestTimeout: "logMessageRequestTimeout",
collectKeyRegionValue: "collectKeyRegionValue",
ipDetectorTimeout: "ipDetectorTimeout",
crossDomainsList: "crossDomainsList",
crossDomainsTimeout: "crossDomainsTimeout",
isMutationObserver: "isMutationObserver",
isEnabled: "isEnabled"
}, t.ConfigurationDefaultTemplates = {
defaultDynamicWupDispatchRateConfiguration: {
type: "dynamic"
},
defaultIncrementalWupDispatchRateConfiguration: {
type: "incremental",
initialRateValueMs: 500,
incrementStepMs: 500,
incrementStopMs: 5e3,
incrementStartWupSendCount: 20
}
};
var e = function() {
function e() {
de(this, e), this._requireParseFields = new t.Map, this._requireParseFields.set(t.ConfigurationFields.dataWupDispatchRateSettings, t.ConfigurationFields.dataWupDispatchRateSettings), this._requireParseFields.set(t.ConfigurationFields.logWupDispatchRateSettings, t.ConfigurationFields.logWupDispatchRateSettings), this._requireParseFields.set(t.ConfigurationFields.serverCommunicationSettings, t.ConfigurationFields.serverCommunicationSettings), this._requireParseFields.set(t.ConfigurationFields.crossDomainsList, t.ConfigurationFields.crossDomainsList), this._configurationList = {}, this.configDefault = {
logLevel: t.Logger.LOG_LEVEL.INFO,
isCrossdomain: !1,
crossDomainsList: [],
crossDomainsTimeout: 5e3,
orientationEventsSamplePeriod: 300,
orientationEventsThreshold: 1,
stateChangeEnabled: !1,
accelerometerEventsSamplePeriod: 0,
dataQPassWorkerInterval: 500,
gyroEventsSamplePeriod: 0,
gyroEventsThreshold: .3,
isContextPropsFeature: !0,
isEnabled: !0,
isResetEveryLoad: !1,
isScrollCollect: !0,
isUnsupportedReport: !0,
isVMDetection: !0,
isAudioDetection: !1,
isHistoryNavigationEvent: !1,
wupStatisticsLogIntervalMs: 3e4,
resetSessionApiThreshold: 2e4,
wupMessageRequestTimeout: 5e3,
logMessageRequestTimeout: 5e3,
forceDynamicDataWupDispatchSettings: !0,
dataWupDispatchRateSettings: t.ConfigurationDefaultTemplates.defaultDynamicWupDispatchRateConfiguration,
logWupDispatchRateSettings: {
type: "constant",
initialRateValueMs: 2500
},
serverCommunicationSettings: {
sendRetryRate: 1e3,
queueLoadThreshold: 100
},
ipDetectorTimeout: 2e3,
collectKeyRegionValue: !1,
isMutationObserver: !0
}, this.loadConfigurations(this.configDefault)
}
return he(e, [{
key: "isConfigurationUpdatedFromServer",
value: function() {
return !this._isDefaultConfiguration
}
}, {
key: "loadConfigurations",
value: function(e) {
for (var t in this._isDefaultConfiguration = e === this.configDefault, e)
if (e.hasOwnProperty(t)) {
var n = e[t];
if (this._requireParseFields.has(t)) {
var i = this._tryParseConfigurationValue(n);
i && (n = i)
}
this._configurationList[t] = n
}
}
}, {
key: "get",
value: function(e) {
return this._configurationList[e]
}
}, {
key: "set",
value: function(e, t) {
this._configurationList[e] = t
}
}, {
key: "getAll",
value: function() {
return this._configurationList
}
}, {
key: "_tryParseConfigurationValue",
value: function(e) {
if ("string" != typeof e) return null;
try {
return JSON.parse(e)
} catch (t) {}
return null
}
}]), e
}();
t.ConfigurationRepository = e
}(e),
function(e) {
function t() {
this._listeners = []
}
e.CDEvent || (t.prototype = {
subscribe: function(e) {
this._listeners.push(e)
},
publish: function(e) {
for (var t = 0, n = this._listeners.length; t < n; t++) this._listeners[t](e)
},
unsubscribe: function(e) {
for (var t = 0, n = this._listeners.length; t < n; t++)
if (e === this._listeners[t]) {
this._listeners.splice(t, 1);
break
}
}
}, e.CDEvent = t)
}(e),
function(e) {
("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).msgpack = function h(r, a, o) {
function u(n, e) {
if (!a[n]) {
if (!r[n]) {
var t = "function" == typeof require && require;
if (!e && t) return t(n, !0);
if (c) return c(n, !0);
var i = new Error("Cannot find module '" + n + "'");
throw i.code = "MODULE_NOT_FOUND", i
}
var s = a[n] = {
exports: {}
};
r[n][0].call(s.exports, function(e) {
var t = r[n][1][e];
return u(t || e)
}, s, s.exports, h, r, a, o)
}
return a[n].exports
}
for (var c = "function" == typeof require && require, e = 0; e < o.length; e++) u(o[e]);
return u
}({
1: [function(e, t, n) {
n.encode = e("./encode").encode, n.decode = e("./decode").decode, n.Encoder = e("./encoder").Encoder, n.Decoder = e("./decoder").Decoder, n.createCodec = e("./ext").createCodec, n.codec = e("./codec").codec
}, {
"./codec": 10,
"./decode": 12,
"./decoder": 13,
"./encode": 15,
"./encoder": 16,
"./ext": 20
}],
2: [function(e, n, t) {
(function(e) {
function t(e) {
return e && e.isBuffer && e
}
n.exports = t("undefined" != typeof e && e) || t(this.Buffer) || t("undefined" != typeof window && window.Buffer) || this.Buffer
}).call(this, e("buffer").Buffer)
}, {
buffer: 29
}],
3: [function(e, t, n) {
n.copy = function a(e, t, n, i) {
var s;
n || (n = 0), i || 0 === i || (i = this.length), t || (t = 0);
var r = i - n;
if (e === this && n < t && t < i)
for (s = r - 1; 0 <= s; s--) e[s + t] = this[s + n];
else
for (s = 0; s < r; s++) e[s + t] = this[s + n];
return r
}, n.toString = function o(e, t, n) {
var i = this,
s = 0 | t;
n || (n = i.length);
for (var r = "", a = 0; s < n;)(a = i[s++]) < 128 ? r += String.fromCharCode(a) : (192 == (224 & a) ? a = (31 & a) << 6 | 63 & i[s++] : 224 == (240 & a) ? a = (15 & a) << 12 | (63 & i[s++]) << 6 | 63 & i[s++] : 240 == (248 & a) && (a = (7 & a) << 18 | (63 & i[s++]) << 12 | (63 & i[s++]) << 6 | 63 & i[s++]), 65536 <= a ? (a -= 65536, r += String.fromCharCode(55296 + (a >>> 10), 56320 + (1023 & a))) : r += String.fromCharCode(a));
return r
}, n.write = function u(e, t) {
for (var n = this, i = t || (t |= 0), s = e.length, r = 0, a = 0; a < s;) r = e.charCodeAt(a++), n[i++] = r < 128 ? r : (n[i++] = r < 2048 ? 192 | r >>> 6 : (n[i++] = r < 55296 || 57343 < r ? 224 | r >>> 12 : (r = 65536 + (r - 55296 << 10 | e.charCodeAt(a++) - 56320), n[i++] = 240 | r >>> 18, 128 | r >>> 12 & 63), 128 | r >>> 6 & 63), 128 | 63 & r);
return i - t
}
}, {}],
4: [function(e, t, n) {
function i(e) {
return new Array(e)
}
var s = e("./bufferish"),
n = t.exports = i(0);
n.alloc = i, n.concat = s.concat, n.from = function r(e) {
if (!s.isBuffer(e) && s.isView(e)) e = s.Uint8Array.from(e);
else if (s.isArrayBuffer(e)) e = new Uint8Array(e);
else {
if ("string" == typeof e) return s.from.call(n, e);
if ("number" == typeof e) throw new TypeError('"value" argument must not be a number')
}
return Array.prototype.slice.call(e)
}
}, {
"./bufferish": 8
}],
5: [function(e, t, n) {
function i(e) {
return new r(e)
}
var s = e("./bufferish"),
r = s.global,
n = t.exports = s.hasBuffer ? i(0) : [];
n.alloc = s.hasBuffer && r.alloc || i, n.concat = s.concat, n.from = function a(e) {
if (!s.isBuffer(e) && s.isView(e)) e = s.Uint8Array.from(e);
else if (s.isArrayBuffer(e)) e = new Uint8Array(e);
else {
if ("string" == typeof e) return s.from.call(n, e);
if ("number" == typeof e) throw new TypeError('"value" argument must not be a number')
}
return r.from && 1 !== r.from.length ? r.from(e) : new r(e)
}
}, {
"./bufferish": 8
}],
6: [function(e, t, n) {
function s(e, t, n, i) {
var s = c.isBuffer(this),
r = c.isBuffer(e);
if (s && r) return this.copy(e, t, n, i);
if (h || s || r || !c.isView(this) || !c.isView(e)) return u.copy.call(this, e, t, n, i);
var a = n || null != i ? o.call(this, n, i) : this;
return e.set(a, t), a.length
}
function o(e, t) {
var n = this.slice || !h && this.subarray;
if (n) return n.call(this, e, t);
var i = c.alloc.call(this, t - e);
return s.call(this, i, 0, e, t), i
}
var u = e("./buffer-lite");
n.copy = s, n.slice = o, n.toString = function a(e, t, n) {
return (!r && c.isBuffer(this) ? this.toString : u.toString).apply(this, arguments)
}, n.write = function l(e) {
function t() {
return (this[e] || u[e]).apply(this, arguments)
}
return t
}("write");
var c = e("./bufferish"),
i = c.global,
r = c.hasBuffer && "TYPED_ARRAY_SUPPORT" in i,
h = r && !i.TYPED_ARRAY_SUPPORT
}, {
"./buffer-lite": 3,
"./bufferish": 8
}],
7: [function(e, t, i) {
function n(e) {
return new Uint8Array(e)
}
var s = e("./bufferish"),
i = t.exports = s.hasArrayBuffer ? n(0) : [];
i.alloc = n, i.concat = s.concat, i.from = function r(e) {
if (s.isView(e)) {
var t = e.byteOffset,
n = e.byteLength;
(e = e.buffer).byteLength !== n && (e.slice ? e = e.slice(t, t + n) : (e = new Uint8Array(e)).byteLength !== n && (e = Array.prototype.slice.call(e, t, t + n)))
} else {
if ("string" == typeof e) return s.from.call(i, e);
if ("number" == typeof e) throw new TypeError('"value" argument must not be a number')
}
return new Uint8Array(e)
}
}, {
"./bufferish": 8
}],
8: [function(e, t, o) {
function u(e) {
return i(this).alloc(e)
}
function n(e) {
var t = 3 * e.length,
n = u.call(this, t),
i = v.write.call(n, e);
return t !== i && (n = v.slice.call(n, 0, i)), n
}
function i(e) {
return d(e) ? p : f(e) ? g : l(e) ? _ : c ? p : h ? g : _
}
function s() {
return !1
}
function r(t, n) {
return t = "[object " + t + "]",
function(e) {
return null != e && {}.toString.call(n ? e[n] : e) === t
}
}
var a = o.global = e("./buffer-global"),
c = o.hasBuffer = a && !!a.isBuffer,
h = o.hasArrayBuffer = "undefined" != typeof ArrayBuffer,
l = o.isArray = e("isarray");
o.isArrayBuffer = h ? function y(e) {
return e instanceof ArrayBuffer || m(e)
} : s;
var d = o.isBuffer = c ? a.isBuffer : s,
f = o.isView = h ? ArrayBuffer.isView || r("ArrayBuffer", "buffer") : s;
o.alloc = u, o.concat = function w(e, t) {
function n(e) {
t += e.length
}
function i(e) {
a += v.copy.call(e, r, a)
}
t || (t = 0, Array.prototype.forEach.call(e, n));
var s = this !== o && this || e[0],
r = u.call(s, t),
a = 0;
return Array.prototype.forEach.call(e, i), r
}, o.from = function S(e) {
return "string" == typeof e ? n.call(this, e) : i(this).from(e)
};
var _ = o.Array = e("./bufferish-array"),
p = o.Buffer = e("./bufferish-buffer"),
g = o.Uint8Array = e("./bufferish-uint8array"),
v = o.prototype = e("./bufferish-proto"),
m = r("ArrayBuffer")
}, {
"./buffer-global": 2,
"./bufferish-array": 4,
"./bufferish-buffer": 5,
"./bufferish-proto": 6,
"./bufferish-uint8array": 7,
isarray: 34
}],
9: [function(e, t, n) {
function i(e) {
return this instanceof i ? (this.options = e, void this.init()) : new i(e)
}
function s(e, t) {
return e && t ? function n() {
return e.apply(this, arguments), t.apply(this, arguments)
} : e || t
}
function r(t) {
function n(e, t) {
return t(e)
}
return t = t.slice(),
function(e) {
return t.reduce(n, e)
}
}
function a(e) {
return new i(e)
}
var o = e("isarray");
n.createCodec = a, n.install = function c(e) {
for (var t in e) i.prototype[t] = s(i.prototype[t], e[t])
}, n.filter = function h(e) {
return o(e) ? r(e) : e
};
var u = e("./bufferish");
i.prototype.init = function() {
var e = this.options;
return e && e.uint8array && (this.bufferish = u.Uint8Array), this
}, n.preset = a({
preset: !0
})
}, {
"./bufferish": 8,
isarray: 34
}],
10: [function(e, t, n) {
e("./read-core"), e("./write-core"), n.codec = {
preset: e("./codec-base").preset
}
}, {
"./codec-base": 9,
"./read-core": 22,
"./write-core": 25
}],
11: [function(e, t, n) {
function i(e) {
if (!(this instanceof i)) return new i(e);
if (e && (this.options = e).codec) {
var t = this.codec = e.codec;
t.bufferish && (this.bufferish = t.bufferish)
}
}
n.DecodeBuffer = i;
var s = e("./read-core").preset,
r = e("./flex-buffer").FlexDecoder;
r.mixin(i.prototype), i.prototype.codec = s, i.prototype.fetch = function() {
return this.codec.decode(this)
}
}, {
"./flex-buffer": 21,
"./read-core": 22
}],
12: [function(e, t, n) {
n.decode = function s(e, t) {
var n = new i(t);
return n.write(e), n.read()
};
var i = e("./decode-buffer").DecodeBuffer
}, {
"./decode-buffer": 11
}],
13: [function(e, t, n) {
function i(e) {
return this instanceof i ? void r.call(this, e) : new i(e)
}
n.Decoder = i;
var s = e("event-lite"),
r = e("./decode-buffer").DecodeBuffer;
i.prototype = new r, s.mixin(i.prototype), i.prototype.decode = function(e) {
arguments.length && this.write(e), this.flush()
}, i.prototype.push = function(e) {
this.emit("data", e)
}, i.prototype.end = function(e) {
this.decode(e), this.emit("end")
}
}, {
"./decode-buffer": 11,
"event-lite": 31
}],
14: [function(e, t, n) {
function i(e) {
if (!(this instanceof i)) return new i(e);
if (e && (this.options = e).codec) {
var t = this.codec = e.codec;
t.bufferish && (this.bufferish = t.bufferish)
}
}
n.EncodeBuffer = i;
var s = e("./write-core").preset,
r = e("./flex-buffer").FlexEncoder;
r.mixin(i.prototype), i.prototype.codec = s, i.prototype.write = function(e) {
this.codec.encode(this, e)
}
}, {
"./flex-buffer": 21,
"./write-core": 25
}],
15: [function(e, t, n) {
n.encode = function s(e, t) {
var n = new i(t);
return n.write(e), n.read()
};
var i = e("./encode-buffer").EncodeBuffer
}, {
"./encode-buffer": 14
}],
16: [function(e, t, n) {
function i(e) {
return this instanceof i ? void r.call(this, e) : new i(e)
}
n.Encoder = i;
var s = e("event-lite"),
r = e("./encode-buffer").EncodeBuffer;
i.prototype = new r, s.mixin(i.prototype), i.prototype.encode = function(e) {
this.write(e), this.emit("data", this.read())
}, i.prototype.end = function(e) {
arguments.length && this.encode(e), this.flush(), this.emit("end")
}
}, {
"./encode-buffer": 14,
"event-lite": 31
}],
17: [function(e, t, n) {
n.ExtBuffer = function s(e, t) {
return this instanceof s ? (this.buffer = i.from(e), void(this.type = t)) : new s(e, t)
};
var i = e("./bufferish")
}, {
"./bufferish": 8
}],
18: [function(t, e, n) {
function i(e) {
return o || (o = t("./encode").encode), o(e)
}
function s(e) {
return e.valueOf()
}
function r(e) {
(e = RegExp.prototype.toString.call(e).split("/")).shift();
var t = [e.pop()];
return t.unshift(e.join("/")), t
}
function a(e) {
var t = {};
for (var n in l) t[n] = e[n];
return t
}
n.setExtPackers = function d(e) {
e.addExtPacker(14, Error, [a, i]), e.addExtPacker(1, EvalError, [a, i]), e.addExtPacker(2, RangeError, [a, i]), e.addExtPacker(3, ReferenceError, [a, i]), e.addExtPacker(4, SyntaxError, [a, i]), e.addExtPacker(5, TypeError, [a, i]), e.addExtPacker(6, URIError, [a, i]), e.addExtPacker(10, RegExp, [r, i]), e.addExtPacker(11, Boolean, [s, i]), e.addExtPacker(12, String, [s, i]), e.addExtPacker(13, Date, [Number, i]), e.addExtPacker(15, Number, [s, i]), "undefined" != typeof Uint8Array && (e.addExtPacker(17, Int8Array, h), e.addExtPacker(18, Uint8Array, h), e.addExtPacker(19, Int16Array, h), e.addExtPacker(20, Uint16Array, h), e.addExtPacker(21, Int32Array, h), e.addExtPacker(22, Uint32Array, h), e.addExtPacker(23, Float32Array, h), "undefined" != typeof Float64Array && e.addExtPacker(24, Float64Array, h), "undefined" != typeof Uint8ClampedArray && e.addExtPacker(25, Uint8ClampedArray, h), e.addExtPacker(26, ArrayBuffer, h), e.addExtPacker(29, DataView, h)), u.hasBuffer && e.addExtPacker(27, c, u.from)
};
var o, u = t("./bufferish"),
c = u.global,
h = u.Uint8Array.from,
l = {
name: 1,
message: 1,
stack: 1,
columnNumber: 1,
fileName: 1,
lineNumber: 1
}
}, {
"./bufferish": 8,
"./encode": 15
}],
19: [function(t, e, n) {
function i(e) {
return u || (u = t("./decode").decode), u(e)
}
function s(e) {
return RegExp.apply(null, e)
}
function r(i) {
return function(e) {
var t = new i;
for (var n in l) t[n] = e[n];
return t
}
}
function a(t) {
return function(e) {
return new t(e)
}
}
function o(e) {
return new Uint8Array(e).buffer
}
n.setExtUnpackers = function d(e) {
e.addExtUnpacker(14, [i, r(Error)]), e.addExtUnpacker(1, [i, r(EvalError)]), e.addExtUnpacker(2, [i, r(RangeError)]), e.addExtUnpacker(3, [i, r(ReferenceError)]), e.addExtUnpacker(4, [i, r(SyntaxError)]), e.addExtUnpacker(5, [i, r(TypeError)]), e.addExtUnpacker(6, [i, r(URIError)]), e.addExtUnpacker(10, [i, s]), e.addExtUnpacker(11, [i, a(Boolean)]), e.addExtUnpacker(12, [i, a(String)]), e.addExtUnpacker(13, [i, a(Date)]), e.addExtUnpacker(15, [i, a(Number)]), "undefined" != typeof Uint8Array && (e.addExtUnpacker(17, a(Int8Array)), e.addExtUnpacker(18, a(Uint8Array)), e.addExtUnpacker(19, [o, a(Int16Array)]), e.addExtUnpacker(20, [o, a(Uint16Array)]), e.addExtUnpacker(21, [o, a(Int32Array)]), e.addExtUnpacker(22, [o, a(Uint32Array)]), e.addExtUnpacker(23, [o, a(Float32Array)]), "undefined" != typeof Float64Array && e.addExtUnpacker(24, [o, a(Float64Array)]), "undefined" != typeof Uint8ClampedArray && e.addExtUnpacker(25, a(Uint8ClampedArray)), e.addExtUnpacker(26, o), e.addExtUnpacker(29, [o, a(DataView)])), c.hasBuffer && e.addExtUnpacker(27, a(h))
};
var u, c = t("./bufferish"),
h = c.global,
l = {
name: 1,
message: 1,
stack: 1,
columnNumber: 1,
fileName: 1,
lineNumber: 1
}
}, {
"./bufferish": 8,
"./decode": 12
}],
20: [function(e, t, n) {
e("./read-core"), e("./write-core"), n.createCodec = e("./codec-base").createCodec
}, {
"./codec-base": 9,
"./read-core": 22,
"./write-core": 25
}],
21: [function(e, t, n) {
function i() {
if (!(this instanceof i)) return new i
}
function s() {
if (!(this instanceof s)) return new s
}
function r() {
throw new Error("method not implemented: write()")
}
function a() {
throw new Error("method not implemented: fetch()")
}
function o() {
var e = this.buffers && this.buffers.length;
return e ? (this.flush(), this.pull()) : this.fetch()
}
function u(e) {
var t = this.buffers || (this.buffers = []);
t.push(e)
}
function c() {
var e = this.buffers || (this.buffers = []);
return e.shift()
}
function h(n) {
return function i(e) {
for (var t in n) e[t] = n[t];
return e
}
}
n.FlexDecoder = i, n.FlexEncoder = s;
var l = e("./bufferish"),
d = "BUFFER_SHORTAGE";
i.mixin = h(function f() {
function e(e) {
var t = this.offset ? l.prototype.slice.call(this.buffer, this.offset) : this.buffer;
this.buffer = t ? e ? this.bufferish.concat([t, e]) : t : e, this.offset = 0
}
function t() {
for (; this.offset < this.buffer.length;) {
var e, t = this.offset;
try {
e = this.fetch()
} catch (e) {
if (e && e.message != d) throw e;
this.offset = t;
break
}
this.push(e)
}
}
function n(e) {
var t = this.offset,
n = t + e;
if (n > this.buffer.length) throw new Error(d);
return this.offset = n, t
}
return {
bufferish: l,
write: e,
fetch: a,
flush: t,
push: u,
pull: c,
read: o,
reserve: n,
offset: 0
}
}()), i.mixin(i.prototype), s.mixin = h(function _() {
function e() {
var e = this.start;
if (e < this.offset) {
var t = this.start = this.offset;
return l.prototype.slice.call(this.buffer, e, t)
}
}
function t() {
for (; this.start < this.offset;) {
var e = this.fetch();
e && this.push(e)
}
}
function n() {
var e = this.buffers || (this.buffers = []),
t = 1 < e.length ? this.bufferish.concat(e) : e[0];
return e.length = 0, t
}
function i(e) {
var t = 0 | e;
if (this.buffer) {
var n = this.buffer.length,
i = 0 | this.offset,
s = i + t;
if (s < n) return this.offset = s, i;
this.flush(), e = Math.max(e, Math.min(2 * n, this.maxBufferSize))
}
return e = Math.max(e, this.minBufferSize), this.buffer = this.bufferish.alloc(e), this.start = 0, this.offset = t, 0
}
function s(e) {
var t = e.length;
if (t > this.minBufferSize) this.flush(), this.push(e);
else {
var n = this.reserve(t);
l.prototype.copy.call(e, this.buffer, n)
}
}
return {
bufferish: l,
write: r,
fetch: e,
flush: t,
push: u,
pull: n,
read: o,
reserve: i,
send: s,
maxBufferSize: 65536,
minBufferSize: 2048,
offset: 0,
start: 0
}
}()), s.mixin(s.prototype)
}, {
"./bufferish": 8
}],
22: [function(e, t, n) {
function i() {
var e = this.options;
return this.decode = function n(e) {
function t(e) {
var t = a(e),
n = i[t];
if (!n) throw new Error("Invalid type: " + (t ? "0x" + t.toString(16) : t));
return n(e)
}
var i = o.getReadToken(e);
return t
}(e), e && e.preset && r.setExtUnpackers(this), this
}
var s = e("./ext-buffer").ExtBuffer,
r = e("./ext-unpacker"),
a = e("./read-format").readUint8,
o = e("./read-token"),
u = e("./codec-base");
u.install({
addExtUnpacker: function c(e, t) {
(this.extUnpackers || (this.extUnpackers = []))[e] = u.filter(t)
},
getExtUnpacker: function h(t) {
function e(e) {
return new s(e, t)
}
return (this.extUnpackers || (this.extUnpackers = []))[t] || e
},
init: i
}), n.preset = i.call(u.preset)
}, {
"./codec-base": 9,
"./ext-buffer": 17,
"./ext-unpacker": 19,
"./read-format": 23,
"./read-token": 24
}],
23: [function(e, t, n) {
function i(e, t) {
var n, i = {},
s = new Array(t),
r = new Array(t),
a = e.codec.decode;
for (n = 0; n < t; n++) s[n] = a(e), r[n] = a(e);
for (n = 0; n < t; n++) i[s[n]] = r[n];
return i
}
function s(e, t) {
var n, i = new Map,
s = new Array(t),
r = new Array(t),
a = e.codec.decode;
for (n = 0; n < t; n++) s[n] = a(e), r[n] = a(e);
for (n = 0; n < t; n++) i.set(s[n], r[n]);
return i
}
function r(e, t) {
for (var n = new Array(t), i = e.codec.decode, s = 0; s < t; s++) n[s] = i(e);
return n
}
function a(e, t) {
var n = e.reserve(t),
i = n + t;
return D.toString.call(e.buffer, "utf-8", n, i)
}
function o(e, t) {
var n = e.reserve(t),
i = n + t,
s = D.slice.call(e.buffer, n, i);
return M.from(s)
}
function u(e, t) {
var n = e.reserve(t),
i = n + t,
s = D.slice.call(e.buffer, n, i);
return M.Uint8Array.from(s).buffer
}
function c(e, t) {
var n = e.reserve(t + 1),
i = e.buffer[n++],
s = n + t,
r = e.codec.getExtUnpacker(i);
if (!r) throw new Error("Invalid ext type: " + (i ? "0x" + i.toString(16) : i));
var a = D.slice.call(e.buffer, n, s);
return r(a)
}
function h(e) {
var t = e.reserve(1);
return e.buffer[t]
}
function l(e) {
var t = e.reserve(1),
n = e.buffer[t];
return 128 & n ? n - 256 : n
}
function d(e) {
var t = e.reserve(2),
n = e.buffer;
return n[t++] << 8 | n[t]
}
function f(e) {
var t = e.reserve(2),
n = e.buffer,
i = n[t++] << 8 | n[t];
return 32768 & i ? i - 65536 : i
}
function _(e) {
var t = e.reserve(4),
n = e.buffer;
return 16777216 * n[t++] + (n[t++] << 16) + (n[t++] << 8) + n[t]
}
function p(e) {
var t = e.reserve(4),
n = e.buffer;
return n[t++] << 24 | n[t++] << 16 | n[t++] << 8 | n[t]
}
function g(n, i) {
return function(e) {
var t = e.reserve(n);
return i.call(e.buffer, t, x)
}
}
function v(e) {
return new C(this, e).toNumber()
}
function m(e) {
return new T(this, e).toNumber()
}
function y(e) {
return new C(this, e)
}
function w(e) {
return new T(this, e)
}
function S(e) {
return E.read(this, e, !1, 23, 4)
}
function b(e) {
return E.read(this, e, !1, 52, 8)
}
var E = e("ieee754"),
k = e("int64-buffer"),
C = k.Uint64BE,
T = k.Int64BE;
n.getReadFormat = function F(e) {
var t = M.hasArrayBuffer && e && e.binarraybuffer,
n = e && e.int64;
return {
map: R && e && e.usemap ? s : i,
array: r,
str: a,
bin: t ? u : o,
ext: c,
uint8: h,
uint16: d,
uint32: _,
uint64: g(8, n ? y : v),
int8: l,
int16: f,
int32: p,
int64: g(8, n ? w : m),
float32: g(4, S),
float64: g(8, b)
}
}, n.readUint8 = h;
var M = e("./bufferish"),
D = e("./bufferish-proto"),
R = "undefined" != typeof Map,
x = !0
}, {
"./bufferish": 8,
"./bufferish-proto": 6,
ieee754: 32,
"int64-buffer": 33
}],
24: [function(e, t, n) {
function i(e) {
var t, n = new Array(256);
for (t = 0; t <= 127; t++) n[t] = r(t);
for (t = 128; t <= 143; t++) n[t] = o(t - 128, e.map);
for (t = 144; t <= 159; t++) n[t] = o(t - 144, e.array);
for (t = 160; t <= 191; t++) n[t] = o(t - 160, e.str);
for (n[192] = r(null), n[193] = null, n[194] = r(!1), n[195] = r(!0), n[196] = a(e.uint8, e.bin), n[197] = a(e.uint16, e.bin), n[198] = a(e.uint32, e.bin), n[199] = a(e.uint8, e.ext), n[200] = a(e.uint16, e.ext), n[201] = a(e.uint32, e.ext), n[202] = e.float32, n[203] = e.float64, n[204] = e.uint8, n[205] = e.uint16, n[206] = e.uint32, n[207] = e.uint64, n[208] = e.int8, n[209] = e.int16, n[210] = e.int32, n[211] = e.int64, n[212] = o(1, e.ext), n[213] = o(2, e.ext), n[214] = o(4, e.ext), n[215] = o(8, e.ext), n[216] = o(16, e.ext), n[217] = a(e.uint8, e.str), n[218] = a(e.uint16, e.str), n[219] = a(e.uint32, e.str), n[220] = a(e.uint16, e.array), n[221] = a(e.uint32, e.array), n[222] = a(e.uint16, e.map), n[223] = a(e.uint32, e.map), t = 224; t <= 255; t++) n[t] = r(t - 256);
return n
}
function s(e) {
var t, n = i(e).slice();
for (n[217] = n[196], n[218] = n[197], n[219] = n[198], t = 160; t <= 191; t++) n[t] = o(t - 160, e.bin);
return n
}
function r(e) {
return function() {
return e
}
}
function a(n, i) {
return function(e) {
var t = n(e);
return i(e, t)
}
}
function o(t, n) {
return function(e) {
return n(e, t)
}
}
var u = e("./read-format");
n.getReadToken = function c(e) {
var t = u.getReadFormat(e);
return e && e.useraw ? s(t) : i(t)
}
}, {
"./read-format": 23
}],
25: [function(e, t, n) {
function i() {
var e = this.options;
return this.encode = function n(e) {
function t(e, t) {
var n = i["undefined" == typeof t ? "undefined" : le(t)];
if (!n) throw new Error('Unsupported type "' + ("undefined" == typeof t ? "undefined" : le(t)) + '": ' + t);
n(e, t)
}
var i = r.getWriteType(e);
return t
}(e), e && e.preset && s.setExtPackers(this), this
}
var o = e("./ext-buffer").ExtBuffer,
s = e("./ext-packer"),
r = e("./write-type"),
u = e("./codec-base");
u.install({
addExtPacker: function c(t, e, n) {
function i(e) {
return n && (e = n(e)), new o(e, t)
}
n = u.filter(n);
var s = e.name;
if (s && "Object" !== s) {
var r = this.extPackers || (this.extPackers = {});
r[s] = i
} else {
var a = this.extEncoderList || (this.extEncoderList = []);
a.unshift([e, i])
}
},
getExtPacker: function h(e) {
var t = this.extPackers || (this.extPackers = {}),
n = e.constructor,
i = n && n.name && t[n.name];
if (i) return i;
for (var s = this.extEncoderList || (this.extEncoderList = []), r = s.length, a = 0; a < r; a++) {
var o = s[a];
if (n === o[0]) return o[1]
}
},
init: i
}), n.preset = i.call(u.preset)
}, {
"./codec-base": 9,
"./ext-buffer": 17,
"./ext-packer": 18,
"./write-type": 27
}],
26: [function(e, t, n) {
function i() {
var e = g.slice();
return e[196] = s(196), e[197] = r(197), e[198] = a(198), e[199] = s(199), e[200] = r(200), e[201] = a(201), e[202] = o(202, 4, S.writeFloatBE || h, !0), e[203] = o(203, 8, S.writeDoubleBE || l, !0), e[204] = s(204), e[205] = r(205), e[206] = a(206), e[207] = o(207, 8, u), e[208] = s(208), e[209] = r(209), e[210] = a(210), e[211] = o(211, 8, c), e[217] = s(217), e[218] = r(218), e[219] = a(219), e[220] = r(220), e[221] = a(221), e[222] = r(222), e[223] = a(223), e
}
function s(s) {
return function(e, t) {
var n = e.reserve(2),
i = e.buffer;
i[n++] = s, i[n] = t
}
}
function r(s) {
return function(e, t) {
var n = e.reserve(3),
i = e.buffer;
i[n++] = s, i[n++] = t >>> 8, i[n] = t
}
}
function a(s) {
return function(e, t) {
var n = e.reserve(5),
i = e.buffer;
i[n++] = s, i[n++] = t >>> 24, i[n++] = t >>> 16, i[n++] = t >>> 8, i[n] = t
}
}
function o(i, s, r, a) {
return function(e, t) {
var n = e.reserve(s + 1);
e.buffer[n++] = i, r.call(e.buffer, t, n, a)
}
}
function u(e, t) {
new _(this, t, e)
}
function c(e, t) {
new p(this, t, e)
}
function h(e, t) {
d.write(this, e, t, !1, 23, 4)
}
function l(e, t) {
d.write(this, e, t, !1, 52, 8)
}
var d = e("ieee754"),
f = e("int64-buffer"),
_ = f.Uint64BE,
p = f.Int64BE,
g = e("./write-uint8").uint8,
v = e("./bufferish"),
m = v.global,
y = v.hasBuffer && "TYPED_ARRAY_SUPPORT" in m,
w = y && !m.TYPED_ARRAY_SUPPORT,
S = v.hasBuffer && m.prototype || {};
n.getWriteToken = function b(e) {
return e && e.uint8array ? ((n = i())[202] = o(202, 4, h), n[203] = o(203, 8, l), n) : w || v.hasBuffer && e && e.safe ? ((t = g.slice())[196] = o(196, 1, m.prototype.writeUInt8), t[197] = o(197, 2, m.prototype.writeUInt16BE), t[198] = o(198, 4, m.prototype.writeUInt32BE), t[199] = o(199, 1, m.prototype.writeUInt8), t[200] = o(200, 2, m.prototype.writeUInt16BE), t[201] = o(201, 4, m.prototype.writeUInt32BE), t[202] = o(202, 4, m.prototype.writeFloatBE), t[203] = o(203, 8, m.prototype.writeDoubleBE), t[204] = o(204, 1, m.prototype.writeUInt8), t[205] = o(205, 2, m.prototype.writeUInt16BE), t[206] = o(206, 4, m.prototype.writeUInt32BE), t[207] = o(207, 8, u), t[208] = o(208, 1, m.prototype.writeInt8), t[209] = o(209, 2, m.prototype.writeInt16BE), t[210] = o(210, 4, m.prototype.writeInt32BE), t[211] = o(211, 8, c), t[217] = o(217, 1, m.prototype.writeUInt8), t[218] = o(218, 2, m.prototype.writeUInt16BE), t[219] = o(219, 4, m.prototype.writeUInt32BE), t[220] = o(220, 2, m.prototype.writeUInt16BE), t[221] = o(221, 4, m.prototype.writeUInt32BE), t[222] = o(222, 2, m.prototype.writeUInt16BE), t[223] = o(223, 4, m.prototype.writeUInt32BE), t) : i();
var t, n
}
}, {
"./bufferish": 8,
"./write-uint8": 28,
ieee754: 32,
"int64-buffer": 33
}],
27: [function(e, t, n) {
var w = e("isarray"),
i = e("int64-buffer"),
S = i.Uint64BE,
b = i.Int64BE,
E = e("./bufferish"),
k = e("./bufferish-proto"),
C = e("./write-token"),
T = e("./write-uint8").uint8,
M = e("./ext-buffer").ExtBuffer,
D = "undefined" != typeof Uint8Array,
R = "undefined" != typeof Map,
x = [];
x[1] = 212, x[2] = 213, x[4] = 214, x[8] = 215, x[16] = 216, n.getWriteType = function F(e) {
function t(e, t) {
_[t ? 195 : 194](e, t)
}
function n(e, t) {
var n = 0 | t;
return t !== n ? void _[203](e, t) : void _[-32 <= n && n <= 127 ? 255 & n : 0 <= n ? n <= 255 ? 204 : n <= 65535 ? 205 : 206 : -128 <= n ? 208 : -32768 <= n ? 209 : 210](e, n)
}
function i(e) {
return e < 32 ? 1 : e <= 255 ? 2 : e <= 65535 ? 3 : 5
}
function s(e) {
return e < 32 ? 1 : e <= 65535 ? 3 : 5
}
function r(h) {
function e(e, t) {
var n = t.length,
i = 5 + 3 * n;
e.offset = e.reserve(i);
var s = e.buffer,
r = h(n),
a = e.offset + r;
n = k.write.call(s, t, a);
var o = h(n);
if (r !== o) {
var u = a + o - r,
c = a + n;
k.copy.call(s, s, u, a, c)
}
_[1 === o ? 160 + n : o <= 3 ? 215 + o : 219](e, n), e.offset += n
}
return e
}
function a(e, t) {
if (null === t) return d(e, t);
if (v(t)) return m(e, t);
if (w(t)) return f(e, t);
if (S.isUint64BE(t)) return n = e, i = t, void _[207](n, i.toArray());
var n, i, s, r;
if (b.isInt64BE(t)) return s = e, r = t, void _[211](s, r.toArray());
var a, o, u, c, h, l = e.codec.getExtPacker(t);
return l && (t = l(t)), t instanceof M ? (a = e, u = (o = t).buffer, c = u.length, h = x[c] || (c < 255 ? 199 : c <= 65535 ? 200 : 201), _[h](a, c), T[o.type](a), void a.send(u)) : void y(e, t)
}
function o(e, t) {
return v(t) ? (n = e, s = (i = t).length, _[s < 32 ? 160 + s : s <= 65535 ? 218 : 219](n, s), void n.send(i)) : void a(e, t);
var n, i, s
}
function d(e, t) {
_[192](e, t)
}
function f(e, t) {
var n = t.length;
_[n < 16 ? 144 + n : n <= 65535 ? 220 : 221](e, n);
for (var i = e.codec.encode, s = 0; s < n; s++) i(e, t[s])
}
function u(e, t) {
var n = t.length,
i = n < 255 ? 196 : n <= 65535 ? 197 : 198;
_[i](e, n), e.send(t)
}
function c(e, t) {
u(e, new Uint8Array(t))
}
function h(t, n) {
var e = Object.keys(n),
i = e.length,
s = i < 16 ? 128 + i : i <= 65535 ? 222 : 223;
_[s](t, i);
var r = t.codec.encode;
e.forEach(function(e) {
r(t, e), r(t, n[e])
})
}
function l(i, e) {
if (!(e instanceof Map)) return h(i, e);
var t = e.size;
_[t < 16 ? 128 + t : t <= 65535 ? 222 : 223](i, t);
var s = i.codec.encode;
e.forEach(function(e, t, n) {
s(i, t), s(i, e)
})
}
var _ = C.getWriteToken(e),
p = e && e.useraw,
g = D && e && e.binarraybuffer,
v = g ? E.isArrayBuffer : E.isBuffer,
m = g ? c : u,
y = R && e && e.usemap ? l : h;
return {
"boolean": t,
"function": d,
number: n,
object: p ? o : a,
string: r(p ? s : i),
symbol: d,
undefined: d
}
}
}, {
"./bufferish": 8,
"./bufferish-proto": 6,
"./ext-buffer": 17,
"./write-token": 26,
"./write-uint8": 28,
"int64-buffer": 33,
isarray: 34
}],
28: [function(e, t, n) {
function i(n) {
return function(e) {
var t = e.reserve(1);
e.buffer[t] = n
}
}
for (var s = n.uint8 = new Array(256), r = 0; r <= 255; r++) s[r] = i(r)
}, {}],
29: [function(N, e, O) {
(function(e) {
function n() {
return l.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
}
function o(e, t) {
if (n() < t) throw new RangeError("Invalid typed array length");
return l.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = l.prototype : (null === e && (e = new l(t)), e.length = t), e
}
function l(e, t, n) {
if (!(l.TYPED_ARRAY_SUPPORT || this instanceof l)) return new l(e, t, n);
if ("number" != typeof e) return i(this, e, t, n);
if ("string" == typeof t) throw new Error("If encoding is specified then the first argument must be a string");
return s(this, e)
}
function i(e, t, n, i) {
if ("number" == typeof t) throw new TypeError('"value" argument must not be a number');
return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function s(e, t, n, i) {
if (t.byteLength, n < 0 || t.byteLength < n) throw new RangeError("'offset' is out of bounds");
if (t.byteLength < n + (i || 0)) throw new RangeError("'length' is out of bounds");
return t = void 0 === n && void 0 === i ? new Uint8Array(t) : void 0 === i ? new Uint8Array(t, n) : new Uint8Array(t, n, i), l.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = l.prototype : e = u(e, t), e
}(e, t, n, i) : "string" == typeof t ? function r(e, t, n) {
if ("string" == typeof n && "" !== n || (n = "utf8"), !l.isEncoding(n)) throw new TypeError('"encoding" must be a valid string encoding');
var i = 0 | h(t, n),
s = (e = o(e, i)).write(t, n);
return s !== i && (e = e.slice(0, s)), e
}(e, t, n) : function a(e, t) {
if (l.isBuffer(t)) {
var n = 0 | c(t.length);
return 0 === (e = o(e, n)).length || 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 || function i(e) {
return e != e
}(t.length) ? o(e, 0) : u(e, t);
if ("Buffer" === t.type && L(t.data)) return u(e, t.data)
}
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
}(e, t)
}
function r(e) {
if ("number" != typeof e) throw new TypeError('"size" argument must be a number');
if (e < 0) throw new RangeError('"size" argument must not be negative')
}
function s(e, t) {
if (r(t), e = o(e, t < 0 ? 0 : 0 | c(t)), !l.TYPED_ARRAY_SUPPORT)
for (var n = 0; n < t; ++n) e[n] = 0;
return e
}
function u(e, t) {
var n = t.length < 0 ? 0 : 0 | c(t.length);
e = o(e, n);
for (var i = 0; i < n; i += 1) e[i] = 255 & t[i];
return e
}
function c(e) {
if (e >= n()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + n().toString(16) + " bytes");
return 0 | e
}
function h(e, t) {
if (l.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 i = !1;;) switch (t) {
case "ascii":
case "latin1":
case "binary":
return n;
case "utf8":
case "utf-8":
case void 0:
return D(e).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * n;
case "hex":
return n >>> 1;
case "base64":
return x(e).length;
default:
if (i) return D(e).length;
t = ("" + t).toLowerCase(), i = !0
}
}
function a(e, t, n) {
var i = e[t];
e[t] = e[n], e[n] = i
}
function d(e, t, n, i, s) {
if (0 === e.length) return -1;
if ("string" == typeof n ? (i = n, n = 0) : 2147483647 < n ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, isNaN(n) && (n = s ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
if (s) return -1;
n = e.length - 1
} else if (n < 0) {
if (!s) return -1;
n = 0
}
if ("string" == typeof t && (t = l.from(t, i)), l.isBuffer(t)) return 0 === t.length ? -1 : f(e, t, n, i, s);
if ("number" == typeof t) return t &= 255, l.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? s ? Uint8Array.prototype.indexOf.call(e, t, n) : Uint8Array.prototype.lastIndexOf.call(e, t, n) : f(e, [t], n, i, s);
throw new TypeError("val must be string, number or Buffer")
}
function f(e, t, n, i, s) {
function r(e, t) {
return 1 === o ? e[t] : e.readUInt16BE(t * o)
}
var a, o = 1,
u = e.length,
c = t.length;
if (void 0 !== i && ("ucs2" === (i = String(i).toLowerCase()) || "ucs-2" === i || "utf16le" === i || "utf-16le" === i)) {
if (e.length < 2 || t.length < 2) return -1;
u /= o = 2, c /= 2, n /= 2
}
if (s) {
var h = -1;
for (a = n; a < u; a++)
if (r(e, a) === r(t, -1 === h ? 0 : a - h)) {
if (-1 === h && (h = a), a - h + 1 === c) return h * o
} else -1 !== h && (a -= a - h), h = -1
} else
for (u < n + c && (n = u - c), a = n; 0 <= a; a--) {
for (var l = !0, d = 0; d < c; d++)
if (r(e, a + d) !== r(t, d)) {
l = !1;
break
}
if (l) return a
}
return -1
}
function p(e, t, n, i) {
n = Number(n) || 0;
var s = e.length - n;
i ? (i = Number(i), s < i && (i = s)) : i = s;
var r = t.length;
if (r % 2 != 0) throw new TypeError("Invalid hex string");
r / 2 < i && (i = r / 2);
for (var a = 0; a < i; ++a) {
var o = parseInt(t.substr(2 * a, 2), 16);
if (isNaN(o)) return a;
e[n + a] = o
}
return a
}
function g(e, t, n, i) {
return F(function s(e) {
for (var t = [], n = 0; n < e.length; ++n) t.push(255 & e.charCodeAt(n));
return t
}(t), e, n, i)
}
function _(e, t, n) {
n = Math.min(e.length, n);
for (var i = [], s = t; s < n;) {
var r, a, o, u, c = e[s],
h = null,
l = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
if (s + l <= n) switch (l) {
case 1:
c < 128 && (h = c);
break;
case 2:
128 == (192 & (r = e[s + 1])) && 127 < (u = (31 & c) << 6 | 63 & r) && (h = u);
break;
case 3:
r = e[s + 1], a = e[s + 2], 128 == (192 & r) && 128 == (192 & a) && 2047 < (u = (15 & c) << 12 | (63 & r) << 6 | 63 & a) && (u < 55296 || 57343 < u) && (h = u);
break;
case 4:
r = e[s + 1], a = e[s + 2], o = e[s + 3], 128 == (192 & r) && 128 == (192 & a) && 128 == (192 & o) && 65535 < (u = (15 & c) << 18 | (63 & r) << 12 | (63 & a) << 6 | 63 & o) && u < 1114112 && (h = u)
}
null === h ? (h = 65533, l = 1) : 65535 < h && (h -= 65536, i.push(h >>> 10 & 1023 | 55296), h = 56320 | 1023 & h), i.push(h), s += l
}
return function d(e) {
var t = e.length;
if (t <= I) return String.fromCharCode.apply(String, e);
for (var n = "", i = 0; i < t;) n += String.fromCharCode.apply(String, e.slice(i, i += I));
return n
}(i)
}
function v(e, t, n) {
var i = "";
n = Math.min(e.length, n);
for (var s = t; s < n; ++s) i += String.fromCharCode(127 & e[s]);
return i
}
function m(e, t, n) {
var i = "";
n = Math.min(e.length, n);
for (var s = t; s < n; ++s) i += String.fromCharCode(e[s]);
return i
}
function y(e, t, n) {
var i, s = e.length;
(!t || t < 0) && (t = 0), (!n || n < 0 || s < n) && (n = s);
for (var r = "", a = t; a < n; ++a) r += (i = e[a]) < 16 ? "0" + i.toString(16) : i.toString(16);
return r
}
function w(e, t, n) {
for (var i = e.slice(t, n), s = "", r = 0; r < i.length; r += 2) s += String.fromCharCode(i[r] + 256 * i[r + 1]);
return s
}
function S(e, t, n) {
if (e % 1 != 0 || e < 0) throw new RangeError("offset is not uint");
if (n < e + t) throw new RangeError("Trying to access beyond buffer length")
}
function b(e, t, n, i, s, r) {
if (!l.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (s < t || t < r) throw new RangeError('"value" argument is out of bounds');
if (n + i > e.length) throw new RangeError("Index out of range")
}
function E(e, t, n, i) {
t < 0 && (t = 65535 + t + 1);
for (var s = 0, r = Math.min(e.length - n, 2); s < r; ++s) e[n + s] = (t & 255 << 8 * (i ? s : 1 - s)) >>> 8 * (i ? s : 1 - s)
}
function k(e, t, n, i) {
t < 0 && (t = 4294967295 + t + 1);
for (var s = 0, r = Math.min(e.length - n, 4); s < r; ++s) e[n + s] = t >>> 8 * (i ? s : 3 - s) & 255
}
function C(e, t, n, i, s, r) {
if (n + i > e.length) throw new RangeError("Index out of range");
if (n < 0) throw new RangeError("Index out of range")
}
function T(e, t, n, i, s) {
return s || C(e, 0, n, 4), P.write(e, t, n, i, 23, 4), n + 4
}
function M(e, t, n, i, s) {
return s || C(e, 0, n, 8), P.write(e, t, n, i, 52, 8), n + 8
}
function D(e, t) {
t = t || 1 / 0;
for (var n, i = e.length, s = null, r = [], a = 0; a < i; ++a) {
if (55295 < (n = e.charCodeAt(a)) && n < 57344) {
if (!s) {
if (56319 < n) {
-1 < (t -= 3) && r.push(239, 191, 189);
continue
}
if (a + 1 === i) {
-1 < (t -= 3) && r.push(239, 191, 189);
continue
}
s = n;
continue
}
if (n < 56320) {
-1 < (t -= 3) && r.push(239, 191, 189), s = n;
continue
}
n = 65536 + (s - 55296 << 10 | n - 56320)
} else s && -1 < (t -= 3) && r.push(239, 191, 189);
if (s = null, n < 128) {
if ((t -= 1) < 0) break;
r.push(n)
} else if (n < 2048) {
if ((t -= 2) < 0) break;
r.push(n >> 6 | 192, 63 & n | 128)
} else if (n < 65536) {
if ((t -= 3) < 0) break;
r.push(n >> 12 | 224, n >> 6 & 63 | 128, 63 & n | 128)
} else {
if (!(n < 1114112)) throw new Error("Invalid code point");
if ((t -= 4) < 0) break;
r.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, 63 & n | 128)
}
}
return r
}
function R(e, t) {
for (var n, i, s, r = [], a = 0; a < e.length && !((t -= 2) < 0); ++a) n = e.charCodeAt(a), i = n >> 8, s = n % 256, r.push(s), r.push(i);
return r
}
function x(e) {
return A.toByteArray(function n(e) {
if ((e = (t = e, t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")).replace(U, "")).length < 2) return "";
for (var t; e.length % 4 != 0;) e += "=";
return e
}(e))
}
function F(e, t, n, i) {
for (var s = 0; s < i && !(s + n >= t.length || s >= e.length); ++s) t[s + n] = e[s];
return s
}
var A = N("base64-js"),
P = N("ieee754"),
L = N("isarray");
O.Buffer = l, O.SlowBuffer = function t(e) {
return +e != e && (e = 0), l.alloc(+e)
}, O.INSPECT_MAX_BYTES = 50, l.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function B() {
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 (e) {
return !1
}
}(), O.kMaxLength = n(), l.poolSize = 8192, l._augment = function(e) {
return e.__proto__ = l.prototype, e
}, l.from = function(e, t, n) {
return i(null, e, t, n)
}, l.TYPED_ARRAY_SUPPORT && (l.prototype.__proto__ = Uint8Array.prototype, l.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && l[Symbol.species] === l && Object.defineProperty(l, Symbol.species, {
value: null,
configurable: !0
})), l.alloc = function(e, t, n) {
return function s(e, t, n, i) {
return r(t), t <= 0 ? o(e, t) : void 0 !== n ? "string" == typeof i ? o(e, t).fill(n, i) : o(e, t).fill(n) : o(e, t)
}(null, e, t, n)
}, l.allocUnsafe = function(e) {
return s(null, e)
}, l.allocUnsafeSlow = function(e) {
return s(null, e)
}, l.isBuffer = function(e) {
return !(null == e || !e._isBuffer)
}, l.compare = function(e, t) {
if (!l.isBuffer(e) || !l.isBuffer(t)) throw new TypeError("Arguments must be Buffers");
if (e === t) return 0;
for (var n = e.length, i = t.length, s = 0, r = Math.min(n, i); s < r; ++s)
if (e[s] !== t[s]) {
n = e[s], i = t[s];
break
}
return n < i ? -1 : i < n ? 1 : 0
}, l.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
}
}, l.concat = function(e, t) {
if (!L(e)) throw new TypeError('"list" argument must be an Array of Buffers');
if (0 === e.length) return l.alloc(0);
var n;
if (void 0 === t)
for (n = t = 0; n < e.length; ++n) t += e[n].length;
var i = l.allocUnsafe(t),
s = 0;
for (n = 0; n < e.length; ++n) {
var r = e[n];
if (!l.isBuffer(r)) throw new TypeError('"list" argument must be an Array of Buffers');
r.copy(i, s), s += r.length
}
return i
}, l.byteLength = h, l.prototype._isBuffer = !0, l.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; t < e; t += 2) a(this, t, t + 1);
return this
}, l.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; t < e; t += 4) a(this, t, t + 3), a(this, t + 1, t + 2);
return this
}, l.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; t < e; t += 8) a(this, t, t + 7), a(this, t + 1, t + 6), a(this, t + 2, t + 5), a(this, t + 3, t + 4);
return this
}, l.prototype.toString = function() {
var e = 0 | this.length;
return 0 === e ? "" : 0 === arguments.length ? _(this, 0, e) : function o(e, t, n) {
var i, s, r, a = !1;
if ((void 0 === t || t < 0) && (t = 0), t > this.length) return "";
if ((void 0 === n || n > this.length) && (n = this.length), n <= 0) return "";
if ((n >>>= 0) <= (t >>>= 0)) return "";
for (e || (e = "utf8");;) switch (e) {
case "hex":
return y(this, t, n);
case "utf8":
case "utf-8":
return _(this, t, n);
case "ascii":
return v(this, t, n);
case "latin1":
case "binary":
return m(this, t, n);
case "base64":
return i = this, r = n, 0 === (s = t) && r === i.length ? A.fromByteArray(i) : A.fromByteArray(i.slice(s, r));
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return w(this, t, n);
default:
if (a) throw new TypeError("Unknown encoding: " + e);
e = (e + "").toLowerCase(), a = !0
}
}.apply(this, arguments)
}, l.prototype.equals = function(e) {
if (!l.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
return this === e || 0 === l.compare(this, e)
}, l.prototype.inspect = function() {
var e = "",
t = O.INSPECT_MAX_BYTES;
return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "), this.length > t && (e += " ... ")), "<Buffer " + e + ">"
}, l.prototype.compare = function(e, t, n, i, s) {
if (!l.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 === i && (i = 0), void 0 === s && (s = this.length), t < 0 || n > e.length || i < 0 || s > this.length) throw new RangeError("out of range index");
if (s <= i && n <= t) return 0;
if (s <= i) return -1;
if (n <= t) return 1;
if (t >>>= 0, n >>>= 0, i >>>= 0, s >>>= 0, this === e) return 0;
for (var r = s - i, a = n - t, o = Math.min(r, a), u = this.slice(i, s), c = e.slice(t, n), h = 0; h < o; ++h)
if (u[h] !== c[h]) {
r = u[h], a = c[h];
break
}
return r < a ? -1 : a < r ? 1 : 0
}, l.prototype.includes = function(e, t, n) {
return -1 !== this.indexOf(e, t, n)
}, l.prototype.indexOf = function(e, t, n) {
return d(this, e, t, n, !0)
}, l.prototype.lastIndexOf = function(e, t, n) {
return d(this, e, t, n, !1)
}, l.prototype.write = function(e, t, n, i) {
if (void 0 === t) i = "utf8", n = this.length, t = 0;
else if (void 0 === n && "string" == typeof t) i = 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, isFinite(n) ? (n |= 0, void 0 === i && (i = "utf8")) : (i = n, n = void 0)
}
var s, r, a, o, u, c, h, l, d, f = this.length - t;
if ((void 0 === n || f < n) && (n = f), 0 < e.length && (n < 0 || t < 0) || t > this.length) throw new RangeError("Attempt to write outside buffer bounds");
i || (i = "utf8");
for (var _ = !1;;) switch (i) {
case "hex":
return p(this, e, t, n);
case "utf8":
case "utf-8":
return l = t, d = n, F(D(e, (h = this).length - l), h, l, d);
case "ascii":
return g(this, e, t, n);
case "latin1":
case "binary":
return g(this, e, t, n);
case "base64":
return o = this, u = t, c = n, F(x(e), o, u, c);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return r = t, a = n, F(R(e, (s = this).length - r), s, r, a);
default:
if (_) throw new TypeError("Unknown encoding: " + i);
i = ("" + i).toLowerCase(), _ = !0
}
}, l.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
}
};
var I = 4096;
l.prototype.slice = function(e, t) {
var n, i = this.length;
if ((e = ~~e) < 0 ? (e += i) < 0 && (e = 0) : i < e && (e = i), (t = void 0 === t ? i : ~~t) < 0 ? (t += i) < 0 && (t = 0) : i < t && (t = i), t < e && (t = e), l.TYPED_ARRAY_SUPPORT)(n = this.subarray(e, t)).__proto__ = l.prototype;
else {
var s = t - e;
n = new l(s, void 0);
for (var r = 0; r < s; ++r) n[r] = this[r + e]
}
return n
}, l.prototype.readUIntLE = function(e, t, n) {
e |= 0, t |= 0, n || S(e, t, this.length);
for (var i = this[e], s = 1, r = 0; ++r < t && (s *= 256);) i += this[e + r] * s;
return i
}, l.prototype.readUIntBE = function(e, t, n) {
e |= 0, t |= 0, n || S(e, t, this.length);
for (var i = this[e + --t], s = 1; 0 < t && (s *= 256);) i += this[e + --t] * s;
return i
}, l.prototype.readUInt8 = function(e, t) {
return t || S(e, 1, this.length), this[e]
}, l.prototype.readUInt16LE = function(e, t) {
return t || S(e, 2, this.length), this[e] | this[e + 1] << 8
}, l.prototype.readUInt16BE = function(e, t) {
return t || S(e, 2, this.length), this[e] << 8 | this[e + 1]
}, l.prototype.readUInt32LE = function(e, t) {
return t || S(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
}, l.prototype.readUInt32BE = function(e, t) {
return t || S(e, 4, this.length), 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
}, l.prototype.readIntLE = function(e, t, n) {
e |= 0, t |= 0, n || S(e, t, this.length);
for (var i = this[e], s = 1, r = 0; ++r < t && (s *= 256);) i += this[e + r] * s;
return (s *= 128) <= i && (i -= Math.pow(2, 8 * t)), i
}, l.prototype.readIntBE = function(e, t, n) {
e |= 0, t |= 0, n || S(e, t, this.length);
for (var i = t, s = 1, r = this[e + --i]; 0 < i && (s *= 256);) r += this[e + --i] * s;
return (s *= 128) <= r && (r -= Math.pow(2, 8 * t)), r
}, l.prototype.readInt8 = function(e, t) {
return t || S(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
}, l.prototype.readInt16LE = function(e, t) {
t || S(e, 2, this.length);
var n = this[e] | this[e + 1] << 8;
return 32768 & n ? 4294901760 | n : n
}, l.prototype.readInt16BE = function(e, t) {
t || S(e, 2, this.length);
var n = this[e + 1] | this[e] << 8;
return 32768 & n ? 4294901760 | n : n
}, l.prototype.readInt32LE = function(e, t) {
return t || S(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
}, l.prototype.readInt32BE = function(e, t) {
return t || S(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
}, l.prototype.readFloatLE = function(e, t) {
return t || S(e, 4, this.length), P.read(this, e, !0, 23, 4)
}, l.prototype.readFloatBE = function(e, t) {
return t || S(e, 4, this.length), P.read(this, e, !1, 23, 4)
}, l.prototype.readDoubleLE = function(e, t) {
return t || S(e, 8, this.length), P.read(this, e, !0, 52, 8)
}, l.prototype.readDoubleBE = function(
e, t) {
return t || S(e, 8, this.length), P.read(this, e, !1, 52, 8)
}, l.prototype.writeUIntLE = function(e, t, n, i) {
if (e = +e, t |= 0, n |= 0, !i) {
var s = Math.pow(2, 8 * n) - 1;
b(this, e, t, n, s, 0)
}
var r = 1,
a = 0;
for (this[t] = 255 & e; ++a < n && (r *= 256);) this[t + a] = e / r & 255;
return t + n
}, l.prototype.writeUIntBE = function(e, t, n, i) {
if (e = +e, t |= 0, n |= 0, !i) {
var s = Math.pow(2, 8 * n) - 1;
b(this, e, t, n, s, 0)
}
var r = n - 1,
a = 1;
for (this[t + r] = 255 & e; 0 <= --r && (a *= 256);) this[t + r] = e / a & 255;
return t + n
}, l.prototype.writeUInt8 = function(e, t, n) {
return e = +e, t |= 0, n || b(this, e, t, 1, 255, 0), l.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[t] = 255 & e, t + 1
}, l.prototype.writeUInt16LE = function(e, t, n) {
return e = +e, t |= 0, n || b(this, e, t, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8) : E(this, e, t, !0), t + 2
}, l.prototype.writeUInt16BE = function(e, t, n) {
return e = +e, t |= 0, n || b(this, e, t, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = 255 & e) : E(this, e, t, !1), t + 2
}, l.prototype.writeUInt32LE = function(e, t, n) {
return e = +e, t |= 0, n || b(this, e, t, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = 255 & e) : k(this, e, t, !0), t + 4
}, l.prototype.writeUInt32BE = function(e, t, n) {
return e = +e, t |= 0, n || b(this, e, t, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : k(this, e, t, !1), t + 4
}, l.prototype.writeIntLE = function(e, t, n, i) {
if (e = +e, t |= 0, !i) {
var s = Math.pow(2, 8 * n - 1);
b(this, e, t, n, s - 1, -s)
}
var r = 0,
a = 1,
o = 0;
for (this[t] = 255 & e; ++r < n && (a *= 256);) e < 0 && 0 === o && 0 !== this[t + r - 1] && (o = 1), this[t + r] = (e / a >> 0) - o & 255;
return t + n
}, l.prototype.writeIntBE = function(e, t, n, i) {
if (e = +e, t |= 0, !i) {
var s = Math.pow(2, 8 * n - 1);
b(this, e, t, n, s - 1, -s)
}
var r = n - 1,
a = 1,
o = 0;
for (this[t + r] = 255 & e; 0 <= --r && (a *= 256);) e < 0 && 0 === o && 0 !== this[t + r + 1] && (o = 1), this[t + r] = (e / a >> 0) - o & 255;
return t + n
}, l.prototype.writeInt8 = function(e, t, n) {
return e = +e, t |= 0, n || b(this, e, t, 1, 127, -128), l.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[t] = 255 & e, t + 1
}, l.prototype.writeInt16LE = function(e, t, n) {
return e = +e, t |= 0, n || b(this, e, t, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8) : E(this, e, t, !0), t + 2
}, l.prototype.writeInt16BE = function(e, t, n) {
return e = +e, t |= 0, n || b(this, e, t, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = 255 & e) : E(this, e, t, !1), t + 2
}, l.prototype.writeInt32LE = function(e, t, n) {
return e = +e, t |= 0, n || b(this, e, t, 4, 2147483647, -2147483648), l.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24) : k(this, e, t, !0), t + 4
}, l.prototype.writeInt32BE = function(e, t, n) {
return e = +e, t |= 0, n || b(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), l.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : k(this, e, t, !1), t + 4
}, l.prototype.writeFloatLE = function(e, t, n) {
return T(this, e, t, !0, n)
}, l.prototype.writeFloatBE = function(e, t, n) {
return T(this, e, t, !1, n)
}, l.prototype.writeDoubleLE = function(e, t, n) {
return M(this, e, t, !0, n)
}, l.prototype.writeDoubleBE = function(e, t, n) {
return M(this, e, t, !1, n)
}, l.prototype.copy = function(e, t, n, i) {
if (n || (n = 0), i || 0 === i || (i = this.length), t >= e.length && (t = e.length), t || (t = 0), 0 < i && i < n && (i = n), i === n) return 0;
if (0 === e.length || 0 === this.length) return 0;
if (t < 0) throw new RangeError("targetStart out of bounds");
if (n < 0 || n >= this.length) throw new RangeError("sourceStart out of bounds");
if (i < 0) throw new RangeError("sourceEnd out of bounds");
i > this.length && (i = this.length), e.length - t < i - n && (i = e.length - t + n);
var s, r = i - n;
if (this === e && n < t && t < i)
for (s = r - 1; 0 <= s; --s) e[s + t] = this[s + n];
else if (r < 1e3 || !l.TYPED_ARRAY_SUPPORT)
for (s = 0; s < r; ++s) e[s + t] = this[s + n];
else Uint8Array.prototype.set.call(e, this.subarray(n, n + r), t);
return r
}, l.prototype.fill = function(e, t, n, i) {
if ("string" == typeof e) {
if ("string" == typeof t ? (i = t, t = 0, n = this.length) : "string" == typeof n && (i = n, n = this.length), 1 === e.length) {
var s = e.charCodeAt(0);
s < 256 && (e = s)
}
if (void 0 !== i && "string" != typeof i) throw new TypeError("encoding must be a string");
if ("string" == typeof i && !l.isEncoding(i)) throw new TypeError("Unknown encoding: " + i)
} else "number" == typeof e && (e &= 255);
if (t < 0 || this.length < t || this.length < n) throw new RangeError("Out of range index");
if (n <= t) return this;
var r;
if (t >>>= 0, n = void 0 === n ? this.length : n >>> 0, e || (e = 0), "number" == typeof e)
for (r = t; r < n; ++r) this[r] = e;
else {
var a = l.isBuffer(e) ? e : D(new l(e, i).toString()),
o = a.length;
for (r = 0; r < n - t; ++r) this[r + t] = a[r % o]
}
return this
};
var U = /[^+\/0-9A-Za-z-_]/g
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
"base64-js": 30,
ieee754: 32,
isarray: 34
}],
30: [function(e, t, n) {
function c(e) {
var t = e.length;
if (0 < t % 4) throw new Error("Invalid string. Length must be a multiple of 4");
return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
}
function u(e, t, n) {
for (var i, s = [], r = t; r < n; r += 3) i = (e[r] << 16) + (e[r + 1] << 8) + e[r + 2], s.push(h[(a = i) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
var a;
return s.join("")
}
n.byteLength = function a(e) {
return 3 * e.length / 4 - c(e)
}, n.toByteArray = function f(e) {
var t, n, i, s, r, a, o = e.length;
r = c(e), a = new d(3 * o / 4 - r), i = 0 < r ? o - 4 : o;
var u = 0;
for (n = t = 0; t < i; t += 4, n += 3) s = l[e.charCodeAt(t)] << 18 | l[e.charCodeAt(t + 1)] << 12 | l[e.charCodeAt(t + 2)] << 6 | l[e.charCodeAt(t + 3)], a[u++] = s >> 16 & 255, a[u++] = s >> 8 & 255, a[u++] = 255 & s;
return 2 === r ? (s = l[e.charCodeAt(t)] << 2 | l[e.charCodeAt(t + 1)] >> 4, a[u++] = 255 & s) : 1 === r && (s = l[e.charCodeAt(t)] << 10 | l[e.charCodeAt(t + 1)] << 4 | l[e.charCodeAt(t + 2)] >> 2, a[u++] = s >> 8 & 255, a[u++] = 255 & s), a
}, n.fromByteArray = function _(e) {
for (var t, n = e.length, i = n % 3, s = "", r = [], a = 0, o = n - i; a < o; a += 16383) r.push(u(e, a, o < a + 16383 ? o : a + 16383));
return 1 === i ? (t = e[n - 1], s += h[t >> 2], s += h[t << 4 & 63], s += "==") : 2 === i && (t = (e[n - 2] << 8) + e[n - 1], s += h[t >> 10], s += h[t >> 4 & 63], s += h[t << 2 & 63], s += "="), r.push(s), r.join("")
};
for (var h = [], l = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, r = i.length; s < r; ++s) h[s] = i[s], l[i.charCodeAt(s)] = s;
l["-".charCodeAt(0)] = 62, l["_".charCodeAt(0)] = 63
}, {}],
31: [function(e, o, t) {
! function(e) {
function t(e) {
for (var t in n) e[t] = n[t];
return e
}
function s(e, t) {
var n;
if (arguments.length) {
if (t) {
if (n = c(this, e, !0)) {
if (!(n = n.filter(function i(e) {
return e !== t && e.originalListener !== t
})).length) return s.call(this, e);
this[r][e] = n
}
} else if ((n = this[r]) && (delete n[e], !Object.keys(n).length)) return s.call(this)
} else delete this[r];
return this
}
function c(e, t, n) {
if (!n || e[r]) {
var i = e[r] || (e[r] = {});
return i[t] || (i[t] = [])
}
}
"undefined" != typeof o && (o.exports = e);
var r = "listeners",
n = {
on: function i(e, t) {
return c(this, e).push(t), this
},
once: function a(e, t) {
function n() {
s.call(i, e, n), t.apply(this, arguments)
}
var i = this;
return n.originalListener = t, c(i, e).push(n), i
},
off: s,
emit: function h(e, t) {
function n(e) {
e.call(r)
}
function i(e) {
e.call(r, t)
}
function s(e) {
e.apply(r, u)
}
var r = this,
a = c(r, e, !0);
if (!a) return !1;
var o = arguments.length;
if (1 === o) a.forEach(n);
else if (2 === o) a.forEach(i);
else {
var u = Array.prototype.slice.call(arguments, 1);
a.forEach(s)
}
return !!a.length
}
};
t(e.prototype), e.mixin = t
}(function n() {
if (!(this instanceof n)) return new n
})
}, {}],
32: [function(e, t, n) {
n.read = function(e, t, n, i, s) {
var r, a, o = 8 * s - i - 1,
u = (1 << o) - 1,
c = u >> 1,
h = -7,
l = n ? s - 1 : 0,
d = n ? -1 : 1,
f = e[t + l];
for (l += d, r = f & (1 << -h) - 1, f >>= -h, h += o; 0 < h; r = 256 * r + e[t + l], l += d, h -= 8);
for (a = r & (1 << -h) - 1, r >>= -h, h += i; 0 < h; a = 256 * a + e[t + l], l += d, h -= 8);
if (0 === r) r = 1 - c;
else {
if (r === u) return a ? NaN : 1 / 0 * (f ? -1 : 1);
a += Math.pow(2, i), r -= c
}
return (f ? -1 : 1) * a * Math.pow(2, r - i)
}, n.write = function(e, t, n, i, s, r) {
var a, o, u, c = 8 * r - s - 1,
h = (1 << c) - 1,
l = h >> 1,
d = 23 === s ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
f = i ? 0 : r - 1,
_ = i ? 1 : -1,
p = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (o = isNaN(t) ? 1 : 0, a = h) : (a = Math.floor(Math.log(t) / Math.LN2), t * (u = Math.pow(2, -a)) < 1 && (a--, u *= 2), 2 <= (t += 1 <= a + l ? d / u : d * Math.pow(2, 1 - l)) * u && (a++, u /= 2), h <= a + l ? (o = 0, a = h) : 1 <= a + l ? (o = (t * u - 1) * Math.pow(2, s), a += l) : (o = t * Math.pow(2, l - 1) * Math.pow(2, s), a = 0)); 8 <= s; e[n + f] = 255 & o, f += _, o /= 256, s -= 8);
for (a = a << s | o, c += s; 0 < c; e[n + f] = 255 & a, f += _, a /= 256, c -= 8);
e[n + f - _] |= 128 * p
}
}, {}],
33: [function(e, t, n) {
(function(s) {
! function(w) {
function e(e, t, u) {
function s(e, t, n, i) {
return this instanceof s ? function a(e, t, n, i, s) {
if (L && I && (t instanceof I && (t = new L(t)), i instanceof I && (i = new L(i))), t || n || i || F) {
if (!k(t, n)) {
var r = F || Array;
s = n, i = t, n = 0, t = new r(8)
}
e.buffer = t, e.offset = n |= 0, A !== ("undefined" == typeof i ? "undefined" : le(i)) && ("string" == typeof i ? function h(e, t, n, i) {
var s = 0,
r = n.length,
a = 0,
o = 0;
"-" === n[0] && s++;
for (var u = s; s < r;) {
var c = parseInt(n[s++], i);
if (!(0 <= c)) break;
o = o * i + c, a = a * i + Math.floor(o / B), o %= B
}
u && (a = ~a, o ? o = B - o : a++), l(e, t + d, a), l(e, t + f, o)
}(t, n, i, s || 10) : k(i, s) ? C(t, n, i, s) : "number" == typeof s ? (l(t, n + d, i), l(t, n + f, s)) : 0 < i ? _(t, n, i) : i < 0 ? p(t, n, i) : C(t, n, U, 0))
} else e.buffer = T(U, 0)
}(this, e, t, n, i) : new s(e, t, n, i)
}
function n() {
var e = this.buffer,
t = this.offset,
n = c(e, t + d),
i = c(e, t + f);
return u || (n |= 0), n ? n * B + i : i
}
function l(e, t, n) {
e[t + o] = 255 & n, n >>= 8, e[t + a] = 255 & n, n >>= 8, e[t + r] = 255 & n, n >>= 8, e[t + i] = 255 & n
}
function c(e, t) {
return 16777216 * e[t + i] + (e[t + r] << 16) + (e[t + a] << 8) + e[t + o]
}
var d = t ? 0 : 4,
f = t ? 4 : 0,
i = t ? 0 : 3,
r = t ? 1 : 2,
a = t ? 2 : 1,
o = t ? 3 : 0,
_ = t ? M : R,
p = t ? D : x,
h = s.prototype,
g = "is" + e,
v = "_" + g;
return h.buffer = void 0, h.offset = 0, h[v] = !0, h.toNumber = n, h.toString = function m(e) {
var t = this.buffer,
n = this.offset,
i = c(t, n + d),
s = c(t, n + f),
r = "",
a = !u && 2147483648 & i;
for (a && (i = ~i, s = B - s), e = e || 10;;) {
var o = i % e * B + s;
if (i = Math.floor(i / e), s = Math.floor(o / e), r = (o % e).toString(e) + r, !i && !s) break
}
return a && (r = "-" + r), r
}, h.toJSON = n, h.toArray = S, P && (h.toBuffer = b), L && (h.toArrayBuffer = E), s[g] = function y(e) {
return !(!e || !e[v])
}, w[e] = s
}
function S(e) {
var t = this.buffer,
n = this.offset;
return F = null, !1 !== e && 0 === n && 8 === t.length && i(t) ? t : T(t, n)
}
function b(e) {
var t = this.buffer,
n = this.offset;
if (F = P, !1 !== e && 0 === n && 8 === t.length && s.isBuffer(t)) return t;
var i = new P(8);
return C(i, 0, t, n), i
}
function E(e) {
var t = this.buffer,
n = this.offset,
i = t.buffer;
if (F = L, !1 !== e && 0 === n && i instanceof I && 8 === i.byteLength) return i;
var s = new L(8);
return C(s, 0, t, n), s.buffer
}
function k(e, t) {
var n = e && e.length;
return t |= 0, n && t + 8 <= n && "string" != typeof e[t]
}
function C(e, t, n, i) {
t |= 0, i |= 0;
for (var s = 0; s < 8; s++) e[t++] = 255 & n[i++]
}
function T(e, t) {
return Array.prototype.slice.call(e, t, t + 8)
}
function M(e, t, n) {
for (var i = t + 8; t < i;) e[--i] = 255 & n, n /= 256
}
function D(e, t, n) {
var i = t + 8;
for (n++; t < i;) e[--i] = 255 & -n ^ 255, n /= 256
}
function R(e, t, n) {
for (var i = t + 8; t < i;) e[t++] = 255 & n, n /= 256
}
function x(e, t, n) {
var i = t + 8;
for (n++; t < i;) e[t++] = 255 & -n ^ 255, n /= 256
}
var F, A = "undefined",
P = A !== ("undefined" == typeof s ? "undefined" : le(s)) && s,
L = A !== ("undefined" == typeof Uint8Array ? "undefined" : le(Uint8Array)) && Uint8Array,
I = A !== ("undefined" == typeof ArrayBuffer ? "undefined" : le(ArrayBuffer)) && ArrayBuffer,
U = [0, 0, 0, 0, 0, 0, 0, 0],
i = Array.isArray || function t(e) {
return !!e && "[object Array]" == Object.prototype.toString.call(e)
},
B = 4294967296;
e("Uint64BE", !0, !0), e("Int64BE", !0, !1), e("Uint64LE", !1, !0), e("Int64LE", !1, !1)
}("object" == ("undefined" == typeof n ? "undefined" : le(n)) && "string" != typeof n.nodeName ? n : this || {})
}).call(this, e("buffer").Buffer)
}, {
buffer: 29
}],
34: [function(e, t, n) {
var i = {}.toString;
t.exports = Array.isArray || function(e) {
return "[object Array]" == i.call(e)
}
}, {}]
}, {}, [1])(1)
}(),
function(e) {
("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).pako = function h(r, a, o) {
function u(n, e) {
if (!a[n]) {
if (!r[n]) {
var t = "function" == typeof require && require;
if (!e && t) return t(n, !0);
if (c) return c(n, !0);
var i = new Error("Cannot find module '" + n + "'");
throw i.code = "MODULE_NOT_FOUND", i
}
var s = a[n] = {
exports: {}
};
r[n][0].call(s.exports, function(e) {
var t = r[n][1][e];
return u(t || e)
}, s, s.exports, h, r, a, o)
}
return a[n].exports
}
for (var c = "function" == typeof require && require, e = 0; e < o.length; e++) u(o[e]);
return u
}({
1: [function(e, t, n) {
var a = e("./zlib/deflate"),
o = e("./utils/common"),
u = e("./utils/strings"),
s = e("./zlib/messages"),
r = e("./zlib/zstream"),
c = Object.prototype.toString,
h = 0,
l = -1,
d = 0,
f = 8;
function _(e) {
if (!(this instanceof _)) return new _(e);
this.options = o.assign({
level: l,
method: f,
chunkSize: 16384,
windowBits: 15,
memLevel: 8,
strategy: d,
to: ""
}, e || {});
var t = this.options;
t.raw && 0 < t.windowBits ? t.windowBits = -t.windowBits : t.gzip && 0 < t.windowBits && t.windowBits < 16 && (t.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new r, this.strm.avail_out = 0;
var n = a.deflateInit2(this.strm, t.level, t.method, t.windowBits, t.memLevel, t.strategy);
if (n !== h) throw new Error(s[n]);
if (t.header && a.deflateSetHeader(this.strm, t.header), t.dictionary) {
var i;
if (i = "string" == typeof t.dictionary ? u.string2buf(t.dictionary) : "[object ArrayBuffer]" === c.call(t.dictionary) ? new Uint8Array(t.dictionary) : t.dictionary, (n = a.deflateSetDictionary(this.strm, i)) !== h) throw new Error(s[n]);
this._dict_set = !0
}
}
function i(e, t) {
var n = new _(t);
if (n.push(e, !0), n.err) throw n.msg || s[n.err];
return n.result
}
_.prototype.push = function(e, t) {
var n, i, s = this.strm,
r = this.options.chunkSize;
if (this.ended) return !1;
i = t === ~~t ? t : !0 === t ? 4 : 0, "string" == typeof e ? s.input = u.string2buf(e) : "[object ArrayBuffer]" === c.call(e) ? s.input = new Uint8Array(e) : s.input = e, s.next_in = 0, s.avail_in = s.input.length;
do {
if (0 === s.avail_out && (s.output = new o.Buf8(r), s.next_out = 0, s.avail_out = r), 1 !== (n = a.deflate(s, i)) && n !== h) return this.onEnd(n), !(this.ended = !0);
0 !== s.avail_out && (0 !== s.avail_in || 4 !== i && 2 !== i) || ("string" === this.options.to ? this.onData(u.buf2binstring(o.shrinkBuf(s.output, s.next_out))) : this.onData(o.shrinkBuf(s.output, s.next_out)))
} while ((0 < s.avail_in || 0 === s.avail_out) && 1 !== n);
return 4 === i ? (n = a.deflateEnd(this.strm), this.onEnd(n), this.ended = !0, n === h) : 2 !== i || (this.onEnd(h), !(s.avail_out = 0))
}, _.prototype.onData = function(e) {
this.chunks.push(e)
}, _.prototype.onEnd = function(e) {
e === h && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg
}, n.Deflate = _, n.deflate = i, n.deflateRaw = function p(e, t) {
return (t = t || {}).raw = !0, i(e, t)
}, n.gzip = function g(e, t) {
return (t = t || {}).gzip = !0, i(e, t)
}
}, {
"./utils/common": 3,
"./utils/strings": 4,
"./zlib/deflate": 8,
"./zlib/messages": 13,
"./zlib/zstream": 15
}],
2: [function(e, t, n) {
var d = e("./zlib/inflate"),
f = e("./utils/common"),
_ = e("./utils/strings"),
p = e("./zlib/constants"),
i = e("./zlib/messages"),
s = e("./zlib/zstream"),
r = e("./zlib/gzheader"),
g = Object.prototype.toString;
function a(e) {
if (!(this instanceof a)) return new a(e);
this.options = f.assign({
chunkSize: 16384,
windowBits: 0,
to: ""
}, e || {});
var t = this.options;
t.raw && 0 <= t.windowBits && t.windowBits < 16 && (t.windowBits = -t.windowBits, 0 === t.windowBits && (t.windowBits = -15)), !(0 <= t.windowBits && t.windowBits < 16) || e && e.windowBits || (t.windowBits += 32), 15 < t.windowBits && t.windowBits < 48 && 0 == (15 & t.windowBits) && (t.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new s, this.strm.avail_out = 0;
var n = d.inflateInit2(this.strm, t.windowBits);
if (n !== p.Z_OK) throw new Error(i[n]);
this.header = new r, d.inflateGetHeader(this.strm, this.header)
}
function o(e, t) {
var n = new a(t);
if (n.push(e, !0), n.err) throw n.msg || i[n.err];
return n.result
}
a.prototype.push = function(e, t) {
var n, i, s, r, a, o, u = this.strm,
c = this.options.chunkSize,
h = this.options.dictionary,
l = !1;
if (this.ended) return !1;
i = t === ~~t ? t : !0 === t ? p.Z_FINISH : p.Z_NO_FLUSH, "string" == typeof e ? u.input = _.binstring2buf(e) : "[object ArrayBuffer]" === g.call(e) ? u.input = new Uint8Array(e) : u.input = e, u.next_in = 0, u.avail_in = u.input.length;
do {
if (0 === u.avail_out && (u.output = new f.Buf8(c), u.next_out = 0, u.avail_out = c), (n = d.inflate(u, p.Z_NO_FLUSH)) === p.Z_NEED_DICT && h && (o = "string" == typeof h ? _.string2buf(h) : "[object ArrayBuffer]" === g.call(h) ? new Uint8Array(h) : h, n = d.inflateSetDictionary(this.strm, o)), n === p.Z_BUF_ERROR && !0 === l && (n = p.Z_OK, l = !1), n !== p.Z_STREAM_END && n !== p.Z_OK) return this.onEnd(n), !(this.ended = !0);
u.next_out && (0 !== u.avail_out && n !== p.Z_STREAM_END && (0 !== u.avail_in || i !== p.Z_FINISH && i !== p.Z_SYNC_FLUSH) || ("string" === this.options.to ? (s = _.utf8border(u.output, u.next_out), r = u.next_out - s, a = _.buf2string(u.output, s), u.next_out = r, u.avail_out = c - r, r && f.arraySet(u.output, u.output, s, r, 0), this.onData(a)) : this.onData(f.shrinkBuf(u.output, u.next_out)))), 0 === u.avail_in && 0 === u.avail_out && (l = !0)
} while ((0 < u.avail_in || 0 === u.avail_out) && n !== p.Z_STREAM_END);
return n === p.Z_STREAM_END && (i = p.Z_FINISH), i === p.Z_FINISH ? (n = d.inflateEnd(this.strm), this.onEnd(n), this.ended = !0, n === p.Z_OK) : i !== p.Z_SYNC_FLUSH || (this.onEnd(p.Z_OK), !(u.avail_out = 0))
}, a.prototype.onData = function(e) {
this.chunks.push(e)
}, a.prototype.onEnd = function(e) {
e === p.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = f.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg
}, n.Inflate = a, n.inflate = o, n.inflateRaw = function u(e, t) {
return (t = t || {}).raw = !0, o(e, t)
}, n.ungzip = o
}, {
"./utils/common": 3,
"./utils/strings": 4,
"./zlib/constants": 6,
"./zlib/gzheader": 9,
"./zlib/inflate": 11,
"./zlib/messages": 13,
"./zlib/zstream": 15
}],
3: [function(e, t, n) {
var i = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array;
n.assign = function(e) {
for (var t, n, i = Array.prototype.slice.call(arguments, 1); i.length;) {
var s = i.shift();
if (s) {
if ("object" !== ("undefined" == typeof s ? "undefined" : le(s))) throw new TypeError(s + "must be non-object");
for (var r in s) t = s, n = r, Object.prototype.hasOwnProperty.call(t, n) && (e[r] = s[r])
}
}
return e
}, n.shrinkBuf = function(e, t) {
return e.length === t ? e : e.subarray ? e.subarray(0, t) : (e.length = t, e)
};
var s = {
arraySet: function(e, t, n, i, s) {
if (t.subarray && e.subarray) e.set(t.subarray(n, n + i), s);
else
for (var r = 0; r < i; r++) e[s + r] = t[n + r]
},
flattenChunks: function(e) {
var t, n, i, s, r, a;
for (t = i = 0, n = e.length; t < n; t++) i += e[t].length;
for (a = new Uint8Array(i), t = s = 0, n = e.length; t < n; t++) r = e[t], a.set(r, s), s += r.length;
return a
}
},
r = {
arraySet: function(e, t, n, i, s) {
for (var r = 0; r < i; r++) e[s + r] = t[n + r]
},
flattenChunks: function(e) {
return [].concat.apply([], e)
}
};
n.setTyped = function(e) {
e ? (n.Buf8 = Uint8Array, n.Buf16 = Uint16Array, n.Buf32 = Int32Array, n.assign(n, s)) : (n.Buf8 = Array, n.Buf16 = Array, n.Buf32 = Array, n.assign(n, r))
}, n.setTyped(i)
}, {}],
4: [function(e, t, n) {
var u = e("./common"),
s = !0,
r = !0;
try {
String.fromCharCode.apply(null, [0])
} catch (a) {
s = !1
}
try {
String.fromCharCode.apply(null, new Uint8Array(1))
} catch (a) {
r = !1
}
for (var c = new u.Buf8(256), i = 0; i < 256; i++) c[i] = 252 <= i ? 6 : 248 <= i ? 5 : 240 <= i ? 4 : 224 <= i ? 3 : 192 <= i ? 2 : 1;
function h(e, t) {
if (t < 65537 && (e.subarray && r || !e.subarray && s)) return String.fromCharCode.apply(null, u.shrinkBuf(e, t));
for (var n = "", i = 0; i < t; i++) n += String.fromCharCode(e[i]);
return n
}
c[254] = c[254] = 1, n.string2buf = function(e) {
var t, n, i, s, r, a = e.length,
o = 0;
for (s = 0; s < a; s++) 55296 == (64512 & (n = e.charCodeAt(s))) && s + 1 < a && 56320 == (64512 & (i = e.charCodeAt(s + 1))) && (n = 65536 + (n - 55296 << 10) + (i - 56320), s++), o += n < 128 ? 1 : n < 2048 ? 2 : n < 65536 ? 3 : 4;
for (t = new u.Buf8(o), s = r = 0; r < o; s++) 55296 == (64512 & (n = e.charCodeAt(s))) && s + 1 < a && 56320 == (64512 & (i = e.charCodeAt(s + 1))) && (n = 65536 + (n - 55296 << 10) + (i - 56320), s++), t[r++] = n < 128 ? n : (t[r++] = n < 2048 ? 192 | n >>> 6 : (t[r++] = n < 65536 ? 224 | n >>> 12 : (t[r++] = 240 | n >>> 18, 128 | n >>> 12 & 63), 128 | n >>> 6 & 63), 128 | 63 & n);
return t
}, n.buf2binstring = function(e) {
return h(e, e.length)
}, n.binstring2buf = function(e) {
for (var t = new u.Buf8(e.length), n = 0, i = t.length; n < i; n++) t[n] = e.charCodeAt(n);
return t
}, n.buf2string = function(e, t) {
var n, i, s, r, a = t || e.length,
o = new Array(2 * a);
for (n = i = 0; n < a;)
if ((s = e[n++]) < 128) o[i++] = s;
else if (4 < (r = c[s])) o[i++] = 65533, n += r - 1;
else {
for (s &= 2 === r ? 31 : 3 === r ? 15 : 7; 1 < r && n < a;) s = s << 6 | 63 & e[n++], r--;
o[i++] = 1 < r ? 65533 : s < 65536 ? s : (s -= 65536, o[i++] = 55296 | s >> 10 & 1023, 56320 | 1023 & s)
}
return h(o, i)
}, n.utf8border = function(e, t) {
var n;
for ((t = t || e.length) > e.length && (t = e.length), n = t - 1; 0 <= n && 128 == (192 & e[n]);) n--;
return n < 0 ? t : 0 === n ? t : n + c[e[n]] > t ? n : t
}
}, {
"./common": 3
}],
5: [function(e, t, n) {
t.exports = function o(e, t, n, i) {
for (var s = 65535 & e | 0, r = e >>> 16 & 65535 | 0, a = 0; 0 !== n;) {
for (n -= a = 2e3 < n ? 2e3 : n; s = s + t[i++] | 0, r = r + s | 0, --a;);
s %= 65521, r %= 65521
}
return s | r << 16 | 0
}
}, {}],
6: [function(e, t, n) {
t.exports = {
Z_NO_FLUSH: 0,
Z_PARTIAL_FLUSH: 1,
Z_SYNC_FLUSH: 2,
Z_FULL_FLUSH: 3,
Z_FINISH: 4,
Z_BLOCK: 5,
Z_TREES: 6,
Z_OK: 0,
Z_STREAM_END: 1,
Z_NEED_DICT: 2,
Z_ERRNO: -1,
Z_STREAM_ERROR: -2,
Z_DATA_ERROR: -3,
Z_BUF_ERROR: -5,
Z_NO_COMPRESSION: 0,
Z_BEST_SPEED: 1,
Z_BEST_COMPRESSION: 9,
Z_DEFAULT_COMPRESSION: -1,
Z_FILTERED: 1,
Z_HUFFMAN_ONLY: 2,
Z_RLE: 3,
Z_FIXED: 4,
Z_DEFAULT_STRATEGY: 0,
Z_BINARY: 0,
Z_TEXT: 1,
Z_UNKNOWN: 2,
Z_DEFLATED: 8
}
}, {}],
7: [function(e, t, n) {
var o = function s() {
for (var e, t = [], n = 0; n < 256; n++) {
e = n;
for (var i = 0; i < 8; i++) e = 1 & e ? 3988292384 ^ e >>> 1 : e >>> 1;
t[n] = e
}
return t
}();
t.exports = function u(e, t, n, i) {
var s = o,
r = i + n;
e ^= -1;
for (var a = i; a < r; a++) e = e >>> 8 ^ s[255 & (e ^ t[a])];
return -1 ^ e
}
}, {}],
8: [function(e, t, n) {
var c, d = e("../utils/common"),
h = e("./trees"),
f = e("./adler32"),
_ = e("./crc32"),
i = e("./messages"),
l = 0,
p = 4,
g = 0,
v = -2,
u = -1,
m = 4,
s = 2,
y = 8,
w = 9,
r = 286,
a = 30,
o = 19,
S = 2 * r + 1,
b = 15,
E = 3,
k = 258,
C = k + E + 1,
T = 42,
M = 113,
D = 1,
R = 2,
x = 3,
F = 4;
function A(e, t) {
return e.msg = i[t], t
}
function P(e) {
return (e << 1) - (4 < e ? 9 : 0)
}
function L(e) {
for (var t = e.length; 0 <= --t;) e[t] = 0
}
function I(e) {
var t = e.state,
n = t.pending;
n > e.avail_out && (n = e.avail_out), 0 !== n && (d.arraySet(e.output, t.pending_buf, t.pending_out, n, e.next_out), e.next_out += n, t.pending_out += n, e.total_out += n, e.avail_out -= n, t.pending -= n, 0 === t.pending && (t.pending_out = 0))
}
function U(e, t) {
h._tr_flush_block(e, 0 <= e.block_start ? e.block_start : -1, e.strstart - e.block_start, t), e.block_start = e.strstart, I(e.strm)
}
function B(e, t) {
e.pending_buf[e.pending++] = t
}
function N(e, t) {
e.pending_buf[e.pending++] = t >>> 8 & 255, e.pending_buf[e.pending++] = 255 & t
}
function O(e, t) {
var n, i, s = e.max_chain_length,
r = e.strstart,
a = e.prev_length,
o = e.nice_match,
u = e.strstart > e.w_size - C ? e.strstart - (e.w_size - C) : 0,
c = e.window,
h = e.w_mask,
l = e.prev,
d = e.strstart + k,
f = c[r + a - 1],
_ = c[r + a];
e.prev_length >= e.good_match && (s >>= 2), o > e.lookahead && (o = e.lookahead);
do {
if (c[(n = t) + a] === _ && c[n + a - 1] === f && c[n] === c[r] && c[++n] === c[r + 1]) {
r += 2, n++;
do {} while (c[++r] === c[++n] && c[++r] === c[++n] && c[++r] === c[++n] && c[++r] === c[++n] && c[++r] === c[++n] && c[++r] === c[++n] && c[++r] === c[++n] && c[++r] === c[++n] && r < d);
if (i = k - (d - r), r = d - k, a < i) {
if (e.match_start = t, o <= (a = i)) break;
f = c[r + a - 1], _ = c[r + a]
}
}
} while ((t = l[t & h]) > u && 0 != --s);
return a <= e.lookahead ? a : e.lookahead
}
function W(e) {
var t, n, i, s, r, a, o, u, c, h, l = e.w_size;
do {
if (s = e.window_size - e.lookahead - e.strstart, e.strstart >= l + (l - C)) {
for (d.arraySet(e.window, e.window, l, l, 0), e.match_start -= l, e.strstart -= l, e.block_start -= l, n = e.hash_size, t = n; i = e.head[--t], e.head[t] = l <= i ? i - l : 0, --n;);
for (t = n = l; i = e.prev[--t], e.prev[t] = l <= i ? i - l : 0, --n;);
s += l
}
if (0 === e.strm.avail_in) break;
if (a = e.strm, o = e.window, u = e.strstart + e.lookahead, c = s, h = void 0, h = a.avail_in, c < h && (h = c), n = 0 === h ? 0 : (a.avail_in -= h, d.arraySet(o, a.input, a.next_in, h, u), 1 === a.state.wrap ? a.adler = f(a.adler, o, h, u) : 2 === a.state.wrap && (a.adler = _(a.adler, o, h, u)), a.next_in += h, a.total_in += h, h), e.lookahead += n, e.lookahead + e.insert >= E)
for (r = e.strstart - e.insert, e.ins_h = e.window[r], e.ins_h = (e.ins_h << e.hash_shift ^ e.window[r + 1]) & e.hash_mask; e.insert && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[r + E - 1]) & e.hash_mask, e.prev[r & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = r, r++, e.insert--, !(e.lookahead + e.insert < E)););
} while (e.lookahead < C && 0 !== e.strm.avail_in)
}
function Q(e, t) {
for (var n, i;;) {
if (e.lookahead < C) {
if (W(e), e.lookahead < C && t === l) return D;
if (0 === e.lookahead) break
}
if (n = 0, e.lookahead >= E && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + E - 1]) & e.hash_mask, n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), 0 !== n && e.strstart - n <= e.w_size - C && (e.match_length = O(e, n)), e.match_length >= E)
if (i = h._tr_tally(e, e.strstart - e.match_start, e.match_length - E), e.lookahead -= e.match_length, e.match_length <= e.max_lazy_match && e.lookahead >= E) {
for (e.match_length--; e.strstart++, e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + E - 1]) & e.hash_mask, n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart, 0 != --e.match_length;);
e.strstart++
} else e.strstart += e.match_length, e.match_length = 0, e.ins_h = e.window[e.strstart], e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + 1]) & e.hash_mask;
else i = h._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++;
if (i && (U(e, !1), 0 === e.strm.avail_out)) return D
}
return e.insert = e.strstart < E - 1 ? e.strstart : E - 1, t === p ? (U(e, !0), 0 === e.strm.avail_out ? x : F) : e.last_lit && (U(e, !1), 0 === e.strm.avail_out) ? D : R
}
function H(e, t) {
for (var n, i, s;;) {
if (e.lookahead < C) {
if (W(e), e.lookahead < C && t === l) return D;
if (0 === e.lookahead) break
}
if (n = 0, e.lookahead >= E && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + E - 1]) & e.hash_mask, n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), e.prev_length = e.match_length, e.prev_match = e.match_start, e.match_length = E - 1, 0 !== n && e.prev_length < e.max_lazy_match && e.strstart - n <= e.w_size - C && (e.match_length = O(e, n), e.match_length <= 5 && (1 === e.strategy || e.match_length === E && 4096 < e.strstart - e.match_start) && (e.match_length = E - 1)), e.prev_length >= E && e.match_length <= e.prev_length) {
for (s = e.strstart + e.lookahead - E, i = h._tr_tally(e, e.strstart - 1 - e.prev_match, e.prev_length - E), e.lookahead -= e.prev_length - 1, e.prev_length -= 2; ++e.strstart <= s && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + E - 1]) & e.hash_mask, n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), 0 != --e.prev_length;);
if (e.match_available = 0, e.match_length = E - 1, e.strstart++, i && (U(e, !1), 0 === e.strm.avail_out)) return D
} else if (e.match_available) {
if ((i = h._tr_tally(e, 0, e.window[e.strstart - 1])) && U(e, !1), e.strstart++, e.lookahead--, 0 === e.strm.avail_out) return D
} else e.match_available = 1, e.strstart++, e.lookahead--
}
return e.match_available && (i = h._tr_tally(e, 0, e.window[e.strstart - 1]), e.match_available = 0), e.insert = e.strstart < E - 1 ? e.strstart : E - 1, t === p ? (U(e, !0), 0 === e.strm.avail_out ? x : F) : e.last_lit && (U(e, !1), 0 === e.strm.avail_out) ? D : R
}
function z(e, t) {
for (var n, i, s, r, a = e.window;;) {
if (e.lookahead <= k) {
if (W(e), e.lookahead <= k && t === l) return D;
if (0 === e.lookahead) break
}
if (e.match_length = 0, e.lookahead >= E && 0 < e.strstart && (s = e.strstart - 1, (i = a[s]) === a[++s] && i === a[++s] && i === a[++s])) {
r = e.strstart + k;
do {} while (i === a[++s] && i === a[++s] && i === a[++s] && i === a[++s] && i === a[++s] && i === a[++s] && i === a[++s] && i === a[++s] && s < r);
e.match_length = k - (r - s), e.match_length > e.lookahead && (e.match_length = e.lookahead)
}
if (e.match_length >= E ? (n = h._tr_tally(e, 1, e.match_length - E), e.lookahead -= e.match_length, e.strstart += e.match_length, e.match_length = 0) : (n = h._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++), n && (U(e, !1), 0 === e.strm.avail_out)) return D
}
return e.insert = 0, t === p ? (U(e, !0), 0 === e.strm.avail_out ? x : F) : e.last_lit && (U(e, !1), 0 === e.strm.avail_out) ? D : R
}
function q(e, t) {
for (var n;;) {
if (0 === e.lookahead && (W(e), 0 === e.lookahead)) {
if (t === l) return D;
break
}
if (e.match_length = 0, n = h._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++, n && (U(e, !1), 0 === e.strm.avail_out)) return D
}
return e.insert = 0, t === p ? (U(e, !0), 0 === e.strm.avail_out ? x : F) : e.last_lit && (U(e, !1), 0 === e.strm.avail_out) ? D : R
}
function j(e, t, n, i, s) {
this.good_length = e, this.max_lazy = t, this.nice_length = n, this.max_chain = i, this.func = s
}
function V() {
this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = y, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new d.Buf16(2 * S), this.dyn_dtree = new d.Buf16(2 * (2 * a + 1)), this.bl_tree = new d.Buf16(2 * (2 * o + 1)), L(this.dyn_ltree), L(this.dyn_dtree), L(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new d.Buf16(b + 1), this.heap = new d.Buf16(2 * r + 1), L(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new d.Buf16(2 * r + 1), L(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0
}
function Y(e) {
var t;
return e && e.state ? (e.total_in = e.total_out = 0, e.data_type = s, (t = e.state).pending = 0, t.pending_out = 0, t.wrap < 0 && (t.wrap = -t.wrap), t.status = t.wrap ? T : M, e.adler = 2 === t.wrap ? 0 : 1, t.last_flush = l, h._tr_init(t), g) : A(e, v)
}
function K(e) {
var t = Y(e);
return t === g && function n(e) {
e.window_size = 2 * e.w_size, L(e.head), e.max_lazy_match = c[e.level].max_lazy, e.good_match = c[e.level].good_length, e.nice_match = c[e.level].nice_length, e.max_chain_length = c[e.level].max_chain, e.strstart = 0, e.block_start = 0, e.lookahead = 0, e.insert = 0, e.match_length = e.prev_length = E - 1, e.match_available = 0, e.ins_h = 0
}(e.state), t
}
function G(e, t, n, i, s, r) {
if (!e) return v;
var a = 1;
if (t === u && (t = 6), i < 0 ? (a = 0, i = -i) : 15 < i && (a = 2, i -= 16), s < 1 || w < s || n !== y || i < 8 || 15 < i || t < 0 || 9 < t || r < 0 || m < r) return A(e, v);
8 === i && (i = 9);
var o = new V;
return (e.state = o).strm = e, o.wrap = a, o.gzhead = null, o.w_bits = i, o.w_size = 1 << o.w_bits, o.w_mask = o.w_size - 1, o.hash_bits = s + 7, o.hash_size = 1 << o.hash_bits, o.hash_mask = o.hash_size - 1, o.hash_shift = ~~((o.hash_bits + E - 1) / E), o.window = new d.Buf8(2 * o.w_size), o.head = new d.Buf16(o.hash_size), o.prev = new d.Buf16(o.w_size), o.lit_bufsize = 1 << s + 6, o.pending_buf_size = 4 * o.lit_bufsize, o.pending_buf = new d.Buf8(o.pending_buf_size), o.d_buf = 1 * o.lit_bufsize, o.l_buf = 3 * o.lit_bufsize, o.level = t, o.strategy = r, o.method = n, K(e)
}
c = [new j(0, 0, 0, 0, function X(e, t) {
var n = 65535;
for (n > e.pending_buf_size - 5 && (n = e.pending_buf_size - 5);;) {
if (e.lookahead <= 1) {
if (W(e), 0 === e.lookahead && t === l) return D;
if (0 === e.lookahead) break
}
e.strstart += e.lookahead, e.lookahead = 0;
var i = e.block_start + n;
if ((0 === e.strstart || e.strstart >= i) && (e.lookahead = e.strstart - i, e.strstart = i, U(e, !1), 0 === e.strm.avail_out)) return D;
if (e.strstart - e.block_start >= e.w_size - C && (U(e, !1), 0 === e.strm.avail_out)) return D
}
return e.insert = 0, t === p ? (U(e, !0), 0 === e.strm.avail_out ? x : F) : (e.strstart > e.block_start && (U(e, !1), e.strm.avail_out), D)
}), new j(4, 4, 8, 4, Q), new j(4, 5, 16, 8, Q), new j(4, 6, 32, 32, Q), new j(4, 4, 16, 16, H), new j(8, 16, 32, 32, H), new j(8, 16, 128, 128, H), new j(8, 32, 128, 256, H), new j(32, 128, 258, 1024, H), new j(32, 258, 258, 4096, H)], n.deflateInit = function Z(e, t) {
return G(e, t, y, 15, 8, 0)
}, n.deflateInit2 = G, n.deflateReset = K, n.deflateResetKeep = Y, n.deflateSetHeader = function J(e, t) {
return e && e.state && 2 === e.state.wrap ? (e.state.gzhead = t, g) : v
}, n.deflate = function $(e, t) {
var n, i, s, r;
if (!e || !e.state || 5 < t || t < 0) return e ? A(e, v) : v;
if (i = e.state, !e.output || !e.input && 0 !== e.avail_in || 666 === i.status && t !== p) return A(e, 0 === e.avail_out ? -5 : v);
if (i.strm = e, n = i.last_flush, i.last_flush = t, i.status === T)
if (2 === i.wrap) e.adler = 0, B(i, 31), B(i, 139), B(i, 8), i.gzhead ? (B(i, (i.gzhead.text ? 1 : 0) + (i.gzhead.hcrc ? 2 : 0) + (i.gzhead.extra ? 4 : 0) + (i.gzhead.name ? 8 : 0) + (i.gzhead.comment ? 16 : 0)), B(i, 255 & i.gzhead.time), B(i, i.gzhead.time >> 8 & 255), B(i, i.gzhead.time >> 16 & 255), B(i, i.gzhead.time >> 24 & 255), B(i, 9 === i.level ? 2 : 2 <= i.strategy || i.level < 2 ? 4 : 0), B(i, 255 & i.gzhead.os), i.gzhead.extra && i.gzhead.extra.length && (B(i, 255 & i.gzhead.extra.length), B(i, i.gzhead.extra.length >> 8 & 255)), i.gzhead.hcrc && (e.adler = _(e.adler, i.pending_buf, i.pending, 0)), i.gzindex = 0, i.status = 69) : (B(i, 0), B(i, 0), B(i, 0), B(i, 0), B(i, 0), B(i, 9 === i.level ? 2 : 2 <= i.strategy || i.level < 2 ? 4 : 0), B(i, 3), i.status = M);
else {
var a = y + (i.w_bits - 8 << 4) << 8,
o = -1;
o = 2 <= i.strategy || i.level < 2 ? 0 : i.level < 6 ? 1 : 6 === i.level ? 2 : 3, a |= o << 6, 0 !== i.strstart && (a |= 32), a += 31 - a % 31, i.status = M, N(i, a), 0 !== i.strstart && (N(i, e.adler >>> 16), N(i, 65535 & e.adler)), e.adler = 1
}
if (69 === i.status)
if (i.gzhead.extra) {
for (s = i.pending; i.gzindex < (65535 & i.gzhead.extra.length) && (i.pending !== i.pending_buf_size || (i.gzhead.hcrc && i.pending > s && (e.adler = _(e.adler, i.pending_buf, i.pending - s, s)), I(e), s = i.pending, i.pending !== i.pending_buf_size));) B(i, 255 & i.gzhead.extra[i.gzindex]), i.gzindex++;
i.gzhead.hcrc && i.pending > s && (e.adler = _(e.adler, i.pending_buf, i.pending - s, s)), i.gzindex === i.gzhead.extra.length && (i.gzindex = 0, i.status = 73)
} else i.status = 73;
if (73 === i.status)
if (i.gzhead.name) {
s = i.pending;
do {
if (i.pending === i.pending_buf_size && (i.gzhead.hcrc && i.pending > s && (e.adler = _(e.adler, i.pending_buf, i.pending - s, s)), I(e), s = i.pending, i.pending === i.pending_buf_size)) {
r = 1;
break
}
r = i.gzindex < i.gzhead.name.length ? 255 & i.gzhead.name.charCodeAt(i.gzindex++) : 0, B(i, r)
} while (0 !== r);
i.gzhead.hcrc && i.pending > s && (e.adler = _(e.adler, i.pending_buf, i.pending - s, s)), 0 === r && (i.gzindex = 0, i.status = 91)
} else i.status = 91;
if (91 === i.status)
if (i.gzhead.comment) {
s = i.pending;
do {
if (i.pending === i.pending_buf_size && (i.gzhead.hcrc && i.pending > s && (e.adler = _(e.adler, i.pending_buf, i.pending - s, s)), I(e), s = i.pending, i.pending === i.pending_buf_size)) {
r = 1;
break
}
r = i.gzindex < i.gzhead.comment.length ? 255 & i.gzhead.comment.charCodeAt(i.gzindex++) : 0, B(i, r)
} while (0 !== r);
i.gzhead.hcrc && i.pending > s && (e.adler = _(e.adler, i.pending_buf, i.pending - s, s)), 0 === r && (i.status = 103)
} else i.status = 103;
if (103 === i.status && (i.gzhead.hcrc ? (i.pending + 2 > i.pending_buf_size && I(e), i.pending + 2 <= i.pending_buf_size && (B(i, 255 & e.adler), B(i, e.adler >> 8 & 255), e.adler = 0, i.status = M)) : i.status = M), 0 !== i.pending) {
if (I(e), 0 === e.avail_out) return i.last_flush = -1, g
} else if (0 === e.avail_in && P(t) <= P(n) && t !== p) return A(e, -5);
if (666 === i.status && 0 !== e.avail_in) return A(e, -5);
if (0 !== e.avail_in || 0 !== i.lookahead || t !== l && 666 !== i.status) {
var u = 2 === i.strategy ? q(i, t) : 3 === i.strategy ? z(i, t) : c[i.level].func(i, t);
if (u !== x && u !== F || (i.status = 666), u === D || u === x) return 0 === e.avail_out && (i.last_flush = -1), g;
if (u === R && (1 === t ? h._tr_align(i) : 5 !== t && (h._tr_stored_block(i, 0, 0, !1), 3 === t && (L(i.head), 0 === i.lookahead && (i.strstart = 0, i.block_start = 0, i.insert = 0))), I(e), 0 === e.avail_out)) return i.last_flush = -1, g
}
return t !== p ? g : i.wrap <= 0 ? 1 : (2 === i.wrap ? (B(i, 255 & e.adler), B(i, e.adler >> 8 & 255), B(i, e.adler >> 16 & 255), B(i, e.adler >> 24 & 255), B(i, 255 & e.total_in), B(i, e.total_in >> 8 & 255), B(i, e.total_in >> 16 & 255), B(i, e.total_in >> 24 & 255)) : (N(i, e.adler >>> 16), N(i, 65535 & e.adler)), I(e), 0 < i.wrap && (i.wrap = -i.wrap), 0 !== i.pending ? g : 1)
}, n.deflateEnd = function ee(e) {
var t;
return e && e.state ? (t = e.state.status) === T || 69 === t || 73 === t || 91 === t || 103 === t || t === M || 666 === t ? (e.state = null, t === M ? A(e, -3) : g) : A(e, v) : v
}, n.deflateSetDictionary = function te(e, t) {
var n, i, s, r, a, o, u, c, h = t.length;
if (!e || !e.state) return v;
if (n = e.state, 2 === (r = n.wrap) || 1 === r && n.status !== T || n.lookahead) return v;
for (1 === r && (e.adler = f(e.adler, t, h, 0)), n.wrap = 0, h >= n.w_size && (0 === r && (L(n.head), n.strstart = 0, n.block_start = 0, n.insert = 0), c = new d.Buf8(n.w_size), d.arraySet(c, t, h - n.w_size, n.w_size, 0), t = c, h = n.w_size), a = e.avail_in, o = e.next_in, u = e.input, e.avail_in = h, e.next_in = 0, e.input = t, W(n); n.lookahead >= E;) {
for (i = n.strstart, s = n.lookahead - (E - 1); n.ins_h = (n.ins_h << n.hash_shift ^ n.window[i + E - 1]) & n.hash_mask, n.prev[i & n.w_mask] = n.head[n.ins_h], n.head[n.ins_h] = i, i++, --s;);
n.strstart = i, n.lookahead = E - 1, W(n)
}
return n.strstart += n.lookahead, n.block_start = n.strstart, n.insert = n.lookahead, n.lookahead = 0, n.match_length = n.prev_length = E - 1, n.match_available = 0, e.next_in = o, e.input = u, e.avail_in = a, n.wrap = r, g
}, n.deflateInfo = "pako deflate (from Nodeca project)"
}, {
"../utils/common": 3,
"./adler32": 5,
"./crc32": 7,
"./messages": 13,
"./trees": 14
}],
9: [function(e, t, n) {
t.exports = function i() {
this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1
}
}, {}],
10: [function(e, t, n) {
t.exports = function(e, t) {
var n, i, s, r, a, o, u, c, h, l, d, f, _, p, g, v, m, y, w, S, b, E, k, C, T;
n = e.state, i = e.next_in, C = e.input, s = i + (e.avail_in - 5), r = e.next_out, T = e.output, a = r - (t - e.avail_out), o = r + (e.avail_out - 257), u = n.dmax, c = n.wsize, h = n.whave, l = n.wnext, d = n.window, f = n.hold, _ = n.bits, p = n.lencode, g = n.distcode, v = (1 << n.lenbits) - 1, m = (1 << n.distbits) - 1;
e: do {
_ < 15 && (f += C[i++] << _, _ += 8, f += C[i++] << _, _ += 8), y = p[f & v];
t: for (;;) {
if (f >>>= w = y >>> 24, _ -= w, 0 == (w = y >>> 16 & 255)) T[r++] = 65535 & y;
else {
if (!(16 & w)) {
if (0 == (64 & w)) {
y = p[(65535 & y) + (f & (1 << w) - 1)];
continue t
}
if (32 & w) {
n.mode = 12;
break e
}
e.msg = "invalid literal/length code", n.mode = 30;
break e
}
S = 65535 & y, (w &= 15) && (_ < w && (f += C[i++] << _, _ += 8), S += f & (1 << w) - 1, f >>>= w, _ -= w), _ < 15 && (f += C[i++] << _, _ += 8, f += C[i++] << _, _ += 8), y = g[f & m];
n: for (;;) {
if (f >>>= w = y >>> 24, _ -= w, !(16 & (w = y >>> 16 & 255))) {
if (0 == (64 & w)) {
y = g[(65535 & y) + (f & (1 << w) - 1)];
continue n
}
e.msg = "invalid distance code", n.mode = 30;
break e
}
if (b = 65535 & y, _ < (w &= 15) && (f += C[i++] << _, (_ += 8) < w && (f += C[i++] << _, _ += 8)), u < (b += f & (1 << w) - 1)) {
e.msg = "invalid distance too far back", n.mode = 30;
break e
}
if (f >>>= w, _ -= w, (w = r - a) < b) {
if (h < (w = b - w) && n.sane) {
e.msg = "invalid distance too far back", n.mode = 30;
break e
}
if (k = d, (E = 0) === l) {
if (E += c - w, w < S) {
for (S -= w; T[r++] = d[E++], --w;);
E = r - b, k = T
}
} else if (l < w) {
if (E += c + l - w, (w -= l) < S) {
for (S -= w; T[r++] = d[E++], --w;);
if (E = 0, l < S) {
for (S -= w = l; T[r++] = d[E++], --w;);
E = r - b, k = T
}
}
} else if (E += l - w, w < S) {
for (S -= w; T[r++] = d[E++], --w;);
E = r - b, k = T
}
for (; 2 < S;) T[r++] = k[E++], T[r++] = k[E++], T[r++] = k[E++], S -= 3;
S && (T[r++] = k[E++], 1 < S && (T[r++] = k[E++]))
} else {
for (E = r - b; T[r++] = T[E++], T[r++] = T[E++], T[r++] = T[E++], 2 < (S -= 3););
S && (T[r++] = T[E++], 1 < S && (T[r++] = T[E++]))
}
break
}
}
break
}
} while (i < s && r < o);
i -= S = _ >> 3, f &= (1 << (_ -= S << 3)) - 1, e.next_in = i, e.next_out = r, e.avail_in = i < s ? s - i + 5 : 5 - (i - s), e.avail_out = r < o ? o - r + 257 : 257 - (r - o), n.hold = f, n.bits = _
}
}, {}],
11: [function(e, t, n) {
var R = e("../utils/common"),
x = e("./adler32"),
F = e("./crc32"),
A = e("./inffast"),
P = e("./inftrees"),
L = 1,
I = 2,
U = 0,
B = -2,
N = 1,
i = 852,
s = 592;
function O(e) {
return (e >>> 24 & 255) + (e >>> 8 & 65280) + ((65280 & e) << 8) + ((255 & e) << 24)
}
function r() {
this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new R.Buf16(320), this.work = new R.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0
}
function a(e) {
var t;
return e && e.state ? (t = e.state, e.total_in = e.total_out = t.total = 0, e.msg = "", t.wrap && (e.adler = 1 & t.wrap), t.mode = N, t.last = 0, t.havedict = 0, t.dmax = 32768, t.head = null, t.hold = 0, t.bits = 0, t.lencode = t.lendyn = new R.Buf32(i), t.distcode = t.distdyn = new R.Buf32(s), t.sane = 1, t.back = -1, U) : B
}
function o(e) {
var t;
return e && e.state ? ((t = e.state).wsize = 0, t.whave = 0, t.wnext = 0, a(e)) : B
}
function u(e, t) {
var n, i;
return e && e.state ? (i = e.state, t < 0 ? (n = 0, t = -t) : (n = 1 + (t >> 4), t < 48 && (t &= 15)), t && (t < 8 || 15 < t) ? B : (null !== i.window && i.wbits !== t && (i.window = null), i.wrap = n, i.wbits = t, o(e))) : B
}
function c(e, t) {
var n, i;
return e ? (i = new r, (e.state = i).window = null, (n = u(e, t)) !== U && (e.state = null), n) : B
}
var h, l, d = !0;
function W(e) {
if (d) {
var t;
for (h = new R.Buf32(512), l = new R.Buf32(32), t = 0; t < 144;) e.lens[t++] = 8;
for (; t < 256;) e.lens[t++] = 9;
for (; t < 280;) e.lens[t++] = 7;
for (; t < 288;) e.lens[t++] = 8;
for (P(L, e.lens, 0, 288, h, 0, e.work, {
bits: 9
}), t = 0; t < 32;) e.lens[t++] = 5;
P(I, e.lens, 0, 32, l, 0, e.work, {
bits: 5
}), d = !1
}
e.lencode = h, e.lenbits = 9, e.distcode = l, e.distbits = 5
}
function Q(e, t, n, i) {
var s, r = e.state;
return null === r.window && (r.wsize = 1 << r.wbits, r.wnext = 0, r.whave = 0, r.window = new R.Buf8(r.wsize)), i >= r.wsize ? (R.arraySet(r.window, t, n - r.wsize, r.wsize, 0), r.wnext = 0, r.whave = r.wsize) : (s = r.wsize - r.wnext, i < s && (s = i), R.arraySet(r.window, t, n - i, s, r.wnext), (i -= s) ? (R.arraySet(r.window, t, n - i, i, 0), r.wnext = i, r.whave = r.wsize) : (r.wnext += s, r.wnext === r.wsize && (r.wnext = 0), r.whave < r.wsize && (r.whave += s))), 0
}
n.inflateReset = o, n.inflateReset2 = u, n.inflateResetKeep = a, n.inflateInit = function f(e) {
return c(e, 15)
}, n.inflateInit2 = c, n.inflate = function H(e, t) {
var n, i, s, r, a, o, u, c, h, l, d, f, _, p, g, v, m, y, w, S, b, E, k, C, T = 0,
M = new R.Buf8(4),
D = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
if (!e || !e.state || !e.output || !e.input && 0 !== e.avail_in) return B;
12 === (n = e.state).mode && (n.mode = 13), a = e.next_out, s = e.output, u = e.avail_out, r = e.next_in, i = e.input, o = e.avail_in, c = n.hold, h = n.bits, l = o, d = u, E = U;
e: for (;;) switch (n.mode) {
case N:
if (0 === n.wrap) {
n.mode = 13;
break
}
for (; h < 16;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
if (2 & n.wrap && 35615 === c) {
n.check = 0, M[0] = 255 & c, M[1] = c >>> 8 & 255, n.check = F(n.check, M, 2, 0), h = c = 0, n.mode = 2;
break
}
if (n.flags = 0, n.head && (n.head.done = !1), !(1 & n.wrap) || (((255 & c) << 8) + (c >> 8)) % 31) {
e.msg = "incorrect header check", n.mode = 30;
break
}
if (8 != (15 & c)) {
e.msg = "unknown compression method", n.mode = 30;
break
}
if (h -= 4, b = 8 + (15 & (c >>>= 4)), 0 === n.wbits) n.wbits = b;
else if (b > n.wbits) {
e.msg = "invalid window size", n.mode = 30;
break
}
n.dmax = 1 << b, e.adler = n.check = 1, n.mode = 512 & c ? 10 : 12, h = c = 0;
break;
case 2:
for (; h < 16;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
if (n.flags = c, 8 != (255 & n.flags)) {
e.msg = "unknown compression method", n.mode = 30;
break
}
if (57344 & n.flags) {
e.msg = "unknown header flags set", n.mode = 30;
break
}
n.head && (n.head.text = c >> 8 & 1), 512 & n.flags && (M[0] = 255 & c, M[1] = c >>> 8 & 255, n.check = F(n.check, M, 2, 0)), h = c = 0, n.mode = 3;
case 3:
for (; h < 32;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
n.head && (n.head.time = c), 512 & n.flags && (M[0] = 255 & c, M[1] = c >>> 8 & 255, M[2] = c >>> 16 & 255, M[3] = c >>> 24 & 255, n.check = F(n.check, M, 4, 0)), h = c = 0, n.mode = 4;
case 4:
for (; h < 16;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
n.head && (n.head.xflags = 255 & c, n.head.os = c >> 8), 512 & n.flags && (M[0] = 255 & c, M[1] = c >>> 8 & 255, n.check = F(n.check, M, 2, 0)), h = c = 0, n.mode = 5;
case 5:
if (1024 & n.flags) {
for (; h < 16;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
n.length = c, n.head && (n.head.extra_len = c), 512 & n.flags && (M[0] = 255 & c, M[1] = c >>> 8 & 255, n.check = F(n.check, M, 2, 0)), h = c = 0
} else n.head && (n.head.extra = null);
n.mode = 6;
case 6:
if (1024 & n.flags && (f = n.length, o < f && (f = o), f && (n.head && (b = n.head.extra_len - n.length, n.head.extra || (n.head.extra = new Array(n.head.extra_len)), R.arraySet(n.head.extra, i, r, f, b)), 512 & n.flags && (n.check = F(n.check, i, f, r)), o -= f, r += f, n.length -= f), n.length)) break e;
n.length = 0, n.mode = 7;
case 7:
if (2048 & n.flags) {
if (0 === o) break e;
for (f = 0; b = i[r + f++], n.head && b && n.length < 65536 && (n.head.name += String.fromCharCode(b)), b && f < o;);
if (512 & n.flags && (n.check = F(n.check, i, f, r)), o -= f, r += f, b) break e
} else n.head && (n.head.name = null);
n.length = 0, n.mode = 8;
case 8:
if (4096 & n.flags) {
if (0 === o) break e;
for (f = 0; b = i[r + f++], n.head && b && n.length < 65536 && (n.head.comment += String.fromCharCode(b)), b && f < o;);
if (512 & n.flags && (n.check = F(n.check, i, f, r)), o -= f, r += f, b) break e
} else n.head && (n.head.comment = null);
n.mode = 9;
case 9:
if (512 & n.flags) {
for (; h < 16;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
if (c !== (65535 & n.check)) {
e.msg = "header crc mismatch", n.mode = 30;
break
}
h = c = 0
}
n.head && (n.head.hcrc = n.flags >> 9 & 1, n.head.done = !0), e.adler = n.check = 0, n.mode = 12;
break;
case 10:
for (; h < 32;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
e.adler = n.check = O(c), h = c = 0, n.mode = 11;
case 11:
if (0 === n.havedict) return e.next_out = a, e.avail_out = u, e.next_in = r, e.avail_in = o, n.hold = c, n.bits = h, 2;
e.adler = n.check = 1, n.mode = 12;
case 12:
if (5 === t || 6 === t) break e;
case 13:
if (n.last) {
c >>>= 7 & h, h -= 7 & h, n.mode = 27;
break
}
for (; h < 3;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
switch (n.last = 1 & c, h -= 1, 3 & (c >>>= 1)) {
case 0:
n.mode = 14;
break;
case 1:
if (W(n), n.mode = 20, 6 !== t) break;
c >>>= 2, h -= 2;
break e;
case 2:
n.mode = 17;
break;
case 3:
e.msg = "invalid block type", n.mode = 30
}
c >>>= 2, h -= 2;
break;
case 14:
for (c >>>= 7 & h, h -= 7 & h; h < 32;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
if ((65535 & c) != (c >>> 16 ^ 65535)) {
e.msg = "invalid stored block lengths", n.mode = 30;
break
}
if (n.length = 65535 & c, h = c = 0, n.mode = 15, 6 === t) break e;
case 15:
n.mode = 16;
case 16:
if (f = n.length) {
if (o < f && (f = o), u < f && (f = u), 0 === f) break e;
R.arraySet(s, i, r, f, a), o -= f, r += f, u -= f, a += f, n.length -= f;
break
}
n.mode = 12;
break;
case 17:
for (; h < 14;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
if (n.nlen = 257 + (31 & c), c >>>= 5, h -= 5, n.ndist = 1 + (31 & c), c >>>= 5, h -= 5, n.ncode = 4 + (15 & c), c >>>= 4, h -= 4, 286 < n.nlen || 30 < n.ndist) {
e.msg = "too many length or distance symbols", n.mode = 30;
break
}
n.have = 0, n.mode = 18;
case 18:
for (; n.have < n.ncode;) {
for (; h < 3;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
n.lens[D[n.have++]] = 7 & c, c >>>= 3, h -= 3
}
for (; n.have < 19;) n.lens[D[n.have++]] = 0;
if (n.lencode = n.lendyn, n.lenbits = 7, k = {
bits: n.lenbits
}, E = P(0, n.lens, 0, 19, n.lencode, 0, n.work, k), n.lenbits = k.bits, E) {
e.msg = "invalid code lengths set", n.mode = 30;
break
}
n.have = 0, n.mode = 19;
case 19:
for (; n.have < n.nlen + n.ndist;) {
for (; T = n.lencode[c & (1 << n.lenbits) - 1], v = T >>> 16 & 255, m = 65535 & T, !((g = T >>> 24) <= h);) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
if (m < 16) c >>>= g, h -= g, n.lens[n.have++] = m;
else {
if (16 === m) {
for (C = g + 2; h < C;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
if (c >>>= g, h -= g, 0 === n.have) {
e.msg = "invalid bit length repeat", n.mode = 30;
break
}
b = n.lens[n.have - 1], f = 3 + (3 & c), c >>>= 2, h -= 2
} else if (17 === m) {
for (C = g + 3; h < C;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
h -= g, b = 0, f = 3 + (7 & (c >>>= g)), c >>>= 3, h -= 3
} else {
for (C = g + 7; h < C;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
h -= g, b = 0, f = 11 + (127 & (c >>>= g)), c >>>= 7, h -= 7
}
if (n.have + f > n.nlen + n.ndist) {
e.msg = "invalid bit length repeat", n.mode = 30;
break
}
for (; f--;) n.lens[n.have++] = b
}
}
if (30 === n.mode) break;
if (0 === n.lens[256]) {
e.msg = "invalid code -- missing end-of-block", n.mode = 30;
break
}
if (n.lenbits = 9, k = {
bits: n.lenbits
}, E = P(L, n.lens, 0, n.nlen, n.lencode, 0, n.work, k), n.lenbits = k.bits, E) {
e.msg = "invalid literal/lengths set", n.mode = 30;
break
}
if (n.distbits = 6, n.distcode = n.distdyn, k = {
bits: n.distbits
}, E = P(I, n.lens, n.nlen, n.ndist, n.distcode, 0, n.work, k), n.distbits = k.bits, E) {
e.msg = "invalid distances set", n.mode = 30;
break
}
if (n.mode = 20, 6 === t) break e;
case 20:
n.mode = 21;
case 21:
if (6 <= o && 258 <= u) {
e.next_out = a, e.avail_out = u, e.next_in = r, e.avail_in = o, n.hold = c, n.bits = h, A(e, d), a = e.next_out, s = e.output, u = e.avail_out, r = e.next_in, i = e.input, o = e.avail_in, c = n.hold, h = n.bits, 12 === n.mode && (n.back = -1);
break
}
for (n.back = 0; T = n.lencode[c & (1 << n.lenbits) - 1], v = T >>> 16 & 255, m = 65535 & T, !((g = T >>> 24) <= h);) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
if (v && 0 == (240 & v)) {
for (y = g, w = v, S = m; T = n.lencode[S + ((c & (1 << y + w) - 1) >> y)], v = T >>> 16 & 255, m = 65535 & T, !(y + (g = T >>> 24) <= h);) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
c >>>= y, h -= y, n.back += y
}
if (c >>>= g, h -= g, n.back += g, n.length = m, 0 === v) {
n.mode = 26;
break
}
if (32 & v) {
n.back = -1, n.mode = 12;
break
}
if (64 & v) {
e.msg = "invalid literal/length code", n.mode = 30;
break
}
n.extra = 15 & v, n.mode = 22;
case 22:
if (n.extra) {
for (C = n.extra; h < C;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
n.length += c & (1 << n.extra) - 1, c >>>= n.extra, h -= n.extra, n.back += n.extra
}
n.was = n.length, n.mode = 23;
case 23:
for (; T = n.distcode[c & (1 << n.distbits) - 1], v = T >>> 16 & 255, m = 65535 & T, !((g = T >>> 24) <= h);) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
if (0 == (240 & v)) {
for (y = g, w = v, S = m; T = n.distcode[S + ((c & (1 << y + w) - 1) >> y)], v = T >>> 16 & 255, m = 65535 & T, !(y + (g = T >>> 24) <= h);) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
c >>>= y, h -= y, n.back += y
}
if (c >>>= g, h -= g, n.back += g, 64 & v) {
e.msg = "invalid distance code", n.mode = 30;
break
}
n.offset = m, n.extra = 15 & v, n.mode = 24;
case 24:
if (n.extra) {
for (C = n.extra; h < C;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
n.offset += c & (1 << n.extra) - 1, c >>>= n.extra, h -= n.extra, n.back += n.extra
}
if (n.offset > n.dmax) {
e.msg = "invalid distance too far back", n.mode = 30;
break
}
n.mode = 25;
case 25:
if (0 === u) break e;
if (f = d - u, n.offset > f) {
if ((f = n.offset - f) > n.whave && n.sane) {
e.msg = "invalid distance too far back", n.mode = 30;
break
}
_ = f > n.wnext ? (f -= n.wnext, n.wsize - f) : n.wnext - f, f > n.length && (f = n.length), p = n.window
} else p = s, _ = a - n.offset, f = n.length;
for (u < f && (f = u), u -= f, n.length -= f; s[a++] = p[_++], --f;);
0 === n.length && (n.mode = 21);
break;
case 26:
if (0 === u) break e;
s[a++] = n.length, u--, n.mode = 21;
break;
case 27:
if (n.wrap) {
for (; h < 32;) {
if (0 === o) break e;
o--, c |= i[r++] << h, h += 8
}
if (d -= u, e.total_out += d, n.total += d, d && (e.adler = n.check = n.flags ? F(n.check, s, d, a - d) : x(n.check, s, d, a - d)), d = u, (n.flags ? c : O(c)) !== n.check) {
e.msg = "incorrect data check", n.mode = 30;
break
}
h = c = 0
}
n.mode = 28;
case 28:
if (n.wrap && n.flags) {
for (; h < 32;) {
if (0 === o) break e;
o--, c += i[r++] << h, h += 8
}
if (c !== (4294967295 & n.total)) {
e.msg = "incorrect length check", n.mode = 30;
break
}
h = c = 0
}
n.mode = 29;
case 29:
E = 1;
break e;
case 30:
E = -3;
break e;
case 31:
return -4;
case 32:
default:
return B
}
return e.next_out = a, e.avail_out = u, e.next_in = r, e.avail_in = o, n.hold = c, n.bits = h, (n.wsize || d !== e.avail_out && n.mode < 30 && (n.mode < 27 || 4 !== t)) && Q(e, e.output, e.next_out, d - e.avail_out) ? (n.mode = 31, -4) : (l -= e.avail_in, d -= e.avail_out, e.total_in += l, e.total_out += d, n.total += d, n.wrap && d && (e.adler = n.check = n.flags ? F(n.check, s, d, e.next_out - d) : x(n.check, s, d, e.next_out - d)), e.data_type = n.bits + (n.last ? 64 : 0) + (12 === n.mode ? 128 : 0) + (20 === n.mode || 15 === n.mode ? 256 : 0), (0 === l && 0 === d || 4 === t) && E === U && (E = -5), E)
}, n.inflateEnd = function _(e) {
if (!e || !e.state) return B;
var t = e.state;
return t.window && (t.window = null), e.state = null, U
}, n.inflateGetHeader = function p(e, t) {
var n;
return e && e.state && 0 != (2 & (n = e.state).wrap) ? ((n.head = t).done = !1, U) : B
}, n.inflateSetDictionary = function g(e, t) {
var n, i = t.length;
return e && e.state ? 0 !== (n = e.state).wrap && 11 !== n.mode ? B : 11 === n.mode && x(1, t, i, 0) !== n.check ? -3 : Q(e, t, i, i) ? (n.mode = 31, -4) : (n.havedict = 1, U) : B
}, n.inflateInfo = "pako inflate (from Nodeca project)"
}, {
"../utils/common": 3,
"./adler32": 5,
"./crc32": 7,
"./inffast": 10,
"./inftrees": 12
}],
12: [function(e, t, n) {
var L = e("../utils/common"),
I = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0],
U = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78],
B = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0],
N = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];
t.exports = function(e, t, n, i, s, r, a, o) {
var u, c, h, l, d, f, _, p, g, v = o.bits,
m = 0,
y = 0,
w = 0,
S = 0,
b = 0,
E = 0,
k = 0,
C = 0,
T = 0,
M = 0,
D = null,
R = 0,
x = new L.Buf16(16),
F = new L.Buf16(16),
A = null,
P = 0;
for (m = 0; m <= 15; m++) x[m] = 0;
for (y = 0; y < i; y++) x[t[n + y]]++;
for (b = v, S = 15; 1 <= S && 0 === x[S]; S--);
if (S < b && (b = S), 0 === S) return s[r++] = 20971520, s[r++] = 20971520, o.bits = 1, 0;
for (w = 1; w < S && 0 === x[w]; w++);
for (b < w && (b = w), m = C = 1; m <= 15; m++)
if (C <<= 1, (C -= x[m]) < 0) return -1;
if (0 < C && (0 === e || 1 !== S)) return -1;
for (F[1] = 0, m = 1; m < 15; m++) F[m + 1] = F[m] + x[m];
for (y = 0; y < i; y++) 0 !== t[n + y] && (a[F[t[n + y]]++] = y);
if (f = 0 === e ? (D = A = a, 19) : 1 === e ? (D = I, R -= 257, A = U, P -= 257, 256) : (D = B, A = N, -1), m = w, d = r, k = y = M = 0, h = -1, l = (T = 1 << (E = b)) - 1, 1 === e && 852 < T || 2 === e && 592 < T) return 1;
for (;;) {
for (_ = m - k, g = a[y] < f ? (p = 0, a[y]) : a[y] > f ? (p = A[P + a[y]], D[R + a[y]]) : (p = 96, 0), u = 1 << m - k, w = c = 1 << E; s[d + (M >> k) + (c -= u)] = _ << 24 | p << 16 | g | 0, 0 !== c;);
for (u = 1 << m - 1; M & u;) u >>= 1;
if (0 !== u ? (M &= u - 1, M += u) : M = 0, y++, 0 == --x[m]) {
if (m === S) break;
m = t[n + a[y]]
}
if (b < m && (M & l) !== h) {
for (0 === k && (k = b), d += w, C = 1 << (E = m - k); E + k < S && !((C -= x[E + k]) <= 0);) E++, C <<= 1;
if (T += 1 << E, 1 === e && 852 < T || 2 === e && 592 < T) return 1;
s[h = M & l] = b << 24 | E << 16 | d - r | 0
}
}
return 0 !== M && (s[d + M] = m - k << 24 | 64 << 16 | 0), o.bits = b, 0
}
}, {
"../utils/common": 3
}],
13: [function(e, t, n) {
t.exports = {
2: "need dictionary",
1: "stream end",
0: "",
"-1": "file error",
"-2": "stream error",
"-3": "data error",
"-4": "insufficient memory",
"-5": "buffer error",
"-6": "incompatible version"
}
}, {}],
14: [function(e, t, n) {
var r = e("../utils/common"),
i = 0,
s = 1;
function a(e) {
for (var t = e.length; 0 <= --t;) e[t] = 0
}
var o = 0,
u = 29,
c = 256,
h = c + 1 + u,
l = 30,
d = 19,
v = 2 * h + 1,
m = 15,
f = 16,
_ = 7,
p = 256,
g = 16,
y = 17,
w = 18,
S = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0],
b = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13],
E = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7],
k = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],
C = new Array(2 * (h + 2));
a(C);
var T = new Array(2 * l);
a(T);
var M = new Array(512);
a(M);
var D = new Array(256);
a(D);
var R = new Array(u);
a(R);
var x, F, A, P = new Array(l);
function L(e, t, n, i, s) {
this.static_tree = e, this.extra_bits = t, this.extra_base = n, this.elems = i, this.max_length = s, this.has_stree = e && e.length
}
function I(e, t) {
this.dyn_tree = e, this.max_code = 0, this.stat_desc = t
}
function U(e) {
return e < 256 ? M[e] : M[256 + (e >>> 7)]
}
function B(e, t) {
e.pending_buf[e.pending++] = 255 & t, e.pending_buf[e.pending++] = t >>> 8 & 255
}
function N(e, t, n) {
e.bi_valid > f - n ? (e.bi_buf |= t << e.bi_valid & 65535, B(e, e.bi_buf), e.bi_buf = t >> f - e.bi_valid, e.bi_valid += n - f) : (e.bi_buf |= t << e.bi_valid & 65535, e.bi_valid += n)
}
function O(e, t, n) {
N(e, n[2 * t], n[2 * t + 1])
}
function W(e, t) {
for (var n = 0; n |= 1 & e, e >>>= 1, n <<= 1, 0 < --t;);
return n >>> 1
}
function Q(e) {
16 === e.bi_valid ? (B(e, e.bi_buf), e.bi_buf = 0, e.bi_valid = 0) : 8 <= e.bi_valid && (e.pending_buf[e.pending++] = 255 & e.bi_buf, e.bi_buf >>= 8, e.bi_valid -= 8)
}
function H(e, t, n) {
var i, s, r = new Array(m + 1),
a = 0;
for (i = 1; i <= m; i++) r[i] = a = a + n[i - 1] << 1;
for (s = 0; s <= t; s++) {
var o = e[2 * s + 1];
0 !== o && (e[2 * s] = W(r[o]++, o))
}
}
function z() {
var e, t, n, i, s, r = new Array(m + 1);
for (i = n = 0; i < u - 1; i++)
for (R[i] = n, e = 0; e < 1 << S[i]; e++) D[n++] = i;
for (D[n - 1] = i, i = s = 0; i < 16; i++)
for (P[i] = s, e = 0; e < 1 << b[i]; e++) M[s++] = i;
for (s >>= 7; i < l; i++)
for (P[i] = s << 7, e = 0; e < 1 << b[i] - 7; e++) M[256 + s++] = i;
for (t = 0; t <= m; t++) r[t] = 0;
for (e = 0; e <= 143;) C[2 * e + 1] = 8, e++, r[8]++;
for (; e <= 255;) C[2 * e + 1] = 9, e++, r[9]++;
for (; e <= 279;) C[2 * e + 1] = 7, e++, r[7]++;
for (; e <= 287;) C[2 * e + 1] = 8, e++, r[8]++;
for (H(C, h + 1, r), e = 0; e < l; e++) T[2 * e + 1] = 5, T[2 * e] = W(e, 5);
x = new L(C, S, c + 1, h, m), F = new L(T, b, 0, l, m), A = new L(new Array(0), E, 0, d, _)
}
function q(e) {
var t;
for (t = 0; t < h; t++) e.dyn_ltree[2 * t] = 0;
for (t = 0; t < l; t++) e.dyn_dtree[2 * t] = 0;
for (t = 0; t < d; t++) e.bl_tree[2 * t] = 0;
e.dyn_ltree[2 * p] = 1, e.opt_len = e.static_len = 0, e.last_lit = e.matches = 0
}
function j(e) {
8 < e.bi_valid ? B(e, e.bi_buf) : 0 < e.bi_valid && (e.pending_buf[e.pending++] = e.bi_buf), e.bi_buf = 0, e.bi_valid = 0
}
function V(e, t, n, i) {
var s = 2 * t,
r = 2 * n;
return e[s] < e[r] || e[s] === e[r] && i[t] <= i[n]
}
function Y(e, t, n) {
for (var i = e.heap[n], s = n << 1; s <= e.heap_len && (s < e.heap_len && V(t, e.heap[s + 1], e.heap[s], e.depth) && s++, !V(t, i, e.heap[s], e.depth));) e.heap[n] = e.heap[s], n = s, s <<= 1;
e.heap[n] = i
}
function K(e, t, n) {
var i, s, r, a, o = 0;
if (0 !== e.last_lit)
for (; i = e.pending_buf[e.d_buf + 2 * o] << 8 | e.pending_buf[e.d_buf + 2 * o + 1], s = e.pending_buf[e.l_buf + o], o++, 0 === i ? O(e, s, t) : (r = D[s], O(e, r + c + 1, t), 0 !== (a = S[r]) && (s -= R[r], N(e, s, a)), r = U(--i), O(e, r, n), 0 !== (a = b[r]) && (i -= P[r], N(e, i, a))), o < e.last_lit;);
O(e, p, t)
}
function G(e, t) {
var n, i, s, r = t.dyn_tree,
a = t.stat_desc.static_tree,
o = t.stat_desc.has_stree,
u = t.stat_desc.elems,
c = -1;
for (e.heap_len = 0, e.heap_max = v, n = 0; n < u; n++) 0 !== r[2 * n] ? (e.heap[++e.heap_len] = c = n, e.depth[n] = 0) : r[2 * n + 1] = 0;
for (; e.heap_len < 2;) s = e.heap[++e.heap_len] = c < 2 ? ++c : 0, r[2 * s] = 1, e.depth[s] = 0, e.opt_len--, o && (e.static_len -= a[2 * s + 1]);
for (t.max_code = c, n = e.heap_len >> 1; 1 <= n; n--) Y(e, r, n);
for (s = u; n = e.heap[1], e.heap[1] = e.heap[e.heap_len--], Y(e, r, 1), i = e.heap[1], e.heap[--e.heap_max] = n, e.heap[--e.heap_max] = i, r[2 * s] = r[2 * n] + r[2 * i], e.depth[s] = (e.depth[n] >= e.depth[i] ? e.depth[n] : e.depth[i]) + 1, r[2 * n + 1] = r[2 * i + 1] = s, e.heap[1] = s++, Y(e, r, 1), 2 <= e.heap_len;);
e.heap[--e.heap_max] = e.heap[1],
function g(e, t) {
var n, i, s, r, a, o, u = t.dyn_tree,
c = t.max_code,
h = t.stat_desc.static_tree,
l = t.stat_desc.has_stree,
d = t.stat_desc.extra_bits,
f = t.stat_desc.extra_base,
_ = t.stat_desc.max_length,
p = 0;
for (r = 0; r <= m; r++) e.bl_count[r] = 0;
for (u[2 * e.heap[e.heap_max] + 1] = 0, n = e.heap_max + 1; n < v; n++) i = e.heap[n], r = u[2 * u[2 * i + 1] + 1] + 1, _ < r && (r = _, p++), u[2 * i + 1] = r, c < i || (e.bl_count[r]++, a = 0, f <= i && (a = d[i - f]), o = u[2 * i], e.opt_len += o * (r + a), l && (e.static_len += o * (h[2 * i + 1] + a)));
if (0 !== p) {
do {
for (r = _ - 1; 0 === e.bl_count[r];) r--;
e.bl_count[r]--, e.bl_count[r + 1] += 2, e.bl_count[_]--, p -= 2
} while (0 < p);
for (r = _; 0 !== r; r--)
for (i = e.bl_count[r]; 0 !== i;) s = e.heap[--n], c < s || (u[2 * s + 1] !== r && (e.opt_len += (r - u[2 * s + 1]) * u[2 * s], u[2 * s + 1] = r), i--)
}
}(e, t), H(r, c, e.bl_count)
}
function X(e, t, n) {
var i, s, r = -1,
a = t[1],
o = 0,
u = 7,
c = 4;
for (0 === a && (u = 138, c = 3), t[2 * (n + 1) + 1] = 65535, i = 0; i <= n; i++) s = a, a = t[2 * (i + 1) + 1], ++o < u && s === a || (o < c ? e.bl_tree[2 * s] += o : 0 !== s ? (s !== r && e.bl_tree[2 * s]++, e.bl_tree[2 * g]++) : o <= 10 ? e.bl_tree[2 * y]++ : e.bl_tree[2 * w]++, r = s, c = (o = 0) === a ? (u = 138, 3) : s === a ? (u = 6, 3) : (u = 7, 4))
}
function Z(e, t, n) {
var i, s, r = -1,
a = t[1],
o = 0,
u = 7,
c = 4;
for (0 === a && (u = 138, c = 3), i = 0; i <= n; i++)
if (s = a, a = t[2 * (i + 1) + 1], !(++o < u && s === a)) {
if (o < c)
for (; O(e, s, e.bl_tree), 0 != --o;);
else 0 !== s ? (s !== r && (O(e, s, e.bl_tree), o--), O(e, g, e.bl_tree), N(e, o - 3, 2)) : o <= 10 ? (O(e, y, e.bl_tree), N(e, o - 3, 3)) : (O(e, w, e.bl_tree), N(e, o - 11, 7));
r = s, c = (o = 0) === a ? (u = 138, 3) : s === a ? (u = 6, 3) : (u = 7, 4)
}
}
function J(e) {
var t;
for (X(e, e.dyn_ltree, e.l_desc.max_code), X(e, e.dyn_dtree, e.d_desc.max_code), G(e, e.bl_desc), t = d - 1; 3 <= t && 0 === e.bl_tree[2 * k[t] + 1]; t--);
return e.opt_len += 3 * (t + 1) + 5 + 5 + 4, t
}
function $(e, t, n, i) {
var s;
for (N(e, t - 257, 5), N(e, n - 1, 5), N(e, i - 4, 4), s = 0; s < i; s++) N(e, e.bl_tree[2 * k[s] + 1], 3);
Z(e, e.dyn_ltree, t - 1), Z(e, e.dyn_dtree, n - 1)
}
function ee(e) {
var t, n = 4093624447;
for (t = 0; t <= 31; t++, n >>>= 1)
if (1 & n && 0 !== e.dyn_ltree[2 * t]) return i;
if (0 !== e.dyn_ltree[18] || 0 !== e.dyn_ltree[20] || 0 !== e.dyn_ltree[26]) return s;
for (t = 32; t < c; t++)
if (0 !== e.dyn_ltree[2 * t]) return s;
return i
}
a(P);
var te = !1;
function ne(e, t, n, i) {
N(e, (o << 1) + (i ? 1 : 0), 3),
function s(e, t, n, i) {
j(e), i && (B(e, n), B(e, ~n)), r.arraySet(e.pending_buf, e.window, t, n, e.pending), e.pending += n
}(e, t, n, !0)
}
n._tr_init = function ie(e) {
te || (z(), te = !0), e.l_desc = new I(e.dyn_ltree, x), e.d_desc = new I(e.dyn_dtree, F), e.bl_desc = new I(e.bl_tree, A), e.bi_buf = 0, e.bi_valid = 0, q(e)
}, n._tr_stored_block = ne, n._tr_flush_block = function se(e, t, n, i) {
var s, r, a = 0;
0 < e.level ? (2 === e.strm.data_type && (e.strm.data_type = ee(e)), G(e, e.l_desc), G(e, e.d_desc), a = J(e), s = e.opt_len + 3 + 7 >>> 3, (r = e.static_len + 3 + 7 >>> 3) <= s && (s = r)) : s = r = n + 5, n + 4 <= s && -1 !== t ? ne(e, t, n, i) : 4 === e.strategy || r === s ? (N(e, 2 + (i ? 1 : 0), 3), K(e, C, T)) : (N(e, 4 + (i ? 1 : 0), 3), $(e, e.l_desc.max_code + 1, e.d_desc.max_code + 1, a + 1), K(e, e.dyn_ltree, e.dyn_dtree)), q(e), i && j(e)
}, n._tr_tally = function re(e, t, n) {
return e.pending_buf[e.d_buf + 2 * e.last_lit] = t >>> 8 & 255, e.pending_buf[e.d_buf + 2 * e.last_lit + 1] = 255 & t, e.pending_buf[e.l_buf + e.last_lit] = 255 & n, e.last_lit++, 0 === t ? e.dyn_ltree[2 * n]++ : (e.matches++, t--, e.dyn_ltree[2 * (D[n] + c + 1)]++, e.dyn_dtree[2 * U(t)]++), e.last_lit === e.lit_bufsize - 1
}, n._tr_align = function ae(e) {
N(e, 2, 3), O(e, p, C), Q(e)
}
}, {
"../utils/common": 3
}],
15: [function(e, t, n) {
t.exports = function i() {
this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0
}
}, {}],
"/": [function(e, t, n) {
var i = e("./lib/utils/common").assign,
s = e("./lib/deflate"),
r = e("./lib/inflate"),
a = e("./lib/zlib/constants"),
o = {};
i(o, s, r, a), t.exports = o
}, {
"./lib/deflate": 1,
"./lib/inflate": 2,
"./lib/utils/common": 3,
"./lib/zlib/constants": 6
}]
}, {}, [])("/")
}(), R = e, x = function() {
function e() {
de(this, e), this.onServerStateUpdated = new R.CDEvent, this.reset()
}
return he(e, [{
key: "getSts",
value: function() {
return this._sts
}
}, {
key: "getStd",
value: function() {
return this._std
}
}, {
key: "getSid",
value: function() {
return this._sid
}
}, {
key: "getCsid",
value: function() {
return this._csid
}
}, {
key: "getPsid",
value: function() {
return this._psid
}
}, {
key: "getMuid",
value: function() {
return this._muid
}
}, {
key: "getContextName",
value: function() {
return this._contextName
}
}, {
key: "getRequestId",
value: function() {
return this._requestId
}
}, {
key: "getWupDispatchRate",
value: function() {
return this._wupDispatchRate
}
}, {
key: "setSts",
value: function(e) {
this._sts = e
}
}, {
key: "setStd",
value: function(e) {
this._std = e
}
}, {
key: "setSid",
value: function(e) {
this._sid = e
}
}, {
key: "setCsid",
value: function(e) {
this._csid = e
}
}, {
key: "setPsid",
value: function(e) {
this._psid = e
}
}, {
key: "setMuid",
value: function(e) {
this._muid = e
}
}, {
key: "setContextName",
value: function(e) {
this._contextName = e
}
}, {
key: "setRequestId",
value: function(e) {
var t = !(1 < arguments.length && arguments[1] !== undefined) || arguments[1];
return this._requestId = e, t && this._publish(), this._requestId
}
}, {
key: "setWupDispatchRate",
value: function(e) {
e ? this._wupDispatchRate = e : log.warn("Wup dispatch rate of " + e + " is invalid. Ignoring update")
}
}, {
key: "setHasConfiguration",
value: function(e) {
if (this._hasConfiguration) throw new Error("Once hasConfiguration is marked as true, it cannot change");
this._hasConfiguration = e
}
}, {
key: "getHasConfiguration",
value: function() {
return this._hasConfiguration
}
}, {
key: "incrementRequestId",
value: function() {
return this._requestId++, this._publish(), this._requestId
}
}, {
key: "resetRequestId",
value: function() {
this._requestId = 0
}
}, {
key: "reset",
value: function() {
this._sts = null, this._std = null, this._sid = null, this._csid = null, this._muid = null, this._contextName = null, this._requestId = 0, this._wupDispatchRate = 5e3, this._hasConfiguration = !1
}
}, {
key: "_publish",
value: function() {
this.onServerStateUpdated.publish({
requestId: this._requestId,
sid: this._sid,
sts: this._sts,
std: this._std
})
}
}]), e
}(), R.WupServerSessionState = x, F = e, A = function() {
function i(e, t, n) {
de(this, i), this._wupServerSessionState = e, this._messageBus = t, this._configurationRepository = n
}
return he(i, [{
key: "process",
value: function(e, t) {
var n = !1;
t && (this._wupServerSessionState.setHasConfiguration(!0), this._configurationRepository.loadConfigurations(e), n = !0), e.sts && this._wupServerSessionState.setSts(e.sts), e.std && this._wupServerSessionState.setStd(e.std), e.reset_session && e.new_sid && this._wupServerSessionState.setSid(e.new_sid), this._messageBus.publish(F.MessageBusEventType.ServerStateUpdatedEvent, {
requestId: this._wupServerSessionState.getRequestId(),
sid: this._wupServerSessionState.getSid(),
sts: this._wupServerSessionState.getSts(),
std: this._wupServerSessionState.getStd()
}), n && this._messageBus.publish(F.MessageBusEventType.ConfigurationLoadedEvent, this._configurationRepository), e.reset_session && (e.new_sid ? this._messageBus.publish(F.MessageBusEventType.NewSessionStartedEvent, e.new_sid) : log.warn("Received a reset session flag from the server without a new sid. Ignoring reset.")), e.nextWupInterval ? e.nextWupInterval !== this._wupServerSessionState.getWupDispatchRate() && (this._wupServerSessionState.setWupDispatchRate(e.nextWupInterval), this._messageBus.publish(F.MessageBusEventType.WupDispatchRateUpdatedEvent, this._wupServerSessionState.getWupDispatchRate())) : log.warn("Received an invalid nextWupInterval value of " + e.nextWupInterval + ". Ignoring value.")
}
}]), i
}(), F.WupResponseProcessor = A, P = e, L = function() {
function e() {
de(this, e), this._messageStruct = {
ds: "js"
}
}
return he(e, [{
key: "getDataSource",
value: function() {
return this._messageStruct.ds
}
}, {
key: "getSid",
value: function() {
return this._messageStruct.cdsnum
}
}, {
key: "setSid",
value: function(e) {
this._messageStruct.cdsnum = e
}
}, {
key: "getCsid",
value: function() {
return this._messageStruct.csid
}
}, {
key: "setCsid",
value: function(e) {
this._messageStruct.csid = e
}
}, {
key: "getPsid",
value: function() {
return this._messageStruct.psid
}
}, {
key: "setPsid",
value: function(e) {
this._messageStruct.psid = e
}
}, {
key: "getMuid",
value: function() {
return this._messageStruct.muid
}
}, {
key: "setMuid",
value: function(e) {
this._messageStruct.muid = e
}
}, {
key: "getContextName",
value: function() {
return this._messageStruct.context_name
}
}, {
key: "setContextName",
value: function(e) {
this._messageStruct.context_name = e
}
}, {
key: "getRequestId",
value: function() {
return this._messageStruct.requestId
}
}, {
key: "setRequestId",
value: function(e) {
this._messageStruct.requestId = e
}
}, {
key: "getSts",
value: function() {
return this._messageStruct.sts
}
}, {
key: "setSts",
value: function(e) {
this._messageStruct.sts = e
}
}, {
key: "getStd",
value: function() {
return this._messageStruct.std
}
}, {
key: "setStd",
value: function(e) {
this._messageStruct.std = e
}
}, {
key: "getConfigurationName",
value: function() {
return this._messageStruct.c
}
}, {
key: "setConfigurationName",
value: function(e) {
this._messageStruct.c = e
}
}, {
key: "getData",
value: function() {
return this._messageStruct.d
}
}, {
key: "setData",
value: function(e) {
this._messageStruct.d = e
}
}, {
key: "getInternalMessage",
value: function() {
return this._messageStruct
}
}]), e
}(), P.WupMessage = L, I = e, U = function() {
function n(e, t) {
de(this, n), this._wupServerSessionState = e, this._dataPacker = t
}
return he(n, [{
key: "build",
value: function(e, t) {
var n = new I.WupMessage;
return n.setSid(this._wupServerSessionState.getSid()), n.setCsid(this._wupServerSessionState.getCsid()), n.setPsid(this._wupServerSessionState.getPsid()), n.setMuid(this._wupServerSessionState.getMuid()), n.setContextName(this._wupServerSessionState.getContextName()), n.setRequestId(this._wupServerSessionState.getRequestId()), this._wupServerSessionState.getSts() && this._wupServerSessionState.getStd() && (n.setSts(this._wupServerSessionState.getSts()), n.setStd(this._wupServerSessionState.getStd())), "0" === e ? n.setData([this._dataPacker.pack(t)]) : n.setConfigurationName(e), n
}
}]), n
}(), I.WupMessageBuilder = U, B = e, N = function() {
function t(e) {
de(this, t), this._wupServerSessionState = e
}
return he(t, [{
key: "build",
value: function(e) {
return e.setSid(this._wupServerSessionState.getSid()), e.setSts(this._wupServerSessionState.getSts()), e.setStd(this._wupServerSessionState.getStd()), JSON.stringify(e.getInternalMessage())
}
}]), t
}(), B.WupRequestBodyBuilder = N, O = e, W = function() {
function s(e, t) {
var n = 2 < arguments.length && arguments[2] !== undefined && arguments[2],
i = 3 < arguments.length && arguments[3] !== undefined ? arguments[3] : "";
de(this, s), this._requestBodyBuilder = e, this.updateSettings(t), this._acceptNoResponse = n, this._messageDescriptor = i, this._dataQueue = new O.Queue, this._awaitingServerResponse = !1, this._currentMessageNumberOfSendFailures = 0, this._currentSentItem = null, this._sendRetryTimeoutId = null, this._messageIdentifier = 0
}
return he(s, [{
key: "setServerUrl",
value: function(e) {
this.wupUrl = e
}
}, {
key: "updateSettings",
value: function(e) {
this._sendRetryRate = e.sendRetryRate, this._queueLoadThershold = e.queueLoadThreshold
}
}, {
key: "sendMessage",
value: function(e, t, n, i, s, r) {
var a = this,
o = function o(e) {
a._onMessageSendSuccess(e, s)
},
u = function u(e, t, n) {
a._onMessageSendFailure(e, t, n, r)
};
this._enqueueMessage(e, t, n, i, o, u)
}
}, {
key: "flush",
value: function() {
this._flushData()
}
}, {
key: "isReadyToSendData",
value: function() {
return !!this.wupUrl
}
}, {
key: "_onMessageSendSuccess",
value: function(e, t) {
this._awaitingServerResponse = !1, this._currentMessageNumberOfSendFailures = 0, this._currentSentItem = null, t(e), this._processNextQueueItem()
}
}, {
key: "_onMessageSendFailure",
value: function(e, t, n, i) {
if (!this._currentSentItem) return log.error("An unexpected error has occurred while handling a " + this._messageDescriptor + " message send failure. Could not find sent item value. Moving to next queued item"), void this._processNextQueueItem();
log.warn(
"Failed sending " + this._messageDescriptor + " message #" + this._currentSentItem.identifier + ". " + this._buildFailureLog(e, t, n)), this._awaitingServerResponse = !1, this._currentMessageNumberOfSendFailures++, 0 == this._currentSentItem.maxNumberOfSendAttempts || this._currentMessageNumberOfSendFailures < this._currentSentItem.maxNumberOfSendAttempts ? (log.info("Trying to send " + this._messageDescriptor + " message #" + this._currentSentItem.identifier + " again. Number of send failures is " + this._currentMessageNumberOfSendFailures), this._prepareMessageForSendRetry(this._currentSentItem.identifier, this._currentSentItem.messageToSend, this._currentSentItem.timeout, this._currentSentItem.maxNumberOfSendAttempts, this._currentSentItem.onSuccess, this._currentSentItem.onError)) : (log.error("Discarding " + this._messageDescriptor + " message #" + this._currentSentItem.identifier + " after " + this._currentMessageNumberOfSendFailures + " failed send attempts."), this._currentMessageNumberOfSendFailures = 0, this._currentSentItem = null, i && i(e), this._processNextQueueItem())
}
}, {
key: "_enqueueMessage",
value: function(e, t, n, i, s, r) {
this._dataQueue.enqueue({
identifier: this._messageIdentifier++,
messageToSend: e,
onSuccess: s,
onError: r,
timeout: t,
maxNumberOfSendAttempts: n
}), this._clearRetryTimeout(), i && this._flushData(), this._awaitingServerResponse || this._processNextQueueItem(i)
}
}, {
key: "_processNextQueueItem",
value: function() {
var e = 0 < arguments.length && arguments[0] !== undefined && arguments[0];
if (this._dataQueue.hasItems()) {
var t = this._dataQueue.dequeue(),
n = this._requestBodyBuilder.build(t.messageToSend);
if (e && navigator.sendBeacon) return log.debug("Data was sent by beacon"), void navigator.sendBeacon(this.wupUrl, n);
this._awaitingServerResponse = !0, this._currentSentItem = t, O.WorkerUtils.getPostUrl(this.wupUrl, "POST", n, t.onSuccess, t.onError, this._acceptNoResponse, t.timeout), this._dataQueue.length() > this._queueLoadThershold && log.warn("Data queue has " + this._dataQueue.length() + " items in queue. Might indicate slow\\unstable communication issues.")
}
}
}, {
key: "_flushData",
value: function() {
for (; this._dataQueue.hasItems();) this._processNextQueueItem(!0)
}
}, {
key: "_prepareMessageForSendRetry",
value: function(e, t, n, i, s, r) {
this._dataQueue.enqueueToHead({
identifier: e,
messageToSend: t,
onSuccess: s,
onError: r,
timeout: n,
maxNumberOfSendAttempts: i
}), this._setRetryTimeout()
}
}, {
key: "_clearRetryTimeout",
value: function() {
this._sendRetryTimeoutId && clearTimeout(this._sendRetryTimeoutId)
}
}, {
key: "_setRetryTimeout",
value: function() {
var e = this;
this._clearRetryTimeout(), this._sendRetryTimeoutId = setTimeout(function() {
e._processNextQueueItem()
}, this._sendRetryRate)
}
}, {
key: "_buildFailureLog",
value: function(e, t, n) {
var i = "";
return e && (i += "Response Text: " + e + "."), t && (i += "Status: " + t + "."), n && (i += "Status Text: " + n + "."), i
}
}]), s
}(), O.ServerCommunicator = W, Q = e, H = function() {
function a(e, t, n, i, s, r) {
de(this, a), this._serverCommunicator = e, this._wupMessageBuilder = t, this._wupServerSessionState = n, this._wupStatisticsService = i, this._wupResponseProcessor = s, this._configurationRepository = r, this._MESSAGE_SEND_RETRIES = 3, this._INFINITE_MESSAGE_SEND_RETRIES = 0, this._requestTimeout = this._configurationRepository.get(Q.ConfigurationFields.wupMessageRequestTimeout)
}
return he(a, [{
key: "startNewSession",
value: function(e, t, n, i, s) {
this._validateCommonSessionRelatedParameters(n, s), this._wupServerSessionState.setRequestId(0), this._sendSessionMessage(null, e, t, n, i, s, null, this._wupServerSessionState.getRequestId())
}
}, {
key: "_sendSessionMessage",
value: function(e, t, n, i, s, r, a, o) {
var u = this;
this._initSession(e, t, n, i, s, r, a, o);
var c = this._createStaticFieldsPart(),
h = !this._wupServerSessionState.getHasConfiguration(),
l = this._wupMessageBuilder.build(h ? "js" : "0", c),
d = function d(e) {
u._onSendDataSuccess(e, h)
};
this._serverCommunicator.sendMessage(l, this._requestTimeout, h ? this._INFINITE_MESSAGE_SEND_RETRIES : this._MESSAGE_SEND_RETRIES, !1, d, this._onSendDataFailure.bind(this))
}
}, {
key: "resumeSession",
value: function(e, t, n, i, s, r, a) {
this._validateResumeSessionRelatedParameters(e, i, r);
var o = a && a.requestId ? this._wupServerSessionState.setRequestId(a.requestId + 1) : this._wupServerSessionState.setRequestId(0);
this._sendSessionMessage(e, t, n, i, s, r, a, o)
}
}, {
key: "sendData",
value: function(e) {
var t = 1 < arguments.length && arguments[1] !== undefined && arguments[1];
this._wupServerSessionState.getSts() && this._wupServerSessionState.getStd() ? this._sendMessage(e, t) : log.error("Unable to send data. sts or std are undefined")
}
}, {
key: "setRequestTimeout",
value: function(e) {
this._requestTimeout = e
}
}, {
key: "_initSession",
value: function(e, t, n, i, s, r, a, o) {
log.debug("Initializing session. wupUrl:" + r + ", sid:" + e), this._serverCommunicator.setServerUrl(r), this._wupServerSessionState.setSid(e), this._wupServerSessionState.setCsid(t), this._wupServerSessionState.setPsid(n), this._wupServerSessionState.setMuid(i), this._wupServerSessionState.setContextName(s || ""), this._wupServerSessionState.setRequestId(o, !1), a ? (this._wupServerSessionState.setSts(a.sts), this._wupServerSessionState.setStd(a.std)) : (log.info("Resetting server state of server communicator. Deleting sts and std"), this._wupServerSessionState.setSts(null), this._wupServerSessionState.setStd(null), this._wupStatisticsService.resetCounters())
}
}, {
key: "updateCsid",
value: function(e) {
var t = this._wupServerSessionState.incrementRequestId() || 0;
this._wupServerSessionState.setCsid(e);
var n = {
static_fields: []
};
n.static_fields.push(["requestId", t], ["contextId", this._wupServerSessionState.getContextName()], ["sessionId", this._wupServerSessionState.getSid()], ["customerSessionId", this._wupServerSessionState.getCsid()], ["partnerSessionId", this._wupServerSessionState.getPsid()], ["muid", this._wupServerSessionState.getMuid()]), this._sendMessage(n)
}
}, {
key: "updatePsid",
value: function(e) {
var t = this._wupServerSessionState.incrementRequestId() || 0;
this._wupServerSessionState.setPsid(e);
var n = {
static_fields: []
};
n.static_fields.push(["requestId", t], ["contextId", this._wupServerSessionState.getContextName()], ["sessionId", this._wupServerSessionState.getSid()], ["customerSessionId", this._wupServerSessionState.getCsid()], ["partnerSessionId", this._wupServerSessionState.getPsid()], ["muid", this._wupServerSessionState.getMuid()]), this._sendMessage(n)
}
}, {
key: "isReady",
value: function() {
return !!(this._serverCommunicator.isReadyToSendData() && this._wupServerSessionState.getStd() && this._wupServerSessionState.getSts())
}
}, {
key: "_validateResumeSessionRelatedParameters",
value: function(e, t, n) {
if (!e) throw new Error("Invalid sid parameter " + e + ". Unable to start new session");
this._validateCommonSessionRelatedParameters(t, n)
}
}, {
key: "_validateCommonSessionRelatedParameters",
value: function(e, t) {
if (!e) throw new Error("Invalid muid parameter " + e + ". Unable to start new session");
if (!t) throw new Error("Invalid serverAddress parameter " + t + ". Unable to start new session")
}
}, {
key: "_createStaticFieldsPart",
value: function() {
var e = {
static_fields: []
};
return e.static_fields.push(["requestId", this._wupServerSessionState.getRequestId()], ["contextId", this._wupServerSessionState.getContextName()], ["sessionId", this._wupServerSessionState.getSid()], ["customerSessionId", this._wupServerSessionState.getCsid()], ["partnerSessionId", this._wupServerSessionState.getPsid()], ["muid", this._wupServerSessionState.getMuid()]), e
}
}, {
key: "_sendMessage",
value: function(e) {
var t = 1 < arguments.length && arguments[1] !== undefined && arguments[1],
n = this._wupMessageBuilder.build("0", e);
this._serverCommunicator.sendMessage(n, this._requestTimeout, this._MESSAGE_SEND_RETRIES, t, this._onSendDataSuccess.bind(this), this._onSendDataFailure.bind(this))
}
}, {
key: "_onSendDataSuccess",
value: function(e, t) {
t = t || !1, this._handleSuccessResponse(e, t), this._wupStatisticsService.incrementSentWupCount()
}
}, {
key: "_onSendDataFailure",
value: function(e) {}
}, {
key: "_handleSuccessResponse",
value: function(e, t) {
try {
var n = JSON.parse(e);
this._wupResponseProcessor.process(n, t)
} catch (s) {
var i = "Failed to parse message from server: " + s.message;
log.error(i, s)
}
}
}]), a
}(), Q.WupServerClient = H, z = e, q = function() {
function e() {
de(this, e)
}
return he(e, [{
key: "setData",
value: function(e) {
this._data = e
}
}, {
key: "getInternalMessage",
value: function() {
return this._data
}
}]), e
}(), z.LogMessage = q, j = e, V = function() {
function t(e) {
de(this, t), this._dataPacker = e
}
return he(t, [{
key: "build",
value: function(e) {
var t = new j.LogMessage;
return t.setData(this._dataPacker.pack(e)), t
}
}]), t
}(), j.LogMessageBuilder = V, Y = e, K = function() {
function e() {
de(this, e)
}
return he(e, [{
key: "build",
value: function(e) {
return e.getInternalMessage()
}
}]), e
}(), Y.LogRequestBodyBuilder = K, G = e, X = function() {
function i(e, t, n) {
de(this, i), this._serverCommunicator = e, this._logMessageBuilder = t, this._configurationRepository = n, this._MESSAGE_SEND_RETRIES = 5, this._requestTimeout = this._configurationRepository.get(G.ConfigurationFields.logMessageRequestTimeout)
}
return he(i, [{
key: "setServerUrl",
value: function(e) {
this._serverCommunicator.setServerUrl(e)
}
}, {
key: "sendData",
value: function(e) {
var t = 1 < arguments.length && arguments[1] !== undefined && arguments[1],
n = this._logMessageBuilder.build(e);
this._serverCommunicator.sendMessage(n, this._requestTimeout, this._MESSAGE_SEND_RETRIES, t, this._onSendDataSuccess.bind(this), this._onSendDataFailure.bind(this)), t && this._serverCommunicator.flush()
}
}, {
key: "isReady",
value: function() {
return this._serverCommunicator.isReadyToSendData()
}
}, {
key: "setRequestTimeout",
value: function(e) {
this._requestTimeout = e
}
}, {
key: "_onSendDataSuccess",
value: function(e) {}
}, {
key: "_onSendDataFailure",
value: function(e) {
log.warn("Failed sending log message. Error: " + e + ".")
}
}]), i
}(), G.LogServerClient = X, (Z = e).WorkerUtils = {
isUndefinedNull: function(e) {
return null === e || e === undefined || "undefined" == typeof e
},
getHash: function(e) {
for (var t = 0, n = 0, i = e.length; n < i; n++) t = (t << 5) - t + e.charCodeAt(n), t &= t;
return t
},
generateUUID: function() {
var n = (new Date).getTime();
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
var t = (n + 16 * Math.random()) % 16 | 0;
return n = Math.floor(n / 16), ("x" == e ? t : 3 & t | 8).toString(16)
})
},
getPostUrl: function(e, t, n, i, s, r, a) {
var o = Z.HttpRequestFactory.create();
o instanceof self.XMLHttpRequest ? (o.open(t, e, !0), o.timeout = a || 12e3, o.onload = function() {
200 === o.status || 204 === o.status && r ? i && i(o.responseText) : s && s(o.responseText, o.status, o.statusText)
}, o.onerror = function() {
s && s(o.responseText, o.status, o.statusText)
}, o.ontimeout = function() {
s && s("timeout")
}, o.onabort = function() {
s && s("abort")
}, o.send(n)) : (o.onload = function() {
i && o.responseText && i(o.responseText)
}, o.onerror = function() {
s && s(o.responseText, o.status, o.statusText)
}, o.onprogress = function() {}, o.ontimeout = function() {
s && s("timeout")
}, o.open(t, e, !0), o.timeout = a || 12e3, setTimeout(function() {
o.send(n)
}, 0))
}
}, J = e, $ = function() {
function e() {
de(this, e), this._compressData = function(e) {
var t = msgpack.encode(e);
return t = pako.deflateRaw(t, {
to: "string"
}), J.btoa(t)
}
}
return he(e, [{
key: "pack",
value: function(e) {
return this._getCompressedData(e)
}
}, {
key: "_getCompressedData",
value: function(e) {
return this._compressData(e)
}
}]), e
}(), J.DataPacker = $, e.WorkerCommand = {
requestConfigurationsCommand: "requestConfigurationsCommand",
startNewSessionCommand: "startNewSessionCommand",
resumeSessionCommand: "resumeSessionCommand",
changeContextCommand: "changeContextCommand",
updateCsidCommand: "updateCsidCommand",
updatePsidCommand: "updatePsidCommand",
updateLogUrlCommand: "updateLogUrl",
sendDataCommand: "sendDataCommand",
sendLogCommand: "sendLogCommand"
}, e.WorkerEvent = {
NewSessionStartedEvent: "NewSessionStartedEvent",
ConfigurationLoadedEvent: "ConfigurationLoadedEvent",
ServerStateUpdatedEvent: "ServerStateUpdatedEvent"
}, ee = e, te = function() {
function o(e, t, n, i, s, r, a) {
de(this, o), this._mainCommunicator = e, this._wupServerClient = t, this._logServerClient = n, this._configurationRepository = i, this._messageProcessor = s, this._logMessageProcessor = r, this._wupServerSessionState = a
}
return he(o, [{
key: "start",
value: function() {
log.debug("Starting Worker Service"), this._mainCommunicator.addMessageListener(ee.WorkerCommand.startNewSessionCommand, this._onStartNewSessionCommand.bind(this)), this._mainCommunicator.addMessageListener(ee.WorkerCommand.resumeSessionCommand, this._onResumeSessionCommand.bind(this)), this._mainCommunicator.addMessageListener(ee.WorkerCommand.changeContextCommand, this._onChangeContextCommand.bind(this)), this._mainCommunicator.addMessageListener(ee.WorkerCommand.updateCsidCommand, this._onUpdateCsidCommand.bind(this)), this._mainCommunicator.addMessageListener(ee.WorkerCommand.updatePsidCommand, this._onUpdatePsidCommand.bind(this)), this._mainCommunicator.addMessageListener(ee.WorkerCommand.updateLogUrlCommand, this._onUpdateLogUrlCommand.bind(this)), this._mainCommunicator.addMessageListener(ee.WorkerCommand.sendDataCommand, this._onSendDataCommand.bind(this)), this._mainCommunicator.addMessageListener(ee.WorkerCommand.sendLogCommand, this._onSendLogCommand.bind(this))
}
}, {
key: "_onStartNewSessionCommand",
value: function(e) {
this._wupServerClient.startNewSession(e.csid, e.psid, e.muid, e.contextName, e.serverAddress)
}
}, {
key: "_onResumeSessionCommand",
value: function(e) {
this._wupServerClient.resumeSession(e.cdsnum, e.csid, e.psid, e.muid, e.contextName, e.serverAddress, e.serverState)
}
}, {
key: "_onChangeContextCommand",
value: function(e) {
log.debug("Worker received a ChangeContextCommand from main."), this._wupServerSessionState.setContextName(e.contextName)
}
}, {
key: "_onUpdateCsidCommand",
value: function(e) {
log.debug("Worker received an UpdateCsidCommand from main. CSID: " + e.csid + "."), this._wupServerClient.updateCsid(e.csid)
}
}, {
key: "_onUpdatePsidCommand",
value: function(e) {
log.debug("Worker received an UpdatePsidCommand from main. PSID: " + e.psid + "."), this._wupServerClient.updatePsid(e.psid)
}
}, {
key: "_onUpdateLogUrlCommand",
value: function(e) {
this._logServerClient.setServerUrl(e.logAddress)
}
}, {
key: "_onInitError",
value: function(e) {
log.warn("Worker received an error response for Init request. Notifying main."), this._mainCommunicator.sendAsync("initCommFailed", e)
}
}, {
key: "_onInitSuccess",
value: function(e) {
log.debug("Worker received a successful response for Init request. Notifying main and updating worker configuration."), this._mainCommunicator.sendAsync("initCommSuccess", e), this._configurationRepository.loadConfigurations(e)
}
}, {
key: "_onSendDataCommand",
value: function(e) {
this._messageProcessor.process(e)
}
}, {
key: "_onSendLogCommand",
value: function(e) {
this._logMessageProcessor.process(e)
}
}]), o
}(), ee.WorkerService = te, ne = e, ie = function() {
function c(e, t, n, i, s, r, a, o, u) {
de(this, c), this._messageBus = e, this._wupStatisticsService = t, this._dataDispatcher = n, this._logDataDispatcher = i, this._serverCommunicator = s, this._wupServerClient = r, this._logServerClient = a, this._logger = o, this._mainCommunicator = u, this._messageBus.subscribe(ne.MessageBusEventType.ConfigurationLoadedEvent, this._handle.bind(this))
}
return he(c, [{
key: "_handle",
value: function(e) {
this._wupStatisticsService.updateSettings(e.get(ne.ConfigurationFields.wupStatisticsLogIntervalMs));
var t = e.get(ne.ConfigurationFields.forceDynamicDataWupDispatchSettings) ? ne.ConfigurationDefaultTemplates.defaultDynamicWupDispatchRateConfiguration : e.get(ne.ConfigurationFields.dataWupDispatchRateSettings);
this._dataDispatcher.updateByConfig(t), this._logDataDispatcher.updateByConfig(e.get(ne.ConfigurationFields.logWupDispatchRateSettings)), this._serverCommunicator.updateSettings(e.get(ne.ConfigurationFields.serverCommunicationSettings)), this._logger.updateLogConfig(e), this._wupServerClient.setRequestTimeout(e.get(ne.ConfigurationFields.wupMessageRequestTimeout) || e.get(ne.ConfigurationFields.wupResponseTimeout)), this._logServerClient.setRequestTimeout(e.get(ne.ConfigurationFields.logMessageRequestTimeout)), this._mainCommunicator.sendAsync(ne.WorkerEvent.ConfigurationLoadedEvent, e.getAll())
}
}]), c
}(), ne.WorkerConfigurationLoadedEventHandler = ie, se = e, re = function() {
function i(e, t, n) {
de(this, i), this._messageBus = e, this._logger = t, this._mainCommunicator = n, this._messageBus.subscribe(se.MessageBusEventType.NewSessionStartedEvent, this._handle.bind(this))
}
return he(i, [{
key: "_handle",
value: function(e) {
this._logger.info("Worker received a new session id " + e + " from server."), this._mainCommunicator.sendAsync(se.WorkerEvent.NewSessionStartedEvent, e)
}
}]), i
}(), se.WorkerNewSessionStartedEventHandler = re, ae = e, oe = function() {
function i(e, t, n) {
de(this, i), this._messageBus = e, this._logger = t, this._mainCommunicator = n, this._messageBus.subscribe(ae.MessageBusEventType.ServerStateUpdatedEvent, this._handle.bind(this))
}
return he(i, [{
key: "_handle",
value: function(e) {
this._logger.debug("Worker received an updated server state."), this._mainCommunicator.sendAsync(ae.WorkerEvent.ServerStateUpdatedEvent, e)
}
}]), i
}(), ae.WorkerServerStateUpdatedEventHandler = oe, ue = e, ce = function() {
function i(e, t, n) {
de(this, i), this._messageBus = e, this._dataDispatcher = t, this._logger = n, this._messageBus.subscribe(ue.MessageBusEventType.WupDispatchRateUpdatedEvent, this._handle.bind(this))
}
return he(i, [{
key: "_handle",
value: function(e) {
this._logger.info("Worker received a wup dispatch rate " + e + " from server."), this._dataDispatcher.scheduleNextDispatching()
}
}]), i
}(), ue.WorkerWupDispatchRateUpdatedEventHandler = ce,
function(r) {
function e(e) {
this._mainCommunicator = e, this._eventHandlers = []
}
e.prototype.loadSystem = function() {
var t = this;
this._msgBus = new r.MessageBus(r.WorkerUtils), this._configurationRepository = new r.ConfigurationRepository, this._wupServerSessionState = new r.WupServerSessionState, this._logRequestBodyBuilder = new r.LogRequestBodyBuilder, this._logServerCommunicator = new r.ServerCommunicator(this._logRequestBodyBuilder, this._configurationRepository.get(r.ConfigurationFields.serverCommunicationSettings), !0, "log"), this._logMessageBuilder = new r.LogMessageBuilder(new r.DataPacker), this._logServerClient = new r.LogServerClient(this._logServerCommunicator, this._logMessageBuilder, this._configurationRepository), this._wupStatisticsService = new r.WupStatisticsService(this._configurationRepository.get(r.ConfigurationFields.wupStatisticsLogIntervalMs)), this._wupDispatchRateCalculatorFactory = new r.WupDispatchRateCalculatorFactory(this._wupStatisticsService, this._wupServerSessionState);
var n = this._logDataDispatcher = new r.DataDispatcher(this._logServerClient, new r.LogAggregator, this._wupDispatchRateCalculatorFactory, this._configurationRepository.get(r.ConfigurationFields.logWupDispatchRateSettings)),
e = new(function() {
function e() {
de(this, e)
}
return he(e, [{
key: "log",
value: function log(e, t) {
n.add({
eventName: "log",
data: {
msg: e,
url: "worker",
level: t,
sn: this.sn++
}
})
}
}]), e
}());
this._logMessageProcessor = new r.MessageProcessor(this._logDataDispatcher), e.sn = 0;
var i = new r.Logger(e);
r.log.setLogger(i), this._wupMessageBuilder = new r.WupMessageBuilder(this._wupServerSessionState, new r.DataPacker), this._wupRequestBodyBuilder = new r.WupRequestBodyBuilder(this._wupServerSessionState), this._dataServerCommunicator = new r.ServerCommunicator(this._wupRequestBodyBuilder, this._configurationRepository.get(r.ConfigurationFields.serverCommunicationSettings), !1, "wup"), this._wupResponseProcessor = new r.WupResponseProcessor(this._wupServerSessionState, this._msgBus, this._configurationRepository), this._wupServerClient = new r.WupServerClient(this._dataServerCommunicator, this._wupMessageBuilder, this._wupServerSessionState, this._wupStatisticsService, this._wupResponseProcessor, this._configurationRepository);
var s = this._configurationRepository.get(r.ConfigurationFields.forceDynamicDataWupDispatchSettings) ? r.ConfigurationDefaultTemplates.defaultDynamicWupDispatchRateConfiguration : this._configurationRepository.get(r.ConfigurationFields.dataWupDispatchRateSettings);
this._dataDispatcher = new r.DataDispatcher(this._wupServerClient, new r.DataAggregator(this._wupServerSessionState), this._wupDispatchRateCalculatorFactory, s), this._messageProcessor = new r.MessageProcessor(this._dataDispatcher), this._eventHandlers.push(new r.WorkerConfigurationLoadedEventHandler(this._msgBus, this._wupStatisticsService, this._dataDispatcher, this._logDataDispatcher, this._dataServerCommunicator, this._wupServerClient, this._logServerClient, i, this._mainCommunicator)), this._eventHandlers.push(new r.WorkerNewSessionStartedEventHandler(this._msgBus, i, this._mainCommunicator)), this._eventHandlers.push(new r.WorkerServerStateUpdatedEventHandler(this._msgBus, i, this._mainCommunicator)), this._eventHandlers.push(new r.WorkerWupDispatchRateUpdatedEventHandler(this._msgBus, this._dataDispatcher, i)), this._wupServerSessionState.onServerStateUpdated.subscribe(function(e) {
t._mainCommunicator.sendAsync(r.WorkerEvent.ServerStateUpdatedEvent, e)
}), this._mainCommunicator.addMessageListener("stateUpdateFromStorage", function(e) {
e && e.requestId && e.sts && (t._wupServerSessionState.setRequestId(e.requestId, !1), t._wupServerSessionState.setSts(e.sts), t._wupServerSessionState.setStd(e.std))
}), this._workerService = new r.WorkerService(this._mainCommunicator, this._wupServerClient, this._logServerClient, this._configurationRepository, this._messageProcessor, this._logMessageProcessor, this._wupServerSessionState), this._workerService.start(), log.info("Loaded worker")
}, r.WorkerSysLoader = e
}(e),
function(n) {
function t(e) {
var t = new n.WorkerCommunicator;
t.setMessagingPort(e), new n.WorkerSysLoader(t).loadSystem()
}
if (n.isUnsupportedMode) t(n.sysLoader.getUnsupportedMgr().getUnsPort());
else {
var e = Object.getOwnPropertyNames(self);
e && -1 < e.indexOf("onconnect") ? self.onconnect = function(e) {
t(new n.CDPort(e.ports[0]))
} : t(new n.CDPort(self))
}
}(e)
}
fe.getServerWorkerCode = function() {
return e.toString()
}, fe.executeServerWorkerCodeInMain = function() {
e()
}
}(Rn);
var log = Rn.log;
Rn.startSloth(null, null)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment