@arms/rum-miniapp 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/miniapp-sdk.js +1 -1
- package/lib/collector/application/index.js +1 -1
- package/lib/collector/longtask/render-block.js +1 -1
- package/lib/collector/resource/api.js +1 -1
- package/lib/collector/view/pv.js +1 -1
- package/lib/configManager.js +2 -2
- package/lib/index.js +1 -1
- package/lib/reporter/index.js +1 -1
- package/lib/shell.js +1 -1
- package/lib/utils/platform.d.ts +1 -0
- package/lib/utils/platform.js +1 -1
- package/package.json +1 -1
package/dist/miniapp-sdk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function t(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.RumSDK=n():e.RumSDK=n()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./dist/",n(n.s=17)}([function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function t(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Shell=e.Reporter=e.Context=e.Client=void 0;var i=n(8);e.Client=i.default;var a=n(10);e.Context=a.default;var u=n(21);e.Reporter=u.default;var c=n(23);e.Shell=c.default,o(n(24),e),o(n(9),e),o(n(25),e),o(n(26),e),o(n(27),e),o(n(7),e),o(n(28),e),o(n(29),e),o(n(13),e),o(n(14),e),o(n(2),e),o(n(30),e),o(n(15),e),o(n(31),e),o(n(11),e),o(n(12),e)},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o;Object.defineProperty(e,"__esModule",{value:!0}),e.HEADER_KEY=e.getPerformance=e.setStorageSync=e.getStorageSync=e.appName=e.sdk=e.ksName=e.jdName=e.swanName=e.alipayName=e.dingtalkName=e.wechatName=e.bytedanceName=e.qqName=e.VERSION=void 0,e.VERSION="cdn-0.1.2";var i="object";function a(t){return"function"==typeof t}function u(){var t,n="unknown";if(("undefined"==typeof ks?"undefined":r(ks))===i)t=ks,n=e.ksName;else if(("undefined"==typeof swan?"undefined":r(swan))===i)t=swan,n=e.swanName;else if(("undefined"==typeof qq?"undefined":r(qq))===i)t=qq,n=e.qqName;else if(("undefined"==typeof tt?"undefined":r(tt))===i)t=tt,n=e.bytedanceName;else if(("undefined"==typeof dd?"undefined":r(dd))===i)t=dd,n=e.dingtalkName;else if(("undefined"==typeof my?"undefined":r(my))===i)t=my,n=e.alipayName;else if(("undefined"==typeof jd?"undefined":r(jd))===i)t=jd,n=e.jdName;else{if(("undefined"==typeof wx?"undefined":r(wx))!==i)throw new Error("Current platform is not supported.");t=wx,n=e.wechatName}return{sdk:t,appName:n}}function c(t){return a(e.sdk.getStorageSync)?e.appName===e.alipayName||e.appName===e.dingtalkName?e.sdk.getStorageSync({key:t}).data:e.sdk.getStorageSync(t):void 0}function s(t,n){return a(e.sdk.getStorageSync)?e.appName===e.alipayName||e.appName===e.dingtalkName?e.sdk.setStorageSync({key:t,data:n}):e.sdk.setStorageSync(t,n):void 0}function f(){return a(e.sdk.getPerformance)?e.sdk.getPerformance():"performance"in e.sdk?e.sdk.performance:void 0}e.qqName="qq",e.bytedanceName="bytedance",e.wechatName="wechat",e.dingtalkName="dingtalk",e.alipayName="alipay",e.swanName="swan",e.jdName="jd",e.ksName="ks",o=u(),e.sdk=o.sdk,e.appName=o.appName,e.getStorageSync=c,e.setStorageSync=s,e.getPerformance=f,e.HEADER_KEY=function(){switch(e.appName){case"alipay":return"headers";default:return"header"}}(),e.default=e.sdk},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return r(t)===e}Object.defineProperty(e,"__esModule",{value:!0}),e.isZero=e.isObject=e.isNull=e.isNumber=e.isBoolean=e.isRegExp=e.isArray=e.isToString=e.isString=e.isFunction=e.isTypeof=void 0,e.isTypeof=o;var i=function t(e){return"function"==typeof e};function a(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")}function u(){for(var t=0;t<arguments.length;t++)if(0!==(t<0||arguments.length<=t?void 0:arguments[t]))return!1;return!0}e.isFunction=i,e.isString=function(t){return o(t,"string")},e.isToString=a,e.isArray=function(t){return a(t,"Array")},e.isRegExp=function(t){return a(t,"RegExp")},e.isBoolean=function(t){return o(t,"boolean")},e.isNumber=function(t){return o(t,"number")&&!isNaN(t)||o(t,"bigint")},e.isNull=function(t){return null===t},e.isObject=function(t){return!(0,e.isNull)(t)&&o(t,"object")},e.isZero=u},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),u=new y(r||[]);return w(a,"_invoke",{value:f(t,n,u)}),a}function n(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function a(){}function u(){}function c(e){["next","throw","return"].forEach((function(n){t(e,n,(function(t){return this._invoke(n,t)}))}))}function s(t,e){function o(i,a,u,c){var s=n(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function f(t,e,r){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=l(u,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(t,e,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(t,e){var r=e.method,o=t.iterator[r];if(o===d)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=n(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function y(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function v(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}o=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(t,e,n){t[e]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",j=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,n){return t[e]=n}}m.wrap=e;var _={},x={};t(x,O,(function(){return this}));var P=Object.getPrototypeOf,k=P&&P(P(v([])));k&&k!==g&&b.call(k,O)&&(x=k);var T=u.prototype=i.prototype=Object.create(x);return a.prototype=u,w(T,"constructor",{value:u,configurable:!0}),w(u,"constructor",{value:a,configurable:!0}),a.displayName=t(u,j,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},m.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,t(e,j,"GeneratorFunction")),e.prototype=Object.create(T),e},m.awrap=function(t){return{__await:t}},c(s.prototype),t(s.prototype,S,(function(){return this})),m.AsyncIterator=s,m.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new s(e(t,n,r,o),i);return m.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},c(T),t(T,j,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),m.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},m.values=v,y.prototype={constructor:y,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=d),_}},m}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}function u(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:e+""}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function f(t,e,n){return e=y(e),l(t,h()?Reflect.construct(e,n||[],y(t).constructor):e.apply(t,n))}function l(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return p(t)}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function d(t,e){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var m=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.checkEnable=void 0;var g=n(0),b=n(1),w="arms_rum2_local_config";function E(t){var e,n,r,o,i={};i.enable=null===(e=t.enable)||void 0===e||e;var a=t.session;if(a){var u={};u.sampleRate=(null!==(n=a.sampling)&&void 0!==n?n:100)/100,u.storage=null!==(r=a.storage)&&void 0!==r?r:"auto",i.sessionConfig=u}var c=t.report;if(c){var s={};s.flushTime=c.flush_interval,s.maxEventCount=c.max_batch_count,i.reportConfig=s}var f=t.tracing;if(f){var l={enable:null===(o=f.enable)||void 0===o||o},p=[];(f.rules||[]).forEach((function(t){var e={enable:t.enable,tracestate:t.tracestate,baggage:t.baggage,propagatorTypes:t.protocols,sampling:t.sampling};return"{location.origin}"===t.match?void(l=Object.assign(Object.assign({},l),e)):(e.match=(0,g.parseRule2Match)(t),void p.push(e))})),l.allowedUrls=p,i.tracing=l}var h=t.collectors;if(h&&0<Object.keys(h).length){var y={};h.forEach((function(t){var e=t.name;if(e){var n=Object.assign({},t),r=t.filters;0<(null==r?void 0:r.length)&&(n.filters=n.filters.map((function(t){return(0,g.parseRule2Match)(t)}))),y[e]=n}})),i.collectors=Object.assign(Object.assign({},i.collectors),y)}return i}var O=function(t){function e(){var t;return i(this,e),(t=f(this,e,arguments)).version="v2",t}return v(e,t),u(e,[{key:"fetchRemoteCfg",value:function t(e){return m(this,void 0,void 0,o().mark((function t(){var e;return o().wrap((function t(n){for(;;)switch(n.prev=n.next){case 0:if(e=this.getRemoteConfigUrl()){n.next=3;break}return n.abrupt("return");case 3:if(!e.includes(".rum.aliyuncs.com")){n.next=6;break}return this.version="v1",n.abrupt("return",this.getV1Config(e));case 6:return n.abrupt("return",this.getV2Config(e));case 7:case"end":return n.stop()}}),t,this)})))}},{key:"getV1Config",value:function t(e){return m(this,void 0,void 0,o().mark((function t(){return o().wrap((function t(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(t,n){var r;(b.default.request||b.default.httpRequest)({url:e,method:"GET",success:function e(n){t(n)},fail:function t(e){n(e)}})})));case 1:case"end":return n.stop()}}),t)})))}},{key:"getV2Config",value:function t(e){return m(this,void 0,void 0,o().mark((function t(){var n,r;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:return n=(0,g.getUrlParams)(e),r={instanceId:"",agentType:"rum_web_sdk",attributes:n,instanceConfigs:[{configType:"rum_web_config",version:1}],capabilities:2},o.abrupt("return",new Promise((function(t,n){var o;(b.default.request||b.default.httpRequest)({url:e,method:"POST",data:JSON.stringify(r),header:{"Content-Type":"application/json","x-log-apiversion":"0.6.0"},success:function e(n){t(n)},fail:function t(e){n(e)}})})));case 3:case"end":return o.stop()}}),t)})))}},{key:"getCacheConfig",value:function t(){var e=(0,b.getStorageSync)(w);if(e){var n,r=this.currentConfig;try{if("pid"in(n=JSON.parse(e))&&n.pid===r.pid||"endpoint"in n&&n.endpoint)return n}catch(t){}return n}}},{key:"setCacheConfig",value:function t(e){var n=this.currentConfig,r=Object.assign(Object.assign({},e),{pid:n.pid,endpoint:n.endpoint});(0,b.setStorageSync)(w,JSON.stringify(r))}},{key:"getRemoteConfigUrl",value:function t(){var e=this.currentConfig,n=e.pid,r,o=e.remoteConfig||{},i=o.url,a=o.region;if(i)return i;if(n){var u=n.split("@");return!u||2>u.length?void 0:"https://".concat(u[0],"-sdk.rum.aliyuncs.com/config/").concat(a||"cn-hangzhou","/").concat(u[1],"?t=").concat(Date.now())}}},{key:"parseConfig",value:function t(e){try{return"v2"===this.version?E(JSON.parse(e.instanceConfigs[0].config)):e}catch(t){return e}}}])}(g.ConfigManager);function S(t,e){var n,r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],o=t.getConfig();if(!1===o.enable)return!1;var i=null===(n=o.collectors)||void 0===n?void 0:n[e];return(0,g.isBoolean)(i)?i:(0,g.isObject)(i)&&"enable"in i?i.enable:r}e.default=O,e.checkEnable=S},function(t,e,n){"use strict";function r(){if("function"==typeof getCurrentPages)try{var t=getCurrentPages()||[];return t[t.length-1]}catch(t){console.warn("[arms] error in getCurView",t)}}function o(t){if(t){var e=t.getViews();if(e&&e.length)return e[e.length-1]}}function i(t,n){return t?t[e.PAGE_ID]?t[e.PAGE_ID]:n?t[e.PAGE_ID]=n.getViewId():void 0:void 0}function a(t,e){return t&&e?e.getViews().find((function(e){return e.id===t})):void 0}Object.defineProperty(e,"__esModule",{value:!0}),e.getViewById=e.getRumViewId=e.getCurView=e.getCurPage=e.PAGE_ID=void 0,e.PAGE_ID="__rum_view_id",e.getCurPage=r,e.getCurView=o,e.getRumViewId=i,e.getViewById=a},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){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 i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.removePageListener=e.addPageListener=e.originalPage=void 0;var s=n(0),f=n(1),l=n(16),p={onLoad:[],onShow:[],onHide:[],onUnload:[],"*":[]},h=["onLoad","onShow","onReady","onHide","onUnload","onPullDownRefresh","onReachBottom","onShareAppMessage","onShareTimeline","onAddToFavorites","onPageScroll","onResize","onTabItemTap","onSaveExitState"];function y(t){Object.keys(t).forEach((function(e){var n=t[e];!(0,s.isFunction)(n)||h.includes(e)||e in p||(p[e]=[])})),Object.keys(p).forEach((function(e){"swan"===f.appName&&Object.defineProperty(t,e,{writable:!0}),"*"===e||(0,s.interceptFunction)(t,e,(function(){for(var t=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=[].concat(r(p[e]),r(p["*"]));a.forEach((function(e){e.apply(t,o)}))}),!0)}))}function v(t,e){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];n||(0,l.addComponentListener)(t,e),t in p||(p[t]=[]),p[t].push(e)}function d(t,e){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];if(n||(0,l.removeComponentListener)(t,e),t in p){var r=p[t],o=r.indexOf(e);r.splice(o,1)}}e.originalPage=Page,Page=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];try{y.apply(this,n)}catch(t){}return e.originalPage.apply(this,n)},Object.keys(e.originalPage).forEach((function(t){Page[t]=e.originalPage[t]})),e.addPageListener=v,e.removePageListener=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCurrentTime=e.formatNumber=void 0;var r=n(1);function o(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:3;if(!t)return t;var n=t.toString(),r=n.indexOf(".");return n=-1===r?n.substring(0):n.substring(0,e+r+1),parseFloat(n)}function i(t){var e=(0,r.getPerformance)(),n=0;return e&&e.timeOrigin&&e.now&&(n=Math.round(e.timeOrigin+(t||e.now()))),1e12>n&&(n=(new Date).getTime()),n}e.formatNumber=o,e.getCurrentTime=i},function(t,e,n){"use strict";var r,o,i;Object.defineProperty(e,"__esModule",{value:!0}),e.AppType=e.ResourceStatus=e.RumEventType=void 0,function(t){t.VIEW="view",t.RESOURCE="resource",t.EXCEPTION="exception",t.LONG_TASK="longTask",t.ACTION="action",t.CUSTOM="custom",t.APPLICATION="application"}(r=e.RumEventType||(e.RumEventType={})),function(t){t[t.Unknown=-1]="Unknown",t[t.Failed=0]="Failed",t[t.Success=1]="Success"}(o=e.ResourceStatus||(e.ResourceStatus={})),function(t){t.browser="browser",t.miniapp="miniapp",t.minigame="minigame",t.uniapp="uniapp",t.reactnative="reactnative"}(i=e.AppType||(e.AppType={}))},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=i(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function t(){};return{s:o,n:function e(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function t(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,u=!0,c=!1;return{s:function e(){n=n.call(t)},n:function t(){var e=n.next();return u=e.done,e},e:function t(e){c=!0,a=e},f:function t(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,f(r.key),r)}}function s(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t){var e=l(t,"string");return"symbol"==r(e)?e:e+""}function l(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var p=n(9),h=n(20),y=n(10),v=n(2),d=function(){function t(){var e=this;u(this,t),this.emitter=new h.EventEmitter,this.sendEvent=function(t){e.emitter.emit(p.EventType.collect,t)}}return s(t,[{key:"init",value:function t(e,n,r){var i=this;this.ctx=new y.default(e,n,r);var a=this.ctx,u=this.collectors,c=this.processors,s=this.reporter;c.forEach((function(t){(0,v.isFunction)(t.setup)&&t.setup(a)})),this.emitter.on(p.EventType.collect,(function(t){a.setRumEvent(t);var e=o(c),n;try{for(e.s();!(n=e.n()).done;){var r=n.value;if(r.match||(r.match=function(){return!0}),r.match(a)){var i=r.process(a);i&&a.setRumEvent(i)}}}catch(t){e.e(t)}finally{e.f()}s.report(a)})),u.forEach((function(t){t.setup(a,i.sendEvent)}))}},{key:"setContext",value:function t(e){this.ctx=e}},{key:"getContext",value:function t(){return this.ctx}},{key:"useCollectors",value:function t(e){this.collectors=e}},{key:"getCollectors",value:function t(){return this.collectors}},{key:"useProcessors",value:function t(e){this.processors=e}},{key:"useReporter",value:function t(e){this.reporter=e}}])}();e.default=d},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EventType=void 0,function(t){t.collect="collect"}(r=e.EventType||(e.EventType={}))},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(e,n,r){o(this,t),this.config=e,this.views=[],n&&(this.session=n,this.session.init(this)),r&&(this.configManager=r)}return a(t,[{key:"getConfig",value:function t(){return this.configManager?this.configManager.getConfig():this.config}},{key:"setConfig",value:function t(e){this.configManager?this.configManager.setConfig(e):this.config=e}},{key:"getViews",value:function t(){return this.views}},{key:"addView",value:function t(e){var n=this.views.findIndex((function(t){return t.id===e.id}));n>=0&&this.views.splice(n,1),this.views.push(e)}},{key:"removeView",value:function t(e){this.views=this.views.filter((function(t){return t.id!==e}))}},{key:"getRumEvent",value:function t(){return this.rumEvent}},{key:"setRumEvent",value:function t(e){this.rumEvent=e}}])}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.verifyProperties=void 0;var r=n(2);function o(t){if((0,r.isObject)(t)){var e=Object.assign({},t);Object.keys(e).forEach((function(t){var n=e[t];if(t.length>50){var o=t.substring(0,50);e[o]=n,delete e[t],t=o}(0,r.isString)(n)||(0,r.isNumber)(n)?(0,r.isString)(n)&&n.length>2e3&&(e[t]=n.substring(0,2e3)):delete e[t]}));var n=Object.keys(e);if(n.length)return n.length>20&&n.forEach((function(t,n){n>19&&delete e[t]})),e}}e.verifyProperties=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getUrlParams=void 0;var r=function t(e){if(0===e.length)return"";try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e.replace(/\+/g," ").replace(/%20/g," ").replace(/%2F/g,"/").replace(/%3D/g,"=").replace(/%26/g,"&").replace(/%3F/g,"?")}},o=function t(e){if(0===e.length)return"";var n=e.indexOf("#"),r=n>=0?e.slice(0,n):e,o=r.indexOf("?");return-1===o?"":r.slice(o+1)};function i(t){if("string"!=typeof t||!t.trim())return{};var e={},n=o(t);if(!n)return e;for(var i=n.split("&"),a=0;a<i.length;a++){var u=i[a];if(u){var c=u.indexOf("=");if(!(c<=0)){var s=r(u.slice(0,c)),f=c<u.length-1?r(u.slice(c+1)):"",l=e[s];void 0!==l?Array.isArray(l)?l.push(f):e[s]=[l,f]:e[s]=f}}}return e}e.getUrlParams=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseRegExpString=e.transStrToReg=e.getType=e.delay=e.debounce=e.generateEventId=e.generateSpanId=e.generateTraceId=e.generateGUID=e.restoreFunction=e.interceptFunction=void 0;var r=n(2),o=/^\[object ([a-z]*)\]$/;function i(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=t[e],a=function e(){for(var a=o?this:t,u=arguments.length,c=new Array(u),s=0;s<u;s++)c[s]=arguments[s];if(n.apply(a,c),(0,r.isFunction)(i))return i.apply(a,c)};a._rum_intercepted=i,t[e]=a}function a(t,e){var n=t[e];if(!(0,r.isFunction)(n)){var o=n._rum_intercepted;(0,r.isFunction)(o)||(t[e]=o)}}function u(){var t="";try{if(crypto&&crypto.randomUUID)t=crypto.randomUUID();else if(crypto&&crypto.getRandomValues){var e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128,t=e.reduce((function(t,e){return t+e.toString(16).padStart(2,"0")}),"").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/,"$1-$2-$3-$4-$5")}}catch(e){t=""}return t||(t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0,n;return("x"==t?e:3&e|8).toString(16)}))),t}function c(){var t=u().replace(/-/g,"");return"0"===t[0]&&(t="1"+t.substring(1)),"0"===t[16]&&(t=t.substring(0,16)+"1"+t.substring(17)),t}function s(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n="",r=0;r<t;r++)n+=Math.floor(Math.random()*e).toString(e);return n}function f(t){var e=s();return"00-".concat(t,"-").concat(e)}function l(t,e){var n;if((0,r.isFunction)(t))return function(){var r=this,o=arguments;n&&clearTimeout(n),n=setTimeout((function(){t.apply(r,o)}),e)}}function p(t,e){if((0,r.isFunction)(t)){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return setTimeout.apply(void 0,[t,+e||0].concat(o))}}function h(t){var e=Object.prototype.toString.call(t),n=(e=e.toLowerCase()||"").match(o);return null==n?void 0:n[1]}function y(t){return"string"!==h(t)?t:t.length>2&&"/"===t[0]&&"/"===t[t.length-1]?new RegExp(t.substr(1,t.length-2)):t}function v(t){if("string"!=typeof t)throw new TypeError("input must be a string");if(t.length>2&&"/"===t[0]){var e=t.lastIndexOf("/");if(e>0){var n=t.substring(1,e),r=t.substring(e+1);return new RegExp(n,r)}return new RegExp(t.substring(1,t.length-1))}return new RegExp(t)}e.interceptFunction=i,e.restoreFunction=a,e.generateGUID=u,e.generateTraceId=c,e.generateSpanId=s,e.generateEventId=f,e.debounce=l,e.delay=p,e.getType=h,e.transStrToReg=y,e.parseRegExpString=v},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<t.length;n+=1){var r=t[n];if(e(r,n))return r}}function o(t,e){return t.slice(0,e.length)===e}function i(t,e){return t.slice(-e.length)===e}function a(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.forEach((function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})),t}Object.defineProperty(e,"__esModule",{value:!0}),e.assign=e.endsWith=e.startsWith=e.find=void 0,e.find=r,e.startsWith=o,e.endsWith=i,e.assign=a},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){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 i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.parseRule2Match=e.urlMatch=e.matchList=e.isMatchOption=void 0;var s=n(2),f=n(14),l=n(13);function p(t){return(0,s.isString)(t)||(0,s.isFunction)(t)||(0,s.isRegExp)(t)}function h(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0;return t.some((function(t){try{if("function"==typeof t)return t(e,r);if(t instanceof RegExp)return t.test(e);if("string"==typeof t)return n?(0,f.startsWith)(e,t):t===e}catch(t){}return!1}))}function y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{(0,s.isArray)(e)||(e=[e]);var n=[/^(https?:)?\/\/.*rum|retcode|log-global|log\.aliyuncs\.com/,/^(https?:)?\/\/.*\.mmstat\.com/,/^(https?:)?\/\/.*hm\.baidu\.com/,/^(https?:)?\/\/.*google-analytics\.com/,/data:(.+?)(;base64)?,(.+)$/].concat(r(e));return h(n,t)}catch(t){return!1}}function v(t){if(p(t))return t;var e;switch(t.match_exp){case"equals":e=function e(n){return n===t.match};break;case"not_equals":e=function e(n){return n!==t.match};break;case"regex":e=(0,l.parseRegExpString)(t.match);break;case"includes":e=function e(n){return n.includes(t.match)};break;case"starts_with":default:e=function e(n){return(0,f.startsWith)(n,t.match)}}return e}e.isMatchOption=p,e.matchList=h,e.urlMatch=y,e.parseRule2Match=v},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){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 i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.removeComponentListener=e.addComponentListener=e.originalComponent=void 0;var s=n(0),f=n(1),l=new Map;["methods","lifetimes"].forEach((function(t){l.set(t,{})}));var p=["created","attached","ready","moved","detached","error"],h=["onShow","onHide","onPullDownRefresh","onReachBottom","onShareAppMessage","onShareTimeline","onAddToFavorites","onPageScroll","onResize","onTabItemTap","onSaveExitState"].concat(p);function y(t,e){var n=l.get(e);Object.keys(t).forEach((function(e){var r=t[e];!(0,s.isFunction)(r)||h.includes(e)||e in n||(n[e]=[])})),Object.keys(n).forEach((function(o){var i=t;"swan"===f.appName&&Object.defineProperty(i,o,{writable:!0}),"*"===o||("lifetimes"===e&&!(0,s.isFunction)(i[o])&&(!i.lifetimes&&(i.lifetimes={}),i=i.lifetimes),(0,s.interceptFunction)(i,o,(function(){for(var t=this,e=arguments.length,i=Array(e),a=0;a<e;a++)i[a]=arguments[a];var u=[].concat(r(n[o]),r(n["*"]||[]));u.forEach((function(e){e.apply(t,i)}))}),!0))}))}function v(t,e){var n;t in(n=p.includes(t)?l.get("lifetimes"):l.get("methods"))||(n[t]=[]),n[t].push(e)}function d(t,e){var n;if(t in(n=p.includes(t)?l.get("lifetimes"):l.get("methods"))){var r=n[t],o=r.indexOf(e);r.splice(o,1)}}e.originalComponent=Component,Component=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];try{var o=n[0]||{};o.methods||(o.methods={}),o.lifetimes||(o.lifetimes={}),y.call(this,o.methods,"methods"),y.call(this,o,"lifetimes")}catch(t){}return e.originalComponent.apply(this,n)},Object.keys(e.originalComponent).forEach((function(t){Component[t]=e.originalComponent[t]})),e.addComponentListener=v,e.removeComponentListener=d},function(t,e,n){t.exports=n(18)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArmsRum=void 0;var r=n(19);Object.defineProperty(e,"ArmsRum",{enumerable:!0,get:function(){return r.ArmsRum}}),e.default=r.default},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,n){return(e=s(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),u=new y(r||[]);return w(a,"_invoke",{value:f(t,n,u)}),a}function n(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function a(){}function u(){}function c(e){["next","throw","return"].forEach((function(n){t(e,n,(function(t){return this._invoke(n,t)}))}))}function s(t,e){function o(i,a,u,c){var s=n(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function f(t,e,r){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=l(u,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(t,e,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(t,e){var r=e.method,o=t.iterator[r];if(o===d)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=n(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function y(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function v(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}i=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(t,e,n){t[e]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",j=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,n){return t[e]=n}}m.wrap=e;var _={},x={};t(x,O,(function(){return this}));var P=Object.getPrototypeOf,k=P&&P(P(v([])));k&&k!==g&&b.call(k,O)&&(x=k);var T=u.prototype=o.prototype=Object.create(x);return a.prototype=u,w(T,"constructor",{value:u,configurable:!0}),w(u,"constructor",{value:a,configurable:!0}),a.displayName=t(u,j,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},m.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,t(e,j,"GeneratorFunction")),e.prototype=Object.create(T),e},m.awrap=function(t){return{__await:t}},c(s.prototype),t(s.prototype,S,(function(){return this})),m.AsyncIterator=s,m.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new s(e(t,n,r,o),i);return m.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},c(T),t(T,j,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),m.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},m.values=v,y.prototype={constructor:y,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=d),_}},m}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}function c(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=f(t,"string");return"symbol"==r(e)?e:e+""}function f(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function l(t,e,n){return e=v(e),p(t,y()?Reflect.construct(e,n||[],v(t).constructor):e.apply(t,n))}function p(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(y=function(){return!!t})()}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m(t,e)}function m(t,e){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var g=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ArmsRum=void 0;var b=n(0),w=n(32),E=n(33),O=n(35),S=n(37),j=n(40),_=n(41),x=n(42),P=n(43),k=n(44),T=n(45),C=n(46),L=n(1),N=n(47),I=n(3),R=[w.default,E.default,O.default,S.default,j.default,_.default,x.default],A=function(t){function e(){var t;return a(this,e),(t=l(this,e,arguments)).version=L.VERSION,t.updateNetType=function(e){var n=t.getConfig().net||{};t.setConfig("net",Object.assign(Object.assign({},n),{type:e}))},t}return d(e,t),c(e,[{key:"init",value:function t(e){return g(this,void 0,void 0,i().mark((function t(){var n;return i().wrap((function t(r){for(;;)switch(r.prev=r.next){case 0:return this.configManager=new I.default,r.next=3,this.configManager.init(e);case 3:if(!1!==(n=this.configManager.getConfig()).enable){r.next=6;break}return r.abrupt("return");case 6:return this.client.useCollectors(R.map((function(t){return new t}))),this.client.useProcessors([new P.default,new k.default]),this.client.useReporter(new T.default),this.client.init(n,new N.RumSession,this.configManager),(0,C.getNetType)(this.updateNetType),r.abrupt("return",this);case 12:case"end":return r.stop()}}),t,this)})))}},{key:"getConfig",value:function t(){var e;return null===(e=this.configManager)||void 0===e?void 0:e.getConfig()}},{key:"setConfig",value:function t(){var e=this.configManager;if(e)if(2===arguments.length){var n=e.getConfig();e.setConfig(Object.assign(Object.assign({},n),o({},0>=arguments.length?void 0:arguments[0],1>=arguments.length?void 0:arguments[1])))}else e.setConfig(0>=arguments.length?void 0:arguments[0])}},{key:"getCollector",value:function t(e){return this.client.getCollectors().find((function(t){return t.name===e}))}}])}(b.Shell);e.ArmsRum=A,e.default=new A},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.EventEmitter=void 0;var s=function(){function t(){o(this,t),this.events={}}return a(t,[{key:"on",value:function t(e,n){this.events[e]||(this.events[e]=[]),this.events[e].push(n)}},{key:"emit",value:function t(e){var n=this.events[e];if(n){for(var r=n.slice(),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];for(var u=0;u<r.length;u++)try{r[u].apply(r,i)}catch(t){console.error('Error in handler for "'.concat(e,'":'),t)}}}},{key:"off",value:function t(e,n){var r=this.events[e];if(r)if(n){for(var o=r.length;o--;)r[o]===n&&r.splice(o,1);0===r.length&&delete this.events[e]}else delete this.events[e]}},{key:"once",value:function t(e,n){var r=this,o=function t(){r.off(e,o),n.apply(void 0,arguments)};this.on(e,o)}}])}();e.EventEmitter=s},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function t(){return e};var t,e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function t(e,n,r){return e[n]=r}}function p(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new N(r||[]);return a(i,"_invoke",{value:k(t,n,u)}),i}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function E(){}var O={};l(O,c,(function(){return this}));var S=Object.getPrototypeOf,j=S&&S(S(I([])));j&&j!==n&&i.call(j,c)&&(O=j);var _=E.prototype=b.prototype=Object.create(O);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function n(o,a,u,c){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function t(r,i){function a(){return new e((function(t,e){n(r,i,t,e)}))}return o=o?o.then(a,a):a()}})}function k(e,n,r){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=T(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===y)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?m:v,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(i.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=E,a(_,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},x(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new P(p(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(_),l(_,f,"Generator"),l(_,c,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function e(n){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(L),!n)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function o(e,o){return c.type="throw",c.arg=n,r.next=e,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],c=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var s=i.call(u,"catchLoc"),f=i.call(u,"finallyLoc");if(s&&f){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function t(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(u)},complete:function t(e,n){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&&n&&(this.next=n),g},finish:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var i=o.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function e(n,r,o){return this.delegate={iterator:I(n),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),g}},e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function u(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:e+""}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});var l=n(7),p=n(22),h=n(2),y=n(11),v=n(12),d=3e3,m=20,g=["app","user","device","os","geo","isp","net","properties"],b=function(){function t(){i(this,t),this.name="reporter",this.eventQueue=[],this._init=!1}return u(t,[{key:"getReportCfg",value:function t(){var e=this.ctx.getConfig().reportConfig;return(0,h.isObject)(e)||(e={}),(!e.flushTime||e.flushTime<0||e.flushTime>1e4)&&(e.flushTime=3e3),(!e.maxEventCount||e.maxEventCount<1||e.maxEventCount>100)&&(e.maxEventCount=20),e}},{key:"report",value:function t(e){var n=this;this.ctx=e,this._init||(this.init(e),this._init=!0),clearTimeout(this.timer),this.pushToQueue();var r=this.getReportCfg();this.eventQueue.length>=r.maxEventCount?this.flushEventQueue():this.timer=setTimeout((function(){n.flushEventQueue()}),r.flushTime)}},{key:"pushToQueue",value:function t(){var e=this.ctx,n=this.eventQueue,r=e.getRumEvent();if(r.event_type===l.RumEventType.EXCEPTION){var o=r.message,i=r.stack,a=(0,p.getErrorID)({message:o,stack:i}),u=this.eventQueue.find((function(t){if(t.event_type===l.RumEventType.EXCEPTION){var e=t.message,n=t.stack;return(0,p.getErrorID)({message:e,stack:n})===a}}));if(u)return void u.times++}if(r.event_type===l.RumEventType.ACTION){var c=r.target_name,s=this.eventQueue.find((function(t){if(t.event_type===l.RumEventType.ACTION)return c===t.target_name}));if(s)return void s.times++}n.push(r)}},{key:"flushEventQueue",value:function t(){var e=this.ctx,n=this.eventQueue;if(n.length){var r=e.getViews(),o=r[r.length-1];r.forEach((function(t){var e;t.id===o.id&&n.filter((function(e){var n;return(null===(n=e.view)||void 0===n?void 0:n.id)===t.id})).forEach((function(t){delete t.view}))}));var i=e.session,a;(!i||i.getSampled())&&this.mergeEvent(e,n,o),this.eventQueue=[]}}},{key:"mergeEvent",value:function t(e,n,r){for(var o=e.getConfig(),i=e.session,a=i.getSessionId(),u=0;u<n.length;u++){var c=n[u];c.session_id===a?delete c.session_id:(n.splice(u,1),u--)}if(0!==n.length){var s=(0,v.getUrlParams)(o.endpoint),f=Object.assign({app:{id:o.pid,env:o.env||"prod",version:o.version,type:""},user:{id:i.getUserId()},session:{id:a},net:{},view:r,events:n},s);g.forEach((function(t){var e=o[t];(0,h.isObject)(e)&&Object.keys(e).forEach((function(n){var r=e[n];"user"===t&&"id"===n||("properties"===t?f[t]=(0,y.verifyProperties)(e):((0,h.isString)(r)||(0,h.isNumber)(r))&&(t in f||(f[t]={}),f[t][n]=r))}))})),("function"!=typeof o.beforeReport||(f=o.beforeReport(f)))&&this.tryRequest(f)}}},{key:"tryRequest",value:function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r,i,a;return f(this,void 0,void 0,o().mark((function t(){var u=this,c,s,f;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:return c=null===(r=this.ctx.getConfig())||void 0===r?void 0:r.reportConfig,s=null!==(i=null==c?void 0:c.maxRetryCount)&&void 0!==i?i:0,f=null!==(a=null==c?void 0:c.retryDelay)&&void 0!==a?a:3e3,o.prev=3,e._retry=n,o.next=7,this.request(this.ctx,e);case 7:o.next=12;break;case 9:o.prev=9,o.t0=o.catch(3),n<s-1&&setTimeout((function(){return u.tryRequest(e,n+1)}),f);case 12:case"end":return o.stop()}}),t,this,[[3,9]])})))}},{key:"init",value:function t(e){}}])}();e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getErrorID=void 0;var r=function t(e){var n=e.message,r=void 0===n?"":n,o=e.stack,i;return r+(void 0===o?"":o)};e.getErrorID=r},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(7),f=n(8),l=n(2),p=function(){function t(e){o(this,t),this.client=new f.default,e&&this.init&&this.init(e)}return a(t,[{key:"sendEvent",value:function t(e){this.client&&this.client.sendEvent(e)}},{key:"getConfig",value:function t(){if(this.client)return this.client.getContext().getConfig()}},{key:"sendCustom",value:function t(e){if(e.name&&e.type){var n=Object.assign(Object.assign({},e),{event_type:s.RumEventType.CUSTOM});this.sendEvent(n)}}},{key:"sendView",value:function t(e){if((0,l.isObject)(e)){if(e.type||(e.type="custom"),"custom"===e.type){var n=0;if(["t1","t2","t3"].forEach((function(t){(0,l.isNumber)(e[t])||delete e[t],t in e&&n++})),0===n)return}var r=Object.assign(Object.assign({},e),{event_type:s.RumEventType.VIEW});this.sendEvent(r)}}},{key:"sendException",value:function t(e){if(e.name&&e.message){var n=e.name,r=e.message,o=e.stack,i=Object.assign(Object.assign({times:1,name:n,message:r,stack:o},e),{event_type:s.RumEventType.EXCEPTION,type:"custom",source:"custom"});this.sendEvent(i)}}},{key:"sendResource",value:function t(e){if(e.name&&e.type&&(0,l.isNumber)(e.duration)){var n=Object.assign(Object.assign({times:1},e),{event_type:s.RumEventType.RESOURCE});this.sendEvent(n)}}}])}();e.default=p},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function t(){return e};var t,e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function t(e,n,r){return e[n]=r}}function p(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new N(r||[]);return a(i,"_invoke",{value:k(t,n,u)}),i}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function E(){}var O={};l(O,c,(function(){return this}));var S=Object.getPrototypeOf,j=S&&S(S(I([])));j&&j!==n&&i.call(j,c)&&(O=j);var _=E.prototype=b.prototype=Object.create(O);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function n(o,a,u,c){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function t(r,i){function a(){return new e((function(t,e){n(r,i,t,e)}))}return o=o?o.then(a,a):a()}})}function k(e,n,r){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=T(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===y)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?m:v,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(i.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=E,a(_,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},x(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new P(p(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(_),l(_,f,"Generator"),l(_,c,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function e(n){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(L),!n)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function o(e,o){return c.type="throw",c.arg=n,r.next=e,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],c=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var s=i.call(u,"catchLoc"),f=i.call(u,"finallyLoc");if(s&&f){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function t(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(u)},complete:function t(e,n){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&&n&&(this.next=n),g},finish:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var i=o.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function e(n,r,o){return this.delegate={iterator:I(n),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),g}},e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function u(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:e+""}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};function l(t){var e=t.remoteConfig||{};return{enable:!1!==e.enable&&!(!e.url&&!e.region),url:e.url||"",mode:e.mode||"launch-first",cacheTimeout:e.cacheTimeout||36e5,region:e.region}}Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigManager=void 0;var p=function(){function t(){i(this,t),this.currentConfig=null,this.initialized=!1}return u(t,[{key:"init",value:function t(e){return f(this,void 0,void 0,o().mark((function t(){var n=this,r,i,a;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:if(!this.initialized){o.next=2;break}return o.abrupt("return");case 2:if(this.currentConfig=Object.assign({},e),this.initialized=!0,r=l(e),this.currentConfig.remoteConfig=r,r.enable){o.next=8;break}return o.abrupt("return");case 8:return o.next=10,this.getCacheConfig();case 10:if((i=o.sent)&&i.content&&(this.currentConfig=this.mergeRemoteCfg(i.content)),!this.isCacheValid(i,r.cacheTimeout)){o.next=14;break}return o.abrupt("return");case 14:if(a=this.fetchRemoteCfg(this.currentConfig).then((function(t){if(t){var e=n.parseConfig(t);n.currentConfig=n.mergeRemoteCfg(e),n.setCacheConfig({timestamp:Date.now(),content:t})}})),"remote-first"!==r.mode){o.next=18;break}return o.next=18,a;case 18:case"end":return o.stop()}}),t,this)})))}},{key:"getConfig",value:function t(){if(!this.currentConfig)throw new Error("Config not initialized");return this.currentConfig}},{key:"setConfig",value:function t(e){return f(this,void 0,void 0,o().mark((function t(){return o().wrap((function t(n){for(;;)switch(n.prev=n.next){case 0:if(this.currentConfig){n.next=2;break}return n.abrupt("return");case 2:this.currentConfig=Object.assign(Object.assign({},this.currentConfig),e);case 3:case"end":return n.stop()}}),t,this)})))}},{key:"isCacheValid",value:function t(e,n){if(!e||!e.timestamp)return!1;var r=n||36e5;return Date.now()-e.timestamp<r}},{key:"mergeRemoteCfg",value:function t(e){var n=this.currentConfig,r=n.pid,o=n.app,i=n.endpoint,a=n.remoteConfig,u=n.beforeReport,c=n.properties;return Object.assign(Object.assign(Object.assign({},this.currentConfig),e),{pid:r,app:o,endpoint:i,remoteConfig:a,beforeReport:u,properties:c})}},{key:"destroy",value:function t(){this.currentConfig=null,this.initialized=!1}}])}();e.ConfigManager=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t){return 0!==t&&100*Math.random()<=t}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t)return t;var r=t.toString(),o=r.indexOf(".");r=-1!==o?r.substring(0,e+o+1):r.substring(0);var i=parseFloat(r);return i>=n?i:void 0}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNumber=e.performDraw=e.ONE_DAY=e.ONE_HOUR=e.ONE_MINUTE=e.ONE_SECOND=void 0,e.ONE_SECOND=1e3,e.ONE_MINUTE=60*e.ONE_SECOND,e.ONE_HOUR=60*e.ONE_MINUTE,e.ONE_DAY=24*e.ONE_HOUR,e.performDraw=r,e.formatNumber=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTracingOptions=e.makeTracingHeaders=e.isTraceOption=void 0;var r=n(15),o=n(2);function i(t){return t&&(0,r.isMatchOption)(t.match)&&(0,o.isArray)(t.propagatorTypes)}function a(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a={},u=n?"1":"0";return r.includes("sw8")&&(r=["sw8"]),(0,o.isArray)(r)||(r=[r]),r.forEach((function(n){switch(n){case"jaeger":a["uber-trace-id"]="".concat(t,":").concat(e,":0:").concat(u);break;case"b3":a.b3="".concat(t,"-").concat(e,"-").concat(u);break;case"b3multi":a["X-B3-TraceId"]=t,a["X-B3-SpanId"]=e,a["X-B3-Sampled"]=u;break;case"sw8":if((0,o.isFunction)(btoa)){var r=btoa(t),c=btoa(e),s=btoa(i.appId),f=btoa(i.appVersion),l=btoa(i.viewName),p=btoa(i.host);a.sw8="".concat(u,"-").concat(r,"-").concat(c,"-",0,"-").concat(s,"-").concat(f,"-").concat(l,"-").concat(p)}break;case"tracecontext":default:a.traceparent="00-".concat(t,"-").concat(e,"-0").concat(u),i.tracestate&&(a.tracestate=i.tracestate)}})),i.baggage&&(a.baggage=i.baggage),a}function u(t){var e=["tracecontext"];if((0,o.isBoolean)(t)||!t)return{enable:!!t,sample:100,propagatorTypes:e,allowedUrls:[],tracestate:!0,baggage:!1};var n=t.enable,a=void 0===n||n,u=t.sample,c=void 0===u?100:u,s=t.propagatorTypes,f=void 0===s?e:s,l=t.allowedUrls,p=void 0===l?[]:l,h=t.tracestate,y=void 0===h||h,v=t.baggage,d=void 0!==v&&v,m=[];return(0,o.isArray)(p)&&p.length&&p.forEach((function(t){(0,r.isMatchOption)(t)?m.push({match:t,propagatorTypes:f}):i(t)&&m.push(t)})),{enable:!(0,o.isBoolean)(a)||a,sample:(0,o.isNumber)(c)?c:100,propagatorTypes:f,allowedUrls:m,tracestate:y,baggage:d}}e.isTraceOption=i,e.makeTracingHeaders=a,e.parseTracingOptions=u},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(4),l=n(5),p=function(){function t(){var e=this;o(this,t),this.name="pv-collector",this.onUnload=function(){var t=(0,f.getCurView)(e.ctx);e.ctx.removeView(t.id)},this.sendPv=function(){var t=(0,f.getCurPage)();if(t){var n=t.route,r=t.options,o=(0,f.getRumViewId)(t);if(!e.prevPage||o!==e.prevPage.viewId){var i=o?"route_back":"initial_load";o=(0,f.getRumViewId)(t,e.ctx.session),e.prevPage={route:n,viewId:o};var a=e.getViewName(n);e.ctx.addView({id:o,name:a});var u={};r&&Object.keys(r).forEach((function(t){u[t]=decodeURIComponent(r[t])})),e.sendEvent({event_type:s.RumEventType.VIEW,type:"pv",url:n,name:a,loading_type:i,snapshots:JSON.stringify(u).substring(0,5e3)})}}}}return a(t,[{key:"setup",value:function(t,e){this.ctx=t,this.sendEvent=e,this.sendPv(),(0,l.addPageListener)("onLoad",this.sendPv),(0,l.addPageListener)("onUnload",this.onUnload)}},{key:"getViewName",value:function(t){var e,n=this.ctx.getConfig().parseViewName,r=t;return(0,s.isFunction)(n)&&(r=n(t)),r}},{key:"destroy",value:function(){(0,l.removePageListener)("onLoad",this.sendPv),(0,l.removePageListener)("onUnload",this.onUnload)}}])}();e.default=p},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(1),l=n(4),p=n(5),h=n(6),y=n(34),v=n(3),d=(0,f.getPerformance)(),m=function(){function t(){var e=this;o(this,t),this.name="perf-collector",this.currentViewId="",this.pageIdToViewId={},this.delayHandler=function(t){var n=(0,s.isArray)(t)?t:t.getEntries();Array.isArray(n)&&0!==n.length&&setTimeout((function(){n.forEach((function(t){if(t.pageId){var n=e.pageIdToViewId["pageId:".concat(t.pageId)];if(n&&e.perfCache[n])return void e.perfCache[n].entries.push(t)}if(e.currentViewId){var r=e.perfCache[e.currentViewId];if(r){var o=t.path;o||"navigation"!==t.entryType||(o=t.name),r.path!==o||r.entries.push(t)}}}))}),y.COMMON_DELAY)},this.onLoad=function(){var t=(0,l.getCurPage)(),n=(0,l.getCurView)(e.ctx),r=(0,l.getRumViewId)(t,e.ctx.session),o=(0,s.isFunction)(t.getPageId)?t.getPageId():null;r in e.perfCache||(e.currentViewId=r,o&&(e.pageIdToViewId[o.toString()]=r),e.perfCache[r]={view:n,path:t.is||t.route,pageId:o,entries:[],timer:setTimeout((function(){e.flushByViewId(r)}),s.ONE_MINUTE),loadTime:(0,h.getCurrentTime)()})},this.onReady=function(){var t=e.currentViewId;if(t){var n=e.perfCache[t];n&&(n.dom_complete=(0,h.getCurrentTime)()-n.loadTime)}},this.flushByViewId=function(t){var n=e.perfCache[t];n&&(e.perfCache[t]=!1,clearTimeout(n.timer),n.entries.length&&e.parsePerf(n))}}return a(t,[{key:"setup",value:function(t,e){if((0,v.checkEnable)(t,"perf")){var n=this;if(this.ctx=t,this.sendEvent=e,d&&d.getEntries){this.perfCache={};var r,o=f.appName===f.wechatName||f.appName===f.alipayName;if(o)r=["navigation","render"];else if(f.appName===f.bytedanceName)r=["launch","paint","navigation"];else{if(f.appName!==f.ksName)return;r=["paint","navigation"]}this.delayHandler(d.getEntries().filter((function(t){return r.includes(t.entryType)}))),this.perfObserver=d.createObserver(this.delayHandler),this.perfObserver.observe({entryTypes:r}),this.onUnload=function(){if(!o){var e=(0,l.getRumViewId)(this,t.session);e&&n.flushByViewId(e)}},(0,p.addPageListener)("onLoad",this.onLoad),(0,p.addPageListener)("onReady",this.onReady),(0,p.addPageListener)("onHide",this.onUnload),(0,p.addPageListener)("onUnload",this.onUnload)}}}},{key:"parsePerf",value:function(t){var e,n,r,o,i,a=t.entries,u=t.view,c=t.dom_complete;a.forEach((function(t){if(t.startTime)switch(t.name){case"firstRender":case"first-render":n=t;break;case"firstPaint":case"first-paint":r=t;break;case"firstContentfulPaint":case"first-contentful-paint":o=t;break;case"largestContentfulPaint":case"largest-contentful-paint":if(i&&i.startTime>t.startTime)break;i=t;break;default:"navigation"===t.entryType&&(e=t)}}));var s={};e&&(n&&(s.first_render=n.duration?n.duration:n.startTime-e.startTime),r&&(s.first_paint=r.startTime-e.startTime),o&&(s.first_contentful_paint=o.startTime-e.startTime),i&&(s.largest_contentful_paint=i.startTime-e.startTime),c&&(s.dom_complete=c),this.sendPerf(s,{view:u,timestamp:e.startTime,timing_data:JSON.stringify(e)}))}},{key:"sendPerf",value:function(t,e){for(var n=Object.keys(t),r=0;r<n.length;r++){var o=n[r],i=t[o];(0>=i||isNaN(i)||6e5<i)&&delete t[o]}if(Object.keys(t)){var a=this.ctx.session.getBaseEvent();this.sendEvent(Object.assign(Object.assign(Object.assign(Object.assign({},a),{event_type:s.RumEventType.VIEW,type:"perf"}),e),t))}}},{key:"destroy",value:function(){this.perfObserver&&this.perfObserver.disconnect(),(0,p.removePageListener)("onLoad",this.onLoad),(0,p.removePageListener)("onReady",this.onReady),(0,p.removePageListener)("onHide",this.onUnload),(0,p.removePageListener)("onUnload",this.onUnload)}}])}();e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.COMMON_DELAY=void 0,e.COMMON_DELAY=200},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(36),l=n(1),p=n(3),h=function(){function t(){var e=this;o(this,t),this.name="exception-collector",this.origin={consoleError:console.error},this.events={onError:null,onUnhandledRejection:null,onPageNotFound:null,onLazyLoadError:null},this.onError=function(t,n){var r=t;(0,s.isString)(r)&&(0,s.isString)(n)&&(r=n),e.errorHandle(r,"onError")},this.errorHandle=function(t){var n,r,o,i,a,u,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(t instanceof Object)n=t.name,r=t.message,o=t.filename||t.fileName,i=t.stack,a=t.lineno||t.lineNumber,u=t.colno||t.columnNumber;else if("string"==typeof t){i=t;var f=e.getErrorByStack(t);f&&(n=f.name,r=f.message)}if(n&&r&&!e.errorFilter(t)){var l=e.ctx.session.getBaseEvent();e.sendEvent(Object.assign(Object.assign({},l),{event_type:s.RumEventType.EXCEPTION,source:c,type:"error",name:n,message:r,file:o,stack:i,line:a,column:u}))}}}return a(t,[{key:"setup",value:function(t,e){this.ctx=t,this.sendEvent=e,this.hackOrigin()}},{key:"hackOrigin",value:function(){var t=this,e=this;(0,p.checkEnable)(this.ctx,"jsError")&&((0,s.isFunction)(l.sdk.onError)&&"undefined"==typeof uni?l.sdk.onError(this.onError):Object.keys(this.events).forEach((function(n){t.events[n]=function(t){t.reason&&t.reason instanceof Error&&(t=t.reason),e.errorHandle(t,n)},(0,f.addAppListener)(n,t.events[n])}))),(0,p.checkEnable)(this.ctx,"consoleError")&&("swan"===l.appName&&Object.defineProperty(console,"error",{writable:!0}),(0,s.interceptFunction)(console,"error",(function(t){e.errorHandle(t,"console.error")})))}},{key:"getErrorByStack",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=t.split("\n");if(!(2>e.length))for(var n=1;n<e.length;n++)if(e[n].trim().startsWith("at ")){var r=e[n-1],o=r.indexOf(": ");return{name:r.substring(0,o),message:r.substring(o+2)}}}},{key:"errorFilter",value:function(t){var e,n=(this.ctx.getConfig().filters||{}).exception;return!!n&&((0,s.isArray)(n)||(n=[n]),(0,s.matchList)(n,t.name,!0,t)||(0,s.matchList)(n,t.message,!0,t)||(0,s.matchList)(n,t.stack,!0,t))}},{key:"destroy",value:function(){var t=this,e=this.origin;e.consoleError&&(console.error=e.consoleError),(0,s.isFunction)(l.sdk.offError)&&l.sdk.offError(this.onError),Object.keys(this.events).forEach((function(e){(0,s.isFunction)(t.events[e])&&(0,f.removeAppListener)(e,t.events[e])}))}}])}();e.default=h},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){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 i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.removeAppListener=e.addAppListener=e.originalApp=void 0;var s=n(0),f=n(1),l={onLaunch:[],"*":[]};function p(t){Object.keys(l).forEach((function(e){"swan"===f.appName&&Object.defineProperty(t,e,{writable:!0}),"*"===e||(0,s.interceptFunction)(t,e,(function(){for(var t=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=[].concat(r(l[e]),r(l["*"]));a.forEach((function(e){e.apply(t,o)}))}),!0)}))}function h(t,e){t in l||(l[t]=[]),l[t].push(e)}function y(t,e){if(t in l){var n=l[t],r=n.indexOf(e);n.splice(r,1)}}e.originalApp=App,App=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];try{p.apply(this,n)}catch(t){}return e.originalApp.apply(this,n)},Object.keys(e.originalApp).forEach((function(t){App[t]=e.originalApp[t]})),e.addAppListener=h,e.removeAppListener=y},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return c(t)||u(t)||a(t)||i()}function i(){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 a(t,e){if(t){if("string"==typeof t)return s(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function u(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function c(t){if(Array.isArray(t))return s(t)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),u=new y(r||[]);return w(a,"_invoke",{value:s(t,n,u)}),a}function n(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function i(){}function a(){}function u(e){["next","throw","return"].forEach((function(n){t(e,n,(function(t){return this._invoke(n,t)}))}))}function c(t,e){function o(i,a,u,c){var s=n(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function s(t,e,r){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=l(u,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(t,e,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(t,e){var r=e.method,o=t.iterator[r];if(o===d)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=n(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function y(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function v(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}f=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(t,e,n){t[e]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",j=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,n){return t[e]=n}}m.wrap=e;var _={},x={};t(x,O,(function(){return this}));var P=Object.getPrototypeOf,k=P&&P(P(v([])));k&&k!==g&&b.call(k,O)&&(x=k);var T=a.prototype=o.prototype=Object.create(x);return i.prototype=a,w(T,"constructor",{value:a,configurable:!0}),w(a,"constructor",{value:i,configurable:!0}),i.displayName=t(a,j,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name))},m.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,t(e,j,"GeneratorFunction")),e.prototype=Object.create(T),e},m.awrap=function(t){return{__await:t}},u(c.prototype),t(c.prototype,S,(function(){return this})),m.AsyncIterator=c,m.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new c(e(t,n,r,o),i);return m.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},u(T),t(T,j,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),m.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},m.values=v,y.prototype={constructor:y,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=d),_}},m}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}function h(t,e,n){return e&&p(t.prototype,e),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t){var e=v(t,"string");return"symbol"==r(e)?e:e+""}function v(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var d=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});var m=n(0),g=n(1),b=n(38),w=n(6),E=n(4),O=n(39),S=n(3),j=function(){function t(){var e=this;l(this,t),this.name="api-collector",this.origin={request:g.default.request,httpRequest:g.default.httpRequest},this.sendApi=function(t,n,r){return d(e,void 0,void 0,f().mark((function e(){var o,i,a,u,c,s,l,p,h,y,v,d,g,b;return f().wrap((function e(f){for(;;)switch(f.prev=f.next){case 0:if(o=this.ctx.getConfig(),i=o.evaluateApi,a=n.statusCode,u=n.status,c=n.errMsg,s=n.errorMessage,l=n.message,(p=n.profile)&&(h=this.parseProfile(p),y=JSON.stringify(p)),!(0,m.isFunction)(i)){f.next=14;break}return f.prev=4,0===t.success&&(v=new Error("request error")),f.next=8,i(r,n,v);case 8:d=f.sent,t=Object.assign(Object.assign({},t),(0,O.reviseApiAttr)(d)),f.next=14;break;case 12:f.prev=12,f.t0=f.catch(4);case 14:if(g=this.ctx.session.getBaseEvent(),!((b=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g),{event_type:m.RumEventType.RESOURCE,type:"api",status_code:u||a,message:s||c||l,duration:(0,w.getCurrentTime)()-t.timestamp}),t),h),{timing_data:y})).duration>m.ONE_HOUR)){f.next=18;break}return f.abrupt("return");case 18:this.sendEvent(b);case 19:case"end":return f.stop()}}),e,this,[[4,12]])})))}}return h(t,[{key:"setup",value:function t(e,n){var r=this;(0,S.checkEnable)(e,"api")&&(this.ctx=e,this.sendEvent=n,Object.keys(this.origin).forEach((function(t){return r.hackRequest(t)})))}},{key:"injectTracing",value:function t(e,n){var r,o=this.ctx.session,i=this.ctx.getConfig(),a=i.tracing,u=i.pid,c=i.version,s=void 0===c?"1.0.0":c,f=(0,m.parseTracingOptions)(a),l=f.enable,p=f.sample,h=f.propagatorTypes,y=f.allowedUrls,v=f.tracestate,d=!(void 0!==v)||v,b=f.baggage,w=void 0!==b&&b;if(l){var E=(0,m.find)(y,(function(t){return(0,m.matchList)([t.match],e.url)}));if(E){var O=E.propagatorTypes;0===O.length&&(O=h);var S=!1;O.includes("sw8")&&(O=["sw8"],S=!0);var j=S?(0,m.generateGUID)():(0,m.generateTraceId)(),_=S?(0,m.generateGUID)():(0,m.generateSpanId)(),x=(0,m.performDraw)(p),P=o.getUserId(),k=o.getSessionId(),T=d?"rum=v2&miniapp&".concat(u,"&").concat(k,"&").concat(P):void 0,C=w?"rum=v2,appType=miniapp,pid=".concat(u,",sid=").concat(k,",uid=").concat(P):void 0,L=(0,m.makeTracingHeaders)(j,_,x,O,{tracestate:T,baggage:C,appId:u,appVersion:s,viewName:null===(r=e.view)||void 0===r?void 0:r.name,host:"miniapp_".concat(g.appName)});x&&(e.trace_id=j,e.trace_data=JSON.stringify({spanId:_,sample:p,sampled:x,headers:L})),n(L)}}}},{key:"hackRequest",value:function t(e){var n=this;(0,m.isFunction)(g.default[e])&&Object.defineProperty(g.default,e,{configurable:!0,enumerable:!0,writable:!0,value:function t(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return o[0]=n.rebuildRequestOptions(o[0]),n.origin[e].apply(this,o)}})}},{key:"rebuildRequestOptions",value:function t(e){var n=this,r=e.url,o=e.success,i=e.fail,a=(0,w.getCurrentTime)();if((0,b.isEndpoint)(this.ctx,r)||n.filter(r))return e;var u=Object.assign({},e),c={view:(0,E.getCurView)(this.ctx),timestamp:a,url:r,name:this.getResourceName(r),method:e.method||"GET"};return this.injectTracing(c,(function(t){var e=[];["headers","header"].forEach((function(n){n in u&&(0,m.isObject)(u[n])&&(u[n]=Object.assign(Object.assign({},u[n]),t),e.push(n))})),0===e.length&&(u[g.HEADER_KEY]=Object.assign(Object.assign({},u[g.HEADER_KEY]),t))})),u.success=function(){c.success=1;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];n.sendApi(c,e[0],u),o&&o.apply(this,e)},u.fail=function(){c.success=0;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];n.sendApi(c,e[0],u),i&&i.apply(this,e)},u}},{key:"getResourceName",value:function t(e){var n,r,o=this.ctx.getConfig().parseResourceName;return n=(0,m.isFunction)(o)?o(e):(0,b.getPathByURL)(e)}},{key:"parseProfile",value:function t(e){function n(t,n){t in e&&0<e[t]&&(o[n]=e[t])}function r(t,n,r){if(t in e&&t in e){var i=e[n]-e[t];0<i&&(o[r]=i)}}var o={};return n("domainLookup","dns_duration"),n("connect","connect_duration"),n("SSLconnection","ssl_duration"),n("Waiting","first_byte_duration"),n("totalTime","duration"),n("receivedBytedCount","size"),r("connectStart","connectEnd","connect_duration"),r("SSLconnectionStart","SSLconnectionEnd","ssl_duration"),r("domainLookUpStart","domainLookUpEnd","dns_duration"),r("redirectStart","redirectEnd","redirect_duration"),r("responseStart","requestStart","first_byte_duration"),r("responseStart","requestEnd","download_duration"),r("redirectStart","responseEnd","duration"),Object.keys(o).forEach((function(t){o[t]>m.ONE_HOUR&&delete o[t]})),o}},{key:"filter",value:function t(e){var n,r,i=this.ctx.getConfig(),a=(null===(n=null==i?void 0:i.filters)||void 0===n?void 0:n.resource)||[];(0,m.isArray)(a)||(a=[a]);var u=null===(r=null==i?void 0:i.collectors)||void 0===r?void 0:r.api;return(0,m.isObject)(u)&&(0,m.isArray)(u.filters)&&(a=[].concat(o(a),o(u.filters))),(0,m.urlMatch)(e,a)}}])}();e.default=j},function(t,e,n){"use strict";function r(t){var e=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1];try{var n=a(t);return e?n.hash:n.pathname}catch(t){return""}}function o(t,e){var n,r=t.getConfig().endpoint;try{return a(e).hostname===a(r).hostname}catch(t){return!1}}Object.defineProperty(e,"__esModule",{value:!0}),e.getURL=e.isEndpoint=e.getPathByURL=void 0,e.getPathByURL=r,e.isEndpoint=o;var i=/^(?:([^:\/?#]+):\/\/)?((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?)?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i;function a(t){var e=decodeURIComponent(t).match(i),n,r=(e[3]||"").split(":").length?(e[2]||"").replace(/(.*\@)/,""):e[2];return{uri:e[0],protocol:e[1],host:r,hostname:e[4],port:e[5],pathname:e[6],search:e[7],hash:e[8]}}e.getURL=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reviseApiAttr=void 0;var r=n(0);function o(t){if((0,r.isObject)(t)){var e={};(0,r.isString)(t.name)&&(e.name=t.name.substring(0,1e3)),(0,r.isString)(t.message)&&(e.message=t.message.substring(0,1e3)),"success"in t&&(e.success=t.success?1:0),(0,r.isNumber)(t.duration)&&0<=t.duration&&(e.duration=t.duration),(0,r.isString)(t.status_code)&&(e.status_code=t.status_code.substring(0,100)),(0,r.isNumber)(t.status_code)&&(e.status_code=t.status_code),(0,r.isString)(t.snapshots)&&(e.snapshots=t.snapshots.substring(0,5e3));var n=(0,r.verifyProperties)(t.properties);return n&&(e.properties=n),e}}e.reviseApiAttr=o},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(5),l=n(3),p=function(){function t(){var e=this;o(this,t),this.name="action-collector",this.DELAY_TIME=300,this.events=["tap"],this.onEvent=function(t){if(t&&e.events.includes(t.type)&&t.target){var n=t.target,r=t.currentTarget,o=t.type,i=r.dataset,a=r.id;if(a||r===n||(a=n.id,i=n.dataset),!a)return;var u=e.ctx.session.getBaseEvent(),c=Object.assign(Object.assign({},u),{event_type:s.RumEventType.ACTION,type:o,name:a,snapshots:JSON.stringify({dataset:i}).substring(0,1e3)});clearTimeout(e.timer),e.lastEvent?e.lastEvent.name===c.name?e.lastEvent.times+=1:e.sendAction():e.lastEvent=c,e.timer=setTimeout(e.sendAction,e.DELAY_TIME)}},this.sendAction=function(){e.sendEvent(e.lastEvent),e.lastEvent=null}}return a(t,[{key:"setup",value:function(t,e){(0,l.checkEnable)(t,"action")&&(this.ctx=t,this.sendEvent=e,(0,f.addPageListener)("*",this.onEvent))}},{key:"destroy",value:function(){(0,f.removePageListener)("*",this.onEvent)}}])}();e.default=p},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(1),l=n(3),p=function(){function t(){var e=this;o(this,t),this.name="application-collector",this.observerHandler=function(t){var n,r,o=(0,s.isArray)(t)?t:t.getEntries();if((0,s.isFunction)(f.default.getLaunchOptionsSync)&&(r=null===(n=f.default.getLaunchOptionsSync())||void 0===n?void 0:n.scene),Array.isArray(o)&&0<o.length)for(var i,a=0;a<o.length;a++)if("number"==typeof(i=o[a]).duration&&0<i.duration){var u=e.ctx.session.getBaseEvent(),c=Object.assign(Object.assign({},u),{event_type:s.RumEventType.APPLICATION,state:"",duration:0,snapshots:JSON.stringify(i),scene:r});switch(i.name){case"appLaunch":case"app-click":c.state="cold_lunch",c.duration=i.duration;break;case"downloadPackage":case"miniprogram-package":case"download":c.state="download_package",c.duration=i.duration;break;case"evaluateScript":case"app-service":var l;"__APP__"===(i.moduleName||i.packageName)&&(c.state="evaluate_script",c.duration=i.duration)}c.state&&0<c.duration&&6e5>c.duration&&e.sendEvent(c)}}}return a(t,[{key:"setup",value:function(t,e){if((0,l.checkEnable)(t,"application")){this.ctx=t,this.sendEvent=e;var n=(0,f.getPerformance)();if(n&&(0,s.isFunction)(n.createObserver)){var r=[];if(f.appName===f.wechatName||f.appName===f.alipayName)r=["navigation","script","loadPackage"];else if(f.appName===f.bytedanceName)r=["launch","evaluate","resource"];else{if(f.appName!==f.ksName)return;r=["navigation","resource"]}this.observerHandler(n.getEntries().filter((function(t){return r.includes(t.entryType)}))),this.perfObserver=n.createObserver(this.observerHandler),this.perfObserver.observe({entryTypes:r})}}}},{key:"destroy",value:function(){this.perfObserver&&this.perfObserver.disconnect()}}])}();e.default=p},function(t,e,n){"use strict";function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}function s(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t){var e=l(t,"string");return"symbol"==a(e)?e:e+""}function l(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var p=n(0),h=n(5),y=n(16),v=n(4),d=n(6),m=n(3),g=5,b=50,w=function(){function t(){var e=this;u(this,t),this.name="render-block-collector",this.renderBlockReportLimitMap=new Map,this.onLoad=function(){var t=(0,v.getCurPage)(),n=(0,v.getRumViewId)(t,e.ctx.session);e.renderBlockReportLimitMap.set(n,{count:0,name:(0,v.getViewById)(n,e.ctx).name})},this.onSetData=function(t){return t&&(0,p.isFunction)(t.setUpdatePerformanceListener)?void t.setUpdatePerformanceListener({withDataPaths:!0},(function(n){var r=n||{},o=r.updateEndTimestamp,i=r.pendingStartTimestamp,a=r.dataPaths,u=void 0===a?[]:a,c=o-i;if((0,p.isNumber)(c)&&!(c<e.renderThreshold)){var s=(0,v.getCurPage)(),f=(0,v.getRumViewId)(s,e.ctx.session);if(e.renderBlockReportLimitMap.has(f)){var l=e.renderBlockReportLimitMap.get(f),h=l.count,y=l.name;if(!(h>e.maxEventCount)){e.renderBlockReportLimitMap.set(f,{count:h+1,name:y});var m=e.ctx.session.getBaseEvent(),g=t.data,b=O(u,g);e.sendEvent(Object.assign(Object.assign({},m),{event_type:p.RumEventType.LONG_TASK,type:"render",duration:c,message:t.is||t.route||"",snapshots:JSON.stringify(Object.assign(Object.assign({},S(n)),b?{data:b}:{})),timestamp:i||(0,d.getCurrentTime)(),source:"setData",view:{id:f,name:y}}))}}}})):void e.destroy()},this.onUnload=function(){var t=(0,v.getCurPage)(),n=(0,v.getRumViewId)(t,e.ctx.session);e.renderBlockReportLimitMap.delete(n)}}return s(t,[{key:"setup",value:function(t,e){var n,r=t.getConfig().longTaskConfig,o=void 0===r?{}:r;if((0,m.checkEnable)(t,"longTask")){var i=this;this.ctx=t,this.sendEvent=e;var a=E(o),u=a.maxEventCount,c=a.renderThreshold;this.maxEventCount=u,this.renderThreshold=c,this._onSetData=function(){i.onSetData(this)},(0,h.addPageListener)("onLoad",this.onLoad),(0,h.addPageListener)("onReady",this._onSetData,!0),(0,h.addPageListener)("onUnload",this.onUnload),(0,y.addComponentListener)("attached",this._onSetData)}}},{key:"destroy",value:function(){(0,h.removePageListener)("onLoad",this.onLoad),(0,h.removePageListener)("onReady",this._onSetData,!0),(0,h.removePageListener)("onUnload",this.onUnload),(0,y.removeComponentListener)("attached",this._onSetData)}}])}();e.default=w;var E=function(t){var e=t||{},n=e.maxEventCount,r=e.renderThreshold;return(!n||!(0,p.isNumber)(n)||1>n||n>b)&&(t.maxEventCount=g),r&&(0,p.isNumber)(r)&&!(r<b)||(t.renderThreshold=b),t},O=function(t,e){try{return t.map((function(t){var n,o="",i=e,a=r(t);try{for(a.s();!(n=a.n()).done;){var u=n.value;o+=o?".".concat(u):u,i=null==i?void 0:i[u]}}catch(t){a.e(t)}finally{a.f()}return{dataKey:o,dataLength:JSON.stringify(i).length}}))}catch(t){return""}},S=function(t){if(!t)return t;var e=t.updateStartTimestamp,n=t.updateEndTimestamp,r=t.pendingStartTimestamp;return t.updateEndTimestamp=n-r,t.updateStartTimestamp=e-r,t.pendingStartTimestamp=0,t}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(6),f=n(4),l=function(){function t(){o(this,t),this.name="default-processor"}return a(t,[{key:"process",value:function(t){var e=t.getRumEvent(),n=(0,f.getCurView)(t),r;return Object.assign({timestamp:(0,s.getCurrentTime)(),session_id:t.session.getSessionId(),event_id:t.session.getEventId(),view:n},e)}}])}();e.default=l},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(5),l=function(){function t(){var e=this;o(this,t),this.name="session-processor",this.update=function(t){t&&!t.isTrusted||e.ctx.session.updateSession()}}return a(t,[{key:"setup",value:function(t){var e=this;this.ctx=t,this.update=(0,s.debounce)(this.update,s.ONE_SECOND),(0,f.addPageListener)("*",(function(t){t&&t.type&&t.target&&e.update()}))}},{key:"process",value:function(t){return this.update(),t.getRumEvent()}}])}();e.default=l},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function s(t,e,n){return e=h(e),f(t,p()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}function f(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function v(t,e){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0});var d=n(0),m=n(1),g=function(t){function e(){var t;return o(this,e),(t=s(this,e,arguments)).name="miniapp-reporter",t}return y(e,t),a(e,[{key:"init",value:function(){var t=this;(0,d.isFunction)(m.default.onAppHide)&&m.default.onAppHide((function(){t.flushEventQueue()}))}},{key:"request",value:function(t,e){var n=t.getConfig();try{var r;e.app.type=d.AppType.miniapp,e._v=m.VERSION,(m.default.request||m.default.httpRequest)({url:n.endpoint,method:"POST",dataType:"text",data:JSON.stringify(e)})}catch(t){console.warn("[arms] sendRequest fail",t)}}}])}(d.Reporter);e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getNetType=void 0;var r=n(1);function o(t){r.default.getNetworkType&&r.default.getNetworkType({success:function(e){var n=e.networkType||e.subtype;t(n?n.toLowerCase():void 0)}}),r.default.onNetworkStatusChange&&r.default.onNetworkStatusChange((function(e){var n=e.networkType||e.subtype;t(n?n.toLowerCase():void 0)}))}e.getNetType=o},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return s(t)||c(t,e)||a(t,e)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){if(t){if("string"==typeof t)return u(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(c){s=!0,o=c}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}function s(t){if(Array.isArray(t))return t}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h(n.key),n)}function p(t,e,n){return e&&l(t.prototype,e),n&&l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t){var e=y(t,"string");return"symbol"==r(e)?e:e+""}function y(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.RumSession=void 0;var v=n(0),d=n(6),m=n(4),g=n(1),b="_arms_uid",w="_arms_session",E=function(){function t(){f(this,t)}return p(t,[{key:"init",value:function(t){var e;this.ctx=t,this.sessionConfig=this.fixSessionConfig(null===(e=t.config)||void 0===e?void 0:e.sessionConfig)}},{key:"getSessionId",value:function(){return this.getSessionInfo().sessionId}},{key:"getSampled",value:function(){return this.getSessionInfo().sampled}},{key:"checkSession",value:function(t){var e=this.sessionConfig,n=e.overtime,r=e.maxDuration,o=(0,d.getCurrentTime)();return!(t.startTime+r<o||t.lastTime+n<o)}},{key:"updateSession",value:function(){var t=this.getSessionInfo();if(!t.isNew){var e=t.startTime,n=(0,d.getCurrentTime)(),r=t.sampled?1:0;(0,g.setStorageSync)(w,"".concat(t.sessionId,"-").concat(r,"-").concat(e,"-").concat(n))}}},{key:"getSessionInfo",value:function(){var t,e=o(((0,g.getStorageSync)(w)||"").split("-"),4),n=e[0],r=e[1],i=e[2],a=e[3],u={sessionId:n,sampled:"0"!==r,startTime:parseInt(i||"")||0,lastTime:parseInt(a||"")||0};return this.checkSession(u)||(u=this.resetSession()),u}},{key:"getEventId",value:function(){return(0,v.generateEventId)(this.getSessionId())}},{key:"getViewId",value:function(){return this.getUUID()}},{key:"getUserId",value:function(){var t=(0,g.getStorageSync)(b);return t&&0===t.indexOf("user_")&&(t=""),t||(t="uid_".concat((0,v.generateSpanId)(16,36)),(0,g.setStorageSync)(b,t)),t}},{key:"resetSession",value:function(){var t=this.sessionConfig.sampleRate,e=this.getUUID(),n=(0,d.getCurrentTime)(),r=(0,v.performDraw)(100*t),o="".concat(e,"-").concat(r?1:0,"-").concat(n,"-").concat(n);return(0,g.setStorageSync)(w,o),{sessionId:e,sampled:r,startTime:n,lastTime:n,isNew:!0}}},{key:"getUUID",value:function(){return(0,v.generateGUID)().replace(/-/g,"")}},{key:"fixSessionConfig",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.sampleRate,n=t.maxDuration,r=t.overtime;return(!(0,v.isNumber)(e)||0>e||1<e)&&(e=1),(!(0,v.isNumber)(n)||n<4*v.ONE_HOUR||n>v.ONE_DAY)&&(n=v.ONE_DAY),(!(0,v.isNumber)(r)||r>v.ONE_HOUR||r<10*v.ONE_MINUTE)&&(r=30*v.ONE_MINUTE),{sampleRate:e,maxDuration:n,overtime:r}}},{key:"getBaseEvent",value:function(){return{timestamp:(0,d.getCurrentTime)(),session_id:this.getSessionId(),event_id:this.getEventId(),view:this.ctx?(0,m.getCurView)(this.ctx):void 0,times:1}}}])}();e.RumSession=E}])}));
|
|
1
|
+
!function e(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.RumSDK=n():t.RumSDK=n()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./dist/",n(n.s=17)}([function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function e(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.Shell=t.Reporter=t.Context=t.Client=void 0;var i=n(8);t.Client=i.default;var a=n(10);t.Context=a.default;var u=n(21);t.Reporter=u.default;var c=n(23);t.Shell=c.default,o(n(24),t),o(n(9),t),o(n(25),t),o(n(26),t),o(n(27),t),o(n(7),t),o(n(28),t),o(n(29),t),o(n(13),t),o(n(14),t),o(n(2),t),o(n(30),t),o(n(15),t),o(n(31),t),o(n(11),t),o(n(12),t)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o;Object.defineProperty(t,"__esModule",{value:!0}),t.HEADER_KEY=t.getPerformance=t.setStorageSync=t.getStorageSync=t.appName=t.sdk=t.ksName=t.jdName=t.swanName=t.alipayName=t.dingtalkName=t.wechatName=t.bytedanceName=t.qqName=t.VERSION=void 0,t.VERSION="cdn-0.1.3";var i="object";function a(e){return"function"==typeof e}function u(){var e,n="unknown";if(("undefined"==typeof ks?"undefined":r(ks))===i)e=ks,n=t.ksName;else if(("undefined"==typeof swan?"undefined":r(swan))===i)e=swan,n=t.swanName;else if(("undefined"==typeof qq?"undefined":r(qq))===i)e=qq,n=t.qqName;else if(("undefined"==typeof tt?"undefined":r(tt))===i)e=tt,n=t.bytedanceName;else if(("undefined"==typeof dd?"undefined":r(dd))===i)e=dd,n=t.dingtalkName;else if(("undefined"==typeof my?"undefined":r(my))===i)e=my,n=t.alipayName;else if(("undefined"==typeof jd?"undefined":r(jd))===i)e=jd,n=t.jdName;else{if(("undefined"==typeof wx?"undefined":r(wx))!==i)throw new Error("Current platform is not supported.");e=wx,n=t.wechatName}return{sdk:e,appName:n}}function c(e){return a(t.sdk.getStorageSync)?t.appName===t.alipayName||t.appName===t.dingtalkName?t.sdk.getStorageSync({key:e}).data:t.sdk.getStorageSync(e):void 0}function s(e,n){return a(t.sdk.getStorageSync)?t.appName===t.alipayName||t.appName===t.dingtalkName?t.sdk.setStorageSync({key:e,data:n}):t.sdk.setStorageSync(e,n):void 0}function f(){return a(t.sdk.getPerformance)?t.sdk.getPerformance():"performance"in t.sdk?t.sdk.performance:void 0}t.qqName="qq",t.bytedanceName="bytedance",t.wechatName="wechat",t.dingtalkName="dingtalk",t.alipayName="alipay",t.swanName="swan",t.jdName="jd",t.ksName="ks",o=u(),t.sdk=o.sdk,t.appName=o.appName,t.getStorageSync=c,t.setStorageSync=s,t.getPerformance=f,t.HEADER_KEY=function(){switch(t.appName){case"alipay":return"headers";default:return"header"}}(),t.default=t.sdk},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return r(e)===t}Object.defineProperty(t,"__esModule",{value:!0}),t.isZero=t.isObject=t.isNull=t.isNumber=t.isBoolean=t.isRegExp=t.isArray=t.isToString=t.isString=t.isFunction=t.isTypeof=void 0,t.isTypeof=o;var i=function e(t){return"function"==typeof t};function a(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function u(){for(var e=0;e<arguments.length;e++)if(0!==(e<0||arguments.length<=e?void 0:arguments[e]))return!1;return!0}t.isFunction=i,t.isString=function(e){return o(e,"string")},t.isToString=a,t.isArray=function(e){return a(e,"Array")},t.isRegExp=function(e){return a(e,"RegExp")},t.isBoolean=function(e){return o(e,"boolean")},t.isNumber=function(e){return o(e,"number")&&!isNaN(e)||o(e,"bigint")},t.isNull=function(e){return null===e},t.isObject=function(e){return!(0,t.isNull)(e)&&o(e,"object")},t.isZero=u},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){function e(e,n,r,o){var a=n&&n.prototype instanceof t?n:t,s=Object.create(a.prototype);return i(s,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,c=0;!l&&s&&!n&&c<f.length;c++){var n,r=f[c],o=y.p,v=r[2];3<e?(n=v===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=u):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,y.v=t,y.n=r[1]):o<v&&(n=3>e||r[0]>t||t>v)&&(r[4]=e,r[5]=t,y.n=v,i=0))}if(n||1<e)return p;throw l=!0,t}var o,i,a,s=0,f=n||[],l=!1,y={p:0,n:0,v:u,a:r,f:r.bind(u,4),d:function e(t,n){return o=t,i=0,a=u,y.n=n,p}};return function(n,f,v){if(1<s)throw TypeError("Generator is already running");for(l&&1===f&&r(f,v),i=f,a=v;(c=2>i?u:a)||!l;){o||(i?3>i?(1<i&&(y.n=-1),r(i,a)):y.n=a:y.v=a);try{if(s=2,o){if(i||(n="next"),c=o[n]){if(!(c=c.call(o,a)))throw TypeError("iterator result is not an object");if(!c.done)return c;a=c.value,2>i&&(i=0)}else 1===i&&(c=o.return)&&c.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=u}else if((c=(l=0>y.n)?a:e.call(t,y))!==p)break}catch(e){o=u,i=1,a=e}finally{s=1}}return{value:c,done:l}}}(e,r,o),!0),s}function t(){}function n(){}function r(){}function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,i(e,l,"GeneratorFunction")),e.prototype=Object.create(v),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var u,c,s="function"==typeof Symbol?Symbol:{},f=s.iterator||"@@iterator",l=s.toStringTag||"@@toStringTag",p={};c=Object.getPrototypeOf;var y=[][f]?c(c([][f]())):(i(c={},f,(function(){return this})),c),v=r.prototype=t.prototype=Object.create(y);return n.prototype=r,i(v,"constructor",r),i(r,"constructor",n),n.displayName="GeneratorFunction",i(r,l,"GeneratorFunction"),i(v),i(v,l,"Generator"),i(v,f,(function(){return this})),i(v,"toString",(function(){return"[object Generator]"})),(o=function t(){return{w:e,m:a}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,a){function u(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(u("next",0),u("throw",1),u("return",2))})(e,t,n,r)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=f(e,"string");return"symbol"==r(t)?t:t+""}function f(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function l(e,t,n){return t=d(t),p(e,v()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function p(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function t(){return!!e})()}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var h=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):o(e.value).then(a,u)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.checkEnable=void 0;var b=n(0),w=n(1),O="arms_rum2_local_config";function S(e){var t,n,r,o,i={};i.enable=null===(t=e.enable)||void 0===t||t;var a=e.session;if(a){var u={};u.sampleRate=(null!==(n=a.sampling)&&void 0!==n?n:100)/100,u.storage=null!==(r=a.storage)&&void 0!==r?r:"auto",i.sessionConfig=u}var c=e.report;if(c){var s={};s.flushTime=c.flush_interval,s.maxEventCount=c.max_batch_count,i.reportConfig=s}var f=e.tracing;if(f){var l={enable:null===(o=f.enable)||void 0===o||o},p=[];(f.rules||[]).forEach((function(e){var t={enable:e.enable,tracestate:e.tracestate,baggage:e.baggage,propagatorTypes:e.protocols,sampling:e.sampling};return"{location.origin}"===e.match?void(l=Object.assign(Object.assign({},l),t)):(t.match=(0,b.parseRule2Match)(e),void p.push(t))})),l.allowedUrls=p,i.tracing=l}var y=e.collectors;if(y&&0<Object.keys(y).length){var v={};y.forEach((function(e){var t=e.name;if(t){var n=Object.assign({},e),r=e.filters;0<(null==r?void 0:r.length)&&(n.filters=n.filters.map((function(e){return(0,b.parseRule2Match)(e)}))),v[t]=n}})),i.collectors=Object.assign(Object.assign({},i.collectors),v)}return i}var E=function(e){function t(){var e;return a(this,t),(e=l(this,t,arguments)).version="v2",e}return m(t,e),c(t,[{key:"fetchRemoteCfg",value:function e(t){return h(this,void 0,void 0,o().m((function e(){var t;return o().w((function(e){for(;;)switch(e.n){case 0:if(t=this.getRemoteConfigUrl()){e.n=1;break}return e.a(2);case 1:if(!t.includes(".rum.aliyuncs.com")){e.n=2;break}return this.version="v1",e.a(2,this.getV1Config(t));case 2:return e.a(2,this.getV2Config(t))}}),e,this)})))}},{key:"getV1Config",value:function e(t){return h(this,void 0,void 0,o().m((function e(){return o().w((function(e){for(;;)switch(e.n){case 0:return e.a(2,new Promise((function(e,n){var r;(w.default.request||w.default.httpRequest)({url:t,method:"GET",success:function t(n){e(n)},fail:function e(t){n(t)}})})))}}),e)})))}},{key:"getV2Config",value:function e(t){return h(this,void 0,void 0,o().m((function e(){var n,r;return o().w((function(e){for(;;)switch(e.n){case 0:return n=(0,b.getUrlParams)(t),r={instanceId:"",agentType:"rum_web_sdk",attributes:n,instanceConfigs:[{configType:"rum_web_config",version:1}],capabilities:2},e.a(2,new Promise((function(e,n){var o;(w.default.request||w.default.httpRequest)({url:t,method:"POST",data:JSON.stringify(r),header:{"Content-Type":"application/json","x-log-apiversion":"0.6.0"},success:function t(n){e(n)},fail:function e(t){n(t)}})})))}}),e)})))}},{key:"getCacheConfig",value:function e(){var t=(0,w.getStorageSync)(O);if(t){var n,r=this.currentConfig;try{if("pid"in(n=JSON.parse(t))&&n.pid===r.pid||"endpoint"in n&&n.endpoint)return n}catch(e){}return n}}},{key:"setCacheConfig",value:function e(t){var n=this.currentConfig,r=Object.assign(Object.assign({},t),{pid:n.pid,endpoint:n.endpoint});(0,w.setStorageSync)(O,JSON.stringify(r))}},{key:"getRemoteConfigUrl",value:function e(){var t=this.currentConfig,n=t.pid,r,o=t.remoteConfig||{},i=o.url,a=o.region;if(i)return i;if(n){var u=n.split("@");return!u||2>u.length?void 0:"https://".concat(u[0],"-sdk.rum.aliyuncs.com/config/").concat(a||"cn-hangzhou","/").concat(u[1],"?t=").concat(Date.now())}}},{key:"parseConfig",value:function e(t){try{return"v2"===this.version?S(JSON.parse(t.instanceConfigs[0].config)):t}catch(e){return t}}}])}(b.ConfigManager);function j(e,t){var n,r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],o=e.getConfig();if(!1===o.enable)return!1;var i=null===(n=o.collectors)||void 0===n?void 0:n[t];return(0,b.isBoolean)(i)?i:(0,b.isObject)(i)&&"enable"in i?i.enable:r}t.default=E,t.checkEnable=j},function(e,t,n){"use strict";function r(){if("function"==typeof getCurrentPages)try{var e=getCurrentPages()||[];return e[e.length-1]}catch(e){console.warn("[arms] error in getCurView",e)}}function o(e){if(e){var t=e.getViews();if(t&&t.length)return t[t.length-1]}}function i(e,n){return e?e[t.PAGE_ID]?e[t.PAGE_ID]:n?e[t.PAGE_ID]=n.getViewId():void 0:void 0}function a(e,t){return e&&t?t.getViews().find((function(t){return t.id===e})):void 0}Object.defineProperty(t,"__esModule",{value:!0}),t.getViewById=t.getRumViewId=t.getCurView=t.getCurPage=t.PAGE_ID=void 0,t.PAGE_ID="__rum_view_id",t.getCurPage=r,t.getCurView=o,t.getRumViewId=i,t.getViewById=a},function(e,t,n){"use strict";function r(e){return u(e)||a(e)||i(e)||o()}function o(){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 i(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e){if(Array.isArray(e))return c(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.removePageListener=t.addPageListener=t.originalPage=void 0;var s=n(0),f=n(1),l=n(16),p={onLoad:[],onShow:[],onHide:[],onUnload:[],"*":[]},y=["onLoad","onShow","onReady","onHide","onUnload","onPullDownRefresh","onReachBottom","onShareAppMessage","onShareTimeline","onAddToFavorites","onPageScroll","onResize","onTabItemTap","onSaveExitState"];function v(e){Object.keys(e).forEach((function(t){var n=e[t];!(0,s.isFunction)(n)||y.includes(t)||t in p||(p[t]=[])})),Object.keys(p).forEach((function(t){"swan"===f.appName&&Object.defineProperty(e,t,{writable:!0}),"*"===t||(0,s.interceptFunction)(e,t,(function(){for(var e=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=[].concat(r(p[t]),r(p["*"]));a.forEach((function(t){t.apply(e,o)}))}),!0)}))}function d(e,t){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];n||(0,l.addComponentListener)(e,t),e in p||(p[e]=[]),p[e].push(t)}function m(e,t){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];if(n||(0,l.removeComponentListener)(e,t),e in p){var r=p[e],o=r.indexOf(t);r.splice(o,1)}}t.originalPage=Page,Page=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];try{v.apply(this,n)}catch(e){}return t.originalPage.apply(this,n)},Object.keys(t.originalPage).forEach((function(e){Page[e]=t.originalPage[e]})),t.addPageListener=d,t.removePageListener=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentTime=t.formatNumber=void 0;var r=n(1);function o(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:3;if(!e)return e;var n=e.toString(),r=n.indexOf(".");return n=-1===r?n.substring(0):n.substring(0,t+r+1),parseFloat(n)}function i(e){var t=(0,r.getPerformance)(),n=0;return t&&t.timeOrigin&&t.now&&(n=Math.round(t.timeOrigin+(e||t.now()))),1e12>n&&(n=(new Date).getTime()),n}t.formatNumber=o,t.getCurrentTime=i},function(e,t,n){"use strict";var r,o,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AppType=t.ResourceStatus=t.RumEventType=void 0,function(e){e.VIEW="view",e.RESOURCE="resource",e.EXCEPTION="exception",e.LONG_TASK="longTask",e.ACTION="action",e.CUSTOM="custom",e.APPLICATION="application"}(r=t.RumEventType||(t.RumEventType={})),function(e){e[e.Unknown=-1]="Unknown",e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(o=t.ResourceStatus||(t.ResourceStatus={})),function(e){e.browser="browser",e.miniapp="miniapp",e.minigame="minigame",e.uniapp="uniapp",e.reactnative="reactnative"}(i=t.AppType||(t.AppType={}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=i(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function e(){};return{s:o,n:function t(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function e(t){throw t},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,u=!0,c=!1;return{s:function t(){n=n.call(e)},n:function e(){var t=n.next();return u=t.done,t},e:function e(t){c=!0,a=t},f:function e(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function s(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){var t=l(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var p=n(9),y=n(20),v=n(10),d=n(2),m=function(){function e(){var t=this;u(this,e),this.emitter=new y.EventEmitter,this.sendEvent=function(e){t.emitter.emit(p.EventType.collect,e)}}return s(e,[{key:"init",value:function e(t,n,r){var i=this;this.ctx=new v.default(t,n,r);var a=this.ctx,u=this.collectors,c=this.processors,s=this.reporter;c.forEach((function(e){(0,d.isFunction)(e.setup)&&e.setup(a)})),this.emitter.on(p.EventType.collect,(function(e){a.setRumEvent(e);var t=o(c),n;try{for(t.s();!(n=t.n()).done;){var r=n.value;if(r.match||(r.match=function(){return!0}),r.match(a)){var i=r.process(a);i&&a.setRumEvent(i)}}}catch(e){t.e(e)}finally{t.f()}s.report(a)})),u.forEach((function(e){e.setup(a,i.sendEvent)}))}},{key:"setContext",value:function e(t){this.ctx=t}},{key:"getContext",value:function e(){return this.ctx}},{key:"useCollectors",value:function e(t){this.collectors=t}},{key:"getCollectors",value:function e(){return this.collectors}},{key:"useProcessors",value:function e(t){this.processors=t}},{key:"useReporter",value:function e(t){this.reporter=t}}])}();t.default=m},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.EventType=void 0,function(e){e.collect="collect"}(r=t.EventType||(t.EventType={}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(t,n,r){o(this,e),this.config=t,this.views=[],n&&(this.session=n,this.session.init(this)),r&&(this.configManager=r)}return a(e,[{key:"getConfig",value:function e(){return this.configManager?this.configManager.getConfig():this.config}},{key:"setConfig",value:function e(t){this.configManager?this.configManager.setConfig(t):this.config=t}},{key:"getViews",value:function e(){return this.views}},{key:"addView",value:function e(t){var n=this.views.findIndex((function(e){return e.id===t.id}));n>=0&&this.views.splice(n,1),this.views.push(t)}},{key:"removeView",value:function e(t){this.views=this.views.filter((function(e){return e.id!==t}))}},{key:"getRumEvent",value:function e(){return this.rumEvent}},{key:"setRumEvent",value:function e(t){this.rumEvent=t}}])}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyProperties=void 0;var r=n(2);function o(e){if((0,r.isObject)(e)){var t=Object.assign({},e);Object.keys(t).forEach((function(e){var n=t[e];if(e.length>50){var o=e.substring(0,50);t[o]=n,delete t[e],e=o}(0,r.isString)(n)||(0,r.isNumber)(n)?(0,r.isString)(n)&&n.length>2e3&&(t[e]=n.substring(0,2e3)):delete t[e]}));var n=Object.keys(t);if(n.length)return n.length>20&&n.forEach((function(e,n){n>19&&delete t[e]})),t}}t.verifyProperties=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUrlParams=void 0;var r=function e(t){if(0===t.length)return"";try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ").replace(/%20/g," ").replace(/%2F/g,"/").replace(/%3D/g,"=").replace(/%26/g,"&").replace(/%3F/g,"?")}},o=function e(t){if(0===t.length)return"";var n=t.indexOf("#"),r=n>=0?t.slice(0,n):t,o=r.indexOf("?");return-1===o?"":r.slice(o+1)};function i(e){if("string"!=typeof e||!e.trim())return{};var t={},n=o(e);if(!n)return t;for(var i=n.split("&"),a=0;a<i.length;a++){var u=i[a];if(u){var c=u.indexOf("=");if(!(c<=0)){var s=r(u.slice(0,c)),f=c<u.length-1?r(u.slice(c+1)):"",l=t[s];void 0!==l?Array.isArray(l)?l.push(f):t[s]=[l,f]:t[s]=f}}}return t}t.getUrlParams=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRegExpString=t.transStrToReg=t.getType=t.delay=t.debounce=t.generateEventId=t.generateSpanId=t.generateTraceId=t.generateGUID=t.restoreFunction=t.interceptFunction=void 0;var r=n(2),o=/^\[object ([a-z]*)\]$/;function i(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e[t],a=function t(){for(var a=o?this:e,u=arguments.length,c=new Array(u),s=0;s<u;s++)c[s]=arguments[s];if(n.apply(a,c),(0,r.isFunction)(i))return i.apply(a,c)};a._rum_intercepted=i,e[t]=a}function a(e,t){var n=e[t];if(!(0,r.isFunction)(n)){var o=n._rum_intercepted;(0,r.isFunction)(o)||(e[t]=o)}}function u(){var e="";try{if(crypto&&crypto.randomUUID)e=crypto.randomUUID();else if(crypto&&crypto.getRandomValues){var t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128,e=t.reduce((function(e,t){return e+t.toString(16).padStart(2,"0")}),"").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/,"$1-$2-$3-$4-$5")}}catch(t){e=""}return e||(e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0,n;return("x"==e?t:3&t|8).toString(16)}))),e}function c(){var e=u().replace(/-/g,"");return"0"===e[0]&&(e="1"+e.substring(1)),"0"===e[16]&&(e=e.substring(0,16)+"1"+e.substring(17)),e}function s(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n="",r=0;r<e;r++)n+=Math.floor(Math.random()*t).toString(t);return n}function f(e){var t=s();return"00-".concat(e,"-").concat(t)}function l(e,t){var n;if((0,r.isFunction)(e))return function(){var r=this,o=arguments;n&&clearTimeout(n),n=setTimeout((function(){e.apply(r,o)}),t)}}function p(e,t){if((0,r.isFunction)(e)){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return setTimeout.apply(void 0,[e,+t||0].concat(o))}}function y(e){var t=Object.prototype.toString.call(e),n=(t=t.toLowerCase()||"").match(o);return null==n?void 0:n[1]}function v(e){return"string"!==y(e)?e:e.length>2&&"/"===e[0]&&"/"===e[e.length-1]?new RegExp(e.substr(1,e.length-2)):e}function d(e){if("string"!=typeof e)throw new TypeError("input must be a string");if(e.length>2&&"/"===e[0]){var t=e.lastIndexOf("/");if(t>0){var n=e.substring(1,t),r=e.substring(t+1);return new RegExp(n,r)}return new RegExp(e.substring(1,e.length-1))}return new RegExp(e)}t.interceptFunction=i,t.restoreFunction=a,t.generateGUID=u,t.generateTraceId=c,t.generateSpanId=s,t.generateEventId=f,t.debounce=l,t.delay=p,t.getType=y,t.transStrToReg=v,t.parseRegExpString=d},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n))return r}}function o(e,t){return e.slice(0,t.length)===t}function i(e,t){return e.slice(-t.length)===t}function a(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}Object.defineProperty(t,"__esModule",{value:!0}),t.assign=t.endsWith=t.startsWith=t.find=void 0,t.find=r,t.startsWith=o,t.endsWith=i,t.assign=a},function(e,t,n){"use strict";function r(e){return u(e)||a(e)||i(e)||o()}function o(){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 i(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e){if(Array.isArray(e))return c(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.parseRule2Match=t.urlMatch=t.matchList=t.isMatchOption=void 0;var s=n(2),f=n(14),l=n(13);function p(e){return(0,s.isString)(e)||(0,s.isFunction)(e)||(0,s.isRegExp)(e)}function y(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0;return e.some((function(e){try{if("function"==typeof e)return e(t,r);if(e instanceof RegExp)return e.test(t);if("string"==typeof e)return n?(0,f.startsWith)(t,e):e===t}catch(e){}return!1}))}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{(0,s.isArray)(t)||(t=[t]);var n=[/^(https?:)?\/\/.*rum|retcode|log-global|log\.aliyuncs\.com/,/^(https?:)?\/\/.*\.mmstat\.com/,/^(https?:)?\/\/.*hm\.baidu\.com/,/^(https?:)?\/\/.*google-analytics\.com/,/data:(.+?)(;base64)?,(.+)$/].concat(r(t));return y(n,e)}catch(e){return!1}}function d(e){if(p(e))return e;var t;switch(e.match_exp){case"equals":t=function t(n){return n===e.match};break;case"not_equals":t=function t(n){return n!==e.match};break;case"regex":t=(0,l.parseRegExpString)(e.match);break;case"includes":t=function t(n){return n.includes(e.match)};break;case"starts_with":default:t=function t(n){return(0,f.startsWith)(n,e.match)}}return t}t.isMatchOption=p,t.matchList=y,t.urlMatch=v,t.parseRule2Match=d},function(e,t,n){"use strict";function r(e){return u(e)||a(e)||i(e)||o()}function o(){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 i(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e){if(Array.isArray(e))return c(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.removeComponentListener=t.addComponentListener=t.originalComponent=void 0;var s=n(0),f=n(1),l=new Map;["methods","lifetimes"].forEach((function(e){l.set(e,{})}));var p=["created","attached","ready","moved","detached","error"],y=["onShow","onHide","onPullDownRefresh","onReachBottom","onShareAppMessage","onShareTimeline","onAddToFavorites","onPageScroll","onResize","onTabItemTap","onSaveExitState"].concat(p);function v(e,t){var n=l.get(t);Object.keys(e).forEach((function(t){var r=e[t];!(0,s.isFunction)(r)||y.includes(t)||t in n||(n[t]=[])})),Object.keys(n).forEach((function(o){var i=e;"swan"===f.appName&&Object.defineProperty(i,o,{writable:!0}),"*"===o||("lifetimes"===t&&!(0,s.isFunction)(i[o])&&(!i.lifetimes&&(i.lifetimes={}),i=i.lifetimes),(0,s.interceptFunction)(i,o,(function(){for(var e=this,t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];var u=[].concat(r(n[o]),r(n["*"]||[]));u.forEach((function(t){t.apply(e,i)}))}),!0))}))}function d(e,t){var n;e in(n=p.includes(e)?l.get("lifetimes"):l.get("methods"))||(n[e]=[]),n[e].push(t)}function m(e,t){var n;if(e in(n=p.includes(e)?l.get("lifetimes"):l.get("methods"))){var r=n[e],o=r.indexOf(t);r.splice(o,1)}}t.originalComponent=Component,Component=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];try{var o=n[0]||{};o.methods||(o.methods={}),o.lifetimes||(o.lifetimes={}),v.call(this,o.methods,"methods"),v.call(this,o,"lifetimes")}catch(e){}return t.originalComponent.apply(this,n)},Object.keys(t.originalComponent).forEach((function(e){Component[e]=t.originalComponent[e]})),t.addComponentListener=d,t.removeComponentListener=m},function(e,t,n){e.exports=n(18)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArmsRum=void 0;var r=n(19);Object.defineProperty(t,"ArmsRum",{enumerable:!0,get:function(){return r.ArmsRum}}),t.default=r.default},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){function e(e,n,r,o){var i=n&&n.prototype instanceof t?n:t,s=Object.create(i.prototype);return a(s,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,c=0;!l&&s&&!n&&c<f.length;c++){var n,r=f[c],o=y.p,v=r[2];3<e?(n=v===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=u):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,y.v=t,y.n=r[1]):o<v&&(n=3>e||r[0]>t||t>v)&&(r[4]=e,r[5]=t,y.n=v,i=0))}if(n||1<e)return p;throw l=!0,t}var o,i,a,s=0,f=n||[],l=!1,y={p:0,n:0,v:u,a:r,f:r.bind(u,4),d:function e(t,n){return o=t,i=0,a=u,y.n=n,p}};return function(n,f,v){if(1<s)throw TypeError("Generator is already running");for(l&&1===f&&r(f,v),i=f,a=v;(c=2>i?u:a)||!l;){o||(i?3>i?(1<i&&(y.n=-1),r(i,a)):y.n=a:y.v=a);try{if(s=2,o){if(i||(n="next"),c=o[n]){if(!(c=c.call(o,a)))throw TypeError("iterator result is not an object");if(!c.done)return c;a=c.value,2>i&&(i=0)}else 1===i&&(c=o.return)&&c.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=u}else if((c=(l=0>y.n)?a:e.call(t,y))!==p)break}catch(e){o=u,i=1,a=e}finally{s=1}}return{value:c,done:l}}}(e,r,o),!0),s}function t(){}function n(){}function r(){}function o(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,a(e,l,"GeneratorFunction")),e.prototype=Object.create(v),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var u,c,s="function"==typeof Symbol?Symbol:{},f=s.iterator||"@@iterator",l=s.toStringTag||"@@toStringTag",p={};c=Object.getPrototypeOf;var y=[][f]?c(c([][f]())):(a(c={},f,(function(){return this})),c),v=r.prototype=t.prototype=Object.create(y);return n.prototype=r,a(v,"constructor",r),a(r,"constructor",n),n.displayName="GeneratorFunction",a(r,l,"GeneratorFunction"),a(v),a(v,l,"Generator"),a(v,f,(function(){return this})),a(v,"toString",(function(){return"[object Generator]"})),(i=function t(){return{w:e,m:o}})()}function a(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(a=function e(t,n,r,i){function u(e,n){a(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!i,configurable:!i,writable:!i}):t[n]=r:(u("next",0),u("throw",1),u("return",2))})(e,t,n,r)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}function s(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){var t=l(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function p(e,t,n){return t=m(t),y(e,d()?Reflect.construct(t,n||[],m(e).constructor):t.apply(e,n))}function y(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function t(){return!!e})()}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var b=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):o(e.value).then(a,u)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ArmsRum=void 0;var w=n(0),O=n(32),S=n(33),E=n(35),j=n(37),_=n(40),P=n(41),T=n(42),k=n(43),C=n(44),N=n(45),x=n(46),R=n(1),A=n(47),I=n(3),M=[O.default,S.default,E.default,j.default,_.default,P.default,T.default],L=function(e){function t(){var e;return u(this,t),(e=p(this,t,arguments)).version=R.VERSION,e.updateNetType=function(t){var n=e.getConfig().net||{};e.setConfig("net",Object.assign(Object.assign({},n),{type:t}))},e}return g(t,e),s(t,[{key:"init",value:function e(t){return b(this,void 0,void 0,i().m((function e(){var n;return i().w((function(e){for(;;)switch(e.n){case 0:return this.configManager=new I.default,e.n=1,this.configManager.init(t);case 1:if(!1!==(n=this.configManager.getConfig()).enable){e.n=2;break}return e.a(2);case 2:return this.client.useCollectors(M.map((function(e){return new e}))),this.client.useProcessors([new k.default,new C.default]),this.client.useReporter(new N.default),this.client.init(n,new A.RumSession,this.configManager),(0,x.getNetType)(this.updateNetType),e.a(2,this)}}),e,this)})))}},{key:"getConfig",value:function e(){var t;return null===(t=this.configManager)||void 0===t?void 0:t.getConfig()}},{key:"setConfig",value:function e(){var t=this.configManager;if(t)if(2===arguments.length){var n=t.getConfig();t.setConfig(Object.assign(Object.assign({},n),o({},0>=arguments.length?void 0:arguments[0],1>=arguments.length?void 0:arguments[1])))}else t.setConfig(0>=arguments.length?void 0:arguments[0])}},{key:"getCollector",value:function e(t){return this.client.getCollectors().find((function(e){return e.name===t}))}}])}(w.Shell);t.ArmsRum=L,t.default=new L},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter=void 0;var s=function(){function e(){o(this,e),this.events={}}return a(e,[{key:"on",value:function e(t,n){this.events[t]||(this.events[t]=[]),this.events[t].push(n)}},{key:"emit",value:function e(t){var n=this.events[t];if(n){for(var r=n.slice(),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];for(var u=0;u<r.length;u++)try{r[u].apply(r,i)}catch(e){console.error('Error in handler for "'.concat(t,'":'),e)}}}},{key:"off",value:function e(t,n){var r=this.events[t];if(r)if(n){for(var o=r.length;o--;)r[o]===n&&r.splice(o,1);0===r.length&&delete this.events[t]}else delete this.events[t]}},{key:"once",value:function e(t,n){var r=this,o=function e(){r.off(t,o),n.apply(void 0,arguments)};this.on(t,o)}}])}();t.EventEmitter=s},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function u(n,r,o,a){var u=r&&r.prototype instanceof s?r:s,f=Object.create(u.prototype);return i(f,"_invoke",function(n,r,o){var i,a,u,s=0,f=o||[],l=!1,p={p:0,n:0,v:e,a:y,f:y.bind(e,4),d:function t(n,r){return i=n,a=0,u=e,p.n=r,c}};function y(n,r){for(a=n,u=r,t=0;!l&&s&&!o&&t<f.length;t++){var o,i=f[t],y=p.p,v=i[2];n>3?(o=v===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=y&&((o=n<2&&y<i[1])?(a=0,p.v=r,p.n=i[1]):y<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,p.n=v,a=0))}if(o||n>1)return c;throw l=!0,r}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&y(f,v),a=f,u=v;(t=a<2?e:u)||!l;){i||(a?a<3?(a>1&&(p.n=-1),y(a,u)):p.n=u:p.v=u);try{if(s=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(l=p.n<0)?u:n.call(r,p))!==c)break}catch(t){i=e,a=1,u=t}finally{s=1}}return{value:t,done:l}}}(n,o,a),!0),f}var c={};function s(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(i(t={},r,(function(){return this})),t),y=l.prototype=s.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,a,"GeneratorFunction")),e.prototype=Object.create(y),e}return f.prototype=l,i(y,"constructor",l),i(l,"constructor",f),f.displayName="GeneratorFunction",i(l,a,"GeneratorFunction"),i(y),i(y,a,"Generator"),i(y,r,(function(){return this})),i(y,"toString",(function(){return"[object Generator]"})),(o=function e(){return{w:u,m:v}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,a){function u(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(u("next",0),u("throw",1),u("return",2))})(e,t,n,r)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=f(e,"string");return"symbol"==r(t)?t:t+""}function f(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var l=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):o(e.value).then(a,u)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});var p=n(7),y=n(22),v=n(2),d=n(11),m=n(12),g=3e3,h=20,b=["app","user","device","os","geo","isp","net","properties"],w=function(){function e(){a(this,e),this.name="reporter",this.eventQueue=[],this._init=!1}return c(e,[{key:"getReportCfg",value:function e(){var t=this.ctx.getConfig().reportConfig;return(0,v.isObject)(t)||(t={}),(!t.flushTime||t.flushTime<0||t.flushTime>1e4)&&(t.flushTime=3e3),(!t.maxEventCount||t.maxEventCount<1||t.maxEventCount>100)&&(t.maxEventCount=20),t}},{key:"report",value:function e(t){var n=this;this.ctx=t,this._init||(this.init(t),this._init=!0),clearTimeout(this.timer),this.pushToQueue();var r=this.getReportCfg();this.eventQueue.length>=r.maxEventCount?this.flushEventQueue():this.timer=setTimeout((function(){n.flushEventQueue()}),r.flushTime)}},{key:"pushToQueue",value:function e(){var t=this.ctx,n=this.eventQueue,r=t.getRumEvent();if(r.event_type===p.RumEventType.EXCEPTION){var o=r.message,i=r.stack,a=(0,y.getErrorID)({message:o,stack:i}),u=this.eventQueue.find((function(e){if(e.event_type===p.RumEventType.EXCEPTION){var t=e.message,n=e.stack;return(0,y.getErrorID)({message:t,stack:n})===a}}));if(u)return void u.times++}if(r.event_type===p.RumEventType.ACTION){var c=r.target_name,s=this.eventQueue.find((function(e){if(e.event_type===p.RumEventType.ACTION)return c===e.target_name}));if(s)return void s.times++}n.push(r)}},{key:"flushEventQueue",value:function e(){var t=this.ctx,n=this.eventQueue;if(n.length){var r=t.getViews(),o=r[r.length-1];r.forEach((function(e){var t;e.id===o.id&&n.filter((function(t){var n;return(null===(n=t.view)||void 0===n?void 0:n.id)===e.id})).forEach((function(e){delete e.view}))}));var i=t.session,a;(!i||i.getSampled())&&this.mergeEvent(t,n,o),this.eventQueue=[]}}},{key:"mergeEvent",value:function e(t,n,r){for(var o=t.getConfig(),i=t.session,a=i.getSessionId(),u=0;u<n.length;u++){var c=n[u];c.session_id===a?delete c.session_id:(n.splice(u,1),u--)}if(0!==n.length){var s=(0,m.getUrlParams)(o.endpoint),f=Object.assign({app:{id:o.pid,env:o.env||"prod",version:o.version,type:""},user:{id:i.getUserId()},session:{id:a},net:{},view:r,events:n},s);b.forEach((function(e){var t=o[e];(0,v.isObject)(t)&&Object.keys(t).forEach((function(n){var r=t[n];"user"===e&&"id"===n||("properties"===e?f[e]=(0,d.verifyProperties)(t):((0,v.isString)(r)||(0,v.isNumber)(r))&&(e in f||(f[e]={}),f[e][n]=r))}))})),("function"!=typeof o.beforeReport||(f=o.beforeReport(f)))&&this.tryRequest(f)}}},{key:"tryRequest",value:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r,i,a;return l(this,void 0,void 0,o().m((function e(){var u=this,c,s,f,l;return o().w((function(e){for(;;)switch(e.p=e.n){case 0:return c=null===(r=this.ctx.getConfig())||void 0===r?void 0:r.reportConfig,s=null!==(i=null==c?void 0:c.maxRetryCount)&&void 0!==i?i:0,f=null!==(a=null==c?void 0:c.retryDelay)&&void 0!==a?a:3e3,e.p=1,t._retry=n,e.n=2,this.request(this.ctx,t);case 2:e.n=4;break;case 3:e.p=3,l=e.v,n<s-1&&setTimeout((function(){return u.tryRequest(t,n+1)}),f);case 4:return e.a(2)}}),e,this,[[1,3]])})))}},{key:"init",value:function e(t){}}])}();t.default=w},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorID=void 0;var r=function e(t){var n=t.message,r=void 0===n?"":n,o=t.stack,i;return r+(void 0===o?"":o)};t.getErrorID=r},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(7),f=n(8),l=n(2),p=function(){function e(t){o(this,e),this.client=new f.default,t&&this.init&&this.init(t)}return a(e,[{key:"sendEvent",value:function e(t){this.client&&this.client.sendEvent(t)}},{key:"getConfig",value:function e(){if(this.client)return this.client.getContext().getConfig()}},{key:"sendCustom",value:function e(t){if(t.name&&t.type){var n=Object.assign(Object.assign({},t),{event_type:s.RumEventType.CUSTOM});this.sendEvent(n)}}},{key:"sendView",value:function e(t){if((0,l.isObject)(t)){if(t.type||(t.type="custom"),"custom"===t.type){var n=0;if(["t1","t2","t3"].forEach((function(e){(0,l.isNumber)(t[e])||delete t[e],e in t&&n++})),0===n)return}var r=Object.assign(Object.assign({},t),{event_type:s.RumEventType.VIEW});this.sendEvent(r)}}},{key:"sendException",value:function e(t){if(t.name&&t.message){var n=t.name,r=t.message,o=t.stack,i=Object.assign(Object.assign({times:1,name:n,message:r,stack:o},t),{event_type:s.RumEventType.EXCEPTION,type:"custom",source:"custom"});this.sendEvent(i)}}},{key:"sendResource",value:function e(t){if(t.name&&t.type&&(0,l.isNumber)(t.duration)){var n=Object.assign(Object.assign({times:1},t),{event_type:s.RumEventType.RESOURCE});this.sendEvent(n)}}}])}();t.default=p},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function u(n,r,o,a){var u=r&&r.prototype instanceof s?r:s,f=Object.create(u.prototype);return i(f,"_invoke",function(n,r,o){var i,a,u,s=0,f=o||[],l=!1,p={p:0,n:0,v:e,a:y,f:y.bind(e,4),d:function t(n,r){return i=n,a=0,u=e,p.n=r,c}};function y(n,r){for(a=n,u=r,t=0;!l&&s&&!o&&t<f.length;t++){var o,i=f[t],y=p.p,v=i[2];n>3?(o=v===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=y&&((o=n<2&&y<i[1])?(a=0,p.v=r,p.n=i[1]):y<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,p.n=v,a=0))}if(o||n>1)return c;throw l=!0,r}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&y(f,v),a=f,u=v;(t=a<2?e:u)||!l;){i||(a?a<3?(a>1&&(p.n=-1),y(a,u)):p.n=u:p.v=u);try{if(s=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(l=p.n<0)?u:n.call(r,p))!==c)break}catch(t){i=e,a=1,u=t}finally{s=1}}return{value:t,done:l}}}(n,o,a),!0),f}var c={};function s(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(i(t={},r,(function(){return this})),t),y=l.prototype=s.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,a,"GeneratorFunction")),e.prototype=Object.create(y),e}return f.prototype=l,i(y,"constructor",l),i(l,"constructor",f),f.displayName="GeneratorFunction",i(l,a,"GeneratorFunction"),i(y),i(y,a,"Generator"),i(y,r,(function(){return this})),i(y,"toString",(function(){return"[object Generator]"})),(o=function e(){return{w:u,m:v}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,a){function u(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(u("next",0),u("throw",1),u("return",2))})(e,t,n,r)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=f(e,"string");return"symbol"==r(t)?t:t+""}function f(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var l=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):o(e.value).then(a,u)}c((r=r.apply(e,t||[])).next())}))};function p(e){var t=e.remoteConfig||{};return{enable:!1!==t.enable&&!(!t.url&&!t.region),url:t.url||"",mode:t.mode||"launch-first",cacheTimeout:t.cacheTimeout||36e5,region:t.region}}Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigManager=void 0;var y=function(){function e(){a(this,e),this.currentConfig=null,this.initialized=!1}return c(e,[{key:"init",value:function e(t){return l(this,void 0,void 0,o().m((function e(){var n=this,r,i,a;return o().w((function(e){for(;;)switch(e.n){case 0:if(!this.initialized){e.n=1;break}return e.a(2);case 1:if(this.currentConfig=Object.assign({},t),this.initialized=!0,r=p(t),this.currentConfig.remoteConfig=r,r.enable){e.n=2;break}return e.a(2);case 2:return e.n=3,this.getCacheConfig();case 3:if((i=e.v)&&i.content&&(this.currentConfig=this.mergeRemoteCfg(i.content)),!this.isCacheValid(i,r.cacheTimeout)){e.n=4;break}return e.a(2);case 4:if(a=this.fetchRemoteCfg(this.currentConfig).then((function(e){if(e){var t=n.parseConfig(e);n.currentConfig=n.mergeRemoteCfg(t),n.setCacheConfig({timestamp:Date.now(),content:e})}})),"remote-first"!==r.mode){e.n=5;break}return e.n=5,a;case 5:return e.a(2)}}),e,this)})))}},{key:"getConfig",value:function e(){if(!this.currentConfig)throw new Error("Config not initialized");return this.currentConfig}},{key:"setConfig",value:function e(t){return l(this,void 0,void 0,o().m((function e(){return o().w((function(e){for(;;)switch(e.n){case 0:if(this.currentConfig){e.n=1;break}return e.a(2);case 1:this.currentConfig=Object.assign(Object.assign({},this.currentConfig),t);case 2:return e.a(2)}}),e,this)})))}},{key:"isCacheValid",value:function e(t,n){if(!t||!t.timestamp)return!1;var r=n||36e5;return Date.now()-t.timestamp<r}},{key:"mergeRemoteCfg",value:function e(t){var n=this.currentConfig,r=n.pid,o=n.app,i=n.endpoint,a=n.remoteConfig,u=n.beforeReport,c=n.properties;return Object.assign(Object.assign(Object.assign({},this.currentConfig),t),{pid:r,app:o,endpoint:i,remoteConfig:a,beforeReport:u,properties:c})}},{key:"destroy",value:function e(){this.currentConfig=null,this.initialized=!1}}])}();t.ConfigManager=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";function r(e){return 0!==e&&100*Math.random()<=e}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!e)return e;var r=e.toString(),o=r.indexOf(".");r=-1!==o?r.substring(0,t+o+1):r.substring(0);var i=parseFloat(r);return i>=n?i:void 0}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNumber=t.performDraw=t.ONE_DAY=t.ONE_HOUR=t.ONE_MINUTE=t.ONE_SECOND=void 0,t.ONE_SECOND=1e3,t.ONE_MINUTE=60*t.ONE_SECOND,t.ONE_HOUR=60*t.ONE_MINUTE,t.ONE_DAY=24*t.ONE_HOUR,t.performDraw=r,t.formatNumber=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTracingOptions=t.makeTracingHeaders=t.isTraceOption=void 0;var r=n(15),o=n(2);function i(e){return e&&(0,r.isMatchOption)(e.match)&&(0,o.isArray)(e.propagatorTypes)}function a(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a={},u=n?"1":"0";return r.includes("sw8")&&(r=["sw8"]),(0,o.isArray)(r)||(r=[r]),r.forEach((function(n){switch(n){case"jaeger":a["uber-trace-id"]="".concat(e,":").concat(t,":0:").concat(u);break;case"b3":a.b3="".concat(e,"-").concat(t,"-").concat(u);break;case"b3multi":a["X-B3-TraceId"]=e,a["X-B3-SpanId"]=t,a["X-B3-Sampled"]=u;break;case"sw8":if((0,o.isFunction)(btoa)){var r=btoa(e),c=btoa(t),s=btoa(i.appId),f=btoa(i.appVersion),l=btoa(i.viewName),p=btoa(i.host);a.sw8="".concat(u,"-").concat(r,"-").concat(c,"-",0,"-").concat(s,"-").concat(f,"-").concat(l,"-").concat(p)}break;case"tracecontext":default:a.traceparent="00-".concat(e,"-").concat(t,"-0").concat(u),i.tracestate&&(a.tracestate=i.tracestate)}})),i.baggage&&(a.baggage=i.baggage),a}function u(e){var t=["tracecontext"];if((0,o.isBoolean)(e)||!e)return{enable:!!e,sample:100,propagatorTypes:t,allowedUrls:[],tracestate:!0,baggage:!1};var n=e.enable,a=void 0===n||n,u=e.sample,c=void 0===u?100:u,s=e.propagatorTypes,f=void 0===s?t:s,l=e.allowedUrls,p=void 0===l?[]:l,y=e.tracestate,v=void 0===y||y,d=e.baggage,m=void 0!==d&&d,g=[];return(0,o.isArray)(p)&&p.length&&p.forEach((function(e){(0,r.isMatchOption)(e)?g.push({match:e,propagatorTypes:f}):i(e)&&g.push(e)})),{enable:!(0,o.isBoolean)(a)||a,sample:(0,o.isNumber)(c)?c:100,propagatorTypes:f,allowedUrls:g,tracestate:v,baggage:m}}t.isTraceOption=i,t.makeTracingHeaders=a,t.parseTracingOptions=u},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),f=n(4),l=n(5),p=function(){function e(){var t=this;o(this,e),this.name="pv-collector",this.onUnload=function(){var e=(0,f.getCurView)(t.ctx);t.ctx.removeView(e.id)},this.sendPv=function(){var e=(0,f.getCurPage)();if(e){var n=e.route,r=e.options,o=(0,f.getRumViewId)(e);if(!t.prevPage||o!==t.prevPage.viewId){var i=o?"route_back":"initial_load";o=(0,f.getRumViewId)(e,t.ctx.session),t.prevPage={route:n,viewId:o};var a=t.getViewName(n);t.ctx.addView({id:o,name:a});var u={};!r&&(0,s.isFunction)(e.getLoadOptions)&&(r=e.getLoadOptions()),r&&Object.keys(r).forEach((function(e){u[e]=decodeURIComponent(r[e])})),t.sendEvent({event_type:s.RumEventType.VIEW,type:"pv",url:n,name:a,loading_type:i,snapshots:JSON.stringify(u).substring(0,5e3)})}}}}return a(e,[{key:"setup",value:function(e,t){this.ctx=e,this.sendEvent=t,this.sendPv(),(0,l.addPageListener)("onLoad",this.sendPv),(0,l.addPageListener)("onUnload",this.onUnload)}},{key:"getViewName",value:function(e){var t,n=this.ctx.getConfig().parseViewName,r=e;return(0,s.isFunction)(n)&&(r=n(e)),r}},{key:"destroy",value:function(){(0,l.removePageListener)("onLoad",this.sendPv),(0,l.removePageListener)("onUnload",this.onUnload)}}])}();t.default=p},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),f=n(1),l=n(4),p=n(5),y=n(6),v=n(34),d=n(3),m=(0,f.getPerformance)(),g=function(){function e(){var t=this;o(this,e),this.name="perf-collector",this.currentViewId="",this.pageIdToViewId={},this.delayHandler=function(e){var n=(0,s.isArray)(e)?e:e.getEntries();Array.isArray(n)&&0!==n.length&&setTimeout((function(){n.forEach((function(e){if(e.pageId){var n=t.pageIdToViewId["pageId:".concat(e.pageId)];if(n&&t.perfCache[n])return void t.perfCache[n].entries.push(e)}if(t.currentViewId){var r=t.perfCache[t.currentViewId];if(r){var o=e.path;o||"navigation"!==e.entryType||(o=e.name),r.path!==o||r.entries.push(e)}}}))}),v.COMMON_DELAY)},this.onLoad=function(){var e=(0,l.getCurPage)(),n=(0,l.getCurView)(t.ctx),r=(0,l.getRumViewId)(e,t.ctx.session),o=(0,s.isFunction)(e.getPageId)?e.getPageId():null;r in t.perfCache||(t.currentViewId=r,o&&(t.pageIdToViewId[o.toString()]=r),t.perfCache[r]={view:n,path:e.is||e.route,pageId:o,entries:[],timer:setTimeout((function(){t.flushByViewId(r)}),s.ONE_MINUTE),loadTime:(0,y.getCurrentTime)()})},this.onReady=function(){var e=t.currentViewId;if(e){var n=t.perfCache[e];n&&(n.dom_complete=(0,y.getCurrentTime)()-n.loadTime)}},this.flushByViewId=function(e){var n=t.perfCache[e];n&&(t.perfCache[e]=!1,clearTimeout(n.timer),n.entries.length&&t.parsePerf(n))}}return a(e,[{key:"setup",value:function(e,t){if((0,d.checkEnable)(e,"perf")){var n=this;if(this.ctx=e,this.sendEvent=t,m&&m.getEntries){this.perfCache={};var r,o=f.appName===f.wechatName||f.appName===f.alipayName;if(o)r=["navigation","render"];else if(f.appName===f.bytedanceName)r=["launch","paint","navigation"];else{if(f.appName!==f.ksName)return;r=["paint","navigation"]}this.delayHandler(m.getEntries().filter((function(e){return r.includes(e.entryType)}))),this.perfObserver=m.createObserver(this.delayHandler),this.perfObserver.observe({entryTypes:r}),this.onUnload=function(){if(!o){var t=(0,l.getRumViewId)(this,e.session);t&&n.flushByViewId(t)}},(0,p.addPageListener)("onLoad",this.onLoad),(0,p.addPageListener)("onReady",this.onReady),(0,p.addPageListener)("onHide",this.onUnload),(0,p.addPageListener)("onUnload",this.onUnload)}}}},{key:"parsePerf",value:function(e){var t,n,r,o,i,a=e.entries,u=e.view,c=e.dom_complete;a.forEach((function(e){if(e.startTime)switch(e.name){case"firstRender":case"first-render":n=e;break;case"firstPaint":case"first-paint":r=e;break;case"firstContentfulPaint":case"first-contentful-paint":o=e;break;case"largestContentfulPaint":case"largest-contentful-paint":if(i&&i.startTime>e.startTime)break;i=e;break;default:"navigation"===e.entryType&&(t=e)}}));var s={};t&&(n&&(s.first_render=n.duration?n.duration:n.startTime-t.startTime),r&&(s.first_paint=r.startTime-t.startTime),o&&(s.first_contentful_paint=o.startTime-t.startTime),i&&(s.largest_contentful_paint=i.startTime-t.startTime),c&&(s.dom_complete=c),this.sendPerf(s,{view:u,timestamp:t.startTime,timing_data:JSON.stringify(t)}))}},{key:"sendPerf",value:function(e,t){for(var n=Object.keys(e),r=0;r<n.length;r++){var o=n[r],i=e[o];(0>=i||isNaN(i)||6e5<i)&&delete e[o]}if(Object.keys(e)){var a=this.ctx.session.getBaseEvent();this.sendEvent(Object.assign(Object.assign(Object.assign(Object.assign({},a),{event_type:s.RumEventType.VIEW,type:"perf"}),t),e))}}},{key:"destroy",value:function(){this.perfObserver&&this.perfObserver.disconnect(),(0,p.removePageListener)("onLoad",this.onLoad),(0,p.removePageListener)("onReady",this.onReady),(0,p.removePageListener)("onHide",this.onUnload),(0,p.removePageListener)("onUnload",this.onUnload)}}])}();t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COMMON_DELAY=void 0,t.COMMON_DELAY=200},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),f=n(36),l=n(1),p=n(3),y=function(){function e(){var t=this;o(this,e),this.name="exception-collector",this.origin={consoleError:console.error},this.events={onError:null,onUnhandledRejection:null,onPageNotFound:null,onLazyLoadError:null},this.onError=function(e,n){var r=e;(0,s.isString)(r)&&(0,s.isString)(n)&&(r=n),t.errorHandle(r,"onError")},this.errorHandle=function(e){var n,r,o,i,a,u,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(e instanceof Object)n=e.name,r=e.message,o=e.filename||e.fileName,i=e.stack,a=e.lineno||e.lineNumber,u=e.colno||e.columnNumber;else if("string"==typeof e){i=e;var f=t.getErrorByStack(e);f&&(n=f.name,r=f.message)}if(n&&r&&!t.errorFilter(e)){var l=t.ctx.session.getBaseEvent();t.sendEvent(Object.assign(Object.assign({},l),{event_type:s.RumEventType.EXCEPTION,source:c,type:"error",name:n,message:r,file:o,stack:i,line:a,column:u}))}}}return a(e,[{key:"setup",value:function(e,t){this.ctx=e,this.sendEvent=t,this.hackOrigin()}},{key:"hackOrigin",value:function(){var e=this,t=this;(0,p.checkEnable)(this.ctx,"jsError")&&((0,s.isFunction)(l.sdk.onError)&&"undefined"==typeof uni?l.sdk.onError(this.onError):Object.keys(this.events).forEach((function(n){e.events[n]=function(e){e.reason&&e.reason instanceof Error&&(e=e.reason),t.errorHandle(e,n)},(0,f.addAppListener)(n,e.events[n])}))),(0,p.checkEnable)(this.ctx,"consoleError")&&("swan"===l.appName&&Object.defineProperty(console,"error",{writable:!0}),(0,s.interceptFunction)(console,"error",(function(e){t.errorHandle(e,"console.error")})))}},{key:"getErrorByStack",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=e.split("\n");if(!(2>t.length))for(var n=1;n<t.length;n++)if(t[n].trim().startsWith("at ")){var r=t[n-1],o=r.indexOf(": ");return{name:r.substring(0,o),message:r.substring(o+2)}}}},{key:"errorFilter",value:function(e){var t,n=(this.ctx.getConfig().filters||{}).exception;return!!n&&((0,s.isArray)(n)||(n=[n]),(0,s.matchList)(n,e.name,!0,e)||(0,s.matchList)(n,e.message,!0,e)||(0,s.matchList)(n,e.stack,!0,e))}},{key:"destroy",value:function(){var e=this,t=this.origin;t.consoleError&&(console.error=t.consoleError),(0,s.isFunction)(l.sdk.offError)&&l.sdk.offError(this.onError),Object.keys(this.events).forEach((function(t){(0,s.isFunction)(e.events[t])&&(0,f.removeAppListener)(t,e.events[t])}))}}])}();t.default=y},function(e,t,n){"use strict";function r(e){return u(e)||a(e)||i(e)||o()}function o(){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 i(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e){if(Array.isArray(e))return c(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.removeAppListener=t.addAppListener=t.originalApp=void 0;var s=n(0),f=n(1),l={onLaunch:[],"*":[]};function p(e){Object.keys(l).forEach((function(t){"swan"===f.appName&&Object.defineProperty(e,t,{writable:!0}),"*"===t||(0,s.interceptFunction)(e,t,(function(){for(var e=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=[].concat(r(l[t]),r(l["*"]));a.forEach((function(t){t.apply(e,o)}))}),!0)}))}function y(e,t){e in l||(l[e]=[]),l[e].push(t)}function v(e,t){if(e in l){var n=l[e],r=n.indexOf(t);n.splice(r,1)}}t.originalApp=App,App=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];try{p.apply(this,n)}catch(e){}return t.originalApp.apply(this,n)},Object.keys(t.originalApp).forEach((function(e){App[e]=t.originalApp[e]})),t.addAppListener=y,t.removeAppListener=v},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return c(e)||u(e)||a(e)||i()}function i(){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 a(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function u(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function c(e){if(Array.isArray(e))return s(e)}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(){function e(e,n,r,o){var u=n&&n.prototype instanceof t?n:t,c=Object.create(u.prototype);return l(c,"_invoke",function(e,t,n){function r(e,t){for(u=e,c=t,a=0;!l&&s&&!n&&a<f.length;a++){var n,r=f[a],o=y.p,v=r[2];3<e?(n=v===t)&&(c=r[(u=r[4])?5:(u=3,3)],r[4]=r[5]=i):r[0]<=o&&((n=2>e&&o<r[1])?(u=0,y.v=t,y.n=r[1]):o<v&&(n=3>e||r[0]>t||t>v)&&(r[4]=e,r[5]=t,y.n=v,u=0))}if(n||1<e)return p;throw l=!0,t}var o,u,c,s=0,f=n||[],l=!1,y={p:0,n:0,v:i,a:r,f:r.bind(i,4),d:function e(t,n){return o=t,u=0,c=i,y.n=n,p}};return function(n,f,v){if(1<s)throw TypeError("Generator is already running");for(l&&1===f&&r(f,v),u=f,c=v;(a=2>u?i:c)||!l;){o||(u?3>u?(1<u&&(y.n=-1),r(u,c)):y.n=c:y.v=c);try{if(s=2,o){if(u||(n="next"),a=o[n]){if(!(a=a.call(o,c)))throw TypeError("iterator result is not an object");if(!a.done)return a;c=a.value,2>u&&(u=0)}else 1===u&&(a=o.return)&&a.call(o),2>u&&(c=TypeError("The iterator does not provide a '"+n+"' method"),u=1);o=i}else if((a=(l=0>y.n)?c:e.call(t,y))!==p)break}catch(e){o=i,u=1,c=e}finally{s=1}}return{value:a,done:l}}}(e,r,o),!0),c}function t(){}function n(){}function r(){}function o(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,l(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var i,a,u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.toStringTag||"@@toStringTag",p={};a=Object.getPrototypeOf;var y=[][c]?a(a([][c]())):(l(a={},c,(function(){return this})),a),v=r.prototype=t.prototype=Object.create(y);return n.prototype=r,l(v,"constructor",r),l(r,"constructor",n),n.displayName="GeneratorFunction",l(r,s,"GeneratorFunction"),l(v),l(v,s,"Generator"),l(v,c,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),(f=function t(){return{w:e,m:o}})()}function l(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(l=function e(t,n,r,i){function a(e,n){l(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!i,configurable:!i,writable:!i}):t[n]=r:(a("next",0),a("throw",1),a("return",2))})(e,t,n,r)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d(n.key),n)}function v(e,t,n){return t&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=m(e,"string");return"symbol"==r(t)?t:t+""}function m(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var g=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):o(e.value).then(a,u)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});var h=n(0),b=n(1),w=n(38),O=n(6),S=n(4),E=n(39),j=n(3),_=function(){function e(){var t=this;p(this,e),this.name="api-collector",this.origin={request:b.default.request,httpRequest:b.default.httpRequest},this.sendApi=function(e,n,r){return g(t,void 0,void 0,f().m((function t(){var o,i,a,u,c,s,l,p,y,v,d,m,g,b,w;return f().w((function(t){for(;;)switch(t.p=t.n){case 0:if(o=this.ctx.getConfig(),i=o.evaluateApi,a=n.statusCode,u=n.status,c=n.errMsg,s=n.errorMessage,l=n.message,(p=n.profile)&&(y=this.parseProfile(p),v=JSON.stringify(p)),!(0,h.isFunction)(i)){t.n=4;break}return t.p=1,0===e.success&&(d=new Error("request error")),t.n=2,i(r,n,d);case 2:m=t.v,e=Object.assign(Object.assign({},e),(0,E.reviseApiAttr)(m)),t.n=4;break;case 3:t.p=3,w=t.v;case 4:if(g=this.ctx.session.getBaseEvent(),!((b=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g),{event_type:h.RumEventType.RESOURCE,type:"api",status_code:u||a,message:s||c||l,duration:(0,O.getCurrentTime)()-e.timestamp}),e),y),{timing_data:v})).duration>h.ONE_HOUR)){t.n=5;break}return t.a(2);case 5:this.sendEvent(b);case 6:return t.a(2)}}),t,this,[[1,3]])})))}}return v(e,[{key:"setup",value:function e(t,n){var r=this;(0,j.checkEnable)(t,"api")&&(this.ctx=t,this.sendEvent=n,Object.keys(this.origin).forEach((function(e){return r.hackRequest(e)})))}},{key:"injectTracing",value:function e(t,n){var r,o=this.ctx.session,i=this.ctx.getConfig(),a=i.tracing,u=i.pid,c=i.version,s=void 0===c?"1.0.0":c,f=(0,h.parseTracingOptions)(a),l=f.enable,p=f.sample,y=f.propagatorTypes,v=f.allowedUrls,d=f.tracestate,m=!(void 0!==d)||d,g=f.baggage,w=void 0!==g&&g;if(l){var O=(0,h.find)(v,(function(e){return(0,h.matchList)([e.match],t.url)}));if(O){var S=O.propagatorTypes;0===S.length&&(S=y);var E=!1;S.includes("sw8")&&(S=["sw8"],E=!0);var j=E?(0,h.generateGUID)():(0,h.generateTraceId)(),_=E?(0,h.generateGUID)():(0,h.generateSpanId)(),P=(0,h.performDraw)(p),T=o.getUserId(),k=o.getSessionId(),C=m?"rum=v2&miniapp&".concat(u,"&").concat(k,"&").concat(T):void 0,N=w?"rum=v2,appType=miniapp,pid=".concat(u,",sid=").concat(k,",uid=").concat(T):void 0,x=(0,h.makeTracingHeaders)(j,_,P,S,{tracestate:C,baggage:N,appId:u,appVersion:s,viewName:null===(r=t.view)||void 0===r?void 0:r.name,host:"miniapp_".concat(b.appName)});P&&(t.trace_id=j,t.trace_data=JSON.stringify({spanId:_,sample:p,sampled:P,headers:x})),n(x)}}}},{key:"hackRequest",value:function e(t){var n=this;(0,h.isFunction)(b.default[t])&&Object.defineProperty(b.default,t,{configurable:!0,enumerable:!0,writable:!0,value:function e(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return o[0]=n.rebuildRequestOptions(o[0]),n.origin[t].apply(this,o)}})}},{key:"rebuildRequestOptions",value:function e(t){var n=this,r=t.url,o=t.success,i=t.fail,a=(0,O.getCurrentTime)();if((0,w.isEndpoint)(this.ctx,r)||n.filter(r))return t;var u=Object.assign({},t),c={view:(0,S.getCurView)(this.ctx),timestamp:a,url:r,name:this.getResourceName(r),method:t.method||"GET"};return this.injectTracing(c,(function(e){var t=[];["headers","header"].forEach((function(n){n in u&&(0,h.isObject)(u[n])&&(u[n]=Object.assign(Object.assign({},u[n]),e),t.push(n))})),0===t.length&&(u[b.HEADER_KEY]=Object.assign(Object.assign({},u[b.HEADER_KEY]),e))})),u.success=function(){c.success=1;for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];n.sendApi(c,t[0],u),o&&o.apply(this,t)},u.fail=function(){c.success=0;for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];n.sendApi(c,t[0],u),i&&i.apply(this,t)},u}},{key:"getResourceName",value:function e(t){var n,r,o=this.ctx.getConfig().parseResourceName;return n=(0,h.isFunction)(o)?o(t):(0,w.getPathByURL)(t)}},{key:"parseProfile",value:function e(t){function n(e,n){e in t&&0<t[e]&&(o[n]=t[e])}function r(e,n,r){if(e in t&&e in t){var i=t[n]-t[e];0<i&&(o[r]=i)}}var o={};return n("domainLookup","dns_duration"),n("connect","connect_duration"),n("SSLconnection","ssl_duration"),n("Waiting","first_byte_duration"),n("totalTime","duration"),n("receivedBytedCount","size"),r("connectStart","connectEnd","connect_duration"),r("SSLconnectionStart","SSLconnectionEnd","ssl_duration"),r("domainLookUpStart","domainLookUpEnd","dns_duration"),r("redirectStart","redirectEnd","redirect_duration"),r("responseStart","requestStart","first_byte_duration"),r("responseStart","requestEnd","download_duration"),r("redirectStart","responseEnd","duration"),Object.keys(o).forEach((function(e){o[e]>h.ONE_HOUR&&delete o[e]})),o}},{key:"filter",value:function e(t){var n,r,i=this.ctx.getConfig(),a=(null===(n=null==i?void 0:i.filters)||void 0===n?void 0:n.resource)||[];(0,h.isArray)(a)||(a=[a]);var u=null===(r=null==i?void 0:i.collectors)||void 0===r?void 0:r.api;return(0,h.isObject)(u)&&(0,h.isArray)(u.filters)&&(a=[].concat(o(a),o(u.filters))),(0,h.urlMatch)(t,a)}}])}();t.default=_},function(e,t,n){"use strict";function r(e){var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1];try{var n=a(e);return t?n.hash:n.pathname}catch(e){return""}}function o(e,t){var n,r=e.getConfig().endpoint;try{return a(t).hostname===a(r).hostname}catch(e){return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.getURL=t.isEndpoint=t.getPathByURL=void 0,t.getPathByURL=r,t.isEndpoint=o;var i=/^(?:([^:\/?#]+):\/\/)?((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?)?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i;function a(e){var t=decodeURIComponent(e).match(i),n,r=(t[3]||"").split(":").length?(t[2]||"").replace(/(.*\@)/,""):t[2];return{uri:t[0],protocol:t[1],host:r,hostname:t[4],port:t[5],pathname:t[6],search:t[7],hash:t[8]}}t.getURL=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviseApiAttr=void 0;var r=n(0);function o(e){if((0,r.isObject)(e)){var t={};(0,r.isString)(e.name)&&(t.name=e.name.substring(0,1e3)),(0,r.isString)(e.message)&&(t.message=e.message.substring(0,1e3)),"success"in e&&(t.success=e.success?1:0),(0,r.isNumber)(e.duration)&&0<=e.duration&&(t.duration=e.duration),(0,r.isString)(e.status_code)&&(t.status_code=e.status_code.substring(0,100)),(0,r.isNumber)(e.status_code)&&(t.status_code=e.status_code),(0,r.isString)(e.snapshots)&&(t.snapshots=e.snapshots.substring(0,5e3));var n=(0,r.verifyProperties)(e.properties);return n&&(t.properties=n),t}}t.reviseApiAttr=o},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),f=n(5),l=n(3),p=function(){function e(){var t=this;o(this,e),this.name="action-collector",this.DELAY_TIME=300,this.events=["tap"],this.onEvent=function(e){if(e&&t.events.includes(e.type)&&e.target){var n=e.target,r=e.currentTarget,o=e.type,i=r.dataset,a=r.id;if(a||r===n||(a=n.id,i=n.dataset),!a)return;var u=t.ctx.session.getBaseEvent(),c=Object.assign(Object.assign({},u),{event_type:s.RumEventType.ACTION,type:o,name:a,snapshots:JSON.stringify({dataset:i}).substring(0,1e3)});clearTimeout(t.timer),t.lastEvent?t.lastEvent.name===c.name?t.lastEvent.times+=1:t.sendAction():t.lastEvent=c,t.timer=setTimeout(t.sendAction,t.DELAY_TIME)}},this.sendAction=function(){t.sendEvent(t.lastEvent),t.lastEvent=null}}return a(e,[{key:"setup",value:function(e,t){(0,l.checkEnable)(e,"action")&&(this.ctx=e,this.sendEvent=t,(0,f.addPageListener)("*",this.onEvent))}},{key:"destroy",value:function(){(0,f.removePageListener)("*",this.onEvent)}}])}();t.default=p},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),f=n(1),l=n(3),p=function(){function e(){var t=this;o(this,e),this.name="application-collector",this.observerHandler=function(e){var n,r,o=(0,s.isArray)(e)?e:e.getEntries();if((0,s.isFunction)(f.default.getLaunchOptionsSync)&&(r=null===(n=f.default.getLaunchOptionsSync())||void 0===n?void 0:n.scene),Array.isArray(o)&&0<o.length)for(var i,a=0;a<o.length;a++)if("number"==typeof(i=o[a]).duration&&0<i.duration){var u=t.ctx.session.getBaseEvent(),c=Object.assign(Object.assign({},u),{event_type:s.RumEventType.APPLICATION,state:"",duration:0,snapshots:JSON.stringify(i),scene:r});switch(i.name){case"appLaunch":case"app-click":c.state="cold_lunch",c.duration=i.duration;break;case"downloadPackage":case"miniprogram-package":case"download":c.state="download_package",c.duration=i.duration;break;case"evaluateScript":case"app-service":var l;"__APP__"===(i.moduleName||i.packageName)&&(c.state="evaluate_script",c.duration=i.duration)}c.state&&0<c.duration&&6e5>c.duration&&t.sendEvent(c)}}}return a(e,[{key:"setup",value:function(e,t){if((0,l.checkEnable)(e,"application")){this.ctx=e,this.sendEvent=t;var n=(0,f.getPerformance)();if(n&&(0,s.isFunction)(n.createObserver)){var r=[];if(f.appName===f.wechatName||f.appName===f.alipayName)r=["navigation","script","loadPackage"];else if(f.appName===f.bytedanceName)r=["launch","evaluate","resource"];else{if(f.appName!==f.ksName)return;r=["navigation","resource"]}this.observerHandler(n.getEntries().filter((function(e){return r.includes(e.entryType)}))),this.perfObserver=n.createObserver(this.observerHandler),this.perfObserver.observe({entryTypes:r})}}}},{key:"destroy",value:function(){this.perfObserver&&this.perfObserver.disconnect()}}])}();t.default=p},function(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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,u=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){c=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function o(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}function s(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){var t=l(e,"string");return"symbol"==a(t)?t:t+""}function l(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var p=n(0),y=n(5),v=n(16),d=n(4),m=n(6),g=n(3),h=5,b=50,w=function(){function e(){var t=this;u(this,e),this.name="render-block-collector",this.renderBlockReportLimitMap=new Map,this.onLoad=function(){var e,n=(0,d.getCurPage)(),r=(0,d.getRumViewId)(n,t.ctx.session),o=null===(e=(0,d.getViewById)(r,t.ctx))||void 0===e?void 0:e.name,i=t.renderBlockReportLimitMap;r&&o&&!i.has(r)&&i.set(r,{count:0,name:o})},this.onSetData=function(e){return e&&(0,p.isFunction)(e.setUpdatePerformanceListener)?void e.setUpdatePerformanceListener({withDataPaths:!0},(function(n){var r=n||{},o=r.updateEndTimestamp,i=r.pendingStartTimestamp,a=r.dataPaths,u=void 0===a?[]:a,c=o-i;if((0,p.isNumber)(c)&&!(c<t.renderThreshold)){var s=(0,d.getCurPage)(),f=(0,d.getRumViewId)(s,t.ctx.session);if(t.renderBlockReportLimitMap.has(f)){var l=t.renderBlockReportLimitMap.get(f),y=l.count,v=l.name;if(!(y>t.maxEventCount)){t.renderBlockReportLimitMap.set(f,{count:y+1,name:v});var g=t.ctx.session.getBaseEvent(),h=e.data,b=S(u,h);t.sendEvent(Object.assign(Object.assign({},g),{event_type:p.RumEventType.LONG_TASK,type:"render",duration:c,message:e.is||e.route||"",snapshots:JSON.stringify(Object.assign(Object.assign({},E(n)),b?{data:b}:{})),timestamp:i||(0,m.getCurrentTime)(),source:"setData",view:{id:f,name:v}}))}}}})):void t.destroy()},this.onUnload=function(){var e=(0,d.getCurPage)(),n=(0,d.getRumViewId)(e,t.ctx.session);t.renderBlockReportLimitMap.delete(n)}}return s(e,[{key:"setup",value:function(e,t){var n,r=e.getConfig().longTaskConfig,o=void 0===r?{}:r;if((0,g.checkEnable)(e,"longTask")){var i=this;this.ctx=e,this.sendEvent=t;var a=O(o),u=a.maxEventCount,c=a.renderThreshold;this.maxEventCount=u,this.renderThreshold=c,this._onSetData=function(){i.onSetData(this)},(0,y.addPageListener)("onLoad",this.onLoad),(0,y.addPageListener)("onReady",this._onSetData,!0),(0,y.addPageListener)("onUnload",this.onUnload),(0,v.addComponentListener)("attached",this._onSetData)}}},{key:"destroy",value:function(){(0,y.removePageListener)("onLoad",this.onLoad),(0,y.removePageListener)("onReady",this._onSetData,!0),(0,y.removePageListener)("onUnload",this.onUnload),(0,v.removeComponentListener)("attached",this._onSetData)}}])}();t.default=w;var O=function(e){var t=e||{},n=t.maxEventCount,r=t.renderThreshold;return(!n||!(0,p.isNumber)(n)||1>n||n>b)&&(e.maxEventCount=h),r&&(0,p.isNumber)(r)&&!(r<b)||(e.renderThreshold=b),e},S=function(e,t){try{return e.map((function(e){var n,o="",i=t,a=r(e);try{for(a.s();!(n=a.n()).done;){var u=n.value;o+=o?".".concat(u):u,i=null==i?void 0:i[u]}}catch(e){a.e(e)}finally{a.f()}return{dataKey:o,dataLength:JSON.stringify(i).length}}))}catch(e){return""}},E=function(e){if(!e)return e;var t=e.updateStartTimestamp,n=e.updateEndTimestamp,r=e.pendingStartTimestamp;return e.updateEndTimestamp=n-r,e.updateStartTimestamp=t-r,e.pendingStartTimestamp=0,e}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(6),f=n(4),l=function(){function e(){o(this,e),this.name="default-processor"}return a(e,[{key:"process",value:function(e){var t=e.getRumEvent(),n=(0,f.getCurView)(e),r;return Object.assign({timestamp:(0,s.getCurrentTime)(),session_id:e.session.getSessionId(),event_id:e.session.getEventId(),view:n},t)}}])}();t.default=l},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),f=n(5),l=function(){function e(){var t=this;o(this,e),this.name="session-processor",this.update=function(e){e&&!e.isTrusted||t.ctx.session.updateSession()}}return a(e,[{key:"setup",value:function(e){var t=this;this.ctx=e,this.update=(0,s.debounce)(this.update,s.ONE_SECOND),(0,f.addPageListener)("*",(function(e){e&&e.type&&e.target&&t.update()}))}},{key:"process",value:function(e){return this.update(),e.getRumEvent()}}])}();t.default=l},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function s(e,t,n){return t=y(t),f(e,p()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function f(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var m=n(0),g=n(1),h=function(e){function t(){var e;return o(this,t),(e=s(this,t,arguments)).name="miniapp-reporter",e}return v(t,e),a(t,[{key:"init",value:function(){var e=this;(0,m.isFunction)(g.default.onAppHide)&&g.default.onAppHide((function(){e.flushEventQueue()}))}},{key:"request",value:function(e,t){var n=e.getConfig();try{var r;t.app.type=m.AppType.miniapp,t._v=g.VERSION,(g.default.request||g.default.httpRequest)({url:n.endpoint,method:"POST",dataType:"text",data:JSON.stringify(t)})}catch(e){console.warn("[arms] sendRequest fail",e)}}}])}(m.Reporter);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNetType=void 0;var r=n(1);function o(e){r.default.getNetworkType&&r.default.getNetworkType({success:function(t){var n=t.networkType||t.subtype;e(n?n.toLowerCase():void 0)}}),r.default.onNetworkStatusChange&&r.default.onNetworkStatusChange((function(t){var n=t.networkType||t.subtype;e(n?n.toLowerCase():void 0)}))}t.getNetType=o},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return s(e)||c(e,t)||a(e,t)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(c){s=!0,o=c}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}function s(e){if(Array.isArray(e))return e}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}function p(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e){var t=v(e,"string");return"symbol"==r(t)?t:t+""}function v(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.RumSession=void 0;var d=n(0),m=n(6),g=n(4),h=n(1),b="_arms_uid",w="_arms_session",O=function(){function e(){f(this,e)}return p(e,[{key:"init",value:function(e){var t;this.ctx=e,this.sessionConfig=this.fixSessionConfig(null===(t=e.config)||void 0===t?void 0:t.sessionConfig)}},{key:"getSessionId",value:function(){return this.getSessionInfo().sessionId}},{key:"getSampled",value:function(){return this.getSessionInfo().sampled}},{key:"checkSession",value:function(e){var t=this.sessionConfig,n=t.overtime,r=t.maxDuration,o=(0,m.getCurrentTime)();return!(e.startTime+r<o||e.lastTime+n<o)}},{key:"updateSession",value:function(){var e=this.getSessionInfo();if(!e.isNew){var t=e.startTime,n=(0,m.getCurrentTime)(),r=e.sampled?1:0;(0,h.setStorageSync)(w,"".concat(e.sessionId,"-").concat(r,"-").concat(t,"-").concat(n))}}},{key:"getSessionInfo",value:function(){var e,t=o(((0,h.getStorageSync)(w)||"").split("-"),4),n=t[0],r=t[1],i=t[2],a=t[3],u={sessionId:n,sampled:"0"!==r,startTime:parseInt(i||"")||0,lastTime:parseInt(a||"")||0};return this.checkSession(u)||(u=this.resetSession()),u}},{key:"getEventId",value:function(){return(0,d.generateEventId)(this.getSessionId())}},{key:"getViewId",value:function(){return this.getUUID()}},{key:"getUserId",value:function(){var e=(0,h.getStorageSync)(b);return e&&0===e.indexOf("user_")&&(e=""),e||(e="uid_".concat((0,d.generateSpanId)(16,36)),(0,h.setStorageSync)(b,e)),e}},{key:"resetSession",value:function(){var e=this.sessionConfig.sampleRate,t=this.getUUID(),n=(0,m.getCurrentTime)(),r=(0,d.performDraw)(100*e),o="".concat(t,"-").concat(r?1:0,"-").concat(n,"-").concat(n);return(0,h.setStorageSync)(w,o),{sessionId:t,sampled:r,startTime:n,lastTime:n,isNew:!0}}},{key:"getUUID",value:function(){return(0,d.generateGUID)().replace(/-/g,"")}},{key:"fixSessionConfig",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.sampleRate,n=e.maxDuration,r=e.overtime;return(!(0,d.isNumber)(t)||0>t||1<t)&&(t=1),(!(0,d.isNumber)(n)||n<4*d.ONE_HOUR||n>d.ONE_DAY)&&(n=d.ONE_DAY),(!(0,d.isNumber)(r)||r>d.ONE_HOUR||r<10*d.ONE_MINUTE)&&(r=30*d.ONE_MINUTE),{sampleRate:t,maxDuration:n,overtime:r}}},{key:"getBaseEvent",value:function(){return{timestamp:(0,m.getCurrentTime)(),session_id:this.getSessionId(),event_id:this.getEventId(),view:this.ctx?(0,g.getCurView)(this.ctx):void 0,times:1}}}])}();t.RumSession=O}])}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_rumCore=require("@arms/rum-core"),_platform=_interopRequireWildcard(require("../../utils/platform")),_configManager=require("../../configManager");function
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_rumCore=require("@arms/rum-core"),_platform=_interopRequireWildcard(require("../../utils/platform")),_configManager=require("../../configManager");function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function(a,b){if(!b&&a&&a.__esModule)return a;var e,g,h={__proto__:null,default:a};if(null===a||"object"!=typeof a&&"function"!=typeof a)return h;if(e=b?d:c){if(e.has(a))return e.get(a);e.set(a,h)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((g=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(g.get||g.set)?e(h,f,g):h[f]=a[f]);return h})(a,b)}/**
|
|
2
2
|
* 参考资料:
|
|
3
3
|
* - https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceEntry.html
|
|
4
4
|
* - https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/api/foundation/performance/tt-performance/performance-entry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_rumCore=require("@arms/rum-core"),_hackPage=require("../../utils/hackPage"),_hackComponent=require("../../utils/hackComponent"),_view=require("../../utils/view"),_base=require("../../utils/base"),_configManager=require("../../configManager");function _createForOfIteratorHelperLoose(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(c)return(c=c.call(a)).next.bind(c);if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0;return function(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}var defaultValues={maxEventCount:5,renderThreshold:50},RenderBlockCollector=exports["default"]=/*#__PURE__*/function(){function a(){var a=this;this.name="render-block-collector",this.ctx=void 0,this.sendEvent=void 0,this._onSetData=void 0,this.maxEventCount=void 0,this.renderThreshold=void 0,this.renderBlockReportLimitMap=new Map,this.onLoad=function(){var b=(0,_view.getCurPage)(),
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_rumCore=require("@arms/rum-core"),_hackPage=require("../../utils/hackPage"),_hackComponent=require("../../utils/hackComponent"),_view=require("../../utils/view"),_base=require("../../utils/base"),_configManager=require("../../configManager");function _createForOfIteratorHelperLoose(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(c)return(c=c.call(a)).next.bind(c);if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0;return function(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}var defaultValues={maxEventCount:5,renderThreshold:50},RenderBlockCollector=exports["default"]=/*#__PURE__*/function(){function a(){var a=this;this.name="render-block-collector",this.ctx=void 0,this.sendEvent=void 0,this._onSetData=void 0,this.maxEventCount=void 0,this.renderThreshold=void 0,this.renderBlockReportLimitMap=new Map,this.onLoad=function(){var b,c=(0,_view.getCurPage)(),d=(0,_view.getRumViewId)(c,a.ctx.session),e=null===(b=(0,_view.getViewById)(d,a.ctx))||void 0===b?void 0:b.name,f=a.renderBlockReportLimitMap;d&&e&&!f.has(d)&&f.set(d,{count:0,name:e})},this.onSetData=function(b){return b&&(0,_rumCore.isFunction)(b.setUpdatePerformanceListener)?void b.setUpdatePerformanceListener({withDataPaths:!0},function(c){var d=c||{},e=d.updateEndTimestamp,f=d.pendingStartTimestamp,g=d.dataPaths,h=void 0===g?[]:g,i=e-f;if((0,_rumCore.isNumber)(i)&&!(i<a.renderThreshold)){var j=(0,_view.getCurPage)(),k=(0,_view.getRumViewId)(j,a.ctx.session);if(a.renderBlockReportLimitMap.has(k)){var l=a.renderBlockReportLimitMap.get(k),m=l.count,n=l.name;if(!(m>a.maxEventCount)){a.renderBlockReportLimitMap.set(k,{count:m+1,name:n});var o=a.ctx.session.getBaseEvent(),p=b.data,q=formatDataPath(h,p);a.sendEvent((0,_extends2["default"])({},o,{event_type:_rumCore.RumEventType.LONG_TASK,type:"render",duration:i,message:b.is||b.route||"",snapshots:JSON.stringify((0,_extends2["default"])({},formatSetDataOriginalPefData(c),q?{data:q}:{})),timestamp:f||(0,_base.getCurrentTime)(),source:"setData",view:{id:k,name:n}}))}}}}):void a.destroy()},this.onUnload=function(){var b=(0,_view.getCurPage)(),c=(0,_view.getRumViewId)(b,a.ctx.session);a.renderBlockReportLimitMap["delete"](c)}}var b=a.prototype;return b.setup=function(a,b){var c=a.getConfig(),d=c.longTaskConfig,e=void 0===d?{}:d;if((0,_configManager.checkEnable)(a,"longTask")){var f=this;this.ctx=a,this.sendEvent=b;var g=fixRenderBlockConfig(e),h=g.maxEventCount,i=g.renderThreshold;this.maxEventCount=h,this.renderThreshold=i,this._onSetData=function(){f.onSetData(this)},(0,_hackPage.addPageListener)("onLoad",this.onLoad),(0,_hackPage.addPageListener)("onReady",this._onSetData,!0),(0,_hackPage.addPageListener)("onUnload",this.onUnload),(0,_hackComponent.addComponentListener)("attached",this._onSetData)}},b.destroy=function(){(0,_hackPage.removePageListener)("onLoad",this.onLoad),(0,_hackPage.removePageListener)("onReady",this._onSetData,!0),(0,_hackPage.removePageListener)("onUnload",this.onUnload),(0,_hackComponent.removeComponentListener)("attached",this._onSetData)},a}(),fixRenderBlockConfig=function(a){var b=a||{},c=b.maxEventCount,d=b.renderThreshold;return(!c||!(0,_rumCore.isNumber)(c)||1>c||c>defaultValues.renderThreshold)&&(a.maxEventCount=defaultValues.maxEventCount),d&&(0,_rumCore.isNumber)(d)&&!(d<defaultValues.renderThreshold)||(a.renderThreshold=defaultValues.renderThreshold),a},formatDataPath=function(a,b){try{return a.map(function(a){for(var c,d="",e=b,f=_createForOfIteratorHelperLoose(a);!(c=f()).done;){var g,h=c.value;d+=d?"."+h:h,e=null===(g=e)||void 0===g?void 0:g[h]}return{dataKey:d,dataLength:JSON.stringify(e).length}})}catch(a){return""}},formatSetDataOriginalPefData=function(a){if(!a)return a;var b=a.updateStartTimestamp,c=a.updateEndTimestamp,d=a.pendingStartTimestamp;return a.updateEndTimestamp=c-d,a.updateStartTimestamp=b-d,a.pendingStartTimestamp=0,a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_rumCore=require("@arms/rum-core"),_platform=_interopRequireWildcard(require("../../utils/platform")),_url=require("../../utils/url"),_base=require("../../utils/base"),_view=require("../../utils/view"),_api=require("../../utils/api"),_configManager=require("../../configManager");function
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_rumCore=require("@arms/rum-core"),_platform=_interopRequireWildcard(require("../../utils/platform")),_url=require("../../utils/url"),_base=require("../../utils/base"),_view=require("../../utils/view"),_api=require("../../utils/api"),_configManager=require("../../configManager");function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function(a,b){if(!b&&a&&a.__esModule)return a;var e,g,h={__proto__:null,default:a};if(null===a||"object"!=typeof a&&"function"!=typeof a)return h;if(e=b?d:c){if(e.has(a))return e.get(a);e.set(a,h)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((g=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(g.get||g.set)?e(h,f,g):h[f]=a[f]);return h})(a,b)}var ApiCollector=exports["default"]=/*#__PURE__*/function(){function a(){var a=this;this.name="api-collector",this.ctx=void 0,this.sendEvent=void 0,this.origin={request:_platform["default"].request,httpRequest:_platform["default"].httpRequest},this.sendApi=/*#__PURE__*/function(){var b=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function e(b,c,d){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;return _regenerator["default"].wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(f=a.ctx.getConfig(),g=f.evaluateApi,h=c.statusCode,i=c.status,j=c.errMsg,k=c.errorMessage,l=c.message,m=c.profile,m&&(n=a.parseProfile(m),o=JSON.stringify(m)),!(0,_rumCore.isFunction)(g)){e.next=4;break}return e.prev=1,0===b.success&&(p=new Error("request error")),e.next=2,g(d,c,p);case 2:q=e.sent,b=(0,_extends2["default"])({},b,(0,_api.reviseApiAttr)(q)),e.next=4;break;case 3:e.prev=3,t=e["catch"](1);case 4:if(r=a.ctx.session.getBaseEvent(),s=(0,_extends2["default"])({},r,{event_type:_rumCore.RumEventType.RESOURCE,type:"api",status_code:i||h,message:k||j||l,duration:(0,_base.getCurrentTime)()-b.timestamp},b,n,{timing_data:o}),!(s.duration>_rumCore.ONE_HOUR)){e.next=5;break}return e.abrupt("return");case 5:a.sendEvent(s);case 6:case"end":return e.stop()}},e,null,[[1,3]])}));return function(){return b.apply(this,arguments)}}()}var b=a.prototype;return b.setup=function(a,b){var c=this;(0,_configManager.checkEnable)(a,"api")&&(this.ctx=a,this.sendEvent=b,Object.keys(this.origin).forEach(function(a){return c.hackRequest(a)}))},b.injectTracing=function(a,b){var c,d=this.ctx.session,e=this.ctx.getConfig(),f=e.tracing,g=e.pid,h=e.version,i=void 0===h?"1.0.0":h,j=(0,_rumCore.parseTracingOptions)(f),k=j.enable,l=j.sample,m=j.propagatorTypes,n=j.allowedUrls,o=j.tracestate,p=j.baggage;if(k){var q=(0,_rumCore.find)(n,function(b){return(0,_rumCore.matchList)([b.match],a.url)});if(q){var r=q.propagatorTypes;0===r.length&&(r=m);// skywalking
|
|
2
2
|
var s=!1;r.includes("sw8")&&(r=["sw8"],s=!0);var t=s?(0,_rumCore.generateGUID)():(0,_rumCore.generateTraceId)(),u=s?(0,_rumCore.generateGUID)():(0,_rumCore.generateSpanId)(),v=(0,_rumCore.performDraw)(l),w=d.getUserId(),x=d.getSessionId(),y=void 0===o||o?"rum=v2&miniapp&"+g+"&"+x+"&"+w:void 0,z=void 0!==p&&p?"rum=v2,appType=miniapp,pid="+g+",sid="+x+",uid="+w:void 0,A=(0,_rumCore.makeTracingHeaders)(t,u,v,r,{tracestate:y,baggage:z,appId:g,appVersion:i,viewName:null===(c=a.view)||void 0===c?void 0:c.name,host:"miniapp_"+_platform.appName});v&&(a.trace_id=t,a.trace_data=JSON.stringify({spanId:u,sample:l,sampled:v,headers:A})),b(A)}}},b.hackRequest=function(a){var b=this;(0,_rumCore.isFunction)(_platform["default"][a])&&Object.defineProperty(_platform["default"],a,{configurable:!0,enumerable:!0,writable:!0,value:function(){for(var c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];return d[0]=b.rebuildRequestOptions(d[0]),b.origin[a].apply(this,d)}})},b.rebuildRequestOptions=function(a){var b=this,c=a.url,d=a.success,e=a.fail,f=(0,_base.getCurrentTime)();// SDK自己的请求不监控 & 过滤不需要监控的url
|
|
3
3
|
if((0,_url.isEndpoint)(this.ctx,c)||b.filter(c))return a;var g=(0,_extends2["default"])({},a),h={view:(0,_view.getCurView)(this.ctx),timestamp:f,url:c,name:this.getResourceName(c),method:a.method||"GET"};return this.injectTracing(h,function(a){var b=[];// 已存在header配置情况
|
|
4
4
|
["headers","header"].forEach(function(c){c in g&&(0,_rumCore.isObject)(g[c])&&(g[c]=(0,_extends2["default"])({},g[c],a),b.push(c))}),0===b.length&&(g[_platform.HEADER_KEY]=(0,_extends2["default"])({},g[_platform.HEADER_KEY],a))}),g.success=function(){h.success=1;for(var a=arguments.length,c=Array(a),e=0;e<a;e++)c[e]=arguments[e];b.sendApi(h,c[0],g),d&&d.apply(this,c)},g.fail=function(){h.success=0;for(var a=arguments.length,c=Array(a),d=0;d<a;d++)c[d]=arguments[d];b.sendApi(h,c[0],g),e&&e.apply(this,c)},g},b.getResourceName=function(a){var b,c=this.ctx.getConfig(),d=c.parseResourceName;return b=(0,_rumCore.isFunction)(d)?d(a):(0,_url.getPathByURL)(a),b}/**
|
package/lib/collector/view/pv.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";exports.__esModule=!0,exports["default"]=void 0;var _rumCore=require("@arms/rum-core"),_view=require("../../utils/view"),_hackPage=require("../../utils/hackPage"),PvCollector=exports["default"]=/*#__PURE__*/function(){function a(){var a=this;this.name="pv-collector",this.ctx=void 0,this.sendEvent=void 0,this.prevPage=void 0,this.onUnload=function(){var b=(0,_view.getCurView)(a.ctx);a.ctx.removeView(b.id)},this.sendPv=function(){var b=(0,_view.getCurPage)();if(b){var c=b.route,d=b.options,e=(0,_view.getRumViewId)(b);if(!(a.prevPage&&e===a.prevPage.viewId))// 路由没有发生变化,不发送
|
|
2
|
-
{var f=e?"route_back":"initial_load";e=(0,_view.getRumViewId)(b,a.ctx.session),a.prevPage={route:c,viewId:e};var g=a.getViewName(c);a.ctx.addView({id:e,name:g});var h={}
|
|
2
|
+
{var f=e?"route_back":"initial_load";e=(0,_view.getRumViewId)(b,a.ctx.session),a.prevPage={route:c,viewId:e};var g=a.getViewName(c);a.ctx.addView({id:e,name:g});var h={};!d&&(0,_rumCore.isFunction)(b.getLoadOptions)&&(d=b.getLoadOptions()),d&&Object.keys(d).forEach(function(a){h[a]=decodeURIComponent(d[a])}),a.sendEvent({event_type:_rumCore.RumEventType.VIEW,type:"pv",url:c,name:g,loading_type:f,snapshots:JSON.stringify(h).substring(0,5e3)})}}}}var b=a.prototype;return b.setup=function(a,b){this.ctx=a,this.sendEvent=b,this.sendPv(),(0,_hackPage.addPageListener)("onLoad",this.sendPv),(0,_hackPage.addPageListener)("onUnload",this.onUnload)},b.getViewName=function(a){var b=this.ctx.getConfig(),c=b.parseViewName,d=a;return(0,_rumCore.isFunction)(c)&&(d=c(a)),d},b.destroy=function(){(0,_hackPage.removePageListener)("onLoad",this.sendPv),(0,_hackPage.removePageListener)("onUnload",this.onUnload)},a}();
|
package/lib/configManager.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.checkEnable=checkEnable,exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")),_extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_rumCore=require("@arms/rum-core"),_platform=_interopRequireWildcard(require("./utils/platform"));function
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.checkEnable=checkEnable,exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")),_extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_rumCore=require("@arms/rum-core"),_platform=_interopRequireWildcard(require("./utils/platform"));function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function(a,b){if(!b&&a&&a.__esModule)return a;var e,g,h={__proto__:null,default:a};if(null===a||"object"!=typeof a&&"function"!=typeof a)return h;if(e=b?d:c){if(e.has(a))return e.get(a);e.set(a,h)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((g=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(g.get||g.set)?e(h,f,g):h[f]=a[f]);return h})(a,b)}var LOCAL_STORE_CONFIG_KEY="arms_rum2_local_config";function parseV2Config(a){var b,c={};c.enable=null===(b=a.enable)||void 0===b||b;// 处理Session配置
|
|
2
2
|
var d=a.session;if(d){var e,f,g={};g.sampleRate=(null!==(e=d.sampling)&&void 0!==e?e:100)/100,g.storage=null!==(f=d.storage)&&void 0!==f?f:"auto",c.sessionConfig=g}// 处理上报配置
|
|
3
3
|
var h=a.report;if(h){var i={};i.flushTime=h.flush_interval,i.maxEventCount=h.max_batch_count,c.reportConfig=i}// 处理链路追踪
|
|
4
4
|
var j=a.tracing;if(j){var k,l={};l.enable=null===(k=j.enable)||void 0===k||k;var m=[];(j.rules||[]).forEach(function(a){var b={enable:a.enable,tracestate:a.tracestate,baggage:a.baggage,propagatorTypes:a.protocols,sampling:a.sampling};return"{location.origin}"===a.match?void(l=(0,_extends2["default"])({},l,b)):void(b.match=(0,_rumCore.parseRule2Match)(a),m.push(b))}),l.allowedUrls=m,c.tracing=l}// 处理采集器
|
|
5
|
-
var n=a.collectors;if(n&&0<Object.keys(n).length){var o={};n.forEach(function(a){var b=a.name;if(b){var c=(0,_extends2["default"])({},a),d=a.filters;0<(null===d||void 0===d?void 0:d.length)&&(c.filters=c.filters.map(function(a){return(0,_rumCore.parseRule2Match)(a)})),o[b]=c}}),c.collectors=(0,_extends2["default"])({},c.collectors,o)}return c}var MiniappConfigManager=exports["default"]=/*#__PURE__*/function(a){function b(){for(var b,c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];return b=a.call.apply(a,[this].concat(d))||this,b.version="v2",b}(0,_inheritsLoose2["default"])(b,a);var c=b.prototype;return c.fetchRemoteCfg=/*#__PURE__*/function(){function a(){return b.apply(this,arguments)}var b=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function a(){var b;return _regenerator["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(b=this.getRemoteConfigUrl(),b){a.next=
|
|
5
|
+
var n=a.collectors;if(n&&0<Object.keys(n).length){var o={};n.forEach(function(a){var b=a.name;if(b){var c=(0,_extends2["default"])({},a),d=a.filters;0<(null===d||void 0===d?void 0:d.length)&&(c.filters=c.filters.map(function(a){return(0,_rumCore.parseRule2Match)(a)})),o[b]=c}}),c.collectors=(0,_extends2["default"])({},c.collectors,o)}return c}var MiniappConfigManager=exports["default"]=/*#__PURE__*/function(a){function b(){for(var b,c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];return b=a.call.apply(a,[this].concat(d))||this,b.version="v2",b}(0,_inheritsLoose2["default"])(b,a);var c=b.prototype;return c.fetchRemoteCfg=/*#__PURE__*/function(){function a(){return b.apply(this,arguments)}var b=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function a(){var b;return _regenerator["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(b=this.getRemoteConfigUrl(),b){a.next=1;break}return a.abrupt("return");case 1:if(!b.includes(".rum.aliyuncs.com")){a.next=2;break}return this.version="v1",a.abrupt("return",this.getV1Config(b));case 2:return a.abrupt("return",this.getV2Config(b));case 3:case"end":return a.stop()}},a,this)}));return a}(),c.getV1Config=/*#__PURE__*/function(){function a(){return b.apply(this,arguments)}var b=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function b(a){return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.abrupt("return",new Promise(function(b,c){var d=_platform["default"].request||_platform["default"].httpRequest;d({url:a,method:"GET",success:function(a){b(a)},fail:function(a){c(a)}})}));case 1:case"end":return b.stop()}},b)}));return a}(),c.getV2Config=/*#__PURE__*/function(){function a(){return b.apply(this,arguments)}var b=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function b(a){var c,d;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=(0,_rumCore.getUrlParams)(a),d={instanceId:"",agentType:"rum_web_sdk",attributes:c,instanceConfigs:[{configType:"rum_web_config",version:1}],capabilities:2},b.abrupt("return",new Promise(function(b,c){var e=_platform["default"].request||_platform["default"].httpRequest;e({url:a,method:"POST",data:JSON.stringify(d),header:{"Content-Type":"application/json","x-log-apiversion":"0.6.0"},success:function(a){b(a)},fail:function(a){c(a)}})}));case 1:case"end":return b.stop()}},b)}));return a}(),c.getCacheConfig=function(){var a=(0,_platform.getStorageSync)(LOCAL_STORE_CONFIG_KEY);if(a){var b,c=this.currentConfig;try{if(b=JSON.parse(a),"pid"in b&&b.pid===c.pid||"endpoint"in b&&b.endpoint)return b}catch(a){//
|
|
6
6
|
}return b}},c.setCacheConfig=function(a){var b=this.currentConfig,c=(0,_extends2["default"])({},a,{pid:b.pid,endpoint:b.endpoint});(0,_platform.setStorageSync)(LOCAL_STORE_CONFIG_KEY,JSON.stringify(c))},c.getRemoteConfigUrl=function(){var a=this.currentConfig,b=a.pid,c=a.remoteConfig,d=c||{},e=d.url,f=d.region;if(e)return e;if(b){var g=b.split("@");return!g||2>g.length?void 0:"https://"+g[0]+"-sdk.rum.aliyuncs.com/config/"+(f||"cn-hangzhou")+"/"+g[1]+"?t="+Date.now()}},c.parseConfig=function(a){try{return"v2"===this.version?parseV2Config(JSON.parse(a.instanceConfigs[0].config)):a}catch(b){return a}},b}(_rumCore.ConfigManager);function checkEnable(a,b,c){var d;void 0===c&&(c=!0);var e=a.getConfig();if(!1===e.enable)return!1;var f=null===(d=e.collectors)||void 0===d?void 0:d[b];return(0,_rumCore.isBoolean)(f)?f:(0,_rumCore.isObject)(f)&&"enable"in f?f.enable:c}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _shell=_interopRequireWildcard(require("./shell"));exports.__esModule=!0,exports["default"]=void 0;exports.ArmsRum=_shell.ArmsRum;function
|
|
1
|
+
"use strict";var _shell=_interopRequireWildcard(require("./shell"));exports.__esModule=!0,exports["default"]=void 0;exports.ArmsRum=_shell.ArmsRum;function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function(a,b){if(!b&&a&&a.__esModule)return a;var e,g,h={__proto__:null,default:a};if(null===a||"object"!=typeof a&&"function"!=typeof a)return h;if(e=b?d:c){if(e.has(a))return e.get(a);e.set(a,h)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((g=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(g.get||g.set)?e(h,f,g):h[f]=a[f]);return h})(a,b)}var _default=exports["default"]=_shell["default"];
|
package/lib/reporter/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")),_rumCore=require("@arms/rum-core"),_platform=_interopRequireWildcard(require("../utils/platform"));function
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")),_rumCore=require("@arms/rum-core"),_platform=_interopRequireWildcard(require("../utils/platform"));function _interopRequireWildcard(a,b){if("function"==typeof WeakMap)var c=new WeakMap,d=new WeakMap;return(_interopRequireWildcard=function(a,b){if(!b&&a&&a.__esModule)return a;var e,g,h={__proto__:null,default:a};if(null===a||"object"!=typeof a&&"function"!=typeof a)return h;if(e=b?d:c){if(e.has(a))return e.get(a);e.set(a,h)}for(var f in a)"default"!=f&&{}.hasOwnProperty.call(a,f)&&((g=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(g.get||g.set)?e(h,f,g):h[f]=a[f]);return h})(a,b)}/**
|
|
2
2
|
* miniapp reporter
|
|
3
3
|
*/var MiniappReporter=/*#__PURE__*/function(a){function b(){for(var b,c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];return b=a.call.apply(a,[this].concat(d))||this,b.name="miniapp-reporter",b}(0,_inheritsLoose2["default"])(b,a);var c=b.prototype;return c.init=function(){var a=this;(0,_rumCore.isFunction)(_platform["default"].onAppHide)&&_platform["default"].onAppHide(function(){a.flushEventQueue()})},c.request=function(a,b){var c=a.getConfig();try{b.app.type=_rumCore.AppType.miniapp,b._v=_platform.VERSION;var d=_platform["default"].request||_platform["default"].httpRequest;d({url:c.endpoint,method:"POST",dataType:"text",data:JSON.stringify(b)})}catch(a){console.warn("[arms] sendRequest fail",a)}},b}(_rumCore.Reporter),_default=exports["default"]=MiniappReporter;
|
package/lib/shell.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=exports.ArmsRum=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_extends3=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")),_rumCore=require("@arms/rum-core"),_pv=_interopRequireDefault(require("./collector/view/pv")),_perf=_interopRequireDefault(require("./collector/view/perf")),_exception=_interopRequireDefault(require("./collector/exception")),_api=_interopRequireDefault(require("./collector/resource/api")),_action=_interopRequireDefault(require("./collector/action")),_application=_interopRequireDefault(require("./collector/application")),_renderBlock=_interopRequireDefault(require("./collector/longtask/render-block")),_defaultProcessor=_interopRequireDefault(require("./processor/default-processor")),_sessionProcessor=_interopRequireDefault(require("./processor/session-processor")),_reporter=_interopRequireDefault(require("./reporter")),_network=require("./utils/network"),_platform=require("./utils/platform"),_session=require("./utils/session"),_configManager=_interopRequireDefault(require("./configManager")),builtInCollectors=[_pv["default"],_perf["default"],_exception["default"],_api["default"],_action["default"],_application["default"],_renderBlock["default"]],ArmsRum=exports.ArmsRum=/*#__PURE__*/function(a){function b(){for(var b,c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];return b=a.call.apply(a,[this].concat(d))||this,b.version=_platform.VERSION,b.configManager=void 0,b.updateNetType=function(a){var c=b.getConfig().net||{};b.setConfig("net",(0,_extends3["default"])({},c,{type:a}))},b}(0,_inheritsLoose2["default"])(b,a);var c=b.prototype;return c.init=/*#__PURE__*//**
|
|
2
2
|
* 初始化
|
|
3
|
-
*/function(){function a(){return b.apply(this,arguments)}var b=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function b(a){var c;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return this.configManager=new _configManager["default"],b.next=
|
|
3
|
+
*/function(){function a(){return b.apply(this,arguments)}var b=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function b(a){var c;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return this.configManager=new _configManager["default"],b.next=1,this.configManager.init(a);case 1:if(c=this.configManager.getConfig(),!1!==c.enable){b.next=2;break}return b.abrupt("return");case 2:return this.client.useCollectors(builtInCollectors.map(function(a){return new a})),this.client.useProcessors([new _defaultProcessor["default"],new _sessionProcessor["default"]]),this.client.useReporter(new _reporter["default"]),this.client.init(c,new _session.RumSession,this.configManager),(0,_network.getNetType)(this.updateNetType),b.abrupt("return",this);case 3:case"end":return b.stop()}},b,this)}));return a}(),c.getConfig=function(){var a;return null===(a=this.configManager)||void 0===a?void 0:a.getConfig()}/**
|
|
4
4
|
* set config
|
|
5
5
|
*/,c.setConfig=function(){var a=this.configManager;if(a)if(2===arguments.length){var b,c=a.getConfig();a.setConfig((0,_extends3["default"])({},c,(b={},b[0>=arguments.length?void 0:arguments[0]]=1>=arguments.length?void 0:arguments[1],b)))}else a.setConfig(0>=arguments.length?void 0:arguments[0])},c.getCollector=function(a){return this.client.getCollectors().find(function(b){return b.name===a})},b}(_rumCore.Shell),_default=exports["default"]=new ArmsRum;/**
|
|
6
6
|
* 对外导出 shell 层, 所有 shell 层模型的 API 设计约定:
|
package/lib/utils/platform.d.ts
CHANGED
package/lib/utils/platform.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.__esModule=!0,exports.dingtalkName=exports["default"]=exports.bytedanceName=exports.appName=exports.alipayName=exports.VERSION=exports.HEADER_KEY=void 0,exports.getPerformance=getPerformance,exports.getStorageSync=getStorageSync,exports.sdk=exports.qqName=exports.ksName=exports.jdName=void 0,exports.setStorageSync=setStorageSync,exports.wechatName=exports.swanName=void 0;var VERSION=exports.VERSION='npm-0.1.
|
|
1
|
+
"use strict";exports.__esModule=!0,exports.dingtalkName=exports["default"]=exports.bytedanceName=exports.appName=exports.alipayName=exports.VERSION=exports.HEADER_KEY=void 0,exports.getPerformance=getPerformance,exports.getStorageSync=getStorageSync,exports.sdk=exports.qqName=exports.ksName=exports.jdName=void 0,exports.setStorageSync=setStorageSync,exports.wechatName=exports.swanName=void 0;var VERSION=exports.VERSION='npm-0.1.3',OBJ="object",qqName=exports.qqName="qq",bytedanceName=exports.bytedanceName="bytedance",wechatName=exports.wechatName="wechat",dingtalkName=exports.dingtalkName="dingtalk",alipayName=exports.alipayName="alipay",swanName=exports.swanName="swan",jdName=exports.jdName="jd",ksName=exports.ksName="ks";function isFunc(a){return"function"==typeof a}/**
|
|
2
2
|
* 获取跨平台的 SDK
|
|
3
3
|
*/function getSDK(){var a,b="unknown";if(typeof ks===OBJ)a=ks,b=ksName;else if(typeof swan===OBJ)a=swan,b=swanName;else if(typeof qq===OBJ)// qq的全局也有wx命名空间,和qq等效,这会导致判断AppName失效
|
|
4
4
|
a=qq,b=qqName;else if(typeof tt===OBJ)// 字节的全局也有wx命名空间,和tt等效,这会导致判断AppName失效
|