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.3 to 1.8.4-alpha

.nyc_output/136a8329-e9fc-4f43-9504-a45a91de8fcd.json

2

lib/base.js

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

}, Base = function(e) {
return this.ver = "1.8.3", this._conf = util.ext({}, Base.dftCon), this.sampleCache = {},
return this.ver = "1.8.4-alpha", this._conf = util.ext({}, Base.dftCon), this.sampleCache = {},
this.requestQueue = [], this.hash = util.seq(), this.resetSession(), this.setConfig(e),

@@ -24,0 +24,0 @@ this.rip = util.getRandIP(), this.record = 999, this["EagleEye-TraceID"] = this.getTraceId()["EagleEye-TraceID"],

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

/** retcode cloud sdk | @version 1.8.3 | @copyright Alibaba Group Holding Limited. */ !function(){function e(t,n,r){function a(i,s){if(!n[i]){if(!t[i]){var c="function"==typeof require&&require;if(!s&&c)return c(i,!0);if(o)return o(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[i]={exports:{}};t[i][0].call(f.exports,function(e){return a(t[i][1][e]||e)},f,f.exports,e,t,n,r)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;i<r.length;i++)a(r[i]);return a}return e}()({1:[function(e,t,n){var r=e("./util"),a=e("./common/sendBeacon"),o=function(e){return this.ver="1.8.3",this._conf=r.ext({},o.dftCon),this.$a5={},this.$a1=[],this.hash=r.seq(),this.$a6(),this.setConfig(e),this.rip=r.getRandIP(),this.record=999,this["EagleEye-TraceID"]=this.getTraceId()["EagleEye-TraceID"],this._common={},this};o.dftCon={sample:1,pvSample:1,tag:"",imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",region:null,ignore:{ignoreUrls:[],ignoreApis:[],ignoreErrors:[]},release:undefined,environment:"production"},o.prototype={constructor:o,$a2:function(e){return e()},$a7:function(){var e=this._conf.page;return r.$a8(e,[],e+"")},setPage:function(){},setConfig:function(e){e&&"object"==typeof e&&(r.$a9(e),e=this.$aa(e),this._conf=r.ext({},this._conf,e))},$aa:function(e){var t=e.region,n=e.imgUrl;if(t){var a=r.regionMap[t];return e.imgUrl=a||r.defaultImgUrl,e}return n&&(e.imgUrl=n),e},$ab:function(e){if(this.getConfig("debug"))return!0;var t=r.regionMap,n=!1;for(var a in t)if(t[a]===e){n=!0;break}return!n&&r.warn("[retcode] invalid url: "+e),n},$ac:function(){},$ad:function(e){a(e,this.getConfig("imgUrl"))},$ae:function(){},$af:function(){return{}},setCommonInfo:function(e){e&&"object"==typeof e&&(this._common=r.ext({},this._common,e))},$a6:function(){this.session=r.uu(),this.sBegin=Date.now()},getTraceId:function(){var e=this.rip,t=Date.now(),n=r.getSortNum(this.record),a=e+t+n+r.getRandNum(this._conf.pid);return this["EagleEye-TraceID"]=a,this.record=n,{"EagleEye-TraceID":a}},getSessionId:function(){return{"EagleEye-SessionID":this.session}},getConfig:function(e){return e?this._conf[e]:r.ext({},this._conf)},$ag:function(e){return 1===e||("boolean"==typeof this.$a5[e]?this.$a5[e]:(this.$a5[e]=r.pick(e),this.$a5[e]))},$a4:function(){var e;clearTimeout(this.$a3),this.$a3=null;for(var t=this._conf&&"function"==typeof this._conf.sendRequest;e=this.$a1.pop();)"res"===e.t?this.$ae(e,"res"):"error"===e.t?this.$ae(e,"err"):"api"===e.t?this.$ae(e,"apiSnapshot"):"behavior"===e.t?this.$ae(e,"behavior"):"health"===e.t&&!t&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?this.$ad(e):this.$ac(e);return this},_lg:function(e,t,n){var a=this._conf,o=this.$a7(),i=a.ignore||{},s=i.ignoreErrors,c=i.ignoreUrls,u=i.ignoreApis;return r.$ah(o,c)||r.$ah(r.decode(o),c)?this:"error"===e&&(r.$ah(t.msg,s)||r.$ah(r.decode(t.msg),s))?this:"api"===e&&(r.$ah(t.api,u)||r.$ah(r.decode(t.api),u))?this:this.$ab(a.imgUrl)&&t&&!a.disabled&&a.pid?n&&!this.$ag(n)?this:(t=r.ext({t:e,times:1,page:o,tag:a.tag||"",release:a.release||"",environment:a.environment,begin:Date.now()},t,this.$af(),this._common,{pid:a.pid,_v:this.ver,sid:this.session,sampling:n||1,z:r.seq(),c1:a.c1,c2:a.c2,c3:a.c3}),function(e,t){var n;{if("error"!==t.t||!(n=e.$a1[0])||"error"!==n.t||t.msg!==n.msg){if("behavior"===t.t){var a=e.$a1&&e.$a1.length;if(a>0&&"behavior"===e.$a1[a-1].t){var o=t.behavior||[];e.$a1[a-1].behavior.concat(o)}else e.$a1.push(t)}else e.$a1.unshift(t);return e.$a2(function(){e.$a3=r.delay(function(){e.$a4()},e.$a1[0]&&"error"===e.$a1[0].t?3e3:-1)}),!0}n.times++}}(this,t)):this},custom:function(e,t){if(!e||"object"!=typeof e)return this;var n=!1,a={begin:Date.now()};return r.each(e,function(e,t){return!(n=t&&t.length<=20)&&r.warn("[retcode] invalid key: "+t),a["x-"+t]=e,n}),n?this._lg("custom",a,t||1):this}},t.exports=o},{"./common/sendBeacon":12,"./util":16}],2:[function(e,t,n){var r=e("../util");t.exports=function(e,t){var n=[],a=null,o=t&&t.location&&t.location.href,i=0,s=undefined,c=null,u=function(e,t,n){if(null!==e){var r=e[t];e[t]=n(r)}},f=function(e){var t,n,r,a,o,i=[];if(!e||!e.tagName)return"";if(i.push(e.tagName.toLowerCase()),e.id&&"[object String]"===Object.prototype.toString.call(e.id)&&i.push("#".concat(e.id)),(t=e.className)&&"[object String]"===Object.prototype.toString.call(t))for(n=t.split(/\s+/),o=0;o<n.length;o++)i.push(".".concat(n[o]));var s=["type","name","title","alt"];for(o=0;o<s.length;o++)r=s[o],(a=e.getAttribute(r))&&"[object String]"===Object.prototype.toString.call(a)&&i.push("[".concat(r,'="').concat(a,'"]'));return i.join("")},l=function(e,t){return function(n){if(n&&n!==c){c=n;var r;try{r=n.target}catch(u){r="<unknown>"}if(0!==r.length){var o={type:"ui.".concat(e),data:{message:function(e){if(!e||1!==e.nodeType)return"";for(var t=e||null,n=[],r=0,a=0,o=" > ".length,i="";t&&r++<5&&!("html"===(i=f(t))||r>1&&a+n.length*o+i.length>=80);)n.push(i),a+=i.length,t=t.parentNode;return n.reverse().join(" > ")}(r)},timestamp:Date.now()};"click"===e?(i&&clearTimeout(i),t?i=setTimeout(function(){a&&a.addBehavior(o)},0):a&&a.addBehavior(o)):"keypress"===e&&(s||a&&a.addBehavior(o),clearTimeout(s),s=setTimeout(function(){s=undefined},100))}}}},p=function(){if(function(){var e=t&&t.chrome,n=e&&e.app&&e.app.runtime,r="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!n&&r}()){var e=function(e,t){var n={type:"navigation",data:{from:e,to:t}};a&&a.addBehavior(n),o=t},n=t.onpopstate;t.onpopstate=function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var s=t.location.href;if(e(o,s),n)return n.apply(this,a)};var r=function(t){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];var i=r.length>2?r[2]:undefined;return i&&e(o,String(i)),t.apply(this,r)}};u(t.history,"pushState",r),u(t.history,"replaceState",r)}};r.ext(e.prototype,{addBehavior:function(e){if(this.getConfig("behavior")&&e&&"object"==typeof e){var a={},o=e.data||{};if(e.type)a=o;else{if("string"!=typeof o.name||"string"!=typeof o.message)return;a.name=o.name.substr(0,20),a.message=o.message.substr(0,200)}a.message&&(a.message=r.encode(a.message));var i={type:e.type||"custom",data:a||{},timestamp:e.timestamp||Date.now(),page:e.page||t&&t.location&&t.location.pathname};return n.push(i),n=n.slice(-100)}},getBehavior:function(){return n||[]},setBehavior:function(e){return e&&(n=e),n},reportBehavior:function(e){var t=this;t.getConfig("behavior")&&(t.$ai&&(clearTimeout(t.$ai),t.$ai=undefined),t.$ai=setTimeout(function(){n&&n.length>0&&(t.behavior(n),n=[],t.$ai=undefined,e&&"function"==typeof e&&e())},0))},$aj:function(){if(!this.hasInitBehavior&&!a){try{!function(){if(document&&document.referrer&&document.location){var e=document.referrer,t=document.location.href;if(""!==e){var n={type:"navigation",data:{from:e,to:t}};o=t,a&&a.addBehavior(n)}}}(),function(){if(t&&t.console)for(var e=["debug","info","warn","log","error","assert"],n=0;n<e.length;n++){var r=e[n];t.console[r]&&"function"==typeof t.console[r]&&u(t.console,r,function(e){var n=r;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var s={type:"console",data:{level:n,message:o}};if(a&&a.addBehavior(s),"error"===n)for(var c=0;c<o.length;c++){var u=o[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,o)}})}}(),t&&t.document&&t.document.addEventListener&&(t.document.addEventListener("click",l("click"),!1),t.document.addEventListener("keypress",l("keypress"),!1)),p()}catch(e){r.warn("[arms] error in initBehavior",e)}a=this,this.hasInitBehavior=!0}return this}})}},{"../util":16}],3:[function(e,t,n){var r=e("../util"),a=e("../reporter"),o=e("../common/sender"),i=e("../common/post"),s=r.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&&r.$a8(e.page,[],e.page+"")||null,t._health={errcount:0,apisucc:0,apifail:0},t.$ak=function(e,n){"error"===e?t._health.errcount++:"api"===e&&t._health[n.success?"apisucc":"apifail"]++},!1!==e.enableInstanceAutoSend&&(t.$al(),t.$am(),t.$an(1e4),t._conf&&t._conf.behavior&&"function"==typeof t.$aj&&t.$aj()),Object.defineProperty&&s.addEventListener&&Object.defineProperty(t,"pipe",{set:t.$ao}),t};f.prototype=r.$ap(a.prototype),r.ext(a._root.dftCon,{uid: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,sendResource:!0,behavior:!0,parseHash:function(e){return(e?r.$ar(e.replace(/^#\/?/,"")):"")||"[index]"},parseResponse:function(e){if(!e||"object"!=typeof e)return{};var t=e.code,n=e.msg||e.message||e.subMsg||e.errorMsg||e.ret||e.errorResponse||"";return"object"==typeof n&&(t=t||n.code,n=n.msg||n.message||n.info||n.ret||JSON.stringify(n)),{msg:n,code:t,success:!0}}}),r.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()):r.on(s,"load",function(){t.hasReady=!0,e()},!0)},$a7:function(e){var t=this._conf,n=t.page,a=location,o=a.host+a.pathname;return n&&!e?r.$a8(n,[],n+""):this._initialPage||r.$aq(t.ignoreUrlCase?o.toLowerCase():o,t.ignoreUrlPath?t.ignoreUrlPath:t.urlHelper)},setPage:function(e,t){var n=this,r=n.$as;if(!1!==t){if(!e||e===r)return n;n.$as=e,clearTimeout(n.$at),n.$au(1),n.$a6(),n.$at=setTimeout(function(){n.$av()},10)}else n.$as=e;return n._conf.page=e,n},setConfig:function(e,t){if(e&&"object"==typeof e){r.$a9(e),e=this.$aa(e);var n=this._conf;if(this._conf=r.ext({},n,e),!t){var a="disableHook";a in e&&n[a]!==e[a]&&(e[a]?this.removeHook():this.addHook()),(a="enableSPA")in e&&n[a]!==e[a]&&this.$aw(e[a])}}},$ac:function(e){o(e,this.getConfig("imgUrl"))},$ae:function(e,t){var n={};n[t]=e[t],delete e[t];var a="";"object"==typeof e&&(a=r.serialize(e)),i(n,this.getConfig("imgUrl")+a+"&post_res=")},$ao:function(e){var t=this;if(!e||!e.length)return t;try{if("Array"===r.T(e[0]))return r.each(e,function(e){return t.$ao(e)});if("Array"!==r.T(e))return t;var n=e.shift();if(!u.test(n))return t;t[n].apply(t,e)}catch(a){return r.warn("[retcode] error in sendPipe",a),t}},$ax:function(){var e=r.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=r.ext({pid:this._conf.pid},e);var t=this.__proto__.constructor(e);return e.page&&t.$av(),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,n){var r=e("../util"),a=500;t.exports=function(e,t,n){function o(e,t,n){var r=0,a=e.tagName;if("SCRIPT"!==a&&"STYLE"!==a&&"META"!==a&&"HEAD"!==a){var i=e.children?e.children.length:0;if(i>0)for(var c=e.children,u=i-1;u>=0;u--)r+=o(c[u],t+1,r>0);if(r<=0&&!n){if(!(e.getBoundingClientRect&&e.getBoundingClientRect().top<s))return 0}r+=1+.5*t}return r}function i(e){for(var t=1;t<e.length;t++)if(e[t].score<e[t-1].score)return e.splice(t,1),i(e);return e}var s=t.innerHeight||0,c=[],u=null,f=0;r.ext(e.prototype,{$an:function(e){var a=this;if(!a._conf||!a._conf.useFmp)return null;if(!t.MutationObserver)return r.warn("[retcode] first meaningful paint can not be retrieved"),a.$ay(),null;r.on(t,"beforeunload",function(){a.$az(0,!0)});var i=t.MutationObserver;return(u=new i(function(){!function(e){var t=Date.now()-e,r=n.querySelector("body");if(r){var a=0;a+=o(r,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.$az(e)}),u},$az:function(e,t){var n=this;if(u&&f)if(t||!function(e,t){var n=Date.now()-e;return!(n>t||n-(c&&c.length&&c[c.length-1].t||0)>2*a)}(n._startTime,e)){u.disconnect(),f=0,c=i(c);for(var o=null,s=1;s<c.length;s++)if(c[s].t>=c[s-1].t){var l=c[s].score-c[s-1].score;(!o||o.rate<=l)&&(o={t:c[s].t,rate:l})}o&&o.t>0&&o.t<36e5?n.$ay({fmp:o.t}):n.$ay()}else r.delay(function(){n.$az(e)},a)}})}},{"../util":16}],5:[function(e,t,n){t.exports=function(t,n){var r=e("../util"),a=n.history||{},o=n.document,i=function(e,t){var r;n.CustomEvent?r=new CustomEvent(e,{detail:t}):((r=o.createEvent("HTMLEvents")).initEvent(e,!1,!0),r.detail=t),n.dispatchEvent(r)},s=function(e){var t=a[e];"function"==typeof t&&(a[e]=function(n,o,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=r.$ar(l[0]),g=r.$ar(p[0]),d=l[1]&&l[1].replace(/^\/?(.*)/,"$1"),v=p[1]&&p[1].replace(/^\/?(.*)/,"$1");h!==g?i("historystatechange",g):d!==v&&i("historystatechange",v)}catch(m){r.warn("[retcode] error in "+e+": "+m)}return f},a[e].toString=r.$b0(e))};r.ext(t.prototype,{$b1:function(){return this.$b2?this:(s("pushState"),s("replaceState"),this.$b2=!0,this)}})}},{"../util":16}],6:[function(e,t,n){t.exports=function(t,n,r){var a=e("../util"),o=e("../common/res"),i=e("../common/perf"),s=null,c=r.documentElement,u=n.innerWidth||c.clientWidth||r.body.clientWidth,f=n.innerHeight||c.clientHeight||r.body.clientHeight,l=n.navigator.connection,p={sr:screen.width+"x"+screen.height,vp:u+"x"+f,ct:l?l.effectiveType||l.type:""},h={},g=function(e,t,n,o,i){if(t===undefined){var s,c;if(!h[e]){s=new RegExp(e+"=([^;]+)");try{c=s.exec(r.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;o&&(u+="; domain="+o),u+="; path="+(i||"/"),n&&(u+="; max-age="+n);try{return r.cookie=u,!!r.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 n=e.target||e.srcElement;!(!n||!n.tagName||e.message||e.filename||e.lineno||e.colno)?this.$b3(e):this.error(e.error||{message:e.message},e)}else"unhandledrejection"===t&&a.T(e.reason,"Error")&&a.$b4(e.reason)&&this.error(e.reason);try{this.getConfig("behavior")&&this.reportBehavior&&this.reportBehavior()}catch(e){}return this},$b3:function(e){var t=this,n=e.target||e.srcElement;try{var r=t.$b5(n),o=n.tagName?n.tagName.toLowerCase():"",i=t.$b6(n,5);return t._lg("resourceError",{src:r&&r.substring(0,1e3),node_name:o,xpath:i}),t}catch(s){return a.warn("[ARMS] $b3 error :",s),t}},$b5:function(e){var t=e.src||e.href;try{if(!t){var n="object"===(e.tagName?e.tagName.toLowerCase():""),r=e.getAttribute("classid")&&"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"===e.getAttribute("classid").toLowerCase()||"application/x-shockwave-flash"===e.getAttribute("type");n&&r&&(t=e.getAttribute("data")||e.getAttribute("codebase")),t||(t=e.outerHTML||e.innerHTML)}}catch(a){t=""}return t},$b6:function(e,t){var n=e.id?"#"+e.id:"",r=e.className?"."+e.className.split(" ").join("."):"",a=(e.tagName?e.tagName.toLowerCase():"")+n+r;return e.parentNode&&e.parentNode.tagName&&t-1!=0?this.$b6(e.parentNode,t-1)+" > "+a:a},$ay:function(e){var t=this;t.$a2(function(){var n=i();n&&(n.page=t.$a7(!0),e&&(n=a.ext(n,e)),t.$b7&&(n=a.ext(n,t.$b7)),t.getConfig("autoSendPerf")?(n.autoSend=!0,t.performance(n)):t.$b7=n)})},$b8:function(e){var t=this;t.$a2(function(){var n=o();n&&(n.load&&n.load<=2e3||n.load&&n.load<=8e3&&Math.random()>.05||(n.page=t.$a7(!0),n.dl=location.href,e&&(n=a.ext(n,e)),t._lg("res",n,t.getConfig("sample"))))})},$av:function(){var e=this;e.$a2(function(){var t=function(e){var t=d(e),a=n.devicePixelRatio||1;return{uid:t,dt:r.title,dl:location.href,dr:r.referrer,dpr:a.toFixed(2),de:(r.characterSet||r.defaultCharset||"").toLowerCase(),ul:c.lang,begin:Date.now()}}(e);t&&t.uid&&e._lg("pv",t,e.getConfig("pvSample"))})},$af:function(){return p.uid=d(this),p},$au:function(e){var t=Date.now();if(t-this._lastUnload<200)return this;this._lastUnload=t,this.$ax(e),this.$b9&&(this._lg("speed",this.$b9),this.$b9=null,clearTimeout(this.$ba)),this.$a4()},$aw:function(e){var t=this;if(!e^t.$bb)return t;e?(t.$b1(),t.$bb=function(e){var n=t._conf.parseHash(location.hash);n&&t.setPage(n,!1!==e)},t.$bc=function(e){var n=t._conf.parseHash(e.detail);n&&t.setPage(n)},a.on(n,"hashchange",t.$bb),a.on(n,"historystatechange",t.$bc),t.$bb(!1)):(a.off(n,"hashchange",t.$bb),a.off(n,"historystatechange",t.$bc),t.$bb=null,t.$bc=null)},$al:function(){var e=this;if(e.$bd)return e;var t=e._conf;return a.on(n,"beforeunload",function(){e.$au(0)}),e.$aw(t.enableSPA),e.activeErrHandler(!1),e.$bd=!0,e}}),a.on(n,"error",function(e){s&&s.errorHandler(e)},!1,!0).on(n,"unhandledrejection",function(e){s&&s.errorHandler(e)}),t}},{"../common/perf":9,"../common/res":11,"../util":16}],7:[function(e,t,n){t.exports=function(t,n){var r=e("../util"),a=null,o=r.getCurDomain(),i=function(e,t,n,a,i,s,c,u,f,l){var p=r.J(i)||null,h=r.$a8(t,[p,a],null);if(!h)return!1;var g=h.code||s,d=!("success"in h)||h.success;e.api(n,d,c,g,h.msg,u,f,l,{},o)},s="fetch",c="__oFetch_",u="__oXMLHttpRequest_",f="XMLHttpRequest";return r.ext(t.prototype,{removeHook:function(e,t){return a&&(t||this===a)?(n[c]&&(n[s]=n[c],delete n[c]),n[u]&&(n[f]=n[u],delete n[u]),a=null,this):this},addHook:function(e){return!e&&a?this:(a||(function(){if("function"==typeof n[s]){var e=n[s];n[c]=e,n[s]=function(t,s){var c=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),u=a;if(!u||!u.api)return e.apply(n,c);if(s&&("HEAD"===s.method||"no-cors"===s.mode))return e.apply(n,c);var f=Date.now(),l=u._conf,p=(t&&"string"!=typeof t?t.url:t)||"",h=p;if(p=r.$ar(p),!r.$be(p,!0))return e.apply(n,c);p=r.$aq(p,l.ignoreApiPath?l.ignoreApiPath:l.apiHelper);var g=l.enableLinkTrace,d="",v="",m=u.getConfig("pid");if(g){var y="";try{y=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(E){y=""}if(r.checkSameOrigin(h,y)){if(t&&"string"!=typeof t)try{if(c[0].headers&&"function"==typeof c[0].headers.get&&"function"==typeof c[0].headers.append){var b=c[0].headers.get("EagleEye-TraceID"),$=c[0].headers.get("EagleEye-SessionID"),w=c[0].headers.get("EagleEye-pAppName");b?d=b:(d=u.getTraceId()["EagleEye-TraceID"],c[0].headers.append("EagleEye-TraceID",d)),$?v=$:(v=u.getSessionId()["EagleEye-SessionID"],c[0].headers.append("EagleEye-SessionID",v)),w||c[0].headers.append("EagleEye-pAppName",m)}}catch(_){r.warn("[retcode] fetch failed to set header, exception is :\n"+_)}s&&(s.headers=s.headers?s.headers:{},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.getSessionId()["EagleEye-SessionID"],s.headers["EagleEye-SessionID"]=v),s.headers["EagleEye-pAppName"]||(s.headers["EagleEye-pAppName"]=m))}}return e.apply(n,c).then(function(e){if(!u||!u.api)return e;try{if(!e||"function"!=typeof e.clone)return e;var t=e.clone(),n=t.headers;if(n&&"function"==typeof n.get){var a=n.get("content-type");if(a&&!/(text)|(json)/.test(a))return e}var s=Date.now()-f;return t.text().then(function(e){var a=r.getFetchSnapshot(c,e,n);t.ok?i(u,l.parseResponse,p,h,e,t.status||200,s,f,d,v):u.api(p,!1,s,t.status||404,t.statusText,f,d,v,a,o)}),e}catch(E){return r.warn("[ARMS] fetch response error :",E),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,{},o),e})},n[s].toString=r.$b0(s)}}(),function(){if("function"==typeof n[f]){var e,t=n[f];n[u]=t,n[f]=function(n){var s=new t(n),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="";return s.open=function(t,n){e=t;var a=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);if(h.apply(s,a),l=n||"",f=r.$ar(l),f=f?r.$aq(f,d.ignoreApiPath?d.ignoreApiPath:d.apiHelper):"",v){var o="";try{o=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(i){o=""}r.checkSameOrigin(l,o)&&g&&"function"==typeof g&&(m=c.getTraceId()["EagleEye-TraceID"],g.apply(s,["EagleEye-TraceID",m]),y=c.getSessionId()["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)},r.on(s,"readystatechange",function(){if(f&&4===s.readyState){var t=Date.now()-u,n=r.getXhrSnapshot(l,e,s);if(s.status>=200&&s.status<=299){var a=s.status||200;if("function"==typeof s.getResponseHeader){var p=s.getResponseHeader("Content-Type");if(p&&!/(text)|(json)/.test(p))return}s.responseType&&"text"!==s.responseType?c.api(f,!0,t,a,"",u,m,y,{},o):i(c,d.parseResponse,f,l,s.responseText,a,t,u,m,y)}else c.api(f,!1,t,s.status||"FAILED",s.statusText,u,m,y,n,o)}}),s},n[f].toString=r.$b0(f)}}()),a=this,this)},$am:function(){return this.$bf?this:(this.getConfig("disableHook")||this.addHook(),this.$bf=!0,this)}}),t}},{"../util":16}],8:[function(e,t,n){n.TIMING_KEYS=["","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","requestStart","responseStart","responseEnd","","domInteractive","","domContentLoadedEventEnd","","loadEventStart","","msFirstPaint","secureConnectionStart"]},{}],9:[function(e,t,n){var r=e("../util"),a=e("./constants").TIMING_KEYS;t.exports=function(){var e=r.win||{},t=e.performance;if(!t||"object"!=typeof t)return null;var n={},o=t.timing||{},i=Date.now(),s=1;if("function"==typeof e.PerformanceNavigationTiming){var c=t.getEntriesByType("navigation")[0];c&&(o=c,s=2)}r.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 r=o[a[e[1]]],i=o[a[e[0]]];if(2===s||r>0&&i>0){var c=Math.round(i-r);c>=0&&c<36e5&&(n[t]=c)}});var u=e.navigator.connection,f=t.navigation||{};n.ct=u?u.effectiveType||u.type:"";var l=u?u.downlink||u.downlinkMax||u.bandwidth||null:null;if((l=l>999?999:l)&&(n.bandwidth=l),n.navtype=1===f.type?"Reload":"Other",1===s&&o[a[16]]>0&&o[a[1]]>0){var p=o[a[16]]-o[a[1]];p>=0&&p<36e5&&(n.fpt=p)}return 1===s&&o[a[1]]>0?n.begin=o[a[1]]:2===s&&n.load>0?n.begin=i-n.load:n.begin=i,n}},{"../util":16,"./constants":8}],10:[function(e,t,n){var r=e("../util"),a="object"==typeof window?window:{},o=a.__oXMLHttpRequest_||a.XMLHttpRequest;o="function"==typeof o?o:undefined,t.exports=function(e,t){try{var n=new o;n.open("POST",t,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(e))}catch(a){r.warn("[retcode] Failed to log, exception is :\n"+a)}}},{"../util":16}],11:[function(e,t,n){var r=e("../util"),a=e("./constants").TIMING_KEYS;t.exports=function(){var e=r.win||{},t=e.performance;if(!t||"object"!=typeof t||"function"!=typeof t.getEntriesByType)return null;var n={},o=t.timing||{},i=t.getEntriesByType("resource")||[];if(n.begin=o[a[1]]||Date.now(),"function"==typeof e.PerformanceNavigationTiming){var s=t.getEntriesByType("navigation")[0];s&&(o=s)}return r.each({dom:[10,8],load:[14,1]},function(e,t){var r=o[a[e[1]]],i=o[a[e[0]]];if(r>0&&i>0){var s=Math.round(i-r);s>=0&&s<36e5&&(n[t]=s)}}),n.res=JSON.stringify(i),n}},{"../util":16,"./constants":8}],12:[function(e,t,n){var r=e("../util");t.exports=function(e,t){"object"==typeof e&&(e=r.serialize(e));var n=t+e;window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?window.navigator.sendBeacon(n,"&post_res="):r.warn("[arms] navigator.sendBeacon not surported")}},{"../util":16}],13:[function(e,t,n){var r=e("../util"),a="object"==typeof window?window:{},o=a.__oFetch_||a.fetch;o="function"==typeof o?o:undefined,t.exports=function(e,t){var n=-1;"object"==typeof e&&(n=e.z,e=r.serialize(e));var i=t+e;if(o)return o(i,{method:"HEAD",mode:"no-cors"})["catch"](r.noop);if(a.document&&a.document.createElement){var s="__request_hold_"+n,c=a[s]=new Image;c.onload=c.onerror=function(){a[s]=undefined},c.src=i,c=null}}},{"../util":16}],14:[function(e,t,n){"use strict";function r(e,t){var n=a[i]=new o(e);n.$ao(t);var r=n._conf;return!1!==r.autoSendPv&&n.$av(),r&&r.useFmp||n.$ay(),r&&r.sendResource&&n.$b8(),a[s]=!0,n}var a=window,o=a.BrowserLogger=e("./biz.browser/clazz"),i=e("./util").key,s="__hasInitBlSdk";o.singleton=function(e,t){return a[s]?a[i]:r(e,t)},o.createExtraInstance=function(e){e&&"object"==typeof e&&!0!==e.enableInstanceAutoSend&&(e.enableInstanceAutoSend=!1);var t=new o(e),n=t._conf;return n.enableInstanceAutoSend&&(!1!==n.autoSendPv&&t.$av(),n&&n.useFmp||t.$ay(),n&&n.sendResource&&t.$b8()),t};"object"==typeof window&&!!window.navigator&&a[i]&&(o.bl=function(){if(a[s])return a[i];var e={},t=[];return i in a&&(e=a[i].config||{},t=a[i].pipe||[]),r(e,t)}(a.__hasInitBlSdk)),t.exports=o},{"./biz.browser/clazz":3,"./util":16}],15:[function(e,t,n){var r=e("./util"),a=e("./base"),o=["api","success","time","code","msg","trace","traceId","begin","sid","seq","domain"],i=function(e,t){var n=e.split("::");return n.length>1?r.ext({group:n[0],key:n[1]},t):r.ext({group:"default_group",key:n[0]},t)},s=function(e){a.call(this,e);var t;try{t="object"==typeof performance?performance.timing.fetchStart:Date.now()}catch(n){t=Date.now()}return this._startTime=t,this};s.prototype=r.$ap(a.prototype),r.ext(a.dftCon,{startTime:null}),r.ext(s.prototype,{constructor:s,_super:a,sum:function(e,t,n){try{return this._lg("sum",i(e,{val:t||1,begin:Date.now()}),n)}catch(a){r.warn("[retcode] can not get parseStatData: "+a)}},avg:function(e,t,n){try{return this._lg("avg",i(e,{val:t||0,begin:Date.now()}),n)}catch(a){r.warn("[retcode] can not get parseStatData: "+a)}},percent:function(e,t,n,a){try{return this._lg("percent",i(e,{subkey:t,val:n||0,begin:Date.now()}),a)}catch(o){r.warn("[retcode] can not get parseStatData: "+o)}},msg:function(e,t){if(e&&!(e.length>180))return this.custom({msg:e},t)},error:function(e,t){if(!e)return r.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 n=e.name||"CustomError",a=e.message||"",o=e.stack||"";t=t||{};var i={begin:Date.now(),cate:n,msg:a&&a.substring(0,1e3),stack:o&&o.substring(0,1e3),file:r.$bg(t.filename||""),line:t.lineno||"",col:t.colno||"",err:{msg_raw:r.encode(a),stack_raw:r.encode(o)}},s=(this.getConfig("ignore")||{}).ignoreErrors;return r.$ah(i.msg,s)||r.$ah(r.decode(i.msg),s)?this:(this.$ak&&this.$ak("error",i),this._lg("error",i,1))},behavior:function(e){if(e){var t="object"==typeof e&&e.behavior?e:{behavior:e};return this.$ak&&this.$ak("behavior",t),this._lg("behavior",t,1)}},api:function(e,t,n,a,i,s,c,u,f,l){if(!e)return r.warn("[retcode] api is null"),this;if(e="string"==typeof e?{api:e,success:t,time:n,code:a,msg:i,begin:s,traceId:c,sid:u,domain:l}:r.sub(e,o),!r.$be(e.api))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.sid=e.sid||"",e.domain=e.domain||"",e.success?e.apiSnapshot&&delete e.apiSnapshot:e.apiSnapshot=f,!e.api||isNaN(e.time))return r.warn("[retcode] invalid time or api"),this;var p=(this.getConfig("ignore")||{}).ignoreApis;if(r.$ah(e.api,p)||r.$ah(r.decode(e.api),p))return this;this.$ak&&this.$ak("api",e);var h={type:"api",data:{message:e.msg,url:e.api,status:e.code},timestamp:e.begin};try{this.getConfig("behavior")&&this.addBehavior&&this.addBehavior(h)}catch(g){}return this._lg("api",e,e.success&&this.getConfig("sample"))},speed:function(e,t,n){var a=this,o=this.getConfig("startTime")||this._startTime;return/^s(\d|1[0])$/.test(e)?(t="number"!=typeof t?Date.now()-o:t>=o?t-o:t,a.$b9=a.$b9||{},a.$b9[e]=t,a.$b9.begin=o,clearTimeout(a.$ba),a.$ba=setTimeout(function(){n||(a.$b9.page=a.$a7(!0)),a._lg("speed",a.$b9),a.$b9=null},5e3),a):(r.warn("[retcode] invalid point: "+e),a)},performance:function(e){if(e&&"object"==typeof e){var t={},n=this.getConfig("autoSendPerf");if(n&&e.autoSend&&!this.$bh)return this.$bh=!0,this._lg("perf",e,this.getConfig("sample"));for(var a in e)(/^t([1-9]|1[0])$/.test(a)||"ctti"===a||"cfpt"===a)&&(t[a]=e[a]);if(n&&!0!==e.autoSend)this.$b7=r.ext(this.$b7||{},t);else if(!1===n&&!this.$bh){if(!this.$b7||"object"!=typeof this.$b7)return;return t=r.ext(this.$b7,t),this.$bh=!0,this._lg("perf",t,this.getConfig("sample"))}}},resource:function(e,t){if(!e||!r.isPlainObject(e))return r.warn("[arms] invalid param data: "+e),this;var n=Object.keys(e),a=["begin","dom","load","res","dl"],o=!1;for(var i in a){if(n.indexOf(a[i])<0){o=!0;break}}if(o)return r.warn("[arms] lack param data: "+e),this;var s={begin:e.begin||Date.now(),dom:e.dom||"",load:e.load||"",res:r.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,n){Date.now=Date.now||function(){return(new Date).getTime()};var r=Date.now(),a=function(){},o={noop:a,warn:function(){var e="object"==typeof console?console.warn:a;try{var t={warn:e};t.warn.call(t)}catch(n){return a}return e}(),key:"__bl",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?",$ap:function(e){if(Object.create)return Object.create(e);var t=function(){};return t.prototype=e,new t},each:function(e,t){var n=0,r=e.length;if(this.T(e,"Array"))for(;n<r&&!1!==t.call(e[n],e[n],n);n++);else for(n in e)if(!1===t.call(e[n],e[n],n))break;return e},$a8:function(e,t,n){if("function"!=typeof e)return n;try{return e.apply(this,t)}catch(r){return n}},T:function(e,t){var n=Object.prototype.toString.call(e).substring(8).replace("]","");return t?n===t:n},$aq:function(e,t){if(!e)return"";if(!t)return e;var n=this,r=n.T(t);return"Function"===r?n.$a8(t,[e],e):"Array"===r?(this.each(t,function(t){e=n.$aq(e,t)}),e):"Object"===r?e.replace(t.rule,t.target||""):e.replace(t,"")},$ah:function(e,t){if(!e||!t)return!1;if((this.isString(t)||t.source||"Function"===this.T(t))&&(t=[t]),!this.isArray(t))return o.warn("[arms] invalid rules of ignore config, (list of) String/RegExp/Funcitons are available"),!1;for(var n,r=[],a=0,i=t.length;a<i;a++)if(n=t[a],this.isString(n))r.push(n.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"));else if(n&&n.source)r.push(n.source);else if(n&&"Function"===this.T(n)&&!0===this.$a8(n,[e],!1))return!0;var s=new RegExp(r.join("|"),"i");return!!(r.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(n){}return t},pick:function(e){return 1===e||1===Math.ceil(Math.random()*e)},$a9:function(e){if("sample"in e){var t=e.sample,n=t;t&&/^\d+(\.\d+)?%$/.test(t)&&(n=parseInt(100/parseFloat(t))),0<n&&1>n&&(n=parseInt(1/n)),n>=1&&n<=100?e.sample=n:delete e.sample}return e},on:function(e,t,n,r,a){return e.addEventListener?(a=a||!1,e.addEventListener(t,function o(i){r&&e.removeEventListener(t,o,a),n.call(this,i)},a)):e.attachEvent&&e.attachEvent("on"+t,function i(a){r&&e.detachEvent("on"+t,i),n.call(this,a)}),this},off:function(e,t,n){return n?(e.removeEventListener?e.removeEventListener(t,n):e.detachEvent&&e.detachEvent(t,n),this):this},delay:function(e,t){return-1===t?(e(),null):setTimeout(e,t||0)},ext:function(e){for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},sub:function(e,t){var n={};return this.each(e,function(e,r){-1!==t.indexOf(r)&&(n[r]=e)}),n},uu:function(){for(var e,t,n=20,r=new Array(n),a=Date.now().toString(36).split("");n-- >0;)t=(e=36*Math.random()|0).toString(36),r[n]=e%3?t:t.toUpperCase();for(var o=0;o<8;o++)r.splice(3*o+2,0,a[o]);return r.join("")},seq:function(){return(r++).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(n){}return e},serialize:function(e){e=e||{};var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==undefined&&t.push(n+"="+this.encode(e[n],"msg"===n));return t.join("&")},$be:function(e,t){if(!e||"string"!=typeof e)return!1;var n=/arms-retcode[\w-]*\.aliyuncs/.test(e);return!n&&t&&(n=/(\.png)|(\.gif)|(alicdn\.com)/.test(e)),!n},$b4:function(e){return!(!e||!e.message)&&!/failed[\w\s]+fetch/i.test(e.message)},$ar:function(e){return e&&"string"==typeof e?e.replace(/^(https?:)?\/\//,"").replace(/\?.*$/,""):""},$bg:function(e){return e&&"string"==typeof e?e.replace(/\?.*$/,""):""},$b0:function(e){return function(){return e+"() { [native code] }"}},checkSameOrigin:function(e,t){if(!t||!e)return!1;var n="//"+t.split("/")[2];return e===t||e.slice(0,t.length+1)===t+"/"||e===n||e.slice(0,n.length+1)===n+"/"||!/^(\/\/|http:|https:).*/.test(e)},getRandIP:function(){for(var e=[],t=0;t<4;t++){var n=Math.floor(256*Math.random());e[t]=(n>15?"":"0")+n.toString(16)}return e.join("")},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=[],n=0;n<e;n++){var r=Math.floor(16*Math.random());t[n]=r.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 n=e.keys(),r=n.next();!r.done;){var a=r.value;t[a]=e.get(a),r=n.next()}else t=e}catch(o){t={}}return t},parseXhrHeaders:function(e){if(!e&&"string"!=typeof e)return{};var t={};try{var n=e.split("\r\n");t=n.reduce(function(e,t){var n=t.split(": ");return e[n[0]]=n[1],e},{})}catch(r){t={}}return t},getQuerys:function(e){if(!e)return"";var t={},n=[],r="",a="";try{var o=[];if(e.indexOf("?")>=0&&(o=e.substring(e.indexOf("?")+1,e.length).split("&")),o.length>0)for(var i in o)r=(n=o[i].split("="))[0],a=n[1],t[r]=a}catch(s){t={}}return t},getFetchSnapshot:function(e,t,n){var r,a;try{var o=(e&&"string"!=typeof e[0]?e[0].url:e[0])||"",i=(e&&"string"!=typeof e[0]?e[0]:e[1])||{},s="POST"===i.method.toUpperCase()?i.body:this.getQuerys(o);r={originApi:o,method:i.method||"unknown",params:s,response:t||"",reqHeaders:this.parseFetchHeaders(i.headers||null),resHeaders:this.parseFetchHeaders(n)},a="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(r))||"{}"}catch(c){a="{}"}return a},getXhrSnapshot:function(e,t,n){if(!e||!t||!n)return{};var r,a;try{r={originApi:e,method:t,params:this.getQuerys(e),response:n.responseText||n.responseXml||"",reqHeaders:{},resHeaders:this.parseXhrHeaders("function"==typeof n.getAllResponseHeaders&&n.getAllResponseHeaders()||"")},a="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(r))||"{}"}catch(o){a="{}"}return a},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,n=[],r=0,a=e.length;r<a;r++)t=e[r],this.isString(t)?n.push(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):t&&t.source&&n.push(t.source);return new RegExp(n.join("|"),"i")},reWriteMethod:function(e,t,n){if(null!==e){var r=e[t];e[t]=n(r)}}};t.exports=o},{}]},{},[14]);
/** retcode cloud sdk | @version 1.8.4-alpha | @copyright Alibaba Group Holding Limited. */ !function(){function e(t,n,r){function a(i,s){if(!n[i]){if(!t[i]){var c="function"==typeof require&&require;if(!s&&c)return c(i,!0);if(o)return o(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[i]={exports:{}};t[i][0].call(f.exports,function(e){return a(t[i][1][e]||e)},f,f.exports,e,t,n,r)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;i<r.length;i++)a(r[i]);return a}return e}()({1:[function(e,t,n){var r=e("./util"),a=e("./common/sendBeacon"),o=function(e){return this.ver="1.8.4-alpha",this._conf=r.ext({},o.dftCon),this.$a5={},this.$a1=[],this.hash=r.seq(),this.$a6(),this.setConfig(e),this.rip=r.getRandIP(),this.record=999,this["EagleEye-TraceID"]=this.getTraceId()["EagleEye-TraceID"],this._common={},this};o.dftCon={sample:1,pvSample:1,tag:"",imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",region:null,ignore:{ignoreUrls:[],ignoreApis:[],ignoreErrors:[]},release:undefined,environment:"production"},o.prototype={constructor:o,$a2:function(e){return e()},$a7:function(){var e=this._conf.page;return r.$a8(e,[],e+"")},setPage:function(){},setConfig:function(e){e&&"object"==typeof e&&(r.$a9(e),e=this.$aa(e),this._conf=r.ext({},this._conf,e))},$aa:function(e){var t=e.region,n=e.imgUrl;if(t){var a=r.regionMap[t];return e.imgUrl=a||r.defaultImgUrl,e}return n&&(e.imgUrl=n),e},$ab:function(e){if(this.getConfig("debug"))return!0;var t=r.regionMap,n=!1;for(var a in t)if(t[a]===e){n=!0;break}return!n&&r.warn("[retcode] invalid url: "+e),n},$ac:function(){},$ad:function(e){a(e,this.getConfig("imgUrl"))},$ae:function(){},$af:function(){return{}},setCommonInfo:function(e){e&&"object"==typeof e&&(this._common=r.ext({},this._common,e))},$a6:function(){this.session=r.uu(),this.sBegin=Date.now()},getTraceId:function(){var e=this.rip,t=Date.now(),n=r.getSortNum(this.record),a=e+t+n+r.getRandNum(this._conf.pid);return this["EagleEye-TraceID"]=a,this.record=n,{"EagleEye-TraceID":a}},getSessionId:function(){return{"EagleEye-SessionID":this.session}},getConfig:function(e){return e?this._conf[e]:r.ext({},this._conf)},$ag:function(e){return 1===e||("boolean"==typeof this.$a5[e]?this.$a5[e]:(this.$a5[e]=r.pick(e),this.$a5[e]))},$a4:function(){var e;clearTimeout(this.$a3),this.$a3=null;for(var t=this._conf&&"function"==typeof this._conf.sendRequest;e=this.$a1.pop();)"res"===e.t?this.$ae(e,"res"):"error"===e.t?this.$ae(e,"err"):"api"===e.t?this.$ae(e,"apiSnapshot"):"behavior"===e.t?this.$ae(e,"behavior"):"health"===e.t&&!t&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?this.$ad(e):this.$ac(e);return this},_lg:function(e,t,n){var a=this._conf,o=this.$a7(),i=a.ignore||{},s=i.ignoreErrors,c=i.ignoreUrls,u=i.ignoreApis;return r.$ah(o,c)||r.$ah(r.decode(o),c)?this:"error"===e&&(r.$ah(t.msg,s)||r.$ah(r.decode(t.msg),s))?this:"api"===e&&(r.$ah(t.api,u)||r.$ah(r.decode(t.api),u))?this:this.$ab(a.imgUrl)&&t&&!a.disabled&&a.pid?n&&!this.$ag(n)?this:(t=r.ext({t:e,times:1,page:o,tag:a.tag||"",release:a.release||"",environment:a.environment,begin:Date.now()},t,this.$af(),this._common,{pid:a.pid,_v:this.ver,sid:this.session,sampling:n||1,z:r.seq(),c1:a.c1,c2:a.c2,c3:a.c3}),function(e,t){var n;{if("error"!==t.t||!(n=e.$a1[0])||"error"!==n.t||t.msg!==n.msg){if("behavior"===t.t){var a=e.$a1&&e.$a1.length;if(a>0&&"behavior"===e.$a1[a-1].t){var o=t.behavior||[];e.$a1[a-1].behavior.concat(o)}else e.$a1.push(t)}else e.$a1.unshift(t);return e.$a2(function(){e.$a3=r.delay(function(){e.$a4()},e.$a1[0]&&"error"===e.$a1[0].t?3e3:-1)}),!0}n.times++}}(this,t)):this},custom:function(e,t){if(!e||"object"!=typeof e)return this;var n=!1,a={begin:Date.now()};return r.each(e,function(e,t){return!(n=t&&t.length<=20)&&r.warn("[retcode] invalid key: "+t),a["x-"+t]=e,n}),n?this._lg("custom",a,t||1):this}},t.exports=o},{"./common/sendBeacon":12,"./util":16}],2:[function(e,t,n){var r=e("../util");t.exports=function(e,t){var n=[],a=null,o=t&&t.location&&t.location.href,i=0,s=undefined,c=null,u=function(e,t,n){if(null!==e){var r=e[t];e[t]=n(r)}},f=function(e){var t,n,r,a,o,i=[];if(!e||!e.tagName)return"";if(i.push(e.tagName.toLowerCase()),e.id&&"[object String]"===Object.prototype.toString.call(e.id)&&i.push("#".concat(e.id)),(t=e.className)&&"[object String]"===Object.prototype.toString.call(t))for(n=t.split(/\s+/),o=0;o<n.length;o++)i.push(".".concat(n[o]));var s=["type","name","title","alt"];for(o=0;o<s.length;o++)r=s[o],(a=e.getAttribute(r))&&"[object String]"===Object.prototype.toString.call(a)&&i.push("[".concat(r,'="').concat(a,'"]'));return i.join("")},l=function(e,t){return function(n){if(n&&n!==c){c=n;var r;try{r=n.target}catch(u){r="<unknown>"}if(0!==r.length){var o={type:"ui.".concat(e),data:{message:function(e){if(!e||1!==e.nodeType)return"";for(var t=e||null,n=[],r=0,a=0,o=" > ".length,i="";t&&r++<5&&!("html"===(i=f(t))||r>1&&a+n.length*o+i.length>=80);)n.push(i),a+=i.length,t=t.parentNode;return n.reverse().join(" > ")}(r)},timestamp:Date.now()};"click"===e?(i&&clearTimeout(i),t?i=setTimeout(function(){a&&a.addBehavior(o)},0):a&&a.addBehavior(o)):"keypress"===e&&(s||a&&a.addBehavior(o),clearTimeout(s),s=setTimeout(function(){s=undefined},100))}}}},p=function(){if(function(){var e=t&&t.chrome,n=e&&e.app&&e.app.runtime,r="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!n&&r}()){var e=function(e,t){var n={type:"navigation",data:{from:e,to:t}};a&&a.addBehavior(n),o=t},n=t.onpopstate;t.onpopstate=function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var s=t.location.href;if(e(o,s),n)return n.apply(this,a)};var r=function(t){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];var i=r.length>2?r[2]:undefined;return i&&e(o,String(i)),t.apply(this,r)}};u(t.history,"pushState",r),u(t.history,"replaceState",r)}};r.ext(e.prototype,{addBehavior:function(e){if(this.getConfig("behavior")&&e&&"object"==typeof e){var a={},o=e.data||{};if(e.type)a=o;else{if("string"!=typeof o.name||"string"!=typeof o.message)return;a.name=o.name.substr(0,20),a.message=o.message.substr(0,200)}a.message&&(a.message=r.encode(a.message));var i={type:e.type||"custom",data:a||{},timestamp:e.timestamp||Date.now(),page:e.page||t&&t.location&&t.location.pathname};return n.push(i),n=n.slice(-100)}},getBehavior:function(){return n||[]},setBehavior:function(e){return e&&(n=e),n},reportBehavior:function(e){var t=this;t.getConfig("behavior")&&(t.$ai&&(clearTimeout(t.$ai),t.$ai=undefined),t.$ai=setTimeout(function(){n&&n.length>0&&(t.behavior(n),n=[],t.$ai=undefined,e&&"function"==typeof e&&e())},0))},$aj:function(){if(!this.hasInitBehavior&&!a){try{!function(){if(document&&document.referrer&&document.location){var e=document.referrer,t=document.location.href;if(""!==e){var n={type:"navigation",data:{from:e,to:t}};o=t,a&&a.addBehavior(n)}}}(),function(){if(t&&t.console)for(var e=["debug","info","warn","log","error","assert"],n=0;n<e.length;n++){var r=e[n];t.console[r]&&"function"==typeof t.console[r]&&u(t.console,r,function(e){var n=r;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var s={type:"console",data:{level:n,message:o}};if(a&&a.addBehavior(s),"error"===n)for(var c=0;c<o.length;c++){var u=o[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,o)}})}}(),t&&t.document&&t.document.addEventListener&&(t.document.addEventListener("click",l("click"),!1),t.document.addEventListener("keypress",l("keypress"),!1)),p()}catch(e){r.warn("[arms] error in initBehavior",e)}a=this,this.hasInitBehavior=!0}return this}})}},{"../util":16}],3:[function(e,t,n){var r=e("../util"),a=e("../reporter"),o=e("../common/sender"),i=e("../common/post"),s=r.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&&r.$a8(e.page,[],e.page+"")||null,t._health={errcount:0,apisucc:0,apifail:0},t.$ak=function(e,n){"error"===e?t._health.errcount++:"api"===e&&t._health[n.success?"apisucc":"apifail"]++},!1!==e.enableInstanceAutoSend&&(t.$al(),t.$am(),t.$an(1e4),t._conf&&t._conf.behavior&&"function"==typeof t.$aj&&t.$aj()),Object.defineProperty&&s.addEventListener&&Object.defineProperty(t,"pipe",{set:t.$ao}),t};f.prototype=r.$ap(a.prototype),r.ext(a._root.dftCon,{uid: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,sendResource:!0,behavior:!0,parseHash:function(e){return(e?r.$ar(e.replace(/^#\/?/,"")):"")||"[index]"},parseResponse:function(e){if(!e||"object"!=typeof e)return{};var t=e.code,n=e.msg||e.message||e.subMsg||e.errorMsg||e.ret||e.errorResponse||"";return"object"==typeof n&&(t=t||n.code,n=n.msg||n.message||n.info||n.ret||JSON.stringify(n)),{msg:n,code:t,success:!0}}}),r.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()):r.on(s,"load",function(){t.hasReady=!0,e()},!0)},$a7:function(e){var t=this._conf,n=t.page,a=location,o=a.host+a.pathname;return n&&!e?r.$a8(n,[],n+""):this._initialPage||r.$aq(t.ignoreUrlCase?o.toLowerCase():o,t.ignoreUrlPath?t.ignoreUrlPath:t.urlHelper)},setPage:function(e,t){var n=this,r=n.$as;if(!1!==t){if(!e||e===r)return n;n.$as=e,clearTimeout(n.$at),n.$au(1),n.$a6(),n.$at=setTimeout(function(){n.$av()},10)}else n.$as=e;return n._conf.page=e,n},setConfig:function(e,t){if(e&&"object"==typeof e){r.$a9(e),e=this.$aa(e);var n=this._conf;if(this._conf=r.ext({},n,e),!t){var a="disableHook";a in e&&n[a]!==e[a]&&(e[a]?this.removeHook():this.addHook()),(a="enableSPA")in e&&n[a]!==e[a]&&this.$aw(e[a])}}},$ac:function(e){o(e,this.getConfig("imgUrl"))},$ae:function(e,t){var n={};n[t]=e[t],delete e[t];var a="";"object"==typeof e&&(a=r.serialize(e)),i(n,this.getConfig("imgUrl")+a+"&post_res=")},$ao:function(e){var t=this;if(!e||!e.length)return t;try{if("Array"===r.T(e[0]))return r.each(e,function(e){return t.$ao(e)});if("Array"!==r.T(e))return t;var n=e.shift();if(!u.test(n))return t;t[n].apply(t,e)}catch(a){return r.warn("[retcode] error in sendPipe",a),t}},$ax:function(){var e=r.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=r.ext({pid:this._conf.pid},e);var t=this.__proto__.constructor(e);return e.page&&t.$av(),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,n){var r=e("../util"),a=500;t.exports=function(e,t,n){function o(e,t,n){var r=0,a=e.tagName;if("SCRIPT"!==a&&"STYLE"!==a&&"META"!==a&&"HEAD"!==a){var i=e.children?e.children.length:0;if(i>0)for(var c=e.children,u=i-1;u>=0;u--)r+=o(c[u],t+1,r>0);if(r<=0&&!n){if(!(e.getBoundingClientRect&&e.getBoundingClientRect().top<s))return 0}r+=1+.5*t}return r}function i(e){for(var t=1;t<e.length;t++)if(e[t].score<e[t-1].score)return e.splice(t,1),i(e);return e}var s=t.innerHeight||0,c=[],u=null,f=0;r.ext(e.prototype,{$an:function(e){var a=this;if(!a._conf||!a._conf.useFmp)return null;if(!t.MutationObserver)return r.warn("[retcode] first meaningful paint can not be retrieved"),a.$ay(),null;r.on(t,"beforeunload",function(){a.$az(0,!0)});var i=t.MutationObserver;return(u=new i(function(){!function(e){var t=Date.now()-e,r=n.querySelector("body");if(r){var a=0;a+=o(r,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.$az(e)}),u},$az:function(e,t){var n=this;if(u&&f)if(t||!function(e,t){var n=Date.now()-e;return!(n>t||n-(c&&c.length&&c[c.length-1].t||0)>2*a)}(n._startTime,e)){u.disconnect(),f=0,c=i(c);for(var o=null,s=1;s<c.length;s++)if(c[s].t>=c[s-1].t){var l=c[s].score-c[s-1].score;(!o||o.rate<=l)&&(o={t:c[s].t,rate:l})}o&&o.t>0&&o.t<36e5?n.$ay({fmp:o.t}):n.$ay()}else r.delay(function(){n.$az(e)},a)}})}},{"../util":16}],5:[function(e,t,n){t.exports=function(t,n){var r=e("../util"),a=n.history||{},o=n.document,i=function(e,t){var r;n.CustomEvent?r=new CustomEvent(e,{detail:t}):((r=o.createEvent("HTMLEvents")).initEvent(e,!1,!0),r.detail=t),n.dispatchEvent(r)},s=function(e){var t=a[e];"function"==typeof t&&(a[e]=function(n,o,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=r.$ar(l[0]),g=r.$ar(p[0]),d=l[1]&&l[1].replace(/^\/?(.*)/,"$1"),v=p[1]&&p[1].replace(/^\/?(.*)/,"$1");h!==g?i("historystatechange",g):d!==v&&i("historystatechange",v)}catch(m){r.warn("[retcode] error in "+e+": "+m)}return f},a[e].toString=r.$b0(e))};r.ext(t.prototype,{$b1:function(){return this.$b2?this:(s("pushState"),s("replaceState"),this.$b2=!0,this)}})}},{"../util":16}],6:[function(e,t,n){t.exports=function(t,n,r){var a=e("../util"),o=e("../common/res"),i=e("../common/perf"),s=null,c=r.documentElement,u=n.innerWidth||c.clientWidth||r.body.clientWidth,f=n.innerHeight||c.clientHeight||r.body.clientHeight,l=n.navigator.connection,p={sr:screen.width+"x"+screen.height,vp:u+"x"+f,ct:l?l.effectiveType||l.type:""},h={},g=function(e,t,n,o,i){if(t===undefined){var s,c;if(!h[e]){s=new RegExp(e+"=([^;]+)");try{c=s.exec(r.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;o&&(u+="; domain="+o),u+="; path="+(i||"/"),n&&(u+="; max-age="+n);try{return r.cookie=u,!!r.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 n=e.target||e.srcElement;!(!n||!n.tagName||e.message||e.filename||e.lineno||e.colno)?this.$b3(e):this.error(e.error||{message:e.message},e)}else"unhandledrejection"===t&&a.T(e.reason,"Error")&&a.$b4(e.reason)&&this.error(e.reason);try{this.getConfig("behavior")&&this.reportBehavior&&this.reportBehavior()}catch(e){}return this},$b3:function(e){var t=this,n=e.target||e.srcElement;try{var r=t.$b5(n),o=n.tagName?n.tagName.toLowerCase():"",i=t.$b6(n,5);return t._lg("resourceError",{src:r&&r.substring(0,1e3),node_name:o,xpath:i}),t}catch(s){return a.warn("[ARMS] $b3 error :",s),t}},$b5:function(e){var t=e.src||e.href;try{if(!t){var n="object"===(e.tagName?e.tagName.toLowerCase():""),r=e.getAttribute("classid")&&"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"===e.getAttribute("classid").toLowerCase()||"application/x-shockwave-flash"===e.getAttribute("type");n&&r&&(t=e.getAttribute("data")||e.getAttribute("codebase")),t||(t=e.outerHTML||e.innerHTML)}}catch(a){t=""}return t},$b6:function(e,t){var n=e.id?"#"+e.id:"",r=e.className?"."+e.className.split(" ").join("."):"",a=(e.tagName?e.tagName.toLowerCase():"")+n+r;return e.parentNode&&e.parentNode.tagName&&t-1!=0?this.$b6(e.parentNode,t-1)+" > "+a:a},$ay:function(e){var t=this;t.$a2(function(){var n=i();n&&(n.page=t.$a7(!0),e&&(n=a.ext(n,e)),t.$b7&&(n=a.ext(n,t.$b7)),t.getConfig("autoSendPerf")?(n.autoSend=!0,t.performance(n)):t.$b7=n)})},$b8:function(e){var t=this;t.$a2(function(){var n=o();n&&(n.load&&n.load<=2e3||n.load&&n.load<=8e3&&Math.random()>.05||(n.page=t.$a7(!0),n.dl=location.href,e&&(n=a.ext(n,e)),t._lg("res",n,t.getConfig("sample"))))})},$av:function(){var e=this;e.$a2(function(){var t=function(e){var t=d(e),a=n.devicePixelRatio||1;return{uid:t,dt:r.title,dl:location.href,dr:r.referrer,dpr:a.toFixed(2),de:(r.characterSet||r.defaultCharset||"").toLowerCase(),ul:c.lang,begin:Date.now()}}(e);t&&t.uid&&e._lg("pv",t,e.getConfig("pvSample"))})},$af:function(){return p.uid=d(this),p},$au:function(e){var t=Date.now();if(t-this._lastUnload<200)return this;this._lastUnload=t,this.$ax(e),this.$b9&&(this._lg("speed",this.$b9),this.$b9=null,clearTimeout(this.$ba)),this.$a4()},$aw:function(e){var t=this;if(!e^t.$bb)return t;e?(t.$b1(),t.$bb=function(e){var n=t._conf.parseHash(location.hash);n&&t.setPage(n,!1!==e)},t.$bc=function(e){var n=t._conf.parseHash(e.detail);n&&t.setPage(n)},a.on(n,"hashchange",t.$bb),a.on(n,"historystatechange",t.$bc),t.$bb(!1)):(a.off(n,"hashchange",t.$bb),a.off(n,"historystatechange",t.$bc),t.$bb=null,t.$bc=null)},$al:function(){var e=this;if(e.$bd)return e;var t=e._conf;return a.on(n,"beforeunload",function(){e.$au(0)}),e.$aw(t.enableSPA),e.activeErrHandler(!1),e.$bd=!0,e}}),a.on(n,"error",function(e){s&&s.errorHandler(e)},!1,!0).on(n,"unhandledrejection",function(e){s&&s.errorHandler(e)}),t}},{"../common/perf":9,"../common/res":11,"../util":16}],7:[function(e,t,n){t.exports=function(t,n){var r=e("../util"),a=null,o=r.getCurDomain(),i=function(e,t,n,a,i,s,c,u,f,l){var p=r.J(i)||null,h=r.$a8(t,[p,a],null);if(!h)return!1;var g=h.code||s,d=!("success"in h)||h.success;e.api(n,d,c,g,h.msg,u,f,l,{},o)},s="fetch",c="__oFetch_",u="__oXMLHttpRequest_",f="XMLHttpRequest";return r.ext(t.prototype,{removeHook:function(e,t){return a&&(t||this===a)?(n[c]&&(n[s]=n[c],delete n[c]),n[u]&&(n[f]=n[u],delete n[u]),a=null,this):this},addHook:function(e){return!e&&a?this:(a||(function(){if("function"==typeof n[s]){var e=n[s];n[c]=e,n[s]=function(t,s){var c=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),u=a;if(!u||!u.api)return e.apply(n,c);if(s&&("HEAD"===s.method||"no-cors"===s.mode))return e.apply(n,c);var f=Date.now(),l=u._conf,p=(t&&"string"!=typeof t?t.url:t)||"",h=p;if(p=r.$ar(p),!r.$be(p,!0))return e.apply(n,c);p=r.$aq(p,l.ignoreApiPath?l.ignoreApiPath:l.apiHelper);var g=l.enableLinkTrace,d="",v="",m=u.getConfig("pid");if(g){var y="";try{y=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(E){y=""}if(r.checkSameOrigin(h,y)){if(t&&"string"!=typeof t)try{if(c[0].headers&&"function"==typeof c[0].headers.get&&"function"==typeof c[0].headers.append){var b=c[0].headers.get("EagleEye-TraceID"),$=c[0].headers.get("EagleEye-SessionID"),w=c[0].headers.get("EagleEye-pAppName");b?d=b:(d=u.getTraceId()["EagleEye-TraceID"],c[0].headers.append("EagleEye-TraceID",d)),$?v=$:(v=u.getSessionId()["EagleEye-SessionID"],c[0].headers.append("EagleEye-SessionID",v)),w||c[0].headers.append("EagleEye-pAppName",m)}}catch(_){r.warn("[retcode] fetch failed to set header, exception is :\n"+_)}s&&(s.headers=s.headers?s.headers:{},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.getSessionId()["EagleEye-SessionID"],s.headers["EagleEye-SessionID"]=v),s.headers["EagleEye-pAppName"]||(s.headers["EagleEye-pAppName"]=m))}}return e.apply(n,c).then(function(e){if(!u||!u.api)return e;try{if(!e||"function"!=typeof e.clone)return e;var t=e.clone(),n=t.headers;if(n&&"function"==typeof n.get){var a=n.get("content-type");if(a&&!/(text)|(json)/.test(a))return e}var s=Date.now()-f;return t.text().then(function(e){var a=r.getFetchSnapshot(c,e,n);t.ok?i(u,l.parseResponse,p,h,e,t.status||200,s,f,d,v):u.api(p,!1,s,t.status||404,t.statusText,f,d,v,a,o)}),e}catch(E){return r.warn("[ARMS] fetch response error :",E),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,{},o),e})},n[s].toString=r.$b0(s)}}(),function(){if("function"==typeof n[f]){var e,t=n[f];n[u]=t,n[f]=function(n){var s=new t(n),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="";return s.open=function(t,n){e=t;var a=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);if(h.apply(s,a),l=n||"",f=r.$ar(l),f=f?r.$aq(f,d.ignoreApiPath?d.ignoreApiPath:d.apiHelper):"",v){var o="";try{o=location.origin?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}catch(i){o=""}r.checkSameOrigin(l,o)&&g&&"function"==typeof g&&(m=c.getTraceId()["EagleEye-TraceID"],g.apply(s,["EagleEye-TraceID",m]),y=c.getSessionId()["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)},r.on(s,"readystatechange",function(){if(f&&4===s.readyState){var t=Date.now()-u,n=r.getXhrSnapshot(l,e,s);if(s.status>=200&&s.status<=299){var a=s.status||200;if("function"==typeof s.getResponseHeader){var p=s.getResponseHeader("Content-Type");if(p&&!/(text)|(json)/.test(p))return}s.responseType&&"text"!==s.responseType?c.api(f,!0,t,a,"",u,m,y,{},o):i(c,d.parseResponse,f,l,s.responseText,a,t,u,m,y)}else c.api(f,!1,t,s.status||"FAILED",s.statusText,u,m,y,n,o)}}),s},n[f].toString=r.$b0(f)}}()),a=this,this)},$am:function(){return this.$bf?this:(this.getConfig("disableHook")||this.addHook(),this.$bf=!0,this)}}),t}},{"../util":16}],8:[function(e,t,n){n.TIMING_KEYS=["","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","requestStart","responseStart","responseEnd","","domInteractive","","domContentLoadedEventEnd","","loadEventStart","","msFirstPaint","secureConnectionStart"]},{}],9:[function(e,t,n){var r=e("../util"),a=e("./constants").TIMING_KEYS;t.exports=function(){var e=r.win||{},t=e.performance;if(!t||"object"!=typeof t)return null;var n={},o=t.timing||{},i=Date.now(),s=1;if("function"==typeof e.PerformanceNavigationTiming){var c=t.getEntriesByType("navigation")[0];c&&(o=c,s=2)}r.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 r=o[a[e[1]]],i=o[a[e[0]]];if(2===s||r>0&&i>0){var c=Math.round(i-r);c>=0&&c<36e5&&(n[t]=c)}});var u=e.navigator.connection,f=t.navigation||{};n.ct=u?u.effectiveType||u.type:"";var l=u?u.downlink||u.downlinkMax||u.bandwidth||null:null;if((l=l>999?999:l)&&(n.bandwidth=l),n.navtype=1===f.type?"Reload":"Other",1===s&&o[a[16]]>0&&o[a[1]]>0){var p=o[a[16]]-o[a[1]];p>=0&&p<36e5&&(n.fpt=p)}return 1===s&&o[a[1]]>0?n.begin=o[a[1]]:2===s&&n.load>0?n.begin=i-n.load:n.begin=i,n}},{"../util":16,"./constants":8}],10:[function(e,t,n){var r=e("../util"),a="object"==typeof window?window:{},o=a.__oXMLHttpRequest_||a.XMLHttpRequest;o="function"==typeof o?o:undefined,t.exports=function(e,t){try{var n=new o;n.open("POST",t,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(e))}catch(a){r.warn("[retcode] Failed to log, exception is :\n"+a)}}},{"../util":16}],11:[function(e,t,n){var r=e("../util"),a=e("./constants").TIMING_KEYS;t.exports=function(){var e=r.win||{},t=e.performance;if(!t||"object"!=typeof t||"function"!=typeof t.getEntriesByType)return null;var n={},o=t.timing||{},i=t.getEntriesByType("resource")||[];if(n.begin=o[a[1]]||Date.now(),"function"==typeof e.PerformanceNavigationTiming){var s=t.getEntriesByType("navigation")[0];s&&(o=s)}return r.each({dom:[10,8],load:[14,1]},function(e,t){var r=o[a[e[1]]],i=o[a[e[0]]];if(r>0&&i>0){var s=Math.round(i-r);s>=0&&s<36e5&&(n[t]=s)}}),n.res=JSON.stringify(i),n}},{"../util":16,"./constants":8}],12:[function(e,t,n){var r=e("../util");t.exports=function(e,t){"object"==typeof e&&(e=r.serialize(e));var n=t+e;window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?window.navigator.sendBeacon(n,"&post_res="):r.warn("[arms] navigator.sendBeacon not surported")}},{"../util":16}],13:[function(e,t,n){var r=e("../util"),a="object"==typeof window?window:{},o=a.__oFetch_||a.fetch;o="function"==typeof o?o:undefined,t.exports=function(e,t){var n=-1;"object"==typeof e&&(n=e.z,e=r.serialize(e));var i=t+e;if(o)return o(i,{method:"HEAD",mode:"no-cors"})["catch"](r.noop);if(a.document&&a.document.createElement){var s="__request_hold_"+n,c=a[s]=new Image;c.onload=c.onerror=function(){a[s]=undefined},c.src=i,c=null}}},{"../util":16}],14:[function(e,t,n){"use strict";function r(e,t){var n=a[i]=new o(e);n.$ao(t);var r=n._conf;return!1!==r.autoSendPv&&n.$av(),r&&r.useFmp||n.$ay(),r&&r.sendResource&&n.$b8(),a[s]=!0,n}var a=window,o=a.BrowserLogger=e("./biz.browser/clazz"),i=e("./util").key,s="__hasInitBlSdk";o.singleton=function(e,t){return a[s]?a[i]:r(e,t)},o.createExtraInstance=function(e){e&&"object"==typeof e&&!0!==e.enableInstanceAutoSend&&(e.enableInstanceAutoSend=!1);var t=new o(e),n=t._conf;return n.enableInstanceAutoSend&&(!1!==n.autoSendPv&&t.$av(),n&&n.useFmp||t.$ay(),n&&n.sendResource&&t.$b8()),t};"object"==typeof window&&!!window.navigator&&a[i]&&(o.bl=function(){if(a[s])return a[i];var e={},t=[];return i in a&&(e=a[i].config||{},t=a[i].pipe||[]),r(e,t)}(a.__hasInitBlSdk)),t.exports=o},{"./biz.browser/clazz":3,"./util":16}],15:[function(e,t,n){var r=e("./util"),a=e("./base"),o=["api","success","time","code","msg","trace","traceId","begin","sid","seq","domain"],i=function(e,t){var n=e.split("::");return n.length>1?r.ext({group:n[0],key:n[1]},t):r.ext({group:"default_group",key:n[0]},t)},s=function(e){a.call(this,e);var t;try{t="object"==typeof performance?performance.timing.fetchStart:Date.now()}catch(n){t=Date.now()}return this._startTime=t,this};s.prototype=r.$ap(a.prototype),r.ext(a.dftCon,{startTime:null}),r.ext(s.prototype,{constructor:s,_super:a,sum:function(e,t,n){try{return this._lg("sum",i(e,{val:t||1,begin:Date.now()}),n)}catch(a){r.warn("[retcode] can not get parseStatData: "+a)}},avg:function(e,t,n){try{return this._lg("avg",i(e,{val:t||0,begin:Date.now()}),n)}catch(a){r.warn("[retcode] can not get parseStatData: "+a)}},percent:function(e,t,n,a){try{return this._lg("percent",i(e,{subkey:t,val:n||0,begin:Date.now()}),a)}catch(o){r.warn("[retcode] can not get parseStatData: "+o)}},msg:function(e,t){if(e&&!(e.length>180))return this.custom({msg:e},t)},error:function(e,t){if(!e)return r.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 n=e.name||"CustomError",a=e.message||"",o=e.stack||"";t=t||{};var i={begin:Date.now(),cate:n,msg:a&&a.substring(0,1e3),stack:o&&o.substring(0,1e3),file:r.$bg(t.filename||""),line:t.lineno||"",col:t.colno||"",err:{msg_raw:r.encode(a),stack_raw:r.encode(o)}},s=(this.getConfig("ignore")||{}).ignoreErrors;return r.$ah(i.msg,s)||r.$ah(r.decode(i.msg),s)?this:(this.$ak&&this.$ak("error",i),this._lg("error",i,1))},behavior:function(e){if(e){var t="object"==typeof e&&e.behavior?e:{behavior:e};return this.$ak&&this.$ak("behavior",t),this._lg("behavior",t,1)}},api:function(e,t,n,a,i,s,c,u,f,l){if(!e)return r.warn("[retcode] api is null"),this;if(e="string"==typeof e?{api:e,success:t,time:n,code:a,msg:i,begin:s,traceId:c,sid:u,domain:l}:r.sub(e,o),!r.$be(e.api))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.sid=e.sid||"",e.domain=e.domain||"",e.success?e.apiSnapshot&&delete e.apiSnapshot:e.apiSnapshot=f,!e.api||isNaN(e.time))return r.warn("[retcode] invalid time or api"),this;var p=(this.getConfig("ignore")||{}).ignoreApis;if(r.$ah(e.api,p)||r.$ah(r.decode(e.api),p))return this;this.$ak&&this.$ak("api",e);var h={type:"api",data:{message:e.msg,url:e.api,status:e.code},timestamp:e.begin};try{this.getConfig("behavior")&&this.addBehavior&&this.addBehavior(h)}catch(g){}return this._lg("api",e,e.success&&this.getConfig("sample"))},speed:function(e,t,n){var a=this,o=this.getConfig("startTime")||this._startTime;return/^s(\d|1[0])$/.test(e)?(t="number"!=typeof t?Date.now()-o:t>=o?t-o:t,a.$b9=a.$b9||{},a.$b9[e]=t,a.$b9.begin=o,clearTimeout(a.$ba),a.$ba=setTimeout(function(){n||(a.$b9.page=a.$a7(!0)),a._lg("speed",a.$b9),a.$b9=null},5e3),a):(r.warn("[retcode] invalid point: "+e),a)},performance:function(e){if(e&&"object"==typeof e){var t={},n=this.getConfig("autoSendPerf");if(n&&e.autoSend&&!this.$bh)return this.$bh=!0,this._lg("perf",e,this.getConfig("sample"));for(var a in e)(/^t([1-9]|1[0])$/.test(a)||"ctti"===a||"cfpt"===a)&&(t[a]=e[a]);if(n&&!0!==e.autoSend)this.$b7=r.ext(this.$b7||{},t);else if(!1===n&&!this.$bh){if(!this.$b7||"object"!=typeof this.$b7)return;return t=r.ext(this.$b7,t),this.$bh=!0,this._lg("perf",t,this.getConfig("sample"))}}},resource:function(e,t){if(!e||!r.isPlainObject(e))return r.warn("[arms] invalid param data: "+e),this;var n=Object.keys(e),a=["begin","dom","load","res","dl"],o=!1;for(var i in a){if(n.indexOf(a[i])<0){o=!0;break}}if(o)return r.warn("[arms] lack param data: "+e),this;var s={begin:e.begin||Date.now(),dom:e.dom||"",load:e.load||"",res:r.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,n){Date.now=Date.now||function(){return(new Date).getTime()};var r=Date.now(),a=function(){},o={noop:a,warn:function(){var e="object"==typeof console?console.warn:a;try{var t={warn:e};t.warn.call(t)}catch(n){return a}return e}(),key:"__bl",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?",$ap:function(e){if(Object.create)return Object.create(e);var t=function(){};return t.prototype=e,new t},each:function(e,t){var n=0,r=e.length;if(this.T(e,"Array"))for(;n<r&&!1!==t.call(e[n],e[n],n);n++);else for(n in e)if(!1===t.call(e[n],e[n],n))break;return e},$a8:function(e,t,n){if("function"!=typeof e)return n;try{return e.apply(this,t)}catch(r){return n}},T:function(e,t){var n=Object.prototype.toString.call(e).substring(8).replace("]","");return t?n===t:n},$aq:function(e,t){if(!e)return"";if(!t)return e;var n=this,r=n.T(t);return"Function"===r?n.$a8(t,[e],e):"Array"===r?(this.each(t,function(t){e=n.$aq(e,t)}),e):"Object"===r?e.replace(t.rule,t.target||""):e.replace(t,"")},$ah:function(e,t){if(!e||!t)return!1;if((this.isString(t)||t.source||"Function"===this.T(t))&&(t=[t]),!this.isArray(t))return o.warn("[arms] invalid rules of ignore config, (list of) String/RegExp/Funcitons are available"),!1;for(var n,r=[],a=0,i=t.length;a<i;a++)if(n=t[a],this.isString(n))r.push(n.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"));else if(n&&n.source)r.push(n.source);else if(n&&"Function"===this.T(n)&&!0===this.$a8(n,[e],!1))return!0;var s=new RegExp(r.join("|"),"i");return!!(r.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(n){}return t},pick:function(e){return 1===e||1===Math.ceil(Math.random()*e)},$a9:function(e){if("sample"in e){var t=e.sample,n=t;t&&/^\d+(\.\d+)?%$/.test(t)&&(n=parseInt(100/parseFloat(t))),0<n&&1>n&&(n=parseInt(1/n)),n>=1&&n<=100?e.sample=n:delete e.sample}return e},on:function(e,t,n,r,a){return e.addEventListener?(a=a||!1,e.addEventListener(t,function o(i){r&&e.removeEventListener(t,o,a),n.call(this,i)},a)):e.attachEvent&&e.attachEvent("on"+t,function i(a){r&&e.detachEvent("on"+t,i),n.call(this,a)}),this},off:function(e,t,n){return n?(e.removeEventListener?e.removeEventListener(t,n):e.detachEvent&&e.detachEvent(t,n),this):this},delay:function(e,t){return-1===t?(e(),null):setTimeout(e,t||0)},ext:function(e){for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},sub:function(e,t){var n={};return this.each(e,function(e,r){-1!==t.indexOf(r)&&(n[r]=e)}),n},uu:function(){for(var e,t,n=20,r=new Array(n),a=Date.now().toString(36).split("");n-- >0;)t=(e=36*Math.random()|0).toString(36),r[n]=e%3?t:t.toUpperCase();for(var o=0;o<8;o++)r.splice(3*o+2,0,a[o]);return r.join("")},seq:function(){return(r++).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(n){}return e},serialize:function(e){e=e||{};var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==undefined&&t.push(n+"="+this.encode(e[n],"msg"===n));return t.join("&")},$be:function(e,t){if(!e||"string"!=typeof e)return!1;var n=/arms-retcode[\w-]*\.aliyuncs/.test(e);return!n&&t&&(n=/(\.png)|(\.gif)|(alicdn\.com)/.test(e)),!n},$b4:function(e){return!(!e||!e.message)&&!/failed[\w\s]+fetch/i.test(e.message)},$ar:function(e){return e&&"string"==typeof e?e.replace(/^(https?:)?\/\//,"").replace(/\?.*$/,""):""},$bg:function(e){return e&&"string"==typeof e?e.replace(/\?.*$/,""):""},$b0:function(e){return function(){return e+"() { [native code] }"}},checkSameOrigin:function(e,t){if(!t||!e)return!1;var n="//"+t.split("/")[2];return e===t||e.slice(0,t.length+1)===t+"/"||e===n||e.slice(0,n.length+1)===n+"/"||!/^(\/\/|http:|https:).*/.test(e)},getRandIP:function(){for(var e=[],t=0;t<4;t++){var n=Math.floor(256*Math.random());e[t]=(n>15?"":"0")+n.toString(16)}return e.join("")},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=[],n=0;n<e;n++){var r=Math.floor(16*Math.random());t[n]=r.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 n=e.keys(),r=n.next();!r.done;){var a=r.value;t[a]=e.get(a),r=n.next()}else t=e}catch(o){t={}}return t},parseXhrHeaders:function(e){if(!e&&"string"!=typeof e)return{};var t={};try{var n=e.split("\r\n");t=n.reduce(function(e,t){var n=t.split(": ");return e[n[0]]=n[1],e},{})}catch(r){t={}}return t},getQuerys:function(e){if(!e)return"";var t={},n=[],r="",a="";try{var o=[];if(e.indexOf("?")>=0&&(o=e.substring(e.indexOf("?")+1,e.length).split("&")),o.length>0)for(var i in o)r=(n=o[i].split("="))[0],a=n[1],t[r]=a}catch(s){t={}}return t},getFetchSnapshot:function(e,t,n){var r,a;try{var o=(e&&"string"!=typeof e[0]?e[0].url:e[0])||"",i=(e&&"string"!=typeof e[0]?e[0]:e[1])||{},s="POST"===i.method.toUpperCase()?i.body:this.getQuerys(o);r={originApi:o,method:i.method||"unknown",params:s,response:t||"",reqHeaders:this.parseFetchHeaders(i.headers||null),resHeaders:this.parseFetchHeaders(n)},a="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(r))||"{}"}catch(c){a="{}"}return a},getXhrSnapshot:function(e,t,n){if(!e||!t||!n)return{};var r,a;try{r={originApi:e,method:t,params:this.getQuerys(e),response:n.responseText||n.responseXml||"",reqHeaders:{},resHeaders:this.parseXhrHeaders("function"==typeof n.getAllResponseHeaders&&n.getAllResponseHeaders()||"")},a="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(r))||"{}"}catch(o){a="{}"}return a},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,n=[],r=0,a=e.length;r<a;r++)t=e[r],this.isString(t)?n.push(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):t&&t.source&&n.push(t.source);return new RegExp(n.join("|"),"i")},reWriteMethod:function(e,t,n){if(null!==e){var r=e[t];e[t]=n(r)}}};t.exports=o},{}]},{},[14]);

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

/** retcode cloud sdk | @version 1.8.3 | @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(n){return noop}return t},util={noop:noop,warn:$a1(),key:"__bl",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 n=0,r=t.length;if(this.T(t,"Array"))for(;n<r&&!1!==e.call(t[n],t[n],n);n++);else for(n in t)if(!1===e.call(t[n],t[n],n))break;return t},$a3:function(t,e,n){if("function"!=typeof t)return n;try{return t.apply(this,e)}catch(r){return n}},T:function(t,e){var n=Object.prototype.toString.call(t).substring(8).replace("]","");return e?n===e:n},$a4:function(t,e){if(!t)return"";if(!e)return t;var n=this,r=n.T(e);return"Function"===r?n.$a3(e,[t],t):"Array"===r?(this.each(e,function(e){t=n.$a4(t,e)}),t):"Object"===r?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 n,r=[],i=0,o=e.length;i<o;i++)if(n=e[i],this.isString(n))r.push(n.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"));else if(n&&n.source)r.push(n.source);else if(n&&"Function"===this.T(n)&&!0===this.$a3(n,[t],!1))return!0;var a=new RegExp(r.join("|"),"i");return!!(r.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(n){}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,n=e;e&&/^\d+(\.\d+)?%$/.test(e)&&(n=parseInt(100/parseFloat(e))),0<n&&1>n&&(n=parseInt(1/n)),n>=1&&n<=100?t.sample=n:delete t.sample}return t},on:function(t,e,n,r,i){return t.addEventListener?(i=i||!1,t.addEventListener(e,function o(a){r&&t.removeEventListener(e,o,i),n.call(this,a)},i)):t.attachEvent&&t.attachEvent("on"+e,function a(i){r&&t.detachEvent("on"+e,a),n.call(this,i)}),this},off:function(t,e,n){return n?(t.removeEventListener?t.removeEventListener(e,n):t.detachEvent&&t.detachEvent(e,n),this):this},delay:function(t,e){return-1===e?(t(),null):setTimeout(t,e||0)},ext:function(t){for(var e=1,n=arguments.length;e<n;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},sub:function(t,e){var n={};return this.each(t,function(t,r){-1!==e.indexOf(r)&&(n[r]=t)}),n},uu:function(){for(var t,e,n=20,r=new Array(n),i=Date.now().toString(36).split("");n-- >0;)e=(t=36*Math.random()|0).toString(36),r[n]=t%3?e:e.toUpperCase();for(var o=0;o<8;o++)r.splice(3*o+2,0,i[o]);return r.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(n){}return t},serialize:function(t){t=t||{};var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&t[n]!==undefined&&e.push(n+"="+this.encode(t[n],"msg"===n));return e.join("&")},$a7:function(t,e){if(!t||"string"!=typeof t)return!1;var n=/arms-retcode[\w-]*\.aliyuncs/.test(t);return!n&&e&&(n=/(\.png)|(\.gif)|(alicdn\.com)/.test(t)),!n},$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 n="//"+e.split("/")[2];return t===e||t.slice(0,e.length+1)===e+"/"||t===n||t.slice(0,n.length+1)===n+"/"||!/^(\/\/|http:|https:).*/.test(t)},getRandIP:function(){for(var t=[],e=0;e<4;e++){var n=Math.floor(256*Math.random());t[e]=(n>15?"":"0")+n.toString(16)}return t.join("")},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=[],n=0;n<t;n++){var r=Math.floor(16*Math.random());e[n]=r.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 n=t.keys(),r=n.next();!r.done;){var i=r.value;e[i]=t.get(i),r=n.next()}else e=t}catch(o){e={}}return e},parseXhrHeaders:function(t){if(!t&&"string"!=typeof t)return{};var e={};try{var n=t.split("\r\n");e=n.reduce(function(t,e){var n=e.split(": ");return t[n[0]]=n[1],t},{})}catch(r){e={}}return e},getQuerys:function(t){if(!t)return"";var e={},n=[],r="",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)r=(n=o[a].split("="))[0],i=n[1],e[r]=i}catch(s){e={}}return e},getFetchSnapshot:function(t,e,n){var r,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);r={originApi:o,method:a.method||"unknown",params:s,response:e||"",reqHeaders:this.parseFetchHeaders(a.headers||null),resHeaders:this.parseFetchHeaders(n)},i="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(r))||"{}"}catch(u){i="{}"}return i},getXhrSnapshot:function(t,e,n){if(!t||!e||!n)return{};var r,i;try{r={originApi:t,method:e,params:this.getQuerys(t),response:n.responseText||n.responseXml||"",reqHeaders:{},resHeaders:this.parseXhrHeaders("function"==typeof n.getAllResponseHeaders&&n.getAllResponseHeaders()||"")},i="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(r))||"{}"}catch(o){i="{}"}return i},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,n=[],r=0,i=t.length;r<i;r++)e=t[r],this.isString(e)?n.push(e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):e&&e.source&&n.push(e.source);return new RegExp(n.join("|"),"i")},reWriteMethod:function(t,e,n){if(null!==t){var r=t[e];t[e]=n(r)}}},util_1=util,sendBeacon=function(t,e){"object"==typeof t&&(t=util_1.serialize(t));var n=e+t;window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?window.navigator.sendBeacon(n,"&post_res="):util_1.warn("[arms] navigator.sendBeacon not surported")},pushToQueue=function(t,e){var n;{if("error"!==e.t||!(n=t.$ac[0])||"error"!==n.t||e.msg!==n.msg){if("behavior"===e.t){var r=t.$ac&&t.$ac.length;if(r>0&&"behavior"===t.$ac[r-1].t){var i=e.behavior||[];t.$ac[r-1].behavior.concat(i)}else t.$ac.push(e)}else t.$ac.unshift(e);return t.$ad(function(){t.$ae=util_1.delay(function(){t.$af()},t.$ac[0]&&"error"===t.$ac[0].t?3e3:-1)}),!0}n.times++}},Base=function(t){return this.ver="1.8.3",this._conf=util_1.ext({},Base.dftCon),this.$ag={},this.$ac=[],this.hash=util_1.seq(),this.$ah(),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:[]},release:undefined,environment:"production"},Base.prototype={constructor:Base,$ad:function(t){return t()},$ai: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.$aj(t),this._conf=util_1.ext({},this._conf,t))},$aj:function(t){var e=t.region,n=t.imgUrl;if(e){var r=util_1.regionMap[e];return t.imgUrl=r||util_1.defaultImgUrl,t}return n&&(t.imgUrl=n),t},$ak:function(t){if(this.getConfig("debug"))return!0;var e=util_1.regionMap,n=!1;for(var r in e)if(e[r]===t){n=!0;break}return!n&&util_1.warn("[retcode] invalid url: "+t),n},$al:function(){},$am:function(t){sendBeacon(t,this.getConfig("imgUrl"))},$an:function(){},$ao:function(){return{}},setCommonInfo:function(t){t&&"object"==typeof t&&(this._common=util_1.ext({},this._common,t))},$ah:function(){this.session=util_1.uu(),this.sBegin=Date.now()},getTraceId:function(){var t=this.rip,e=Date.now(),n=util_1.getSortNum(this.record),r=t+e+n+util_1.getRandNum(this._conf.pid);return this["EagleEye-TraceID"]=r,this.record=n,{"EagleEye-TraceID":r}},getSessionId:function(){return{"EagleEye-SessionID":this.session}},getConfig:function(t){return t?this._conf[t]:util_1.ext({},this._conf)},$ap:function(t){return 1===t||("boolean"==typeof this.$ag[t]?this.$ag[t]:(this.$ag[t]=util_1.pick(t),this.$ag[t]))},$af:function(){var t;clearTimeout(this.$ae),this.$ae=null;for(var e=this._conf&&"function"==typeof this._conf.sendRequest;t=this.$ac.pop();)"res"===t.t?this.$an(t,"res"):"error"===t.t?this.$an(t,"err"):"api"===t.t?this.$an(t,"apiSnapshot"):"behavior"===t.t?this.$an(t,"behavior"):"health"===t.t&&!e&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?this.$am(t):this.$al(t);return this},_lg:function(t,e,n){var r=this._conf,i=this.$ai(),o=r.ignore||{},a=o.ignoreErrors,s=o.ignoreUrls,u=o.ignoreApis;return util_1.$a5(i,s)||util_1.$a5(util_1.decode(i),s)?this:"error"===t&&(util_1.$a5(e.msg,a)||util_1.$a5(util_1.decode(e.msg),a))?this:"api"===t&&(util_1.$a5(e.api,u)||util_1.$a5(util_1.decode(e.api),u))?this:this.$ak(r.imgUrl)&&e&&!r.disabled&&r.pid?n&&!this.$ap(n)?this:(e=util_1.ext({t:t,times:1,page:i,tag:r.tag||"",release:r.release||"",environment:r.environment,begin:Date.now()},e,this.$ao(),this._common,{pid:r.pid,_v:this.ver,sid:this.session,sampling:n||1,z:util_1.seq(),c1:r.c1,c2:r.c2,c3:r.c3}),pushToQueue(this,e)):this},custom:function(t,e){if(!t||"object"!=typeof t)return this;var n=!1,r={begin:Date.now()};return util_1.each(t,function(t,e){return!(n=e&&e.length<=20)&&util_1.warn("[retcode] invalid key: "+e),r["x-"+e]=t,n}),n?this._lg("custom",r,e||1):this}};var base=Base,validApiKeys=["api","success","time","code","msg","trace","traceId","begin","sid","seq","domain"],parseStatData=function(t,e){var n=t.split("::");return n.length>1?util_1.ext({group:n[0],key:n[1]},e):util_1.ext({group:"default_group",key:n[0]},e)},Reporter=function(t){base.call(this,t);var e;try{e="object"==typeof performance?performance.timing.fetchStart:Date.now()}catch(n){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,n){try{return this._lg("sum",parseStatData(t,{val:e||1,begin:Date.now()}),n)}catch(r){util_1.warn("[retcode] can not get parseStatData: "+r)}},avg:function(t,e,n){try{return this._lg("avg",parseStatData(t,{val:e||0,begin:Date.now()}),n)}catch(r){util_1.warn("[retcode] can not get parseStatData: "+r)}},percent:function(t,e,n,r){try{return this._lg("percent",parseStatData(t,{subkey:e,val:n||0,begin:Date.now()}),r)}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 n=t.name||"CustomError",r=t.message||"",i=t.stack||"";e=e||{};var o={begin:Date.now(),cate:n,msg:r&&r.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(r),stack_raw:util_1.encode(i)}},a=(this.getConfig("ignore")||{}).ignoreErrors;return util_1.$a5(o.msg,a)||util_1.$a5(util_1.decode(o.msg),a)?this:(this.$as&&this.$as("error",o),this._lg("error",o,1))},behavior:function(t){if(t){var e="object"==typeof t&&t.behavior?t:{behavior:t};return this.$as&&this.$as("behavior",e),this._lg("behavior",e,1)}},api:function(t,e,n,r,i,o,a,s,u,c){if(!t)return util_1.warn("[retcode] api is null"),this;if(t="string"==typeof t?{api:t,success:e,time:n,code:r,msg:i,begin:o,traceId:a,sid:s,domain:c}:util_1.sub(t,validApiKeys),!util_1.$a7(t.api))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.sid=t.sid||"",t.domain=t.domain||"",t.success?t.apiSnapshot&&delete t.apiSnapshot:t.apiSnapshot=u,!t.api||isNaN(t.time))return util_1.warn("[retcode] invalid time or api"),this;var f=(this.getConfig("ignore")||{}).ignoreApis;if(util_1.$a5(t.api,f)||util_1.$a5(util_1.decode(t.api),f))return this;this.$as&&this.$as("api",t);var g={type:"api",data:{message:t.msg,url:t.api,status:t.code},timestamp:t.begin};try{this.getConfig("behavior")&&this.addBehavior&&this.addBehavior(g)}catch(l){}return this._lg("api",t,t.success&&this.getConfig("sample"))},speed:function(t,e,n){var r=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,r.$aq=r.$aq||{},r.$aq[t]=e,r.$aq.begin=i,clearTimeout(r.$ar),r.$ar=setTimeout(function(){n||(r.$aq.page=r.$ai(!0)),r._lg("speed",r.$aq),r.$aq=null},5e3),r):(util_1.warn("[retcode] invalid point: "+t),r)},performance:function(t){if(t&&"object"==typeof t){var e={},n=this.getConfig("autoSendPerf");if(n&&t.autoSend&&!this.$at)return this.$at=!0,this._lg("perf",t,this.getConfig("sample"));for(var r in t)(/^t([1-9]|1[0])$/.test(r)||"ctti"===r||"cfpt"===r)&&(e[r]=t[r]);if(n&&!0!==t.autoSend)this.$au=util_1.ext(this.$au||{},e);else if(!1===n&&!this.$at){if(!this.$au||"object"!=typeof this.$au)return;return e=util_1.ext(this.$au,e),this.$at=!0,this._lg("perf",e,this.getConfig("sample"))}}},resource:function(t,e){if(!t||!util_1.isPlainObject(t))return util_1.warn("[arms] invalid param data: "+t),this;var n=Object.keys(t),r=["begin","dom","load","res","dl"],i=!1;for(var o in r){if(n.indexOf(r[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._health={errcount:0,apisucc:0,apifail:0},e.DEFAUT_PAGE_PATH="[app]",e.isSendPerf=!1,e.$as=function(t,n){"error"===t?e._health.errcount++:"api"===t&&e._health[n.success?"apisucc":"apifail"]++},"function"==typeof e.$av&&e.$av(),e._conf&&e._conf.behavior&&"function"==typeof e.$aw&&e.$aw(),"function"==typeof e.$ax&&e.$ax(),this};MiniProgramLogger.prototype=util_1.$a2(reporter.prototype),util_1.ext(reporter._root.dftCon,{uid:null,disableHook:!1,enableLinkTrace:!1,behavior:!1,sendRequest:function(){},getCurrentPage:function(){}}),util_1.ext(MiniProgramLogger.prototype,{constructor:MiniProgramLogger,_super:reporter,$ad:function(t){t()},$al: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 n=this.getConfig("imgUrl");"object"==typeof t&&(t=util_1.serialize(t));var r=n+t;e&&(r+="&post_res=");var i=this._conf.sendRequest;if("function"==typeof i)try{i(r,e)}catch(o){util_1.warn("[arms] error in $al",o)}}},$an:function(t,e){var n={};n[e]=t[e],delete t[e],this.$al(t,n)},$ai:function(){var t=this._conf.getCurrentPage;if("function"==typeof t)try{var e=t();if(e&&"string"==typeof e)return e}catch(n){util_1.warn("[arms] error in $ai",n)}return"string"==typeof t&&t?t:this.DEFAUT_PAGE_PATH},setConfig:function(t){if(t&&"object"==typeof t){util_1.$a6(t),t=this.$aj(t);var e=this._conf;this._conf=util_1.ext({},this._conf,t);var n="disableHook";n in t&&e[n]!==t[n]&&(t[n]?"function"==typeof this.removeHook&&this.removeHook():"function"==typeof this.addHook&&this.addHook())}},pageShow:function(){var t=this;t.$ah(),t.$ay(),clearTimeout(t.$az),t.$b0(),t.$az=setTimeout(function(){t.$b1()},50),t.sessionPage=t.$ai()},pageHide:function(){this.$b0()},addHook:function(){return this},removeHook:function(){return this},hookApp:function(t){var e=this,n={onError:function(n){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),i=t.onError;try{e.error(n),e.getConfig("behavior")&&"function"==typeof e.reportBehavior&&e.reportBehavior()}catch(n){util_1.warn("[arms] error in hookApp:onError",n)}if("function"==typeof i)return i.apply(this,r)}};return util_1.ext({},t,n)},hookPage:function(t){var e=this,n={onShow:function(){var n=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),r=t.onShow;try{e.pageShow()}catch(i){util_1.warn("[arms] error in hookPage:pageShow",i)}if("function"==typeof r)return r.apply(this,n)},onHide:function(){var n=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),r=t.onHide;try{e.pageHide()}catch(i){util_1.warn("[arms] error in hookPage:onHide",i)}if("function"==typeof r)return r.apply(this,n)},onUnload:function(){var n=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),r=t.onUnload;try{e.pageHide()}catch(i){util_1.warn("[arms] error in hookPage:onUnload",i)}if("function"==typeof r)return r.apply(this,n)}};return util_1.ext({},t,n)},$av:function(){},$ax:function(){this.setCommonInfo({app:"mini_common",uid:this._conf.uid})},$b1:function(){var t=this;t.$ad(function(){t._lg("pv",{},t.getConfig("pvSample"))})},$ay:function(){var t=this;t.isSendPerf||(t.$ad(function(){var e={fpt:Date.now()-t.sBegin};t._lg("perf",e,t.getConfig("sample"))}),t.isSendPerf=!0)},$b0:function(){this.$b2(),this.$aq&&(this._lg("speed",this.$aq),this.$aq=null,clearTimeout(this.$ar)),this.$af()},$b2:function(){if(this.sessionPage){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.sessionPage,t.stay=e,this._lg("health",t,1),this._health={errcount:0,apisucc:0,apifail:0},this.sessionPage=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,n=null,r={};return e.ext(t.prototype,{addHook:function(){return this.isHookInstantiated?this:(function(){var t=this;if("undefined"!=typeof wx&&wx&&"function"==typeof wx.request){n=wx;var i={request:function(n){var r=(new Date).getTime();if(n&&"object"==typeof n&&n[0]){var i,o,a=n[0],s=e.$a9(a.url),u=a.success,c=a.fail,f=a&&a.header;f&&"object"==typeof f||(f={});var g={};if(t.getConfig("enableLinkTrace")){var l=f["EagleEye-pAppName"];if(i=f["EagleEye-TraceID"],o=f["EagleEye-SessionID"],i||(i=t.getTraceId()["EagleEye-TraceID"],g["EagleEye-TraceID"]=i),o||(o=t.getSessionId()["EagleEye-SessionID"],g["EagleEye-SessionID"]=o),!l){var p=t.getConfig("pid");g["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:n[0].url,success:!0,time:a-r,code:c,begin:r,traceId:i,sid: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:n[0].url,success:!1,time:a-r,code:f,msg:u,begin:r,traceId:i,sid:o})}c&&c.apply(t,[].slice.call(arguments))},a.header=e.ext({},f,g)}}};for(var o in wx)if(i[o]){var a=o.toString();r[a]=function(){return i[a](arguments),n[a].apply(n,[].slice.call(arguments))}}else r[o]=n[o];wx=r}}.call(this),this.isHookInstantiated=!0,this)},removeHook:function(){return this.isHookInstantiated?(function(){"undefined"!=typeof wx&&wx&&n&&(wx=n,n=null)}.call(this),this.isHookInstantiated=!1,this):this},$av:function(){return this.$b3?this:(this.getConfig("disableHook")||this.addHook(),this.$b3=!0,this)}}),t},miniBehavior=function(t){var e=[],n=util_1.reWriteMethod,r={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 r=this,i=0;i<t.length;i++){var o=t[i];"function"==typeof console[o]&&n(console,o,function(t){var n=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:n,message:o}};r&&"function"==typeof r.addBehavior&&r.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 n="";this._conf&&"function"==typeof this._conf.getCurrentPage&&(n=this._conf.getCurrentPage());var r=null;try{r=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||r,page:t.page||n};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.$b4&&(clearTimeout(t.$b4),t.$b4=undefined),t.$b4=setTimeout(function(){e&&e.length>0&&("function"==typeof t.behavior&&t.behavior(e),e=[])},0))},$aw:function(){}}),r},behavior=function(t,e){var n=null,r="",i=function(t){return function(){if(t&&n){var e=n,r=t+"timmer";e[r]&&(clearTimeout(e[r]),e[r]=undefined),e[r]=setTimeout(function(){"function"==typeof e.addBehavior&&e.addBehavior({type:"ui.default",data:{level:t}})},100)}}},o=miniBehavior(t)||{};util_1.ext(t.prototype,{$aw:function(){if(!this.hasInitBehavior&&!n&&void 0!==e&&e){try{"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:r||"unknown",to:t&&t.path||"unknown"}};n&&"function"==typeof n.addBehavior&&n.addBehavior(e),r=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 n=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 n,r="GET";e&&(r="POST",n=JSON.stringify(e)),wx.request({url:t,method:r,data:n,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(n){util_1.warn("[arms] error in conf getCurrentPage",n)}}}),util_1.ext(WXLogger.prototype,{constructor:WXLogger,_super:miniProgramLogger,$ax:function(){this.setCommonInfo({app:"mini_wx"}),this.$b5(),this.$b6(),this.$b7()},$b7: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(n){util_1.warn("[arms] error in $b7",n)}},$b5: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 $b5",e)}},$b6: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] $b6 getNetworkType fail",t)}})}catch(e){util_1.warn("[arms] error in $b6",e)}},hookApp:function(t){var e=this,n={onError:function(n){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),i=t.onError;try{if(n&&"object"==typeof n&&e.error(n),n&&"string"==typeof n){var o=n.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||n,stack:n})}}catch(n){util_1.warn("[arms] error in hookApp:onError",n)}if("function"==typeof i)return i.apply(this,r)}};return util_1.ext({},t,n)}}),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.4-alpha | @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(n){return noop}return t},util={noop:noop,warn:$a1(),key:"__bl",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 n=0,r=t.length;if(this.T(t,"Array"))for(;n<r&&!1!==e.call(t[n],t[n],n);n++);else for(n in t)if(!1===e.call(t[n],t[n],n))break;return t},$a3:function(t,e,n){if("function"!=typeof t)return n;try{return t.apply(this,e)}catch(r){return n}},T:function(t,e){var n=Object.prototype.toString.call(t).substring(8).replace("]","");return e?n===e:n},$a4:function(t,e){if(!t)return"";if(!e)return t;var n=this,r=n.T(e);return"Function"===r?n.$a3(e,[t],t):"Array"===r?(this.each(e,function(e){t=n.$a4(t,e)}),t):"Object"===r?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 n,r=[],i=0,o=e.length;i<o;i++)if(n=e[i],this.isString(n))r.push(n.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"));else if(n&&n.source)r.push(n.source);else if(n&&"Function"===this.T(n)&&!0===this.$a3(n,[t],!1))return!0;var a=new RegExp(r.join("|"),"i");return!!(r.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(n){}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,n=e;e&&/^\d+(\.\d+)?%$/.test(e)&&(n=parseInt(100/parseFloat(e))),0<n&&1>n&&(n=parseInt(1/n)),n>=1&&n<=100?t.sample=n:delete t.sample}return t},on:function(t,e,n,r,i){return t.addEventListener?(i=i||!1,t.addEventListener(e,function o(a){r&&t.removeEventListener(e,o,i),n.call(this,a)},i)):t.attachEvent&&t.attachEvent("on"+e,function a(i){r&&t.detachEvent("on"+e,a),n.call(this,i)}),this},off:function(t,e,n){return n?(t.removeEventListener?t.removeEventListener(e,n):t.detachEvent&&t.detachEvent(e,n),this):this},delay:function(t,e){return-1===e?(t(),null):setTimeout(t,e||0)},ext:function(t){for(var e=1,n=arguments.length;e<n;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},sub:function(t,e){var n={};return this.each(t,function(t,r){-1!==e.indexOf(r)&&(n[r]=t)}),n},uu:function(){for(var t,e,n=20,r=new Array(n),i=Date.now().toString(36).split("");n-- >0;)e=(t=36*Math.random()|0).toString(36),r[n]=t%3?e:e.toUpperCase();for(var o=0;o<8;o++)r.splice(3*o+2,0,i[o]);return r.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(n){}return t},serialize:function(t){t=t||{};var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&t[n]!==undefined&&e.push(n+"="+this.encode(t[n],"msg"===n));return e.join("&")},$a7:function(t,e){if(!t||"string"!=typeof t)return!1;var n=/arms-retcode[\w-]*\.aliyuncs/.test(t);return!n&&e&&(n=/(\.png)|(\.gif)|(alicdn\.com)/.test(t)),!n},$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 n="//"+e.split("/")[2];return t===e||t.slice(0,e.length+1)===e+"/"||t===n||t.slice(0,n.length+1)===n+"/"||!/^(\/\/|http:|https:).*/.test(t)},getRandIP:function(){for(var t=[],e=0;e<4;e++){var n=Math.floor(256*Math.random());t[e]=(n>15?"":"0")+n.toString(16)}return t.join("")},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=[],n=0;n<t;n++){var r=Math.floor(16*Math.random());e[n]=r.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 n=t.keys(),r=n.next();!r.done;){var i=r.value;e[i]=t.get(i),r=n.next()}else e=t}catch(o){e={}}return e},parseXhrHeaders:function(t){if(!t&&"string"!=typeof t)return{};var e={};try{var n=t.split("\r\n");e=n.reduce(function(t,e){var n=e.split(": ");return t[n[0]]=n[1],t},{})}catch(r){e={}}return e},getQuerys:function(t){if(!t)return"";var e={},n=[],r="",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)r=(n=o[a].split("="))[0],i=n[1],e[r]=i}catch(s){e={}}return e},getFetchSnapshot:function(t,e,n){var r,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);r={originApi:o,method:a.method||"unknown",params:s,response:e||"",reqHeaders:this.parseFetchHeaders(a.headers||null),resHeaders:this.parseFetchHeaders(n)},i="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(r))||"{}"}catch(u){i="{}"}return i},getXhrSnapshot:function(t,e,n){if(!t||!e||!n)return{};var r,i;try{r={originApi:t,method:e,params:this.getQuerys(t),response:n.responseText||n.responseXml||"",reqHeaders:{},resHeaders:this.parseXhrHeaders("function"==typeof n.getAllResponseHeaders&&n.getAllResponseHeaders()||"")},i="function"==typeof encodeURIComponent&&JSON&&encodeURIComponent(JSON.stringify(r))||"{}"}catch(o){i="{}"}return i},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,n=[],r=0,i=t.length;r<i;r++)e=t[r],this.isString(e)?n.push(e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):e&&e.source&&n.push(e.source);return new RegExp(n.join("|"),"i")},reWriteMethod:function(t,e,n){if(null!==t){var r=t[e];t[e]=n(r)}}},util_1=util,sendBeacon=function(t,e){"object"==typeof t&&(t=util_1.serialize(t));var n=e+t;window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?window.navigator.sendBeacon(n,"&post_res="):util_1.warn("[arms] navigator.sendBeacon not surported")},pushToQueue=function(t,e){var n;{if("error"!==e.t||!(n=t.$ac[0])||"error"!==n.t||e.msg!==n.msg){if("behavior"===e.t){var r=t.$ac&&t.$ac.length;if(r>0&&"behavior"===t.$ac[r-1].t){var i=e.behavior||[];t.$ac[r-1].behavior.concat(i)}else t.$ac.push(e)}else t.$ac.unshift(e);return t.$ad(function(){t.$ae=util_1.delay(function(){t.$af()},t.$ac[0]&&"error"===t.$ac[0].t?3e3:-1)}),!0}n.times++}},Base=function(t){return this.ver="1.8.4-alpha",this._conf=util_1.ext({},Base.dftCon),this.$ag={},this.$ac=[],this.hash=util_1.seq(),this.$ah(),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:[]},release:undefined,environment:"production"},Base.prototype={constructor:Base,$ad:function(t){return t()},$ai: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.$aj(t),this._conf=util_1.ext({},this._conf,t))},$aj:function(t){var e=t.region,n=t.imgUrl;if(e){var r=util_1.regionMap[e];return t.imgUrl=r||util_1.defaultImgUrl,t}return n&&(t.imgUrl=n),t},$ak:function(t){if(this.getConfig("debug"))return!0;var e=util_1.regionMap,n=!1;for(var r in e)if(e[r]===t){n=!0;break}return!n&&util_1.warn("[retcode] invalid url: "+t),n},$al:function(){},$am:function(t){sendBeacon(t,this.getConfig("imgUrl"))},$an:function(){},$ao:function(){return{}},setCommonInfo:function(t){t&&"object"==typeof t&&(this._common=util_1.ext({},this._common,t))},$ah:function(){this.session=util_1.uu(),this.sBegin=Date.now()},getTraceId:function(){var t=this.rip,e=Date.now(),n=util_1.getSortNum(this.record),r=t+e+n+util_1.getRandNum(this._conf.pid);return this["EagleEye-TraceID"]=r,this.record=n,{"EagleEye-TraceID":r}},getSessionId:function(){return{"EagleEye-SessionID":this.session}},getConfig:function(t){return t?this._conf[t]:util_1.ext({},this._conf)},$ap:function(t){return 1===t||("boolean"==typeof this.$ag[t]?this.$ag[t]:(this.$ag[t]=util_1.pick(t),this.$ag[t]))},$af:function(){var t;clearTimeout(this.$ae),this.$ae=null;for(var e=this._conf&&"function"==typeof this._conf.sendRequest;t=this.$ac.pop();)"res"===t.t?this.$an(t,"res"):"error"===t.t?this.$an(t,"err"):"api"===t.t?this.$an(t,"apiSnapshot"):"behavior"===t.t?this.$an(t,"behavior"):"health"===t.t&&!e&&window&&window.navigator&&"function"==typeof window.navigator.sendBeacon?this.$am(t):this.$al(t);return this},_lg:function(t,e,n){var r=this._conf,i=this.$ai(),o=r.ignore||{},a=o.ignoreErrors,s=o.ignoreUrls,u=o.ignoreApis;return util_1.$a5(i,s)||util_1.$a5(util_1.decode(i),s)?this:"error"===t&&(util_1.$a5(e.msg,a)||util_1.$a5(util_1.decode(e.msg),a))?this:"api"===t&&(util_1.$a5(e.api,u)||util_1.$a5(util_1.decode(e.api),u))?this:this.$ak(r.imgUrl)&&e&&!r.disabled&&r.pid?n&&!this.$ap(n)?this:(e=util_1.ext({t:t,times:1,page:i,tag:r.tag||"",release:r.release||"",environment:r.environment,begin:Date.now()},e,this.$ao(),this._common,{pid:r.pid,_v:this.ver,sid:this.session,sampling:n||1,z:util_1.seq(),c1:r.c1,c2:r.c2,c3:r.c3}),pushToQueue(this,e)):this},custom:function(t,e){if(!t||"object"!=typeof t)return this;var n=!1,r={begin:Date.now()};return util_1.each(t,function(t,e){return!(n=e&&e.length<=20)&&util_1.warn("[retcode] invalid key: "+e),r["x-"+e]=t,n}),n?this._lg("custom",r,e||1):this}};var base=Base,validApiKeys=["api","success","time","code","msg","trace","traceId","begin","sid","seq","domain"],parseStatData=function(t,e){var n=t.split("::");return n.length>1?util_1.ext({group:n[0],key:n[1]},e):util_1.ext({group:"default_group",key:n[0]},e)},Reporter=function(t){base.call(this,t);var e;try{e="object"==typeof performance?performance.timing.fetchStart:Date.now()}catch(n){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,n){try{return this._lg("sum",parseStatData(t,{val:e||1,begin:Date.now()}),n)}catch(r){util_1.warn("[retcode] can not get parseStatData: "+r)}},avg:function(t,e,n){try{return this._lg("avg",parseStatData(t,{val:e||0,begin:Date.now()}),n)}catch(r){util_1.warn("[retcode] can not get parseStatData: "+r)}},percent:function(t,e,n,r){try{return this._lg("percent",parseStatData(t,{subkey:e,val:n||0,begin:Date.now()}),r)}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 n=t.name||"CustomError",r=t.message||"",i=t.stack||"";e=e||{};var o={begin:Date.now(),cate:n,msg:r&&r.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(r),stack_raw:util_1.encode(i)}},a=(this.getConfig("ignore")||{}).ignoreErrors;return util_1.$a5(o.msg,a)||util_1.$a5(util_1.decode(o.msg),a)?this:(this.$as&&this.$as("error",o),this._lg("error",o,1))},behavior:function(t){if(t){var e="object"==typeof t&&t.behavior?t:{behavior:t};return this.$as&&this.$as("behavior",e),this._lg("behavior",e,1)}},api:function(t,e,n,r,i,o,a,s,u,c){if(!t)return util_1.warn("[retcode] api is null"),this;if(t="string"==typeof t?{api:t,success:e,time:n,code:r,msg:i,begin:o,traceId:a,sid:s,domain:c}:util_1.sub(t,validApiKeys),!util_1.$a7(t.api))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.sid=t.sid||"",t.domain=t.domain||"",t.success?t.apiSnapshot&&delete t.apiSnapshot:t.apiSnapshot=u,!t.api||isNaN(t.time))return util_1.warn("[retcode] invalid time or api"),this;var f=(this.getConfig("ignore")||{}).ignoreApis;if(util_1.$a5(t.api,f)||util_1.$a5(util_1.decode(t.api),f))return this;this.$as&&this.$as("api",t);var g={type:"api",data:{message:t.msg,url:t.api,status:t.code},timestamp:t.begin};try{this.getConfig("behavior")&&this.addBehavior&&this.addBehavior(g)}catch(l){}return this._lg("api",t,t.success&&this.getConfig("sample"))},speed:function(t,e,n){var r=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,r.$aq=r.$aq||{},r.$aq[t]=e,r.$aq.begin=i,clearTimeout(r.$ar),r.$ar=setTimeout(function(){n||(r.$aq.page=r.$ai(!0)),r._lg("speed",r.$aq),r.$aq=null},5e3),r):(util_1.warn("[retcode] invalid point: "+t),r)},performance:function(t){if(t&&"object"==typeof t){var e={},n=this.getConfig("autoSendPerf");if(n&&t.autoSend&&!this.$at)return this.$at=!0,this._lg("perf",t,this.getConfig("sample"));for(var r in t)(/^t([1-9]|1[0])$/.test(r)||"ctti"===r||"cfpt"===r)&&(e[r]=t[r]);if(n&&!0!==t.autoSend)this.$au=util_1.ext(this.$au||{},e);else if(!1===n&&!this.$at){if(!this.$au||"object"!=typeof this.$au)return;return e=util_1.ext(this.$au,e),this.$at=!0,this._lg("perf",e,this.getConfig("sample"))}}},resource:function(t,e){if(!t||!util_1.isPlainObject(t))return util_1.warn("[arms] invalid param data: "+t),this;var n=Object.keys(t),r=["begin","dom","load","res","dl"],i=!1;for(var o in r){if(n.indexOf(r[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._health={errcount:0,apisucc:0,apifail:0},e.DEFAUT_PAGE_PATH="[app]",e.isSendPerf=!1,e.$as=function(t,n){"error"===t?e._health.errcount++:"api"===t&&e._health[n.success?"apisucc":"apifail"]++},"function"==typeof e.$av&&e.$av(),e._conf&&e._conf.behavior&&"function"==typeof e.$aw&&e.$aw(),"function"==typeof e.$ax&&e.$ax(),this};MiniProgramLogger.prototype=util_1.$a2(reporter.prototype),util_1.ext(reporter._root.dftCon,{uid:null,disableHook:!1,enableLinkTrace:!1,behavior:!1,sendRequest:function(){},getCurrentPage:function(){}}),util_1.ext(MiniProgramLogger.prototype,{constructor:MiniProgramLogger,_super:reporter,$ad:function(t){t()},$al: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 n=this.getConfig("imgUrl");"object"==typeof t&&(t=util_1.serialize(t));var r=n+t;e&&(r+="&post_res=");var i=this._conf.sendRequest;if("function"==typeof i)try{i(r,e)}catch(o){util_1.warn("[arms] error in $al",o)}}},$an:function(t,e){var n={};n[e]=t[e],delete t[e],this.$al(t,n)},$ai:function(){var t=this._conf.getCurrentPage;if("function"==typeof t)try{var e=t();if(e&&"string"==typeof e)return e}catch(n){util_1.warn("[arms] error in $ai",n)}return"string"==typeof t&&t?t:this.DEFAUT_PAGE_PATH},setConfig:function(t){if(t&&"object"==typeof t){util_1.$a6(t),t=this.$aj(t);var e=this._conf;this._conf=util_1.ext({},this._conf,t);var n="disableHook";n in t&&e[n]!==t[n]&&(t[n]?"function"==typeof this.removeHook&&this.removeHook():"function"==typeof this.addHook&&this.addHook())}},pageShow:function(){var t=this;t.$ah(),t.$ay(),clearTimeout(t.$az),t.$b0(),t.$az=setTimeout(function(){t.$b1()},50),t.sessionPage=t.$ai()},pageHide:function(){this.$b0()},addHook:function(){return this},removeHook:function(){return this},hookApp:function(t){var e=this,n={onError:function(n){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),i=t.onError;try{e.error(n),e.getConfig("behavior")&&"function"==typeof e.reportBehavior&&e.reportBehavior()}catch(n){util_1.warn("[arms] error in hookApp:onError",n)}if("function"==typeof i)return i.apply(this,r)}};return util_1.ext({},t,n)},hookPage:function(t){var e=this,n={onShow:function(){var n=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),r=t.onShow;try{e.pageShow()}catch(i){util_1.warn("[arms] error in hookPage:pageShow",i)}if("function"==typeof r)return r.apply(this,n)},onHide:function(){var n=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),r=t.onHide;try{e.pageHide()}catch(i){util_1.warn("[arms] error in hookPage:onHide",i)}if("function"==typeof r)return r.apply(this,n)},onUnload:function(){var n=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),r=t.onUnload;try{e.pageHide()}catch(i){util_1.warn("[arms] error in hookPage:onUnload",i)}if("function"==typeof r)return r.apply(this,n)}};return util_1.ext({},t,n)},$av:function(){},$ax:function(){this.setCommonInfo({app:"mini_common",uid:this._conf.uid})},$b1:function(){var t=this;t.$ad(function(){t._lg("pv",{},t.getConfig("pvSample"))})},$ay:function(){var t=this;t.isSendPerf||(t.$ad(function(){var e={fpt:Date.now()-t.sBegin};t._lg("perf",e,t.getConfig("sample"))}),t.isSendPerf=!0)},$b0:function(){this.$b2(),this.$aq&&(this._lg("speed",this.$aq),this.$aq=null,clearTimeout(this.$ar)),this.$af()},$b2:function(){if(this.sessionPage){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.sessionPage,t.stay=e,this._lg("health",t,1),this._health={errcount:0,apisucc:0,apifail:0},this.sessionPage=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,n=null,r={};return e.ext(t.prototype,{addHook:function(){return this.isHookInstantiated?this:(function(){var t=this;if("undefined"!=typeof wx&&wx&&"function"==typeof wx.request){n=wx;var i={request:function(n){var r=(new Date).getTime();if(n&&"object"==typeof n&&n[0]){var i,o,a=n[0],s=e.$a9(a.url),u=a.success,c=a.fail,f=a&&a.header;f&&"object"==typeof f||(f={});var g={};if(t.getConfig("enableLinkTrace")){var l=f["EagleEye-pAppName"];if(i=f["EagleEye-TraceID"],o=f["EagleEye-SessionID"],i||(i=t.getTraceId()["EagleEye-TraceID"],g["EagleEye-TraceID"]=i),o||(o=t.getSessionId()["EagleEye-SessionID"],g["EagleEye-SessionID"]=o),!l){var p=t.getConfig("pid");g["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:n[0].url,success:!0,time:a-r,code:c,begin:r,traceId:i,sid: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:n[0].url,success:!1,time:a-r,code:f,msg:u,begin:r,traceId:i,sid:o})}c&&c.apply(t,[].slice.call(arguments))},a.header=e.ext({},f,g)}}};for(var o in wx)if(i[o]){var a=o.toString();r[a]=function(){return i[a](arguments),n[a].apply(n,[].slice.call(arguments))}}else r[o]=n[o];wx=r}}.call(this),this.isHookInstantiated=!0,this)},removeHook:function(){return this.isHookInstantiated?(function(){"undefined"!=typeof wx&&wx&&n&&(wx=n,n=null)}.call(this),this.isHookInstantiated=!1,this):this},$av:function(){return this.$b3?this:(this.getConfig("disableHook")||this.addHook(),this.$b3=!0,this)}}),t},miniBehavior=function(t){var e=[],n=util_1.reWriteMethod,r={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 r=this,i=0;i<t.length;i++){var o=t[i];"function"==typeof console[o]&&n(console,o,function(t){var n=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:n,message:o}};r&&"function"==typeof r.addBehavior&&r.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 n="";this._conf&&"function"==typeof this._conf.getCurrentPage&&(n=this._conf.getCurrentPage());var r=null;try{r=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||r,page:t.page||n};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.$b4&&(clearTimeout(t.$b4),t.$b4=undefined),t.$b4=setTimeout(function(){e&&e.length>0&&("function"==typeof t.behavior&&t.behavior(e),e=[])},0))},$aw:function(){}}),r},behavior=function(t,e){var n=null,r="",i=function(t){return function(){if(t&&n){var e=n,r=t+"timmer";e[r]&&(clearTimeout(e[r]),e[r]=undefined),e[r]=setTimeout(function(){"function"==typeof e.addBehavior&&e.addBehavior({type:"ui.default",data:{level:t}})},100)}}},o=miniBehavior(t)||{};util_1.ext(t.prototype,{$aw:function(){if(!this.hasInitBehavior&&!n&&void 0!==e&&e){try{"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:r||"unknown",to:t&&t.path||"unknown"}};n&&"function"==typeof n.addBehavior&&n.addBehavior(e),r=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 n=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 n,r="GET";e&&(r="POST",n=JSON.stringify(e)),wx.request({url:t,method:r,data:n,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(n){util_1.warn("[arms] error in conf getCurrentPage",n)}}}),util_1.ext(WXLogger.prototype,{constructor:WXLogger,_super:miniProgramLogger,$ax:function(){this.setCommonInfo({app:"mini_wx"}),this.$b5(),this.$b6(),this.$b7()},$b7: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(n){util_1.warn("[arms] error in $b7",n)}},$b5: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 $b5",e)}},$b6: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] $b6 getNetworkType fail",t)}})}catch(e){util_1.warn("[arms] error in $b6",e)}},hookApp:function(t){var e=this,n={onError:function(n){var r=1===arguments.length?[arguments[0]]:Array.apply(null,arguments),i=t.onError;try{if(n&&"object"==typeof n&&e.error(n),n&&"string"==typeof n){var o=n.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||n,stack:n})}}catch(n){util_1.warn("[arms] error in hookApp:onError",n)}if("function"==typeof i)return i.apply(this,r)}};return util_1.ext({},t,n)}}),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.3",
"version": "1.8.4-alpha",
"description": "retcode cloud sdk",

@@ -22,4 +22,4 @@ "exports": "__bl",

"dev_local": "DEV=1 LOCAL=1 node ./bin/pack",
"test-miniapp": "nyc mocha --timeout 5000 --reporter spec 'test/unittest/**/*.spec.js'",
"test-miniapp-watch": "mocha --reporter spec 'test/unittest/**/*.spec.js' --watch"
"test-miniapp": "nyc mocha --timeout 5000 --reporter spec 'test/unittest/**/**.spec.js'",
"test-miniapp-watch": "mocha --reporter spec 'test/unittest/**/**.spec.js' --watch"
},

@@ -26,0 +26,0 @@ "author": {

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