fast-tracker-browser
Version:
用户行为、应用性能、应用异常一体化采集
8 lines • 79.5 kB
JavaScript
/*!
* Release Version: 1.0.1-r18
* Release Time: Wed Mar 01 2023 19:14:01 GMT+0800 (中国标准时间)
*/
!function(e,t){
if(e===window){e.fastTracker=t();e.myWebLogTracker=t();}
//[ONLINE-CONFIG]
"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("fastTracker",[],t):"object"==typeof exports?exports.fastTracker=t():e.fastTracker=t()}(this,(function(){return function(){var e={553:function(e){var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(P){s=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),i=new T(n||[]);return a._invoke=function(e,t,r){var n=l;return function(o,a){if(n===p)throw new Error("Generator is already running");if(n===g){if("throw"===o)throw a;return D()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var s=f(e,t,r);if("normal"===s.type){if(n=r.done?g:d,s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=g,r.method="throw",r.arg=s.arg)}}}(e,r,i),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(P){return{type:"throw",arg:P}}}e.wrap=u;var l="suspendedStart",d="suspendedYield",p="executing",g="completed",h={};function m(){}function v(){}function y(){}var _={};s(_,a,(function(){return this}));var w=Object.getPrototypeOf,b=w&&w(w(L([])));b&&b!==r&&n.call(b,a)&&(_=b);var O=y.prototype=m.prototype=Object.create(_);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(o,a,i,c){var s=f(e[o],e,a);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,c)}),(function(e){r("throw",e,i,c)})):t.resolve(l).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,c)}))}c(s.arg)}var o;this._invoke=function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}}function E(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator["return"]&&(r.method="return",r.arg=t,E(e,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=f(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,h;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function L(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}return{next:D}}function D(){return{value:t,done:!0}}return v.prototype=y,s(O,"constructor",y),s(y,"constructor",v),v.displayName=s(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,s(e,c,"GeneratorFunction")),e.prototype=Object.create(O),e},e.awrap=function(e){return{__await:e}},k(x.prototype),s(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new x(u(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(O),s(O,c,"Generator"),s(O,a,(function(){return this})),s(O,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=L,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),j(r),h}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},757:function(e,t,r){e.exports=r(553)}},t={};function r(n){var o=t[n];if(o!==undefined)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var n={};return function(){"use strict";function e(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){var r,n;(n="undefined"!=typeof window&&window.navigator.userAgent.toLowerCase())&&/msie|trident/.test(n)?(r=document.createEvent("CustomEvent")).initCustomEvent(e,!1,!1,t):window.CustomEvent?r=new CustomEvent(e,{detail:t}):((r=document.createEvent("HTMLEvents")).initEvent(e,!1,!0),r.detail=t),window.dispatchEvent(r)}function s(e,t,r,n){var o=function c(e){return e&&(e.preventDefault=c.preventDefault,e.stopPropagation=c.stopPropagation),e};o.preventDefault=function(){this.returnValue=!1},o.stopPropagation=function(){this.cancelBubble=!0};var a=function(e,t,r,n){return function(a){if(!(a=a||o(window.event)))return undefined;a.target=a.srcElement;var i,c=!0;"function"==typeof r&&(i=r(a));var s=t.call(e,a);return"beforeunload"!==n?(!1!==i&&!1!==s||(c=!1),c):void 0}},i=function(e,t,r){if(n===undefined&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,(function(e){e._getPath=o._getPath,r.call(this,e)}),n);else{var i="on".concat(t),c=e[i];e[i]=a(e,r,c,t)}};i.apply(null,arguments)}r.d(n,{"default":function(){return Lt}});var u=600,f="__fastTracker__",l="__myWebLogTracker__",d="/data/(data|user/\\d+)/[^/]+/files/www",p="/var/mobile/Containers/Data/Application/[^/]+/Documents/www",g="Hybrid APP",h=["page_stay","page_load","page","click","api","error","crash","start","pause","resume","fmp","anr"],m={top:1,com:1,xyz:1,xin:1,vip:1,win:1,red:1,net:1,org:1,wang:1,gov:1,edu:1,mil:1,co:1,biz:1,name:1,info:1,mobi:1,pro:1,travel:1,club:1,museum:1,int:1,aero:1,post:1,rec:1,asia:1,art:1,firm:1,nom:1,store:1,web:1},v={ad:1,ae:1,af:1,ag:1,ai:1,al:1,am:1,an:1,ao:1,aa:1,ar:1,as:1,at:1,au:1,aw:1,az:1,ba:1,bb:1,bd:1,be:1,bf:1,bg:1,bh:1,bi:1,bj:1,bm:1,bn:1,bo:1,br:1,bs:1,bt:1,bv:1,bw:1,by:1,bz:1,ca:1,cc:1,cf:1,cd:1,ch:1,ci:1,ck:1,cl:1,cm:1,cn:1,cq:1,cr:1,cu:1,cv:1,cx:1,cy:1,cz:1,de:1,dj:1,dk:1,dm:1,"do":1,dz:1,ec:1,ee:1,eg:1,eh:1,er:1,es:1,et:1,ev:1,fi:1,fj:1,fk:1,fm:1,fo:1,fr:1,ga:1,gd:1,ge:1,gf:1,gg:1,gh:1,gi:1,gl:1,gm:1,gn:1,gp:1,gr:1,gs:1,gt:1,gu:1,gw:1,gy:1,hk:1,hm:1,hn:1,hr:1,ht:1,hu:1,id:1,ie:1,il:1,im:1,"in":1,io:1,iq:1,ir:1,is:1,it:1,jm:1,jo:1,jp:1,je:1,ke:1,kg:1,kh:1,ki:1,km:1,kn:1,kp:1,kr:1,kw:1,ky:1,kz:1,la:1,lb:1,lc:1,li:1,lk:1,lr:1,ls:1,lt:1,lu:1,lv:1,ly:1,ma:1,mc:1,md:1,me:1,mg:1,mh:1,mk:1,ml:1,mm:1,mn:1,mo:1,mp:1,mq:1,mr:1,ms:1,mt:1,mu:1,mv:1,mw:1,mx:1,my:1,mz:1,na:1,nc:1,ne:1,nf:1,ng:1,ni:1,nl:1,no:1,np:1,nr:1,nt:1,nu:1,nz:1,om:1,qa:1,pa:1,pe:1,pf:1,pg:1,ph:1,pk:1,pl:1,pm:1,pn:1,pr:1,pt:1,pw:1,py:1,re:1,rs:1,ro:1,ru:1,rw:1,sa:1,sb:1,sc:1,sd:1,se:1,sg:1,sh:1,si:1,sj:1,sk:1,sl:1,sm:1,sn:1,so:1,sr:1,st:1,sv:1,su:1,sy:1,sz:1,sx:1,tc:1,td:1,tf:1,tg:1,th:1,tj:1,tk:1,tl:1,tm:1,tn:1,to:1,tr:1,tt:1,tv:1,tw:1,tz:1,ua:1,ug:1,uk:1,um:1,us:1,uy:1,uz:1,va:1,vc:1,ve:1,vg:1,vi:1,vn:1,vu:1,wf:1,ws:1,ye:1,yt:1,za:1,zm:1,zw:1};function y(e){var t=e.msg,r=void 0===t?"":t,n=e.showFooter,o=void 0!==n&&n,a=e.type,i=void 0===a?"warn":a,c=window.console;if(c&&c.log&&r){var s="error"===i?"color:#F86161":"color:#e80",u="%c[天眼探针内部".concat("error"===i?"错误":"提醒","]");r.indexOf("\n")>-1?(c.log(u,s),r.split("\n").forEach((function(e){e&&c.log(e)}))):c.log("".concat(u,": ").concat(r),s),o&&c.log("探针初始化失败, 请查看文档【https://open.mingyuanyun.com/docs/fast】")}}function _(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function w(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}function b(e){return e&&"[object Function]"===Object.prototype.toString.call(e)}function O(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}}function k(e){return"[object ErrorEvent]"===Object.prototype.toString.call(e)}function x(e){return"[object DOMError]"===Object.prototype.toString.call(e)}function E(e){return"[object DOMException]"===Object.prototype.toString.call(e)}function S(e){return"[object String]"===Object.prototype.toString.call(e)}var j,T=(j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=","function"==typeof window.btoa?window.btoa:function(e){for(var t,r,n,o,a="",i=(e=String(e)).length%3,c=0;c<e.length;){if(r=e.charCodeAt(c++),n=e.charCodeAt(c++),o=e.charCodeAt(c++),r>255||n>255||o>255)return y({msg:"探针内部异常encodeB64失败\nThe string to be encoded contains characters outside of the Latin1 range"}),e;a+=j.charAt((t=r<<16|n<<8|o)>>18&63)+j.charAt(t>>12&63)+j.charAt(t>>6&63)+j.charAt(63&t)}return i?a.slice(0,i-3)+"===".substring(i):a});function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function D(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(0!==r.length){var o=_(r[0])?r[0]:r;o.forEach((function(t){try{delete e[t]}catch(r){}}))}}function P(e,t){try{return null===e||e===undefined?null:function(e,t){if(t&&"string"==typeof t)try{if(-1===t.indexOf("."))return e&&e[t]!==undefined?e[t]:null;for(var r=t.split("."),n=e,o=0,a=r.length;null!==n&&n!==undefined&&o<a;)n=n["".concat(r[o++])];return o&&o===a?n:null}catch(i){return null}return null}(e,t)}catch(r){}return null}function I(e){return e.replace(/((password|pwd)["']?\s*[:=]\s*["']?)([^"'&,}]+)(["'&,}]+|\b)/gi,(function(e,t,r,n,o){return"".concat(t,"**").concat(o)}))}function A(e){var t=arguments.length>1&&arguments[1]!==undefined&&arguments[1];return e>0?t?Math.round(e):e:0}function R(e){if("function"==typeof Number.isNaN)return Number.isNaN(e);try{return window.isNaN(e)}catch(t){return!1}}function C(e){if("function"==typeof Number.parseFloat)return Number.parseFloat(e);try{return window.parseFloat(e)}catch(t){return+e}}function N(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;return R(+e)?0:C((+e).toFixed(t))}function F(e){return function(){return"function ".concat(e,"() { [native code] }")}}function z(e){for(var t=0,r=0;r<e.length;r++){var n=e.charCodeAt(r);n<127?t++:t+=n>=128&&n<=2047?2:n>=2048&&n<=65535?3:4}return t}function M(){var e={registUser:function(){return y({msg:"探针registUser方法调用无效!",showFooter:!0})},setBasicInfo:function(){return y({msg:"探针setBasicInfo方法调用无效!",showFooter:!0})},report:function(){return y({msg:"探针report方法调用无效!",showFooter:!0})},reportError:function(){return y({msg:"探针reportError方法调用无效!",showFooter:!0})},reportLoaded:function(){return y({msg:"探针reportLoaded方法调用无效!且该方法已移除!",showFooter:!0})},clearLogStore:function(){return y({msg:"探针clearLogStore方法调用无效!",showFooter:!0})},printDebug:function(){return y({msg:"探针printDebug方法调用无效!",showFooter:!0})}};return e.registUser.toString=F("registUser"),e.setBasicInfo.toString=F("setBasicInfo"),e.report.toString=F("report"),e.reportError.toString=F("reportError"),e.reportLoaded.toString=F("reportLoaded"),e.clearLogStore.toString=F("clearLogStore"),e.printDebug.toString=F("printDebug"),e}function q(e,t,r){if(e&&"function"==typeof r){var n=e[t];if(!n||!n._fast_wrapped_){var o=r(n);if(o)return o.__fast_wrapped__=!0,o.toString=F(t),e[t]=o,o}}return!1}function $(e){return"string"==typeof e&&(e=e.replace(/(%[0-9a-f]{2})+/gi,(function(e){var t;try{t=decodeURIComponent(e)}catch(r){t=unescape(e)}return t}))),e}function B(e){return e&&"string"==typeof e.tagName?e.tagName.toLowerCase():""}function U(e){var t=(e||"").replace(/^[a-zA-Z]+:\/\//,"");if(t){var r=t.split("."),n=r.length-1;for(1===v[r[n]]&&(n-=1);n>-1;n--)if(1!==m[r[n]])return r[n]}return""}function H(e){var t=e.curr_title,r=e.curr_hash,n=e.curr_search,o=e.curr_href,a=n,i=o.replace(/(^[a-zA-Z]+:\/\/[^/]*)[\s\S]*/,"$1"),c=i.replace(/^[a-zA-Z]+:\/\//i,""),s=o.replace(i,"");return window.cordova&&(s=(s=s.replace(new RegExp("^".concat(p)),"")).replace(new RegExp("^".concat(d)),"")),r?(s=0===r.indexOf("#/")?s.replace(/([^#]*#\/[^#?]*)([#?][\s\S]*)?/,"$1"):s.replace(/#[\s\S]*/,"").replace(/\?[\s\S]*/,""),!a&&o.indexOf("?")>-1&&(a=o.replace(/[^?]*(\?[^#?]*)([#?][\s\S]*)?/,"$1"))):s=s.replace(/\?[\s\S]*/,""),{hash:r,href:o,title:t,fixPathname:s,search:a?a.replace(/^\??([\s\S]+)$/,"$1"):"",domain:c}}function J(e){var t=e?e.curr_href:document&&document.referrer;return"string"!=typeof t?"":(window.cordova&&(t=(t=t.replace(new RegExp("^[a-zA-Z]+://([\\w\\.\\-]+(:\\d+)?)?".concat(p)),"")).replace(new RegExp("^[a-zA-Z]+://".concat(d)),"")),t)}function K(){var e,t,r=(null===(e=document)||void 0===e?void 0:e.location)||{},n=r.href,o=r.hash,a=r.search;return{curr_title:(null===(t=document)||void 0===t?void 0:t.title)||"",curr_hash:o||"",curr_search:a||"",curr_href:n||""}}function W(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[],r=t.length;if(!e||0===r)return!1;for(var n=0;n<r;n++){var o=t[n];try{if("string"!=typeof o)continue;if(new RegExp(o).test(e))return!0}catch(a){continue}}return!1}function G(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"",t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"",r=(e||window.location.href).replace(/^[^?]+\?([^?#]+).*$/,"$1"),n=r?r.split("&"):[],o=n.length;if(o>0){for(var a={},i=0;i<o;i++){var c=n[i].indexOf("="),s=n[i].substr(0,c),u=n[i].substr(c+1);if(s&&u){if(t&&s===t)return $(u);a[s]=$(u)}}return t?"":a}return t?"":{}}function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function V(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"",r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"",n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"",o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};return o=o||{},"body"===B(e)&&o[n]?o:"function"==typeof e.getAttribute?([t,r,n].forEach((function(t){if(!o[t]){var r=e.getAttribute(t);r&&(o[t]=r)}})),o[t]&&o[r]&&o[n]||!e.parentNode||(o=X(X({},o),V(e.parentNode,t,r,n,o))),o):o}function Y(e,t){return!!(e&&e.parentNode&&e.parentNode.children)&&(t=t&&t.join?t:[],"body"===e.nodeName.toLowerCase()||1!==e.nodeType?(t.unshift("body"),t.join(" > ")):(t.unshift(function(e){var t=e.parentNode&&9===e.parentNode.nodeType?-1:function(e){var t=[].indexOf;if(!e.parentNode)return-1;var r=e.parentNode.children;if(!r)return-1;var n=r.length;if(t)return t.call(r,e);for(var o=0;o<n;++o)if(e===r[o])return o;return-1}(e);return e.id?"#".concat(e.id):B(e)+(~t?":nth-child(".concat(t+1,")"):"")}(e)),e.id?t.join(" > "):Y(e.parentNode,t)))}function Q(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0,r="string"==typeof e.tagName?e.tagName.toUpperCase():"";if(e.childNodes.length>0&&t<3&&"TEXTAREA"!==r){for(var n=[],o=[],a=e.childNodes.length,c=0;c<a;c++)1===e.childNodes[c].nodeType&&e.childNodes[c].childNodes.length>0?o.push(e.childNodes[c]):3===e.childNodes[c].nodeType&&e.childNodes[c].nodeValue&&n.push(e.childNodes[c].nodeValue);for(var s=o.length,u=0;u<s;u++){var f=t>0?t+1:n.length>0?1:0,l=Q(o[u],f);l.length>0&&n.push.apply(n,i(l))}return n}return[]}var ee=function(e){s(document,"click",(function(t){var r=t||window.event;if(!r)return!1;var n=r.target||r.srcElement,o=B(n);if(!o||"body"===o||"html"===o||!n.parentNode||!n.parentNode.children)return!1;var a=V(n,e.conf.log_event_attribute,e.conf.log_content_attribute,e.conf.log_module_attribute),i=a[e.conf.log_content_attribute]||"",c=a[e.conf.log_event_attribute]||"",s=a[e.conf.log_module_attribute]||"",u=Y(n),f={g:{et:o,ec:Q(n).join("").replace(/\s/g,"").slice(0,256),ep:u}};return(i||"number"==typeof i)&&(f.l=i),s&&(f.m=s),h.indexOf(c)>-1?c="user-defined-".concat(c):c||(c=h[3]),e.createLog(c,f),!0}))};function te(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(u){return void r(u)}c.done?t(s):Promise.resolve(s).then(n,o)}function re(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){te(a,n,o,i,c,"next",e)}function c(e){te(a,n,o,i,c,"throw",e)}i(undefined)}))}}var ne=r(757),oe=r.n(ne);function ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var ie={read:function(e){return e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};var ce=function Dt(e,t){function r(r,n,o){if("undefined"!=typeof document){"number"==typeof(o=ae({},t,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),n=e.write(n,r);var a="";for(var i in o)o[i]&&(a+="; "+i,!0!==o[i]&&(a+="="+o[i].split(";")[0]));return document.cookie=r+"="+n+a}}return Object.create({set:r,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var r=document.cookie?document.cookie.split("; "):[],n={},o=0;o<r.length;o++){var a=r[o].split("="),i=a.slice(1).join("=");'"'===i[0]&&(i=i.slice(1,-1));try{var c=ie.read(a[0]);if(n[c]=e.read(i,c),t===c)break}catch(s){}}return t?n[t]:n}},remove:function(e,t){r(e,"",ae({},t,{expires:-1}))},withAttributes:function(e){return Dt(this.converter,ae({},this.attributes,e))},withConverter:function(e){return Dt(ae({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}(ie,{path:"/"});function se(e,t){t&&e&&localStorage.setItem(e,JSON.stringify(t))}function ue(e){try{return JSON.parse(localStorage.getItem(e))}catch(t){return null}}function fe(e){var t=e.conf,r=e.static_base,n="__fast_log:".concat(t.accessKey),o=function(e,t){var r,n=ue(t);if(_(n)&&n.length>0)(r=e.log_store).push.apply(r,i(n));else if(w(n)&&1===n.closed&&_(n.logs)&&n.logs.length>0){var o;(o=e.log_store).push.apply(o,i(n.logs))}localStorage.removeItem(t)};if(r.at===g)o(e,n);else try{for(var a=localStorage.length,c=0;c<a;c++){var s=localStorage.key(c);s&&0===s.indexOf(n)&&o(e,s)}}catch(u){}}function le(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[],r=arguments.length>2&&arguments[2]!==undefined&&arguments[2];if(_(t)){var n=e.conf,o=e.ins_id,a=e.static_base,c=a.at===g,s="__fast_log:".concat(n.accessKey).concat(c?"":":".concat(o)),u={logs:t,t:(new Date).getTime()},f=ue(s);_(f)&&f.length>0?u.logs=[].concat(i(f),i(u.logs)):w(f)&&_(f.logs)&&f.logs.length>0&&(u.logs=[].concat(i(f.logs),i(u.logs))),r&&(u.closed=1),se(s,u)}}function de(e){var t={expires:1e4};document&&document.location&&document.location.hostname&&(t.domain=document.location.hostname.replace(/^[^.]+\.(.+)/,".$1")),ce.set("__tracker_user_id__",e,t),localStorage.setItem("__tracker_user_id__",e)}function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function he(e){var t=e.method,r=void 0===t?"GET":t,n=e.data,o=void 0===n?null:n,a=e.url,i=e.callback,c=e.success,s=e.customHeader,u=void 0===s?{}:s;if(a&&"string"==typeof a){r=r&&"string"==typeof r?r.toUpperCase():"GET";var f="undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof window.XDomainRequest?new XDomainRequest:null;f&&("undefined"!=typeof window.XDomainRequest&&f instanceof window.XDomainRequest&&(a=a.replace(/^https?:/i,"")),f.open(r,a),"POST"!==r&&"PUT"!==r||!o||(o=JSON.stringify(o),f.setRequestHeader("Content-Type","application/json")),Object.getOwnPropertyNames(u).forEach((function(e){f.setRequestHeader(e,u[e])})),"function"==typeof c&&(f.onreadystatechange=function(){4!==f.readyState||200!==f.status&&304!==f.status||c(f.response)}),f.send(o)),"function"==typeof i&&i()}}function me(e,t){var r=t.slice(),n=ge(ge({},e.static_base),e.hybrid_base),o=r.length;if(1===o)return{base:n,items:r};for(var a=ge({},n),i=r[0],c=Object.getOwnPropertyNames(i),s=1;s<o;s++){if(0===c.length)break;for(var u=c.length-1;u>-1;u--){var f=c[u];r[s][f]!==undefined&&r[s][f]===i[f]||c.splice(u,1)}}if(c.length>0){for(var l=0;l<c.length;l++){var d=c[l];a[d]=i[d]}r=r.map((function(e){var t=ge({},e);return D(t,c),t}))}return{base:a,items:r}}function ve(e){if(_(e.log_store)&&e.log_store.length>0){var t=Object.getOwnPropertyNames(e.hybrid_rt);e.log_store=e.log_store.map((function(r){return t.forEach((function(t){r[t]||(r[t]=e.hybrid_rt[t])})),r.e!==h[5]&&D(r,"rom","ram"),r}))}}function ye(e,t,r){for(var n=e.length,o="",a=0;a<n;a++){var i=e[a];try{"url"===i?o=G(r,t):"cookie"===i?o=ce.get(t):"window"===i?(o=window[t])===window&&(o=""):o="localstorage"===i?localStorage.getItem(t):sessionStorage.getItem(t)}catch(c){}if(o)break}return o}function _e(e,t,r){for(var n=e.length,o="",a=0;a<n;a++){var i=e[a];if("url"!==i&&"cookie"!==i){try{if("window"===i)(o=P(window,t))===window&&(o="");else{var c=t.substring(0,r),s=t.substring(r+1),u="localstorage"===i?localStorage.getItem(c):sessionStorage.getItem(c);o=P(JSON.parse(u),s)}}catch(f){}if(o)break}}return o}function we(e,t,r){var n=e.conf[t]||{},o=n.key,a=n.range;if(!_(o)||0===o.length||!_(a)||0===a.length)return"";try{for(var i=o.length,c="",s=0;s<i;s++){var u=o[s];if(u){var f=u.indexOf(".");c=f>-1?_e(a,u,f):ye(a,u,r&&r.curr_href?r.curr_href:"")}if(c)break}return c||""}catch(l){}return""}function be(e){var t=(new Date).getTime().toFixed(3);return e.last_ts&&e.last_ts===t?e.ts_counter=+e.ts_counter+1:(e.last_ts=t,e.ts_counter=0),"".concat(t).concat(Array(4-"".concat(e.ts_counter).length).join("0")+e.ts_counter)}function Oe(e){if(window.cordova&&w(window.MFastLog)){var t=ge({tn:e.insertData.tn||"",ru:e.insertData.ru||"",ug:e.insertData.ug||"",l:e.insertData.cd||{},ahv:e.insertData.ahv||"",m:e.insertData.m||"",sid:e.sid},e.static_base);w(e.hybrid_base)&&(t.afv=e.hybrid_base.afv),window.MFastLog.setExtraLogs(t)}}function ke(e,t){for(var r=t.length-1;r>-1;r--)if(e&&e.indexOf(t[r])>-1)return!0;return!1}function xe(e,t,r,n){var o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:[];if("function"!=typeof performance.getEntriesByType)return[];for(var a=[],i=performance.getEntriesByType("resource").slice(e+1),c=i.length,s=r+t,u=0;u<c;u++){var f=i[u];if(!(f.duration<=0||""===f.initiatorType||"xmlhttprequest,fetch".indexOf(f.initiatorType)>-1||f.startTime<r||t&&f.responseEnd>s)&&!(o.length>0&&ke(f.name,o))){var l=f.transferSize||f.decodedBodySize||f.encodedBodySize||0,g=f.name;g=$(g),window.cordova&&(g=(g=g.replace(new RegExp("^[a-zA-Z]+://([\\w\\.\\-]+(:\\d+)?)?".concat(p)),"")).replace(new RegExp("^[a-zA-Z]+://".concat(d)),"")),a.push({u:g,s:l,du:A(f.duration,!0),st:+n+f.startTime,rst:f.startTime-r,it:f.initiatorType||""})}}return{resources:a,lastIndex:e+c}}function Ee(){return(Ee=re(oe().mark((function e(t,r){var n,o,a,i,c,s,u;return oe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.static_base.at=g,n=window,o=n.MFastLog,t.hybrid_rt.ram="",t.hybrid_rt.rom="",t.hybrid_rt.nt="",t.hybrid_rt["do"]="",t.hybrid_base.dmf="",t.hybrid_base.dmd="",t.hybrid_base.afv=window.cordova&&window.cordova.version||"",t.hybrid_base.ir=0,t.hybrid_base.ca="",t.hybrid_base.ac="",t.hybrid_base.aid="",t.hybrid_base.av="",a=0,!w(o)){e.next=39;break}return e.next=18,new Promise((function(e){o.getBasicInformation((function(t){e(t)}))}));case 18:i=e.sent,t.hybrid_rt["do"]=i.device_orientation||"",t.hybrid_rt.ram=i.m_available_ram||"",t.hybrid_rt.rom=i.m_available_rom||"",t.hybrid_rt.nt=i.network||"",t.hybrid_base.dmf=i.device_manufacturer||"",t.hybrid_base.dmd=i.device_model||"",t.hybrid_base.ir=i.m_is_root||0,t.hybrid_base.ca=i.m_cpu_architectures||"",t.hybrid_base.ac=i.m_app_channel||"",t.hybrid_base.aid=i.m_app_id||"",t.hybrid_base.av=i.m_app_version||"",i.os_name&&(t.static_base.osn=i.os_name),i.os_version&&(t.static_base.osv=i.os_version),t.insertData.av=t.hybrid_base.av,a=i.start_timestamp||0,i.user_id&&(t.static_base.u=i.user_id,de(i.user_id)),"function"==typeof o.setFastConfig&&o.setFastConfig({endpoint:t.conf.replay.endpoint?"".concat(t.conf.replay.endpoint).concat("prod"!==t.env?"?env=".concat(t.env):""):"",eventHashkey:t.conf.accessKey||"",recordHashkey:t.conf.replay.accessKey||""}),"function"==typeof o.setLogMaxSize&&o.setLogMaxSize(150,(function(){y({msg:"MFastLog的单个日志文件大小成功设置为150Kb (仅提示)"})}),(function(){y({msg:"MFastLog的单个日志文件大小设置失败,仍为默认200Kb (仅提示)"})})),Oe(t),S(t.hybrid_rt.nt)&&(t.hybrid_rt.nt=t.hybrid_rt.nt.toUpperCase());case 39:t.ha_inited=!0,t.last_hi=(new Date).getTime(),ve(t),c=ue("__fast_last_start__")||{},s=!1,!R(+a)&&a>0?(s=c.t!==a,u="".concat(a,".000000"),c.t=a):(s=c.sid!==t.sid,u=+t.start_time.toFixed(6),c.sid=t.sid),s&&u&&(t.createLog(h[7],{t:"".concat(u)}),se("__fast_last_start__",c)),r();case 47:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(e,t){var r=[h[7],h[8],h[9]],n=[h[0],h[1],h[2],h[10]];return-1!==h.slice().indexOf(t)&&(r.indexOf(t)>-1?-1===e.indexOf("event"):n.indexOf(t)>-1?-1===e.indexOf("page"):t===h[4]?-1===e.indexOf("api"):-1===e.indexOf(t))}function je(e){var t=Object.getOwnPropertyNames(e),r="";return t.forEach((function(t){var n=!1;switch(t){case"is_spa":case"include_search":case"report_api_params":"boolean"!=typeof e[t]&&(n=!0,r+=e[t]===undefined?"":"参数".concat(t,"必须是布尔类型!\n"));break;case"api_url_regx":"string"!=typeof e[t]&&(n=!0,r+=e[t]===undefined?"":"参数".concat(t,"必须是字符串类型!\n"));break;case"log_content_attribute":case"log_event_attribute":case"log_module_attribute":"string"==typeof e[t]&&e[t]||(n=!0,r+=e[t]===undefined?"":"参数".concat(t,"必须是字符串类型且不能为空!\n"));break;case"api_ignore_urls":case"ignore_pages":case"collect_event_types":if(_(e[t])||(n=!0,r+=e[t]===undefined?"":"参数".concat(t,"必须是数组类型!\n")),"api_ignore_urls"===t||"ignore_pages"===t){var o=[];e[t].forEach((function(e){var t=S(e)?e.replace(/^\s+|\s+$/g,""):"";t&&o.push(t)})),e[t]=o}break;case"tenant_reader":case"real_user_reader":case"user_group_reader":case"app_version_reader":if(w(e[t])?S(e[t].key)&&_(e[t].range)?e[t].key=e[t].key?e[t].key.split("|").map((function(e){return e.replace(/^\s+|\s+$/g,"")})):[]:(n=!0,r+="参数".concat(t,"格式错误,请参照: { key: 'user', range: ['cookie'] }\n")):(n=!0,r+=e[t]===undefined||null===e[t]?"":"参数".concat(t,"必须是对象类型!\n")),!n&&e[t].range.indexOf("window")>-1){var a="";e[t].key.forEach((function(e){P(window,e)===window&&(a+=a?",".concat(e):e)})),a&&(r+="参数".concat(t,"中存在key: ").concat(a,"因在window中查询结果仍然为window,将在window的查找中被忽略\n"))}break;case"trace_config":w(e[t])?null!==e[t]&&(e[t].tid_type=String(e[t].tid_type),"skywalking"!==e[t].tid_type&&"fast"!==e[t].tid_type&&(e[t].tid_type="fast"),_(e[t].rules)&&_(e[t].headers)?_(e[t].headers)&&(e[t].headers=function(e,t){for(var r="skywalking"===t?"sw8":"x-fast-trace-id",n=["accept-charset","accept-encoding","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","referer","te","trailer","transfer-encoding","upgrade","user-agent","via",/^proxy-/i,/^sec-/i],o=e.length,a=[],i={},c={},s=0,u=0;s<o;s++){var f=e[s]||{},l=f.name,d=f.type,p=f.value;if(l&&p&&("built-in"===d||"static"===d)&&c[l]===undefined){for(var g=n.length-1;g>-1;g--)if("string"==typeof n[g]){if("".concat(l).toLowerCase()===n[g])continue}else if(n[g].test(l))continue;if("built-in"===d){if(i[p])continue;i[p]=1}c[l]=u++,a.push({name:l,type:d,value:p})}}if(!i.tid){var h=c[r];h!==undefined&&a.splice(h,1),a.push({name:r,type:"built-in",value:"tid"})}return a}(e[t].headers,e[t].tid_type)):(n=!0,r+="参数".concat(t,"格式错误,请参照: { tid_type: 'fast', rules: ['http://fast.mypaas.com.cn'], headers: [{ type: 'built-in', name: 'x-fast-trace-id', value: 'trace_id' }] }\n"))):(n=!0,r+=e[t]===undefined||null===e[t]?"":"参数".concat(t,"必须是对象类型!\n"));break;case"replay":w(e[t])?null!==e[t]&&(S(e[t].endpoint)&&e[t].endpoint&&/^https?:\/\//.test(e[t].endpoint)||(n=!0,r+="参数".concat(t,"中的endpoint缺少,视频回放功能以及MFastLog上报不可用\n")),S(e[t].accessKey)&&e[t].accessKey||(r+="参数".concat(t,"中的accessKey缺少,视频回放功能不可用\n")),n||(e[t]={endpoint:e[t].endpoint,accessKey:e[t].accessKey,error:!!e[t].error,crash:!!e[t].crash,all:!!e[t].all})):(n=!0,r+=e[t]===undefined||null===e[t]?"":"参数".concat(t,"必须是对象类型!\n"));break;case"debug":case"product":case"app":case"endpoint":case"accessKey":break;case"enable":1!==e[t]&&0!==e[t]&&(e[t]=1);break;default:n=!0,r+="参数".concat(t,"不属于探针的配置项\n")}n&&e[t]!==undefined&&delete e[t]})),r&&y({msg:r+="以上仅提示,不影响探针运行"}),e}function Te(e,t){var r=t||e,n=H(r),o=n.domain,a=n.fixPathname,i=n.search,c=e.prev_page||"";if(0===c.indexOf(o)&&!e.conf.include_search){var s=c.indexOf("?");s>0&&(c=c.substring(0,s))}var u={d:o?$(o):"",pg:a?$(a):"",pid:e.curr_pid,ps:e.conf.include_search&&i?$(i):"",te:r.curr_title||a,r:c?$(c):"",sid:e.sid};e.regu_called?(u.tn=e.insertData.tn||"",u.ru=e.insertData.ru||"",u.ug=e.insertData.ug||""):(e.conf.tenant_reader&&(u.tn=we(e,"tenant_reader",r),e.insertData.tn=u.tn),e.conf.real_user_reader&&(u.ru=we(e,"real_user_reader",r),e.insertData.ru=u.ru),e.conf.user_group_reader&&(u.ug=we(e,"user_group_reader",r),e.insertData.ug=u.ug)),e.hybrid_base.av&&S(e.hybrid_base.av)?u.av=e.hybrid_base.av:e.conf.app_version_reader&&(u.av=we(e,"app_version_reader",r),e.insertData.av=u.av),e.insertData.ahv&&(u.ahv=e.insertData.ahv);var f=(new Date).getTime();return f-e.last_sync>=12e4&&(Oe(e),e.last_sync=f),u}function Le(e,t){var r=arguments.length>2&&arguments[2]!==undefined&&arguments[2],n=e.r,o=e.d,a={};if(!r&&n){var i=G(n);if(Object.getOwnPropertyNames(i).length>0&&(a.referrer_params=JSON.stringify(i)),a.referrer_domain=0===n.indexOf("file://")?"/":n.replace(/(^[a-zA-Z]+:\/\/[^/]*)[\s\S]*/,"$1"),"/"!==a.referrer_domain&&"/"!==o){var c=U(a.referrer_domain),s=U(o);/^[a-zA-Z]+:\/\/((.*\.baidu\.com$)|(.*\.bing\.com$)|(www\.google\.com$)|(www\.google\.com\.[a-z]{2}$)|(www\.google\.[a-z]{2}$)|(m\.sm\.cn$)|(.+\.so\.com$)|(.*\.sogou\.com$)|(.*\.yahoo\.com$)|(so\.toutiao\.com$))/i.test(a.referrer_domain)?a.traffic_source="搜索引擎":a.traffic_source=c===s?"直接访问":"外部链接"}else a.traffic_source="直接访问"}else a.traffic_source="直接访问";if(t&&t.indexOf("?")>-1){var u=G(t);["utm_source","utm_medium","utm_campaign","utm_content","utm_term"].forEach((function(e){u[e]&&(a[e]=u[e])}))}return a}function De(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0,r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(t||2===r){var n=new Image,o=function(){n.onload=null,n.onerror=null,n=undefined};n.onload=o,n.onerror=o,n.crossOrigin="anonymous",n.src=e}else he({url:e})}function Pe(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(1===e.conf.enable)try{t&&e.log_store.push(t);var n="".concat(e.conf.endpoint,"/").concat(e.conf.accessKey,"?env=").concat(e.env),o=e.log_store.slice(),a=window.MFastLog||{},i=a.writeToFile,c=a.startUploadLog,s="function"==typeof i&&"function"==typeof c,f=e.static_base.at===g,l=w(s)?50:10,d=o.length,p=(new Date).getTime();if(d>0){var h;if(f&&!e.ha_inited||0===r&&d<l)return;e.log_store=[];var m=(null===(h=window.navigator.connection)||void 0===h?void 0:h.type)||"";if(s&&!/(wifi|4g|cellular)/i.test(m))if(2===r)le(e,o,!0);else{var v=me(e,o),_=JSON.stringify(v);clearTimeout(e.wfile_timer),i(_,"event",(function(){r>0&&p-e.last_sul>12e4&&(e.last_sul=p,e.wfile_timer=setTimeout(c,u))}),(function(e){y({msg:"探针内部异常向MFastLog写入事件日志出错\n".concat(e)})}))}else{s&&p-e.last_sul>12e4&&(e.last_sul=p,e.wfile_timer=setTimeout(c,u));var b=16256,O=me(e,o),k="".concat(n,"&data=").concat(encodeURIComponent(JSON.stringify(O))),x=z(k);if(x<b)De(k,e.pg_loaded,r);else if(2!==r)he({url:n,method:"POST",data:O});else{for(var E=z("".concat(n,"&data=&items=&base=").concat(encodeURIComponent(JSON.stringify(ge(ge({},e.static_base),e.hybrid_base))))),S=[],j=0,T=0;j<d;j++){var L=o[j],D=z(encodeURIComponent(JSON.stringify([L])));if(D+E>=b){var P=me(e,S);"function"==typeof navigator.sendBeacon?navigator.sendBeacon(n,P):he({url:n,method:"POST",data:P})}else if(T+D+E>=b){var I=me(e,S),A="".concat(n,"&data=").concat(encodeURIComponent(JSON.stringify(I)));De(A,e.pg_loaded,r),T=0,S=[]}T+=D,S.push(L)}if(S.length>0){var R=me(e,S),C="".concat(n,"&data=").concat(encodeURIComponent(JSON.stringify(R)));De(C,e.pg_loaded,r)}}}}}catch(N){y({msg:"探针内部异常上报日志出错\n".concat(N)})}}function Ie(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1,t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return Math.floor(Math.random()*(e-t)+t)}var Ae=function(){for(var e=function(){var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&window.msCrypto.getRandomValues.bind(window.msCrypto);if(e){var t=new Uint8Array(16);return function(){return e(t),t}}var r=[];return function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}(),t=function(e){for(var t=(e=unescape(encodeURIComponent(e))).length,r=[],n=0;n<t;n++)r[n]=e.charCodeAt(n);return r}(window.navigator.userAgent),r=t.length,n=[],o=0;o<256;++o)n[o]=(o+256).toString(16).substr(1);var a=(new Date).getTime(),i=0,c=0;return function(){var o=e(),s=0,u=[],f=[1|o[0],o[1],o[2]],l=1e5*(new Date).getTime();performance&&"function"==typeof performance.now&&(l=+"".concat(1e5*(a+performance.now())).replace(/\.\d*/g,""));var d=l.toString(16),p=c+1;(l-i<=0||l>i)&&(p=0),i=l,c=p;var g,h,m=(1e4*(268435455&(l+=122192928e5))+p)%4294967296;return u[s++]=m>>>16&255,u[s++]=m>>>8&255,u[s++]=255&p,u[s++]=f[0],u[s++]=f[1],u[s++]=f[2],u[s++]=255&t[Ie(r)],u[s++]=255&t[Ie(r)],u[8]=255&t[Ie(r)],"".concat(d,"-").concat((g=u,h?[n[g[2]],n[g[Math.floor(3*Math.random())+3]],n[g[Math.floor(3*Math.random())+6]]].join(""):[n[g[0]],n[g[1]],n[g[2]],n[g[3]],n[g[4]],"-",n[g[5]],n[g[6]],n[g[7]],n[g[8]],n[g[9]]].join("")))}}(),Re=function(e){e.curr_pgsted=0,e.createLog(h[2],null,1);var t=function(t){clearTimeout(e.ps_timer),t&&(e.ps_timer=setTimeout((function(){var t=(new Date).getTime();e.curr_pgsted=1,e.createLog(h[0],{g:{du:t-e.page_enter}})}),18e5))};if(e.conf.is_spa){var r=function(){e.fmpInstance&&e.fmpInstance.stop(),e.fmpInstance&&e.fmpInstance.start(),"function"==typeof performance.getEntriesByType&&(e.last_resource=performance.getEntriesByType("resource").length-1);var r=(new Date).getTime();e.curr_pgsted||(e.curr_pgsted=1,e.createLog(h[0],{g:{du:r-e.page_enter}})),e.page_enter=r;var n=K();e.prev_page=J(e),e.curr_pid=Ae(),e.curr_title=n.curr_title,e.curr_hash=n.curr_hash,e.curr_search=n.curr_search,e.curr_href=n.curr_href,e.curr_pgsted=0,e.createLog(h[2]),e.createLog(h[1],{g:{du:0,res:[]}}),t(!0)},n=window.navigator.userAgent;if((-1===n.indexOf("Android 2.")&&-1===n.indexOf("Android 4.0")||-1===n.indexOf("Mobile Safari")||-1!==n.indexOf("Chrome")||-1!==n.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history){var o=function(e,t){var n=e[t];"function"!=typeof n||e[t].__fast_wrapped__||(e[t]=function(t,o,a){if(!a||"string"!=typeof a)return n.call(e,t,o);var i=n.call(e,t,o,a);return r(),i},e[t].toString=F(t),e[t].__fast_wrapped__=!0)};o(window.history,"pushState"),o(window.history,"replaceState"),s(window,"popstate",r)}else s(window,"hashchange",r)}var a=!1;if("complete"===document.readyState&&performance){var i="function"==typeof performance.getEntriesByType?performance.getEntriesByType("navigation")[0]:null;i&&i.loadEventStart>0&&(a=!0)}var c=function(){e.pg_loaded||(e.pg_loaded=1),setTimeout((function(){var r={du:Math.max((new Date).getTime()-e.page_enter,0)},n="function"==typeof performance.getEntriesByType?performance.getEntriesByType("navigation")[0]:null;n&&n.duration>0&&(r.du=N(n.duration,6),r.nty=n.type,r.fs=N(n.fetchStart,6),r.dls=N(n.domainLookupStart,6),r.dle=N(n.domainLookupEnd,6),r.cs=N(n.connectStart,6),r.ce=N(n.connectEnd,6),r.ues=N(n.unloadEventStart,6),r.uee=N(n.unloadEventEnd,6),r.scs=N(n.secureConnectionStart,6),r.rqs=N(n.requestStart,6),r.rps=N(n.responseStart,6),r.rpe=N(n.responseEnd,6),r.di=N(n.domInteractive,6),r.dcs=N(n.domContentLoadedEventStart,6),r.dce=N(n.domContentLoadedEventEnd,6),r.dc=N(n.domComplete,6),r.les=N(n.loadEventStart,6),r.lee=N(n.loadEventEnd,6));var o=xe(e.last_resource,r.du,0,e.start_time,[e.conf.endpoint]);e.last_resource=o.lastIndex,r.res=o.resources,e.createLog(h[1],{g:r}),t(!0)}),0)};a?c():s(window,"load",c),s(window,"beforeunload",(function(){var r=(new Date).getTime();e.curr_pgsted||(e.curr_pgsted=1,e.createLog(h[0],{g:{du:r-e.page_enter}},2)),e.page_enter=r,e.last_api=-1,t(!1)}))};function Ce(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ne(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ne(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r["return"]||r["return"]()}finally{if(c)throw a}}}}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Me(e){if(e&&"string"==typeof e){var t=document.createElement("base");return t.href=e,t.href}return window.location.href}function qe(e,t){var r="";if(t)try{var n=e.match(new RegExp(t));n&&(r=n[1]||n[0]||"")}catch(o){r=""}return r}function $e(e,t,r){var n="",o="";t&&"string"==typeof t&&t.indexOf("?")>-1&&(n=t.substring(t.indexOf("?")+1)||"")&&(n=$(I(n))),r&&"function"==typeof r.toString&&(0===(o=r.toString()||"").indexOf("[object")?o="":o&&(o=$(I(o))));var a=JSON.stringify(e);return z("".concat(a).concat(n).concat(o))>14336&&(o="-",z("".concat(a).concat(n))>14336&&(n="-")),{request_query:n,request_body:o}}function Be(e,t){var r=t.conf||{},n=r.endpoint,o=void 0===n?"":n,a=r.api_ignore_urls,i=r.replay,c=[o,"aliyuncs.com","growingio.com","sensorsdata.cn","hm.baidu.com","google-analytics.com","tingyun.com","lr-ingest.io","r.lr-in-prod.com","logrocket.io"];i&&i.endpoint&&S(i.endpoint)&&c.unshift(i.endpoint);var s=_(a)?a.length:0;if(!e||"string"!=typeof e)return!1;for(var u=0;u<c.length;u++){var f=c[u];if(e.indexOf(f)>-1)return!0}for(var l=0;l<s;l++){var d=a[l];try{if(d&&d.constructor===RegExp&&d.test(e)||"string"==typeof d&&new RegExp(d).test(e))return!0}catch(p){continue}}return!1}function Ue(e,t){try{var r=function(e){try{var t={};return e.transferSize>0?t.size=e.transferSize:e.decodedBodySize>0?t.size=e.decodedBodySize:e.encodedBodySize>0&&(t.size=e.encodedBodySize),e.duration>0?t.du=A(e.duration,!0):e.responseEnd>0&&(e.fetchStart>0||e.startTime>0)&&(t.du=A(e.responseEnd-(e.fetchStart>0?e.fetchStart:e.startTime),!0)),(e.connectStart>0||e.requestStart>0)&&e.fetchStart>0&&(t.qas=A((e.connectStart>0?e.connectStart:e.requestStart)-e.fetchStart,!0)),e.connectEnd>0&&e.connectStart>0&&(t.ic=A(e.connectEnd-e.connectStart,!0)),e.responseStart>0&&e.requestStart>0&&(t.wt=A(e.responseStart-e.requestStart,!0)),e.responseEnd>0&&e.responseStart>0&&(t.ctd=A(e.responseEnd-e.responseStart,!0)),t}catch(r){return{}}}(t);r.size!==undefined&&(e.g.size=r.size),r.du!==undefined&&(e.g.du=r.du),r.qas!==undefined&&(e.g.qas=r.qas),r.ic!==undefined&&(e.g.ic=r.ic),r.wt!==undefined&&(e.g.wt=r.wt),r.ctd!==undefined&&(e.g.ctd=r.ctd)}catch(n){y({msg:"探针内部异常合并API阶段数据失败\n".concat(e.g.api,"\n").concat(n.message)})}}function He(e,t){try{t.use_trace||delete t.g.tid,t.g.regxApiUrl&&(t.g.api=t.g.regxApiUrl),delete t.g.regxApiUrl,delete t.use_trace,e.createLog(h[4],ze({},t))}catch(r){}}function Je(e,t){clearTimeout(e.api_timer),-1===e.api_que.indexOf(t.g.tid)&&(e.api_que.push(t.g.tid),e.api_cache[t.g.tid]=ze({},t)),e.api_timer=setTimeout((function(){var t=e.api_que.slice(),r=t.length;if(e.api_que.splice(0,r),"function"==typeof performance.mark&&"function"==typeof performance.getEntries){var n=e.last_api,o=[];performance.getEntries().slice(n+1).forEach((function(t){var r="mark"===t.entryType&&0===t.name.indexOf("fast-tracker-api"),a="resource"===t.entryType&&("xmlhttprequest,fetch".indexOf(t.initiatorType)>-1||window.navigator.userAgent.indexOf("Android")>-1&&""===t.initiatorType)&&!Be($(t.name),e);(r||a)&&o.push(t),n+=1}));for(var a=o.length,i=0;i<a;){var c=o[i];if(c&&"mark"===c.entryType){var s=c.name.split("|$|"),u=s[1],f=s[2];if(u&&f&&e.api_cache[u]){for(var l=1;i+l<a&&o[i+l]&&"mark"!==o[i+l].entryType;){var d=o[i+l];if(d&&d.name===f){e.api_perfCache[u]=d;break}l++}i+=l}else i++}else i++}e.last_api=n}for(var p=0;p<r;p++){var g=t[p],h=e.api_cache[g];if(g&&h){var m=ze({},h),v=e.api_perfCache[g];v&&Ue(m,v),He(e,m);try{e.api_cache[g]=null,delete e.api_cache[g],e.api_perfCache[g]=null,delete e.api_perfCache[g]}catch(y){}}}}),1350)}function Ke(e,t){switch(t){case"u":return e.static_base.u;case"dsw":return e.static_base.dsw;case"dsh":return e.static_base.dsh;case"ua":return e.static_base.ua;case"tn":return e.insertData.tn;case"ru":return e.insertData.ru;case"ug":return e.insertData.ug;case"dmf":return e.hybrid_base.dmf;case"dmd":return e.hybrid_base.dmd;case"ac":return e.hybrid_base.ac;case"aid":return e.hybrid_base.aid;case"av":return e.insertData.av;case"ahv":return e.insertData.ahv;default:return""}}function We(e,t,r){var n=[];try{var o=e.conf.trace_config||{},a=o.rules,i=o.headers,c=new RegExp(/(\w+):\/\/([^/]+)/),s=t.match(c),u=s?s[0]:t;if(_(a)&&a.length>0&&_(i)&&i.length>0){for(var f=!1,l=a.length-1;l>-1;l--){var d=a[l].replace(/\./g,"\\.").replace(/\?/g,".").replace(/\*/g,".*");if(d&&"string"==typeof d&&new RegExp(d).test(u)){f=!0;break}}if(f)for(var p=i.length,g=function(e){return"\\u"===e?"%u":escape(e)},h=0;h<p;h++){var m=i[h]||{},v=m.name,y=m.type,w=m.value;if(v&&w&&("static"===y||"built-in"===y)){var b="static"===y?w:"tid"===w?r:Ke(e,w);null!==b&&b!==undefined&&""!==b&&n.push({name:v,value:"".concat(b).replace(/[^\x00-\xff]|\\u/g,g)})}}}}catch(O){}return n}function Ge(e,t,r){var n=String(T(r)),o=String(T(Ae())),a=String(T(e.static_base.a)),i=String(T(t.av)),c=String(T(t.pg)),s=String(T(t.d.replace(/^\w+:\/\//i,"")));return"".concat(1,"-",n,"-").concat(o,"-0-").concat(a,"-").concat(i,"-").concat(c,"-").concat(s)}var Ze,Xe=function(e){var t="undefined"!=typeof window?window:"undefined"!=typeof r.g?r.g:{},n="fetch",o="XMLHttpRequest",a="function"==typeof performance.mark&&"function"==typeof performance.getEntries;if("function"==typeof t[n]&&!t[n].__fast_wrapped__&&!t[n].polyfill){t.ofetch=t[n];q(t,n,(function(r){return function(o,i){for(var c=arguments.length,s=new Array(c>2?c-2:0),u=2;u<c;u++)s[u-2]=arguments[u];var f=1===arguments.length?[o]:[o,i].concat(s);if(!i||"HEAD"===i.method||"no-cors"===i.mode)return r.apply(t,f);var l=(o&&"string"!=typeof o?o.url:o)||"";if(!l||Be(l,e)||-1===e.conf.collect_event_types.indexOf(h[4])||W(window.location.href,e.conf.ignore_pages)||r.polyfill||t[n].polyfill)return r.apply(t,f);var d=ze(ze({},Te(e)),{},{t:be(e)}),p="",g="";if(e.conf.report_api_params){var m=$e(d,l,i.body);p=m.request_query,g=m.request_body}var v=new Date,_="fast-".concat(Ae()),b="skywalking"===e.conf.trace_config.tid_type?Ge(e,d,_):_,O=qe(l,e.conf.api_url_regx),k=Me(l),x=We(e,k,b),E=x.length>0;if(E)try{for(var S={},j=x.length-1;j>-1;j--){var T=x[j],L=T.name,D=T.value;S[L]=D}if(w(f[1]))if(f[1]=ze({},f[1]),f[1].headers)if("[object Headers]"===Object.prototype.toString.call(f[1].headers)&&"function"==typeof f[1].headers.keys){var P,I=Ce(f[1].headers.keys());try{for(I.s();!(P=I.n()).done;){var A=P.value;S[A]=f[1].headers.get(A)}}catch(R){I.e(R)}finally{I.f()}}else S=ze(ze({},S),f[1].headers);else f[1].headers={};else f[1]={headers:{}};f[1].headers=S}catch(C){y({msg:"探针内部异常拦截fetch过程中添加请求头失败\n".concat(C)})}return a&&performance.mark("fast-tracker-api|$|".concat(_,"|$|").concat(k)),r.apply(t,f).then((function(t){var r=t.clone(),n=new Date-v,o=ze({g:{regxApiUrl:O,api:k,du:n,m:i.method||"GET",tid:_}},d);return E&&(o.use_trace=1),p&&(o.g.rq=p),g&&(o.g.rb=g),r.ok?r.arrayBuffer().then((function(t){o.g.ss=r.status||200,o.g.size=t&&t.byteLength?t.byteLength:0,Je(e,o)})):r.arrayBuffer().then((function(t){o.g.ss=r.status||404,o.g.size=t&&t.byteLength?t.byteLength:0,Je(e,o)})),t}))}}))}if("function"==typeof t[o]&&!t[o].__fast_wrapped__){var c=t[o],u=c.prototype,f=function(t){return function(r,n){for(var o=arguments.length,a=new Array(o>2?o-2:0),c=2;c<o;c++)a[c-2]=arguments[c];var s=1===arguments.length?[r]:[r,n].concat(a),u=n||"";u&&Be(u,e)&&(u=""),this.__api_method__=(r||"get").toUpperCase(),this.__api_url__=u;try{return t.apply(this,s)}catch(f){return Function.prototype.apply.apply(t,[this].concat(i(s)))}}},l=function(t){return function(){for(var r=new Date,n=arguments.length,o=new Array(n),f=0;f<n;f++)o[f]=arguments[f];var l=[].concat(o),d=this;if(d&&d.__api_url__&&e.conf.collect_event_types.indexOf(h[4])>-1&&!W(window.location.href,e.conf.ignore_pages)){var p=ze(ze({},Te(e)),{},{t:be(e)}),g="",m="";if(e.conf.report_api_params){var v=$e(p,d.__api_url__,l[0]);g=v.request_query,m=v.request_body}var y="fast-".concat(Ae()),_="skywalking"===e.conf.trace_config.tid_type?Ge(e,p,y):y,w=qe(d.__api_url__,e.conf.api_url_regx),b=Me(d.__api_url__),O=We(e,b,_),k=O.length>0;if(k){var x=d.setRequestHeader;u&&u.setRequestHeader?x=u.setRequestHeader:c&&c.setRequestHeader&&(x=c.setRequestHeader);for(var E=O.length-1;E>-1;E--){var j=O[E],T=j.name,L=j.value;x.call(d,T,L)}}s(d,"readystatechange",(function(t){var n=t.target||d;if(n&&4===n.readyState){var o,a=new Date-r;try{var i=n.response||n.responseText;o=i?S(i)?i.length:JSON.stringify(i).length:0}catch(u){o=0}var c,s=ze({g:{regxApiUrl:w,api:b,du:a,m:n.__api_method__,size:o,tid:y}},p);k&&(s.use_trace=1),g&&(s.g.rq=g),m&&(s.g.rb=m);try{c=n.status}catch(u){c=0}c>=200&&c<300?(s.g.ss=c||200,Je(e,s)):c>0&&(s.g.ss=c,Je(e,s))}})),a&&performance.mark("fast-tracker-api|$|".concat(y,"|$|").concat(b))}try{return t.apply(d,l)}catch(D){return Function.prototype.apply.apply(t,[d].concat(i(l)))}}};u?(q(u,"open",f),q(u,"send",l)):(t[o]=function(e){var t=new c(e);return q(t,"open",f),q(t,"send",l),t},Object.keys(c).forEach((function(e){L(c,e)&&!L(t[o],e)&&(t[o][e]=c[e])})),t[o].toString=F(o)),t[o].__fast_wrapped__=!0}},Ve=function(e){var t=!1;if(window.cordova&&window.cordova.require){var r=window.cordova.require("cordova/channel");r&&r.onDeviceReady&&2===r.onDeviceReady.state&&(t=!0)}var n=function(){if(window.cordova){var t=window.MFastLog;if(w(t)){var r=e.conf.collect_event_types.indexOf(h[6])>-1;if("function"==typeof t.setLogLevelByJson){var n=["event"];e.conf.collect_event_types.indexOf(h[11])>-1&&n.push("anr"),r&&n.push("crash"),t.setLogLevelByJson(n)}}!function(e,t){Ee.apply(this,arguments)}(e,(function(){s(document,"pause",(function(){e.createLog(h[8],null,2)})),s(document,"resume",(function(){fe(e),e.createLog(h[9])}))}))}};t?n():document.addEventListener("deviceready",n,!1)},Ye=function(e,t,r){return{app:e.static_base.a,record_id:Ae(),session_id:e.sid,page_id:e.curr_pid,record_type:t,time:r?r.timestamp:null,content:r?[r]:[]}},Qe=(Ze=null,function(e){if(Ze)return Ze;try{var t=e.conf.replay||{},r=t.endpoint,n=t.accessKey,o=t.error,a=t.all;if(b(window.$$fastRecord)&&r&&n&&(o||a)){var i=0,c=0,s=[],u=[];window.$$fastRecord({emit:function(t,r){if(i++,r)u.push(Ye(e,0,t)),i=1;else if(3!==t.type)0===u.length?u.push(Ye(e,0,t)):u[u.length-1].content.push(t);else{var n=u[u.length-1];i>102&&(u=function(e){if(_(e)&&e.length>0){for(var t=e.length-1;t>-1;t--)if(e[t]&&0===e[t].record_type)return e.slice(t);return e}return[]}(u)),0===n.record_type?u.push(Ye(e,1,t)):(_(n.content)&&0===n.content.length&&(n.time=t.timestamp),n.content.push(t))}},inlineStylesheet:!0,sampling:{scroll:150,input:"last"},checkoutEveryNth:200}),Ze={caughtError:function(){var t=(new Date).getTime();if(c+500<t&&_(u)&&u.length>1){var o=[];s=[],u.forEach((function(e,t){var r;!e||0!==t&&0===e.record_type||(s.push(e.record_id),e.sended||(o.push({filename:(r=e,"".concat(r.record_type,"_[").concat(r.app,"]_").concat(r.session_id,"_").concat(r.page_id,"_").concat(r.record_id,"_").concat(r.time)),content:JSON.stringify(e)}),e.sended=1))})),u.push(Ye(e,1,null)),c=t;var a=window.MFastLog||{},i=a.writeToFile,f=a.startUploadLog;if("function"==typeof i&&"function"==typeof f){var l=o.map((function(e){var t=e.filename,r=e.content;return{filename:"".concat(t,".txt"),filecontent:r}}));i(JSON.stringify(l),"record",(function(){f()}),(function(e){y({msg:"探针内部异常向MFastLog写入回放日志出错\n".concat(e)})}))}else he({url:"".concat(r).concat("prod"!==e.env?"?env=".concat(e.env):""),method:"POST",customHeader:{hashkey:n},data:{data:o}})}return s},pidChanged:function(){},userExit:function(){}}}}catch(f){y({msg:"探针视频回放采集模块异常\n".concat(f.message)})}return Ze});function et(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var tt={collectWindowErrors:!0,debug:!1},rt="undefined"!=typeof window?window:"undefined"!=typeof r.g?r.g:{},nt=[].slice,ot="?",at=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function it(){return"undefined"!=typeof document&&document.location?document.location.href:""}tt.report=function(){var e,t,r=[],n=null,o=null,a=null;function i(e,t){var n=null;if(!t||tt.collectWindowErrors){for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))try{r[o].apply(null,[e].concat(nt.call(arguments,2)))}catch(a){n=a}if(n)throw n}}function c(){var e=a,t=n;n=null,a=null,o=null,i.apply(null,[e,!1].concat(t))}function s(t,r,n,o,s){var u=k(s)?s.error:s,f=k(t)?t.message:t;if(a)tt.computeStackTrace.augmentStackTraceWithInitialElement(a,r,n,f),c();else if(u&&O(u))i(tt.computeStackTrace(u),!0);else{var l,d={url:r,line:n,column:o};if(S(f)){var p=f.match(at);p&&(l=p[1],f=p[2])}d.func=ot,i({name:l,message:f,url:it(),stack:[d]},!0)}return!!e&&e.apply(this,arguments)}function u(){t||(e=rt.onerror,rt.addEventListener("error",(function(e){try{var t=[(e=e||window.event).message||"",e.filename||""];t.push("undefined"==typeof e.lineno?1:e.lineno),t.push("undefined"==typeof e.colno?1:e.colno),t.push("undefined"==typeof e.error?{}:e.error),s.apply(this,t)}catch(r){}})),t=!0)}function f(e,t){var r=nt.call(arguments,1);if(a){if(o===e)return;c()}var i=tt.computeStackTrace(e);if(a=i,o=e,n=r,setTimeout((function(){o===e&&c()}),i.incomplete?2e3:0),!1!==t)throw e}return f.subscribe=function(e){u(),r.push(e)},f.unsubscribe=function(e){for(var t=r.length-1;t>=0;--t)r[t]===e&&r.splice(t,1)},f.uninstall=function(){t&&(rt.onerror=e,t=!1,e=undefined),r=[]},f}(),tt.computeStackTrace=function(){function e(e){if("undefined"!=typeof e.stack&&e.stack){for(var t,r,n,o=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx(?:-web)|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,i=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,s=/\((\S*)(?::(\d+))(?::(\d+))\)/,u=e.stack.split("\n"),f=[],l=0,d=u.length;l<d;++l){if(r=o.exec(u[l])){var p=r[2]&&0===r[2].indexOf("native");r[2]&&0===r[2].indexOf("eval")&&(t=s.exec(r[2]))&&(r[2]=t[1],r[3]=t[2],r[4]=t[3]),n={url:p?null:r[2],func:r[1]||ot,args:p?[r[2]]:[],line:r[3]?+r[3]:null,column:r[4]?+r[4]:null}}else if(r=a.exec(u[l]))n={url:r[2],func:r[1]||ot,args:[],line:+r[3],column:r[4]?+r[4]:null};else{if(!(r=i.exec(u[l])))continue;r[3]&&r[3].indexOf(" > eval")>-1&&(t=c.exec(r[3]))?(r[3]=t[1],r[4]=t[2],r[5]=null):0!==l||r[5]||"undefined"==typeof e.columnNumber||(f[0].column=e.columnNumber+1),n={url:r[3],func:r[1]||ot,args:r[2]?r[2].split(","):[],line:r[4]?+r[4]:null,column:r[5]?+r[5]:null}}if(!n.func&&n.line&&(n.func=ot),n.url&&"blob:"===n.url.substr(0,5)){var g=new XMLHttpRequest;g.open("GET",n.url,!1),g.send(null);try{if(200===g.status){var h=g.responseText||"",m=(h=h.slice(-300)).match(/\/\/# sourceMappingURL=(.*)$/);if(m){var v=m[1];"~"===v.charAt(0)&&(v=("undefined"!=typeof document&&document.location?document.location.origin?document.location.origin:"".concat(document.location.protocol,"//").concat(document.location.hostname).concat(document.location.port?":".concat(document.location.port):""):"")+v.slice(1)),n.url=v.slice(0,-4)}}}catch(y){}}f.push(n)}return f.length?{name:e.name,message:e.message,url:it(),stack:f}:null}}function t(e,t,r){var n={url:t,line:r};if(n.url&&n.line){if(e.incomplete=!1,n.func||(n.func=ot),e.stack.length>0&&e.stack[0].url===n.url){if(e.stack[0].line===n.line)return!1;if(!e.stack[0].line&&e.stack[0].func===n.func)return e.stack[0].line=n.line,!1}return e.stack.unshift(n),e.partial=!0,!0}return e.incomplete=!0,!1}function r(e,o){for(var a,i,c=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,s=[],u={},f=!1,l=r.caller;l&&!f;l=l.caller)if(l!==n&&l!==tt.report){if(i={url:null,func:ot,line:null,column:null},l.name?i.func=l.name:(a=c.exec(l.toString()))&&(i.func=a[1]),"undefined"==typeof i.func)try{i.func=a.input.substring(0,a.input.indexOf("{"))}catch(p){}u["".concat(l)]?f=!0:u["".concat(l)]=!0,s.push(i)}o&&s.splice(0,o);var d={name:e.name,message:e.message,url:it(),stack:s};return t(d,e.sourceURL||e.fileName,e.line||e.lineNumber),d}function n(t,n){var o=null;n=null==n?0:+n;try{if(o=e(t))return o}catch(a){if(tt.debug)throw a}try{if(o=r(t,n+1))return o}catch(a){if(tt.debug)throw a}return{name:t.name,message:t.message,url:it()}}return n.augmentStackTraceWithInitialElement=t,n.computeStackTraceFromStackProp=e,n}();var ct=tt;function st(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ut(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?st(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ft,lt="undefined"!=typeof window?window:"undefined"!=typeof r.g?r.g:{},dt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._lastCaptruedException=null,this._lastData=null,this._lastEventId=null,this._errCallback=null,this._globalOptions={ignoreErrors:[],stackTraceLimit:50,collectWindowErrors:!0,captureUnhandledRejections:!0},this._ignoreOnError=0,this._lastCaptruedEvent=null}var t,r,n;return t=e,(r=[{key:"init",value:function(e){var t=this,r=e.callback,n=e.confSource;r="function"==typeof r?r:function(){},this._errCallback=r;var o=this._globalOptions;o.ignoreErrors.push(/^Script error\.?$/),o.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/),o.ignoreErrors=function(e){for(var t,r=[],n=0,o=e.length;n<o;n++)S(t=e[n])?r.push(t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):t&&t.source&&r.push(t.source);return new RegExp(r.join("|"),"i")}(o.ignoreErrors),ct.report.subscribe((function(){if(-1!==n.conf.collect_event_types.indexOf("error")){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];t._handleOnErrorStackInfo.apply(t,r)}})),o.captureUnhandledRejections&&this._attachPromiseRejectionHandler(n)}},{key:"_handleOnErrorStackInfo",value:function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};t.mechanism=t.mechanism||{type:"onerror",handled:!1,time:(new Date).getTime()},this._ignoreOnError||this._handleStackInfo(e,t)}},{key:"_handleStackInfo",value:function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},r=this._prepareFrames(e,t);this._processException(e.name,e.message,e.url,e.lineno,r,t)}},{key:"_prepareFrames",value:function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},r=this,n=[];if(e.stack&&e.stack.length&&(e.stack.forEach((function(t){var o=r._normalizeFrame(t,e.url);o&&n.push(o)})),t&&t.trimHeadFrames))for(var o=0;o<t.trimHeadFrames&&o<n.length;o++)n[o].in_app=!1;return n=n.slice(0,this._globalOptions.stackTraceLimit).filter((function(e){return e.in_app}))}},{key:"_normalizeFrame",value:function(e,t){var r={filename:e.url,lineno:e.line,colno:e.column,"function":e.func||"?"};return e.url||(r.filename=t),r.in_app=!/(StackTracer|TraceKit)\./.test(r["function"]),r}},{key:"_processException",value:function(e,t,r,n,o,a){var i=(e?"".concat(e,": "):"")+(t||"");if(!this._globalOptions.ignoreErrors.test||!this._globalOptions.ignoreErrors.test(t)&&!this._globalOptions.ignoreErrors.test(i)){var c;o&&o.length?(r=o[0].filename||r,o.reverse(),c={frames:o}):r&&(c={frames:[{lineno:n,filename:r,in_app:!0}]});var s=ut({exception:{values:[{value:t,type:e,stacktrace:c}]},transaction:r},a),u=s.exception.values[0];null==u.type&&""===u.value&&(u.value="Unrecoverable error caught"),!s.exception.mechanism&&s.mechanism&&(s.exception.mechanism=s.mechanism,delete s.mechanism),s.exception.mechanism=s.exception.mechanism||{},s.exception.mechanism=ut({type:"generic",handled:!0},s.exception.mechanism),this._errCallback(s)}}},{key:"_attachPromiseRejectionHandler",value:function(e){return this._promiseRejectionHandler=this._promiseRejectionHandler.bind(this,e),lt.addEventListener&<.addEventListener("unhandledrejection",this._promiseRejectionHandler),this}},{key:"_promiseRejectionHandler",value:function(e,t){if(-1!==e.conf.collect_event_types.indexOf("error")){var r=null;r=S(t.reason)?{message:t.reason}:t.reason,this.captureException(r,{mechanism:{type:"onunhandledrejection",handled:!1,time:(new Date).getTime()}})}}},{key:"captureException",value:function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(t=ut({trimHeadFrames:0},t),k(e)&&e.error)e=e.error;else{if(x(e)||E(e)){var r=e.name||(x(e)?"DOMError":"DOMException"),n=e.message?"".concat(r,": ").concat(e.message,"$"):r;return this.captureMessage(n,ut(ut({},t),{},{stacktrace:!0,trimHeadFrames:t.trimHeadFrames+1}))}if(!O(e))return}this._lastCapturedException=e;try{var o=ct.computeStackTrace(e);this._handleStackInfo(o,t)}catch(a){}return this}},{key:"captureMessage",value:function(e,t){if(!this._globalOptions.ignoreErrors.test||!this._globalOptions.ignoreErrors.test(e)){var r,n=ut({message:e+=""},t=t||{});try{throw new Error(e)}catch(c){r=c}r.name=null;var o=ct.computeStackTrace(r),a=_(o.stack)&&o.stack[1];if(a&&"StackTracer.captureException"===a.func&&(a=o.stack[2]),this._globalOptions.stacktrace||t.stacktrace||""===n.message){n.fingerprint=null==n.fingerprint?e:n.fingerprint,(t=ut({trimHeadFrames:0},t)).trimHeadFrames+=1;var i=this._prepareFrames(o,t);n.stacktrace={frames:i.reverse()}}return n.fingerprint&&(n.fingerprint=_(n.fingerprint)?n.fingerprint:[n.fingerprint]),this._errCallback(n),this}}}])&&et(t.prototype,r),n&&et(t,n),e}();o(dt,"getInstance",(ft=null,function(e){return ft||(ft=new dt(e)),ft}));var pt,gt,ht,mt,vt,yt,_t,wt,bt,Ot=(pt=window.innerWidth,gt=window.innerHeight,ht={},mt=function(e,t){var r={svg:2,img:2,canvas:4,object:4,embed:4,video:4},n=e.getBoundingClientRect(),o=n.width,a=n.height,i=n.left,c=n.top,s=1;(c>gt||c+a<0||i>pt||i+o<0)&&(s=0),e.__fast_scored__?s=0:e.__fast_scored__=1;var u=0,f="",l="",d=0;t.forEach((function(e){u+=e.st,e.src&&e.st>d&&(l=e.src,d=e.st)}));var p,g,h=r[B(e)]||1,m="";if("img"===B(e))m=e.getAttribute("src")||"";else if(1===h){var v=(p=e,g="backgroundImage",window.getComputedStyle?window.getComputedStyle(p)[g]:p.currentStyle?p.currentStyle[g]:null);if(v&&"initial"!==v){h=r.img;var y=v.match(/url\("(.*?)"\)/);y&&y[1]&&(m=y[1]||"")}}0!==m.indexOf("data:")&&0===m.indexOf("http")||(m=""),m&&(f=m);var _=o*a*h*s,w=[{node:e,st:_,weight:h}],b=function(e){var t=e.getBoundingClientRect(),r=t.left,n=t.right,o=t.top,a=t.bottom,i=t.width,c=t.height,s=n-r+(pt-0)-(Math.max(n,pt)-Math.min(r,0));if(s<=0)return 0;var u=a-o+(gt-0)-(Math.max(a,gt)-Math.min(o,0));return u<=0?0:s*u/(i*c)}(e);return(u>_*b||0===b)&&(_=u,w=[],f=l,t.forEach((function(e){w=w.concat(e.els)}))),f||(f=l),{src:f,dpss:t,st:_,els:w}},vt=function Pt(e){if(e&&-1==="script|style|meta|head|link".indexOf(B(e))){var t=[];if(e.children)for(var r=0;;r++){var n=e.children[r];if(!n)break;var o=Pt(n);o.st&&t.push(o)}return mt(e,t)}return{}},yt=function(){clearTimeout(ht.timer),ht.snapshots=[],ht.startTime=performance.now(),ht.lastResourceIndex=performance.getEntriesByType("resource").length-1},_t=function(e){e||yt(),ht.observer.observe(document,{childList:!0,subtree:!0})},wt=function(){ht.observer.disconnect()},bt=function(e){if(e.length>1){var t=performance.now()-ht.startTime;clearTimeout(ht.timer),ht.timer=setTimeout((function(){var e=function(e){for(var t=null,r=e.length,n=0;n<r;n++)(!t||!t.st||t.st<e[n].st)&&(t=e[n]);return t}(ht.snapshots);if(e){if(_(e.src)&&e.src.length>0){for(var t=performance.getEntriesByType("resource").slice(ht.lastResourceIndex+1),r={},n=t.length-1;n>=0;n--)r[t[n].name]=t[n];for(var o=e.src.length-1;o>=0;o--){var a=r[e.src[o]];a&&a.responseEnd>0&&e.start+e.duration<a.responseEnd&&(e.duration=a.responseEnd-e.start)}}var i=xe(e.lastIndex,e.duration,e.start,ht.zeroTime,[ht.confEndpoint]);ht.report(h[10],{__fastCurrPage__:e.currPage,g:{du:e.duration,res:i.resources}})}wt(),yt()}),2e3);var r=function(e,t,r,n){for(var o={mutations:e,lastIndex:n,duration:t,start:r,st:0,src:[],currPage:ht.getCurrPage()},a=e.length-1;a>-1;a--){var i=e[a];if(i.addedNodes)for(var c=i.addedNodes.length;c>-1;c--){var s=i.addedNodes[c],u=vt(s);u.st>=0&&(o.st=o.st>0?o.st+u.st:u.st),u.src&&-1===o.src.indexOf(u.src)&&o.src.push(u.src)}}return o}(e,t,ht.startTime,ht.lastResourceIndex);ht.snapshots.push(r),t>3e4&&wt()}},function(e){var t=window.MutationObserver||window.WebKitMutationObserver;return ht.observer&&ht.observer instanceof t||(ht.confEndpoint=e.conf.endpoint,ht.zeroTime=e.start_time,ht.startTime=performance.getEntriesByType("navigation")[0]&&performance.getEntriesByType("navigation")[0].responseEnd||0,ht.snapshots=[],ht.getCurrPage=function(){return{curr_title:e.curr_title,curr_hash:e.curr_hash,curr_search:e.curr_search,curr_href:e.curr_href}},ht.timer=0,ht.observer=new t(bt),ht.report=e.createLog,ht.lastResourceIndex=-1,ht.start=_t,ht.stop=wt,_t(!0)),ht}),kt=["log_store","conf"];function xt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xt(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var St=dt.getInstance(),jt=(new Date).getTime(),Tt=function(r,n){r||(r={});var o="fasttrackerinited",a="fastlogcreated",i=[];if(r.endpoint?S(r.endpoint)&&/^https?:\/\//.test(r.endpoint)?r.endpoint="/"===r.endpoint.slice(-1)?r.endpoint.slice(0,-1):r.endpoint:i.push("初始化参数endpoint[日志上报地址]不合法"):i.push("初始化参数endpoint[日志上报地址]必填"),r.accessKey&&S(r.accessKey)||i.push("初始化参数accessKey[日志上报密钥]必填"),i.length>0)return y({msg:i.join("\n")}),M();if(window[f]&&window[f].inited)return c(o,window[f]),window[f];if(window[l]&&window[l].inited)return c(o,window[l]),window[l];var s={},d=window,p=d.screen,m=d.navigator,v=ce.get("__tracker_user_id__")||localStorage.getItem("__tracker_user_id__")||Ae();de(v);var O,k,x=ce.get("__fast_sid__")||Ae();O=x,k={},document&&document.location&&document.location.hostname&&(k.domain=document.location.hostname.replace(/^[^.]+\.(.+)/,".$1")),ce.set("__fast_sid__",O,k);var E,j,T=K(),L={env:n||window.__fastTrackerLogEnv__||window.__fastTrackerEnv__||"prod",ins_id:Ae(),sid:x,start_time:jt,ts_counter:0,last_ts:null,conf:(E=r,j=je(E),ge(ge({},{enable:1,is_spa:!0,include_search:!1,log_content_attribute:"data-log",log_event_attribute:"data-event",log_module_attribute:"data-module",report_api_params:!1,api_ignore_urls:[],ignore_pages:[],api_url_regx:"",collect_event_types:["event","page","click","api","error","crash"],tenant_reader:{key:"",range:["url","localstorage","sessionstorage","cookie","window"]},real_user_reader:{key:"",range:["url","localstorage","sessionstorage","cookie","window"]},user_group_reader:{key:"",range:["url","localstorage","sessionstorage","cookie","window"]},app_version_reader:{key:"",range:["url","localstorage","sessionstorage","cookie","window"]},trace_config:{tid_type:"fast",rules:[],headers:[]},replay:{error:!1}}),j)),ha_inited:!1,log_store:[],page_enter:(new Date).getTime(),curr_title:T.curr_title,curr_hash:T.curr_hash,curr_search:T.curr_search,curr_href:T.curr_href,pg_loaded:0,curr_pgsted:0,curr_pid:Ae(),prev_page:J(null),ps_timer:0,api_timer:0,api_que:[],api_cache:{},api_perfCache:{},last_api:-1,last_resource:-1,regu_called:!1,last_sync:0,last_hi:0,send_timer:0,wfile_timer:0,last_sul:0,insertData:{cd:{},ahv:"",av:"",m:"",tn:"",ru:"",ug:""},static_base:{a:r.app||"",u:v,dsw:p.width,dsh:p.height,ua:m.userAgent,tv:"1.0.1-r18",tl:"javascript",at:""},hybrid_base:{},hybrid_rt:{}};window.cordova&&(L.static_base.at=g);var D,P,I,A=function(){L.static_base.at="miniprogram"===window.__wxjs_environment?"WeChat Mini Program":""};return/miniProgram/.test(L.static_base.ua)?L.static_base.at="WeChat Mini Program":window.WeixinJSBridge&&window.WeixinJSBridge.invoke?A():document.addEventListener("WeixinJSBridgeReady",A,!1),L.createLog=function(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;clearTimeout(L.send_timer);try{var o=null;r&&r.__fastCurrPage__&&r.__fastCurrPage__.curr_href&&(o=r.__fastCurrPage__,delete r.__fastCurrPage__);var i=H(o||L),s=i.href,f=!Se(L.conf.collect_event_types,e)&&!W(s,L.conf.ignore_pages);if(e===h[5]&&r&&(1===r.__fromReportError&&(f=!0),delete r.__fromReportError),f){var l=Te(L,o),d=Et(Et({e:e},l),r);switch(!d.m&&L.insertData.m&&(d.m=L.insertData.m),d.g&&w(d.g)||delete d.g,t(d.l)){case"string":try{d.l=w(JSON.parse(d.l))?JSON.parse(d.l):{msg:d.l}}catch(j){d.l=d.l?{msg:d.l}:null}break;case"number":case"boolean":case"symbol":d.l={msg:d.l};break;case"function":case"undefined":d.l=null;break;default:!w(d.l)&&d.l&&(d.l={msg:d.l})}d.l||delete d.l,e===h[2]?d.g=Le(d,s,L.static_base.at===g):e===h[4]&&(d.g.api=$(d.g.api),d.g.m=S(d.g.m)?d.g.m.toUpperCase():"GET"),d.t||(d.t=be(L)),L.insertData.cd&&w(L.insertData.cd)&&(w(d.l)?d.l=Et(Et({},L.insertData.cd),d.l):d.l=Et({},L.insertData.cd));var p=e===h[5];if(p&&w(L.rcdIns)&&b(L.rcdIns.caughtError))try{d.g.replay=L.rcdIns.caughtError()}catch(T){}if(c(a,Et(Et(Et(Et(Et({},L.static_base),L.hybrid_base),L.hybrid_rt),d),{},{env:L.env})),window.cordova){var m=(new Date).getTime();if(2===n||m-L.last_hi<(p?3e4:3e5))d["do"]=L.hybrid_rt["do"],d.nt=(L.hybrid_rt.nt||"").toUpperCase(),Pe(L,d,n);else{var v=window,_=v.MFastLog,O=function(e){d["do"]=e["do"],d.nt=e.nt.toUpperCase(),p&&(d.ram=e.ram,d.rom=e.rom),L.hybrid_rt={"do":d["do"],nt:d.nt,ram:e.ram,rom:e.rom},L.last_hi=m,Pe(L,d,n)};if(p&&w(_))_.getBasicInformation((function(e){O({ram:e.m_available_ram||"",rom:e.m_available_rom||"",nt:e.network||"","do":e.device_orientation||""})}));else{var k=window.navigator,x=window.screen,E={nt:"","do":""};k&&k.connection&&k.connection.type&&(E.nt=k.connection.type||""),x&&x.orientation&&x.orientation.type&&(E["do"]=x.orientation.type||""),O(Et(Et({},E),{},{ram:"",rom:""}))}}}else Pe(L,d,n)}}catch(T){y({msg:"探针内部异常createLog失败\n".concat(T.message)})}1===L.conf.enable&&(L.send_timer=setTimeout((function(){Pe(L,null,1)}),u))},Ve(L),fe(L),"function"==typeof performance.getEntriesByType&&(window.MutationObserver||window.WebKitMutationObserver)&&(L.fmpInstance=Ot(L)),s.registUser=function(e){if(w(e)&&e)try{e.tenant_code!==undefined&&(L.insertData.tn=e.tenant_code||""),e.user_account!==undefined&&(L.insertData.ru=e.user_account||""),e.user_group!==undefined&&(L.insertData.ug=e.user_group||""),L.regu_called=!0,Oe(L)}catch(t){y({msg:"探针API:registUser内部异常\n".concat(t.message)})}else y({msg:"探针API:registUser的参数必须是对象"})},s.setBasicInfo=function(e){if(w(e)&&e)try{var t=0;e.custom_data&&(w(e.custom_data)?(L.insertData.cd=e.custom_data,t=1):y({msg:"探针API:setBasicInfo参数中custom_data必须是对象"})),e.app_hotupdate_version&&(L.insertData.ahv=String(e.app_hotupdate_version),t=1),e.app_version&&(L.insertData.av=String(e.app_version),t=1),e.globalModule&&(L.insertData.m=String(e.globalModule),t=1),t&&Oe(L)}catch(r){y({msg:"探针API:setBasicInfo内部异常\n".concat(r.message)})}else y({msg:"探针API:setBasicInfo的参数必须是对象"})},s.report=function(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"",n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;if(S(e)&&e)if(e)try{var o=h.indexOf(e)>-1;o&&(y({msg:"参数eventName与内置事件重复,已增加user-defined-前缀"}),e="user-defined-".concat(e));var a={};(t||"number"==typeof t)&&(a.l=t),r&&S(r)&&(a.m=r),L.createLog(e,a,n)}catch(i){y({msg:"探针API:report内部异常\n".concat(i.message)})}else y({msg:"参数eventName必填"});else y({msg:"参数eventName必须是字符串"})},s.reportError=function(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";try{var n={__fromReportError:1};return"string"==typeof r&&r&&(n.module=r),w(t)?n.fast_extra_info=t:"string"==typeof t&&t&&(n.fast_extra_info={extra_info:t}),St.captureException.call(St,e,n),"ok"}catch(o){y({msg:"探针API:reportError内部异常\n".concat(o.message)})}},s.reportLoaded=function(){y({msg:"该方法已移除,天眼将自动记录页面加载时间"})},s.setEnable=function(e){1!==e&&0!==e||(L.conf.enable=e)},s.clearLogStore=function(){try{return L.log_store=[],le(L,[]),"ok"}catch(e){y({msg:"探针API:clearLogStore内部异常\n".concat(e.message)})}},s.printDebug=function(){try{var t=L.log_store,r=L.conf,n=e(L,kt),o=window.console;o.log("config: ",r),o.log("$self$: ",n),_(t)&&t.length>0&&o.log("log: ",t)}catch(a){y({msg:"探针API:printDebug内部异常\n".concat(a.message)})}},window[f]=s,window[l]=s,c(o,window[f]),Re(L),ee(L),Xe(L),St.init({confSource:L,callback:function(e){var t={g:{capturedTime:(new Date).getTime(),capturedType:"unknowType",exceptionType:"unkonwType",exceptionReason:"unkonwError",traceFrames:[]}};if(e){if(e.exception){if(e.exception.mechanism){var r=e.exception.mechanism||{};t.g.capturedTime=r.time||(new Date).getTime(),t.g.capturedType=r.type||"unknowType"}if(e.exception.values){var n=e.exception.values[0]||{};t.g.traceFrames=n.stacktrace&&n.stacktrace.frames||[],t.g.exceptionType=n.type||"unkonwType",t.g.exceptionReason=n.value||"unkonwError"}}else e.stacktrace&&_(e.stacktrace.frames)&&(t.g.traceFrames=e.stacktrace.frames,t.g.exceptionReason=e.message||"unkonwError");e.fast_extra_info&&(t.l={extraInfo:e.fast_extra_info}),e.module&&(t.m=e.module),1===e.__fromReportError&&(t.__fromReportError=1)}if(t.g.traceFrames.length){var o=t.g.traceFrames[t.g.traceFrames.length-1];if(1===t.g.traceFrames.length&&!window.cordova){if(1===o.colno&&1===o.lineno)return;if(!o.colno||!o.lineno)return}/fastTracker/i.test(o.filename)||L.createLog(h[5],t,1)}}}),window.MutationObserver&&w(L.conf.replay)&&L.conf.replay.accessKey&&(!0===L.conf.replay.error||!0===L.conf.replay.all)&&(b(window.$$fastRecord)?L.rcdIns=Qe(L):(P=function(){L.rcdIns=Qe(L)},I=0,(D=["https://mic-open.mypaas.com.cn/fast-tracker/release/browser/recordlib/tracker-record.min.js"]).forEach((function(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,document.getElementsByTagName("head")[0].appendChild(t),t.onload=function(){++I===D.length&&P()}})))),Object.getOwnPropertyNames(s).forEach((function(e){s[e].toString=F(e)})),s.inited=!0,window[f].inited=!0,window[l].inited=!0,s};window&&!window[f]&&(window[f]=M(),window[l]=window[f]),c("fasttrackerloaded",Tt);var Lt=Tt}(),n=n["default"]}()}));