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

alife-logger

Package Overview
Dependencies
Maintainers
4
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alife-logger - npm Package Compare versions

Comparing version 1.8.18 to 1.8.20

.nyc_output/52800eba-a6be-44f9-856b-48c3ff88ca84.json

2

lib/base.js

@@ -21,3 +21,3 @@ var util = require("./util"), sendBeacon = require("./common/sendBeacon"), selfId = "aokcdqn3ly@e629dabd48a9933", pushToQueue = function(e, t) {

}, Base = function(e) {
return this.ver = "1.8.18", this._conf = util.ext({}, Base.dftCon), this.sampleCache = {},
return this.ver = "1.8.20", this._conf = util.ext({}, Base.dftCon), this.sampleCache = {},
this.requestQueue = [], this.selfQueue = [], this.sdkFlag = !0, this.hash = util.seq(),

@@ -24,0 +24,0 @@ this.resetPageview(), this.setConfig(e), this.rip = util.getRandIP(), this.record = 999,

@@ -27,4 +27,4 @@ var util = require("../util"), Reporter = require("../reporter"), webSender = require("../common/sender"), webPost = require("../common/post"), win = util.win, doc = win.document, validFn = /^(error|api|speed|sum|avg|percent|custom|msg|setPage|setConfig|behavior|performance)$/, Browser = function(e) {

apiHelper: {
rule: /(\w+)\/\d{2,}/g,
target: "$1"
rule: /\/([a-z\-_]+)?\d{2,20}/g,
target: "/$1**"
},

@@ -31,0 +31,0 @@ ignoreUrlCase: !0,

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

@@ -21,45 +21,47 @@ return a.ext(e.prototype, {

if (s && ("HEAD" === s.method || "no-cors" === s.mode)) return e.apply(t, p);
var l = Date.now(), g = c._conf, d = (o && "string" != typeof o ? o.url : o) || "", f = d;
if (d = a.cutUrlSearch(d), !a.checkAPI(d, !0)) return e.apply(t, p);
var l = Date.now(), g = c._conf, d = (o && "string" != typeof o ? o.url : o) || "", u = d;
d = a.cutUrlSearch(d);
var f = (g.ignore || {}).ignoreApis;
if (!a.checkAPI(d, !0) || a.ignoreByRule(d, f)) return e.apply(t, p);
d = a.filterByRule(d, g.ignoreApiPath ? g.ignoreApiPath : g.apiHelper);
var u = g.enableLinkTrace, h = "", y = "", E = c.getConfig("pid"), v = null, I = c.getConfig("sample"), D = c.getConfig("linkType"), T = 1;
if (I && !c.sampling(I) && (T = 0), u) {
var h = g.enableLinkTrace, y = "", E = "", v = c.getConfig("pid"), I = null, D = c.getConfig("sample"), T = c.getConfig("linkType"), A = 1;
if (D && !c.sampling(D) && (A = 0), h) {
var S = "";
try {
S = location.origin ? location.origin : location.protocol + "//" + location.hostname + (location.port ? ":" + location.port : "");
} catch (C) {
} catch (R) {
S = "";
}
var b = a.checkSameOrigin(f, S);
var b = a.checkSameOrigin(u, S);
if (c.getConfig("enableApiCors") || b) {
if (o && "string" != typeof o) try {
if (p[0].headers && "function" == typeof p[0].headers.get && "function" == typeof p[0].headers.append) switch (D) {
if (p[0].headers && "function" == typeof p[0].headers.get && "function" == typeof p[0].headers.append) switch (T) {
case "tracing":
var m = p[0].headers.get("uber-trace-id");
m ? h = m.split(":")[0] : (m = c.getUberTraceId(T), p[0].headers.append("uber-trace-id", m["uber-trace-id"]),
h = m.traceId), y = c.pageview;
var k = p[0].headers.get("uber-trace-id");
k ? y = k.split(":")[0] : (k = c.getUberTraceId(A), p[0].headers.append("uber-trace-id", k["uber-trace-id"]),
y = k.traceId), E = c.pageview;
break;
default:
var k = p[0].headers.get("EagleEye-TraceID"), A = p[0].headers.get("EagleEye-SessionID"), w = p[0].headers.get("EagleEye-pAppName");
k ? h = k : (h = c.getTraceId()["EagleEye-TraceID"], p[0].headers.append("EagleEye-TraceID", h)),
A ? y = A : (y = c.getPageviewId()["EagleEye-SessionID"], p[0].headers.append("EagleEye-SessionID", y)),
w || p[0].headers.append("EagleEye-pAppName", E);
var m = p[0].headers.get("EagleEye-TraceID"), w = p[0].headers.get("EagleEye-SessionID"), H = p[0].headers.get("EagleEye-pAppName");
m ? y = m : (y = c.getTraceId()["EagleEye-TraceID"], p[0].headers.append("EagleEye-TraceID", y)),
w ? E = w : (E = c.getPageviewId()["EagleEye-SessionID"], p[0].headers.append("EagleEye-SessionID", E)),
H || p[0].headers.append("EagleEye-pAppName", v);
}
} catch (R) {
a.warn("[retcode] fetch failed to set header, exception is :\n" + R);
} catch (P) {
a.warn("[retcode] fetch failed to set header, exception is :\n" + P);
}
if (s) switch (s.headers = s.headers ? s.headers : {}, D) {
if (s) switch (s.headers = s.headers ? s.headers : {}, T) {
case "tracing":
if (s.headers["uber-trace-id"]) h = s.headers["uber-trace-id"].split(":")[0]; else {
var H = c.getUberTraceId(T);
s.headers["uber-trace-id"] = H["uber-trace-id"], h = H.traceId;
if (s.headers["uber-trace-id"]) y = s.headers["uber-trace-id"].split(":")[0]; else {
var C = c.getUberTraceId(A);
s.headers["uber-trace-id"] = C["uber-trace-id"], y = C.traceId;
}
y = c.getPageviewId()["EagleEye-SessionID"];
E = c.getPageviewId()["EagleEye-SessionID"];
break;
default:
s.headers["EagleEye-TraceID"] ? h = s.headers["EagleEye-TraceID"] : (h = c.getTraceId()["EagleEye-TraceID"],
s.headers["EagleEye-TraceID"] = h), s.headers["EagleEye-SessionID"] ? y = s.headers["EagleEye-SessionID"] : (y = c.getPageviewId()["EagleEye-SessionID"],
s.headers["EagleEye-SessionID"] = y), s.headers["EagleEye-pAppName"] || (s.headers["EagleEye-pAppName"] = E);
s.headers["EagleEye-TraceID"] ? y = s.headers["EagleEye-TraceID"] : (y = c.getTraceId()["EagleEye-TraceID"],
s.headers["EagleEye-TraceID"] = y), s.headers["EagleEye-SessionID"] ? E = s.headers["EagleEye-SessionID"] : (E = c.getPageviewId()["EagleEye-SessionID"],
s.headers["EagleEye-SessionID"] = E), s.headers["EagleEye-pAppName"] || (s.headers["EagleEye-pAppName"] = v);
}

@@ -76,14 +78,14 @@ }

if (o && !/(text)|(json)/.test(o)) return e;
if (!h) {
if (!y) {
var s = a.parseFetchHeaders(r);
"object" == typeof s && s["eagleeye-traceid"] && (h = s["eagleeye-traceid"], v = "response");
"object" == typeof s && s["eagleeye-traceid"] && (y = s["eagleeye-traceid"], I = "response");
}
}
var u = Date.now() - l;
var f = Date.now() - l;
return t.text().then(function(e) {
var o = a.getFetchSnapshot(p, e, r);
t.ok ? i(c, g.parseResponse, d, f, e, t.status || 200, u, l, h, y, o, v, T) : c.api(d, !1, u, t.status || 404, t.statusText, l, h, y, o, n, v, T);
t.ok ? i(c, g.parseResponse, d, u, e, t.status || 200, f, l, y, E, o, I, A) : c.api(d, !1, f, t.status || 404, t.statusText, l, y, E, o, n, I, A);
}), e;
} catch (C) {
return a.warn("[ARMS] fetch response error :", C), e;
} catch (R) {
return a.warn("[ARMS] fetch response error :", R), e;
}

@@ -93,3 +95,3 @@ })["catch"](function(e) {

var t = Date.now() - l;
throw c.api(d, !1, t, e.name || "Error", e.message, l, h, y, {}, n), e;
throw c.api(d, !1, t, e.name || "Error", e.message, l, y, E, {}, n), e;
});

@@ -104,24 +106,26 @@ }, t[o].toString = a.createFakeToString(o);

if (!p || !p.api || !s.addEventListener) return s;
var c, l, g, d = s.send, f = s.open, u = s.setRequestHeader, h = p._conf, y = p.getConfig("enableLinkTrace"), E = "", v = "", I = "", D = null, T = p.getConfig("sample"), S = p.getConfig("linkType"), b = 1;
return T && !p.sampling(T) && (b = 0), s.open = function(t, r) {
var c, l, g, d = s.send, u = s.open, f = s.setRequestHeader, h = p._conf, y = (h.ignore || {}).ignoreApis, E = p.getConfig("enableLinkTrace"), v = "", I = "", D = "", T = null, A = p.getConfig("sample"), S = p.getConfig("linkType"), b = 1;
return A && !p.sampling(A) && (b = 0), s.open = function(t, r) {
e = t;
var n = 1 === arguments.length ? [ arguments[0] ] : Array.apply(null, arguments);
if (f.apply(s, n), g = r || "", l = a.cutUrlSearch(g), l = l ? a.filterByRule(l, h.ignoreApiPath ? h.ignoreApiPath : h.apiHelper) : "",
y) {
var i = "";
u.apply(s, n), g = r || "", l = a.cutUrlSearch(g);
var i = !a.checkAPI(l, !0) || a.ignoreByRule(l, y);
if (l = l ? a.filterByRule(l, h.ignoreApiPath ? h.ignoreApiPath : h.apiHelper) : "",
!i && E) {
var o = "";
try {
i = location.origin ? location.origin : location.protocol + "//" + location.hostname + (location.port ? ":" + location.port : "");
} catch (d) {
i = "";
o = location.origin ? location.origin : location.protocol + "//" + location.hostname + (location.port ? ":" + location.port : "");
} catch (T) {
o = "";
}
var o = a.checkSameOrigin(g, i);
if ((p.getConfig("enableApiCors") || o) && u && "function" == typeof u) switch (S) {
var c = a.checkSameOrigin(g, o);
if ((p.getConfig("enableApiCors") || c) && f && "function" == typeof f) switch (S) {
case "tracing":
var c = p.getUberTraceId(b);
u.apply(s, [ "uber-trace-id", c["uber-trace-id"] ]), E = c.traceId, v = p.getPageviewId()["EagleEye-SessionID"];
var d = p.getUberTraceId(b);
f.apply(s, [ "uber-trace-id", d["uber-trace-id"] ]), v = d.traceId, I = p.getPageviewId()["EagleEye-SessionID"];
break;
default:
E = p.getTraceId()["EagleEye-TraceID"], u.apply(s, [ "EagleEye-TraceID", E ]), v = p.getPageviewId()["EagleEye-SessionID"],
u.apply(s, [ "EagleEye-SessionID", v ]), I = p.getConfig("pid"), u.apply(s, [ "EagleEye-pAppName", I ]);
v = p.getTraceId()["EagleEye-TraceID"], f.apply(s, [ "EagleEye-TraceID", v ]), I = p.getPageviewId()["EagleEye-SessionID"],
f.apply(s, [ "EagleEye-SessionID", I ]), D = p.getConfig("pid"), f.apply(s, [ "EagleEye-pAppName", D ]);
}

@@ -136,5 +140,5 @@ }

var t = Date.now() - c, r = a.getXhrSnapshot(g, e, s);
if (!E) {
if (!v) {
var o = a.parseXhrHeaders("function" == typeof s.getAllResponseHeaders && s.getAllResponseHeaders() || "");
"object" == typeof o && o["eagleeye-traceid"] && (E = o["eagleeye-traceid"], D = "response");
"object" == typeof o && o["eagleeye-traceid"] && (v = o["eagleeye-traceid"], T = "response");
}

@@ -144,7 +148,7 @@ if (s.status >= 200 && s.status <= 299) {

if ("function" == typeof s.getResponseHeader) {
var f = s.getResponseHeader("Content-Type");
if (f && !/(text)|(json)/.test(f)) return;
var u = s.getResponseHeader("Content-Type");
if (u && !/(text)|(json)/.test(u)) return;
}
s.responseType && "text" !== s.responseType ? p.api(l, !0, t, d, "", c, E, v, {}, n, D, b) : i(p, h.parseResponse, l, g, s.responseText, d, t, c, E, v, r, D, b);
} else p.api(l, !1, t, s.status || "FAILED", s.statusText, c, E, v, r, n, D, b);
s.responseType && "text" !== s.responseType ? p.api(l, !0, t, d, "", c, v, I, {}, n, T, b) : i(p, h.parseResponse, l, g, s.responseText, d, t, c, v, I, r, T, b);
} else p.api(l, !1, t, s.status || "FAILED", s.statusText, c, v, I, r, n, T, b);
}

@@ -151,0 +155,0 @@ }), s;

@@ -27,4 +27,4 @@ var util = require("../util"), Reporter = require("../reporter"), webSender = require("../common/sender"), perfModel = require("../common/perf"), env = require("./env"), currHandlerInstance = null, commonInfo = {

apiHelper: {
rule: /(\w+)\/\d{2,}/g,
target: "$1"
rule: /\/([a-z\-_]+)?\d{2,20}/g,
target: "/$1**"
},

@@ -31,0 +31,0 @@ ignoreUrlCase: !0,

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

/** retcode cloud sdk | @version 1.8.18 | @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.18",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\.?$/]},release:undefined,environment:"prod"},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(e){if(this.getConfig("debug"))return!0;var t=n.regionMap,r=!1;for(var a in t)if(t[a]===e){r=!0;break}return!r&&n.warn("[retcode] invalid url: "+e),r},$ad:function(){},$ae:function(e){a(e,this.getConfig("imgUrl"))},$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,20),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",{"uber-trace-id":o+":"+s+":0:"+e,traceId:o}},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();)"res"===t.t?this.$af(t,"res"):"error"===t.t?this.$af(t,"err"):"api"===t.t?this.$af(t,"apiSnapshot"):"behavior"===t.t?this.$af(t,"behavior"):"health"===t.t&&!r&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?this.$ae(t):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._conf,s=this.$a8(),c=i.ignore||{},u=c.ignoreErrors,f=c.ignoreUrls,l=c.ignoreApis;return this._isRobot?this:n.$al(s,f)||n.$al(n.decode(s),f)?this:"error"===e&&(n.$al(t.msg,u)||n.$al(n.decode(t.msg),u))?this:"api"===e&&(n.$al(t.api,l)||n.$al(n.decode(t.api),l))?this:this.$ac(i.imgUrl)&&t&&!i.disabled&&i.pid?0===a?this:(t=n.ext({t:e,times:1,page:s,tag:i.tag||"",release:i.release||"",environment:i.environment,begin:Date.now(),c1:i.c1,c2:i.c2,c3:i.c3},t,this.$ag(),this._common,{pid:i.pid,_v:this.ver,pv_id:this.pageview,username:this.$ah(),sampling:r||1,z:n.seq()}),1===a?o(this,t):r&&!this.$ai(r)?this:o(this,t)):this},_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":12,"./util":16}],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"];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":16}],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()),Object.defineProperty&&s.addEventListener&&Object.defineProperty(t,"pipe",{set:t.$as}),t};f.prototype=n.$at(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**"},/\/$/],apiHelper:{rule:/(\w+)\/\d{2,}/g,target:"$1"},ignoreUrlCase:!0,imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",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.$av(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.$au(t.ignoreUrlCase?i.toLowerCase():i,t.ignoreUrlPath?t.ignoreUrlPath:t.urlHelper)},setPage:function(e,t){var r=this,n=r.$aw;if(!1!==t){if(!e||e===n)return r;r.$aw=e,clearTimeout(r.$ax),r.$ay(1),r.$a7(),r.$ax=setTimeout(function(){r.$az()},10)}else r.$aw=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.$b0(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=")},$as: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.$as(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}},$b1: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.$az(),t}}),e("./behavior")(f,s),e("./handler")(f,s,c),e("./fmp")(f,s,c),e("./hook")(f,s),e("./hack")(f,s),f._super=a,f._root=a._root,a.Browser=f,t.exports=f},{"../common/post":10,"../common/sender":13,"../reporter":15,"../util":16,"./behavior":2,"./fmp":4,"./hack":5,"./handler":6,"./hook":7}],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.$b2(),null;n.on(t,"beforeunload",function(){a.$b3(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.$b3(e)}),u},$b3:function(e,t){var r=this;if(u&&f)if(r.$b4&&(clearTimeout(r.$b4),r.$b4=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.$b2({fmp:i.t}):r.$b2()}else r.$b4=n.delay(function(){r.$b3(e)},a)}})}},{"../util":16}],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("#"),h=n.$av(l[0]),g=n.$av(p[0]),d=l[1]&&l[1].replace(/^\/?(.*)/,"$1"),v=p[1]&&p[1].replace(/^\/?(.*)/,"$1");h!==g?o("historystatechange",g):d!==v&&o("historystatechange",v)}catch(m){n.warn("[retcode] error in "+e+": "+m)}return f},a[e].toString=n.$b5(e))};n.ext(t.prototype,{$b6:function(){return this.$b7?this:(s("pushState"),s("replaceState"),this.$b7=!0,this)}})}},{"../util":16}],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:""},h={},g=function(e,t,r,i,o){if(t===undefined){var s,c;if(!h[e]){s=new RegExp(e+"=([^;]+)");try{c=s.exec(n.cookie)}catch(f){return a.warn("[retcode] can not get cookie:",f),null}c&&(h[e]=c[1])}return h[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}},d=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.$b8(e):this.error(e.error||{message:e.message},e)}else"unhandledrejection"===t&&a.T(e.reason,"Error")&&a.$b9(e.reason)&&this.error(e.reason);try{this.getConfig("behavior")&&this.reportBehavior&&this.reportBehavior()}catch(e){}return this},$b8:function(e){var t=this,r=e.target||e.srcElement;try{var n=t.$ba(r),i="string"==typeof r.tagName?r.tagName.toLowerCase():"",o=t.$bb(r,5);return t._lg("resourceError",{src:n&&n.substring(0,1e3),node_name:i,xpath:o}),t}catch(s){return a.warn("[ARMS] $b8 error :",s),t}},$ba: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},$bb: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.$bb(e.parentNode,t-1)+" > "+a:a},$b2: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))})},$bc: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"))))})},$az:function(){var e=this;e.$a2(function(){var t=function(e){var t=d(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=d(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},$ay:function(e){var t=Date.now();if(t-this._lastUnload<200)return this;this._lastUnload=t,this.$b1(e),this.$bd&&(this._lg("speed",this.$bd),this.$bd=null,clearTimeout(this.$be)),this.$a4(!0)},$b0:function(e){var t=this;if(!e^t.$bf)return t;e?(t.$b6(),t.$bf=function(e){var r=t._conf.parseHash(location.hash);r&&t.setPage(r,!1!==e)},t.$bg=function(e){var r=t._conf.parseHash(e.detail);r&&t.setPage(r)},a.on(r,"hashchange",t.$bf),a.on(r,"historystatechange",t.$bg),t.$bf(!1)):(a.off(r,"hashchange",t.$bf),a.off(r,"historystatechange",t.$bg),t.$bf=null,t.$bg=null)},$ap:function(){var e=this;if(e.$bh)return e;var t=e._conf;return a.on(r,"beforeunload",function(){e.$ay(0)}),e.$b0(t.enableSPA),e.activeErrHandler(!1),e.$bh=!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":9,"../common/res":11,"../util":16}],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,h,g){var d=n.J(o)||null,v=n.$a9(t,[d,a],null);if(!v)return!1;var m=v.code||s,y=!("success"in v)||v.success;e.api(r,y,c,m,v.msg,u,f,l,p,i,h,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);var f=Date.now(),l=u._conf,p=(t&&"string"!=typeof t?t.url:t)||"",h=p;if(p=n.$av(p),!n.$bi(p,!0))return e.apply(r,c);p=n.$au(p,l.ignoreApiPath?l.ignoreApiPath:l.apiHelper);var g=l.enableLinkTrace,d="",v="",m=u.getConfig("pid"),y=null,b=u.getConfig("sample"),$=u.getConfig("linkType"),w=1;if(b&&!u.$ai(b)&&(w=0),g){var _="";try{_=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(C){_=""}var E=n.checkSameOrigin(h,_);if(u.getConfig("enableApiCors")||E){if(t&&"string"!=typeof t)try{if(c[0].headers&&"function"==typeof c[0].headers.get&&"function"==typeof c[0].headers.append)switch($){case"tracing":var S=c[0].headers.get("uber-trace-id");S?d=S.split(":")[0]:(S=u.getUberTraceId(w),c[0].headers.append("uber-trace-id",S["uber-trace-id"]),d=S.traceId),v=u.pageview;break;default:var T=c[0].headers.get("EagleEye-TraceID"),I=c[0].headers.get("EagleEye-SessionID"),x=c[0].headers.get("EagleEye-pAppName");T?d=T:(d=u.getTraceId()["EagleEye-TraceID"],c[0].headers.append("EagleEye-TraceID",d)),I?v=I:(v=u.getPageviewId()["EagleEye-SessionID"],c[0].headers.append("EagleEye-SessionID",v)),x||c[0].headers.append("EagleEye-pAppName",m)}}catch(D){n.warn("[retcode] fetch failed to set header, exception is :\n"+D)}if(s)switch(s.headers=s.headers?s.headers:{},$){case"tracing":if(s.headers["uber-trace-id"])d=s.headers["uber-trace-id"].split(":")[0];else{var k=u.getUberTraceId(w);s.headers["uber-trace-id"]=k["uber-trace-id"],d=k.traceId}v=u.getPageviewId()["EagleEye-SessionID"];break;default:s.headers["EagleEye-TraceID"]?d=s.headers["EagleEye-TraceID"]:(d=u.getTraceId()["EagleEye-TraceID"],s.headers["EagleEye-TraceID"]=d),s.headers["EagleEye-SessionID"]?v=s.headers["EagleEye-SessionID"]:(v=u.getPageviewId()["EagleEye-SessionID"],s.headers["EagleEye-SessionID"]=v),s.headers["EagleEye-pAppName"]||(s.headers["EagleEye-pAppName"]=m)}}}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 a=r.get("content-type");if(a&&!/(text)|(json)/.test(a))return e;if(!d){var s=n.parseFetchHeaders(r);"object"==typeof s&&s["eagleeye-traceid"]&&(d=s["eagleeye-traceid"],y="response")}}var g=Date.now()-f;return t.text().then(function(e){var a=n.getFetchSnapshot(c,e,r);t.ok?o(u,l.parseResponse,p,h,e,t.status||200,g,f,d,v,a,y,w):u.api(p,!1,g,t.status||404,t.statusText,f,d,v,a,i,y,w)}),e}catch(C){return n.warn("[ARMS] fetch response error :",C),e}})["catch"](function(e){if(!u||!u.api)throw e;var t=Date.now()-f;throw u.api(p,!1,t,e.name||"Error",e.message,f,d,v,{},i),e})},r[s].toString=n.$b5(s)}}(),function(){if("function"==typeof r[f]){var e,t=r[f];r[u]=t,r[f]=function(r){var s=new t(r),c=a;if(!c||!c.api||!s.addEventListener)return s;var u,f,l,p=s.send,h=s.open,g=s.setRequestHeader,d=c._conf,v=c.getConfig("enableLinkTrace"),m="",y="",b="",$=null,w=c.getConfig("sample"),_=c.getConfig("linkType"),E=1;return w&&!c.$ai(w)&&(E=0),s.open=function(t,r){e=t;var a=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);if(h.apply(s,a),l=r||"",f=n.$av(l),f=f?n.$au(f,d.ignoreApiPath?d.ignoreApiPath:d.apiHelper):"",v){var i="";try{i=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(p){i=""}var o=n.checkSameOrigin(l,i);if((c.getConfig("enableApiCors")||o)&&g&&"function"==typeof g)switch(_){case"tracing":var u=c.getUberTraceId(E);g.apply(s,["uber-trace-id",u["uber-trace-id"]]),m=u.traceId,y=c.getPageviewId()["EagleEye-SessionID"];break;default:m=c.getTraceId()["EagleEye-TraceID"],g.apply(s,["EagleEye-TraceID",m]),y=c.getPageviewId()["EagleEye-SessionID"],g.apply(s,["EagleEye-SessionID",y]),b=c.getConfig("pid"),g.apply(s,["EagleEye-pAppName",b])}}},s.send=function(){u=Date.now();var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);p.apply(s,e)},n.on(s,"readystatechange",function(){if(f&&4===s.readyState){var t=Date.now()-u,r=n.getXhrSnapshot(l,e,s);if(!m){var a=n.parseXhrHeaders("function"==typeof s.getAllResponseHeaders&&s.getAllResponseHeaders()||"");"object"==typeof a&&a["eagleeye-traceid"]&&(m=a["eagleeye-traceid"],$="response")}if(s.status>=200&&s.status<=299){var p=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(f,!0,t,p,"",u,m,y,{},i,$,E):o(c,d.parseResponse,f,l,s.responseText,p,t,u,m,y,r,$,E)}else c.api(f,!1,t,s.status||"FAILED",s.statusText,u,m,y,r,i,$,E)}}),s},r[f].toString=n.$b5(f)}}()),a=this,this)},$aq:function(){return this.$bj?this:(this.getConfig("disableHook")||this.addHook(),this.$bj=!0,this)}}),t}},{"../util":16}],8:[function(e,t,r){r.TIMING_KEYS=["","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","requestStart","responseStart","responseEnd","","domInteractive","","domContentLoadedEventEnd","","loadEventStart","","msFirstPaint","secureConnectionStart"]},{}],9:[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":16,"./constants":8}],10:[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":16}],11:[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":16,"./constants":8}],12:[function(e,t,r){var n=e("../util");t.exports=function(e,t){"object"==typeof e&&(e=n.serialize(e));var r=t+e;window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?window.navigator.sendBeacon(r,"&post_res="):n.warn("[arms] navigator.sendBeacon not surported")}},{"../util":16}],13:[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":16}],14:[function(e,t,r){"use strict";function n(e,t){var r=a[o]=new i(e);r.$as(t);var n=r._conf;return!1!==n.autoSendPv&&r.$az(),n&&n.useFmp||r.$b2(),n&&n.sendResource&&r.$bc(),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.$az(),r&&r.useFmp||t.$b2(),r&&r.sendResource&&t.$bc()),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":16}],15:[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,t){var r=e.split("::");return r.length>1?n.ext({group:r[0],key:r[1]},t):n.ext({group:"default_group",key:r[0]},t)},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.$at(a.prototype),n.ext(a.dftCon,{startTime:null}),n.ext(s.prototype,{constructor:s,_super:a,sum:function(e,t,r){try{return this._lg("sum",o(e,{val:t||1,begin:Date.now()}),r)}catch(a){n.warn("[retcode] can not get parseStatData: "+a)}},avg:function(e,t,r){try{return this._lg("avg",o(e,{val:t||0,begin:Date.now()}),r)}catch(a){n.warn("[retcode] can not get parseStatData: "+a)}},percent:function(e,t,r,a){try{return this._lg("percent",o(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||{};if(n.$bk(a,t.filename)){var o=/^Script error\.?$/,s=e.msg||e.message;if(n.$al(s,o)||n.$al(n.decode(s),o))return this;var c={msg:n.selfErrKey,err:{msg_raw:n.encode(e.msg||e.message)}};return this._self("error",c,1)}var u={begin:Date.now(),cate:r,msg:a&&a.substring(0,1e3),stack:i&&i.substring(0,1e3),file:n.$bl(t.filename||""),line:t.lineno||"",col:t.colno||"",err:{msg_raw:n.encode(a),stack_raw:n.encode(i)},tag:t.tag||"",c1:t.c1,c2:t.c2,c3:t.c3},f=(this.getConfig("ignore")||{}).ignoreErrors;return n.$al(u.msg,f)||n.$al(n.decode(u.msg),f)?this:(this.$ao&&this.$ao("error",u),this._lg("error",u,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,h){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:h}:n.sub(e,i),!n.$bi(e.api,!0))return this;if(e.code=e.code||"",e.msg=e.msg||"",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.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 g=(this.getConfig("ignore")||{}).ignoreApis;return n.$al(e.api,g)||n.$al(n.decode(e.api),g)?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.$bd=a.$bd||{},a.$bd[e]=t,a.$bd.begin=i,clearTimeout(a.$be),a.$be=setTimeout(function(){r||(a.$bd.page=a.$a8(!0)),a._lg("speed",a.$bd),a.$bd=null},5e3),a):(n.warn("[retcode] invalid point: "+e),a)},performance:function(e){if(e&&"object"==typeof e&&!this.$bm){var t={},r={},a=this.getConfig("autoSendPerf");if(e.autoSend&&a)return r=n.ext(this.$bn||{},e),this.$bm=!0,this._lg("perf",r,this.getConfig("sample"));if(e.autoSend&&!a)return delete e.autoSend,this.$bn?(r=n.ext(this.$bn||{},e),this.$bm=!0,this._lg("perf",r,this.getConfig("sample"))):void(this.$bn=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.$bn))return!0!==e.autoSend&&!1===a&&this.$bn?(t=n.ext(this.$bn||{},t),this.$bm=!0,this._lg("perf",t,this.getConfig("sample"))):void 0;this.$bn=n.ext(this.$bn||{},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)}}),s._super=a,s._root=a,a.Reporter=s,t.exports=s},{"./base":1,"./util":16}],16:[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?",us:"https://retcode-us-west-1.arms.aliyuncs.com/r.png?"},defaultImgUrl:"https://arms-retcode.aliyuncs.com/r.png?",$at: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},$au:function(e,t){if(!e)return"";if(!t)return e;var r=this,n=r.T(t);return"Function"===n?r.$a9(t,[e],e):"Array"===n?(this.each(t,function(t){e=r.$au(e,t)}),e):"Object"===n?e.replace(t.rule,t.target||""):e.replace(t,"")},$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 i.warn("[arms] invalid rules of ignore config, (list of) String/RegExp/Funcitons are available"),!1;for(var r,n=[],a=0,o=t.length;a<o;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 s=new RegExp(n.join("|"),"i");return!!(n.length&&s.test&&s.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("")},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("&")},$bi: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)/.test(e)),!r},$b9:function(e){return!(!e||!e.message)&&!/failed[\w\s]+fetch/i.test(e.message)},$av:function(e){return e&&"string"==typeof e?e.replace(/^(https?:)?\/\//,"").replace(/\?.*$/,""):""},$bl:function(e){return e&&"string"==typeof e?e.replace(/\?.*$/,""):""},$b5: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||""},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},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:""!==r.responseType&&"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){i.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)}},$bk: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/])},$bp:function(e){return{msg:e,message:this.selfErrKey}}};t.exports=i},{}]},{},[14]);
/** retcode cloud sdk | @version 1.8.20 | @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.20",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\.?$/]},release:undefined,environment:"prod"},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(e){if(this.getConfig("debug"))return!0;var t=n.regionMap,r=!1;for(var a in t)if(t[a]===e){r=!0;break}return!r&&n.warn("[retcode] invalid url: "+e),r},$ad:function(){},$ae:function(e){a(e,this.getConfig("imgUrl"))},$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,20),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",{"uber-trace-id":o+":"+s+":0:"+e,traceId:o}},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();)"res"===t.t?this.$af(t,"res"):"error"===t.t?this.$af(t,"err"):"api"===t.t?this.$af(t,"apiSnapshot"):"behavior"===t.t?this.$af(t,"behavior"):"health"===t.t&&!r&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?this.$ae(t):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._conf,s=this.$a8(),c=i.ignore||{},u=c.ignoreErrors,f=c.ignoreUrls,l=c.ignoreApis;return this._isRobot?this:n.$al(s,f)||n.$al(n.decode(s),f)?this:"error"===e&&(n.$al(t.msg,u)||n.$al(n.decode(t.msg),u))?this:"api"===e&&(n.$al(t.api,l)||n.$al(n.decode(t.api),l))?this:this.$ac(i.imgUrl)&&t&&!i.disabled&&i.pid?0===a?this:(t=n.ext({t:e,times:1,page:s,tag:i.tag||"",release:i.release||"",environment:i.environment,begin:Date.now(),c1:i.c1,c2:i.c2,c3:i.c3},t,this.$ag(),this._common,{pid:i.pid,_v:this.ver,pv_id:this.pageview,username:this.$ah(),sampling:r||1,z:n.seq()}),1===a?o(this,t):r&&!this.$ai(r)?this:o(this,t)):this},_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":12,"./util":16}],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"];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":16}],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()),Object.defineProperty&&s.addEventListener&&Object.defineProperty(t,"pipe",{set:t.$as}),t};f.prototype=n.$at(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**"},/\/$/],apiHelper:{rule:/\/([a-z\-_]+)?\d{2,20}/g,target:"/$1**"},ignoreUrlCase:!0,imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",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.$av(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.$au(t.ignoreUrlCase?i.toLowerCase():i,t.ignoreUrlPath?t.ignoreUrlPath:t.urlHelper)},setPage:function(e,t){var r=this,n=r.$aw;if(!1!==t){if(!e||e===n)return r;r.$aw=e,clearTimeout(r.$ax),r.$ay(1),r.$a7(),r.$ax=setTimeout(function(){r.$az()},10)}else r.$aw=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.$b0(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=")},$as: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.$as(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}},$b1: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.$az(),t}}),e("./behavior")(f,s),e("./handler")(f,s,c),e("./fmp")(f,s,c),e("./hook")(f,s),e("./hack")(f,s),f._super=a,f._root=a._root,a.Browser=f,t.exports=f},{"../common/post":10,"../common/sender":13,"../reporter":15,"../util":16,"./behavior":2,"./fmp":4,"./hack":5,"./handler":6,"./hook":7}],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.$b2(),null;n.on(t,"beforeunload",function(){a.$b3(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.$b3(e)}),u},$b3:function(e,t){var r=this;if(u&&f)if(r.$b4&&(clearTimeout(r.$b4),r.$b4=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.$b2({fmp:i.t}):r.$b2()}else r.$b4=n.delay(function(){r.$b3(e)},a)}})}},{"../util":16}],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("#"),g=n.$av(l[0]),h=n.$av(p[0]),d=l[1]&&l[1].replace(/^\/?(.*)/,"$1"),v=p[1]&&p[1].replace(/^\/?(.*)/,"$1");g!==h?o("historystatechange",h):d!==v&&o("historystatechange",v)}catch(m){n.warn("[retcode] error in "+e+": "+m)}return f},a[e].toString=n.$b5(e))};n.ext(t.prototype,{$b6:function(){return this.$b7?this:(s("pushState"),s("replaceState"),this.$b7=!0,this)}})}},{"../util":16}],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:""},g={},h=function(e,t,r,i,o){if(t===undefined){var s,c;if(!g[e]){s=new RegExp(e+"=([^;]+)");try{c=s.exec(n.cookie)}catch(f){return a.warn("[retcode] can not get cookie:",f),null}c&&(g[e]=c[1])}return g[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}},d=function(e){var t=e._conf.uid||h("_nk_")||h("_bl_uid");if(!t){t=a.uu();if(!h("_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.$b8(e):this.error(e.error||{message:e.message},e)}else"unhandledrejection"===t&&a.T(e.reason,"Error")&&a.$b9(e.reason)&&this.error(e.reason);try{this.getConfig("behavior")&&this.reportBehavior&&this.reportBehavior()}catch(e){}return this},$b8:function(e){var t=this,r=e.target||e.srcElement;try{var n=t.$ba(r),i="string"==typeof r.tagName?r.tagName.toLowerCase():"",o=t.$bb(r,5);return t._lg("resourceError",{src:n&&n.substring(0,1e3),node_name:i,xpath:o}),t}catch(s){return a.warn("[ARMS] $b8 error :",s),t}},$ba: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},$bb: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.$bb(e.parentNode,t-1)+" > "+a:a},$b2: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))})},$bc: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"))))})},$az:function(){var e=this;e.$a2(function(){var t=function(e){var t=d(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=d(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},$ay:function(e){var t=Date.now();if(t-this._lastUnload<200)return this;this._lastUnload=t,this.$b1(e),this.$bd&&(this._lg("speed",this.$bd),this.$bd=null,clearTimeout(this.$be)),this.$a4(!0)},$b0:function(e){var t=this;if(!e^t.$bf)return t;e?(t.$b6(),t.$bf=function(e){var r=t._conf.parseHash(location.hash);r&&t.setPage(r,!1!==e)},t.$bg=function(e){var r=t._conf.parseHash(e.detail);r&&t.setPage(r)},a.on(r,"hashchange",t.$bf),a.on(r,"historystatechange",t.$bg),t.$bf(!1)):(a.off(r,"hashchange",t.$bf),a.off(r,"historystatechange",t.$bg),t.$bf=null,t.$bg=null)},$ap:function(){var e=this;if(e.$bh)return e;var t=e._conf;return a.on(r,"beforeunload",function(){e.$ay(0)}),e.$b0(t.enableSPA),e.activeErrHandler(!1),e.$bh=!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":9,"../common/res":11,"../util":16}],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,g,h){var d=n.J(o)||null,v=n.$a9(t,[d,a],null);if(!v)return!1;var m=v.code||s,y=!("success"in v)||v.success;e.api(r,y,c,m,v.msg,u,f,l,p,i,g,h)},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);var f=Date.now(),l=u._conf,p=(t&&"string"!=typeof t?t.url:t)||"",g=p;p=n.$av(p);var h=(l.ignore||{}).ignoreApis;if(!n.$bi(p,!0)||n.$al(p,h))return e.apply(r,c);p=n.$au(p,l.ignoreApiPath?l.ignoreApiPath:l.apiHelper);var d=l.enableLinkTrace,v="",m="",y=u.getConfig("pid"),b=null,$=u.getConfig("sample"),w=u.getConfig("linkType"),_=1;if($&&!u.$ai($)&&(_=0),d){var E="";try{E=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(D){E=""}var S=n.checkSameOrigin(g,E);if(u.getConfig("enableApiCors")||S){if(t&&"string"!=typeof t)try{if(c[0].headers&&"function"==typeof c[0].headers.get&&"function"==typeof c[0].headers.append)switch(w){case"tracing":var T=c[0].headers.get("uber-trace-id");T?v=T.split(":")[0]:(T=u.getUberTraceId(_),c[0].headers.append("uber-trace-id",T["uber-trace-id"]),v=T.traceId),m=u.pageview;break;default:var I=c[0].headers.get("EagleEye-TraceID"),x=c[0].headers.get("EagleEye-SessionID"),k=c[0].headers.get("EagleEye-pAppName");I?v=I:(v=u.getTraceId()["EagleEye-TraceID"],c[0].headers.append("EagleEye-TraceID",v)),x?m=x:(m=u.getPageviewId()["EagleEye-SessionID"],c[0].headers.append("EagleEye-SessionID",m)),k||c[0].headers.append("EagleEye-pAppName",y)}}catch(j){n.warn("[retcode] fetch failed to set header, exception is :\n"+j)}if(s)switch(s.headers=s.headers?s.headers:{},w){case"tracing":if(s.headers["uber-trace-id"])v=s.headers["uber-trace-id"].split(":")[0];else{var C=u.getUberTraceId(_);s.headers["uber-trace-id"]=C["uber-trace-id"],v=C.traceId}m=u.getPageviewId()["EagleEye-SessionID"];break;default:s.headers["EagleEye-TraceID"]?v=s.headers["EagleEye-TraceID"]:(v=u.getTraceId()["EagleEye-TraceID"],s.headers["EagleEye-TraceID"]=v),s.headers["EagleEye-SessionID"]?m=s.headers["EagleEye-SessionID"]:(m=u.getPageviewId()["EagleEye-SessionID"],s.headers["EagleEye-SessionID"]=m),s.headers["EagleEye-pAppName"]||(s.headers["EagleEye-pAppName"]=y)}}}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 a=r.get("content-type");if(a&&!/(text)|(json)/.test(a))return e;if(!v){var s=n.parseFetchHeaders(r);"object"==typeof s&&s["eagleeye-traceid"]&&(v=s["eagleeye-traceid"],b="response")}}var h=Date.now()-f;return t.text().then(function(e){var a=n.getFetchSnapshot(c,e,r);t.ok?o(u,l.parseResponse,p,g,e,t.status||200,h,f,v,m,a,b,_):u.api(p,!1,h,t.status||404,t.statusText,f,v,m,a,i,b,_)}),e}catch(D){return n.warn("[ARMS] fetch response error :",D),e}})["catch"](function(e){if(!u||!u.api)throw e;var t=Date.now()-f;throw u.api(p,!1,t,e.name||"Error",e.message,f,v,m,{},i),e})},r[s].toString=n.$b5(s)}}(),function(){if("function"==typeof r[f]){var e,t=r[f];r[u]=t,r[f]=function(r){var s=new t(r),c=a;if(!c||!c.api||!s.addEventListener)return s;var u,f,l,p=s.send,g=s.open,h=s.setRequestHeader,d=c._conf,v=(d.ignore||{}).ignoreApis,m=c.getConfig("enableLinkTrace"),y="",b="",$="",w=null,_=c.getConfig("sample"),E=c.getConfig("linkType"),S=1;return _&&!c.$ai(_)&&(S=0),s.open=function(t,r){e=t;var a=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);g.apply(s,a),l=r||"",f=n.$av(l);var i=!n.$bi(f,!0)||n.$al(f,v);if(f=f?n.$au(f,d.ignoreApiPath?d.ignoreApiPath:d.apiHelper):"",!i&&m){var o="";try{o=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(w){o=""}var u=n.checkSameOrigin(l,o);if((c.getConfig("enableApiCors")||u)&&h&&"function"==typeof h)switch(E){case"tracing":var p=c.getUberTraceId(S);h.apply(s,["uber-trace-id",p["uber-trace-id"]]),y=p.traceId,b=c.getPageviewId()["EagleEye-SessionID"];break;default:y=c.getTraceId()["EagleEye-TraceID"],h.apply(s,["EagleEye-TraceID",y]),b=c.getPageviewId()["EagleEye-SessionID"],h.apply(s,["EagleEye-SessionID",b]),$=c.getConfig("pid"),h.apply(s,["EagleEye-pAppName",$])}}},s.send=function(){u=Date.now();var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);p.apply(s,e)},n.on(s,"readystatechange",function(){if(f&&4===s.readyState){var t=Date.now()-u,r=n.getXhrSnapshot(l,e,s);if(!y){var a=n.parseXhrHeaders("function"==typeof s.getAllResponseHeaders&&s.getAllResponseHeaders()||"");"object"==typeof a&&a["eagleeye-traceid"]&&(y=a["eagleeye-traceid"],w="response")}if(s.status>=200&&s.status<=299){var p=s.status||200;if("function"==typeof s.getResponseHeader){var g=s.getResponseHeader("Content-Type");if(g&&!/(text)|(json)/.test(g))return}s.responseType&&"text"!==s.responseType?c.api(f,!0,t,p,"",u,y,b,{},i,w,S):o(c,d.parseResponse,f,l,s.responseText,p,t,u,y,b,r,w,S)}else c.api(f,!1,t,s.status||"FAILED",s.statusText,u,y,b,r,i,w,S)}}),s},r[f].toString=n.$b5(f)}}()),a=this,this)},$aq:function(){return this.$bj?this:(this.getConfig("disableHook")||this.addHook(),this.$bj=!0,this)}}),t}},{"../util":16}],8:[function(e,t,r){r.TIMING_KEYS=["","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","requestStart","responseStart","responseEnd","","domInteractive","","domContentLoadedEventEnd","","loadEventStart","","msFirstPaint","secureConnectionStart"]},{}],9:[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":16,"./constants":8}],10:[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":16}],11:[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":16,"./constants":8}],12:[function(e,t,r){var n=e("../util");t.exports=function(e,t){"object"==typeof e&&(e=n.serialize(e));var r=t+e;window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?window.navigator.sendBeacon(r,"&post_res="):n.warn("[arms] navigator.sendBeacon not surported")}},{"../util":16}],13:[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":16}],14:[function(e,t,r){"use strict";function n(e,t){var r=a[o]=new i(e);r.$as(t);var n=r._conf;return!1!==n.autoSendPv&&r.$az(),n&&n.useFmp||r.$b2(),n&&n.sendResource&&r.$bc(),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.$az(),r&&r.useFmp||t.$b2(),r&&r.sendResource&&t.$bc()),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":16}],15:[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,t){var r=e.split("::");return r.length>1?n.ext({group:r[0],key:r[1]},t):n.ext({group:"default_group",key:r[0]},t)},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.$at(a.prototype),n.ext(a.dftCon,{startTime:null}),n.ext(s.prototype,{constructor:s,_super:a,sum:function(e,t,r){try{return this._lg("sum",o(e,{val:t||1,begin:Date.now()}),r)}catch(a){n.warn("[retcode] can not get parseStatData: "+a)}},avg:function(e,t,r){try{return this._lg("avg",o(e,{val:t||0,begin:Date.now()}),r)}catch(a){n.warn("[retcode] can not get parseStatData: "+a)}},percent:function(e,t,r,a){try{return this._lg("percent",o(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||{};if(n.$bk(a,t.filename)){var o=/^Script error\.?$/,s=e.msg||e.message;if(n.$al(s,o)||n.$al(n.decode(s),o))return this;var c={msg:n.selfErrKey,err:{msg_raw:n.encode(e.msg||e.message)}};return this._self("error",c,1)}var u={begin:Date.now(),cate:r,msg:a&&a.substring(0,1e3),stack:i&&i.substring(0,1e3),file:n.$bl(t.filename||""),line:t.lineno||"",col:t.colno||"",err:{msg_raw:n.encode(a),stack_raw:n.encode(i)},tag:t.tag||"",c1:t.c1,c2:t.c2,c3:t.c3},f=(this.getConfig("ignore")||{}).ignoreErrors;return n.$al(u.msg,f)||n.$al(n.decode(u.msg),f)?this:(this.$ao&&this.$ao("error",u),this._lg("error",u,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,g){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:g}:n.sub(e,i),!n.$bi(e.api,!0))return this;e.code=e.code||"";var h=e.msg||"";if(h="string"==typeof h?h.substring(0,1e3):h,e.msg=h,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.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 d=(this.getConfig("ignore")||{}).ignoreApis;return n.$al(e.api,d)||n.$al(n.decode(e.api),d)?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.$bd=a.$bd||{},a.$bd[e]=t,a.$bd.begin=i,clearTimeout(a.$be),a.$be=setTimeout(function(){r||(a.$bd.page=a.$a8(!0)),a._lg("speed",a.$bd),a.$bd=null},5e3),a):(n.warn("[retcode] invalid point: "+e),a)},performance:function(e){if(e&&"object"==typeof e&&!this.$bm){var t={},r={},a=this.getConfig("autoSendPerf");if(e.autoSend&&a)return r=n.ext(this.$bn||{},e),this.$bm=!0,this._lg("perf",r,this.getConfig("sample"));if(e.autoSend&&!a)return delete e.autoSend,this.$bn?(r=n.ext(this.$bn||{},e),this.$bm=!0,this._lg("perf",r,this.getConfig("sample"))):void(this.$bn=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.$bn))return!0!==e.autoSend&&!1===a&&this.$bn?(t=n.ext(this.$bn||{},t),this.$bm=!0,this._lg("perf",t,this.getConfig("sample"))):void 0;this.$bn=n.ext(this.$bn||{},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)}}),s._super=a,s._root=a,a.Reporter=s,t.exports=s},{"./base":1,"./util":16}],16:[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?",us:"https://retcode-us-west-1.arms.aliyuncs.com/r.png?"},defaultImgUrl:"https://arms-retcode.aliyuncs.com/r.png?",$at: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},$au:function(e,t){if(!e)return"";if(!t)return e;var r=this,n=r.T(t);return"Function"===n?r.$a9(t,[e],e):"Array"===n?(this.each(t,function(t){e=r.$au(e,t)}),e):"Object"===n?e.replace(t.rule,t.target||""):e.replace(t,"")},$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 i.warn("[arms] invalid rules of ignore config, (list of) String/RegExp/Funcitons are available"),!1;for(var r,n=[],a=0,o=t.length;a<o;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 s=new RegExp(n.join("|"),"i");return!!(n.length&&s.test&&s.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("")},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("&")},$bi: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)/.test(e)),!r},$b9:function(e){return!(!e||!e.message)&&!/failed[\w\s]+fetch/i.test(e.message)},$av:function(e){return e&&"string"==typeof e?e.replace(/^(https?:)?\/\//,"").replace(/\?.*$/,""):""},$bl:function(e){return e&&"string"==typeof e?e.replace(/\?.*$/,""):""},$b5: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||""},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},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){i.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)}},$bk: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/])},$bp:function(e){return{msg:e,message:this.selfErrKey}}};t.exports=i},{}]},{},[14]);

@@ -125,9 +125,11 @@ 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, t) {

} : util.sub(e, validApiKeys), !util.checkAPI(e.api, !0)) return this;
if (e.code = e.code || "", e.msg = e.msg || "", 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.success ? e.apiSnapshot && delete e.apiSnapshot : e.apiSnapshot = u,
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.success ? e.apiSnapshot && delete e.apiSnapshot : e.apiSnapshot = u,
c && (e.traceOrigin = c), !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 : (this.beforeSend && this.beforeSend("api", e),
var f = (this.getConfig("ignore") || {}).ignoreApis;
return util.ignoreByRule(e.api, f) || util.ignoreByRule(util.decode(e.api), f) ? this : (this.beforeSend && this.beforeSend("api", e),
this._lg("api", e, e.success && this.getConfig("sample"), e.flag));

@@ -134,0 +136,0 @@ },

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

var i = "";
"" === r.responseType || "text" === r.responseType ? i = r.responseText : "" !== r.responseType && "document" !== r.responseType || (i = r.responseXML),
"" === r.responseType || "text" === r.responseType ? i = r.responseText : "document" === r.responseType && (i = r.responseXML),
n = {

@@ -254,0 +254,0 @@ originApi: e,

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

/** retcode cloud sdk | @version 1.8.18 | @copyright Alibaba Group Holding Limited. */ "use strict";Date.now=Date.now||function(){return(new Date).getTime()};var SEQUENCE=Date.now(),noop=function(){},$a1=function(){var t="object"==typeof console?console.warn:noop;try{var e={warn:t};e.warn.call(e)}catch(r){return noop}return t},util={noop:noop,warn:$a1(),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?",us:"https://retcode-us-west-1.arms.aliyuncs.com/r.png?"},defaultImgUrl:"https://arms-retcode.aliyuncs.com/r.png?",$a2:function(t){if(Object.create)return Object.create(t);var e=function(){};return e.prototype=t,new e},each:function(t,e){var r=0,n=t.length;if(this.T(t,"Array"))for(;r<n&&!1!==e.call(t[r],t[r],r);r++);else for(r in t)if(!1===e.call(t[r],t[r],r))break;return t},$a3:function(t,e,r){if("function"!=typeof t)return r;try{return t.apply(this,e)}catch(n){return r}},T:function(t,e){var r=Object.prototype.toString.call(t).substring(8).replace("]","");return e?r===e:r},$a4:function(t,e){if(!t)return"";if(!e)return t;var r=this,n=r.T(e);return"Function"===n?r.$a3(e,[t],t):"Array"===n?(this.each(e,function(e){t=r.$a4(t,e)}),t):"Object"===n?t.replace(e.rule,e.target||""):t.replace(e,"")},$a5:function(t,e){if(!t||!e)return!1;if((this.isString(e)||e.source||"Function"===this.T(e))&&(e=[e]),!this.isArray(e))return util.warn("[arms] invalid rules of ignore config, (list of) String/RegExp/Funcitons are available"),!1;for(var r,n=[],i=0,o=e.length;i<o;i++)if(r=e[i],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.$a3(r,[t],!1))return!0;var a=new RegExp(n.join("|"),"i");return!!(n.length&&a.test&&a.test(t))},J:function(t){if(!t||"string"!=typeof t)return t;var e=null;try{e=JSON.parse(t)}catch(r){}return e},pick:function(t){return 1===t||1===Math.ceil(Math.random()*t)},$a6:function(t){if("sample"in t){var e=t.sample,r=e;e&&/^\d+(\.\d+)?%$/.test(e)&&(r=parseInt(100/parseFloat(e))),0<r&&1>r&&(r=parseInt(1/r)),r>=1&&r<=100?t.sample=r:delete t.sample}return t},on:function(t,e,r,n,i){return t.addEventListener?(i=i||!1,t.addEventListener(e,function o(a){n&&t.removeEventListener(e,o,i),r.call(this,a)},i)):t.attachEvent&&t.attachEvent("on"+e,function a(i){n&&t.detachEvent("on"+e,a),r.call(this,i)}),this},off:function(t,e,r){return r?(t.removeEventListener?t.removeEventListener(e,r):t.detachEvent&&t.detachEvent(e,r),this):this},delay:function(t,e){return-1===e?(t(),null):setTimeout(t,e||0)},ext:function(t){for(var e=1,r=arguments.length;e<r;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},sub:function(t,e){var r={};return this.each(t,function(t,n){-1!==e.indexOf(n)&&(r[n]=t)}),r},uu:function(){for(var t,e,r=20,n=new Array(r),i=Date.now().toString(36).split("");r-- >0;)e=(t=36*Math.random()|0).toString(36),n[r]=t%3?e:e.toUpperCase();for(var o=0;o<8;o++)n.splice(3*o+2,0,i[o]);return n.join("")},seq:function(){return(SEQUENCE++).toString(36)},decode:function(t){try{t=decodeURIComponent(t)}catch(e){}return t},encode:function(t,e){try{t=e?encodeURIComponent(t).replace(/\(/g,"%28").replace(/\)/g,"%29"):encodeURIComponent(t)}catch(r){}return t},serialize:function(t){t=t||{};var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&t[r]!==undefined&&e.push(r+"="+this.encode(t[r],"msg"===r));return e.join("&")},$a7:function(t,e){if(!t||"string"!=typeof t)return!1;var r=/arms-retcode[\w-]*\.aliyuncs/.test(t);return!r&&e&&(r=/(\.png)|(\.gif)|(alicdn\.com)/.test(t)),!r},$a8:function(t){return!(!t||!t.message)&&!/failed[\w\s]+fetch/i.test(t.message)},$a9:function(t){return t&&"string"==typeof t?t.replace(/^(https?:)?\/\//,"").replace(/\?.*$/,""):""},$aa:function(t){return t&&"string"==typeof t?t.replace(/\?.*$/,""):""},$ab:function(t){return function(){return t+"() { [native code] }"}},checkSameOrigin:function(t,e){if(!e||!t)return!1;var r="//"+e.split("/")[2];return t===e||t.slice(0,e.length+1)===e+"/"||t===r||t.slice(0,r.length+1)===r+"/"||!/^(\/\/|http:|https:).*/.test(t)},getRandIP:function(){for(var t=[],e=0;e<4;e++){var r=Math.floor(256*Math.random());t[e]=(r>15?"":"0")+r.toString(16)}return t.join("").replace(/^0/,"1")},getSortNum:function(t){return t?(t+=1)>=1e3&&t<=9999?t:t<1e3?t+1e3:t%1e4+1e3:1e3},getRandNum:function(t){return t&&"string"==typeof t?t.length<5?this.getNum(5):t.substring(t.length-5):this.getNum(5)},getNum:function(t){for(var e=[],r=0;r<t;r++){var n=Math.floor(16*Math.random());e[r]=n.toString(16)}return e.join("")},getCurDomain:function(){return location&&location.hostname||""},parseFetchHeaders:function(t){if(!t)return{};var e={};try{if("function"==typeof t.keys)for(var r=t.keys(),n=r.next();!n.done;){var i=n.value;e[i]=t.get(i),n=r.next()}else e=t}catch(o){e={}}return e},parseXhrHeaders:function(t){if(!t&&"string"!=typeof t)return{};var e={};try{var r=t.split("\r\n");e=r.reduce(function(t,e){var r=e.split(": ");return t[r[0]]=r[1],t},{})}catch(n){e={}}return e},getQuerys:function(t){if(!t)return"";var e={},r=[],n="",i="";try{var o=[];if(t.indexOf("?")>=0&&(o=t.substring(t.indexOf("?")+1,t.length).split("&")),o.length>0)for(var a in o)n=(r=o[a].split("="))[0],i=r[1],e[n]=i}catch(s){e={}}return e},getFetchSnapshot:function(t,e,r){var n,i;try{var o=(t&&"string"!=typeof t[0]?t[0].url:t[0])||"",a=(t&&"string"!=typeof t[0]?t[0]:t[1])||{},s="POST"===a.method.toUpperCase()?a.body:this.getQuerys(o);n={originApi:o,method:a.method||"unknown",params:s,response:e||"",reqHeaders:this.parseFetchHeaders(a.headers||null),resHeaders:this.parseFetchHeaders(r)},i="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(n))||"{}"}catch(u){i="{}"}return i},getXhrSnapshot:function(t,e,r){if(!t||!e||!r)return{};var n,i;try{var o="";""===r.responseType||"text"===r.responseType?o=r.responseText:""!==r.responseType&&"document"!==r.responseType||(o=r.responseXML),n={originApi:t,method:e,params:this.getQuerys(t),response:o,reqHeaders:{},resHeaders:this.parseXhrHeaders("function"==typeof r.getAllResponseHeaders&&r.getAllResponseHeaders()||"")},i="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(n))||"{}"}catch(a){i="{}"}return i},isRobot:function(){var t=["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 e=navigator.userAgent.toLowerCase(),r=0;r<t.length;r++){var n=t[r];if(e.lastIndexOf(n)>=0)return!0}}catch(i){util.warn("[arms] useragent parse error")}return!1},isFunction:function(t){return"function"==typeof t},isPlainObject:function(t){return"[object Object]"===Object.prototype.toString.call(t)},isString:function(t){return"[object String]"===Object.prototype.toString.call(t)},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},joinRegExp:function(t){for(var e,r=[],n=0,i=t.length;n<i;n++)e=t[n],this.isString(e)?r.push(e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):e&&e.source&&r.push(e.source);return new RegExp(r.join("|"),"i")},reWriteMethod:function(t,e,r){if(null!==t){var n=t[e];t[e]=r(n)}},$ac:function(t,e){if(!t&&!e)return!1;if(new RegExp(this.selfErrKey,"i").test(t))return!0;return!!this.$a5(e,[/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/])},$ad:function(t){return{msg:t,message:this.selfErrKey}}},util_1=util,sendBeacon=function(t,e){"object"==typeof t&&(t=util_1.serialize(t));var r=e+t;window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?window.navigator.sendBeacon(r,"&post_res="):util_1.warn("[arms] navigator.sendBeacon not surported")},selfId="aokcdqn3ly@e629dabd48a9933",pushToQueue=function(t,e){var r;{if("error"!==e.t||!(r=t.$ae[0])||"error"!==r.t||e.msg!==r.msg){if("behavior"===e.t){var n=t.$ae&&t.$ae.length;if(n>0&&"behavior"===t.$ae[n-1].t){var i=e.behavior||[];t.$ae[n-1].behavior.concat(i)}else t.$ae.push(e)}else t.$ae.unshift(e);return t.$af(function(){t.$ag=util_1.delay(function(){t.$ah()},t.$ae[0]&&"error"===t.$ae[0].t?3e3:-1)}),!0}r.times++}},Base=function(t){return this.ver="1.8.18",this._conf=util_1.ext({},Base.dftCon),this.$ai={},this.$ae=[],this.$aj=[],this.sdkFlag=!0,this.hash=util_1.seq(),this.$ak(),this.setConfig(t),this.rip=util_1.getRandIP(),this.record=999,this["EagleEye-TraceID"]=this.getTraceId()["EagleEye-TraceID"],this._common={},this};Base.dftCon={sample:1,pvSample:1,tag:"",imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",region:null,ignore:{ignoreUrls:[],ignoreApis:[],ignoreErrors:[/^Script error\.?$/]},release:undefined,environment:"prod"},Base.prototype={constructor:Base,$af:function(t){return t()},$al:function(){var t=this._conf.page;return util_1.$a3(t,[],t+"")},setPage:function(){},setConfig:function(t){t&&"object"==typeof t&&(util_1.$a6(t),t=this.$am(t),this._conf=util_1.ext({},this._conf,t))},$am:function(t){var e=t.region,r=t.imgUrl;if(e){var n=util_1.regionMap[e];return t.imgUrl=n||util_1.defaultImgUrl,t}return r&&(t.imgUrl=r),t},$an:function(t){if(this.getConfig("debug"))return!0;var e=util_1.regionMap,r=!1;for(var n in e)if(e[n]===t){r=!0;break}return!r&&util_1.warn("[retcode] invalid url: "+t),r},$ao:function(){},$ap:function(t){sendBeacon(t,this.getConfig("imgUrl"))},$aq:function(){},$ar:function(){return{}},setCommonInfo:function(t){t&&"object"==typeof t&&(this._common=util_1.ext({},this._common,t))},$ak:function(){this.pageview=util_1.uu(),this.sBegin=Date.now()},$as:function(){if(this.username)return this.username;var t=this._conf,e=t&&t.setUsername;if("function"==typeof e)try{var r=e();"string"==typeof r&&(r=r.substr(0,20),this.username=r)}catch(n){util_1.warn("[arms] setUsername fail",n)}return this.username},getTraceId:function(){var t=this.rip,e=Date.now(),r=util_1.getSortNum(this.record),n=t+e+r+util_1.getRandNum(this._conf.pid);return this["EagleEye-TraceID"]=n,this.record=r,{"EagleEye-TraceID":n}},getUberTraceId:function(t){var e=this.rip,r=Date.now(),n=util_1.getSortNum(this.record),i=util_1.getRandNum(this._conf.pid),o=e+r+n+util_1.getNum(2)+i,a=o.substring(0,16);return t=t?"1":"0",{"uber-trace-id":o+":"+a+":0:"+t,traceId:o}},getPageviewId:function(){return{"EagleEye-SessionID":this.pageview}},getConfig:function(t){return t?this._conf[t]:util_1.ext({},this._conf)},$at:function(t){return 1===t||("boolean"==typeof this.$ai[t]?this.$ai[t]:(this.$ai[t]=util_1.pick(t),this.$ai[t]))},$ah:function(t){var e;clearTimeout(this.$ag),this.$ag=null;for(var r=this._conf&&"function"==typeof this._conf.sendRequest;e=this.$ae.pop();)"res"===e.t?this.$aq(e,"res"):"error"===e.t?this.$aq(e,"err"):"api"===e.t?this.$aq(e,"apiSnapshot"):"behavior"===e.t?this.$aq(e,"behavior"):"health"===e.t&&!r&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?this.$ap(e):this.$ao(e);return t&&this.$au(),this},$au:function(){var t;for(clearTimeout(this.$av),this.$av=null;t=this.$aj.pop();)this.$aq(t,"err");return this},_lg:function(t,e,r,n){var i=this._conf,o=this.$al(),a=i.ignore||{},s=a.ignoreErrors,u=a.ignoreUrls,c=a.ignoreApis;return this._isRobot?this:util_1.$a5(o,u)||util_1.$a5(util_1.decode(o),u)?this:"error"===t&&(util_1.$a5(e.msg,s)||util_1.$a5(util_1.decode(e.msg),s))?this:"api"===t&&(util_1.$a5(e.api,c)||util_1.$a5(util_1.decode(e.api),c))?this:this.$an(i.imgUrl)&&e&&!i.disabled&&i.pid?0===n?this:(e=util_1.ext({t:t,times:1,page:o,tag:i.tag||"",release:i.release||"",environment:i.environment,begin:Date.now(),c1:i.c1,c2:i.c2,c3:i.c3},e,this.$ar(),this._common,{pid:i.pid,_v:this.ver,pv_id:this.pageview,username:this.$as(),sampling:r||1,z:util_1.seq()}),1===n?pushToQueue(this,e):r&&!this.$at(r)?this:pushToQueue(this,e)):this},_self:function(t,e,r){var n=this,i=n._conf;if("error"!==t)return n;if(!n.$an(i.imgUrl))return n;if(!e||i.disabled||!i.pid||!selfId)return n;if(r&&!n.$at(r))return n;e=util_1.ext({t:t,times:1,page:util_1.selfErrPage,tag:i.pid,begin:Date.now()},e,{pid:selfId,_v:n.ver,sampling:r||1,z:util_1.seq()});var o=n.$aj[0];if(o){o.times++;try{if(o.err&&e.err&&o.err.msg_raw&&e.err.msg_raw){o.err.msg_raw.split("&").indexOf(e.err.msg_raw)<0&&o.err.msg_raw.length<1e3&&(o.err.msg_raw+="&"+e.err.msg_raw)}}catch(a){}}else n.$aj.unshift(e),n.$af(function(){n.sdkFlag&&(n.sdkFlag=!1,n.$av=util_1.delay(function(){n.$au()},1e4))})},custom:function(t,e){if(!t||"object"!=typeof t)return this;var r=!1,n={begin:Date.now()};return util_1.each(t,function(t,e){return!(r=e&&e.length<=20)&&util_1.warn("[retcode] invalid key: "+e),n["x-"+e]=t,r}),r?this._lg("custom",n,e||1):this}};var base=Base,validApiKeys=["api","success","time","code","msg","trace","traceId","begin","pv_id","sid","seq","domain","flag"],parseStatData=function(t,e){var r=t.split("::");return r.length>1?util_1.ext({group:r[0],key:r[1]},e):util_1.ext({group:"default_group",key:r[0]},e)},Reporter=function(t){base.call(this,t);var e;try{e="object"==typeof performance?performance.timing.fetchStart:Date.now()}catch(r){e=Date.now()}return this._startTime=e,this};Reporter.prototype=util_1.$a2(base.prototype),util_1.ext(base.dftCon,{startTime:null}),util_1.ext(Reporter.prototype,{constructor:Reporter,_super:base,sum:function(t,e,r){try{return this._lg("sum",parseStatData(t,{val:e||1,begin:Date.now()}),r)}catch(n){util_1.warn("[retcode] can not get parseStatData: "+n)}},avg:function(t,e,r){try{return this._lg("avg",parseStatData(t,{val:e||0,begin:Date.now()}),r)}catch(n){util_1.warn("[retcode] can not get parseStatData: "+n)}},percent:function(t,e,r,n){try{return this._lg("percent",parseStatData(t,{subkey:e,val:r||0,begin:Date.now()}),n)}catch(i){util_1.warn("[retcode] can not get parseStatData: "+i)}},msg:function(t,e){if(t&&!(t.length>180))return this.custom({msg:t},e)},error:function(t,e){if(!t)return util_1.warn("[retcode] invalid param e: "+t),this;1===arguments.length?("string"==typeof t&&(t={message:t},e={}),"object"==typeof t&&(e=t=t.error||t)):("string"==typeof t&&(t={message:t}),"object"!=typeof e&&(e={}));var r=t.name||"CustomError",n=t.message||"",i=t.stack||"";e=e||{};if(util_1.$ac(n,e.filename)){var o=/^Script error\.?$/,a=t.msg||t.message;if(util_1.$a5(a,o)||util_1.$a5(util_1.decode(a),o))return this;var s={msg:util_1.selfErrKey,err:{msg_raw:util_1.encode(t.msg||t.message)}};return this._self("error",s,1)}var u={begin:Date.now(),cate:r,msg:n&&n.substring(0,1e3),stack:i&&i.substring(0,1e3),file:util_1.$aa(e.filename||""),line:e.lineno||"",col:e.colno||"",err:{msg_raw:util_1.encode(n),stack_raw:util_1.encode(i)},tag:e.tag||"",c1:e.c1,c2:e.c2,c3:e.c3},c=(this.getConfig("ignore")||{}).ignoreErrors;return util_1.$a5(u.msg,c)||util_1.$a5(util_1.decode(u.msg),c)?this:(this.$ay&&this.$ay("error",u),this._lg("error",u,1))},behavior:function(t){if(t){var e="object"==typeof t&&t.behavior?t:{behavior:t};return this.$ay&&this.$ay("behavior",e),this._lg("behavior",e,1)}},api:function(t,e,r,n,i,o,a,s,u,c,f,l){if(!t)return util_1.warn("[retcode] api is null"),this;if(t="string"==typeof t?{api:t,success:e,time:r,code:n,msg:i,begin:o,traceId:a,pv_id:s,apiSnapshot:u,domain:c,flag:l}:util_1.sub(t,validApiKeys),!util_1.$a7(t.api,!0))return this;if(t.code=t.code||"",t.msg=t.msg||"",t.success=t.success?1:0,t.time=+t.time,t.begin=t.begin,t.traceId=t.traceId||"",t.pv_id=t.pv_id||"",t.domain=t.domain||"",t.flag=t.flag,t.success?t.apiSnapshot&&delete t.apiSnapshot:t.apiSnapshot=u,f&&(t.traceOrigin=f),!t.api||isNaN(t.time))return util_1.warn("[retcode] invalid time or api"),this;var g=(this.getConfig("ignore")||{}).ignoreApis;return util_1.$a5(t.api,g)||util_1.$a5(util_1.decode(t.api),g)?this:(this.$ay&&this.$ay("api",t),this._lg("api",t,t.success&&this.getConfig("sample"),t.flag))},speed:function(t,e,r){var n=this,i=this.getConfig("startTime")||this._startTime;return/^s(\d|1[0])$/.test(t)?(e="number"!=typeof e?Date.now()-i:e>=i?e-i:e,n.$aw=n.$aw||{},n.$aw[t]=e,n.$aw.begin=i,clearTimeout(n.$ax),n.$ax=setTimeout(function(){r||(n.$aw.page=n.$al(!0)),n._lg("speed",n.$aw),n.$aw=null},5e3),n):(util_1.warn("[retcode] invalid point: "+t),n)},performance:function(t){if(t&&"object"==typeof t&&!this.$az){var e={},r={},n=this.getConfig("autoSendPerf");if(t.autoSend&&n)return r=util_1.ext(this.$b0||{},t),this.$az=!0,this._lg("perf",r,this.getConfig("sample"));if(t.autoSend&&!n)return delete t.autoSend,this.$b0?(r=util_1.ext(this.$b0||{},t),this.$az=!0,this._lg("perf",r,this.getConfig("sample"))):void(this.$b0=t);for(var i in t)(/^t([1-9]|1[0])$/.test(i)||"ctti"===i||"cfpt"===i)&&(e[i]=t[i]);if(!0===t.autoSend||!n&&(n||this.$b0))return!0!==t.autoSend&&!1===n&&this.$b0?(e=util_1.ext(this.$b0||{},e),this.$az=!0,this._lg("perf",e,this.getConfig("sample"))):void 0;this.$b0=util_1.ext(this.$b0||{},e)}},resource:function(t,e){if(!t||!util_1.isPlainObject(t))return util_1.warn("[arms] invalid param data: "+t),this;var r=Object.keys(t),n=["begin","dom","load","res","dl"],i=!1;for(var o in n){if(r.indexOf(n[o])<0){i=!0;break}}if(i)return util_1.warn("[arms] lack param data: "+t),this;var a={begin:t.begin||Date.now(),dom:t.dom||"",load:t.load||"",res:util_1.isArray(t.res)?JSON.stringify(t.res):JSON.stringify([]),dl:t.dl||""};return this._lg("res",a,e)}}),Reporter._super=base,Reporter._root=base,base.Reporter=Reporter;var reporter=Reporter,MiniProgramLogger=function(t){t&&t.pid||util_1.warn("[arms] pid is a required prop to instatiate MiniProgramLogger");var e=this;return reporter.call(e,t),e.appBegin=Date.now(),e._health={errcount:0,apisucc:0,apifail:0},e.DEFAUT_PAGE_PATH="[app]",e.isSendPerf=!1,e.$ay=function(t,r){"error"===t?e._health.errcount++:"api"===t&&e._health[r.success?"apisucc":"apifail"]++},"function"==typeof e.$b1&&e.$b1(),e._conf&&e._conf.behavior&&"function"==typeof e.$b2&&e.$b2(),"function"==typeof e.$b3&&e.$b3(),this};MiniProgramLogger.prototype=util_1.$a2(reporter.prototype),util_1.ext(reporter._root.dftCon,{uid:null,setUsername:null,disableHook:!1,enableLinkTrace:!1,behavior:!1,enableConsole:!1,sendRequest:function(){},getCurrentPage:function(){}}),util_1.ext(MiniProgramLogger.prototype,{constructor:MiniProgramLogger,_super:reporter,$af:function(t){t()},$ao:function(t,e){if(this.getConfig("debug"))"undefined"!=typeof console&&console&&"function"==typeof console.log&&console.log("[arms] [DEBUG MODE] log data",t);else{var r=this.getConfig("imgUrl");"object"==typeof t&&(t=util_1.serialize(t));var n=r+t;e&&(n+="&post_res=");var i=this._conf.sendRequest;if("function"==typeof i)try{i(n,e)}catch(o){util_1.warn("[arms] error in $ao",o)}}},$aq:function(t,e){var r={};r[e]=t[e],delete t[e],this.$ao(t,r)},$al:function(){var t=this._conf.getCurrentPage;if("function"==typeof t)try{var e=t();if(e&&"string"==typeof e)return e}catch(r){util_1.warn("[arms] error in $al",r)}return"string"==typeof t&&t?t:this.DEFAUT_PAGE_PATH},$b4:function(){this.setCommonInfo({sid:util_1.uu()})},setConfig:function(t){if(t&&"object"==typeof t){util_1.$a6(t),t=this.$am(t);var e=this._conf;this._conf=util_1.ext({},this._conf,t);var r="disableHook";r in t&&e[r]!==t[r]&&(t[r]?"function"==typeof this.removeHook&&this.removeHook():"function"==typeof this.addHook&&this.addHook())}},appLaunch:function(){this.appBegin=Date.now()},pageShow:function(){var t=this;t.$ak(),t.$b5(),clearTimeout(t.$b6),t.$b7(),t.$b6=setTimeout(function(){t.$b8()},50),t.pvPage=t.$al()},pageHide:function(){this.$b7()},addHook:function(){return this},removeHook:function(){return this},hookApp:function(t){var e=this,r={onLaunch:function(){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),n=t.onLaunch;try{e.appLaunch()}catch(i){util_1.warn("[arms] error in hookApp:onLaunch",i)}if("function"==typeof n)return n.apply(this,r)},onError:function(r){var n=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),i=t.onError;try{e.error(r),e.getConfig("behavior")&&"function"==typeof e.reportBehavior&&e.reportBehavior()}catch(r){util_1.warn("[arms] error in hookApp:onError",r)}if("function"==typeof i)return i.apply(this,n)}};return util_1.ext({},t,r)},hookPage:function(t){var e=this,r={onShow:function(){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),n=t.onShow;try{e.pageShow()}catch(i){util_1.warn("[arms] error in hookPage:pageShow",i)}if("function"==typeof n)return n.apply(this,r)},onHide:function(){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),n=t.onHide;try{e.pageHide()}catch(i){util_1.warn("[arms] error in hookPage:onHide",i)}if("function"==typeof n)return n.apply(this,r)},onUnload:function(){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),n=t.onUnload;try{e.pageHide()}catch(i){util_1.warn("[arms] error in hookPage:onUnload",i)}if("function"==typeof n)return n.apply(this,r)}};return util_1.ext({},t,r)},$b1:function(){},$b3:function(){this.setCommonInfo({app:"mini_common",uid:this._conf.uid})},$b8:function(){var t=this;t.$af(function(){t._lg("pv",{},t.getConfig("pvSample"))})},$b5:function(){var t=this;t.isSendPerf||(t.$af(function(){var e={fpt:Date.now()-t.appBegin};t._lg("perf",e,t.getConfig("sample"))}),t.isSendPerf=!0)},$b7:function(){this.$b9(),this.$aw&&(this._lg("speed",this.$aw),this.$aw=null,clearTimeout(this.$ax)),this.$ah(!0)},$b9:function(){if(this.pvPage){var t=util_1.ext({},this._health);t.healthy=t.errcount>0?0:1,t.begin=Date.now();var e=t.begin-this.sBegin;t.page=this.pvPage,t.stay=e,this._lg("health",t,1),this._health={errcount:0,apisucc:0,apifail:0},this.pvPage=null}}});var singleton=null,generator=function(t){return singleton||(singleton=new MiniProgramLogger(t||{})),singleton};MiniProgramLogger.createExtraInstance=function(t){t&&"object"==typeof t?(t.disableHook=!0,t.behavior=!1):t={disableHook:!0,behavior:!1};return new MiniProgramLogger(t)},MiniProgramLogger.init=generator,MiniProgramLogger.singleton=generator,MiniProgramLogger._super=reporter,MiniProgramLogger._root=reporter._root,reporter.MiniProgramLogger=MiniProgramLogger;var miniProgramLogger=MiniProgramLogger,hook=function(t){var e=util_1,r=null,n={};return e.ext(t.prototype,{addHook:function(){return this.isHookInstantiated?this:(function(){var t=this;if("undefined"!=typeof wx&&wx&&"function"==typeof wx.request){r=wx;var i={request:function(r){var n=(new Date).getTime();if(r&&"object"==typeof r&&r[0]){var i,o,a=r[0],s=e.$a9(a.url),u=a.success,c=a.fail,f=a&&a.header;f&&"object"==typeof f||(f={});var l={};if(t.getConfig("enableLinkTrace")){var g=f["EagleEye-pAppName"];if(i=f["EagleEye-TraceID"],o=f["EagleEye-SessionID"],i||(i=t.getTraceId()["EagleEye-TraceID"],l["EagleEye-TraceID"]=i),o||(o=t.getPageviewId()["EagleEye-SessionID"],l["EagleEye-SessionID"]=o),!g){var p=t.getConfig("pid");l["EagleEye-pAppName"]=p}}a.success=function(){var a=(new Date).getTime();if(e.$a7(s,!0)){var c=arguments&&arguments[0]&&arguments[0].statusCode||200;t.api({api:r[0].url,success:!0,time:a-n,code:c,begin:n,traceId:i,pv_id:o})}u&&u.apply(t,[].slice.call(arguments))},a.fail=function(){var a=(new Date).getTime();if(e.$a7(s,!0)){var u="";arguments&&arguments[0]&&"object"==typeof arguments[0]&&(u=(u=JSON.stringify(arguments[0])).substring(0,1e3));var f=arguments&&arguments[0]&&arguments[0].statusCode||"FAILED";t.api({api:r[0].url,success:!1,time:a-n,code:f,msg:u,begin:n,traceId:i,pv_id:o})}c&&c.apply(t,[].slice.call(arguments))},a.header=e.ext({},f,l)}}};for(var o in wx)if(i[o]){var a=o.toString();n[a]=function(){return i[a](arguments),r[a].apply(r,[].slice.call(arguments))}}else n[o]=r[o];wx=n}}.call(this),this.isHookInstantiated=!0,this)},removeHook:function(){return this.isHookInstantiated?(function(){"undefined"!=typeof wx&&wx&&r&&(wx=r,r=null)}.call(this),this.isHookInstantiated=!1,this):this},$b1:function(){return this.$ba?this:(this.getConfig("disableHook")||this.addHook(),this.$ba=!0,this)}}),t},miniBehavior=function(t){var e=[],r=util_1.reWriteMethod,n={consoleBehavior:function(){if(console){var t=["debug","info","warn","log","error"],e=null;if(Function&&(e=Function.prototype.apply||Function.apply),"function"==typeof e)for(var n=this,i=0;i<t.length;i++){var o=t[i];"function"==typeof console[o]&&r(console,o,function(t){var r=o;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s={type:"console",data:{level:r,message:o}};n&&"function"==typeof n.addBehavior&&n.addBehavior(s),"function"==typeof t&&e.call(t,console,o)}})}}}};return util_1.ext(t.prototype,{addBehavior:function(t){if(this.getConfig("behavior")&&t&&"object"==typeof t){var r="";this._conf&&"function"==typeof this._conf.getCurrentPage&&(r=this._conf.getCurrentPage());var n=null;try{n=Date.now()}catch(s){return void util_1.warn("[arms] error in Date.now",s)}var i={},o=t.data||{};if(t.type)i=o;else{if("string"!=typeof o.name||"string"!=typeof o.message)return;i.name=o.name.substr(0,20),i.message=o.message.substr(0,200)}i.message&&(i.message=util_1.encode(i.message));var a={type:t.type||"custom",data:i||{},timestamp:t.timestamp||n,page:t.page||r};return e.push(a),e=e.slice(-100)}},getBehavior:function(){return e||[]},setBehavior:function(t){return t&&(e=t),e},reportBehavior:function(){var t=this;t.getConfig("behavior")&&(t.$bb&&(clearTimeout(t.$bb),t.$bb=undefined),t.$bb=setTimeout(function(){e&&e.length>0&&("function"==typeof t.behavior&&t.behavior(e),e=[])},0))},$b2:function(){}}),n},behavior=function(t,e){var r=null,n="",i=function(t){return function(){if(t&&r){var e=r,n=t+"timmer";e[n]&&(clearTimeout(e[n]),e[n]=undefined),e[n]=setTimeout(function(){"function"==typeof e.addBehavior&&e.addBehavior({type:"ui.default",data:{level:t}})},100)}}},o=miniBehavior(t)||{};util_1.ext(t.prototype,{$b2:function(){if(!this.hasInitBehavior&&!r&&void 0!==e&&e){try{this.getConfig("enableConsole")&&"function"==typeof o.consoleBehavior&&o.consoleBehavior.call(this),e&&("function"==typeof e.onKeyboardHeightChange&&e.onKeyboardHeightChange(i("KeyboardHeightChange")),"function"==typeof e.onPageNotFound&&e.onPageNotFound(i("PageNotFound")),"function"==typeof e.onAppShow&&e.onAppShow(i("AppShow")),"function"==typeof e.onAppHide&&e.onAppHide(i("AppHide"))),e&&"function"==typeof e.onAppRoute&&e.onAppRoute(function(t){var e={type:"navigation",data:{level:t&&t.openType||"unknown",from:n||"unknown",to:t&&t.path||"unknown"}};r&&"function"==typeof r.addBehavior&&r.addBehavior(e),n=t&&t.path||""}),e&&"function"==typeof e.onError&&e.onError(this.reportBehavior.bind(this))}catch(t){util_1.warn("[arms] error in initBehavior",t)}return r=this,this.hasInitBehavior=!0,this}}})},ARMS_STORAGE_MINIPROGRAM_WX_UID_KEY="ARMS_STORAGE_MINIPROGRAM_WX_UID_KEY",WXLogger=function(t){return miniProgramLogger.call(this,t),this};WXLogger.prototype=util_1.$a2(miniProgramLogger.prototype),util_1.ext(miniProgramLogger._root.dftCon,{sendRequest:function(t,e){if("undefined"!=typeof wx&&wx&&"function"==typeof wx.request)try{var r,n="GET";e&&(n="POST",r=JSON.stringify(e)),wx.request({url:t,method:n,data:r,fail:function(t){util_1.warn("[arms] sendRequest fail",t)}})}catch(i){util_1.warn("[arms] error in conf sendRequest",i)}},getCurrentPage:function(){if("function"==typeof getCurrentPages)try{var t=getCurrentPages()||[],e=t[t.length-1];return e&&e.route||null}catch(r){util_1.warn("[arms] error in conf getCurrentPage",r)}}}),util_1.ext(WXLogger.prototype,{constructor:WXLogger,_super:miniProgramLogger,$b3:function(){this.setCommonInfo({app:"mini_wx"}),this.$bc(),this.$bd(),this.$be(),this.$b4()},$be:function(){if(this._conf&&this._conf.uid)this.setCommonInfo({uid:this._conf.uid});else if("undefined"!=typeof wx&&wx&&"function"==typeof wx.getStorageSync)try{var t=wx.getStorageSync(ARMS_STORAGE_MINIPROGRAM_WX_UID_KEY);if(t&&"string"==typeof t)this.setCommonInfo({uid:t});else if("function"==typeof wx.setStorageSync){var e=util_1.uu();wx.setStorageSync(ARMS_STORAGE_MINIPROGRAM_WX_UID_KEY,e),this.setCommonInfo({uid:e})}}catch(r){util_1.warn("[arms] error in $be",r)}},$bc:function(){if("undefined"!=typeof wx&&wx&&"function"==typeof wx.getSystemInfoSync)try{var t=wx.getSystemInfoSync();"object"==typeof t&&this.setCommonInfo({sr:(t.screenWidth||0)+"x"+(t.screenHeight||0),vp:(t.windowWidth||0)+"x"+(t.windowHeight||0),dpr:t.pixelRatio,ul:t.language})}catch(e){util_1.warn("[arms] error in $bc",e)}},$bd:function(){var t=this;if("undefined"!=typeof wx&&wx&&"function"==typeof wx.getNetworkType)try{wx.getNetworkType({success:function(e){e&&"string"==typeof e.networkType&&t.setCommonInfo({ct:e.networkType})},fail:function(t){util_1.warn("[arms] $bd getNetworkType fail",t)}})}catch(e){util_1.warn("[arms] error in $bd",e)}},hookApp:function(t){var e=this,r={onError:function(r){var n=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),i=t.onError;try{if(r&&"object"==typeof r&&e.error(r),r&&"string"==typeof r){var o=r.split("\n"),a="",s="";o.length>1&&(a=o[0]&&o[0].length<100?o[0]:o[0].substring(0,100),s=o[1]),e.error({name:a,message:s||r,stack:r})}}catch(r){util_1.warn("[arms] error in hookApp:onError",r)}if("function"==typeof i)return i.apply(this,n)},onLaunch:function(){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),n=t.onLaunch;try{e.appLaunch()}catch(i){util_1.warn("[arms] error in hookApp:onLaunch",i)}if("function"==typeof n)return n.apply(this,r)}};return util_1.ext({},t,r)}}),hook(WXLogger),"undefined"!=typeof wx&&wx&&behavior(WXLogger,wx);var singleton$1=null,generator$1=function(t){return singleton$1||(singleton$1=new WXLogger(t||{})),singleton$1};WXLogger.createExtraInstance=function(t){t&&"object"==typeof t?(t.disableHook=!0,t.behavior=!1):t={disableHook:!0,behavior:!1};return new WXLogger(t)},WXLogger.init=generator$1,WXLogger.singleton=generator$1,WXLogger._super=miniProgramLogger,WXLogger._root=miniProgramLogger._root,miniProgramLogger.WXLogger=WXLogger;var clazz=WXLogger;module.exports=clazz;
/** retcode cloud sdk | @version 1.8.20 | @copyright Alibaba Group Holding Limited. */ "use strict";Date.now=Date.now||function(){return(new Date).getTime()};var SEQUENCE=Date.now(),noop=function(){},$a1=function(){var t="object"==typeof console?console.warn:noop;try{var e={warn:t};e.warn.call(e)}catch(r){return noop}return t},util={noop:noop,warn:$a1(),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?",us:"https://retcode-us-west-1.arms.aliyuncs.com/r.png?"},defaultImgUrl:"https://arms-retcode.aliyuncs.com/r.png?",$a2:function(t){if(Object.create)return Object.create(t);var e=function(){};return e.prototype=t,new e},each:function(t,e){var r=0,n=t.length;if(this.T(t,"Array"))for(;r<n&&!1!==e.call(t[r],t[r],r);r++);else for(r in t)if(!1===e.call(t[r],t[r],r))break;return t},$a3:function(t,e,r){if("function"!=typeof t)return r;try{return t.apply(this,e)}catch(n){return r}},T:function(t,e){var r=Object.prototype.toString.call(t).substring(8).replace("]","");return e?r===e:r},$a4:function(t,e){if(!t)return"";if(!e)return t;var r=this,n=r.T(e);return"Function"===n?r.$a3(e,[t],t):"Array"===n?(this.each(e,function(e){t=r.$a4(t,e)}),t):"Object"===n?t.replace(e.rule,e.target||""):t.replace(e,"")},$a5:function(t,e){if(!t||!e)return!1;if((this.isString(e)||e.source||"Function"===this.T(e))&&(e=[e]),!this.isArray(e))return util.warn("[arms] invalid rules of ignore config, (list of) String/RegExp/Funcitons are available"),!1;for(var r,n=[],i=0,o=e.length;i<o;i++)if(r=e[i],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.$a3(r,[t],!1))return!0;var a=new RegExp(n.join("|"),"i");return!!(n.length&&a.test&&a.test(t))},J:function(t){if(!t||"string"!=typeof t)return t;var e=null;try{e=JSON.parse(t)}catch(r){}return e},pick:function(t){return 1===t||1===Math.ceil(Math.random()*t)},$a6:function(t){if("sample"in t){var e=t.sample,r=e;e&&/^\d+(\.\d+)?%$/.test(e)&&(r=parseInt(100/parseFloat(e))),0<r&&1>r&&(r=parseInt(1/r)),r>=1&&r<=100?t.sample=r:delete t.sample}return t},on:function(t,e,r,n,i){return t.addEventListener?(i=i||!1,t.addEventListener(e,function o(a){n&&t.removeEventListener(e,o,i),r.call(this,a)},i)):t.attachEvent&&t.attachEvent("on"+e,function a(i){n&&t.detachEvent("on"+e,a),r.call(this,i)}),this},off:function(t,e,r){return r?(t.removeEventListener?t.removeEventListener(e,r):t.detachEvent&&t.detachEvent(e,r),this):this},delay:function(t,e){return-1===e?(t(),null):setTimeout(t,e||0)},ext:function(t){for(var e=1,r=arguments.length;e<r;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},sub:function(t,e){var r={};return this.each(t,function(t,n){-1!==e.indexOf(n)&&(r[n]=t)}),r},uu:function(){for(var t,e,r=20,n=new Array(r),i=Date.now().toString(36).split("");r-- >0;)e=(t=36*Math.random()|0).toString(36),n[r]=t%3?e:e.toUpperCase();for(var o=0;o<8;o++)n.splice(3*o+2,0,i[o]);return n.join("")},seq:function(){return(SEQUENCE++).toString(36)},decode:function(t){try{t=decodeURIComponent(t)}catch(e){}return t},encode:function(t,e){try{t=e?encodeURIComponent(t).replace(/\(/g,"%28").replace(/\)/g,"%29"):encodeURIComponent(t)}catch(r){}return t},serialize:function(t){t=t||{};var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&t[r]!==undefined&&e.push(r+"="+this.encode(t[r],"msg"===r));return e.join("&")},$a7:function(t,e){if(!t||"string"!=typeof t)return!1;var r=/arms-retcode[\w-]*\.aliyuncs/.test(t);return!r&&e&&(r=/(\.png)|(\.gif)|(alicdn\.com)/.test(t)),!r},$a8:function(t){return!(!t||!t.message)&&!/failed[\w\s]+fetch/i.test(t.message)},$a9:function(t){return t&&"string"==typeof t?t.replace(/^(https?:)?\/\//,"").replace(/\?.*$/,""):""},$aa:function(t){return t&&"string"==typeof t?t.replace(/\?.*$/,""):""},$ab:function(t){return function(){return t+"() { [native code] }"}},checkSameOrigin:function(t,e){if(!e||!t)return!1;var r="//"+e.split("/")[2];return t===e||t.slice(0,e.length+1)===e+"/"||t===r||t.slice(0,r.length+1)===r+"/"||!/^(\/\/|http:|https:).*/.test(t)},getRandIP:function(){for(var t=[],e=0;e<4;e++){var r=Math.floor(256*Math.random());t[e]=(r>15?"":"0")+r.toString(16)}return t.join("").replace(/^0/,"1")},getSortNum:function(t){return t?(t+=1)>=1e3&&t<=9999?t:t<1e3?t+1e3:t%1e4+1e3:1e3},getRandNum:function(t){return t&&"string"==typeof t?t.length<5?this.getNum(5):t.substring(t.length-5):this.getNum(5)},getNum:function(t){for(var e=[],r=0;r<t;r++){var n=Math.floor(16*Math.random());e[r]=n.toString(16)}return e.join("")},getCurDomain:function(){return location&&location.hostname||""},parseFetchHeaders:function(t){if(!t)return{};var e={};try{if("function"==typeof t.keys)for(var r=t.keys(),n=r.next();!n.done;){var i=n.value;e[i]=t.get(i),n=r.next()}else e=t}catch(o){e={}}return e},parseXhrHeaders:function(t){if(!t&&"string"!=typeof t)return{};var e={};try{var r=t.split("\r\n");e=r.reduce(function(t,e){var r=e.split(": ");return t[r[0]]=r[1],t},{})}catch(n){e={}}return e},getQuerys:function(t){if(!t)return"";var e={},r=[],n="",i="";try{var o=[];if(t.indexOf("?")>=0&&(o=t.substring(t.indexOf("?")+1,t.length).split("&")),o.length>0)for(var a in o)n=(r=o[a].split("="))[0],i=r[1],e[n]=i}catch(s){e={}}return e},getFetchSnapshot:function(t,e,r){var n,i;try{var o=(t&&"string"!=typeof t[0]?t[0].url:t[0])||"",a=(t&&"string"!=typeof t[0]?t[0]:t[1])||{},s="POST"===a.method.toUpperCase()?a.body:this.getQuerys(o);n={originApi:o,method:a.method||"unknown",params:s,response:e||"",reqHeaders:this.parseFetchHeaders(a.headers||null),resHeaders:this.parseFetchHeaders(r)},i="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(n))||"{}"}catch(u){i="{}"}return i},getXhrSnapshot:function(t,e,r){if(!t||!e||!r)return{};var n,i;try{var o="";""===r.responseType||"text"===r.responseType?o=r.responseText:"document"===r.responseType&&(o=r.responseXML),n={originApi:t,method:e,params:this.getQuerys(t),response:o,reqHeaders:{},resHeaders:this.parseXhrHeaders("function"==typeof r.getAllResponseHeaders&&r.getAllResponseHeaders()||"")},i="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(n))||"{}"}catch(a){i="{}"}return i},isRobot:function(){var t=["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 e=navigator.userAgent.toLowerCase(),r=0;r<t.length;r++){var n=t[r];if(e.lastIndexOf(n)>=0)return!0}}catch(i){util.warn("[arms] useragent parse error")}return!1},isFunction:function(t){return"function"==typeof t},isPlainObject:function(t){return"[object Object]"===Object.prototype.toString.call(t)},isString:function(t){return"[object String]"===Object.prototype.toString.call(t)},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},joinRegExp:function(t){for(var e,r=[],n=0,i=t.length;n<i;n++)e=t[n],this.isString(e)?r.push(e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):e&&e.source&&r.push(e.source);return new RegExp(r.join("|"),"i")},reWriteMethod:function(t,e,r){if(null!==t){var n=t[e];t[e]=r(n)}},$ac:function(t,e){if(!t&&!e)return!1;if(new RegExp(this.selfErrKey,"i").test(t))return!0;return!!this.$a5(e,[/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/])},$ad:function(t){return{msg:t,message:this.selfErrKey}}},util_1=util,sendBeacon=function(t,e){"object"==typeof t&&(t=util_1.serialize(t));var r=e+t;window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?window.navigator.sendBeacon(r,"&post_res="):util_1.warn("[arms] navigator.sendBeacon not surported")},selfId="aokcdqn3ly@e629dabd48a9933",pushToQueue=function(t,e){var r;{if("error"!==e.t||!(r=t.$ae[0])||"error"!==r.t||e.msg!==r.msg){if("behavior"===e.t){var n=t.$ae&&t.$ae.length;if(n>0&&"behavior"===t.$ae[n-1].t){var i=e.behavior||[];t.$ae[n-1].behavior.concat(i)}else t.$ae.push(e)}else t.$ae.unshift(e);return t.$af(function(){t.$ag=util_1.delay(function(){t.$ah()},t.$ae[0]&&"error"===t.$ae[0].t?3e3:-1)}),!0}r.times++}},Base=function(t){return this.ver="1.8.20",this._conf=util_1.ext({},Base.dftCon),this.$ai={},this.$ae=[],this.$aj=[],this.sdkFlag=!0,this.hash=util_1.seq(),this.$ak(),this.setConfig(t),this.rip=util_1.getRandIP(),this.record=999,this["EagleEye-TraceID"]=this.getTraceId()["EagleEye-TraceID"],this._common={},this};Base.dftCon={sample:1,pvSample:1,tag:"",imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",region:null,ignore:{ignoreUrls:[],ignoreApis:[],ignoreErrors:[/^Script error\.?$/]},release:undefined,environment:"prod"},Base.prototype={constructor:Base,$af:function(t){return t()},$al:function(){var t=this._conf.page;return util_1.$a3(t,[],t+"")},setPage:function(){},setConfig:function(t){t&&"object"==typeof t&&(util_1.$a6(t),t=this.$am(t),this._conf=util_1.ext({},this._conf,t))},$am:function(t){var e=t.region,r=t.imgUrl;if(e){var n=util_1.regionMap[e];return t.imgUrl=n||util_1.defaultImgUrl,t}return r&&(t.imgUrl=r),t},$an:function(t){if(this.getConfig("debug"))return!0;var e=util_1.regionMap,r=!1;for(var n in e)if(e[n]===t){r=!0;break}return!r&&util_1.warn("[retcode] invalid url: "+t),r},$ao:function(){},$ap:function(t){sendBeacon(t,this.getConfig("imgUrl"))},$aq:function(){},$ar:function(){return{}},setCommonInfo:function(t){t&&"object"==typeof t&&(this._common=util_1.ext({},this._common,t))},$ak:function(){this.pageview=util_1.uu(),this.sBegin=Date.now()},$as:function(){if(this.username)return this.username;var t=this._conf,e=t&&t.setUsername;if("function"==typeof e)try{var r=e();"string"==typeof r&&(r=r.substr(0,20),this.username=r)}catch(n){util_1.warn("[arms] setUsername fail",n)}return this.username},getTraceId:function(){var t=this.rip,e=Date.now(),r=util_1.getSortNum(this.record),n=t+e+r+util_1.getRandNum(this._conf.pid);return this["EagleEye-TraceID"]=n,this.record=r,{"EagleEye-TraceID":n}},getUberTraceId:function(t){var e=this.rip,r=Date.now(),n=util_1.getSortNum(this.record),i=util_1.getRandNum(this._conf.pid),o=e+r+n+util_1.getNum(2)+i,a=o.substring(0,16);return t=t?"1":"0",{"uber-trace-id":o+":"+a+":0:"+t,traceId:o}},getPageviewId:function(){return{"EagleEye-SessionID":this.pageview}},getConfig:function(t){return t?this._conf[t]:util_1.ext({},this._conf)},$at:function(t){return 1===t||("boolean"==typeof this.$ai[t]?this.$ai[t]:(this.$ai[t]=util_1.pick(t),this.$ai[t]))},$ah:function(t){var e;clearTimeout(this.$ag),this.$ag=null;for(var r=this._conf&&"function"==typeof this._conf.sendRequest;e=this.$ae.pop();)"res"===e.t?this.$aq(e,"res"):"error"===e.t?this.$aq(e,"err"):"api"===e.t?this.$aq(e,"apiSnapshot"):"behavior"===e.t?this.$aq(e,"behavior"):"health"===e.t&&!r&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?this.$ap(e):this.$ao(e);return t&&this.$au(),this},$au:function(){var t;for(clearTimeout(this.$av),this.$av=null;t=this.$aj.pop();)this.$aq(t,"err");return this},_lg:function(t,e,r,n){var i=this._conf,o=this.$al(),a=i.ignore||{},s=a.ignoreErrors,u=a.ignoreUrls,c=a.ignoreApis;return this._isRobot?this:util_1.$a5(o,u)||util_1.$a5(util_1.decode(o),u)?this:"error"===t&&(util_1.$a5(e.msg,s)||util_1.$a5(util_1.decode(e.msg),s))?this:"api"===t&&(util_1.$a5(e.api,c)||util_1.$a5(util_1.decode(e.api),c))?this:this.$an(i.imgUrl)&&e&&!i.disabled&&i.pid?0===n?this:(e=util_1.ext({t:t,times:1,page:o,tag:i.tag||"",release:i.release||"",environment:i.environment,begin:Date.now(),c1:i.c1,c2:i.c2,c3:i.c3},e,this.$ar(),this._common,{pid:i.pid,_v:this.ver,pv_id:this.pageview,username:this.$as(),sampling:r||1,z:util_1.seq()}),1===n?pushToQueue(this,e):r&&!this.$at(r)?this:pushToQueue(this,e)):this},_self:function(t,e,r){var n=this,i=n._conf;if("error"!==t)return n;if(!n.$an(i.imgUrl))return n;if(!e||i.disabled||!i.pid||!selfId)return n;if(r&&!n.$at(r))return n;e=util_1.ext({t:t,times:1,page:util_1.selfErrPage,tag:i.pid,begin:Date.now()},e,{pid:selfId,_v:n.ver,sampling:r||1,z:util_1.seq()});var o=n.$aj[0];if(o){o.times++;try{if(o.err&&e.err&&o.err.msg_raw&&e.err.msg_raw){o.err.msg_raw.split("&").indexOf(e.err.msg_raw)<0&&o.err.msg_raw.length<1e3&&(o.err.msg_raw+="&"+e.err.msg_raw)}}catch(a){}}else n.$aj.unshift(e),n.$af(function(){n.sdkFlag&&(n.sdkFlag=!1,n.$av=util_1.delay(function(){n.$au()},1e4))})},custom:function(t,e){if(!t||"object"!=typeof t)return this;var r=!1,n={begin:Date.now()};return util_1.each(t,function(t,e){return!(r=e&&e.length<=20)&&util_1.warn("[retcode] invalid key: "+e),n["x-"+e]=t,r}),r?this._lg("custom",n,e||1):this}};var base=Base,validApiKeys=["api","success","time","code","msg","trace","traceId","begin","pv_id","sid","seq","domain","flag"],parseStatData=function(t,e){var r=t.split("::");return r.length>1?util_1.ext({group:r[0],key:r[1]},e):util_1.ext({group:"default_group",key:r[0]},e)},Reporter=function(t){base.call(this,t);var e;try{e="object"==typeof performance?performance.timing.fetchStart:Date.now()}catch(r){e=Date.now()}return this._startTime=e,this};Reporter.prototype=util_1.$a2(base.prototype),util_1.ext(base.dftCon,{startTime:null}),util_1.ext(Reporter.prototype,{constructor:Reporter,_super:base,sum:function(t,e,r){try{return this._lg("sum",parseStatData(t,{val:e||1,begin:Date.now()}),r)}catch(n){util_1.warn("[retcode] can not get parseStatData: "+n)}},avg:function(t,e,r){try{return this._lg("avg",parseStatData(t,{val:e||0,begin:Date.now()}),r)}catch(n){util_1.warn("[retcode] can not get parseStatData: "+n)}},percent:function(t,e,r,n){try{return this._lg("percent",parseStatData(t,{subkey:e,val:r||0,begin:Date.now()}),n)}catch(i){util_1.warn("[retcode] can not get parseStatData: "+i)}},msg:function(t,e){if(t&&!(t.length>180))return this.custom({msg:t},e)},error:function(t,e){if(!t)return util_1.warn("[retcode] invalid param e: "+t),this;1===arguments.length?("string"==typeof t&&(t={message:t},e={}),"object"==typeof t&&(e=t=t.error||t)):("string"==typeof t&&(t={message:t}),"object"!=typeof e&&(e={}));var r=t.name||"CustomError",n=t.message||"",i=t.stack||"";e=e||{};if(util_1.$ac(n,e.filename)){var o=/^Script error\.?$/,a=t.msg||t.message;if(util_1.$a5(a,o)||util_1.$a5(util_1.decode(a),o))return this;var s={msg:util_1.selfErrKey,err:{msg_raw:util_1.encode(t.msg||t.message)}};return this._self("error",s,1)}var u={begin:Date.now(),cate:r,msg:n&&n.substring(0,1e3),stack:i&&i.substring(0,1e3),file:util_1.$aa(e.filename||""),line:e.lineno||"",col:e.colno||"",err:{msg_raw:util_1.encode(n),stack_raw:util_1.encode(i)},tag:e.tag||"",c1:e.c1,c2:e.c2,c3:e.c3},c=(this.getConfig("ignore")||{}).ignoreErrors;return util_1.$a5(u.msg,c)||util_1.$a5(util_1.decode(u.msg),c)?this:(this.$ay&&this.$ay("error",u),this._lg("error",u,1))},behavior:function(t){if(t){var e="object"==typeof t&&t.behavior?t:{behavior:t};return this.$ay&&this.$ay("behavior",e),this._lg("behavior",e,1)}},api:function(t,e,r,n,i,o,a,s,u,c,f,l){if(!t)return util_1.warn("[retcode] api is null"),this;if(t="string"==typeof t?{api:t,success:e,time:r,code:n,msg:i,begin:o,traceId:a,pv_id:s,apiSnapshot:u,domain:c,flag:l}:util_1.sub(t,validApiKeys),!util_1.$a7(t.api,!0))return this;t.code=t.code||"";var g=t.msg||"";if(g="string"==typeof g?g.substring(0,1e3):g,t.msg=g,t.success=t.success?1:0,t.time=+t.time,t.begin=t.begin,t.traceId=t.traceId||"",t.pv_id=t.pv_id||"",t.domain=t.domain||"",t.flag=t.flag,t.success?t.apiSnapshot&&delete t.apiSnapshot:t.apiSnapshot=u,f&&(t.traceOrigin=f),!t.api||isNaN(t.time))return util_1.warn("[retcode] invalid time or api"),this;var p=(this.getConfig("ignore")||{}).ignoreApis;return util_1.$a5(t.api,p)||util_1.$a5(util_1.decode(t.api),p)?this:(this.$ay&&this.$ay("api",t),this._lg("api",t,t.success&&this.getConfig("sample"),t.flag))},speed:function(t,e,r){var n=this,i=this.getConfig("startTime")||this._startTime;return/^s(\d|1[0])$/.test(t)?(e="number"!=typeof e?Date.now()-i:e>=i?e-i:e,n.$aw=n.$aw||{},n.$aw[t]=e,n.$aw.begin=i,clearTimeout(n.$ax),n.$ax=setTimeout(function(){r||(n.$aw.page=n.$al(!0)),n._lg("speed",n.$aw),n.$aw=null},5e3),n):(util_1.warn("[retcode] invalid point: "+t),n)},performance:function(t){if(t&&"object"==typeof t&&!this.$az){var e={},r={},n=this.getConfig("autoSendPerf");if(t.autoSend&&n)return r=util_1.ext(this.$b0||{},t),this.$az=!0,this._lg("perf",r,this.getConfig("sample"));if(t.autoSend&&!n)return delete t.autoSend,this.$b0?(r=util_1.ext(this.$b0||{},t),this.$az=!0,this._lg("perf",r,this.getConfig("sample"))):void(this.$b0=t);for(var i in t)(/^t([1-9]|1[0])$/.test(i)||"ctti"===i||"cfpt"===i)&&(e[i]=t[i]);if(!0===t.autoSend||!n&&(n||this.$b0))return!0!==t.autoSend&&!1===n&&this.$b0?(e=util_1.ext(this.$b0||{},e),this.$az=!0,this._lg("perf",e,this.getConfig("sample"))):void 0;this.$b0=util_1.ext(this.$b0||{},e)}},resource:function(t,e){if(!t||!util_1.isPlainObject(t))return util_1.warn("[arms] invalid param data: "+t),this;var r=Object.keys(t),n=["begin","dom","load","res","dl"],i=!1;for(var o in n){if(r.indexOf(n[o])<0){i=!0;break}}if(i)return util_1.warn("[arms] lack param data: "+t),this;var a={begin:t.begin||Date.now(),dom:t.dom||"",load:t.load||"",res:util_1.isArray(t.res)?JSON.stringify(t.res):JSON.stringify([]),dl:t.dl||""};return this._lg("res",a,e)}}),Reporter._super=base,Reporter._root=base,base.Reporter=Reporter;var reporter=Reporter,MiniProgramLogger=function(t){t&&t.pid||util_1.warn("[arms] pid is a required prop to instatiate MiniProgramLogger");var e=this;return reporter.call(e,t),e.appBegin=Date.now(),e._health={errcount:0,apisucc:0,apifail:0},e.DEFAUT_PAGE_PATH="[app]",e.isSendPerf=!1,e.$ay=function(t,r){"error"===t?e._health.errcount++:"api"===t&&e._health[r.success?"apisucc":"apifail"]++},"function"==typeof e.$b1&&e.$b1(),e._conf&&e._conf.behavior&&"function"==typeof e.$b2&&e.$b2(),"function"==typeof e.$b3&&e.$b3(),this};MiniProgramLogger.prototype=util_1.$a2(reporter.prototype),util_1.ext(reporter._root.dftCon,{uid:null,setUsername:null,disableHook:!1,enableLinkTrace:!1,behavior:!1,enableConsole:!1,sendRequest:function(){},getCurrentPage:function(){}}),util_1.ext(MiniProgramLogger.prototype,{constructor:MiniProgramLogger,_super:reporter,$af:function(t){t()},$ao:function(t,e){if(this.getConfig("debug"))"undefined"!=typeof console&&console&&"function"==typeof console.log&&console.log("[arms] [DEBUG MODE] log data",t);else{var r=this.getConfig("imgUrl");"object"==typeof t&&(t=util_1.serialize(t));var n=r+t;e&&(n+="&post_res=");var i=this._conf.sendRequest;if("function"==typeof i)try{i(n,e)}catch(o){util_1.warn("[arms] error in $ao",o)}}},$aq:function(t,e){var r={};r[e]=t[e],delete t[e],this.$ao(t,r)},$al:function(){var t=this._conf.getCurrentPage;if("function"==typeof t)try{var e=t();if(e&&"string"==typeof e)return e}catch(r){util_1.warn("[arms] error in $al",r)}return"string"==typeof t&&t?t:this.DEFAUT_PAGE_PATH},$b4:function(){this.setCommonInfo({sid:util_1.uu()})},setConfig:function(t){if(t&&"object"==typeof t){util_1.$a6(t),t=this.$am(t);var e=this._conf;this._conf=util_1.ext({},this._conf,t);var r="disableHook";r in t&&e[r]!==t[r]&&(t[r]?"function"==typeof this.removeHook&&this.removeHook():"function"==typeof this.addHook&&this.addHook())}},appLaunch:function(){this.appBegin=Date.now()},pageShow:function(){var t=this;t.$ak(),t.$b5(),clearTimeout(t.$b6),t.$b7(),t.$b6=setTimeout(function(){t.$b8()},50),t.pvPage=t.$al()},pageHide:function(){this.$b7()},addHook:function(){return this},removeHook:function(){return this},hookApp:function(t){var e=this,r={onLaunch:function(){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),n=t.onLaunch;try{e.appLaunch()}catch(i){util_1.warn("[arms] error in hookApp:onLaunch",i)}if("function"==typeof n)return n.apply(this,r)},onError:function(r){var n=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),i=t.onError;try{e.error(r),e.getConfig("behavior")&&"function"==typeof e.reportBehavior&&e.reportBehavior()}catch(r){util_1.warn("[arms] error in hookApp:onError",r)}if("function"==typeof i)return i.apply(this,n)}};return util_1.ext({},t,r)},hookPage:function(t){var e=this,r={onShow:function(){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),n=t.onShow;try{e.pageShow()}catch(i){util_1.warn("[arms] error in hookPage:pageShow",i)}if("function"==typeof n)return n.apply(this,r)},onHide:function(){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),n=t.onHide;try{e.pageHide()}catch(i){util_1.warn("[arms] error in hookPage:onHide",i)}if("function"==typeof n)return n.apply(this,r)},onUnload:function(){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),n=t.onUnload;try{e.pageHide()}catch(i){util_1.warn("[arms] error in hookPage:onUnload",i)}if("function"==typeof n)return n.apply(this,r)}};return util_1.ext({},t,r)},$b1:function(){},$b3:function(){this.setCommonInfo({app:"mini_common",uid:this._conf.uid})},$b8:function(){var t=this;t.$af(function(){t._lg("pv",{},t.getConfig("pvSample"))})},$b5:function(){var t=this;t.isSendPerf||(t.$af(function(){var e={fpt:Date.now()-t.appBegin};t._lg("perf",e,t.getConfig("sample"))}),t.isSendPerf=!0)},$b7:function(){this.$b9(),this.$aw&&(this._lg("speed",this.$aw),this.$aw=null,clearTimeout(this.$ax)),this.$ah(!0)},$b9:function(){if(this.pvPage){var t=util_1.ext({},this._health);t.healthy=t.errcount>0?0:1,t.begin=Date.now();var e=t.begin-this.sBegin;t.page=this.pvPage,t.stay=e,this._lg("health",t,1),this._health={errcount:0,apisucc:0,apifail:0},this.pvPage=null}}});var singleton=null,generator=function(t){return singleton||(singleton=new MiniProgramLogger(t||{})),singleton};MiniProgramLogger.createExtraInstance=function(t){t&&"object"==typeof t?(t.disableHook=!0,t.behavior=!1):t={disableHook:!0,behavior:!1};return new MiniProgramLogger(t)},MiniProgramLogger.init=generator,MiniProgramLogger.singleton=generator,MiniProgramLogger._super=reporter,MiniProgramLogger._root=reporter._root,reporter.MiniProgramLogger=MiniProgramLogger;var miniProgramLogger=MiniProgramLogger,hook=function(t){var e=util_1,r=null,n={};return e.ext(t.prototype,{addHook:function(){return this.isHookInstantiated?this:(function(){var t=this;if("undefined"!=typeof wx&&wx&&"function"==typeof wx.request){r=wx;var i={request:function(r){var n=(new Date).getTime();if(r&&"object"==typeof r&&r[0]){var i,o,a=r[0],s=e.$a9(a.url),u=a.success,c=a.fail,f=a&&a.header;f&&"object"==typeof f||(f={});var l={};if(t.getConfig("enableLinkTrace")){var g=f["EagleEye-pAppName"];if(i=f["EagleEye-TraceID"],o=f["EagleEye-SessionID"],i||(i=t.getTraceId()["EagleEye-TraceID"],l["EagleEye-TraceID"]=i),o||(o=t.getPageviewId()["EagleEye-SessionID"],l["EagleEye-SessionID"]=o),!g){var p=t.getConfig("pid");l["EagleEye-pAppName"]=p}}a.success=function(){var a=(new Date).getTime();if(e.$a7(s,!0)){var c=arguments&&arguments[0]&&arguments[0].statusCode||200;t.api({api:r[0].url,success:!0,time:a-n,code:c,begin:n,traceId:i,pv_id:o})}u&&u.apply(t,[].slice.call(arguments))},a.fail=function(){var a=(new Date).getTime();if(e.$a7(s,!0)){var u="";arguments&&arguments[0]&&"object"==typeof arguments[0]&&(u=(u=JSON.stringify(arguments[0])).substring(0,1e3));var f=arguments&&arguments[0]&&arguments[0].statusCode||"FAILED";t.api({api:r[0].url,success:!1,time:a-n,code:f,msg:u,begin:n,traceId:i,pv_id:o})}c&&c.apply(t,[].slice.call(arguments))},a.header=e.ext({},f,l)}}};for(var o in wx)if(i[o]){var a=o.toString();n[a]=function(){return i[a](arguments),r[a].apply(r,[].slice.call(arguments))}}else n[o]=r[o];wx=n}}.call(this),this.isHookInstantiated=!0,this)},removeHook:function(){return this.isHookInstantiated?(function(){"undefined"!=typeof wx&&wx&&r&&(wx=r,r=null)}.call(this),this.isHookInstantiated=!1,this):this},$b1:function(){return this.$ba?this:(this.getConfig("disableHook")||this.addHook(),this.$ba=!0,this)}}),t},miniBehavior=function(t){var e=[],r=util_1.reWriteMethod,n={consoleBehavior:function(){if(console){var t=["debug","info","warn","log","error"],e=null;if(Function&&(e=Function.prototype.apply||Function.apply),"function"==typeof e)for(var n=this,i=0;i<t.length;i++){var o=t[i];"function"==typeof console[o]&&r(console,o,function(t){var r=o;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s={type:"console",data:{level:r,message:o}};n&&"function"==typeof n.addBehavior&&n.addBehavior(s),"function"==typeof t&&e.call(t,console,o)}})}}}};return util_1.ext(t.prototype,{addBehavior:function(t){if(this.getConfig("behavior")&&t&&"object"==typeof t){var r="";this._conf&&"function"==typeof this._conf.getCurrentPage&&(r=this._conf.getCurrentPage());var n=null;try{n=Date.now()}catch(s){return void util_1.warn("[arms] error in Date.now",s)}var i={},o=t.data||{};if(t.type)i=o;else{if("string"!=typeof o.name||"string"!=typeof o.message)return;i.name=o.name.substr(0,20),i.message=o.message.substr(0,200)}i.message&&(i.message=util_1.encode(i.message));var a={type:t.type||"custom",data:i||{},timestamp:t.timestamp||n,page:t.page||r};return e.push(a),e=e.slice(-100)}},getBehavior:function(){return e||[]},setBehavior:function(t){return t&&(e=t),e},reportBehavior:function(){var t=this;t.getConfig("behavior")&&(t.$bb&&(clearTimeout(t.$bb),t.$bb=undefined),t.$bb=setTimeout(function(){e&&e.length>0&&("function"==typeof t.behavior&&t.behavior(e),e=[])},0))},$b2:function(){}}),n},behavior=function(t,e){var r=null,n="",i=function(t){return function(){if(t&&r){var e=r,n=t+"timmer";e[n]&&(clearTimeout(e[n]),e[n]=undefined),e[n]=setTimeout(function(){"function"==typeof e.addBehavior&&e.addBehavior({type:"ui.default",data:{level:t}})},100)}}},o=miniBehavior(t)||{};util_1.ext(t.prototype,{$b2:function(){if(!this.hasInitBehavior&&!r&&void 0!==e&&e){try{this.getConfig("enableConsole")&&"function"==typeof o.consoleBehavior&&o.consoleBehavior.call(this),e&&("function"==typeof e.onKeyboardHeightChange&&e.onKeyboardHeightChange(i("KeyboardHeightChange")),"function"==typeof e.onPageNotFound&&e.onPageNotFound(i("PageNotFound")),"function"==typeof e.onAppShow&&e.onAppShow(i("AppShow")),"function"==typeof e.onAppHide&&e.onAppHide(i("AppHide"))),e&&"function"==typeof e.onAppRoute&&e.onAppRoute(function(t){var e={type:"navigation",data:{level:t&&t.openType||"unknown",from:n||"unknown",to:t&&t.path||"unknown"}};r&&"function"==typeof r.addBehavior&&r.addBehavior(e),n=t&&t.path||""}),e&&"function"==typeof e.onError&&e.onError(this.reportBehavior.bind(this))}catch(t){util_1.warn("[arms] error in initBehavior",t)}return r=this,this.hasInitBehavior=!0,this}}})},ARMS_STORAGE_MINIPROGRAM_WX_UID_KEY="ARMS_STORAGE_MINIPROGRAM_WX_UID_KEY",WXLogger=function(t){return miniProgramLogger.call(this,t),this};WXLogger.prototype=util_1.$a2(miniProgramLogger.prototype),util_1.ext(miniProgramLogger._root.dftCon,{sendRequest:function(t,e){if("undefined"!=typeof wx&&wx&&"function"==typeof wx.request)try{var r,n="GET";e&&(n="POST",r=JSON.stringify(e)),wx.request({url:t,method:n,data:r,fail:function(t){util_1.warn("[arms] sendRequest fail",t)}})}catch(i){util_1.warn("[arms] error in conf sendRequest",i)}},getCurrentPage:function(){if("function"==typeof getCurrentPages)try{var t=getCurrentPages()||[],e=t[t.length-1];return e&&e.route||null}catch(r){util_1.warn("[arms] error in conf getCurrentPage",r)}}}),util_1.ext(WXLogger.prototype,{constructor:WXLogger,_super:miniProgramLogger,$b3:function(){this.setCommonInfo({app:"mini_wx"}),this.$bc(),this.$bd(),this.$be(),this.$b4()},$be:function(){if(this._conf&&this._conf.uid)this.setCommonInfo({uid:this._conf.uid});else if("undefined"!=typeof wx&&wx&&"function"==typeof wx.getStorageSync)try{var t=wx.getStorageSync(ARMS_STORAGE_MINIPROGRAM_WX_UID_KEY);if(t&&"string"==typeof t)this.setCommonInfo({uid:t});else if("function"==typeof wx.setStorageSync){var e=util_1.uu();wx.setStorageSync(ARMS_STORAGE_MINIPROGRAM_WX_UID_KEY,e),this.setCommonInfo({uid:e})}}catch(r){util_1.warn("[arms] error in $be",r)}},$bc:function(){if("undefined"!=typeof wx&&wx&&"function"==typeof wx.getSystemInfoSync)try{var t=wx.getSystemInfoSync();"object"==typeof t&&this.setCommonInfo({sr:(t.screenWidth||0)+"x"+(t.screenHeight||0),vp:(t.windowWidth||0)+"x"+(t.windowHeight||0),dpr:t.pixelRatio,ul:t.language})}catch(e){util_1.warn("[arms] error in $bc",e)}},$bd:function(){var t=this;if("undefined"!=typeof wx&&wx&&"function"==typeof wx.getNetworkType)try{wx.getNetworkType({success:function(e){e&&"string"==typeof e.networkType&&t.setCommonInfo({ct:e.networkType})},fail:function(t){util_1.warn("[arms] $bd getNetworkType fail",t)}})}catch(e){util_1.warn("[arms] error in $bd",e)}},hookApp:function(t){var e=this,r={onError:function(r){var n=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),i=t.onError;try{if(r&&"object"==typeof r&&e.error(r),r&&"string"==typeof r){var o=r.split("\n"),a="",s="";o.length>1&&(a=o[0]&&o[0].length<100?o[0]:o[0].substring(0,100),s=o[1]),e.error({name:a,message:s||r,stack:r})}}catch(r){util_1.warn("[arms] error in hookApp:onError",r)}if("function"==typeof i)return i.apply(this,n)},onLaunch:function(){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),n=t.onLaunch;try{e.appLaunch()}catch(i){util_1.warn("[arms] error in hookApp:onLaunch",i)}if("function"==typeof n)return n.apply(this,r)}};return util_1.ext({},t,r)}}),hook(WXLogger),"undefined"!=typeof wx&&wx&&behavior(WXLogger,wx);var singleton$1=null,generator$1=function(t){return singleton$1||(singleton$1=new WXLogger(t||{})),singleton$1};WXLogger.createExtraInstance=function(t){t&&"object"==typeof t?(t.disableHook=!0,t.behavior=!1):t={disableHook:!0,behavior:!1};return new WXLogger(t)},WXLogger.init=generator$1,WXLogger.singleton=generator$1,WXLogger._super=miniProgramLogger,WXLogger._root=miniProgramLogger._root,miniProgramLogger.WXLogger=WXLogger;var clazz=WXLogger;module.exports=clazz;
{
"name": "alife-logger",
"version": "1.8.18",
"version": "1.8.20",
"description": "retcode cloud sdk",

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

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