Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arms/js-sdk

Package Overview
Dependencies
Maintainers
5
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arms/js-sdk - npm Package Compare versions

Comparing version 1.8.36-beta.7 to 1.8.36-beta.8

lib/biz.quickapp/index.js

36

lib/base.js
var util = require("./util"), sendBeacon = require("./common/sendBeacon"), selfId = "aokcdqn3ly@e629dabd48a9933", pushToQueue = function(e, t) {
var r;
{
if ("error" !== t.t || !(r = e.requestQueue[0]) || "error" !== r.t || t.msg !== r.msg) {
if ("behavior" === t.t) {
var i = e.requestQueue && e.requestQueue.length;
if (i > 0 && "behavior" === e.requestQueue[i - 1].t) {
var n = t.behavior || [];
e.requestQueue[i - 1].behavior.concat(n);
} else e.requestQueue.push(t);
} else e.requestQueue.unshift(t);
return e.onReady(function() {
e.requestTimmer = util.delay(function() {
e.clear();
}, e.requestQueue[0] && "error" === e.requestQueue[0].t ? 3e3 : -1);
}), !0;
}
r.times++;
}
if ("error" === t.t && (r = e.requestQueue[0]) && "error" === r.t && t.msg === r.msg) return t.times = r.times + 1,
void (e.requestQueue[0] = t);
if ("behavior" === t.t) {
var i = e.requestQueue && e.requestQueue.length;
if (i > 0 && "behavior" === e.requestQueue[i - 1].t) {
var n = t.behavior || [];
e.requestQueue[i - 1].behavior.concat(n);
} else e.requestQueue.push(t);
} else e.requestQueue.unshift(t);
return e.onReady(function() {
e.requestTimmer = util.delay(function() {
e.clear();
}, e.requestQueue[0] && "error" === e.requestQueue[0].t ? 3e3 : -1);
}), !0;
}, Base = function(e) {
return this.ver = "1.8.35", this._conf = util.ext({}, Base.dftCon), this.sampleCache = {},
return this.ver = "1.8.36-beta.8", this._conf = util.ext({}, Base.dftCon), this.sampleCache = {},
this.requestQueue = [], this.selfQueue = [], this.sdkFlag = !0, this.hash = util.seq(),

@@ -43,3 +40,4 @@ this.resetPageview(), this.setConfig(e), this.rip = util.getRandIP(), this.record = 999,

environment: "prod",
beforeReport: null
beforeReport: null,
parseTraceId: null
}, Base.prototype = {

@@ -46,0 +44,0 @@ constructor: Base,

@@ -49,3 +49,3 @@ var util = require("../util");

};
}, h = function() {
}, l = function() {
if (function() {

@@ -129,30 +129,36 @@ var e = t && t.chrome, n = e && e.app && e.app.runtime, r = "history" in t && !!t.history.pushState && !!t.history.replaceState;

}(), t && t.document && t.document.addEventListener && (t.document.addEventListener("click", f("click"), !1),
t.document.addEventListener("keypress", f("keypress"), !1)), h(), this.getConfig("enableConsole") && function() {
if (t && t.console) for (var e = [ "debug", "info", "warn", "log", "error", "assert" ], n = 0; n < e.length; n++) {
var o = e[n];
t.console[o] && "function" == typeof t.console[o] && u(t.console, o, function(e) {
var n = o;
return function() {
for (var o = arguments.length, a = new Array(o), i = 0; i < o; i++) a[i] = arguments[i];
var s = {
type: "console",
data: {
level: n,
message: a
t.document.addEventListener("keypress", f("keypress"), !1)), l();
var e = this.getConfig("enableConsole");
e && function(e) {
if (t && t.console) {
var n = [ "debug", "info", "warn", "log", "error", "assert" ];
util.isArray(e) && (n = e);
for (var o = 0; o < n.length; o++) {
var a = n[o];
a && util.isString(a) && t.console[a] && "function" == typeof t.console[a] && u(t.console, a, function(e) {
var n = a;
return function() {
for (var o = arguments.length, a = new Array(o), i = 0; i < o; i++) a[i] = arguments[i];
var s = {
type: "console",
data: {
level: n,
message: a
}
};
if (r && r.addBehavior(s), "error" === n) for (var u = 0; u < a.length; u++) {
var c = a[u];
c && c.message && c.stack && r && r.errorHandler(new ErrorEvent("error", {
error: c,
message: c.message
}));
}
e && Function.prototype.apply.call(e, t.console, a);
};
if (r && r.addBehavior(s), "error" === n) for (var u = 0; u < a.length; u++) {
var c = a[u];
c && c.message && c.stack && r && r.errorHandler(new ErrorEvent("error", {
error: c,
message: c.message
}));
}
e && Function.prototype.apply.call(e, t.console, a);
};
});
});
}
}
}();
} catch (e) {
util.warn("[arms] error in initBehavior", e);
}(e);
} catch (n) {
util.warn("[arms] error in initBehavior", n);
}

@@ -159,0 +165,0 @@ r = this, this.hasInitBehavior = !0;

module.exports = function(e, a) {
var r = require("../util"), t = null, n = r.getCurDomain(), s = function(e, a, t, s, i, o, p, c, d, l, g, u, h) {
var f = r.J(i) || null, y = r.safetyCall(a, [ f, s ], null);
var r = require("../util"), t = null, n = r.getCurDomain(), i = function(e, a, t, i, s, o, p, c, d, l, g, u, f) {
var h = r.J(s) || null, y = r.safetyCall(a, [ h, i ], null);
if (!y) return !1;
var I = y.code || o, E = !("success" in y) || y.success;
e.api(t, E, p, I, y.msg, c, d, l, g, n, u, h);
}, i = "fetch", o = "__oFetch_", p = "__oXMLHttpRequest_", c = "XMLHttpRequest";
e.api(t, E, p, I, y.msg, c, d, l, E ? {} : g, n, u, f);
}, s = "fetch", o = "__oFetch_", p = "__oXMLHttpRequest_", c = "XMLHttpRequest";
return r.ext(e.prototype, {
removeHook: function(e, r) {
return t && (r || this === t) ? (a[o] && (a[i] = a[o], delete a[o]), a[p] && (a[c] = a[p],
return t && (r || this === t) ? (a[o] && (a[s] = a[o], delete a[o]), a[p] && (a[c] = a[p],
delete a[p]), t = null, this) : this;

@@ -15,5 +15,5 @@ },

return !e && t ? this : (t || (function() {
if ("function" == typeof a[i]) {
var e = a[i];
a[o] = e, a[i] = function(i, o) {
if ("function" == typeof a[s]) {
var e = a[s];
a[o] = e, a[s] = function(s, o) {
var p = 1 === arguments.length ? [ arguments[0] ] : Array.apply(null, arguments), c = t;

@@ -23,34 +23,34 @@ if (!c || !c.api) return e.apply(a, p);

o || (o = {});
var d = Date.now(), l = c._conf, g = r.duration(), u = (i && "string" != typeof i ? i.url : i) || "", h = u;
var d = Date.now(), l = c._conf, g = r.duration(), u = (s && "string" != typeof s ? s.url : s) || "", f = u;
u = r.cutUrlSearch(u);
var f = (l.ignore || {}).ignoreApis;
if (!r.checkAPI(u, !0) || r.ignoreByRule(u, f)) return e.apply(a, p);
u = r.filterByRule(u, h, l.ignoreApiPath ? l.ignoreApiPath : l.apiHelper);
var y = l.enableLinkTrace, I = "", E = "", S = c.getConfig("pid"), v = null, T = c.getConfig("sample"), B = c.getConfig("linkType"), X = 1;
if (T && !c.sampling(T) && (X = 0), y) {
var b = "";
var h = (l.ignore || {}).ignoreApis, y = l.parseTraceId;
if (!r.checkAPI(u, !0) || r.ignoreByRule(u, h)) return e.apply(a, p);
u = r.filterByRule(u, f, l.ignoreApiPath ? l.ignoreApiPath : l.apiHelper);
var I = l.enableLinkTrace, E = "", S = "", v = c.getConfig("pid"), T = null, B = c.getConfig("sample"), X = c.getConfig("linkType"), b = 1;
if (B && !c.sampling(B) && (b = 0), I) {
var m = "";
try {
b = location.origin ? location.origin : location.protocol + "//" + location.hostname + (location.port ? ":" + location.port : "");
} catch (C) {
b = "";
m = location.origin ? location.origin : location.protocol + "//" + location.hostname + (location.port ? ":" + location.port : "");
} catch (_) {
m = "";
}
var m = r.checkSameOrigin(h, b);
if (c.getConfig("enableApiCors") || m) if (i && "string" != typeof i) try {
if (p[0].headers && "function" == typeof p[0].headers.get && "function" == typeof p[0].headers.append) switch (B) {
var D = r.checkSameOrigin(f, m);
if (c.getConfig("enableApiCors") || D) if (s && "string" != typeof s) try {
if (p[0].headers && "function" == typeof p[0].headers.get && "function" == typeof p[0].headers.append) switch (X) {
case "arms":
var D = p[0].headers.get("EagleEye-TraceID"), R = p[0].headers.get("EagleEye-SessionID"), k = p[0].headers.get("EagleEye-pAppName");
D ? I = D : (I = c.getTraceId()["EagleEye-TraceID"], p[0].headers.append("EagleEye-TraceID", I)),
R ? E = R : (E = c.getPageviewId()["EagleEye-SessionID"], p[0].headers.append("EagleEye-SessionID", E)),
k || p[0].headers.append("EagleEye-pAppName", S);
var R = p[0].headers.get("EagleEye-TraceID"), k = p[0].headers.get("EagleEye-SessionID"), A = p[0].headers.get("EagleEye-pAppName");
R ? E = R : (E = c.getTraceId()["EagleEye-TraceID"], p[0].headers.append("EagleEye-TraceID", E)),
k ? S = k : (S = c.getPageviewId()["EagleEye-SessionID"], p[0].headers.append("EagleEye-SessionID", S)),
A || p[0].headers.append("EagleEye-pAppName", v);
break;
case "b3":
var A = p[0].headers.get("X-B3-TraceId");
if (A) I = A; else {
var w = c.getB3TraceId(X);
p[0].headers.append("X-B3-TraceId", w["X-B3-TraceId"]), p[0].headers.append("X-B3-ParentSpanId", w["X-B3-ParentSpanId"]),
p[0].headers.append("X-B3-SpanId", w["X-B3-SpanId"]), p[0].headers.append("X-B3-Sampled", w["X-B3-Sampled"]),
p[0].headers.append("X-Request-ID", r.guid()), I = w["X-B3-TraceId"];
var w = p[0].headers.get("X-B3-TraceId");
if (w) E = w; else {
var H = c.getB3TraceId(b);
p[0].headers.append("X-B3-TraceId", H["X-B3-TraceId"]), p[0].headers.append("X-B3-ParentSpanId", H["X-B3-ParentSpanId"]),
p[0].headers.append("X-B3-SpanId", H["X-B3-SpanId"]), p[0].headers.append("X-B3-Sampled", H["X-B3-Sampled"]),
p[0].headers.append("X-Request-ID", r.guid()), E = H["X-B3-TraceId"];
}
E = c.pageview;
S = c.pageview;
break;

@@ -60,23 +60,23 @@

default:
var H = p[0].headers.get("uber-trace-id");
H ? I = H.split(":")[0] : (H = c.getUberTraceId(X), p[0].headers.append("uber-trace-id", H["uber-trace-id"]),
I = H.traceId), E = c.pageview;
var P = p[0].headers.get("uber-trace-id");
P ? E = P.split(":")[0] : (P = c.getUberTraceId(b), p[0].headers.append("uber-trace-id", P["uber-trace-id"]),
E = P.traceId), S = c.pageview;
}
} catch (_) {
r.warn("[retcode] fetch failed to set header, exception is :\n" + _);
} else switch (o.headers = o.headers ? o.headers : {}, B) {
} catch (F) {
r.warn("[retcode] fetch failed to set header, exception is :\n" + F);
} else switch (o.headers = o.headers ? o.headers : {}, X) {
case "arms":
o.headers["EagleEye-TraceID"] ? I = o.headers["EagleEye-TraceID"] : (I = c.getTraceId()["EagleEye-TraceID"],
o.headers["EagleEye-TraceID"] = I), o.headers["EagleEye-SessionID"] ? E = o.headers["EagleEye-SessionID"] : (E = c.getPageviewId()["EagleEye-SessionID"],
o.headers["EagleEye-SessionID"] = E), o.headers["EagleEye-pAppName"] || (o.headers["EagleEye-pAppName"] = S);
o.headers["EagleEye-TraceID"] ? E = o.headers["EagleEye-TraceID"] : (E = c.getTraceId()["EagleEye-TraceID"],
o.headers["EagleEye-TraceID"] = E), o.headers["EagleEye-SessionID"] ? S = o.headers["EagleEye-SessionID"] : (S = c.getPageviewId()["EagleEye-SessionID"],
o.headers["EagleEye-SessionID"] = S), o.headers["EagleEye-pAppName"] || (o.headers["EagleEye-pAppName"] = v);
break;
case "b3":
if (o.headers["X-B3-TraceId"]) I = o.headers["X-B3-TraceId"]; else {
var P = c.getB3TraceId(X);
o.headers["X-B3-TraceId"] = P["X-B3-TraceId"], o.headers["X-B3-ParentSpanId"] = P["X-B3-ParentSpanId"],
o.headers["X-B3-SpanId"] = P["X-B3-SpanId"], o.headers["X-B3-Sampled"] = P["X-B3-Sampled"],
o.headers["X-Request-ID"] = r.guid(), I = P["X-B3-TraceId"];
if (o.headers["X-B3-TraceId"]) E = o.headers["X-B3-TraceId"]; else {
var x = c.getB3TraceId(b);
o.headers["X-B3-TraceId"] = x["X-B3-TraceId"], o.headers["X-B3-ParentSpanId"] = x["X-B3-ParentSpanId"],
o.headers["X-B3-SpanId"] = x["X-B3-SpanId"], o.headers["X-B3-Sampled"] = x["X-B3-Sampled"],
o.headers["X-Request-ID"] = r.guid(), E = x["X-B3-TraceId"];
}
E = c.getPageviewId()["EagleEye-SessionID"];
S = c.getPageviewId()["EagleEye-SessionID"];
break;

@@ -86,7 +86,7 @@

default:
if (o.headers["uber-trace-id"]) I = o.headers["uber-trace-id"].split(":")[0]; else {
var x = c.getUberTraceId(X);
o.headers["uber-trace-id"] = x["uber-trace-id"], I = x.traceId;
if (o.headers["uber-trace-id"]) E = o.headers["uber-trace-id"].split(":")[0]; else {
var C = c.getUberTraceId(b);
o.headers["uber-trace-id"] = C["uber-trace-id"], E = C.traceId;
}
E = c.getPageviewId()["EagleEye-SessionID"];
S = c.getPageviewId()["EagleEye-SessionID"];
}

@@ -98,15 +98,19 @@ }

if (!e || "function" != typeof e.clone) return e;
var a = e.clone(), i = a.headers;
if (i && "function" == typeof i.get) {
var o = i.get("content-type");
var a = e.clone(), s = a.headers;
if (s && "function" == typeof s.get) {
var o = s.get("content-type");
if (o && !/(text)|(json)/.test(o)) return e;
if (!I) {
var f = r.parseFetchHeaders(i);
"object" == typeof f && f["eagleeye-traceid"] && (I = f["eagleeye-traceid"], v = "response");
if (!E) {
var h = r.parseFetchHeaders(s);
"object" == typeof h && h["eagleeye-traceid"] && (E = h["eagleeye-traceid"], T = "response");
}
}
var y = g();
var I = g();
return a.text().then(function(e) {
var o = r.getFetchSnapshot(p, e, i);
a.ok ? s(c, l.parseResponse, u, h, e, a.status || 200, y, d, I, E, o, v, X) : (c.api(u, !1, y, a.status || 404, a.statusText, d, I, E, o, n, v, X),
if (!E && r.isFunction(y)) {
var o = y(a, e);
o && r.isString(o) && (E = o);
}
var g = r.getFetchSnapshot(p, e, s);
a.ok ? i(c, l.parseResponse, u, f, e, a.status || 200, I, d, E, S, g, T, b) : (c.api(u, !1, I, a.status || 404, a.statusText, d, E, S, g, n, T, b),
l.enableResource && t.fixResourceStatus && t.fixResourceStatus({

@@ -117,4 +121,4 @@ src: a.url,

}), e;
} catch (C) {
return r.warn("[ARMS] fetch response error :", C), e;
} catch (_) {
return r.warn("[ARMS] fetch response error :", _), e;
}

@@ -124,42 +128,42 @@ })["catch"](function(e) {

var a = g();
throw c.api(u, !1, a, e.name || "Error", e.message, d, I, E, {}, n), l.enableResource && t.fixResourceStatus && t.fixResourceStatus({
src: h,
throw c.api(u, !1, a, e.name || "Error", e.message, d, E, S, {}, n), l.enableResource && t.fixResourceStatus && t.fixResourceStatus({
src: f,
res_type: "api"
}), e;
});
}, a[i].toString = r.createFakeToString(i);
}, a[s].toString = r.createFakeToString(s);
}
}(), function() {
if ("function" == typeof a[c]) {
var e, i = a[c];
a[p] = i;
var e, s = a[c];
a[p] = s;
var o = function(a) {
var o = new i(a), p = t;
var o = new s(a), p = t;
if (!p || !p.api || !o.addEventListener) return o;
var c, d, l, g, u = o.send, h = o.open, f = o.setRequestHeader, y = p._conf, I = (y.ignore || {}).ignoreApis, E = p.getConfig("enableLinkTrace"), S = "", v = "", T = "", B = null, X = p.getConfig("sample"), b = p.getConfig("linkType"), m = 1;
return X && !p.sampling(X) && (m = 0), o.open = function(a, t) {
var c, d, l, g, u = o.send, f = o.open, h = o.setRequestHeader, y = p._conf, I = (y.ignore || {}).ignoreApis, E = y.parseTraceId, S = p.getConfig("enableLinkTrace"), v = "", T = "", B = "", X = null, b = p.getConfig("sample"), m = p.getConfig("linkType"), D = 1;
return b && !p.sampling(b) && (D = 0), o.open = function(a, t) {
e = a;
var n = 1 === arguments.length ? [ arguments[0] ] : Array.apply(null, arguments);
h.apply(o, n), g = t || "", l = r.cutUrlSearch(g);
var s = !r.checkAPI(l, !0) || r.ignoreByRule(l, I);
f.apply(o, n), g = t || "", l = r.cutUrlSearch(g);
var i = !r.checkAPI(l, !0) || r.ignoreByRule(l, I);
if (l = l ? r.filterByRule(l, g, y.ignoreApiPath ? y.ignoreApiPath : y.apiHelper) : "",
!s && E) {
var i = "";
!i && S) {
var s = "";
try {
i = location.origin ? location.origin : location.protocol + "//" + location.hostname + (location.port ? ":" + location.port : "");
} catch (B) {
i = "";
s = location.origin ? location.origin : location.protocol + "//" + location.hostname + (location.port ? ":" + location.port : "");
} catch (E) {
s = "";
}
var c = r.checkSameOrigin(g, i);
if ((p.getConfig("enableApiCors") || c) && f && "function" == typeof f) switch (b) {
var c = r.checkSameOrigin(g, s);
if ((p.getConfig("enableApiCors") || c) && h && "function" == typeof h) switch (m) {
case "arms":
S = p.getTraceId()["EagleEye-TraceID"], f.apply(o, [ "EagleEye-TraceID", S ]), v = p.getPageviewId()["EagleEye-SessionID"],
f.apply(o, [ "EagleEye-SessionID", v ]), T = p.getConfig("pid"), f.apply(o, [ "EagleEye-pAppName", T ]);
v = p.getTraceId()["EagleEye-TraceID"], h.apply(o, [ "EagleEye-TraceID", v ]), T = p.getPageviewId()["EagleEye-SessionID"],
h.apply(o, [ "EagleEye-SessionID", T ]), B = p.getConfig("pid"), h.apply(o, [ "EagleEye-pAppName", B ]);
break;
case "b3":
var d = p.getB3TraceId(m);
f.apply(o, [ "X-B3-TraceId", d["X-B3-TraceId"] ]), f.apply(o, [ "X-B3-ParentSpanId", d["X-B3-ParentSpanId"] ]),
f.apply(o, [ "X-B3-SpanId", d["X-B3-SpanId"] ]), f.apply(o, [ "X-B3-Sampled", d["X-B3-Sampled"] ]),
f.apply(o, [ "X-Request-ID", r.guid() ]), S = d["X-B3-TraceId"], v = p.getPageviewId()["EagleEye-SessionID"];
var d = p.getB3TraceId(D);
h.apply(o, [ "X-B3-TraceId", d["X-B3-TraceId"] ]), h.apply(o, [ "X-B3-ParentSpanId", d["X-B3-ParentSpanId"] ]),
h.apply(o, [ "X-B3-SpanId", d["X-B3-SpanId"] ]), h.apply(o, [ "X-B3-Sampled", d["X-B3-Sampled"] ]),
h.apply(o, [ "X-Request-ID", r.guid() ]), v = d["X-B3-TraceId"], T = p.getPageviewId()["EagleEye-SessionID"];
break;

@@ -169,4 +173,4 @@

default:
var u = p.getUberTraceId(m);
f.apply(o, [ "uber-trace-id", u["uber-trace-id"] ]), S = u.traceId, v = p.getPageviewId()["EagleEye-SessionID"];
var u = p.getUberTraceId(D);
h.apply(o, [ "uber-trace-id", u["uber-trace-id"] ]), v = u.traceId, T = p.getPageviewId()["EagleEye-SessionID"];
}

@@ -180,15 +184,19 @@ }

if (l && 4 === o.readyState) {
var a = d(), i = r.getXhrSnapshot(g, e, o);
if (!S) {
var a = d(), s = r.getXhrSnapshot(g, e, o);
if (!v) {
var u = r.parseXhrHeaders("function" == typeof o.getAllResponseHeaders && o.getAllResponseHeaders() || "");
"object" == typeof u && u["eagleeye-traceid"] && (S = u["eagleeye-traceid"], B = "response");
"object" == typeof u && u["eagleeye-traceid"] && (v = u["eagleeye-traceid"], X = "response");
}
if (!v && r.isFunction(E)) {
var f = E(o);
f && r.isString(f) && (v = f);
}
if (o.status >= 200 && o.status <= 299) {
var h = o.status || 200;
if ("function" == typeof o.getResponseHeader) {
var f = o.getResponseHeader("Content-Type");
if (f && !/(text)|(json)/.test(f)) return;
var I = o.getResponseHeader("Content-Type");
if (I && !/(text)|(json)/.test(I)) return;
}
o.responseType && "text" !== o.responseType ? p.api(l, !0, a, h, "", c, S, v, {}, n, B, m) : s(p, y.parseResponse, l, g, o.responseText, h, a, c, S, v, i, B, m);
} else p.api(l, !1, a, o.status || "FAILED", o.statusText, c, S, v, i, n, B, m),
o.responseType && "text" !== o.responseType ? p.api(l, !0, a, h, "", c, v, T, {}, n, X, D) : i(p, y.parseResponse, l, g, o.responseText, h, a, c, v, T, s, X, D);
} else p.api(l, !1, a, o.status || "FAILED", o.statusText, c, v, T, s, n, X, D),
y.enableResource && t.fixResourceStatus && t.fixResourceStatus({

@@ -201,4 +209,4 @@ src: o.responseURL || g,

};
o.prototype = i.prototype, r.each(Object.keys(i), function(e) {
o[e] = i[e];
o.prototype = s.prototype, r.each(Object.keys(s), function(e) {
o[e] = s[e];
}), a[c] = o, a[c].toString = r.createFakeToString(c);

@@ -205,0 +213,0 @@ }

@@ -23,3 +23,4 @@ var util = require("../util");

try {
this.getConfig("enableConsole") && "function" == typeof a.consoleBehavior && a.consoleBehavior.call(this),
var o = this.getConfig("enableConsole");
o && "function" == typeof a.consoleBehavior && a.consoleBehavior.call(this, o),
n && ("function" == typeof n.onKeyboardHeightChange && n.onKeyboardHeightChange(i("KeyboardHeightChange")),

@@ -38,4 +39,4 @@ "function" == typeof n.onPageNotFound && n.onPageNotFound(i("PageNotFound")), "function" == typeof n.onAppShow && n.onAppShow(i("AppShow")),

}), n && "function" == typeof n.onError && n.onError(this.reportBehavior.bind(this));
} catch (o) {
util.warn("[arms] error in initBehavior", o);
} catch (r) {
util.warn("[arms] error in initBehavior", r);
}

@@ -42,0 +43,0 @@ return e = this, this.hasInitBehavior = !0, this;

@@ -6,6 +6,6 @@ var platform = require("./platform"), util = require("../util");

if (e[t]) {
var o = e[t];
var i = e[t];
e[t] = function() {
var e = Array.apply(null, arguments);
n.apply(this, e), o.apply(this, e);
n.apply(this, e), i.apply(this, e);
};

@@ -17,3 +17,3 @@ } else e[t] = function() {

}
var n = platform.sdk, o = {
var n = platform.sdk, i = {
request: null,

@@ -24,3 +24,3 @@ httpRequest: null,

component: null
}, i = function(e) {
}, o = function(e) {
var t = this;

@@ -34,31 +34,35 @@ if (n && "function" == typeof n[e]) {

return function(e) {
var n = Date.now(), o = util.duration(), i = t._conf || {}, a = i.parseResponse;
var n = Date.now(), i = util.duration(), o = t._conf || {}, a = o.parseResponse;
if (e && "object" == typeof e && e[0]) {
var s = e[0], u = s.url, p = util.cutUrlSearch(s.url);
p = p ? util.filterByRule(p, u, i.ignoreApiPath ? i.ignoreApiPath : i.apiHelper) : "";
var r, l, c = s.success, f = s.fail, h = (i.ignore || {}).ignoreApis, g = s.header;
g && "object" == typeof g || (g = {});
var d = {};
p = p ? util.filterByRule(p, u, o.ignoreApiPath ? o.ignoreApiPath : o.apiHelper) : "";
var r, l, c = s.success, f = s.fail, h = (o.ignore || {}).ignoreApis, g = o.parseTraceId, d = s.header;
d && "object" == typeof d || (d = {});
var y = {};
if (t.getConfig("enableLinkTrace")) {
var y = g["EagleEye-pAppName"];
if (r = g["EagleEye-TraceID"], l = g["EagleEye-SessionID"], r || (r = t.getTraceId()["EagleEye-TraceID"],
d["EagleEye-TraceID"] = r), l || (l = t.getPageviewId()["EagleEye-SessionID"], d["EagleEye-SessionID"] = l),
!y) {
var m = t.getConfig("pid");
d["EagleEye-pAppName"] = m;
var m = d["EagleEye-pAppName"];
if (r = d["EagleEye-TraceID"], l = d["EagleEye-SessionID"], r || (r = t.getTraceId()["EagleEye-TraceID"],
y["EagleEye-TraceID"] = r), l || (l = t.getPageviewId()["EagleEye-SessionID"], y["EagleEye-SessionID"] = l),
!m) {
var v = t.getConfig("pid");
y["EagleEye-pAppName"] = v;
}
}
var v = function(i, s, c) {
var f = i.statusCode || c, g = "", d = s;
if ("number" == typeof f && (f < 200 || f >= 300) && (d = !1), util.checkAPI(p, !0) || util.ignoreByRule(u, h)) {
var q = function(o, s, c) {
var f = o.statusCode || c, d = "", y = s;
if ("number" == typeof f && (f < 200 || f >= 300) && (y = !1), !r && util.isFunction(g)) {
var m = g(o);
m && util.isString(m) && (r = m);
}
if (util.checkAPI(p, !0) || util.ignoreByRule(u, h)) {
if ("function" == typeof a) {
var y = a(i);
y && (f = "code" in y ? y.code : f, g = "msg" in y ? y.msg : g, d = !!("success" in y ? y.success : d));
var v = a(o);
v && (f = "code" in v ? v.code : f, d = "msg" in v ? v.msg : d, y = !!("success" in v ? v.success : y));
}
util.isString(g) && g && (g = g.substring(0, 1e3)), t.api({
util.isString(d) && d && (d = d.substring(0, 1e3)), t.api({
api: e[0].url,
success: d,
time: o(),
success: y,
time: i(),
code: f,
msg: g,
msg: d,
begin: n,

@@ -71,8 +75,8 @@ traceId: r,

s.success = function() {
v(arguments[0], !0, 200), c && c.apply(t, [].slice.call(arguments));
q(arguments[0], !0, 200), c && c.apply(t, [].slice.call(arguments));
}, s.fail = function() {
v(arguments[0], !1, "FAILED"), f && f.apply(t, [].slice.call(arguments));
}, s.header = util.ext({}, g, d);
q(arguments[0], !1, "FAILED"), f && f.apply(t, [].slice.call(arguments));
}, s.header = util.ext({}, d, y);
}
}(arguments), o[e].apply(this, arguments);
}(arguments), i[e].apply(this, arguments);
}

@@ -84,7 +88,7 @@ });

addHook: function() {
return this.isHookInstantiated ? this : (n && ("function" == typeof n.request && (o.request = n.request,
i.call(this, "request")), "function" == typeof n.httpRequest && (o.httpRequest = n.httpRequest,
i.call(this, "httpRequest"))), function() {
return this.isHookInstantiated ? this : (n && ("function" == typeof n.request && (i.request = n.request,
o.call(this, "request")), "function" == typeof n.httpRequest && (i.httpRequest = n.httpRequest,
o.call(this, "httpRequest"))), function() {
var e = this;
o.app = App, o.page = Page, o.component = Component, App = function(n) {
i.app = App, i.page = Page, i.component = Component, App = function(n) {
n || (n = {}), n.__hooked || (t(n, "onLaunch", function() {

@@ -94,3 +98,3 @@ e.appLaunch();

e.error(t), "function" == typeof e.reportBehavior && e.reportBehavior();
}), o.app(n));
}), i.app(n));
}, Page = function(n) {

@@ -103,3 +107,3 @@ n || (n = {}), n.__hooked || (t(n, "onShow", function() {

e.pageHide();
}), o.page(n));
}), i.page(n));
}, Component = function(n) {

@@ -112,3 +116,3 @@ n || (n = {}), n.methods || (n.methods = {}), n.__hooked || (t(n.methods, "onShow", function() {

e.pageHide();
}), o.component(n));
}), i.component(n));
};

@@ -119,6 +123,6 @@ }.call(this), this.isHookInstantiated = !0, this);

return this.isHookInstantiated ? (function() {
void 0 !== n && n && (o.request && (n.request = o.request, o.request = null), o.httpRequest && (n.httpRequest = o.httpRequest,
o.httpRequest = null));
void 0 !== n && n && (i.request && (n.request = i.request, i.request = null), i.httpRequest && (n.httpRequest = i.httpRequest,
i.httpRequest = null));
}.call(this), function() {
o.app && (App = o.app), o.page && (Page = o.page), o.component && (Component = o.component);
i.app && (App = i.app), i.page && (Page = i.page), i.component && (Component = i.component);
}.call(this), this.isHookInstantiated = !1, this) : this;

@@ -125,0 +129,0 @@ },

@@ -13,2 +13,3 @@ var util = require("../util"), MiniProgramLogger = require("../miniProgramLogger"), platform = require("./platform"), sdk = platform.sdk, ARMS_STORAGE_MINIPROGRAM_UID_KEY = "ARMS_STORAGE_MINIPROGRAM_UID_KEY", MiniLogger = function(e) {

method: i,
dataType: "text",
data: o,

@@ -15,0 +16,0 @@ fail: function(e) {

@@ -1,1 +0,1 @@

/** retcode cloud sdk | @version 1.8.35 | @copyright Alibaba Group Holding Limited. */ !function(){function e(t,r,n){function a(o,s){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!s&&c)return c(o,!0);if(i)return i(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=r[o]={exports:{}};t[o][0].call(f.exports,function(e){return a(t[o][1][e]||e)},f,f.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}return e}()({1:[function(e,t,r){var n=e("./util"),a=e("./common/sendBeacon"),i="aokcdqn3ly@e629dabd48a9933",o=function(e,t){var r;{if("error"!==t.t||!(r=e.$a1[0])||"error"!==r.t||t.msg!==r.msg){if("behavior"===t.t){var a=e.$a1&&e.$a1.length;if(a>0&&"behavior"===e.$a1[a-1].t){var i=t.behavior||[];e.$a1[a-1].behavior.concat(i)}else e.$a1.push(t)}else e.$a1.unshift(t);return e.$a2(function(){e.$a3=n.delay(function(){e.$a4()},e.$a1[0]&&"error"===e.$a1[0].t?3e3:-1)}),!0}r.times++}},s=function(e){return this.ver="1.8.35",this._conf=n.ext({},s.dftCon),this.$a5={},this.$a1=[],this.$a6=[],this.sdkFlag=!0,this.hash=n.seq(),this.$a7(),this.setConfig(e),this.rip=n.getRandIP(),this.record=999,this["EagleEye-TraceID"]=this.getTraceId()["EagleEye-TraceID"],this._common={},this};s.dftCon={sample:1,pvSample:1,tag:"",imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",region:null,ignore:{ignoreUrls:[],ignoreApis:[],ignoreErrors:[/^Script error\.?$/],ignoreResErrors:[],ignoreResources:[/\/(bl|wl)(.debug)?.js$/]},release:undefined,environment:"prod",beforeReport:null},s.prototype={constructor:s,$a2:function(e){return e()},$a8:function(){var e=this._conf.page;return n.$a9(e,[],e+"")},setPage:function(){},setConfig:function(e){e&&"object"==typeof e&&(n.$aa(e),e=this.$ab(e),this._conf=n.ext({},this._conf,e))},$ab:function(e){var t=e.region,r=e.imgUrl;if(t){var a=n.regionMap[t];return e.imgUrl=a||n.defaultImgUrl,e}return r&&(e.imgUrl=r),e},$ac:function(){return!0},$ad:function(){},$ae:function(e,t,r){a(e,t||this.getConfig("imgUrl"),r)},$af:function(){},$ag:function(){return{}},setCommonInfo:function(e){e&&"object"==typeof e&&(this._common=n.ext({},this._common,e))},$a7:function(){this.pageview=n.uu(),this.sBegin=Date.now()},$ah:function(){if(this.username)return this.username;var e=this._conf,t=e&&e.setUsername;if("function"==typeof t)try{var r=t();"string"==typeof r&&(r=r.substr(0,40),this.username=r)}catch(a){n.warn("[arms] setUsername fail",a)}return this.username},getTraceId:function(){var e=this.rip,t=Date.now(),r=n.getSortNum(this.record),a=e+t+r+n.getRandNum(this._conf.pid);return this["EagleEye-TraceID"]=a,this.record=r,{"EagleEye-TraceID":a}},getUberTraceId:function(e){var t=this.rip,r=Date.now(),a=n.getSortNum(this.record),i=n.getRandNum(this._conf.pid),o=t+r+a+n.getNum(2)+i,s=o.substring(0,16);return e=e?"1":"0","0"===o[0]&&(o[0]="1"),"0"===o[16]&&(o[16]="1"),{"uber-trace-id":o+":"+s+":0:"+e,traceId:o}},getB3TraceId:function(e){var t=this.rip,r=Date.now(),a=n.getSortNum(this.record),i=n.getRandNum(this._conf.pid),o=t+r+a+n.getNum(2)+i,s=o.substring(0,16);return e=e?"1":"0","0"===o[0]&&(o[0]="1"),"0"===o[16]&&(o[16]="1"),{b3:o+"-"+s+"-"+e+"-0","X-B3-TraceId":o,"X-B3-ParentSpanId":"0","X-B3-SpanId":s,"X-B3-Sampled":e}},getPageviewId:function(){return{"EagleEye-SessionID":this.pageview}},getConfig:function(e){return e?this._conf[e]:n.ext({},this._conf)},$ai:function(e){return 1===e||("boolean"==typeof this.$a5[e]?this.$a5[e]:(this.$a5[e]=n.pick(e),this.$a5[e]))},$a4:function(e){var t;clearTimeout(this.$a3),this.$a3=null;for(var r=this._conf&&"function"==typeof this._conf.sendRequest;t=this.$a1.pop();)if("res"===t.t)this.$af(t,"res");else if("error"===t.t)this.$af(t,"err");else if("api"===t.t)this.$af(t,"apiSnapshot");else if("behavior"===t.t)this.$af(t,"behavior");else if("health"===t.t&&!r&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon)this.$ae(t);else if("resource"===t.t&&!r&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon){var n=JSON.stringify({resource:t.resource});delete t.resource,this.$ae(t,null,n)}else"resource"===t.t?this.$af(t,"resource"):this.$ad(t);return e&&this.$aj(),this},$aj:function(){var e;for(clearTimeout(this.$ak),this.$ak=null;e=this.$a6.pop();)this.$af(e,"err");return this},_lg:function(e,t,r,a){var i=this,s=i._conf,c=i.$a8(),u=s.ignore||{},f=u.ignoreErrors,l=u.ignoreResErrors,p=u.ignoreUrls,d=u.ignoreApis;if(i._isRobot)return i;if(n.$al(c,p)||n.$al(n.decode(c),p))return i;if("error"===e&&(n.$al(t.msg,f)||n.$al(n.decode(t.msg),f)))return i;if("resourceError"===e&&(n.$al(t.src,l)||n.$al(n.decode(t.src),l)))return i;if("api"===e&&(n.$al(t.api,d)||n.$al(n.decode(t.api),d)))return i;if(!i.$ac(s.imgUrl))return i;if(!t||s.disabled||!s.pid)return i;if(0===a)return i;var g=t.dl;if(delete t.dl,t=n.ext({t:e,times:1,page:c,tag:s.tag||"",release:s.release||"",environment:s.environment,begin:Date.now(),c1:s.c1,c2:s.c2,c3:s.c3},t,i.$ag(),i._common,{pid:s.pid,_v:i.ver,pv_id:i.pageview,username:i.$ah(),sampling:r||1,dl:g,z:n.seq()}),"Function"===n.T(s.beforeReport))try{if(!(t=s.beforeReport(t)))return i}catch(h){return i}return 1===a?o(i,t):r&&!i.$ai(r)?i:o(i,t)},_self:function(e,t,r){var a=this,o=a._conf;if("error"!==e)return a;if(!a.$ac(o.imgUrl))return a;if(!t||o.disabled||!o.pid)return a;if(r&&!a.$ai(r))return a;t=n.ext({t:e,times:1,page:n.selfErrPage,tag:o.pid,begin:Date.now()},t,{pid:i,_v:a.ver,sampling:r||1,z:n.seq()});var s=a.$a6[0];if(s){s.times++;try{if(s.err&&t.err&&s.err.msg_raw&&t.err.msg_raw){s.err.msg_raw.split("&").indexOf(t.err.msg_raw)<0&&s.err.msg_raw.length<1e3&&(s.err.msg_raw+="&"+t.err.msg_raw)}}catch(c){}}else a.$a6.unshift(t),a.$a2(function(){a.sdkFlag&&(a.sdkFlag=!1,a.$ak=n.delay(function(){a.$aj()},1e4))})},custom:function(e,t){if(!e||"object"!=typeof e)return this;var r=!1,a={begin:Date.now()};return n.each(e,function(e,t){return!(r=t&&t.length<=20)&&n.warn("[retcode] invalid key: "+t),a["x-"+t]=e,r}),r?this._lg("custom",a,t||1):this}},t.exports=s},{"./common/sendBeacon":13,"./util":17}],2:[function(e,t,r){var n=e("../util");t.exports=function(e,t){var r=[],a=null,i=t&&t.location&&t.location.href,o=0,s=undefined,c=null,u=function(e,t,r){if(null!==e){var n=e[t];e[t]=r(n)}},f=function(e){var t,r,n,a,i,o=[];if(!e||"string"!=typeof e.tagName)return"";if(o.push(e.tagName.toLowerCase()),"string"==typeof e.id&&o.push("#".concat(e.id)),"string"==typeof(t=e.className))for(r=t.split(/\s+/),i=0;i<r.length;i++)o.push(".".concat(r[i]));var s=["type","name","title","alt","data-arms-attr"];for(i=0;i<s.length;i++)n=s[i],"string"==typeof(a=e.getAttribute(n))&&o.push("[".concat(n,'="').concat(a,'"]'));return o.join("")},l=function(e,t){return function(r){if(r&&r!==c){c=r;var n;try{n=r.target}catch(u){n="<unknown>"}if(0!==n.length){var i={type:"ui.".concat(e),data:{message:function(e){if(!e||1!==e.nodeType)return"";for(var t=e||null,r=[],n=0,a=0,i=" > ".length,o="";t&&n++<5&&!("html"===(o=f(t))||n>1&&a+r.length*i+o.length>=80);)r.push(o),a+=o.length,t=t.parentNode;return r.reverse().join(" > ")}(n)},timestamp:Date.now()};"click"===e?(o&&clearTimeout(o),t?o=setTimeout(function(){a&&a.addBehavior(i)},0):a&&a.addBehavior(i)):"keypress"===e&&(s||a&&a.addBehavior(i),clearTimeout(s),s=setTimeout(function(){s=undefined},100))}}}},p=function(){if(function(){var e=t&&t.chrome,r=e&&e.app&&e.app.runtime,n="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!r&&n}()){var e=function(e,t){var r={type:"navigation",data:{from:e,to:t}};a&&a.addBehavior(r),i=t},r=t.onpopstate;t.onpopstate=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=t.location.href;if(e(i,s),r)return r.apply(this,a)};var n=function(t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];var o=n.length>2?n[2]:undefined;return o&&e(i,String(o)),t.apply(this,n)}};u(t.history,"pushState",n),u(t.history,"replaceState",n)}};n.ext(e.prototype,{addBehavior:function(e){if(this.getConfig("behavior")&&e&&"object"==typeof e){var a={},i=e.data||{};if(e.type)a=i;else{if("string"!=typeof i.name||"string"!=typeof i.message)return;a.name=i.name.substr(0,20),a.message=i.message.substr(0,200)}a.message&&(a.message=n.encode(a.message));var o={type:e.type||"custom",data:a||{},timestamp:e.timestamp||Date.now(),page:e.page||t&&t.location&&t.location.pathname};return r.push(o),r=r.slice(-100)}},getBehavior:function(){return r||[]},setBehavior:function(e){return e&&(r=e),r},reportBehavior:function(e){var t=this;t.getConfig("behavior")&&(t.$am&&(clearTimeout(t.$am),t.$am=undefined),t.$am=setTimeout(function(){r&&r.length>0&&(t.behavior(r),r=[],t.$am=undefined,e&&"function"==typeof e&&e())},0))},$an:function(){if(!this.hasInitBehavior&&!a){try{!function(){if(document&&document.referrer&&document.location){var e=document.referrer,t=document.location.href;if(""!==e){var r={type:"navigation",data:{from:e,to:t}};i=t,a&&a.addBehavior(r)}}}(),t&&t.document&&t.document.addEventListener&&(t.document.addEventListener("click",l("click"),!1),t.document.addEventListener("keypress",l("keypress"),!1)),p(),this.getConfig("enableConsole")&&function(){if(t&&t.console)for(var e=["debug","info","warn","log","error","assert"],r=0;r<e.length;r++){var n=e[r];t.console[n]&&"function"==typeof t.console[n]&&u(t.console,n,function(e){var r=n;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var s={type:"console",data:{level:r,message:i}};if(a&&a.addBehavior(s),"error"===r)for(var c=0;c<i.length;c++){var u=i[c];u&&u.message&&u.stack&&a&&a.errorHandler(new ErrorEvent("error",{error:u,message:u.message}))}e&&Function.prototype.apply.call(e,t.console,i)}})}}()}catch(e){n.warn("[arms] error in initBehavior",e)}a=this,this.hasInitBehavior=!0}return this}})}},{"../util":17}],3:[function(e,t,r){var n=e("../util"),a=e("../reporter"),i=e("../common/sender"),o=e("../common/post"),s=n.win,c=s.document,u=/^(error|api|speed|sum|avg|percent|custom|msg|setPage|setConfig|behavior|performance)$/,f=function(e){var t=this;return a.call(t,e),t._initialPage=e.page&&n.$a9(e.page,[],e.page+"")||null,t._isRobot=n.isRobot(),t._health={errcount:0,apisucc:0,apifail:0},t.$ao=function(e,r){"error"===e?t._health.errcount++:"api"===e&&t._health[r.success?"apisucc":"apifail"]++},!1!==e.enableInstanceAutoSend&&(t.$ap(),t.$aq(),t.$ar(1e4),t._conf&&t._conf.behavior&&"function"==typeof t.$an&&t.$an(),t._conf&&t._conf.enableResource&&"function"==typeof t.$as&&t.$as()),Object.defineProperty&&s.addEventListener&&Object.defineProperty(t,"pipe",{set:t.$at}),t};f.prototype=n.$au(a.prototype),n.ext(a._root.dftCon,{uid:null,setUsername:null,ignoreUrlPath:null,ignoreApiPath:null,urlHelper:[{rule:/\/([a-z\-_]+)?\d{2,20}/g,target:"/$1**"},/\/$/],resourceHelper:[],apiHelper:{rule:/\/([a-z\-_]+)?\d{2,20}/g,target:"/$1**"},ignoreUrlCase:!0,imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",cdnHostList:[],resourceTypes:["css","script","img","font"],resourceSlow:2e3,disableHook:!1,autoSendPv:!0,autoSendPerf:!0,enableSPA:!1,enableLinkTrace:!1,linkType:"arms",enableApiCors:!1,sendResource:!0,behavior:!0,enableConsole:!1,parseHash:function(e){return(e?n.$aw(e.replace(/^#\/?/,"")):"")||"[index]"},parseResponse:function(e){if(!e||"object"!=typeof e)return{};var t=e.code,r=e.msg||e.message||e.subMsg||e.errorMsg||e.ret||e.errorResponse||"";return"object"==typeof r&&(t=t||r.code,r=r.msg||r.message||r.info||r.ret||JSON.stringify(r)),{msg:r,code:t,success:!0}}}),n.ext(f.prototype,{constructor:f,_super:a,$a2:function(e){var t=this;if(t.hasReady)return e();"complete"===c.readyState?(t.hasReady=!0,e()):n.on(s,"load",function(){t.hasReady=!0,e()},!0)},$a8:function(e){var t=this._conf,r=t.page,a=location,i=a.host+a.pathname;return r&&!e?n.$a9(r,[],r+""):this._initialPage||n.$av(t.ignoreUrlCase?i.toLowerCase():i,a.href,t.ignoreUrlPath?t.ignoreUrlPath:t.urlHelper)},setPage:function(e,t){var r=this,n=r.$ax;if(!1!==t){if(!e||e===n)return r;r.$ax=e,clearTimeout(r.$ay),r.$az(1),r.$a7(),r.$ay=setTimeout(function(){r.$b0()},10)}else r.$ax=e;return r._conf.page=e,r},setConfig:function(e,t){if(e&&"object"==typeof e){n.$aa(e),e=this.$ab(e);var r=this._conf;if(this._conf=n.ext({},r,e),!t){var a="disableHook";a in e&&r[a]!==e[a]&&(e[a]?this.removeHook():this.addHook()),(a="enableSPA")in e&&r[a]!==e[a]&&this.$b1(e[a])}}},$ad:function(e){i(e,this.getConfig("imgUrl"))},$af:function(e,t){var r={};r[t]=e[t],delete e[t];var a="";"object"==typeof e&&(a=n.serialize(e)),o(r,this.getConfig("imgUrl")+a+"&post_res=")},$at:function(e){var t=this;if(!e||!e.length)return t;try{if("Array"===n.T(e[0]))return n.each(e,function(e){return t.$at(e)});if("Array"!==n.T(e))return t;var r=e.shift();if(!u.test(r))return t;t[r].apply(t,e)}catch(a){return n.warn("[retcode] error in sendPipe",a),t}},$b2:function(){var e=n.ext({},this._health);e.healthy=e.errcount>0?0:1,e.begin=Date.now();var t=e.begin-this.sBegin;e.stay=t,this._lg("health",e,1),this._health={errcount:0,apisucc:0,apifail:0}},createInstance:function(e){e=n.ext({pid:this._conf.pid},e);var t=this.__proto__.constructor(e);return e.page&&t.$b0(),t}}),e("./behavior")(f,s),e("./handler")(f,s,c),e("./fmp")(f,s,c),e("./hook")(f,s),e("./hack")(f,s),e("./resource")(f,s),f._super=a,f._root=a._root,a.Browser=f,t.exports=f},{"../common/post":11,"../common/sender":14,"../reporter":16,"../util":17,"./behavior":2,"./fmp":4,"./hack":5,"./handler":6,"./hook":7,"./resource":8}],4:[function(e,t,r){var n=e("../util"),a=500;t.exports=function(e,t,r){function i(e,t,r){var n=0,a=e.tagName;if("SCRIPT"!==a&&"STYLE"!==a&&"META"!==a&&"HEAD"!==a){var o=e.children?e.children.length:0;if(o>0)for(var c=e.children,u=o-1;u>=0;u--)n+=i(c[u],t+1,n>0);if(n<=0&&!r){if(!(e.getBoundingClientRect&&e.getBoundingClientRect().top<s))return 0}n+=1+.5*t}return n}function o(e){for(var t=1;t<e.length;t++)if(e[t].score<e[t-1].score)return e.splice(t,1),o(e);return e}var s=t.innerHeight||0,c=[],u=null,f=0;n.ext(e.prototype,{$ar:function(e){var a=this;if(!a._conf||!a._conf.useFmp)return null;if(!t.MutationObserver)return n.warn("[retcode] first meaningful paint can not be retrieved"),a.$b3(),null;n.on(t,"beforeunload",function(){a.$b4(0,!0)});var o=t.MutationObserver;return(u=new o(function(){!function(e){var t=Date.now()-e,n=r.querySelector("body");if(n){var a=0;a+=i(n,1,!1),c.push({score:a,t:t})}else c.push({score:0,t:t})}(a._startTime)})).observe(document,{childList:!0,subtree:!0}),f=1,a.$a2(function(){a.$b4(e)}),u},$b4:function(e,t){var r=this;if(u&&f)if(r.$b5&&(clearTimeout(r.$b5),r.$b5=null),t||!function(e,t){var r=Date.now()-e;return!(r>t||r-(c&&c.length&&c[c.length-1].t||0)>2*a)}(r._startTime,e)){u.disconnect(),f=0,c=o(c);for(var i=null,s=1;s<c.length;s++)if(c[s].t>=c[s-1].t){var l=c[s].score-c[s-1].score;(!i||i.rate<=l)&&(i={t:c[s].t,rate:l})}i&&i.t>0&&i.t<36e5?r.$b3({fmp:i.t}):r.$b3()}else r.$b5=n.delay(function(){r.$b4(e)},a)}})}},{"../util":17}],5:[function(e,t,r){t.exports=function(t,r){var n=e("../util"),a=r.history||{},i=r.document,o=function(e,t){var n;r.CustomEvent?n=new CustomEvent(e,{detail:t}):((n=i.createEvent("HTMLEvents")).initEvent(e,!1,!0),n.detail=t),r.dispatchEvent(n)},s=function(e){var t=a[e];"function"==typeof t&&(a[e]=function(r,i,s){var c=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),u=location.href,f=t.apply(a,c);if(!s||"string"!=typeof s)return f;if(s===u)return f;try{var l=u.split("#"),p=s.split("#"),d=n.$aw(l[0]),g=n.$aw(p[0]),h=l[1]&&l[1].replace(/^\/?(.*)/,"$1"),m=p[1]&&p[1].replace(/^\/?(.*)/,"$1");h!==m?o("historystatechange",m):d!==g&&o("historystatechange",g)}catch(v){n.warn("[retcode] error in "+e+": "+v)}return f},a[e].toString=n.$b6(e))};n.ext(t.prototype,{$b7:function(){return this.$b8?this:(s("pushState"),s("replaceState"),this.$b8=!0,this)}})}},{"../util":17}],6:[function(e,t,r){t.exports=function(t,r,n){var a=e("../util"),i=e("../common/res"),o=e("../common/perf"),s=null,c=n.documentElement,u=r.innerWidth||c.clientWidth||n.body.clientWidth,f=r.innerHeight||c.clientHeight||n.body.clientHeight,l=r.navigator.connection,p={sr:screen.width+"x"+screen.height,vp:u+"x"+f,ct:l?l.effectiveType||l.type:""},d={},g=function(e,t,r,i,o){if(t===undefined){var s,c;if(!d[e]){s=new RegExp(e+"=([^;]+)");try{c=s.exec(n.cookie)}catch(f){return a.warn("[retcode] can not get cookie:",f),null}c&&(d[e]=c[1])}return d[e]}var u=e+"="+t;i&&(u+="; domain="+i),u+="; path="+(o||"/"),r&&(u+="; max-age="+r);try{return n.cookie=u,!!n.cookie}catch(f){return a.warn("[retcode] can not set cookie: ",f),!1}},h=function(e){var t=e._conf.uid||g("_nk_")||g("_bl_uid");if(!t){t=a.uu();if(!g("_bl_uid",t,15552e3))return null}return t};return a.ext(t.prototype,{activeErrHandler:function(e){return s&&!e?this:(s=this,this)},errorHandler:function(e){if(!e)return this;var t=e.type;if("error"===t){var r=e.target||e.srcElement;!(!r||!r.tagName||e.message||e.filename||e.lineno||e.colno)?this.$b9(e):this.error(e.error||{message:e.message},e)}else"unhandledrejection"===t&&a.T(e.reason,"Error")&&a.$ba(e.reason)&&this.error(e.reason);try{this.getConfig("behavior")&&this.reportBehavior&&this.reportBehavior()}catch(e){}return this},$b9:function(e){var t=this,r=e.target||e.srcElement;try{var n=t.$bb(r),i="string"==typeof r.tagName?r.tagName.toLowerCase():"",o=t.$bc(r,5),s=a.getURL(n),c={src:n&&n.substring(0,1e3),node_name:i,xpath:o,res_type:a.getResType(i,n),res_name:s.path,domain:s.domain};return t._conf.enableResource&&t.fixResourceStatus&&e.timeStamp&&t.fixResourceStatus({src:n,node_name:i,res_type:a.getResType(i,n),timeStamp:e.timeStamp,domain:s.domain}),t._lg("resourceError",c),t}catch(u){return a.warn("[ARMS] $b9 error :",u),t}},$bb:function(e){var t=e.src||e.href;try{if(!t){var r="object"===("string"==typeof e.tagName?e.tagName.toLowerCase():""),n=e.getAttribute("classid")&&"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"===e.getAttribute("classid").toLowerCase()||"application/x-shockwave-flash"===e.getAttribute("type");r&&n&&(t=e.getAttribute("data")||e.getAttribute("codebase")),t||(t=e.outerHTML||e.innerHTML)}}catch(a){t=""}return t},$bc:function(e,t){var r=e.id?"#"+e.id:"",n="string"==typeof e.className?"."+e.className.split(" ").join("."):"",a=("string"==typeof e.tagName?e.tagName.toLowerCase():"")+r+n;return e.parentNode&&e.parentNode.tagName&&t-1!=0?this.$bc(e.parentNode,t-1)+" > "+a:a},$b3:function(e){var t=this;t.$a2(function(){var r=o();r&&r.load&&r.load>0&&(r.page=t.$a8(!0),e&&(r=a.ext(r,e)),r.autoSend=!0,t.performance(r))})},$bd:function(e){var t=this;t.$a2(function(){var r=i();r&&r.load&&r.load>0&&(r.load&&r.load<=2e3||r.load&&r.load<=8e3&&Math.random()>.05||(r.page=t.$a8(!0),r.dl=location.href,e&&(r=a.ext(r,e)),t._lg("res",r,t.getConfig("sample"))))})},$b0:function(){var e=this;e.$a2(function(){var t=function(e){var t=h(e),a=r.devicePixelRatio||1;return{uid:t,dt:n.title,dl:location.href,dr:n.referrer,dpr:a.toFixed(2),de:(n.characterSet||n.defaultCharset||"").toLowerCase(),ul:c.lang,begin:Date.now()}}(e);t&&t.uid&&e._lg("pv",t,e.getConfig("pvSample"))})},$ag:function(){return p.uid=h(this),p.sid=function(e){if(e.session)return e.session;var t;try{if("object"==typeof window&&"object"==typeof sessionStorage&&"function"==typeof sessionStorage.getItem)return"string"==typeof(t=sessionStorage.getItem("_bl_sid"))?(e.session=t,t):(t=a.uu(),e.session=t,"function"==typeof sessionStorage.setItem&&sessionStorage.setItem("_bl_sid",t),t)}catch(r){a.warn("[ARMS] getSid error :",r)}return e.session=t=a.uu(),t}(this),p},$az:function(e){var t=Date.now();if(t-this._lastUnload<200)return this;this._lastUnload=t,this.$b2(e),this.$be&&(this._lg("speed",this.$be),this.$be=null,clearTimeout(this.$bf)),this._conf&&this._conf.enableResource&&this.$bg(),this.$a4(!0)},$b1:function(e){var t=this;if(!e^t.$bh)return t;e?(t.$b7(),t.$bh=function(e){var r=t._conf.parseHash(location.hash);r&&t.setPage(r,!1!==e)},t.$bi=function(e){var r=t._conf.parseHash(e.detail);r&&t.setPage(r)},a.on(r,"hashchange",t.$bh),a.on(r,"historystatechange",t.$bi),t.$bh(!1)):(a.off(r,"hashchange",t.$bh),a.off(r,"historystatechange",t.$bi),t.$bh=null,t.$bi=null)},$ap:function(){var e=this;if(e.$bj)return e;var t=e._conf;return a.on(r,"beforeunload",function(){e.$az(0)}),e.$b1(t.enableSPA),e.activeErrHandler(!1),e.$bj=!0,e}}),a.on(r,"error",function(e){s&&s.errorHandler(e)},!1,!0).on(r,"unhandledrejection",function(e){s&&s.errorHandler(e)}),t}},{"../common/perf":10,"../common/res":12,"../util":17}],7:[function(e,t,r){t.exports=function(t,r){var n=e("../util"),a=null,i=n.getCurDomain(),o=function(e,t,r,a,o,s,c,u,f,l,p,d,g){var h=n.J(o)||null,m=n.$a9(t,[h,a],null);if(!m)return!1;var v=m.code||s,y=!("success"in m)||m.success;e.api(r,y,c,v,m.msg,u,f,l,p,i,d,g)},s="fetch",c="__oFetch_",u="__oXMLHttpRequest_",f="XMLHttpRequest";return n.ext(t.prototype,{removeHook:function(e,t){return a&&(t||this===a)?(r[c]&&(r[s]=r[c],delete r[c]),r[u]&&(r[f]=r[u],delete r[u]),a=null,this):this},addHook:function(e){return!e&&a?this:(a||(function(){if("function"==typeof r[s]){var e=r[s];r[c]=e,r[s]=function(t,s){var c=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),u=a;if(!u||!u.api)return e.apply(r,c);if(s&&("HEAD"===s.method||"no-cors"===s.mode))return e.apply(r,c);s||(s={});var f=Date.now(),l=u._conf,p=n.duration(),d=(t&&"string"!=typeof t?t.url:t)||"",g=d;d=n.$aw(d);var h=(l.ignore||{}).ignoreApis;if(!n.$bk(d,!0)||n.$al(d,h))return e.apply(r,c);d=n.$av(d,g,l.ignoreApiPath?l.ignoreApiPath:l.apiHelper);var m=l.enableLinkTrace,v="",y="",b=u.getConfig("pid"),$=null,w=u.getConfig("sample"),_=u.getConfig("linkType"),S=1;if(w&&!u.$ai(w)&&(S=0),m){var E="";try{E=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(O){E=""}var x=n.checkSameOrigin(g,E);if(u.getConfig("enableApiCors")||x)if(t&&"string"!=typeof t)try{if(c[0].headers&&"function"==typeof c[0].headers.get&&"function"==typeof c[0].headers.append)switch(_){case"arms":var I=c[0].headers.get("EagleEye-TraceID"),T=c[0].headers.get("EagleEye-SessionID"),R=c[0].headers.get("EagleEye-pAppName");I?v=I:(v=u.getTraceId()["EagleEye-TraceID"],c[0].headers.append("EagleEye-TraceID",v)),T?y=T:(y=u.getPageviewId()["EagleEye-SessionID"],c[0].headers.append("EagleEye-SessionID",y)),R||c[0].headers.append("EagleEye-pAppName",b);break;case"b3":var k=c[0].headers.get("X-B3-TraceId");if(k)v=k;else{var j=u.getB3TraceId(S);c[0].headers.append("X-B3-TraceId",j["X-B3-TraceId"]),c[0].headers.append("X-B3-ParentSpanId",j["X-B3-ParentSpanId"]),c[0].headers.append("X-B3-SpanId",j["X-B3-SpanId"]),c[0].headers.append("X-B3-Sampled",j["X-B3-Sampled"]),c[0].headers.append("X-Request-ID",n.guid()),v=j["X-B3-TraceId"]}y=u.pageview;break;case"tracing":default:var C=c[0].headers.get("uber-trace-id");C?v=C.split(":")[0]:(C=u.getUberTraceId(S),c[0].headers.append("uber-trace-id",C["uber-trace-id"]),v=C.traceId),y=u.pageview}}catch(A){n.warn("[retcode] fetch failed to set header, exception is :\n"+A)}else switch(s.headers=s.headers?s.headers:{},_){case"arms":s.headers["EagleEye-TraceID"]?v=s.headers["EagleEye-TraceID"]:(v=u.getTraceId()["EagleEye-TraceID"],s.headers["EagleEye-TraceID"]=v),s.headers["EagleEye-SessionID"]?y=s.headers["EagleEye-SessionID"]:(y=u.getPageviewId()["EagleEye-SessionID"],s.headers["EagleEye-SessionID"]=y),s.headers["EagleEye-pAppName"]||(s.headers["EagleEye-pAppName"]=b);break;case"b3":if(s.headers["X-B3-TraceId"])v=s.headers["X-B3-TraceId"];else{var D=u.getB3TraceId(S);s.headers["X-B3-TraceId"]=D["X-B3-TraceId"],s.headers["X-B3-ParentSpanId"]=D["X-B3-ParentSpanId"],s.headers["X-B3-SpanId"]=D["X-B3-SpanId"],s.headers["X-B3-Sampled"]=D["X-B3-Sampled"],s.headers["X-Request-ID"]=n.guid(),v=D["X-B3-TraceId"]}y=u.getPageviewId()["EagleEye-SessionID"];break;case"tracing":default:if(s.headers["uber-trace-id"])v=s.headers["uber-trace-id"].split(":")[0];else{var B=u.getUberTraceId(S);s.headers["uber-trace-id"]=B["uber-trace-id"],v=B.traceId}y=u.getPageviewId()["EagleEye-SessionID"]}}return e.apply(r,c).then(function(e){if(!u||!u.api)return e;try{if(!e||"function"!=typeof e.clone)return e;var t=e.clone(),r=t.headers;if(r&&"function"==typeof r.get){var s=r.get("content-type");if(s&&!/(text)|(json)/.test(s))return e;if(!v){var h=n.parseFetchHeaders(r);"object"==typeof h&&h["eagleeye-traceid"]&&(v=h["eagleeye-traceid"],$="response")}}var m=p();return t.text().then(function(e){var s=n.getFetchSnapshot(c,e,r);t.ok?o(u,l.parseResponse,d,g,e,t.status||200,m,f,v,y,s,$,S):(u.api(d,!1,m,t.status||404,t.statusText,f,v,y,s,i,$,S),l.enableResource&&a.fixResourceStatus&&a.fixResourceStatus({src:t.url,res_type:"api"}))}),e}catch(O){return n.warn("[ARMS] fetch response error :",O),e}})["catch"](function(e){if(!u||!u.api)throw e;var t=p();throw u.api(d,!1,t,e.name||"Error",e.message,f,v,y,{},i),l.enableResource&&a.fixResourceStatus&&a.fixResourceStatus({src:g,res_type:"api"}),e})},r[s].toString=n.$b6(s)}}(),function(){if("function"==typeof r[f]){var e,t=r[f];r[u]=t;var s=function(r){var s=new t(r),c=a;if(!c||!c.api||!s.addEventListener)return s;var u,f,l,p,d=s.send,g=s.open,h=s.setRequestHeader,m=c._conf,v=(m.ignore||{}).ignoreApis,y=c.getConfig("enableLinkTrace"),b="",$="",w="",_=null,S=c.getConfig("sample"),E=c.getConfig("linkType"),x=1;return S&&!c.$ai(S)&&(x=0),s.open=function(t,r){e=t;var a=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);g.apply(s,a),p=r||"",l=n.$aw(p);var i=!n.$bk(l,!0)||n.$al(l,v);if(l=l?n.$av(l,p,m.ignoreApiPath?m.ignoreApiPath:m.apiHelper):"",!i&&y){var o="";try{o=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(_){o=""}var u=n.checkSameOrigin(p,o);if((c.getConfig("enableApiCors")||u)&&h&&"function"==typeof h)switch(E){case"arms":b=c.getTraceId()["EagleEye-TraceID"],h.apply(s,["EagleEye-TraceID",b]),$=c.getPageviewId()["EagleEye-SessionID"],h.apply(s,["EagleEye-SessionID",$]),w=c.getConfig("pid"),h.apply(s,["EagleEye-pAppName",w]);break;case"b3":var f=c.getB3TraceId(x);h.apply(s,["X-B3-TraceId",f["X-B3-TraceId"]]),h.apply(s,["X-B3-ParentSpanId",f["X-B3-ParentSpanId"]]),h.apply(s,["X-B3-SpanId",f["X-B3-SpanId"]]),h.apply(s,["X-B3-Sampled",f["X-B3-Sampled"]]),h.apply(s,["X-Request-ID",n.guid()]),b=f["X-B3-TraceId"],$=c.getPageviewId()["EagleEye-SessionID"];break;case"tracing":default:var d=c.getUberTraceId(x);h.apply(s,["uber-trace-id",d["uber-trace-id"]]),b=d.traceId,$=c.getPageviewId()["EagleEye-SessionID"]}}},s.send=function(){u=Date.now(),f=n.duration();var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);d.apply(s,e)},n.on(s,"readystatechange",function(){if(l&&4===s.readyState){var t=f(),r=n.getXhrSnapshot(p,e,s);if(!b){var d=n.parseXhrHeaders("function"==typeof s.getAllResponseHeaders&&s.getAllResponseHeaders()||"");"object"==typeof d&&d["eagleeye-traceid"]&&(b=d["eagleeye-traceid"],_="response")}if(s.status>=200&&s.status<=299){var g=s.status||200;if("function"==typeof s.getResponseHeader){var h=s.getResponseHeader("Content-Type");if(h&&!/(text)|(json)/.test(h))return}s.responseType&&"text"!==s.responseType?c.api(l,!0,t,g,"",u,b,$,{},i,_,x):o(c,m.parseResponse,l,p,s.responseText,g,t,u,b,$,r,_,x)}else c.api(l,!1,t,s.status||"FAILED",s.statusText,u,b,$,r,i,_,x),m.enableResource&&a.fixResourceStatus&&a.fixResourceStatus({src:s.responseURL||p,res_type:"api"})}}),s};s.prototype=t.prototype,n.each(Object.keys(t),function(e){s[e]=t[e]}),r[f]=s,r[f].toString=n.$b6(f)}}()),a=this,this)},$aq:function(){return this.$bl?this:(this.getConfig("disableHook")||this.addHook(),this.$bl=!0,this)}}),t}},{"../util":17}],8:[function(e,t,r){var n=e("../util"),a=e("../common/constants").TIMING_KEYS;t.exports=function(e,t){function r(e,r,i){if(e instanceof t.PerformanceResourceTiming&&e.initiatorType){var o=n.getResType(e.initiatorType,e.name),s=r.resourceTypes||[],c=(r.ignore||{}).ignoreResources;if(o&&s.includes(o)&&!n.$al(e.name,c)&&!n.$al(n.decode(e.name),c)){var u=e[a[0]],f=e[a[1]],l=e[a[2]],p=e[a[3]],d=e[a[4]],g=e[a[5]],h=e[a[6]],m=e[a[7]],v=e[a[8]],y=e[a[18]],b=e[a[19]];if(!i.has(e)){if(!n.areInOrder(u,f,l,p,d,g,h,m,v))return;if(u>m)return}if(y<u&&(y=u),b<u&&(b=f),n.areInOrder(u,y,b,f)){return{domain:n.getURL(e.name).domain,res_type:o,src_type:n.getSrcType(e.name,r.cdnHostList),success:1,size:Math.round(e.decodedBodySize),duration:Math.round(e.duration),timeStamp:e.responseEnd,timing:e}}}}}var i="_resource-"+Date.now(),o="_resource_error-"+Date.now();n.ext(e.prototype,{$as:function(){var e=this,r=t.performance,n=t.PerformanceObserver;if(e[o]||(e[o]=new WeakMap),!r||!n||"object"!=typeof r||"function"!=typeof r.getEntriesByType)return null;var a=r.getEntriesByType("resource")||[];setTimeout(function(){e.setResource(a)},10);return new n(function(t){setTimeout(function(){e.setResource(t.getEntries())},10)}).observe({entryTypes:["resource"]}),this.$a2(function(){setTimeout(e.$bg.bind(e),5e3)}),e},setResource:function(e){var t=this._conf,a=this[o];if(n.isArray(e)&&e.length){this[i]||(this[i]={});for(var s=this[i],c=0,u=e.length;c<u;c+=1){var f=e[c];if(n.$bk(f.name,!1)){var l=r(f,t,a);if(l){var p=l.res_type+"-"+l.domain;p in s||(s[p]=[]),s[p].push(l)}}}return this}},fixResourceStatus:function(e){var r=t.performance;if(!r||"function"!=typeof r.getEntriesByName)return null;var a=this[o];if(!e.src||!n.$bk(e.src,!1))return this;var i=e.timeStamp||r.now(),s=r.getEntriesByName(e.src,"resource");return n.each(s,function(e){if(!a.has(e)){i-e.responseEnd<100&&a.set(e,{success:0})}}),this},$bg:function(){var e=this[i]||{},r=this._conf.resourceSlow||2e3,a=this[o];this[i]={};var s=Object.keys(e);if(0!==s.length){var c=[];n.each(s,function(t){var i=e[t],o={domain:"",res_type:"",src_type:"",size:0,duration:0,count:0,err_count:0,err_duration:0,slow_count:0,slow_duration:0,timings:[]};n.each(i,function(e){var t=e.timing||{},n=a.get(e.timing),i=n?n.success:1,s=e.duration>r?1:0;o.domain=e.domain,o.res_type=e.res_type,o.src_type=e.src_type,o.count+=1,o.duration+=e.duration,o.size+=e.size,i||(o.err_count+=1,o.err_duration+=e.duration),s&&(o.slow_count+=1,o.slow_duration+=e.duration);try{var c=JSON.parse(JSON.stringify(t));c.success=i,c.resourceSlow=r,c.isSlow=s,o.timings.push(c)}catch(u){}}),o.count&&(o.size=Math.round(o.size/o.count),o.duration=Math.round(o.duration/o.count)),o.slow_count&&(o.slow_duration=Math.round(o.slow_duration/o.slow_count)),o.err_count&&(o.err_duration=Math.round(o.err_duration/o.err_count)),o.timings.length>20&&(o.timings.sort(function(e,t){return t.duration-e.duration}),o.timings.length=20),o.timings=encodeURIComponent(JSON.stringify(o.timings)),c.push(o)});var u={_combo:1,resource:JSON.stringify(c)},f=t.navigator.connection;u.ct=f?f.effectiveType||f.type:"";var l=f?f.downlink||f.downlinkMax||f.bandwidth||null:null;(l=l>999?999:l)&&(u.bandwidth=l),this._lg("resource",u,this.getConfig("sample"))}}})}},{"../common/constants":9,"../util":17}],9:[function(e,t,r){r.TIMING_KEYS=["startTime","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","requestStart","responseStart","responseEnd","","domInteractive","","domContentLoadedEventEnd","","loadEventStart","","msFirstPaint","secureConnectionStart","redirectStart","redirectEnd"]},{}],10:[function(e,t,r){var n=e("../util"),a=e("./constants").TIMING_KEYS;t.exports=function(){var e=n.win||{},t=e.performance;if(!t||"object"!=typeof t)return null;var r={},i=t.timing||{},o=Date.now(),s=1;if("function"==typeof e.PerformanceNavigationTiming){var c=t.getEntriesByType("navigation")[0];c&&(i=c,s=2)}n.each({dns:[3,2],tcp:[5,4],ssl:[5,17],ttfb:[7,6],trans:[8,7],dom:[10,8],res:[14,12],firstbyte:[7,2],fpt:[8,1],tti:[10,1],ready:[12,1],load:[14,1]},function(e,t){var n=i[a[e[1]]],o=i[a[e[0]]];if(2===s||n>0&&o>0){var c=Math.round(o-n);c>=0&&c<6e5&&(r[t]=c)}});var u=e.navigator.connection,f=t.navigation||{};r.ct=u?u.effectiveType||u.type:"";var l=u?u.downlink||u.downlinkMax||u.bandwidth||null:null;if((l=l>999?999:l)&&(r.bandwidth=l),r.navtype=1===f.type?"Reload":"Other",1===s&&i[a[16]]>0&&i[a[1]]>0){var p=i[a[16]]-i[a[1]];p>=0&&p<36e5&&(r.fpt=p)}return 1===s&&i[a[1]]>0?r.begin=i[a[1]]:2===s&&r.load>0?r.begin=o-r.load:r.begin=o,r}},{"../util":17,"./constants":9}],11:[function(e,t,r){var n=e("../util"),a="object"==typeof window?window:{},i=a.__oXMLHttpRequest_||a.XMLHttpRequest;i="function"==typeof i?i:undefined,t.exports=function(e,t){try{var r=new i;r.open("POST",t,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(e))}catch(a){n.warn("[retcode] Failed to log, exception is :\n"+a)}}},{"../util":17}],12:[function(e,t,r){var n=e("../util"),a=e("./constants").TIMING_KEYS;t.exports=function(){var e=n.win||{},t=e.performance;if(!t||"object"!=typeof t||"function"!=typeof t.getEntriesByType)return null;var r={},i=t.timing||{},o=t.getEntriesByType("resource")||[];if(r.begin=i[a[1]]||Date.now(),"function"==typeof e.PerformanceNavigationTiming){var s=t.getEntriesByType("navigation")[0];s&&(i=s)}return n.each({dom:[10,8],load:[14,1]},function(e,t){var n=i[a[e[1]]],o=i[a[e[0]]];if(n>0&&o>0){var s=Math.round(o-n);s>=0&&s<6e5&&(r[t]=s)}}),r.res=JSON.stringify(o),r}},{"../util":17,"./constants":9}],13:[function(e,t,r){var n=e("../util");t.exports=function(e,t,r){"object"==typeof e&&(e=n.serialize(e));var a=t+e+(r?"&post_res=":"");window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?window.navigator.sendBeacon(a,r||"&post_res="):n.warn("[arms] navigator.sendBeacon not surported")}},{"../util":17}],14:[function(e,t,r){var n=e("../util"),a="object"==typeof window?window:{},i=a.__oFetch_||a.fetch;i="function"==typeof i?i:undefined,t.exports=function(e,t){var r=-1;"object"==typeof e&&(r=e.z,e=n.serialize(e));var o=t+e;if(i)return i(o,{method:"HEAD",mode:"no-cors"})["catch"](n.noop);if(a.document&&a.document.createElement){var s="__request_hold_"+r,c=a[s]=new Image;c.onload=c.onerror=function(){a[s]=undefined},c.src=o,c=null}}},{"../util":17}],15:[function(e,t,r){"use strict";function n(e,t){var r=a[o]=new i(e);r.$at(t);var n=r._conf;return!1!==n.autoSendPv&&r.$b0(),n&&n.useFmp||r.$b3(),n&&n.sendResource&&r.$bd(),a[s]=!0,r}var a=window,i=a.BrowserLogger=e("./biz.browser/clazz"),o=e("./util").key,s="__hasInitBlSdk";i.singleton=function(e,t){return a[s]?a[o]:n(e,t)},i.createExtraInstance=function(e){e&&"object"==typeof e&&!0!==e.enableInstanceAutoSend&&(e.enableInstanceAutoSend=!1);var t=new i(e),r=t._conf;return r.enableInstanceAutoSend&&(!1!==r.autoSendPv&&t.$b0(),r&&r.useFmp||t.$b3(),r&&r.sendResource&&t.$bd()),t};"object"==typeof window&&!!window.navigator&&a[o]&&(i.bl=function(){if(a[s])return a[o];var e={},t=[];return o in a&&(e=a[o].config||{},t=a[o].pipe||[]),n(e,t)}(a.__hasInitBlSdk)),t.exports=i},{"./biz.browser/clazz":3,"./util":17}],16:[function(e,t,r){var n=e("./util"),a=e("./base"),i=["api","success","time","code","msg","trace","traceId","begin","pv_id","sid","seq","domain","flag"],o=function(e){var t=(e.key||"default").split("::");return t.length>1?n.ext(e,{group:t[0],key:t[1]}):n.ext(e,{group:"default_group",key:t[0]})},s=function(e){a.call(this,e);var t;try{t="object"==typeof performance?performance.timing.fetchStart:Date.now()}catch(r){t=Date.now()}return this._startTime=t,this};s.prototype=n.$au(a.prototype),n.ext(a.dftCon,{startTime:null}),n.ext(s.prototype,{constructor:s,_super:a,sum:function(e,t,r){try{var a=n.$bm(e,t,1);return this._lg("sum",o(a),r)}catch(i){n.warn("[retcode] can not get parseStatData: "+i)}},avg:function(e,t,r){try{var a=n.$bm(e,t,0);return this._lg("avg",o(a),r)}catch(i){n.warn("[retcode] can not get parseStatData: "+i)}},percent:function(e,t,r,a){try{return this._lg("percent",o({key:e,subkey:t,val:r||0,begin:Date.now()}),a)}catch(i){n.warn("[retcode] can not get parseStatData: "+i)}},msg:function(e,t){if(e&&!(e.length>180))return this.custom({msg:e},t)},error:function(e,t){if(!e)return n.warn("[retcode] invalid param e: "+e),this;1===arguments.length?("string"==typeof e&&(e={message:e},t={}),"object"==typeof e&&(t=e=e.error||e)):("string"==typeof e&&(e={message:e}),"object"!=typeof t&&(t={}));var r=e.name||"CustomError",a=e.message||"",i=e.stack||"";t=t||{};var o="object"==typeof location&&"string"==typeof location.href&&location.href.substring(0,500)||"";if(n.$bn(a,t.filename)){var s=/^Script error\.?$/,c=e.msg||e.message;if(n.$al(c,s)||n.$al(n.decode(c),s))return this;var u={msg:n.selfErrKey,err:{msg_raw:n.encode(e.msg||e.message)}};return this._self("error",u,1)}for(var f={begin:Date.now(),cate:r,msg:a&&a.substring(0,1e3),stack:i&&i.substring(0,1e3),file:n.$bo(t.filename||""),line:t.lineno||"",col:t.colno||"",err:{msg_raw:n.encode(a),stack_raw:n.encode(i)},dl:o},l=["tag","c1","c2","c3"],p=0;p<l.length;p++){var d=l[p];t[d]&&(f[d]=t[d])}var g=(this.getConfig("ignore")||{}).ignoreErrors;return n.$al(f.msg,g)||n.$al(n.decode(f.msg),g)?this:(this.$ao&&this.$ao("error",f),this._lg("error",f,1))},behavior:function(e){if(e){var t="object"==typeof e&&e.behavior?e:{behavior:e};return this.$ao&&this.$ao("behavior",t),this._lg("behavior",t,1)}},api:function(e,t,r,a,o,s,c,u,f,l,p,d){if(!e)return n.warn("[retcode] api is null"),this;if(e="string"==typeof e?{api:e,success:t,time:r,code:a,msg:o,begin:s,traceId:c,pv_id:u,apiSnapshot:f,domain:l,flag:d}:n.sub(e,i),!n.$bk(e.api,!0))return this;e.code=e.code||"";var g=e.msg||"";if(g="string"==typeof g?g.substring(0,1e3):g,e.msg=g,e.success=e.success?1:0,e.time=+e.time,e.begin=e.begin,e.traceId=e.traceId||"",e.pv_id=e.pv_id||"",e.domain=e.domain||"",e.flag=e.flag,e.dl="object"==typeof location&&"string"==typeof location.href&&location.href.substring(0,500)||"",e.success?e.apiSnapshot&&delete e.apiSnapshot:e.apiSnapshot=f,p&&(e.traceOrigin=p),!e.api||isNaN(e.time))return n.warn("[retcode] invalid time or api"),this;var h=(this.getConfig("ignore")||{}).ignoreApis;return n.$al(e.api,h)||n.$al(n.decode(e.api),h)?this:e.time<0?this:(this.$ao&&this.$ao("api",e),this._lg("api",e,e.success&&this.getConfig("sample"),e.flag))},speed:function(e,t,r){var a=this,i=this.getConfig("startTime")||this._startTime;return/^s(\d|1[0])$/.test(e)?(t="number"!=typeof t?Date.now()-i:t>=i?t-i:t,a.$be=a.$be||{},a.$be[e]=t,a.$be.begin=i,clearTimeout(a.$bf),a.$bf=setTimeout(function(){r||(a.$be.page=a.$a8(!0)),a._lg("speed",a.$be),a.$be=null},5e3),a):(n.warn("[retcode] invalid point: "+e),a)},performance:function(e){if(e&&"object"==typeof e&&!this.$bp){var t={},r={},a=this.getConfig("autoSendPerf");if(e.autoSend&&a)return r=n.ext(this.$bq||{},e),this.$bp=!0,this._lg("perf",r,this.getConfig("sample"));if(e.autoSend&&!a)return delete e.autoSend,this.$bq?(r=n.ext(this.$bq||{},e),this.$bp=!0,this._lg("perf",r,this.getConfig("sample"))):void(this.$bq=e);for(var i in e)(/^t([1-9]|1[0])$/.test(i)||"ctti"===i||"cfpt"===i)&&(t[i]=e[i]);if(!0===e.autoSend||!a&&(a||this.$bq))return!0!==e.autoSend&&!1===a&&this.$bq?(t=n.ext(this.$bq||{},t),this.$bp=!0,this._lg("perf",t,this.getConfig("sample"))):void 0;this.$bq=n.ext(this.$bq||{},t)}},resource:function(e,t){if(!e||!n.isPlainObject(e))return n.warn("[arms] invalid param data: "+e),this;var r=Object.keys(e),a=["begin","dom","load","res","dl"],i=!1;for(var o in a){if(r.indexOf(a[o])<0){i=!0;break}}if(i)return n.warn("[arms] lack param data: "+e),this;var s={begin:e.begin||Date.now(),dom:e.dom||"",load:e.load||"",res:n.isArray(e.res)?JSON.stringify(e.res):JSON.stringify([]),dl:e.dl||""};return this._lg("res",s,t)},event:function(e,t){if("object"==typeof e&&e&&e.key){var r={},n=["key","success","time","c1","c2","c3"];for(var a in e)n.indexOf(a)>-1&&(r[a]=e[a]);r.success=!1===e.success?0:1,this._lg("event",r,t)}}}),s._super=a,s._root=a,a.Reporter=s,t.exports=s},{"./base":1,"./util":17}],17:[function(e,t,r){Date.now=Date.now||function(){return(new Date).getTime()};var n=Date.now(),a=function(){},i={noop:a,warn:function(){var e="object"==typeof console?console.warn:a;try{var t={warn:e};t.warn.call(t)}catch(r){return a}return e}(),key:"__bl",selfErrKey:"ARMS_SDK_ERROR",selfErrPage:"ARMSSDK",win:"object"==typeof window&&window.document?window:undefined,regionMap:{cn:"https://arms-retcode.aliyuncs.com/r.png?",sg:"https://arms-retcode-sg.aliyuncs.com/r.png?",sg_2:"https://retcode-sg-lazada.arms.aliyuncs.com/r.png?",daily:"http://arms-retcode-daily.alibaba.net/r.png?",daily_2:"https://arms-retcode-daily.alibaba.net/r.png?",daily_3:"http://arms-retcode-daily.aliyun.test/r.png?",us:"https://retcode-us-west-1.arms.aliyuncs.com/r.png?",tw:"https://arms-retcode.orientalgame.com.tw/r.png?",tw_sg:"https://arms-retcode-sg.orientalgame.com.tw/r.png?",hz_finance:"https://arms-retcode-hz-finance.aliyuncs.com/r.png?"},defaultImgUrl:"https://arms-retcode.aliyuncs.com/r.png?",$au:function(e){if(Object.create)return Object.create(e);var t=function(){};return t.prototype=e,new t},each:function(e,t){var r=0,n=e.length;if(this.T(e,"Array"))for(;r<n&&!1!==t.call(e[r],e[r],r);r++);else for(r in e)if(!1===t.call(e[r],e[r],r))break;return e},$a9:function(e,t,r){if("function"!=typeof e)return r;try{return e.apply(this,t)}catch(n){return r}},T:function(e,t){var r=Object.prototype.toString.call(e).substring(8).replace("]","");return t?r===t:r},duration:function(){var e=Date;try{performance&&this.T(performance.now,"Function")&&(e=performance)}catch(r){e=Date}var t=e.now();return function(){return Math.round(e.now()-t)}},$av:function(){var e=[].slice.call(arguments),t=e.length;if(t<2)return e[0];var r=e[t-1],n=e[0];if(!n)return"";if(!r)return n;var a=this,i=a.T(r),o=e.slice(0,t-1);return"Function"===i?a.$a9(r,o,n):"Array"===i?(this.each(r,function(e){o[0]=n=a.$av.apply(a,[].concat(o,e))}),n):"Object"===i?n.replace(r.rule,r.target||""):n.replace(r,"")},$al:function(e,t){if(!e||!t)return!1;if((this.isString(t)||t.source||"Function"===this.T(t))&&(t=[t]),!this.isArray(t))return this.warn("[arms] invalid rules of ignore config, (list of) String/RegExp/Funcitons are available"),!1;for(var r,n=[],a=0,i=t.length;a<i;a++)if(r=t[a],this.isString(r))n.push(r.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"));else if(r&&r.source)n.push(r.source);else if(r&&"Function"===this.T(r)&&!0===this.$a9(r,[e],!1))return!0;var o=new RegExp(n.join("|"),"i");return!!(n.length&&o.test&&o.test(e))},J:function(e){if(!e||"string"!=typeof e)return e;var t=null;try{t=JSON.parse(e)}catch(r){}return t},pick:function(e){return 1===e||1===Math.ceil(Math.random()*e)},$aa:function(e){if("sample"in e){var t=e.sample,r=t;t&&/^\d+(\.\d+)?%$/.test(t)&&(r=parseInt(100/parseFloat(t))),0<r&&1>r&&(r=parseInt(1/r)),r>=1&&r<=100?e.sample=r:delete e.sample}return e},on:function(e,t,r,n,a){return e.addEventListener?(a=a||!1,e.addEventListener(t,function i(o){n&&e.removeEventListener(t,i,a),r.call(this,o)},a)):e.attachEvent&&e.attachEvent("on"+t,function o(a){n&&e.detachEvent("on"+t,o),r.call(this,a)}),this},off:function(e,t,r){return r?(e.removeEventListener?e.removeEventListener(t,r):e.detachEvent&&e.detachEvent(t,r),this):this},delay:function(e,t){return-1===t?(e(),null):setTimeout(e,t||0)},ext:function(e){for(var t=1,r=arguments.length;t<r;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},sub:function(e,t){var r={};return this.each(e,function(e,n){-1!==t.indexOf(n)&&(r[n]=e)}),r},uu:function(){for(var e,t,r=20,n=new Array(r),a=Date.now().toString(36).split("");r-- >0;)t=(e=36*Math.random()|0).toString(36),n[r]=e%3?t:t.toUpperCase();for(var i=0;i<8;i++)n.splice(3*i+2,0,a[i]);return n.join("")},guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},seq:function(){return(n++).toString(36)},decode:function(e){try{e=decodeURIComponent(e)}catch(t){}return e},encode:function(e,t){try{e=t?encodeURIComponent(e).replace(/\(/g,"%28").replace(/\)/g,"%29"):encodeURIComponent(e)}catch(r){}return e},serialize:function(e){e=e||{};var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&e[r]!==undefined&&t.push(r+"="+this.encode(e[r],"msg"===r));return t.join("&")},$bk:function(e,t){if(!e||"string"!=typeof e)return!1;var r=/arms-retcode[\w-]*\.aliyuncs/.test(e);return!r&&t&&(r=/(\.png)|(\.gif)|(alicdn\.com)|(mmstat\.com)/.test(e)),!r},$ba:function(e){return!(!e||!e.message)&&!/failed[\w\s]+fetch/i.test(e.message)},$aw:function(e){return e&&"string"==typeof e?e.replace(/^(https?:)?\/\//,"").replace(/\?.*$/,""):""},$bo:function(e){return e&&"string"==typeof e?e.replace(/\?.*$/,""):""},$b6:function(e){return function(){return e+"() { [native code] }"}},checkSameOrigin:function(e,t){if(!t||!e)return!1;var r="//"+t.split("/")[2];return e===t||e.slice(0,t.length+1)===t+"/"||e===r||e.slice(0,r.length+1)===r+"/"||!/^(\/\/|http:|https:).*/.test(e)},getRandIP:function(){for(var e=[],t=0;t<4;t++){var r=Math.floor(256*Math.random());e[t]=(r>15?"":"0")+r.toString(16)}return e.join("").replace(/^0/,"1")},getSortNum:function(e){return e?(e+=1)>=1e3&&e<=9999?e:e<1e3?e+1e3:e%1e4+1e3:1e3},getRandNum:function(e){return e&&"string"==typeof e?e.length<5?this.getNum(5):e.substring(e.length-5):this.getNum(5)},getNum:function(e){for(var t=[],r=0;r<e;r++){var n=Math.floor(16*Math.random());t[r]=n.toString(16)}return t.join("")},getCurDomain:function(){return location&&location.hostname||""},getSrcType:function(e,t){var r=location&&location.host||"";if(!r)return"";var n=new URL(e).host;if(n===r)return"self";for(var a=0;a<t.length;a+=1)if(n.includes(t[a]))return"cdn";return"others"},parseFetchHeaders:function(e){if(!e)return{};var t={};try{if("function"==typeof e.keys)for(var r=e.keys(),n=r.next();!n.done;){var a=n.value;t[a]=e.get(a),n=r.next()}else t=e}catch(i){t={}}return t},parseXhrHeaders:function(e){if(!e&&"string"!=typeof e)return{};var t={};try{var r=e.split("\r\n");t=r.reduce(function(e,t){var r=t.split(": ");return e[r[0]]=r[1],e},{})}catch(n){t={}}return t},getQuerys:function(e){if(!e)return"";var t={},r=[],n="",a="";try{var i=[];if(e.indexOf("?")>=0&&(i=e.substring(e.indexOf("?")+1,e.length).split("&")),i.length>0)for(var o in i)n=(r=i[o].split("="))[0],a=r[1],t[n]=a}catch(s){t={}}return t},getURL:function(e){if(!e)return null;var t={},r=e.length,n=e.indexOf("://");if(n<0)return null;t.protocol=e.substring(0,n+1);var a=e.indexOf("#"),i=e.indexOf("?");a<0&&(a=r),i<0&&(i=a),t.search=e.substring(i,a).substring(0,1e3);var o=e.substring(n+3,i),s=o.indexOf("/");return s<0&&(s=o.length),t.domain=o.substring(0,s).split(":")[0],t.path=o.substring(s,o.length).substring(0,1e3),t},getResType:function(e,t){if(["script","img","other"].indexOf(e)>-1)return e;if(["video"].indexOf(e)>-1)return"media";if(["document","iframe"].indexOf(e)>-1)return"doc";var r=t?this.getURL(t):null,n=r&&r.path?r.path.lastIndexOf("."):-1,a=(n>0?r.path.substr(n+1):"").toLowerCase();if(a){if(["eot","woff","woff2","ttf"].indexOf(a)>-1)return"font";if("css"===a)return"css";if("js"===a)return"script"}return["fetch","xmlhttprequest","beacon"].indexOf(e)>-1?"api":"others"},areInOrder:function(){for(var e=1;e<arguments.length;e+=1)if(arguments[e-1]>arguments[e])return!1;return!0},getFetchSnapshot:function(e,t,r){var n,a;try{var i=(e&&"string"!=typeof e[0]?e[0].url:e[0])||"",o=(e&&"string"!=typeof e[0]?e[0]:e[1])||{},s="POST"===o.method.toUpperCase()?o.body:this.getQuerys(i);n={originApi:i,method:o.method||"unknown",params:s,response:t||"",reqHeaders:this.parseFetchHeaders(o.headers||null),resHeaders:this.parseFetchHeaders(r)},a="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(n))||"{}"}catch(c){a="{}"}return a},getXhrSnapshot:function(e,t,r){if(!e||!t||!r)return{};var n,a;try{var i="";""===r.responseType||"text"===r.responseType?i=r.responseText:"document"===r.responseType&&(i=r.responseXML),n={originApi:e,method:t,params:this.getQuerys(e),response:i,reqHeaders:{},resHeaders:this.parseXhrHeaders("function"==typeof r.getAllResponseHeaders&&r.getAllResponseHeaders()||"")},a="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(n))||"{}"}catch(o){a="{}"}return a},isRobot:function(){var e=["nuhk","googlebot/","googlebot-image","yammybot","openbot","slurp","msnbot","ask jeeves/teoma","ia_archiver","baiduspider","bingbot/","adsbot"];if(!navigator||"string"!=typeof navigator.userAgent)return!1;try{for(var t=navigator.userAgent.toLowerCase(),r=0;r<e.length;r++){var n=e[r];if(t.lastIndexOf(n)>=0)return!0}}catch(a){this.warn("[arms] useragent parse error")}return!1},isFunction:function(e){return"function"==typeof e},isPlainObject:function(e){return"[object Object]"===Object.prototype.toString.call(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},joinRegExp:function(e){for(var t,r=[],n=0,a=e.length;n<a;n++)t=e[n],this.isString(t)?r.push(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):t&&t.source&&r.push(t.source);return new RegExp(r.join("|"),"i")},reWriteMethod:function(e,t,r){if(null!==e){var n=e[t];e[t]=r(n)}},$bn:function(e,t){if(!e&&!t)return!1;if(new RegExp(this.selfErrKey,"i").test(e))return!0;return!!this.$al(t,[/retcode.alicdn.com\/retcode\/bl.js/,/g.alicdn.com\/retcode\/cloud-sdk\/bl.js/,/laz-g-cdn.alicdn.com\/retcode\/cloud-sdk\/bl.js/,/local.taobao.com:8880\/build\/bl/])},$bs:function(e){return{msg:e,message:this.selfErrKey}},$bm:function(e,t,r){var n={};try{n=this.isPlainObject(e)?this.ext({key:e.key||"default",val:e.val||e.value||r},e,{begin:Date.now()}):{key:e||"default",val:t||r,begin:Date.now()}}catch(a){this.warn("[retcode] baseLog error: "+a)}return n}};t.exports=i},{}]},{},[15]);
/** retcode cloud sdk | @version 1.8.36-beta.8 | @copyright Alibaba Group Holding Limited. */ !function(){function e(t,r,n){function a(o,s){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!s&&c)return c(o,!0);if(i)return i(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=r[o]={exports:{}};t[o][0].call(f.exports,function(e){return a(t[o][1][e]||e)},f,f.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}return e}()({1:[function(e,t,r){var n=e("./util"),a=e("./common/sendBeacon"),i="aokcdqn3ly@e629dabd48a9933",o=function(e,t){var r;if("error"===t.t&&(r=e.$a1[0])&&"error"===r.t&&t.msg===r.msg)return t.times=r.times+1,void(e.$a1[0]=t);if("behavior"===t.t){var a=e.$a1&&e.$a1.length;if(a>0&&"behavior"===e.$a1[a-1].t){var i=t.behavior||[];e.$a1[a-1].behavior.concat(i)}else e.$a1.push(t)}else e.$a1.unshift(t);return e.$a2(function(){e.$a3=n.delay(function(){e.$a4()},e.$a1[0]&&"error"===e.$a1[0].t?3e3:-1)}),!0},s=function(e){return this.ver="1.8.36-beta.8",this._conf=n.ext({},s.dftCon),this.$a5={},this.$a1=[],this.$a6=[],this.sdkFlag=!0,this.hash=n.seq(),this.$a7(),this.setConfig(e),this.rip=n.getRandIP(),this.record=999,this["EagleEye-TraceID"]=this.getTraceId()["EagleEye-TraceID"],this._common={},this};s.dftCon={sample:1,pvSample:1,tag:"",imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",region:null,ignore:{ignoreUrls:[],ignoreApis:[],ignoreErrors:[/^Script error\.?$/],ignoreResErrors:[],ignoreResources:[/\/(bl|wl)(.debug)?.js$/]},release:undefined,environment:"prod",beforeReport:null,parseTraceId:null},s.prototype={constructor:s,$a2:function(e){return e()},$a8:function(){var e=this._conf.page;return n.$a9(e,[],e+"")},setPage:function(){},setConfig:function(e){e&&"object"==typeof e&&(n.$aa(e),e=this.$ab(e),this._conf=n.ext({},this._conf,e))},$ab:function(e){var t=e.region,r=e.imgUrl;if(t){var a=n.regionMap[t];return e.imgUrl=a||n.defaultImgUrl,e}return r&&(e.imgUrl=r),e},$ac:function(){return!0},$ad:function(){},$ae:function(e,t,r){a(e,t||this.getConfig("imgUrl"),r)},$af:function(){},$ag:function(){return{}},setCommonInfo:function(e){e&&"object"==typeof e&&(this._common=n.ext({},this._common,e))},$a7:function(){this.pageview=n.uu(),this.sBegin=Date.now()},$ah:function(){if(this.username)return this.username;var e=this._conf,t=e&&e.setUsername;if("function"==typeof t)try{var r=t();"string"==typeof r&&(r=r.substr(0,40),this.username=r)}catch(a){n.warn("[arms] setUsername fail",a)}return this.username},getTraceId:function(){var e=this.rip,t=Date.now(),r=n.getSortNum(this.record),a=e+t+r+n.getRandNum(this._conf.pid);return this["EagleEye-TraceID"]=a,this.record=r,{"EagleEye-TraceID":a}},getUberTraceId:function(e){var t=this.rip,r=Date.now(),a=n.getSortNum(this.record),i=n.getRandNum(this._conf.pid),o=t+r+a+n.getNum(2)+i,s=o.substring(0,16);return e=e?"1":"0","0"===o[0]&&(o[0]="1"),"0"===o[16]&&(o[16]="1"),{"uber-trace-id":o+":"+s+":0:"+e,traceId:o}},getB3TraceId:function(e){var t=this.rip,r=Date.now(),a=n.getSortNum(this.record),i=n.getRandNum(this._conf.pid),o=t+r+a+n.getNum(2)+i,s=o.substring(0,16);return e=e?"1":"0","0"===o[0]&&(o[0]="1"),"0"===o[16]&&(o[16]="1"),{b3:o+"-"+s+"-"+e+"-0","X-B3-TraceId":o,"X-B3-ParentSpanId":"0","X-B3-SpanId":s,"X-B3-Sampled":e}},getPageviewId:function(){return{"EagleEye-SessionID":this.pageview}},getConfig:function(e){return e?this._conf[e]:n.ext({},this._conf)},$ai:function(e){return 1===e||("boolean"==typeof this.$a5[e]?this.$a5[e]:(this.$a5[e]=n.pick(e),this.$a5[e]))},$a4:function(e){var t;clearTimeout(this.$a3),this.$a3=null;for(var r=this._conf&&"function"==typeof this._conf.sendRequest;t=this.$a1.pop();)if("res"===t.t)this.$af(t,"res");else if("error"===t.t)this.$af(t,"err");else if("api"===t.t)this.$af(t,"apiSnapshot");else if("behavior"===t.t)this.$af(t,"behavior");else if("health"===t.t&&!r&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon)this.$ae(t);else if("resource"===t.t&&!r&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon){var n=JSON.stringify({resource:t.resource});delete t.resource,this.$ae(t,null,n)}else"resource"===t.t?this.$af(t,"resource"):this.$ad(t);return e&&this.$aj(),this},$aj:function(){var e;for(clearTimeout(this.$ak),this.$ak=null;e=this.$a6.pop();)this.$af(e,"err");return this},_lg:function(e,t,r,a){var i=this,s=i._conf,c=i.$a8(),u=s.ignore||{},f=u.ignoreErrors,l=u.ignoreResErrors,p=u.ignoreUrls,d=u.ignoreApis;if(i._isRobot)return i;if(n.$al(c,p)||n.$al(n.decode(c),p))return i;if("error"===e&&(n.$al(t.msg,f)||n.$al(n.decode(t.msg),f)))return i;if("resourceError"===e&&(n.$al(t.src,l)||n.$al(n.decode(t.src),l)))return i;if("api"===e&&(n.$al(t.api,d)||n.$al(n.decode(t.api),d)))return i;if(!i.$ac(s.imgUrl))return i;if(!t||s.disabled||!s.pid)return i;if(0===a)return i;var g=t.dl;if(delete t.dl,t=n.ext({t:e,times:1,page:c,tag:s.tag||"",release:s.release||"",environment:s.environment,begin:Date.now(),c1:s.c1,c2:s.c2,c3:s.c3},t,i.$ag(),i._common,{pid:s.pid,_v:i.ver,pv_id:i.pageview,username:i.$ah(),sampling:r||1,dl:g,z:n.seq()}),"Function"===n.T(s.beforeReport))try{if(!(t=s.beforeReport(t)))return i}catch(h){return i}return 1===a?o(i,t):r&&!i.$ai(r)?i:o(i,t)},_self:function(e,t,r){var a=this,o=a._conf;if("error"!==e)return a;if(!a.$ac(o.imgUrl))return a;if(!t||o.disabled||!o.pid)return a;if(r&&!a.$ai(r))return a;t=n.ext({t:e,times:1,page:n.selfErrPage,tag:o.pid,begin:Date.now()},t,{pid:i,_v:a.ver,sampling:r||1,z:n.seq()});var s=a.$a6[0];if(s){s.times++;try{if(s.err&&t.err&&s.err.msg_raw&&t.err.msg_raw){s.err.msg_raw.split("&").indexOf(t.err.msg_raw)<0&&s.err.msg_raw.length<1e3&&(s.err.msg_raw+="&"+t.err.msg_raw)}}catch(c){}}else a.$a6.unshift(t),a.$a2(function(){a.sdkFlag&&(a.sdkFlag=!1,a.$ak=n.delay(function(){a.$aj()},1e4))})},custom:function(e,t){if(!e||"object"!=typeof e)return this;var r=!1,a={begin:Date.now()};return n.each(e,function(e,t){return!(r=t&&t.length<=20)&&n.warn("[retcode] invalid key: "+t),a["x-"+t]=e,r}),r?this._lg("custom",a,t||1):this}},t.exports=s},{"./common/sendBeacon":13,"./util":17}],2:[function(e,t,r){var n=e("../util");t.exports=function(e,t){var r=[],a=null,i=t&&t.location&&t.location.href,o=0,s=undefined,c=null,u=function(e,t,r){if(null!==e){var n=e[t];e[t]=r(n)}},f=function(e){var t,r,n,a,i,o=[];if(!e||"string"!=typeof e.tagName)return"";if(o.push(e.tagName.toLowerCase()),"string"==typeof e.id&&o.push("#".concat(e.id)),"string"==typeof(t=e.className))for(r=t.split(/\s+/),i=0;i<r.length;i++)o.push(".".concat(r[i]));var s=["type","name","title","alt","data-arms-attr"];for(i=0;i<s.length;i++)n=s[i],"string"==typeof(a=e.getAttribute(n))&&o.push("[".concat(n,'="').concat(a,'"]'));return o.join("")},l=function(e,t){return function(r){if(r&&r!==c){c=r;var n;try{n=r.target}catch(u){n="<unknown>"}if(0!==n.length){var i={type:"ui.".concat(e),data:{message:function(e){if(!e||1!==e.nodeType)return"";for(var t=e||null,r=[],n=0,a=0,i=" > ".length,o="";t&&n++<5&&!("html"===(o=f(t))||n>1&&a+r.length*i+o.length>=80);)r.push(o),a+=o.length,t=t.parentNode;return r.reverse().join(" > ")}(n)},timestamp:Date.now()};"click"===e?(o&&clearTimeout(o),t?o=setTimeout(function(){a&&a.addBehavior(i)},0):a&&a.addBehavior(i)):"keypress"===e&&(s||a&&a.addBehavior(i),clearTimeout(s),s=setTimeout(function(){s=undefined},100))}}}},p=function(){if(function(){var e=t&&t.chrome,r=e&&e.app&&e.app.runtime,n="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!r&&n}()){var e=function(e,t){var r={type:"navigation",data:{from:e,to:t}};a&&a.addBehavior(r),i=t},r=t.onpopstate;t.onpopstate=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=t.location.href;if(e(i,s),r)return r.apply(this,a)};var n=function(t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];var o=n.length>2?n[2]:undefined;return o&&e(i,String(o)),t.apply(this,n)}};u(t.history,"pushState",n),u(t.history,"replaceState",n)}};n.ext(e.prototype,{addBehavior:function(e){if(this.getConfig("behavior")&&e&&"object"==typeof e){var a={},i=e.data||{};if(e.type)a=i;else{if("string"!=typeof i.name||"string"!=typeof i.message)return;a.name=i.name.substr(0,20),a.message=i.message.substr(0,200)}a.message&&(a.message=n.encode(a.message));var o={type:e.type||"custom",data:a||{},timestamp:e.timestamp||Date.now(),page:e.page||t&&t.location&&t.location.pathname};return r.push(o),r=r.slice(-100)}},getBehavior:function(){return r||[]},setBehavior:function(e){return e&&(r=e),r},reportBehavior:function(e){var t=this;t.getConfig("behavior")&&(t.$am&&(clearTimeout(t.$am),t.$am=undefined),t.$am=setTimeout(function(){r&&r.length>0&&(t.behavior(r),r=[],t.$am=undefined,e&&"function"==typeof e&&e())},0))},$an:function(){if(!this.hasInitBehavior&&!a){try{!function(){if(document&&document.referrer&&document.location){var e=document.referrer,t=document.location.href;if(""!==e){var r={type:"navigation",data:{from:e,to:t}};i=t,a&&a.addBehavior(r)}}}(),t&&t.document&&t.document.addEventListener&&(t.document.addEventListener("click",l("click"),!1),t.document.addEventListener("keypress",l("keypress"),!1)),p();var e=this.getConfig("enableConsole");e&&function(e){if(t&&t.console){var r=["debug","info","warn","log","error","assert"];n.isArray(e)&&(r=e);for(var i=0;i<r.length;i++){var o=r[i];o&&n.isString(o)&&t.console[o]&&"function"==typeof t.console[o]&&u(t.console,o,function(e){var r=o;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var s={type:"console",data:{level:r,message:i}};if(a&&a.addBehavior(s),"error"===r)for(var c=0;c<i.length;c++){var u=i[c];u&&u.message&&u.stack&&a&&a.errorHandler(new ErrorEvent("error",{error:u,message:u.message}))}e&&Function.prototype.apply.call(e,t.console,i)}})}}}(e)}catch(r){n.warn("[arms] error in initBehavior",r)}a=this,this.hasInitBehavior=!0}return this}})}},{"../util":17}],3:[function(e,t,r){var n=e("../util"),a=e("../reporter"),i=e("../common/sender"),o=e("../common/post"),s=n.win,c=s.document,u=/^(error|api|speed|sum|avg|percent|custom|msg|setPage|setConfig|behavior|performance)$/,f=function(e){var t=this;return a.call(t,e),t._initialPage=e.page&&n.$a9(e.page,[],e.page+"")||null,t._isRobot=n.isRobot(),t._health={errcount:0,apisucc:0,apifail:0},t.$ao=function(e,r){"error"===e?t._health.errcount++:"api"===e&&t._health[r.success?"apisucc":"apifail"]++},!1!==e.enableInstanceAutoSend&&(t.$ap(),t.$aq(),t.$ar(1e4),t._conf&&t._conf.behavior&&"function"==typeof t.$an&&t.$an(),t._conf&&t._conf.enableResource&&"function"==typeof t.$as&&t.$as()),Object.defineProperty&&s.addEventListener&&Object.defineProperty(t,"pipe",{set:t.$at}),t};f.prototype=n.$au(a.prototype),n.ext(a._root.dftCon,{uid:null,setUsername:null,ignoreUrlPath:null,ignoreApiPath:null,urlHelper:[{rule:/\/([a-z\-_]+)?\d{2,20}/g,target:"/$1**"},/\/$/],resourceHelper:[],apiHelper:{rule:/\/([a-z\-_]+)?\d{2,20}/g,target:"/$1**"},ignoreUrlCase:!0,imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",cdnHostList:[],resourceTypes:["css","script","img","font"],resourceSlow:2e3,disableHook:!1,autoSendPv:!0,autoSendPerf:!0,enableSPA:!1,enableLinkTrace:!1,linkType:"arms",enableApiCors:!1,sendResource:!0,behavior:!0,enableConsole:!1,parseHash:function(e){return(e?n.$aw(e.replace(/^#\/?/,"")):"")||"[index]"},parseResponse:function(e){if(!e||"object"!=typeof e)return{};var t=e.code,r=e.msg||e.message||e.subMsg||e.errorMsg||e.ret||e.errorResponse||"";return"object"==typeof r&&(t=t||r.code,r=r.msg||r.message||r.info||r.ret||JSON.stringify(r)),{msg:r,code:t,success:!0}}}),n.ext(f.prototype,{constructor:f,_super:a,$a2:function(e){var t=this;if(t.hasReady)return e();"complete"===c.readyState?(t.hasReady=!0,e()):n.on(s,"load",function(){t.hasReady=!0,e()},!0)},$a8:function(e){var t=this._conf,r=t.page,a=location,i=a.host+a.pathname;return r&&!e?n.$a9(r,[],r+""):this._initialPage||n.$av(t.ignoreUrlCase?i.toLowerCase():i,a.href,t.ignoreUrlPath?t.ignoreUrlPath:t.urlHelper)},setPage:function(e,t){var r=this,n=r.$ax;if(!1!==t){if(!e||e===n)return r;r.$ax=e,clearTimeout(r.$ay),r.$az(1),r.$a7(),r.$ay=setTimeout(function(){r.$b0()},10)}else r.$ax=e;return r._conf.page=e,r},setConfig:function(e,t){if(e&&"object"==typeof e){n.$aa(e),e=this.$ab(e);var r=this._conf;if(this._conf=n.ext({},r,e),!t){var a="disableHook";a in e&&r[a]!==e[a]&&(e[a]?this.removeHook():this.addHook()),(a="enableSPA")in e&&r[a]!==e[a]&&this.$b1(e[a])}}},$ad:function(e){i(e,this.getConfig("imgUrl"))},$af:function(e,t){var r={};r[t]=e[t],delete e[t];var a="";"object"==typeof e&&(a=n.serialize(e)),o(r,this.getConfig("imgUrl")+a+"&post_res=")},$at:function(e){var t=this;if(!e||!e.length)return t;try{if("Array"===n.T(e[0]))return n.each(e,function(e){return t.$at(e)});if("Array"!==n.T(e))return t;var r=e.shift();if(!u.test(r))return t;t[r].apply(t,e)}catch(a){return n.warn("[retcode] error in sendPipe",a),t}},$b2:function(){var e=n.ext({},this._health);e.healthy=e.errcount>0?0:1,e.begin=Date.now();var t=e.begin-this.sBegin;e.stay=t,this._lg("health",e,1),this._health={errcount:0,apisucc:0,apifail:0}},createInstance:function(e){e=n.ext({pid:this._conf.pid},e);var t=this.__proto__.constructor(e);return e.page&&t.$b0(),t}}),e("./behavior")(f,s),e("./handler")(f,s,c),e("./fmp")(f,s,c),e("./hook")(f,s),e("./hack")(f,s),e("./resource")(f,s),f._super=a,f._root=a._root,a.Browser=f,t.exports=f},{"../common/post":11,"../common/sender":14,"../reporter":16,"../util":17,"./behavior":2,"./fmp":4,"./hack":5,"./handler":6,"./hook":7,"./resource":8}],4:[function(e,t,r){var n=e("../util"),a=500;t.exports=function(e,t,r){function i(e,t,r){var n=0,a=e.tagName;if("SCRIPT"!==a&&"STYLE"!==a&&"META"!==a&&"HEAD"!==a){var o=e.children?e.children.length:0;if(o>0)for(var c=e.children,u=o-1;u>=0;u--)n+=i(c[u],t+1,n>0);if(n<=0&&!r){if(!(e.getBoundingClientRect&&e.getBoundingClientRect().top<s))return 0}n+=1+.5*t}return n}function o(e){for(var t=1;t<e.length;t++)if(e[t].score<e[t-1].score)return e.splice(t,1),o(e);return e}var s=t.innerHeight||0,c=[],u=null,f=0;n.ext(e.prototype,{$ar:function(e){var a=this;if(!a._conf||!a._conf.useFmp)return null;if(!t.MutationObserver)return n.warn("[retcode] first meaningful paint can not be retrieved"),a.$b3(),null;n.on(t,"beforeunload",function(){a.$b4(0,!0)});var o=t.MutationObserver;return(u=new o(function(){!function(e){var t=Date.now()-e,n=r.querySelector("body");if(n){var a=0;a+=i(n,1,!1),c.push({score:a,t:t})}else c.push({score:0,t:t})}(a._startTime)})).observe(document,{childList:!0,subtree:!0}),f=1,a.$a2(function(){a.$b4(e)}),u},$b4:function(e,t){var r=this;if(u&&f)if(r.$b5&&(clearTimeout(r.$b5),r.$b5=null),t||!function(e,t){var r=Date.now()-e;return!(r>t||r-(c&&c.length&&c[c.length-1].t||0)>2*a)}(r._startTime,e)){u.disconnect(),f=0,c=o(c);for(var i=null,s=1;s<c.length;s++)if(c[s].t>=c[s-1].t){var l=c[s].score-c[s-1].score;(!i||i.rate<=l)&&(i={t:c[s].t,rate:l})}i&&i.t>0&&i.t<36e5?r.$b3({fmp:i.t}):r.$b3()}else r.$b5=n.delay(function(){r.$b4(e)},a)}})}},{"../util":17}],5:[function(e,t,r){t.exports=function(t,r){var n=e("../util"),a=r.history||{},i=r.document,o=function(e,t){var n;r.CustomEvent?n=new CustomEvent(e,{detail:t}):((n=i.createEvent("HTMLEvents")).initEvent(e,!1,!0),n.detail=t),r.dispatchEvent(n)},s=function(e){var t=a[e];"function"==typeof t&&(a[e]=function(r,i,s){var c=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),u=location.href,f=t.apply(a,c);if(!s||"string"!=typeof s)return f;if(s===u)return f;try{var l=u.split("#"),p=s.split("#"),d=n.$aw(l[0]),g=n.$aw(p[0]),h=l[1]&&l[1].replace(/^\/?(.*)/,"$1"),m=p[1]&&p[1].replace(/^\/?(.*)/,"$1");h!==m?o("historystatechange",m):d!==g&&o("historystatechange",g)}catch(v){n.warn("[retcode] error in "+e+": "+v)}return f},a[e].toString=n.$b6(e))};n.ext(t.prototype,{$b7:function(){return this.$b8?this:(s("pushState"),s("replaceState"),this.$b8=!0,this)}})}},{"../util":17}],6:[function(e,t,r){t.exports=function(t,r,n){var a=e("../util"),i=e("../common/res"),o=e("../common/perf"),s=null,c=n.documentElement,u=r.innerWidth||c.clientWidth||n.body.clientWidth,f=r.innerHeight||c.clientHeight||n.body.clientHeight,l=r.navigator.connection,p={sr:screen.width+"x"+screen.height,vp:u+"x"+f,ct:l?l.effectiveType||l.type:""},d={},g=function(e,t,r,i,o){if(t===undefined){var s,c;if(!d[e]){s=new RegExp(e+"=([^;]+)");try{c=s.exec(n.cookie)}catch(f){return a.warn("[retcode] can not get cookie:",f),null}c&&(d[e]=c[1])}return d[e]}var u=e+"="+t;i&&(u+="; domain="+i),u+="; path="+(o||"/"),r&&(u+="; max-age="+r);try{return n.cookie=u,!!n.cookie}catch(f){return a.warn("[retcode] can not set cookie: ",f),!1}},h=function(e){var t=e._conf.uid||g("_nk_")||g("_bl_uid");if(!t){t=a.uu();if(!g("_bl_uid",t,15552e3))return null}return t};return a.ext(t.prototype,{activeErrHandler:function(e){return s&&!e?this:(s=this,this)},errorHandler:function(e){if(!e)return this;var t=e.type;if("error"===t){var r=e.target||e.srcElement;!(!r||!r.tagName||e.message||e.filename||e.lineno||e.colno)?this.$b9(e):this.error(e.error||{message:e.message},e)}else"unhandledrejection"===t&&a.T(e.reason,"Error")&&a.$ba(e.reason)&&this.error(e.reason);try{this.getConfig("behavior")&&this.reportBehavior&&this.reportBehavior()}catch(e){}return this},$b9:function(e){var t=this,r=e.target||e.srcElement;try{var n=t.$bb(r),i="string"==typeof r.tagName?r.tagName.toLowerCase():"",o=t.$bc(r,5),s=a.getURL(n),c={src:n&&n.substring(0,1e3),node_name:i,xpath:o,res_type:a.getResType(i,n),res_name:s.path,domain:s.domain};return t._conf.enableResource&&t.fixResourceStatus&&e.timeStamp&&t.fixResourceStatus({src:n,node_name:i,res_type:a.getResType(i,n),timeStamp:e.timeStamp,domain:s.domain}),t._lg("resourceError",c),t}catch(u){return a.warn("[ARMS] $b9 error :",u),t}},$bb:function(e){var t=e.src||e.href;try{if(!t){var r="object"===("string"==typeof e.tagName?e.tagName.toLowerCase():""),n=e.getAttribute("classid")&&"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"===e.getAttribute("classid").toLowerCase()||"application/x-shockwave-flash"===e.getAttribute("type");r&&n&&(t=e.getAttribute("data")||e.getAttribute("codebase")),t||(t=e.outerHTML||e.innerHTML)}}catch(a){t=""}return t},$bc:function(e,t){var r=e.id?"#"+e.id:"",n="string"==typeof e.className?"."+e.className.split(" ").join("."):"",a=("string"==typeof e.tagName?e.tagName.toLowerCase():"")+r+n;return e.parentNode&&e.parentNode.tagName&&t-1!=0?this.$bc(e.parentNode,t-1)+" > "+a:a},$b3:function(e){var t=this;t.$a2(function(){var r=o();r&&r.load&&r.load>0&&(r.page=t.$a8(!0),e&&(r=a.ext(r,e)),r.autoSend=!0,t.performance(r))})},$bd:function(e){var t=this;t.$a2(function(){var r=i();r&&r.load&&r.load>0&&(r.load&&r.load<=2e3||r.load&&r.load<=8e3&&Math.random()>.05||(r.page=t.$a8(!0),r.dl=location.href,e&&(r=a.ext(r,e)),t._lg("res",r,t.getConfig("sample"))))})},$b0:function(){var e=this;e.$a2(function(){var t=function(e){var t=h(e),a=r.devicePixelRatio||1;return{uid:t,dt:n.title,dl:location.href,dr:n.referrer,dpr:a.toFixed(2),de:(n.characterSet||n.defaultCharset||"").toLowerCase(),ul:c.lang,begin:Date.now()}}(e);t&&t.uid&&e._lg("pv",t,e.getConfig("pvSample"))})},$ag:function(){return p.uid=h(this),p.sid=function(e){if(e.session)return e.session;var t;try{if("object"==typeof window&&"object"==typeof sessionStorage&&"function"==typeof sessionStorage.getItem)return"string"==typeof(t=sessionStorage.getItem("_bl_sid"))?(e.session=t,t):(t=a.uu(),e.session=t,"function"==typeof sessionStorage.setItem&&sessionStorage.setItem("_bl_sid",t),t)}catch(r){a.warn("[ARMS] getSid error :",r)}return e.session=t=a.uu(),t}(this),p},$az:function(e){var t=Date.now();if(t-this._lastUnload<200)return this;this._lastUnload=t,this.$b2(e),this.$be&&(this._lg("speed",this.$be),this.$be=null,clearTimeout(this.$bf)),this._conf&&this._conf.enableResource&&this.$bg(),this.$a4(!0)},$b1:function(e){var t=this;if(!e^t.$bh)return t;e?(t.$b7(),t.$bh=function(e){var r=t._conf.parseHash(location.hash);r&&t.setPage(r,!1!==e)},t.$bi=function(e){var r=t._conf.parseHash(e.detail);r&&t.setPage(r)},a.on(r,"hashchange",t.$bh),a.on(r,"historystatechange",t.$bi),t.$bh(!1)):(a.off(r,"hashchange",t.$bh),a.off(r,"historystatechange",t.$bi),t.$bh=null,t.$bi=null)},$ap:function(){var e=this;if(e.$bj)return e;var t=e._conf;return a.on(r,"beforeunload",function(){e.$az(0)}),e.$b1(t.enableSPA),e.activeErrHandler(!1),e.$bj=!0,e}}),a.on(r,"error",function(e){s&&s.errorHandler(e)},!1,!0).on(r,"unhandledrejection",function(e){s&&s.errorHandler(e)}),t}},{"../common/perf":10,"../common/res":12,"../util":17}],7:[function(e,t,r){t.exports=function(t,r){var n=e("../util"),a=null,i=n.getCurDomain(),o=function(e,t,r,a,o,s,c,u,f,l,p,d,g){var h=n.J(o)||null,m=n.$a9(t,[h,a],null);if(!m)return!1;var v=m.code||s,y=!("success"in m)||m.success;e.api(r,y,c,v,m.msg,u,f,l,y?{}:p,i,d,g)},s="fetch",c="__oFetch_",u="__oXMLHttpRequest_",f="XMLHttpRequest";return n.ext(t.prototype,{removeHook:function(e,t){return a&&(t||this===a)?(r[c]&&(r[s]=r[c],delete r[c]),r[u]&&(r[f]=r[u],delete r[u]),a=null,this):this},addHook:function(e){return!e&&a?this:(a||(function(){if("function"==typeof r[s]){var e=r[s];r[c]=e,r[s]=function(t,s){var c=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),u=a;if(!u||!u.api)return e.apply(r,c);if(s&&("HEAD"===s.method||"no-cors"===s.mode))return e.apply(r,c);s||(s={});var f=Date.now(),l=u._conf,p=n.duration(),d=(t&&"string"!=typeof t?t.url:t)||"",g=d;d=n.$aw(d);var h=(l.ignore||{}).ignoreApis,m=l.parseTraceId;if(!n.$bk(d,!0)||n.$al(d,h))return e.apply(r,c);d=n.$av(d,g,l.ignoreApiPath?l.ignoreApiPath:l.apiHelper);var v=l.enableLinkTrace,y="",b="",$=u.getConfig("pid"),w=null,_=u.getConfig("sample"),S=u.getConfig("linkType"),E=1;if(_&&!u.$ai(_)&&(E=0),v){var x="";try{x=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(A){x=""}var T=n.checkSameOrigin(g,x);if(u.getConfig("enableApiCors")||T)if(t&&"string"!=typeof t)try{if(c[0].headers&&"function"==typeof c[0].headers.get&&"function"==typeof c[0].headers.append)switch(S){case"arms":var I=c[0].headers.get("EagleEye-TraceID"),k=c[0].headers.get("EagleEye-SessionID"),R=c[0].headers.get("EagleEye-pAppName");I?y=I:(y=u.getTraceId()["EagleEye-TraceID"],c[0].headers.append("EagleEye-TraceID",y)),k?b=k:(b=u.getPageviewId()["EagleEye-SessionID"],c[0].headers.append("EagleEye-SessionID",b)),R||c[0].headers.append("EagleEye-pAppName",$);break;case"b3":var j=c[0].headers.get("X-B3-TraceId");if(j)y=j;else{var D=u.getB3TraceId(E);c[0].headers.append("X-B3-TraceId",D["X-B3-TraceId"]),c[0].headers.append("X-B3-ParentSpanId",D["X-B3-ParentSpanId"]),c[0].headers.append("X-B3-SpanId",D["X-B3-SpanId"]),c[0].headers.append("X-B3-Sampled",D["X-B3-Sampled"]),c[0].headers.append("X-Request-ID",n.guid()),y=D["X-B3-TraceId"]}b=u.pageview;break;case"tracing":default:var B=c[0].headers.get("uber-trace-id");B?y=B.split(":")[0]:(B=u.getUberTraceId(E),c[0].headers.append("uber-trace-id",B["uber-trace-id"]),y=B.traceId),b=u.pageview}}catch(N){n.warn("[retcode] fetch failed to set header, exception is :\n"+N)}else switch(s.headers=s.headers?s.headers:{},S){case"arms":s.headers["EagleEye-TraceID"]?y=s.headers["EagleEye-TraceID"]:(y=u.getTraceId()["EagleEye-TraceID"],s.headers["EagleEye-TraceID"]=y),s.headers["EagleEye-SessionID"]?b=s.headers["EagleEye-SessionID"]:(b=u.getPageviewId()["EagleEye-SessionID"],s.headers["EagleEye-SessionID"]=b),s.headers["EagleEye-pAppName"]||(s.headers["EagleEye-pAppName"]=$);break;case"b3":if(s.headers["X-B3-TraceId"])y=s.headers["X-B3-TraceId"];else{var C=u.getB3TraceId(E);s.headers["X-B3-TraceId"]=C["X-B3-TraceId"],s.headers["X-B3-ParentSpanId"]=C["X-B3-ParentSpanId"],s.headers["X-B3-SpanId"]=C["X-B3-SpanId"],s.headers["X-B3-Sampled"]=C["X-B3-Sampled"],s.headers["X-Request-ID"]=n.guid(),y=C["X-B3-TraceId"]}b=u.getPageviewId()["EagleEye-SessionID"];break;case"tracing":default:if(s.headers["uber-trace-id"])y=s.headers["uber-trace-id"].split(":")[0];else{var O=u.getUberTraceId(E);s.headers["uber-trace-id"]=O["uber-trace-id"],y=O.traceId}b=u.getPageviewId()["EagleEye-SessionID"]}}return e.apply(r,c).then(function(e){if(!u||!u.api)return e;try{if(!e||"function"!=typeof e.clone)return e;var t=e.clone(),r=t.headers;if(r&&"function"==typeof r.get){var s=r.get("content-type");if(s&&!/(text)|(json)/.test(s))return e;if(!y){var h=n.parseFetchHeaders(r);"object"==typeof h&&h["eagleeye-traceid"]&&(y=h["eagleeye-traceid"],w="response")}}var v=p();return t.text().then(function(e){if(!y&&n.isFunction(m)){var s=m(t,e);s&&n.isString(s)&&(y=s)}var p=n.getFetchSnapshot(c,e,r);t.ok?o(u,l.parseResponse,d,g,e,t.status||200,v,f,y,b,p,w,E):(u.api(d,!1,v,t.status||404,t.statusText,f,y,b,p,i,w,E),l.enableResource&&a.fixResourceStatus&&a.fixResourceStatus({src:t.url,res_type:"api"}))}),e}catch(A){return n.warn("[ARMS] fetch response error :",A),e}})["catch"](function(e){if(!u||!u.api)throw e;var t=p();throw u.api(d,!1,t,e.name||"Error",e.message,f,y,b,{},i),l.enableResource&&a.fixResourceStatus&&a.fixResourceStatus({src:g,res_type:"api"}),e})},r[s].toString=n.$b6(s)}}(),function(){if("function"==typeof r[f]){var e,t=r[f];r[u]=t;var s=function(r){var s=new t(r),c=a;if(!c||!c.api||!s.addEventListener)return s;var u,f,l,p,d=s.send,g=s.open,h=s.setRequestHeader,m=c._conf,v=(m.ignore||{}).ignoreApis,y=m.parseTraceId,b=c.getConfig("enableLinkTrace"),$="",w="",_="",S=null,E=c.getConfig("sample"),x=c.getConfig("linkType"),T=1;return E&&!c.$ai(E)&&(T=0),s.open=function(t,r){e=t;var a=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);g.apply(s,a),p=r||"",l=n.$aw(p);var i=!n.$bk(l,!0)||n.$al(l,v);if(l=l?n.$av(l,p,m.ignoreApiPath?m.ignoreApiPath:m.apiHelper):"",!i&&b){var o="";try{o=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(y){o=""}var u=n.checkSameOrigin(p,o);if((c.getConfig("enableApiCors")||u)&&h&&"function"==typeof h)switch(x){case"arms":$=c.getTraceId()["EagleEye-TraceID"],h.apply(s,["EagleEye-TraceID",$]),w=c.getPageviewId()["EagleEye-SessionID"],h.apply(s,["EagleEye-SessionID",w]),_=c.getConfig("pid"),h.apply(s,["EagleEye-pAppName",_]);break;case"b3":var f=c.getB3TraceId(T);h.apply(s,["X-B3-TraceId",f["X-B3-TraceId"]]),h.apply(s,["X-B3-ParentSpanId",f["X-B3-ParentSpanId"]]),h.apply(s,["X-B3-SpanId",f["X-B3-SpanId"]]),h.apply(s,["X-B3-Sampled",f["X-B3-Sampled"]]),h.apply(s,["X-Request-ID",n.guid()]),$=f["X-B3-TraceId"],w=c.getPageviewId()["EagleEye-SessionID"];break;case"tracing":default:var d=c.getUberTraceId(T);h.apply(s,["uber-trace-id",d["uber-trace-id"]]),$=d.traceId,w=c.getPageviewId()["EagleEye-SessionID"]}}},s.send=function(){u=Date.now(),f=n.duration();var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);d.apply(s,e)},n.on(s,"readystatechange",function(){if(l&&4===s.readyState){var t=f(),r=n.getXhrSnapshot(p,e,s);if(!$){var d=n.parseXhrHeaders("function"==typeof s.getAllResponseHeaders&&s.getAllResponseHeaders()||"");"object"==typeof d&&d["eagleeye-traceid"]&&($=d["eagleeye-traceid"],S="response")}if(!$&&n.isFunction(y)){var g=y(s);g&&n.isString(g)&&($=g)}if(s.status>=200&&s.status<=299){var h=s.status||200;if("function"==typeof s.getResponseHeader){var v=s.getResponseHeader("Content-Type");if(v&&!/(text)|(json)/.test(v))return}s.responseType&&"text"!==s.responseType?c.api(l,!0,t,h,"",u,$,w,{},i,S,T):o(c,m.parseResponse,l,p,s.responseText,h,t,u,$,w,r,S,T)}else c.api(l,!1,t,s.status||"FAILED",s.statusText,u,$,w,r,i,S,T),m.enableResource&&a.fixResourceStatus&&a.fixResourceStatus({src:s.responseURL||p,res_type:"api"})}}),s};s.prototype=t.prototype,n.each(Object.keys(t),function(e){s[e]=t[e]}),r[f]=s,r[f].toString=n.$b6(f)}}()),a=this,this)},$aq:function(){return this.$bl?this:(this.getConfig("disableHook")||this.addHook(),this.$bl=!0,this)}}),t}},{"../util":17}],8:[function(e,t,r){var n=e("../util"),a=e("../common/constants").TIMING_KEYS;t.exports=function(e,t){function r(e,r,i){if(e instanceof t.PerformanceResourceTiming&&e.initiatorType){var o=n.getResType(e.initiatorType,e.name),s=r.resourceTypes||[],c=(r.ignore||{}).ignoreResources;if(o&&s.includes(o)&&!n.$al(e.name,c)&&!n.$al(n.decode(e.name),c)){var u=e[a[0]],f=e[a[1]],l=e[a[2]],p=e[a[3]],d=e[a[4]],g=e[a[5]],h=e[a[6]],m=e[a[7]],v=e[a[8]],y=e[a[18]],b=e[a[19]];if(!i.has(e)){if(!n.areInOrder(u,f,l,p,d,g,h,m,v))return;if(u>m)return}if(y<u&&(y=u),b<u&&(b=f),n.areInOrder(u,y,b,f)){return{domain:n.getURL(e.name).domain,res_type:o,src_type:n.getSrcType(e.name,r.cdnHostList),success:1,size:Math.round(e.decodedBodySize),duration:Math.round(e.duration),timeStamp:e.responseEnd,timing:e}}}}}var i="_resource-"+Date.now(),o="_resource_error-"+Date.now();n.ext(e.prototype,{$as:function(){var e=this,r=t.performance,n=t.PerformanceObserver;if(e[o]||(e[o]=new WeakMap),!r||!n||"object"!=typeof r||"function"!=typeof r.getEntriesByType)return null;var a=r.getEntriesByType("resource")||[];setTimeout(function(){e.setResource(a)},10);return new n(function(t){setTimeout(function(){e.setResource(t.getEntries())},10)}).observe({entryTypes:["resource"]}),this.$a2(function(){setTimeout(e.$bg.bind(e),5e3)}),e},setResource:function(e){var t=this._conf,a=this[o];if(n.isArray(e)&&e.length){this[i]||(this[i]={});for(var s=this[i],c=0,u=e.length;c<u;c+=1){var f=e[c];if(n.$bk(f.name,!1)){var l=r(f,t,a);if(l){var p=l.res_type+"-"+l.domain;p in s||(s[p]=[]),s[p].push(l)}}}return this}},fixResourceStatus:function(e){var r=t.performance;if(!r||"function"!=typeof r.getEntriesByName)return null;var a=this[o];if(!e.src||!n.$bk(e.src,!1))return this;var i=e.timeStamp||r.now(),s=r.getEntriesByName(e.src,"resource");return n.each(s,function(e){if(!a.has(e)){i-e.responseEnd<100&&a.set(e,{success:0})}}),this},$bg:function(){var e=this[i]||{},r=this._conf.resourceSlow||2e3,a=this[o];this[i]={};var s=Object.keys(e);if(0!==s.length){var c=[];n.each(s,function(t){var i=e[t],o={domain:"",res_type:"",src_type:"",size:0,duration:0,count:0,err_count:0,err_duration:0,slow_count:0,slow_duration:0,timings:[]};n.each(i,function(e){var t=e.timing||{},n=a.get(e.timing),i=n?n.success:1,s=e.duration>r?1:0;o.domain=e.domain,o.res_type=e.res_type,o.src_type=e.src_type,o.count+=1,o.duration+=e.duration,o.size+=e.size,i||(o.err_count+=1,o.err_duration+=e.duration),s&&(o.slow_count+=1,o.slow_duration+=e.duration);try{var c=JSON.parse(JSON.stringify(t));c.success=i,c.resourceSlow=r,c.isSlow=s,o.timings.push(c)}catch(u){}}),o.count&&(o.size=Math.round(o.size/o.count),o.duration=Math.round(o.duration/o.count)),o.slow_count&&(o.slow_duration=Math.round(o.slow_duration/o.slow_count)),o.err_count&&(o.err_duration=Math.round(o.err_duration/o.err_count)),o.timings.length>20&&(o.timings.sort(function(e,t){return t.duration-e.duration}),o.timings.length=20),o.timings=encodeURIComponent(JSON.stringify(o.timings)),c.push(o)});var u={_combo:1,resource:JSON.stringify(c)},f=t.navigator.connection;u.ct=f?f.effectiveType||f.type:"";var l=f?f.downlink||f.downlinkMax||f.bandwidth||null:null;(l=l>999?999:l)&&(u.bandwidth=l),this._lg("resource",u,this.getConfig("sample"))}}})}},{"../common/constants":9,"../util":17}],9:[function(e,t,r){r.TIMING_KEYS=["startTime","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","requestStart","responseStart","responseEnd","","domInteractive","","domContentLoadedEventEnd","","loadEventStart","","msFirstPaint","secureConnectionStart","redirectStart","redirectEnd"]},{}],10:[function(e,t,r){var n=e("../util"),a=e("./constants").TIMING_KEYS;t.exports=function(){var e=n.win||{},t=e.performance;if(!t||"object"!=typeof t)return null;var r={},i=t.timing||{},o=Date.now(),s=1;if("function"==typeof e.PerformanceNavigationTiming){var c=t.getEntriesByType("navigation")[0];c&&(i=c,s=2)}n.each({dns:[3,2],tcp:[5,4],ssl:[5,17],ttfb:[7,6],trans:[8,7],dom:[10,8],res:[14,12],firstbyte:[7,2],fpt:[8,1],tti:[10,1],ready:[12,1],load:[14,1]},function(e,t){var n=i[a[e[1]]],o=i[a[e[0]]];if(2===s||n>0&&o>0){var c=Math.round(o-n);c>=0&&c<6e5&&(r[t]=c)}});var u=e.navigator.connection,f=t.navigation||{};r.ct=u?u.effectiveType||u.type:"";var l=u?u.downlink||u.downlinkMax||u.bandwidth||null:null;if((l=l>999?999:l)&&(r.bandwidth=l),r.navtype=1===f.type?"Reload":"Other",1===s&&i[a[16]]>0&&i[a[1]]>0){var p=i[a[16]]-i[a[1]];p>=0&&p<36e5&&(r.fpt=p)}return 1===s&&i[a[1]]>0?r.begin=i[a[1]]:2===s&&r.load>0?r.begin=o-r.load:r.begin=o,r}},{"../util":17,"./constants":9}],11:[function(e,t,r){var n=e("../util"),a="object"==typeof window?window:{},i=a.__oXMLHttpRequest_||a.XMLHttpRequest;i="function"==typeof i?i:undefined,t.exports=function(e,t){try{var r=new i;r.open("POST",t,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(e))}catch(a){n.warn("[retcode] Failed to log, exception is :\n"+a)}}},{"../util":17}],12:[function(e,t,r){var n=e("../util"),a=e("./constants").TIMING_KEYS;t.exports=function(){var e=n.win||{},t=e.performance;if(!t||"object"!=typeof t||"function"!=typeof t.getEntriesByType)return null;var r={},i=t.timing||{},o=t.getEntriesByType("resource")||[];if(r.begin=i[a[1]]||Date.now(),"function"==typeof e.PerformanceNavigationTiming){var s=t.getEntriesByType("navigation")[0];s&&(i=s)}return n.each({dom:[10,8],load:[14,1]},function(e,t){var n=i[a[e[1]]],o=i[a[e[0]]];if(n>0&&o>0){var s=Math.round(o-n);s>=0&&s<6e5&&(r[t]=s)}}),r.res=JSON.stringify(o),r}},{"../util":17,"./constants":9}],13:[function(e,t,r){var n=e("../util");t.exports=function(e,t,r){"object"==typeof e&&(e=n.serialize(e));var a=t+e+(r?"&post_res=":"");window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?window.navigator.sendBeacon(a,r||"&post_res="):n.warn("[arms] navigator.sendBeacon not surported")}},{"../util":17}],14:[function(e,t,r){var n=e("../util"),a="object"==typeof window?window:{},i=a.__oFetch_||a.fetch;i="function"==typeof i?i:undefined,t.exports=function(e,t){var r=-1;"object"==typeof e&&(r=e.z,e=n.serialize(e));var o=t+e;if(i)return i(o,{method:"HEAD",mode:"no-cors"})["catch"](n.noop);if(a.document&&a.document.createElement){var s="__request_hold_"+r,c=a[s]=new Image;c.onload=c.onerror=function(){a[s]=undefined},c.src=o,c=null}}},{"../util":17}],15:[function(e,t,r){"use strict";function n(e,t){var r=a[o]=new i(e);r.$at(t);var n=r._conf;return!1!==n.autoSendPv&&r.$b0(),n&&n.useFmp||r.$b3(),n&&n.sendResource&&r.$bd(),a[s]=!0,r}var a=window,i=a.BrowserLogger=e("./biz.browser/clazz"),o=e("./util").key,s="__hasInitBlSdk";i.singleton=function(e,t){return a[s]?a[o]:n(e,t)},i.createExtraInstance=function(e){e&&"object"==typeof e&&!0!==e.enableInstanceAutoSend&&(e.enableInstanceAutoSend=!1);var t=new i(e),r=t._conf;return r.enableInstanceAutoSend&&(!1!==r.autoSendPv&&t.$b0(),r&&r.useFmp||t.$b3(),r&&r.sendResource&&t.$bd()),t};"object"==typeof window&&!!window.navigator&&a[o]&&(i.bl=function(){if(a[s])return a[o];var e={},t=[];return o in a&&(e=a[o].config||{},t=a[o].pipe||[]),n(e,t)}(a.__hasInitBlSdk)),t.exports=i},{"./biz.browser/clazz":3,"./util":17}],16:[function(e,t,r){var n=e("./util"),a=e("./base"),i=["api","success","time","code","msg","trace","traceId","begin","pv_id","sid","seq","domain","flag","apiSnapshot","tag","c1","c2","c3"],o=function(e){var t=(e.key||"default").split("::");return t.length>1?n.ext(e,{group:t[0],key:t[1]}):n.ext(e,{group:"default_group",key:t[0]})},s=function(e){a.call(this,e);var t;try{t="object"==typeof performance?performance.timing.fetchStart:Date.now()}catch(r){t=Date.now()}return this._startTime=t,this};s.prototype=n.$au(a.prototype),n.ext(a.dftCon,{startTime:null}),n.ext(s.prototype,{constructor:s,_super:a,sum:function(e,t,r){try{var a=n.$bm(e,t,1);return this._lg("sum",o(a),r)}catch(i){n.warn("[retcode] can not get parseStatData: "+i)}},avg:function(e,t,r){try{var a=n.$bm(e,t,0);return this._lg("avg",o(a),r)}catch(i){n.warn("[retcode] can not get parseStatData: "+i)}},percent:function(e,t,r,a){try{return this._lg("percent",o({key:e,subkey:t,val:r||0,begin:Date.now()}),a)}catch(i){n.warn("[retcode] can not get parseStatData: "+i)}},msg:function(e,t){if(e&&!(e.length>180))return this.custom({msg:e},t)},error:function(e,t){if(!e)return n.warn("[retcode] invalid param e: "+e),this;1===arguments.length?("string"==typeof e&&(e={message:e},t={}),"object"==typeof e&&(t=e=e.error||e)):("string"==typeof e&&(e={message:e}),"object"!=typeof t&&(t={}));var r=e.name||"CustomError",a=e.message||"",i=e.stack||"";t=t||{};var o="object"==typeof location&&"string"==typeof location.href&&location.href.substring(0,500)||"";if(n.$bn(a,t.filename)){var s=/^Script error\.?$/,c=e.msg||e.message;if(n.$al(c,s)||n.$al(n.decode(c),s))return this;var u={msg:n.selfErrKey,err:{msg_raw:n.encode(e.msg||e.message)}};return this._self("error",u,1)}for(var f={begin:Date.now(),cate:r,msg:a&&a.substring(0,1e3),stack:i&&i.substring(0,1e3),file:n.$bo(t.filename||""),line:t.lineno||"",col:t.colno||"",err:{msg_raw:n.encode(a),stack_raw:n.encode(i)},dl:o},l=["tag","c1","c2","c3"],p=0;p<l.length;p++){var d=l[p];t[d]&&(f[d]=t[d])}var g=(this.getConfig("ignore")||{}).ignoreErrors;return n.$al(f.msg,g)||n.$al(n.decode(f.msg),g)?this:(this.$ao&&this.$ao("error",f),this._lg("error",f,1))},behavior:function(e){if(e){var t="object"==typeof e&&e.behavior?e:{behavior:e};return this.$ao&&this.$ao("behavior",t),this._lg("behavior",t,1)}},api:function(e,t,r,a,o,s,c,u,f,l,p,d,g,h,m,v){if(!e)return n.warn("[retcode] api is null"),this;if(e="string"==typeof e?{api:e,success:t,time:r,code:a,msg:o,begin:s,traceId:c,pv_id:u,apiSnapshot:f,domain:l,flag:d,tag:g,c1:h,c2:m,c3:v}:n.sub(e,i),!n.$bk(e.api,!0))return this;e.code=e.code||"";var y=e.msg||"";if(y="string"==typeof y?y.substring(0,1e3):y,e.msg=y,e.success=e.success?1:0,e.time=+e.time,e.begin=e.begin,e.traceId=e.traceId||"",e.pv_id=e.pv_id||"",e.domain=e.domain||"",e.flag=e.flag,e.dl="object"==typeof location&&"string"==typeof location.href&&location.href.substring(0,500)||"",e.apiSnapshot&&("object"==typeof e.apiSnapshot&&(e.apiSnapshot=JSON.stringify(e.apiSnapshot)),"string"!=typeof e.apiSnapshot&&delete e.apiSnapshot,e.apiSnapshot.length>2e3&&(e.apiSnapshot=e.apiSnapshot.substring(0,2e3))),p&&(e.traceOrigin=p),!e.api||isNaN(e.time))return n.warn("[retcode] invalid time or api"),this;var b=(this.getConfig("ignore")||{}).ignoreApis;return n.$al(e.api,b)||n.$al(n.decode(e.api),b)?this:e.time<0?this:(this.$ao&&this.$ao("api",e),this._lg("api",e,e.success&&this.getConfig("sample"),e.flag))},speed:function(e,t,r){var a=this,i=this.getConfig("startTime")||this._startTime;return/^s(\d|1[0])$/.test(e)?(t="number"!=typeof t?Date.now()-i:t>=i?t-i:t,a.$be=a.$be||{},a.$be[e]=t,a.$be.begin=i,clearTimeout(a.$bf),a.$bf=setTimeout(function(){r||(a.$be.page=a.$a8(!0)),a._lg("speed",a.$be),a.$be=null},5e3),a):(n.warn("[retcode] invalid point: "+e),a)},performance:function(e){if(e&&"object"==typeof e&&!this.$bp){var t={},r={},a=this.getConfig("autoSendPerf");if(e.autoSend&&a)return r=n.ext(this.$bq||{},e),this.$bp=!0,this._lg("perf",r,this.getConfig("sample"));if(e.autoSend&&!a)return delete e.autoSend,this.$bq?(r=n.ext(this.$bq||{},e),this.$bp=!0,this._lg("perf",r,this.getConfig("sample"))):void(this.$bq=e);for(var i in e)(/^t([1-9]|1[0])$/.test(i)||"ctti"===i||"cfpt"===i)&&(t[i]=e[i]);if(!0===e.autoSend||!a&&(a||this.$bq))return!0!==e.autoSend&&!1===a&&this.$bq?(t=n.ext(this.$bq||{},t),this.$bp=!0,this._lg("perf",t,this.getConfig("sample"))):void 0;this.$bq=n.ext(this.$bq||{},t)}},resource:function(e,t){if(!e||!n.isPlainObject(e))return n.warn("[arms] invalid param data: "+e),this;var r=Object.keys(e),a=["begin","dom","load","res","dl"],i=!1;for(var o in a){if(r.indexOf(a[o])<0){i=!0;break}}if(i)return n.warn("[arms] lack param data: "+e),this;var s={begin:e.begin||Date.now(),dom:e.dom||"",load:e.load||"",res:n.isArray(e.res)?JSON.stringify(e.res):JSON.stringify([]),dl:e.dl||""};return this._lg("res",s,t)},event:function(e,t){if("object"==typeof e&&e&&e.key){var r={},n=["key","success","time","c1","c2","c3"];for(var a in e)n.indexOf(a)>-1&&(r[a]=e[a]);r.success=!1===e.success?0:1,this._lg("event",r,t)}}}),s._super=a,s._root=a,a.Reporter=s,t.exports=s},{"./base":1,"./util":17}],17:[function(e,t,r){Date.now=Date.now||function(){return(new Date).getTime()};var n=Date.now(),a=function(){},i={noop:a,warn:function(){var e="object"==typeof console?console.warn:a;try{var t={warn:e};t.warn.call(t)}catch(r){return a}return e}(),key:"__bl",selfErrKey:"ARMS_SDK_ERROR",selfErrPage:"ARMSSDK",win:"object"==typeof window&&window.document?window:undefined,regionMap:{cn:"https://arms-retcode.aliyuncs.com/r.png?",sg:"https://arms-retcode-sg.aliyuncs.com/r.png?",sg_2:"https://retcode-sg-lazada.arms.aliyuncs.com/r.png?",daily:"http://arms-retcode-daily.alibaba.net/r.png?",daily_2:"https://arms-retcode-daily.alibaba.net/r.png?",daily_3:"http://arms-retcode-daily.aliyun.test/r.png?",us:"https://retcode-us-west-1.arms.aliyuncs.com/r.png?",tw:"https://arms-retcode.orientalgame.com.tw/r.png?",tw_sg:"https://arms-retcode-sg.orientalgame.com.tw/r.png?",hz_finance:"https://arms-retcode-hz-finance.aliyuncs.com/r.png?"},defaultImgUrl:"https://arms-retcode.aliyuncs.com/r.png?",$au:function(e){if(Object.create)return Object.create(e);var t=function(){};return t.prototype=e,new t},each:function(e,t){var r=0,n=e.length;if(this.T(e,"Array"))for(;r<n&&!1!==t.call(e[r],e[r],r);r++);else for(r in e)if(!1===t.call(e[r],e[r],r))break;return e},$a9:function(e,t,r){if("function"!=typeof e)return r;try{return e.apply(this,t)}catch(n){return r}},T:function(e,t){var r=Object.prototype.toString.call(e).substring(8).replace("]","");return t?r===t:r},duration:function(){var e=Date;try{performance&&this.T(performance.now,"Function")&&(e=performance)}catch(r){e=Date}var t=e.now();return function(){return Math.round(e.now()-t)}},$av:function(){var e=[].slice.call(arguments),t=e.length;if(t<2)return e[0];var r=e[t-1],n=e[0];if(!n)return"";if(!r)return n;var a=this,i=a.T(r),o=e.slice(0,t-1);return"Function"===i?a.$a9(r,o,n):"Array"===i?(this.each(r,function(e){o[0]=n=a.$av.apply(a,[].concat(o,e))}),n):"Object"===i?n.replace(r.rule,r.target||""):n.replace(r,"")},$al:function(e,t){if(!e||!t)return!1;if((this.isString(t)||t.source||"Function"===this.T(t))&&(t=[t]),!this.isArray(t))return this.warn("[arms] invalid rules of ignore config, (list of) String/RegExp/Funcitons are available"),!1;for(var r,n=[],a=0,i=t.length;a<i;a++)if(r=t[a],this.isString(r))n.push(r.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"));else if(r&&r.source)n.push(r.source);else if(r&&"Function"===this.T(r)&&!0===this.$a9(r,[e],!1))return!0;var o=new RegExp(n.join("|"),"i");return!!(n.length&&o.test&&o.test(e))},J:function(e){if(!e||"string"!=typeof e)return e;var t=null;try{t=JSON.parse(e)}catch(r){}return t},pick:function(e){return 1===e||1===Math.ceil(Math.random()*e)},$aa:function(e){if("sample"in e){var t=e.sample,r=t;t&&/^\d+(\.\d+)?%$/.test(t)&&(r=parseInt(100/parseFloat(t))),0<r&&1>r&&(r=parseInt(1/r)),r>=1&&r<=100?e.sample=r:delete e.sample}return e},on:function(e,t,r,n,a){return e.addEventListener?(a=a||!1,e.addEventListener(t,function i(o){n&&e.removeEventListener(t,i,a),r.call(this,o)},a)):e.attachEvent&&e.attachEvent("on"+t,function o(a){n&&e.detachEvent("on"+t,o),r.call(this,a)}),this},off:function(e,t,r){return r?(e.removeEventListener?e.removeEventListener(t,r):e.detachEvent&&e.detachEvent(t,r),this):this},delay:function(e,t){return-1===t?(e(),null):setTimeout(e,t||0)},ext:function(e){for(var t=1,r=arguments.length;t<r;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},sub:function(e,t){var r={};return this.each(e,function(e,n){-1!==t.indexOf(n)&&(r[n]=e)}),r},uu:function(){for(var e,t,r=20,n=new Array(r),a=Date.now().toString(36).split("");r-- >0;)t=(e=36*Math.random()|0).toString(36),n[r]=e%3?t:t.toUpperCase();for(var i=0;i<8;i++)n.splice(3*i+2,0,a[i]);return n.join("")},guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},seq:function(){return(n++).toString(36)},decode:function(e){try{e=decodeURIComponent(e)}catch(t){}return e},encode:function(e,t){try{e=t?encodeURIComponent(e).replace(/\(/g,"%28").replace(/\)/g,"%29"):encodeURIComponent(e)}catch(r){}return e},serialize:function(e){e=e||{};var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&e[r]!==undefined&&t.push(r+"="+this.encode(e[r],"msg"===r));return t.join("&")},$bk:function(e,t){if(!e||"string"!=typeof e)return!1;var r=/arms-retcode[\w-]*\.aliyuncs/.test(e);return!r&&t&&(r=/(alicdn\.com)|(mmstat\.com)/.test(e)),!r},$ba:function(e){return!(!e||!e.message)&&!/failed[\w\s]+fetch/i.test(e.message)},$aw:function(e){return e&&"string"==typeof e?e.replace(/^(https?:)?\/\//,"").replace(/\?.*$/,""):""},$bo:function(e){return e&&"string"==typeof e?e.replace(/\?.*$/,""):""},$b6:function(e){return function(){return e+"() { [native code] }"}},checkSameOrigin:function(e,t){if(!t||!e)return!1;var r="//"+t.split("/")[2];return e===t||e.slice(0,t.length+1)===t+"/"||e===r||e.slice(0,r.length+1)===r+"/"||!/^(\/\/|http:|https:).*/.test(e)},getRandIP:function(){for(var e=[],t=0;t<4;t++){var r=Math.floor(256*Math.random());e[t]=(r>15?"":"0")+r.toString(16)}return e.join("").replace(/^0/,"1")},getSortNum:function(e){return e?(e+=1)>=1e3&&e<=9999?e:e<1e3?e+1e3:e%1e4+1e3:1e3},getRandNum:function(e){return e&&"string"==typeof e?e.length<5?this.getNum(5):e.substring(e.length-5):this.getNum(5)},getNum:function(e){for(var t=[],r=0;r<e;r++){var n=Math.floor(16*Math.random());t[r]=n.toString(16)}return t.join("")},getCurDomain:function(){return location&&location.hostname||""},getSrcType:function(e,t){var r=location&&location.host||"";if(!r)return"";var n=new URL(e).host;if(n===r)return"self";for(var a=0;a<t.length;a+=1)if(n.includes(t[a]))return"cdn";return"others"},parseFetchHeaders:function(e){if(!e)return{};var t={};try{if("function"==typeof e.keys)for(var r=e.keys(),n=r.next();!n.done;){var a=n.value;t[a]=e.get(a),n=r.next()}else t=e}catch(i){t={}}return t},parseXhrHeaders:function(e){if(!e&&"string"!=typeof e)return{};var t={};try{var r=e.split("\r\n");t=r.reduce(function(e,t){var r=t.split(": ");return e[r[0]]=r[1],e},{})}catch(n){t={}}return t},getQuerys:function(e){if(!e)return"";var t={},r=[],n="",a="";try{var i=[];if(e.indexOf("?")>=0&&(i=e.substring(e.indexOf("?")+1,e.length).split("&")),i.length>0)for(var o in i)n=(r=i[o].split("="))[0],a=r[1],t[n]=a}catch(s){t={}}return t},getURL:function(e){if(!e)return null;var t={},r=e.length,n=e.indexOf("://");if(n<0)return null;t.protocol=e.substring(0,n+1);var a=e.indexOf("#"),i=e.indexOf("?");a<0&&(a=r),i<0&&(i=a),t.search=e.substring(i,a).substring(0,1e3);var o=e.substring(n+3,i),s=o.indexOf("/");return s<0&&(s=o.length),t.domain=o.substring(0,s).split(":")[0],t.path=o.substring(s,o.length).substring(0,1e3),t},getResType:function(e,t){if(["script","img","other"].indexOf(e)>-1)return e;if(["video"].indexOf(e)>-1)return"media";if(["document","iframe"].indexOf(e)>-1)return"doc";var r=t?this.getURL(t):null,n=r&&r.path?r.path.lastIndexOf("."):-1,a=(n>0?r.path.substr(n+1):"").toLowerCase();if(a){if(["eot","woff","woff2","ttf"].indexOf(a)>-1)return"font";if("css"===a)return"css";if("js"===a)return"script"}return["fetch","xmlhttprequest","beacon"].indexOf(e)>-1?"api":"others"},areInOrder:function(){for(var e=1;e<arguments.length;e+=1)if(arguments[e-1]>arguments[e])return!1;return!0},getFetchSnapshot:function(e,t,r){var n,a;try{var i=(e&&"string"!=typeof e[0]?e[0].url:e[0])||"",o=(e&&"string"!=typeof e[0]?e[0]:e[1])||{},s="POST"===o.method.toUpperCase()?o.body:this.getQuerys(i);n={originApi:i,method:o.method||"unknown",params:s,response:t||"",reqHeaders:this.parseFetchHeaders(o.headers||null),resHeaders:this.parseFetchHeaders(r)},a=JSON&&JSON.stringify(n)||"{}"}catch(c){a="{}"}return a},getXhrSnapshot:function(e,t,r){if(!e||!t||!r)return{};var n,a;try{var i="";""===r.responseType||"text"===r.responseType?i=r.responseText:"document"===r.responseType&&(i=r.responseXML),n={originApi:e,method:t,params:this.getQuerys(e),response:i,reqHeaders:{},resHeaders:this.parseXhrHeaders("function"==typeof r.getAllResponseHeaders&&r.getAllResponseHeaders()||"")},a=JSON&&JSON.stringify(n)||"{}"}catch(o){a="{}"}return a},isRobot:function(){var e=["nuhk","googlebot/","googlebot-image","yammybot","openbot","slurp","msnbot","ask jeeves/teoma","ia_archiver","baiduspider","bingbot/","adsbot"];if(!navigator||"string"!=typeof navigator.userAgent)return!1;try{for(var t=navigator.userAgent.toLowerCase(),r=0;r<e.length;r++){var n=e[r];if(t.lastIndexOf(n)>=0)return!0}}catch(a){this.warn("[arms] useragent parse error")}return!1},isFunction:function(e){return"function"==typeof e},isPlainObject:function(e){return"[object Object]"===Object.prototype.toString.call(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},joinRegExp:function(e){for(var t,r=[],n=0,a=e.length;n<a;n++)t=e[n],this.isString(t)?r.push(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):t&&t.source&&r.push(t.source);return new RegExp(r.join("|"),"i")},reWriteMethod:function(e,t,r){if(null!==e){var n=e[t];e[t]=r(n)}},$bn:function(e,t){if(!e&&!t)return!1;if(new RegExp(this.selfErrKey,"i").test(e))return!0;return!!this.$al(t,[/retcode.alicdn.com\/retcode\/bl.js/,/g.alicdn.com\/retcode\/cloud-sdk\/bl.js/,/laz-g-cdn.alicdn.com\/retcode\/cloud-sdk\/bl.js/,/local.taobao.com:8880\/build\/bl/])},$bs:function(e){return{msg:e,message:this.selfErrKey}},$bm:function(e,t,r){var n={};try{n=this.isPlainObject(e)?this.ext({key:e.key||"default",val:e.val||e.value||r},e,{begin:Date.now()}):{key:e||"default",val:t||r,begin:Date.now()}}catch(a){this.warn("[retcode] baseLog error: "+a)}return n}};t.exports=i},{}]},{},[15]);

@@ -5,19 +5,21 @@ var util = require("../util");

var t = [], n = util.reWriteMethod, o = {
consoleBehavior: function() {
consoleBehavior: function(e) {
if (console) {
var e = [ "debug", "info", "warn", "log", "error" ], t = null;
if (Function && (t = Function.prototype.apply || Function.apply), "function" == typeof t) for (var o = this, r = 0; r < e.length; r++) {
var i = e[r];
"function" == typeof console[i] && n(console, i, function(e) {
var n = i;
var t = [ "debug", "info", "warn", "log", "error" ];
util.isArray(e) && (t = e);
var o = null;
if (Function && (o = Function.prototype.apply || Function.apply), "function" == typeof o) for (var r = this, i = 0; i < t.length; i++) {
var a = t[i];
a && util.isString(a) && "function" == typeof console[a] && n(console, a, function(e) {
var t = a;
return function() {
for (var r = arguments.length, i = new Array(r), a = 0; a < r; a++) i[a] = arguments[a];
for (var n = arguments.length, i = new Array(n), a = 0; a < n; a++) i[a] = arguments[a];
var s = {
type: "console",
data: {
level: n,
level: t,
message: i
}
};
o && "function" == typeof o.addBehavior && o.addBehavior(s), "function" == typeof e && t.call(e, console, i);
r && "function" == typeof r.addBehavior && r.addBehavior(s), "function" == typeof e && o.call(e, console, i);
};

@@ -24,0 +26,0 @@ });

@@ -1,2 +0,2 @@

var util = require("./util"), Base = require("./base"), validApiKeys = [ "api", "success", "time", "code", "msg", "trace", "traceId", "begin", "pv_id", "sid", "seq", "domain", "flag" ], parseStatData = function(e) {
var util = require("./util"), Base = require("./base"), validApiKeys = [ "api", "success", "time", "code", "msg", "trace", "traceId", "begin", "pv_id", "sid", "seq", "domain", "flag", "apiSnapshot", "tag", "c1", "c2", "c3" ], parseStatData = function(e) {
var t = (e.key || "default").split("::");

@@ -72,3 +72,3 @@ return t.length > 1 ? util.ext(e, {

if (util.ignoreByRule(o, n) || util.ignoreByRule(util.decode(o), n)) return this;
var u = {
var c = {
msg: util.selfErrKey,

@@ -79,5 +79,5 @@ err: {

};
return this._self("error", u, 1);
return this._self("error", c, 1);
}
for (var c = {
for (var u = {
begin: Date.now(),

@@ -95,9 +95,9 @@ cate: r,

dl: s
}, l = [ "tag", "c1", "c2", "c3" ], p = 0; p < l.length; p++) {
var f = l[p];
t[f] && (c[f] = t[f]);
}, p = [ "tag", "c1", "c2", "c3" ], l = 0; l < p.length; l++) {
var f = p[l];
t[f] && (u[f] = t[f]);
}
var g = (this.getConfig("ignore") || {}).ignoreErrors;
return util.ignoreByRule(c.msg, g) || util.ignoreByRule(util.decode(c.msg), g) ? this : (this.beforeSend && this.beforeSend("error", c),
this._lg("error", c, 1));
return util.ignoreByRule(u.msg, g) || util.ignoreByRule(util.decode(u.msg), g) ? this : (this.beforeSend && this.beforeSend("error", u),
this._lg("error", u, 1));
},

@@ -112,3 +112,3 @@ behavior: function(e) {

},
api: function(e, t, r, i, a, s, n, o, u, c, l, p) {
api: function(e, t, r, i, a, s, n, o, c, u, p, l, f, g, h, d) {
if (!e) return util.warn("[retcode] api is null"), this;

@@ -124,15 +124,21 @@ if (e = "string" == typeof e ? {

pv_id: o,
apiSnapshot: u,
domain: c,
flag: p
apiSnapshot: c,
domain: u,
flag: l,
tag: f,
c1: g,
c2: h,
c3: d
} : util.sub(e, validApiKeys), !util.checkAPI(e.api, !0)) return this;
e.code = e.code || "";
var f = e.msg || "";
if (f = "string" == typeof f ? f.substring(0, 1e3) : f, e.msg = f, e.success = e.success ? 1 : 0,
var m = e.msg || "";
if (m = "string" == typeof m ? m.substring(0, 1e3) : m, e.msg = m, e.success = e.success ? 1 : 0,
e.time = +e.time, e.begin = e.begin, e.traceId = e.traceId || "", e.pv_id = e.pv_id || "",
e.domain = e.domain || "", e.flag = e.flag, e.dl = "object" == typeof location && "string" == typeof location.href && location.href.substring(0, 500) || "",
e.success ? e.apiSnapshot && delete e.apiSnapshot : e.apiSnapshot = u, l && (e.traceOrigin = l),
!e.api || isNaN(e.time)) return util.warn("[retcode] invalid time or api"), this;
var g = (this.getConfig("ignore") || {}).ignoreApis;
return util.ignoreByRule(e.api, g) || util.ignoreByRule(util.decode(e.api), g) ? this : e.time < 0 ? this : (this.beforeSend && this.beforeSend("api", e),
e.apiSnapshot && ("object" == typeof e.apiSnapshot && (e.apiSnapshot = JSON.stringify(e.apiSnapshot)),
"string" != typeof e.apiSnapshot && delete e.apiSnapshot, e.apiSnapshot.length > 2e3 && (e.apiSnapshot = e.apiSnapshot.substring(0, 2e3))),
p && (e.traceOrigin = p), !e.api || isNaN(e.time)) return util.warn("[retcode] invalid time or api"),
this;
var v = (this.getConfig("ignore") || {}).ignoreApis;
return util.ignoreByRule(e.api, v) || util.ignoreByRule(util.decode(e.api), v) ? this : e.time < 0 ? this : (this.beforeSend && this.beforeSend("api", e),
this._lg("api", e, e.success && this.getConfig("sample"), e.flag));

@@ -139,0 +145,0 @@ },

@@ -171,3 +171,3 @@ Date.now = Date.now || function() {

var r = /arms-retcode[\w-]*\.aliyuncs/.test(e);
return !r && t && (r = /(\.png)|(\.gif)|(alicdn\.com)|(mmstat\.com)/.test(e)), !r;
return !r && t && (r = /(alicdn\.com)|(mmstat\.com)/.test(e)), !r;
},

@@ -301,3 +301,3 @@ checkAutoError: function(e) {

resHeaders: this.parseFetchHeaders(r)
}, o = "function" == typeof encodeURIComponent && JSON && encodeURIComponent(JSON.stringify(n)) || "{}";
}, o = JSON && JSON.stringify(n) || "{}";
} catch (c) {

@@ -321,3 +321,3 @@ o = "{}";

resHeaders: this.parseXhrHeaders("function" == typeof r.getAllResponseHeaders && r.getAllResponseHeaders() || "")
}, o = "function" == typeof encodeURIComponent && JSON && encodeURIComponent(JSON.stringify(n)) || "{}";
}, o = JSON && JSON.stringify(n) || "{}";
} catch (a) {

@@ -324,0 +324,0 @@ o = "{}";

{
"name": "@arms/js-sdk",
"version": "1.8.36-beta.7",
"version": "1.8.36-beta.8",
"description": "arms rum javascript sdk",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc