@arms/rum-miniapp 0.1.3 → 0.1.4

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.
@@ -1 +1 @@
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
+ !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.4";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(e){var n=(0,f.getCurPage)();if(n){var r=n.route,o=n.options,i=(0,f.getRumViewId)(n);if(!t.prevPage||i!==t.prevPage.viewId){var a=i?"route_back":"initial_load";i=(0,f.getRumViewId)(n,t.ctx.session),t.prevPage={route:r,viewId:i};var u=t.getViewName(r);t.ctx.addView({id:i,name:u});var c={};o||((0,s.isFunction)(n.getLoadOptions)?o=n.getLoadOptions():(0,s.isObject)(e)&&(o=e)),o&&Object.keys(o).forEach((function(e){var t=o[e];if((0,s.isString)(t))try{c[e]=decodeURIComponent(t)}catch(n){c[e]=t}else c[e]=t})),t.sendEvent({event_type:s.RumEventType.VIEW,type:"pv",url:r,name:u,loading_type:a,snapshots:JSON.stringify(c).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}])}));
@@ -6,7 +6,7 @@ export default class PvCollector implements ICollector {
6
6
  private prevPage;
7
7
  setup(ctx: IContext, sendEvent: (payload: RumEvent) => void): void;
8
8
  onUnload: () => void;
9
- sendPv: () => void;
9
+ sendPv: (ops?: Record<string, unknown>) => void;
10
10
  private getViewName;
11
11
  destroy(): void;
12
12
  }
@@ -1,2 +1,2 @@
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={};!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}();
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(b){var c=(0,_view.getCurPage)();if(c){var d=c.route,e=c.options,f=(0,_view.getRumViewId)(c);if(!(a.prevPage&&f===a.prevPage.viewId))// 路由没有发生变化,不发送
2
+ {var g=f?"route_back":"initial_load";f=(0,_view.getRumViewId)(c,a.ctx.session),a.prevPage={route:d,viewId:f};var h=a.getViewName(d);a.ctx.addView({id:f,name:h});var i={};e||((0,_rumCore.isFunction)(c.getLoadOptions)?e=c.getLoadOptions():(0,_rumCore.isObject)(b)&&(e=b)),e&&Object.keys(e).forEach(function(a){var b=e[a];if((0,_rumCore.isString)(b))try{i[a]=decodeURIComponent(b)}catch(c){i[a]=b}else i[a]=b}),a.sendEvent({event_type:_rumCore.RumEventType.VIEW,type:"pv",url:d,name:h,loading_type:g,snapshots:JSON.stringify(i).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}();
@@ -4,7 +4,7 @@ export interface Page {
4
4
  is: string;
5
5
  getPageId: () => string;
6
6
  __rum_view_id?: string;
7
- options?: Record<string, string | number>;
7
+ options?: Record<string, unknown>;
8
8
  getLoadOptions?: () => Record<string, string | number>;
9
9
  }
10
10
  interface SDK {
@@ -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.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}/**
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.4',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失效
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arms/rum-miniapp",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "arms rum javascript sdk for miniapp",
5
5
  "author": "guangli.fj <guangli.fj@alibaba-inc.com>",
6
6
  "license": "ISC",