@arms/rum-uniapp 0.0.1-beta.2 → 0.1.1

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
- module.exports=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=15)}([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(6);t.Client=i.default;var u=n(8);t.Context=u.default;var a=n(19);t.Reporter=a.default;var c=n(21);t.Shell=c.default,o(n(7),t),o(n(23),t),o(n(24),t),o(n(25),t),o(n(4),t),o(n(26),t),o(n(10),t),o(n(11),t),o(n(1),t),o(n(27),t),o(n(12),t),o(n(28),t),o(n(9),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)}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 u(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function a(){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=u,t.isArray=function(e){return u(e,"Array")},t.isRegExp=function(e){return u(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=a},function(e,t,n){"use strict";function r(e,n){return e?e[t.PAGE_ID]?e[t.PAGE_ID]:n?e[t.PAGE_ID]=n.getViewId():void 0:void 0}function o(e,t){return e&&t?t.getViews().find((function(t){return t.id===e})):void 0}function i(e){if(e){var t=e.getViews();if(t&&t.length)return t[t.length-1]}}Object.defineProperty(t,"__esModule",{value:!0}),t.getCurView=t.getViewById=t.getRumViewId=t.PAGE_ID=void 0,t.PAGE_ID="__rum_view_id",t.getRumViewId=r,t.getViewById=o,t.getCurView=i},function(e,t,n){"use strict";(function(e){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/facebook/regenerator/blob/main/LICENSE */function e(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}function t(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,u=Object.create(o.prototype),a=new y(r||[]);return w(u,"_invoke",{value:f(e,n,a)}),u}function n(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function u(){}function a(){}function c(t){["next","throw","return"].forEach((function(n){e(t,n,(function(e){return this._invoke(n,e)}))}))}function s(e,t){function o(i,u,a,c){var s=n(e[i],e,u);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?t.resolve(l.__await).then((function(e){o("next",e,a,c)}),(function(e){o("throw",e,a,c)})):t.resolve(l).then((function(e){f.value=e,a(f)}),(function(e){return o("throw",e,a,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function f(e,t,r){var o="suspendedStart";return function(i,u){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw u;return{value:d,done:!0}}for(r.method=i,r.arg=u;;){var a=r.delegate;if(a){var c=l(a,r);if(c){if(c===j)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(e,t,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===j)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(e,t){var r=t.method,o=e.iterator[r];if(o===d)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=d,l(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),j;var i=n(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,j;var u=i.arg;return u?u.done?(t[e.resultName]=u.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=d),t.delegate=null,j):u:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,j)}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function v(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function y(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset(!0)}function h(e){if(e||""===e){var t=e[O];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(b.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=d,t.done=!0,t};return o.next=o}}throw new TypeError(r(e)+" is not iterable")}o=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(e,t,n){e[t]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",_=E.toStringTag||"@@toStringTag";try{e({},"")}catch(S){e=function(e,t,n){return e[t]=n}}m.wrap=t;var j={},x={};e(x,O,(function(){return this}));var T=Object.getPrototypeOf,P=T&&T(T(h([])));P&&P!==g&&b.call(P,O)&&(x=P);var k=a.prototype=i.prototype=Object.create(x);return u.prototype=a,w(k,"constructor",{value:a,configurable:!0}),w(a,"constructor",{value:u,configurable:!0}),u.displayName=e(a,_,"GeneratorFunction"),m.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===u||"GeneratorFunction"===(t.displayName||t.name))},m.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,e(t,_,"GeneratorFunction")),t.prototype=Object.create(k),t},m.awrap=function(e){return{__await:e}},c(s.prototype),e(s.prototype,S,(function(){return this})),m.AsyncIterator=s,m.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var u=new s(t(e,n,r,o),i);return m.isGeneratorFunction(n)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},c(k),e(k,_,"Generator"),e(k,O,(function(){return this})),e(k,"toString",(function(){return"[object Generator]"})),m.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},m.values=h,y.prototype={constructor:y,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(v),!e)for(var t in this)"t"===t.charAt(0)&&b.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){function t(t,r){return i.type="throw",i.arg=e,n.next=t,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var u=b.call(o,"catchLoc"),a=b.call(o,"finallyLoc");if(u&&a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!a)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(e,t){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,j):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),j},finish:function(e){for(var t,n=this.tryEntries.length-1;0<=n;--n)if((t=this.tryEntries[n]).finallyLoc===e)return this.complete(t.completion,t.afterLoc),v(t),j},catch:function(e){for(var t,n=this.tryEntries.length-1;0<=n;--n)if((t=this.tryEntries[n]).tryLoc===e){var r=t.completion;if("throw"===r.type){var o=r.arg;v(t)}return o}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:h(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=d),j}},m}var i=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 u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):o(e.value).then(u,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fixAttrs=t.getNetType=t.getPerformance=t.setStorageSync=t.getStorageSync=t.appName=t.sdk=t.VERSION=t.global2=void 0;var u=n(0);function a(e){return"function"==typeof t.sdk.getStorageSync?t.sdk.getStorageSync(e):void 0}function c(e,n){return"function"==typeof t.sdk.setStorageSync?t.sdk.setStorageSync(e,n):void 0}function s(){return"performance"in t.global2?t.global2.performance:void 0}function f(){return new Promise((function(e){try{t.sdk.getNetworkType({success:function t(n){var r=n.networkType||n.subtype;e(r?r.toLowerCase():void 0)},fail:function t(n){e(void 0)}})}catch(t){e(void 0)}}))}t.global2=e||window,t.VERSION="0.0.1-beta.2",t.sdk=uni,t.appName="uniapp",t.getStorageSync=a,t.setStorageSync=c,t.getPerformance=s,t.getNetType=f;var l=function e(n){return i(this,void 0,void 0,o().mark((function e(){var r,i,a,c,s;return o().wrap((function e(o){for(;;)switch(o.prev=o.next){case 0:if(n){o.next=2;break}return o.abrupt("return");case 2:return o.next=4,f();case 4:return r=o.sent,n.app.type=u.AppType.uniapp,n._v=t.VERSION,n.net=Object.assign({model:r},n.net),i=t.sdk.getDeviceInfo()||{},a=t.sdk.getAppBaseInfo()||{},c={brand:i.brand,model:i.model},s={type:i.platform,version:i.system,container:t.appName,container_version:a.SDKVersion},n.device=Object.assign(Object.assign({},c),n.device),n.os=Object.assign(Object.assign({},s),n.os),o.abrupt("return",n);case 15:case"end":return o.stop()}}),e)})))};t.fixAttrs=l}).call(this,n(14))},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"}(i=t.AppType||(t.AppType={}))},function(e,t,n){"use strict";function r(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 o(){return(new Date).getTime()}Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentTime=t.formatNumber=void 0,t.formatNumber=r,t.getCurrentTime=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){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 u,a=!0,c=!1;return{s:function t(){n=n.call(e)},n:function e(){var t=n.next();return a=t.done,t},e:function e(t){c=!0,u=t},f:function e(){try{a||null==n.return||n.return()}finally{if(c)throw u}}}}function i(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 a(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(7),v=n(18),y=n(8),h=n(1),d=function(){function e(){var t=this;a(this,e),this.emitter=new v.EventEmitter,this.sendEvent=function(e){t.emitter.emit(p.EventType.collect,e)}}return s(e,[{key:"init",value:function e(t,n){var r=this;this.ctx=new y.default(t,n);var i=this.ctx,u=this.collectors,a=this.processors,c=this.reporter;a.forEach((function(e){(0,h.isFunction)(e.setup)&&e.setup(i)})),this.emitter.on(p.EventType.collect,(function(e){i.setRumEvent(e);var t=o(a),n;try{for(t.s();!(n=t.n()).done;){var r=n.value;if(r.match||(r.match=function(){return!0}),r.match(i)){var u=r.process(i);u&&i.setRumEvent(u)}}}catch(e){t.e(e)}finally{t.f()}c.report(i)})),u.forEach((function(e){e.setup(i,r.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=d},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,a(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(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){o(this,e),this.config=t,this.views=[],n&&(this.session=n,this.session.init(this))}return u(e,[{key:"getConfig",value:function e(){return this.config}},{key:"setConfig",value:function e(t){this.config=t}},{key:"getViews",value:function e(){return this.views}},{key:"addView",value:function e(t){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(1);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.toRegFormat=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(1),o="__",i=/^\[object ([a-z]*)\]$/;function u(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e[t];e["".concat("__").concat(t).concat("__")]=i,e[t]=function(){for(var t=o?this:e,u=arguments.length,a=new Array(u),c=0;c<u;c++)a[c]=arguments[c];if(n.apply(t,a),(0,r.isFunction)(i))return i.apply(t,a)}}function a(e,t){var n="".concat("__").concat(t).concat("__");"function"==typeof e[n]&&(e[t]=e[n],delete e[n])}function c(){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(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 s(){var e=c().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 f(){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 l(e){var t=f();return"00-".concat(e,"-").concat(t)}function p(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 v(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(i);return null==n?void 0:n[1]}function h(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,t){"string"===y(t)&&(t=[t]);for(var n=0,r=t.length;n<r;n++){var o=t[n].split("."),i=o.length-1;if(!e)break;for(var u=e,a=0,c=o.length;a<c;a++){if("[]"===o[a]){if("array"===y(u)){var s=o.splice(a+1);s=s.join(".");for(var f=0,l=u.length;f<l;f++)d(u[f],s)}break}if(i===a&&"string"===y(u[o[a]])){u[o[a]]=h(u[o[a]]);break}if(!(u=u[o[a]]))break}if(u&&"array"===y(u))for(var p=0,v=u.length;p<v;p++)u[p]=h(u[p])}}t.interceptFunction=u,t.restoreFunction=a,t.generateGUID=c,t.generateTraceId=s,t.generateSpanId=f,t.generateEventId=l,t.debounce=p,t.delay=v,t.getType=y,t.transStrToReg=h,t.toRegFormat=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 u(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=u},function(e,t,n){"use strict";function r(e){return a(e)||u(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 u(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(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.urlMatch=t.matchList=t.isMatchOption=void 0;var s=n(1),f=n(11);function l(e){return(0,s.isString)(e)||(0,s.isFunction)(e)||(0,s.isRegExp)(e)}function p(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 p(n,e)}catch(e){return!1}}t.isMatchOption=l,t.matchList=p,t.urlMatch=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeEventListener=t.addEventListener=t.mixin=void 0;var r,o={onLaunch:[],onLoad:[],onShow:[],beforeCreate:[],mounted:[]};function i(e){if(!r){r=e;var t={};Object.keys(o).forEach((function(e){t[e]=function(t){var n=this,r;o[e].forEach((function(e){e(n,t)}))}})),e.mixin(t)}}function u(e,t){e in o||(o[e]=[]),o[e].push(t)}function a(e,t){if(e in o&&t){var n=o[e],r=n.indexOf(t);return n.splice(r,1),!0}return!1}t.mixin=i,t.addEventListener=u,t.removeEventListener=a},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){e.exports=n(16)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArmsRum=void 0;var r=n(17);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=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(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,c(n.key),n)}function a(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=s(e,"string");return"symbol"==r(t)?t:t+""}function s(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 f(e,t,n){return t=y(t),l(e,v()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function l(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 p(e)}function p(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(){return!!e})()}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(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}),t.ArmsRum=void 0;var m=n(0),g=n(29),b=n(30),w=n(31),E=n(34),O=n(35),S=n(36),_=n(3),j=n(37),x=n(13),T=function(e){function t(){var e;return i(this,t),(e=f(this,t,arguments)).version=_.VERSION,e}return h(t,e),a(t,[{key:"init",value:function(e){e.vue&&this.setVue(e.vue),this.client.useCollectors([new g.default,new b.default,new w.default]),this.client.useProcessors([new E.default,new O.default]),this.client.useReporter(new S.default),this.client.init(e,new j.RumSession)}},{key:"setConfig",value:function(){var e=this.client.getContext();if(2===arguments.length){var t=this.client.getContext(),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 e.setConfig(0>=arguments.length?void 0:arguments[0])}},{key:"getLocalConfig",value:function(){}},{key:"getRemoteConfig",value:function(){}},{key:"storeRemoteConfig",value:function(){return!1}},{key:"setVue",value:function(e){this.setConfig("vue",e),(0,x.mixin)(e)}}])}(m.Shell);t.ArmsRum=T,t.default=new T},function(e,t,n){"use strict";var r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function e(t,n,r){return Function.prototype.apply.call(t,n,r)},i;function u(e){console&&console.warn&&console.warn(e)}i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function e(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function e(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function e(t){return t!=t};function c(){c.init.call(this)}e.exports=c,e.exports.once=w,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var s=10;function f(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function p(e,t,n,r){var o,i,a;if(f(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=l(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,u(c)}return e}function v(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function y(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=v.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?b(o):m(o,o.length)}function d(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function b(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function w(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}O(e,t,i,{once:!0}),"error"!==t&&E(e,o,{once:!0})}))}function E(e,t,n){"function"==typeof e.on&&O(e,"error",t,n)}function O(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),c.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function e(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},c.prototype.getMaxListeners=function e(){return l(this)},c.prototype.emit=function e(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i="error"===t,u=this._events;if(void 0!==u)i=i&&void 0===u.error;else if(!i)return!1;if(i){var a;if(n.length>0&&(a=n[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var s=u[t];if(void 0===s)return!1;if("function"==typeof s)o(s,this,n);else for(var f=s.length,l=m(s,f),r=0;r<f;++r)o(l[r],this,n);return!0},c.prototype.addListener=function e(t,n){return p(this,t,n,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function e(t,n){return p(this,t,n,!0)},c.prototype.once=function e(t,n){return f(n),this.on(t,y(this,t,n)),this},c.prototype.prependOnceListener=function e(t,n){return f(n),this.prependListener(t,y(this,t,n)),this},c.prototype.removeListener=function e(t,n){var r,o,i,u,a;if(f(n),void 0===(o=this._events))return this;if(void 0===(r=o[t]))return this;if(r===n||r.listener===n)0==--this._eventsCount?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,r.listener||n));else if("function"!=typeof r){for(i=-1,u=r.length-1;u>=0;u--)if(r[u]===n||r[u].listener===n){a=r[u].listener,i=u;break}if(i<0)return this;0===i?r.shift():g(r,i),1===r.length&&(o[t]=r[0]),void 0!==o.removeListener&&this.emit("removeListener",t,a||n)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function e(t){var n,r,o;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i=Object.keys(r),u;for(o=0;o<i.length;++o)"removeListener"!==(u=i[o])&&this.removeAllListeners(u);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(n=r[t]))this.removeListener(t,n);else if(void 0!==n)for(o=n.length-1;o>=0;o--)this.removeListener(t,n[o]);return this},c.prototype.listeners=function e(t){return h(this,t,!0)},c.prototype.rawListeners=function e(t){return h(this,t,!1)},c.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},c.prototype.listenerCount=d,c.prototype.eventNames=function e(){return this._eventsCount>0?i(this._events):[]}},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,a(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(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(4),f=n(20),l=n(1),p=n(9),v=3e3,y=20,h=["app","user","device","os","geo","isp","net","properties"],d=function(){function e(){o(this,e),this.name="reporter",this.eventQueue=[]}return u(e,[{key:"getReportCfg",value:function e(){var t=this.ctx.getConfig().reportConfig;return(0,l.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(t),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===s.RumEventType.EXCEPTION){var o=r.message,i=r.stack,u=(0,f.getErrorID)({message:o,stack:i}),a=this.eventQueue.find((function(e){if(e.event_type===s.RumEventType.EXCEPTION){var t=e.message,n=e.stack;return(0,f.getErrorID)({message:t,stack:n})===u}}));if(a)return void a.times++}if(r.event_type===s.RumEventType.ACTION){var c=r.target_name,l=this.eventQueue.find((function(e){if(e.event_type===s.RumEventType.ACTION)return c===e.target_name}));if(l)return void l.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,u;(!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,u=i.getSessionId(),a=0;a<n.length;a++){var c=n[a];c.session_id===u?delete c.session_id:(n.splice(a,1),a--)}if(0!==n.length){var s={app:{id:o.pid,env:o.env||"prod",version:o.version,type:""},user:{id:i.getUserId()},session:{id:u},net:{},view:r,events:n};h.forEach((function(e){var t=o[e];(0,l.isObject)(t)&&Object.keys(t).forEach((function(n){var r=t[n];"user"===e&&"id"===n||("properties"===e?s[e]=(0,p.verifyProperties)(t):((0,l.isString)(r)||(0,l.isNumber)(r))&&(e in s||(s[e]={}),s[e][n]=r))}))})),("function"!=typeof o.beforeReport||(s=o.beforeReport(s)))&&this.request(t,s)}}},{key:"init",value:function e(t){}}])}();t.default=d},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,a(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(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(4),f=n(6),l=n(1),p=n(22),v=function(){function e(t){o(this,e),this.client=new f.default,t&&this.init&&this.init(t)}return u(e,[{key:"getCombinedConfig",value:function e(t){var n;if((0,p.isRemoteConfigEnable)(t)&&(0,l.isFunction)(this.getLocalConfig)){var r=this.getLocalConfig(0,t.pid);n=(0,p.default)(t,r)}return n||t}},{key:"updateFromRemoteConfig",value:function e(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.pid&&(0,p.isRemoteConfigEnable)(t)&&(0,l.isFunction)(this.getRemoteConfig)){var r=this,o=this.getRemoteConfig((0,p.getRemoteConfigUrl)(t),t);null==o||o.then((function(e){if(e&&void 0===e.errorStatus){var o=(0,p.default)(t,e);if(o&&((0,l.isFunction)(r.storeRemoteConfig)&&r.storeRemoteConfig(e,t.pid),!1!==n&&!1!==t.remoteConfig.reSetup)){var i=r.client.getContext(),u;i.setConfig(o),r.client.getCollectors().forEach((function(e){(0,l.isFunction)(e.destroy)&&(e.destroy(),e.setup(i,r.client.sendEvent))}))}}}))}}},{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=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRemoteConfigUrl=t.isRemoteConfigEnable=void 0;var r=n(10),o=["filters.exception","filters.resource","tracing.allowedUrls.[].match"];function i(e){return!0===e.remoteConfig||e.remoteConfig&&!1!==e.remoteConfig.enable}function u(e){if(e.remoteConfig&&e.remoteConfig.url)return e.remoteConfig.url;var t=e.pid.split("@");if(t&&!(t.length<2)){var n=Date.now();return"//".concat(t[0],"-sdk.rum.aliyuncs.com/config/").concat(e.remoteConfig.region||"cn-hangzhou","/").concat(t[1],"?t=").concat(n)}}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in e)if("pid"!==n&&"endpoint"!==n&&void 0!==(null==t?void 0:t[n])){var o=e[n],i=null==t?void 0:t[n];"object"===(0,r.getType)(o)&&"object"===(0,r.getType)(i)?a(o,i):e[n]=i}}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t)if(void 0===(null==e?void 0:e[n]))e[n]=t[n];else{var o=e[n],i=t[n];"object"===(0,r.getType)(o)&&"object"===(0,r.getType)(i)&&c(o,i)}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;if("object"!==(0,r.getType)(e)||"object"!==(0,r.getType)(t))return null;var n=Object.assign({},e);return(0,r.toRegFormat)(t,o),a(n,t),c(n,t),n}t.isRemoteConfigEnable=i,t.getRemoteConfigUrl=u,t.default=s},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(12),o=n(1);function i(e){return e&&(0,r.isMatchOption)(e.match)&&(0,o.isArray)(e.propagatorTypes)}function u(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},u={},a=n?"1":"0";return r.includes("sw8")&&(r=["sw8"]),(0,o.isArray)(r)||(r=[r]),r.forEach((function(n){switch(n){case"jaeger":u["uber-trace-id"]="".concat(e,":").concat(t,":0:").concat(a);break;case"b3":u.b3="".concat(e,"-").concat(t,"-").concat(a);break;case"b3multi":u["X-B3-TraceId"]=e,u["X-B3-SpanId"]=t,u["X-B3-Sampled"]=a;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);u.sw8="".concat(a,"-").concat(r,"-").concat(c,"-",0,"-").concat(s,"-").concat(f,"-").concat(l,"-").concat(p)}break;case"tracecontext":default:u.traceparent="00-".concat(e,"-").concat(t,"-0").concat(a),i.tracestate&&(u.tracestate=i.tracestate)}})),i.baggage&&(u.baggage=i.baggage),u}function a(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,u=void 0===n||n,a=e.sample,c=void 0===a?100:a,s=e.propagatorTypes,f=void 0===s?t:s,l=e.allowedUrls,p=void 0===l?[]:l,v=e.tracestate,y=void 0===v||v,h=e.baggage,d=void 0!==h&&h,m=[];return(0,o.isArray)(p)&&p.length&&p.forEach((function(e){(0,r.isMatchOption)(e)?m.push({match:e,propagatorTypes:f}):i(e)&&m.push(e)})),{enable:!(0,o.isBoolean)(u)||u,sample:(0,o.isNumber)(c)?c:100,propagatorTypes:f,allowedUrls:m,tracestate:y,baggage:d}}t.isTraceOption=i,t.makeTracingHeaders=u,t.parseTracingOptions=a},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,a(n.key),n)}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(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(2),l=n(13),p=function(){function e(){var t=this;o(this,e),this.name="pv-collector",this.onLaunch=function(e,n){if(e&&n&&"app"===e.$mpType){var r=(0,f.getRumViewId)(e,t.ctx.session);t.sendPv({id:r,route:n.path})}},this.onBeforeCreate=function(e){if("page"===e.$mpType&&e.route){var n=(0,f.getRumViewId)(e,t.ctx.session);t.sendPv({id:n,route:e.route})}},this.onUnload=function(){var e=(0,f.getCurView)(t.ctx);t.ctx.removeView(e.id)},this.sendPv=function(e){t.prevPage&&e.id===t.prevPage.id||(e.name=t.getViewName(e.route),t.prevPage=e,t.ctx.addView(e),t.sendEvent(Object.assign({event_type:s.RumEventType.VIEW,type:"pv",loading_type:"initial_load"},e)))}}return u(e,[{key:"setup",value:function(e,t){this.ctx=e,this.sendEvent=t,(0,l.addEventListener)("onLaunch",this.onLaunch),(0,l.addEventListener)("beforeCreate",this.onBeforeCreate),(0,l.addEventListener)("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.removeEventListener)("onLaunch",this.onLaunch),(0,l.removeEventListener)("beforeCreate",this.onBeforeCreate)}}])}();t.default=p},function(e,t,n){"use strict";(function(e){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,a(n.key),n)}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(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(2),l=function(){function t(){var e=this;o(this,t),this.name="exception-collector",this.uniError=function(t){e.errorHandle(t,"uni.onError")},this.onError=function(t){e.errorHandle(t,"onError")},this.onUnhandledRejection=function(t){if(t){var n=t.reason;if(n){var r=n.errMsg;if(r&&(0,s.isString)(r)){(n=new Error(r)).name="",n.stack="";for(var o,i,u=0,a=["navigateTo","redirectTo","appLaunch","switchTab","getLocation","onLocationChange"];u<a.length;u++)if(o=a[u],r.startsWith(o)){n.name=o;break}n.name||(n.name=r.split(":")[0])}e.errorHandle(n,"onUnhandledRejection")}}},this.errorHandle=function(t){var n,r,o,i,u,a,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",l=(0,f.getCurView)(e.ctx);if(t instanceof Object){if(n=t.name,r=t.message,o=t.filename||t.fileName,i=t.stack,u=t.lineno||t.lineNumber,a=t.colno||t.columnNumber,t.error instanceof Error){var p=t.error;n=p.name,r=p.message,i=p.stack}}else if("string"==typeof t){i=t;var v=e.getErrorByStack(t);v&&(n=v.name,r=v.message)}n&&r&&e.sendEvent({event_type:s.RumEventType.EXCEPTION,source:c,type:"error",name:n,message:r,file:o,stack:i,line:u,column:a,times:1,view:l})}}return u(t,[{key:"setup",value:function(e,t){this.ctx=e,this.sendEvent=t,this.hackOrigin()}},{key:"hackOrigin",value:function(){var t=this,n,r=this.ctx.getConfig().collectors,o=void 0===r?{}:r;if(!1!==o.jsError)try{uni.onError(this.uniError),e.addEventListener("error",this.onError),e.addEventListener("unhandledrejection",this.onUnhandledRejection)}catch(t){console.error(t)}!1!==o.consoleError&&(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:"destroy",value:function(){(0,s.restoreFunction)(e.console,"error")}}])}();t.default=l}).call(this,n(14))},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/facebook/regenerator/blob/main/LICENSE */function e(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}function t(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,u=Object.create(o.prototype),a=new y(r||[]);return w(u,"_invoke",{value:f(e,n,a)}),u}function n(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function u(){}function a(){}function c(t){["next","throw","return"].forEach((function(n){e(t,n,(function(e){return this._invoke(n,e)}))}))}function s(e,t){function o(i,u,a,c){var s=n(e[i],e,u);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?t.resolve(l.__await).then((function(e){o("next",e,a,c)}),(function(e){o("throw",e,a,c)})):t.resolve(l).then((function(e){f.value=e,a(f)}),(function(e){return o("throw",e,a,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function f(e,t,r){var o="suspendedStart";return function(i,u){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw u;return{value:d,done:!0}}for(r.method=i,r.arg=u;;){var a=r.delegate;if(a){var c=l(a,r);if(c){if(c===j)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(e,t,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===j)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(e,t){var r=t.method,o=e.iterator[r];if(o===d)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=d,l(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),j;var i=n(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,j;var u=i.arg;return u?u.done?(t[e.resultName]=u.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=d),t.delegate=null,j):u:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,j)}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function v(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function y(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset(!0)}function h(e){if(e||""===e){var t=e[O];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(b.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=d,t.done=!0,t};return o.next=o}}throw new TypeError(r(e)+" is not iterable")}o=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(e,t,n){e[t]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",_=E.toStringTag||"@@toStringTag";try{e({},"")}catch(S){e=function(e,t,n){return e[t]=n}}m.wrap=t;var j={},x={};e(x,O,(function(){return this}));var T=Object.getPrototypeOf,P=T&&T(T(h([])));P&&P!==g&&b.call(P,O)&&(x=P);var k=a.prototype=i.prototype=Object.create(x);return u.prototype=a,w(k,"constructor",{value:a,configurable:!0}),w(a,"constructor",{value:u,configurable:!0}),u.displayName=e(a,_,"GeneratorFunction"),m.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===u||"GeneratorFunction"===(t.displayName||t.name))},m.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,e(t,_,"GeneratorFunction")),t.prototype=Object.create(k),t},m.awrap=function(e){return{__await:e}},c(s.prototype),e(s.prototype,S,(function(){return this})),m.AsyncIterator=s,m.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var u=new s(t(e,n,r,o),i);return m.isGeneratorFunction(n)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},c(k),e(k,_,"Generator"),e(k,O,(function(){return this})),e(k,"toString",(function(){return"[object Generator]"})),m.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},m.values=h,y.prototype={constructor:y,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(v),!e)for(var t in this)"t"===t.charAt(0)&&b.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){function t(t,r){return i.type="throw",i.arg=e,n.next=t,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var u=b.call(o,"catchLoc"),a=b.call(o,"finallyLoc");if(u&&a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!a)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(e,t){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,j):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),j},finish:function(e){for(var t,n=this.tryEntries.length-1;0<=n;--n)if((t=this.tryEntries[n]).finallyLoc===e)return this.complete(t.completion,t.afterLoc),v(t),j},catch:function(e){for(var t,n=this.tryEntries.length-1;0<=n;--n)if((t=this.tryEntries[n]).tryLoc===e){var r=t.completion;if("throw"===r.type){var o=r.arg;v(t)}return o}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:h(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=d),j}},m}function i(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,c(n.key),n)}function a(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=s(e,"string");return"symbol"==r(t)?t:t+""}function s(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 f=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 u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):o(e.value).then(u,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),p=n(3),v=n(32),y=n(5),h=n(2),d=n(33),m=function(){function e(){var t=this;i(this,e),this.name="api-collector",this.sendApi=function(e,n,r){return f(t,void 0,void 0,o().mark((function t(){var i,u,a,c,s,f,p,v,h,m,g;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:if(i=this.ctx.getConfig(),u=i.evaluateApi,a=n.statusCode,c=n.status,s=n.errMsg,f=n.errorMessage,p=n.message,v=n.profile,!(0,l.isFunction)(u)){o.next=13;break}return o.prev=3,0===e.success&&(h=new Error("request error")),o.next=7,u(r,n,h);case 7:m=o.sent,e=Object.assign(Object.assign({},e),(0,d.reviseApiAttr)(m)),o.next=13;break;case 11:o.prev=11,o.t0=o.catch(3);case 13:if(!((g=Object.assign({event_type:l.RumEventType.RESOURCE,type:"api",status_code:c||a,message:f||s||p,duration:(0,y.getCurrentTime)()-e.timestamp,times:1},e)).duration>l.ONE_DAY)){o.next=16;break}return o.abrupt("return");case 16:this.sendEvent(g);case 17:case"end":return o.stop()}}),t,this,[[3,11]])})))}}return a(e,[{key:"setup",value:function e(t,n){var r,o=t.getConfig().collectors,i;!1===(void 0===o?{}:o).api||(this.ctx=t,this.sendEvent=n,this.interceptorRequest())}},{key:"interceptorRequest",value:function e(){if((0,l.isFunction)(p.sdk.addInterceptor)){var t=this;p.sdk.addInterceptor("request",{invoke:function e(n){t.rebuildRequestOptions(n)}})}}},{key:"injectTracing",value:function e(t,n){var r,o=this.ctx.getConfig(),i=o.tracing,u=o.pid,a=o.version,c=void 0===a?"1.0.0":a,s=(0,l.parseTracingOptions)(i),f=s.enable,v=s.sample,y=s.propagatorTypes,h=s.allowedUrls,d=s.tracestate,m=!(void 0!==d)||d,g=s.baggage,b=void 0!==g&&g;if(f){var w=(0,l.find)(h,(function(e){return(0,l.matchList)([e.match],t.url)}));if(w){var E=w.propagatorTypes;0===E.length&&(E=y);var O=!1;E.includes("sw8")&&(E=["sw8"],O=!0);var S=O?(0,l.generateGUID)():(0,l.generateTraceId)(),_=O?(0,l.generateGUID)():(0,l.generateSpanId)(),j=(0,l.performDraw)(v),x=this.ctx.session.getUserId(),T=this.ctx.session.getSessionId(),P=m?"rum=v2&uniapp&".concat(u,"&").concat(T,"&").concat(x):void 0,k=b?"rum=v2,appType=uniapp,pid=".concat(u,",sid=").concat(T,",uid=").concat(x):void 0,C=(0,l.makeTracingHeaders)(S,_,j,E,{tracestate:P,baggage:k,appId:u,appVersion:c,viewName:null===(r=t.view)||void 0===r?void 0:r.name,host:p.appName});j&&(t.trace_id=S,t.trace_data=JSON.stringify({spanId:_,sample:v,sampled:j,header:C})),n(C)}}}},{key:"rebuildRequestOptions",value:function e(t){var n=this,r=t.url,o=t.success,i=t.fail,u=t.header,a=(0,y.getCurrentTime)();if((0,v.isEndpoint)(this.ctx,r)||(0,l.urlMatch)(r))return t;var c={view:(0,h.getCurView)(this.ctx),timestamp:a,url:r,name:this.getResourceName(r),method:t.method||"GET"};return this.injectTracing(c,(function(e){t.header=Object.assign(Object.assign({},u),e)})),t.success=function(){c.success=1;for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];n.sendApi(c,r[0],t),o&&o.apply(this,r)},t.fail=function(){c.success=0;for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];n.sendApi(c,r[0],t),i&&i.apply(this,r)},t}},{key:"getResourceName",value:function e(t){var n,r,o=this.ctx.getConfig().parseResourceName;return n=(0,l.isFunction)(o)?o(t):(0,v.getPathByURL)(t)}}])}();t.default=m},function(e,t,n){"use strict";function r(e){var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1];try{var n=u(e);return t?n.hash:n.pathname}catch(e){return""}}function o(e,t){var n,r=e.getConfig().endpoint;try{return u(t).hostname===u(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 u(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=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviseApiAttr=void 0;var r=n(0);function o(e){if(e&&(0,r.isObject)(e)){var t={};return(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)),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,a(n.key),n)}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(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(5),f=n(2),l=function(){function e(){o(this,e),this.name="default-processor"}return u(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,a(n.key),n)}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(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=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 u(e,[{key:"setup",value:function(e){this.ctx=e,this.update=(0,s.debounce)(this.update,s.ONE_SECOND)}},{key:"process",value:function(e){return this.update(),e.getRumEvent()}}])}();t.default=f},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,a(n.key),n)}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(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=v(t),f(e,p()?Reflect.construct(t,n||[],v(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 v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(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)}Object.defineProperty(t,"__esModule",{value:!0});var d=n(0),m=n(3),g=function(e){function t(){var e;return o(this,t),(e=s(this,t,arguments)).name="uni-reporter",e}return y(t,e),u(t,[{key:"init",value:function(){var e=this;m.sdk.onAppHide((function(){e.flushEventQueue()}))}},{key:"request",value:function(e,t){var n=e.getConfig();(0,m.fixAttrs)(t).then((function(e){m.sdk.request({url:n.endpoint,method:"POST",dataType:"text",data:JSON.stringify(e)})})).catch((function(e){console.warn("[arms] sendRequest fail",e)}))}}])}(d.Reporter);t.default=g},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)||u(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 u(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 c(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,u,a=[],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)&&(a.push(r.value),a.length!==t);c=!0);}catch(c){s=!0,o=c}finally{try{if(!c&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(s)throw o}}return a}}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,v(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 v(e){var t=y(e,"string");return"symbol"==r(t)?t:t+""}function y(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 h=n(0),d=n(5),m=n(2),g=n(3),b="_arms_uid",w="_arms_session",E=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,d.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,d.getCurrentTime)(),r=e.sampled?1:0;(0,g.setStorageSync)(w,"".concat(e.sessionId,"-").concat(r,"-").concat(t,"-").concat(n))}}},{key:"getSessionInfo",value:function(){var e,t=o(((0,g.getStorageSync)(w)||"").split("-"),4),n=t[0],r=t[1],i=t[2],u=t[3],a={sessionId:n,sampled:"0"!==r,startTime:parseInt(i||"")||0,lastTime:parseInt(u||"")||0};return this.checkSession(a)||(a=this.resetSession()),a}},{key:"getEventId",value:function(){return(0,h.generateEventId)(this.getSessionId())}},{key:"getViewId",value:function(){return this.getUUID()}},{key:"getUserId",value:function(){var e=(0,g.getStorageSync)(b);return e&&0===e.indexOf("user_")&&(e=""),e||(e="uid_".concat((0,h.generateSpanId)(16,36)),(0,g.setStorageSync)(b,e)),e}},{key:"resetSession",value:function(){var e=this.sessionConfig.sampleRate,t=this.getUUID(),n=(0,d.getCurrentTime)(),r=(0,h.performDraw)(100*e),o="".concat(t,"-").concat(r?1:0,"-").concat(n,"-").concat(n);return(0,g.setStorageSync)(w,o),{sessionId:t,sampled:r,startTime:n,lastTime:n,isNew:!0}}},{key:"getUUID",value:function(){return(0,h.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,h.isNumber)(t)||0>t||1<t)&&(t=1),(!(0,h.isNumber)(n)||n<4*h.ONE_HOUR||n>h.ONE_DAY)&&(n=h.ONE_DAY),(!(0,h.isNumber)(r)||r>h.ONE_HOUR||r<10*h.ONE_MINUTE)&&(r=30*h.ONE_MINUTE),{sampleRate:t,maxDuration:n,overtime:r}}},{key:"getBaseEvent",value:function(){return{timestamp:(0,d.getCurrentTime)(),session_id:this.getSessionId(),event_id:this.getEventId(),view:this.ctx?(0,m.getCurView)(this.ctx):void 0,times:1}}}])}();t.RumSession=E}]);
1
+ module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="./dist/",r(r.s=16)}([function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function t(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.Shell=e.Reporter=e.Context=e.Client=void 0;var i=r(6);e.Client=i.default;var a=r(8);e.Context=a.default;var u=r(20);e.Reporter=u.default;var c=r(22);e.Shell=c.default,o(r(23),e),o(r(7),e),o(r(24),e),o(r(25),e),o(r(26),e),o(r(4),e),o(r(27),e),o(r(28),e),o(r(11),e),o(r(12),e),o(r(1),e),o(r(29),e),o(r(13),e),o(r(30),e),o(r(9),e),o(r(10),e)},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return n(t)===e}Object.defineProperty(e,"__esModule",{value:!0}),e.isZero=e.isObject=e.isNull=e.isNumber=e.isBoolean=e.isRegExp=e.isArray=e.isToString=e.isString=e.isFunction=e.isTypeof=void 0,e.isTypeof=o;var i=function t(e){return"function"==typeof e};function a(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")}function u(){for(var t=0;t<arguments.length;t++)if(0!==(t<0||arguments.length<=t?void 0:arguments[t]))return!1;return!0}e.isFunction=i,e.isString=function(t){return o(t,"string")},e.isToString=a,e.isArray=function(t){return a(t,"Array")},e.isRegExp=function(t){return a(t,"RegExp")},e.isBoolean=function(t){return o(t,"boolean")},e.isNumber=function(t){return o(t,"number")&&!isNaN(t)||o(t,"bigint")},e.isNull=function(t){return null===t},e.isObject=function(t){return!(0,e.isNull)(t)&&o(t,"object")},e.isZero=u},function(t,e,r){"use strict";function n(t,r){return t?t[e.PAGE_ID]?t[e.PAGE_ID]:r?t[e.PAGE_ID]=r.getViewId():void 0:void 0}function o(t,e){return t&&e?e.getViews().find((function(e){return e.id===t})):void 0}function i(t){if(t){var e=t.getViews();if(e&&e.length)return e[e.length-1]}}Object.defineProperty(e,"__esModule",{value:!0}),e.getCurView=e.getViewById=e.getRumViewId=e.PAGE_ID=void 0,e.PAGE_ID="__rum_view_id",e.getRumViewId=n,e.getViewById=o,e.getCurView=i},function(t,e,r){"use strict";(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,r,n){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),u=new v(n||[]);return w(a,"_invoke",{value:f(t,r,u)}),a}function r(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function i(){}function a(){}function u(){}function c(e){["next","throw","return"].forEach((function(r){t(e,r,(function(t){return this._invoke(r,t)}))}))}function s(t,e){function o(i,a,u,c){var s=r(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==n(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function f(t,e,n){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=l(u,n);if(c){if(c===_)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===o)throw o="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o="executing";var s=r(t,e,n);if("normal"===s.type){if(o=n.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o="completed",n.method="throw",n.arg=s.arg)}}}function l(t,e){var n=e.method,o=t.iterator[n];if(o===d)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var i=r(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function v(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function y(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(b.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(n(t)+" is not iterable")}o=function(){return g};var d,g={},m=Object.prototype,b=m.hasOwnProperty,w=Object.defineProperty||function(t,e,r){t[e]=r.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",x=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,r){return t[e]=r}}g.wrap=e;var _={},j={};t(j,O,(function(){return this}));var k=Object.getPrototypeOf,P=k&&k(k(y([])));P&&P!==m&&b.call(P,O)&&(j=P);var T=u.prototype=i.prototype=Object.create(j);return a.prototype=u,w(T,"constructor",{value:u,configurable:!0}),w(u,"constructor",{value:a,configurable:!0}),a.displayName=t(u,x,"GeneratorFunction"),g.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},g.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,t(e,x,"GeneratorFunction")),e.prototype=Object.create(T),e},g.awrap=function(t){return{__await:t}},c(s.prototype),t(s.prototype,S,(function(){return this})),g.AsyncIterator=s,g.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new s(e(t,r,n,o),i);return g.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},c(T),t(T,x,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),g.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},g.values=y,v.prototype={constructor:v,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,n){return i.type="throw",i.arg=t,r.next=e,n&&(r.method="next",r.arg=d),!!n}if(this.done)throw t;for(var r=this,n=this.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var r,n=this.tryEntries.length-1;0<=n;--n)if((r=this.tryEntries[n]).tryLoc<=this.prev&&b.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,r=this.tryEntries.length-1;0<=r;--r)if((e=this.tryEntries[r]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,r=this.tryEntries.length-1;0<=r;--r)if((e=this.tryEntries[r]).tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:y(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=d),_}},g}var i=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fixAttrs=e.getNetType=e.getPerformance=e.setStorageSync=e.getStorageSync=e.appName=e.sdk=e.VERSION=e.global2=void 0;var a=r(0);function u(t){return"function"==typeof e.sdk.getStorageSync?e.sdk.getStorageSync(t):void 0}function c(t,r){return"function"==typeof e.sdk.setStorageSync?e.sdk.setStorageSync(t,r):void 0}function s(){return"performance"in e.global2?e.global2.performance:void 0}function f(){return new Promise((function(t){try{e.sdk.getNetworkType({success:function e(r){var n=r.networkType||r.subtype;t(n?n.toLowerCase():void 0)},fail:function e(r){t(void 0)}})}catch(e){t(void 0)}}))}e.global2=t||window,e.VERSION="0.1.1",e.sdk=uni,e.appName="uniapp",e.getStorageSync=u,e.setStorageSync=c,e.getPerformance=s,e.getNetType=f;var l=function t(r){return i(this,void 0,void 0,o().mark((function t(){var n,i,u,c,s;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:if(r){o.next=2;break}return o.abrupt("return");case 2:return o.next=4,f();case 4:return n=o.sent,r.app.type=a.AppType.uniapp,r._v=e.VERSION,r.net=Object.assign({model:n},r.net),i=e.sdk.getDeviceInfo()||{},u=e.sdk.getAppBaseInfo()||{},c={brand:i.brand,model:i.model},s={type:i.platform,version:i.system,container:e.appName,container_version:u.SDKVersion},r.device=Object.assign(Object.assign({},c),r.device),r.os=Object.assign(Object.assign({},s),r.os),o.abrupt("return",r);case 15:case"end":return o.stop()}}),t)})))};e.fixAttrs=l}).call(this,r(15))},function(t,e,r){"use strict";var n,o,i;Object.defineProperty(e,"__esModule",{value:!0}),e.AppType=e.ResourceStatus=e.RumEventType=void 0,function(t){t.VIEW="view",t.RESOURCE="resource",t.EXCEPTION="exception",t.LONG_TASK="longTask",t.ACTION="action",t.CUSTOM="custom",t.APPLICATION="application"}(n=e.RumEventType||(e.RumEventType={})),function(t){t[t.Unknown=-1]="Unknown",t[t.Failed=0]="Failed",t[t.Success=1]="Success"}(o=e.ResourceStatus||(e.ResourceStatus={})),function(t){t.browser="browser",t.miniapp="miniapp",t.minigame="minigame",t.uniapp="uniapp",t.reactnative="reactnative"}(i=e.AppType||(e.AppType={}))},function(t,e,r){"use strict";function n(){return(new Date).getTime()}function o(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"utf8";if("string"!=typeof t)throw new TypeError("Input must be a string");var r=e.toLowerCase();if("utf16"===r){for(var n,o=0,i=0;i<t.length;i++){if(55296<=(n=t.charCodeAt(i))&&56319>=n&&i+1<t.length){var a=t.charCodeAt(i+1);if(56320<=a&&57343>=a){o+=4,i++;continue}}o+=2}return o}if("utf8"===r){for(var u,c=0,s=0;s<t.length;s++){if(55296<=(u=t.charCodeAt(s))&&56319>=u&&s+1<t.length){var f=t.charCodeAt(s+1);56320<=f&&57343>=f&&(u=1024*(u-55296)+(f-56320)+65536,s++)}c+=127>=u?1:2047>=u?2:65535>=u?3:1114111>=u?4:3}return c}throw new Error('Unsupported encoding. Use "utf8" or "utf16".')}Object.defineProperty(e,"__esModule",{value:!0}),e.getStringSize=e.getCurrentTime=void 0,e.getCurrentTime=n,e.getStringSize=o},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function t(){};return{s:o,n:function e(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function e(){r=r.call(t)},n:function t(){var e=r.next();return u=e.done,e},e:function t(e){c=!0,a=e},f:function t(){try{u||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function s(t,e,r){return e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t){var e=l(t,"string");return"symbol"==n(e)?e:e+""}function l(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var p=r(7),h=r(19),v=r(8),y=r(1),d=function(){function t(){var e=this;u(this,t),this.emitter=new h.EventEmitter,this.sendEvent=function(t){e.emitter.emit(p.EventType.collect,t)}}return s(t,[{key:"init",value:function t(e,r,n){var i=this;this.ctx=new v.default(e,r,n);var a=this.ctx,u=this.collectors,c=this.processors,s=this.reporter;c.forEach((function(t){(0,y.isFunction)(t.setup)&&t.setup(a)})),this.emitter.on(p.EventType.collect,(function(t){a.setRumEvent(t);var e=o(c),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;if(n.match||(n.match=function(){return!0}),n.match(a)){var i=n.process(a);i&&a.setRumEvent(i)}}}catch(t){e.e(t)}finally{e.f()}s.report(a)})),u.forEach((function(t){t.setup(a,i.sendEvent)}))}},{key:"setContext",value:function t(e){this.ctx=e}},{key:"getContext",value:function t(){return this.ctx}},{key:"useCollectors",value:function t(e){this.collectors=e}},{key:"getCollectors",value:function t(){return this.collectors}},{key:"useProcessors",value:function t(e){this.processors=e}},{key:"useReporter",value:function t(e){this.reporter=e}}])}();e.default=d},function(t,e,r){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.EventType=void 0,function(t){t.collect="collect"}(n=e.EventType||(e.EventType={}))},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==n(e)?e:e+""}function c(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(e,r,n){o(this,t),this.config=e,this.views=[],r&&(this.session=r,this.session.init(this)),n&&(this.configManager=n)}return a(t,[{key:"getConfig",value:function t(){return this.configManager?this.configManager.getConfig():this.config}},{key:"setConfig",value:function t(e){this.configManager?this.configManager.setConfig(e):this.config=e}},{key:"getViews",value:function t(){return this.views}},{key:"addView",value:function t(e){var r=this.views.findIndex((function(t){return t.id===e.id}));r>=0&&this.views.splice(r,1),this.views.push(e)}},{key:"removeView",value:function t(e){this.views=this.views.filter((function(t){return t.id!==e}))}},{key:"getRumEvent",value:function t(){return this.rumEvent}},{key:"setRumEvent",value:function t(e){this.rumEvent=e}}])}();e.default=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.verifyProperties=void 0;var n=r(1);function o(t){if((0,n.isObject)(t)){var e=Object.assign({},t);Object.keys(e).forEach((function(t){var r=e[t];if(t.length>50){var o=t.substring(0,50);e[o]=r,delete e[t],t=o}(0,n.isString)(r)||(0,n.isNumber)(r)?(0,n.isString)(r)&&r.length>2e3&&(e[t]=r.substring(0,2e3)):delete e[t]}));var r=Object.keys(e);if(r.length)return r.length>20&&r.forEach((function(t,r){r>19&&delete e[t]})),e}}e.verifyProperties=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getUrlParams=void 0;var n=function t(e){if(0===e.length)return"";try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e.replace(/\+/g," ").replace(/%20/g," ").replace(/%2F/g,"/").replace(/%3D/g,"=").replace(/%26/g,"&").replace(/%3F/g,"?")}},o=function t(e){if(0===e.length)return"";var r=e.indexOf("#"),n=r>=0?e.slice(0,r):e,o=n.indexOf("?");return-1===o?"":n.slice(o+1)};function i(t){if("string"!=typeof t||!t.trim())return{};var e={},r=o(t);if(!r)return e;for(var i=r.split("&"),a=0;a<i.length;a++){var u=i[a];if(u){var c=u.indexOf("=");if(!(c<=0)){var s=n(u.slice(0,c)),f=c<u.length-1?n(u.slice(c+1)):"",l=e[s];void 0!==l?Array.isArray(l)?l.push(f):e[s]=[l,f]:e[s]=f}}}return e}e.getUrlParams=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseRegExpString=e.transStrToReg=e.getType=e.delay=e.debounce=e.generateEventId=e.generateSpanId=e.generateTraceId=e.generateGUID=e.restoreFunction=e.interceptFunction=void 0;var n=r(1),o=/^\[object ([a-z]*)\]$/;function i(t,e,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=t[e],a=function e(){for(var a=o?this:t,u=arguments.length,c=new Array(u),s=0;s<u;s++)c[s]=arguments[s];if(r.apply(a,c),(0,n.isFunction)(i))return i.apply(a,c)};a._rum_intercepted=i,t[e]=a}function a(t,e){var r=t[e];if(!(0,n.isFunction)(r)){var o=r._rum_intercepted;(0,n.isFunction)(o)||(t[e]=o)}}function u(){var t="";try{if(crypto&&crypto.randomUUID)t=crypto.randomUUID();else if(crypto&&crypto.getRandomValues){var e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128,t=e.reduce((function(t,e){return t+e.toString(16).padStart(2,"0")}),"").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/,"$1-$2-$3-$4-$5")}}catch(e){t=""}return t||(t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0,r;return("x"==t?e:3&e|8).toString(16)}))),t}function c(){var t=u().replace(/-/g,"");return"0"===t[0]&&(t="1"+t.substring(1)),"0"===t[16]&&(t=t.substring(0,16)+"1"+t.substring(17)),t}function s(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,r="",n=0;n<t;n++)r+=Math.floor(Math.random()*e).toString(e);return r}function f(t){var e=s();return"00-".concat(t,"-").concat(e)}function l(t,e){var r;if((0,n.isFunction)(t))return function(){var n=this,o=arguments;r&&clearTimeout(r),r=setTimeout((function(){t.apply(n,o)}),e)}}function p(t,e){if((0,n.isFunction)(t)){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return setTimeout.apply(void 0,[t,+e||0].concat(o))}}function h(t){var e=Object.prototype.toString.call(t),r=(e=e.toLowerCase()||"").match(o);return null==r?void 0:r[1]}function v(t){return"string"!==h(t)?t:t.length>2&&"/"===t[0]&&"/"===t[t.length-1]?new RegExp(t.substr(1,t.length-2)):t}function y(t){if("string"!=typeof t)throw new TypeError("input must be a string");if(t.length>2&&"/"===t[0]){var e=t.lastIndexOf("/");if(e>0){var r=t.substring(1,e),n=t.substring(e+1);return new RegExp(r,n)}return new RegExp(t.substring(1,t.length-1))}return new RegExp(t)}e.interceptFunction=i,e.restoreFunction=a,e.generateGUID=u,e.generateTraceId=c,e.generateSpanId=s,e.generateEventId=f,e.debounce=l,e.delay=p,e.getType=h,e.transStrToReg=v,e.parseRegExpString=y},function(t,e,r){"use strict";function n(t,e){for(var r=0;r<t.length;r+=1){var n=t[r];if(e(n,r))return n}}function o(t,e){return t.slice(0,e.length)===e}function i(t,e){return t.slice(-e.length)===e}function a(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return r.forEach((function(e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})),t}Object.defineProperty(e,"__esModule",{value:!0}),e.assign=e.endsWith=e.startsWith=e.find=void 0,e.find=n,e.startsWith=o,e.endsWith=i,e.assign=a},function(t,e,r){"use strict";function n(t){return u(t)||a(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.parseRule2Match=e.urlMatch=e.matchList=e.isMatchOption=void 0;var s=r(1),f=r(12),l=r(11);function p(t){return(0,s.isString)(t)||(0,s.isFunction)(t)||(0,s.isRegExp)(t)}function h(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0;return t.some((function(t){try{if("function"==typeof t)return t(e,n);if(t instanceof RegExp)return t.test(e);if("string"==typeof t)return r?(0,f.startsWith)(e,t):t===e}catch(t){}return!1}))}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{(0,s.isArray)(e)||(e=[e]);var r=[/^(https?:)?\/\/.*rum|retcode|log-global|log\.aliyuncs\.com/,/^(https?:)?\/\/.*\.mmstat\.com/,/^(https?:)?\/\/.*hm\.baidu\.com/,/^(https?:)?\/\/.*google-analytics\.com/,/data:(.+?)(;base64)?,(.+)$/].concat(n(e));return h(r,t)}catch(t){return!1}}function y(t){if(p(t))return t;var e;switch(t.match_exp){case"equals":e=function e(r){return r===t.match};break;case"not_equals":e=function e(r){return r!==t.match};break;case"regex":e=(0,l.parseRegExpString)(t.match);break;case"includes":e=function e(r){return r.includes(t.match)};break;case"starts_with":default:e=function e(r){return(0,f.startsWith)(r,t.match)}}return e}e.isMatchOption=p,e.matchList=h,e.urlMatch=v,e.parseRule2Match=y},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.removeEventListener=e.addEventListener=e.mixin=void 0;var n,o={onLaunch:[],onLoad:[],onShow:[],beforeCreate:[],mounted:[]};function i(t){if(!n){n=t;var e={};Object.keys(o).forEach((function(t){e[t]=function(e){var r=this,n;o[t].forEach((function(t){t(r,e)}))}})),t.mixin(e)}}function a(t,e){t in o||(o[t]=[]),o[t].push(e)}function u(t,e){if(t in o&&e){var r=o[t],n=r.indexOf(e);return r.splice(n,1),!0}return!1}e.mixin=i,e.addEventListener=a,e.removeEventListener=u},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){t.exports=r(17)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArmsRum=void 0;var n=r(18);Object.defineProperty(e,"ArmsRum",{enumerable:!0,get:function(){return n.ArmsRum}}),e.default=n.default},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,r){return(e=c(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var r,n=0;n<e.length;n++)(r=e[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}function u(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==n(e)?e:e+""}function s(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function f(t,e,r){return e=v(e),l(t,h()?Reflect.construct(e,r||[],v(t).constructor):e.apply(t,r))}function l(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return p(t)}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function d(t,e){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ArmsRum=void 0;var g=r(0),m=r(31),b=r(32),w=r(33),E=r(36),O=r(37),S=r(38),x=r(3),_=r(39),j=r(14),k=function(t){function e(){var t;return i(this,e),(t=f(this,e,arguments)).version=x.VERSION,t}return y(e,t),u(e,[{key:"init",value:function(t){return t.vue&&this.setVue(t.vue),this.client.useCollectors([new m.default,new b.default,new w.default]),this.client.useProcessors([new E.default,new O.default]),this.client.useReporter(new S.default),this.client.init(t,new _.RumSession),this}},{key:"setConfig",value:function(){var t=this.client.getContext();if(2===arguments.length){var e=this.client.getContext(),r=e.getConfig();e.setConfig(Object.assign(Object.assign({},r),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:"setVue",value:function(t){this.setConfig("vue",t),(0,j.mixin)(t)}}])}(g.Shell);e.ArmsRum=k,e.default=new k},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==n(e)?e:e+""}function c(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.EventEmitter=void 0;var s=function(){function t(){o(this,t),this.events={}}return a(t,[{key:"on",value:function t(e,r){this.events[e]||(this.events[e]=[]),this.events[e].push(r)}},{key:"emit",value:function t(e){var r=this.events[e];if(r){for(var n=r.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<n.length;u++)try{n[u].apply(n,i)}catch(t){console.error('Error in handler for "'.concat(e,'":'),t)}}}},{key:"off",value:function t(e,r){var n=this.events[e];if(n)if(r){for(var o=n.length;o--;)n[o]===r&&n.splice(o,1);0===n.length&&delete this.events[e]}else delete this.events[e]}},{key:"once",value:function t(e,r){var n=this,o=function t(){n.off(e,o),r.apply(void 0,arguments)};this.on(e,o)}}])}();e.EventEmitter=s},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function t(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function t(e,r,n){return e[r]=n}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new N(n||[]);return a(i,"_invoke",{value:P(t,r,u)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var v="suspendedStart",y="suspendedYield",d="executing",g="completed",m={};function b(){}function w(){}function E(){}var O={};l(O,c,(function(){return this}));var S=Object.getPrototypeOf,x=S&&S(S(I([])));x&&x!==r&&i.call(x,c)&&(O=x);var _=E.prototype=b.prototype=Object.create(O);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,a,u,c){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==n(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return r("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function t(n,i){function a(){return new e((function(t,e){r(n,i,t,e)}))}return o=o?o.then(a,a):a()}})}function P(e,r,n){var o=v;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=T(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?g:y,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=E,a(_,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(_),l(_,f,"Generator"),l(_,c,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function e(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!r)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function e(r){if(this.done)throw r;var n=this;function o(e,o){return c.type="throw",c.arg=r,n.next=e,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],c=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var s=i.call(u,"catchLoc"),f=i.call(u,"finallyLoc");if(s&&f){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function t(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=r,a?(this.method="next",this.next=a.finallyLoc,m):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),m},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;L(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function e(r,n,o){return this.delegate={iterator:I(r),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=t),m}},e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function u(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==n(e)?e:e+""}function s(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});var l=r(4),p=r(21),h=r(1),v=r(9),y=r(10),d=3e3,g=20,m=["app","user","device","os","geo","isp","net","properties"],b=function(){function t(){i(this,t),this.name="reporter",this.eventQueue=[],this._init=!1}return u(t,[{key:"getReportCfg",value:function t(){var e=this.ctx.getConfig().reportConfig;return(0,h.isObject)(e)||(e={}),(!e.flushTime||e.flushTime<0||e.flushTime>1e4)&&(e.flushTime=3e3),(!e.maxEventCount||e.maxEventCount<1||e.maxEventCount>100)&&(e.maxEventCount=20),e}},{key:"report",value:function t(e){var r=this;this.ctx=e,this._init||(this.init(e),this._init=!0),clearTimeout(this.timer),this.pushToQueue();var n=this.getReportCfg();this.eventQueue.length>=n.maxEventCount?this.flushEventQueue():this.timer=setTimeout((function(){r.flushEventQueue()}),n.flushTime)}},{key:"pushToQueue",value:function t(){var e=this.ctx,r=this.eventQueue,n=e.getRumEvent();if(n.event_type===l.RumEventType.EXCEPTION){var o=n.message,i=n.stack,a=(0,p.getErrorID)({message:o,stack:i}),u=this.eventQueue.find((function(t){if(t.event_type===l.RumEventType.EXCEPTION){var e=t.message,r=t.stack;return(0,p.getErrorID)({message:e,stack:r})===a}}));if(u)return void u.times++}if(n.event_type===l.RumEventType.ACTION){var c=n.target_name,s=this.eventQueue.find((function(t){if(t.event_type===l.RumEventType.ACTION)return c===t.target_name}));if(s)return void s.times++}r.push(n)}},{key:"flushEventQueue",value:function t(){var e=this.ctx,r=this.eventQueue;if(r.length){var n=e.getViews(),o=n[n.length-1];n.forEach((function(t){var e;t.id===o.id&&r.filter((function(e){var r;return(null===(r=e.view)||void 0===r?void 0:r.id)===t.id})).forEach((function(t){delete t.view}))}));var i=e.session,a;(!i||i.getSampled())&&this.mergeEvent(e,r,o),this.eventQueue=[]}}},{key:"mergeEvent",value:function t(e,r,n){for(var o=e.getConfig(),i=e.session,a=i.getSessionId(),u=0;u<r.length;u++){var c=r[u];c.session_id===a?delete c.session_id:(r.splice(u,1),u--)}if(0!==r.length){var s=(0,y.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:n,events:r},s);m.forEach((function(t){var e=o[t];(0,h.isObject)(e)&&Object.keys(e).forEach((function(r){var n=e[r];"user"===t&&"id"===r||("properties"===t?f[t]=(0,v.verifyProperties)(e):((0,h.isString)(n)||(0,h.isNumber)(n))&&(t in f||(f[t]={}),f[t][r]=n))}))})),("function"!=typeof o.beforeReport||(f=o.beforeReport(f)))&&this.tryRequest(f)}}},{key:"tryRequest",value:function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n,i,a;return f(this,void 0,void 0,o().mark((function t(){var u=this,c,s,f;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:return c=null===(n=this.ctx.getConfig())||void 0===n?void 0:n.reportConfig,s=null!==(i=null==c?void 0:c.maxRetryCount)&&void 0!==i?i:0,f=null!==(a=null==c?void 0:c.retryDelay)&&void 0!==a?a:3e3,o.prev=3,e._retry=r,o.next=7,this.request(this.ctx,e);case 7:o.next=12;break;case 9:o.prev=9,o.t0=o.catch(3),r<s-1&&setTimeout((function(){return u.tryRequest(e,r+1)}),f);case 12:case"end":return o.stop()}}),t,this,[[3,9]])})))}},{key:"init",value:function t(e){}}])}();e.default=b},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getErrorID=void 0;var n=function t(e){var r=e.message,n=void 0===r?"":r,o=e.stack,i;return n+(void 0===o?"":o)};e.getErrorID=n},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==n(e)?e:e+""}function c(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(4),f=r(6),l=r(1),p=function(){function t(e){o(this,t),this.client=new f.default,e&&this.init&&this.init(e)}return a(t,[{key:"sendEvent",value:function t(e){this.client&&this.client.sendEvent(e)}},{key:"getConfig",value:function t(){if(this.client)return this.client.getContext().getConfig()}},{key:"sendCustom",value:function t(e){if(e.name&&e.type){var r=Object.assign(Object.assign({},e),{event_type:s.RumEventType.CUSTOM});this.sendEvent(r)}}},{key:"sendView",value:function t(e){if((0,l.isObject)(e)){if(e.type||(e.type="custom"),"custom"===e.type){var r=0;if(["t1","t2","t3"].forEach((function(t){(0,l.isNumber)(e[t])||delete e[t],t in e&&r++})),0===r)return}var n=Object.assign(Object.assign({},e),{event_type:s.RumEventType.VIEW});this.sendEvent(n)}}},{key:"sendException",value:function t(e){if(e.name&&e.message){var r=e.name,n=e.message,o=e.stack,i=Object.assign(Object.assign({times:1,name:r,message:n,stack:o},e),{event_type:s.RumEventType.EXCEPTION,type:"custom",source:"custom"});this.sendEvent(i)}}},{key:"sendResource",value:function t(e){if(e.name&&e.type&&(0,l.isNumber)(e.duration)){var r=Object.assign(Object.assign({times:1},e),{event_type:s.RumEventType.RESOURCE});this.sendEvent(r)}}}])}();e.default=p},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function t(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function t(e,r,n){return e[r]=n}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new N(n||[]);return a(i,"_invoke",{value:P(t,r,u)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var v="suspendedStart",y="suspendedYield",d="executing",g="completed",m={};function b(){}function w(){}function E(){}var O={};l(O,c,(function(){return this}));var S=Object.getPrototypeOf,x=S&&S(S(I([])));x&&x!==r&&i.call(x,c)&&(O=x);var _=E.prototype=b.prototype=Object.create(O);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,a,u,c){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==n(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return r("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function t(n,i){function a(){return new e((function(t,e){r(n,i,t,e)}))}return o=o?o.then(a,a):a()}})}function P(e,r,n){var o=v;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=T(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?g:y,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=E,a(_,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(_),l(_,f,"Generator"),l(_,c,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function e(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!r)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function e(r){if(this.done)throw r;var n=this;function o(e,o){return c.type="throw",c.arg=r,n.next=e,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],c=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var s=i.call(u,"catchLoc"),f=i.call(u,"finallyLoc");if(s&&f){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function t(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=r,a?(this.method="next",this.next=a.finallyLoc,m):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),m},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;L(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function e(r,n,o){return this.delegate={iterator:I(r),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=t),m}},e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function u(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==n(e)?e:e+""}function s(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))};function l(t){var e=t.remoteConfig||{};return{enable:!1!==e.enable&&!(!e.url&&!e.region),url:e.url||"",mode:e.mode||"launch-first",cacheTimeout:e.cacheTimeout||36e5}}Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigManager=void 0;var p=function(){function t(){i(this,t),this.currentConfig=null,this.initialized=!1}return u(t,[{key:"init",value:function t(e){return f(this,void 0,void 0,o().mark((function t(){var r=this,n,i,a;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:if(!this.initialized){o.next=2;break}return o.abrupt("return");case 2:if(this.currentConfig=Object.assign({},e),this.initialized=!0,n=l(e),this.currentConfig.remoteConfig=n,n.enable){o.next=8;break}return o.abrupt("return");case 8:return o.next=10,this.getCacheConfig();case 10:if((i=o.sent)&&i.content&&(this.currentConfig=this.mergeRemoteCfg(i.content)),!this.isCacheValid(i,n.cacheTimeout)){o.next=14;break}return o.abrupt("return");case 14:if(a=this.fetchRemoteCfg(this.currentConfig).then((function(t){if(t){var e=r.parseConfig(t);r.currentConfig=r.mergeRemoteCfg(e),r.setCacheConfig({timestamp:Date.now(),content:t})}})),"remote-first"!==n.mode){o.next=18;break}return o.next=18,a;case 18:case"end":return o.stop()}}),t,this)})))}},{key:"getConfig",value:function t(){if(!this.currentConfig)throw new Error("Config not initialized");return this.currentConfig}},{key:"setConfig",value:function t(e){return f(this,void 0,void 0,o().mark((function t(){return o().wrap((function t(r){for(;;)switch(r.prev=r.next){case 0:if(this.currentConfig){r.next=2;break}return r.abrupt("return");case 2:this.currentConfig=Object.assign(Object.assign({},this.currentConfig),e);case 3:case"end":return r.stop()}}),t,this)})))}},{key:"isCacheValid",value:function t(e,r){if(!e||!e.timestamp)return!1;var n=r||36e5;return Date.now()-e.timestamp<n}},{key:"mergeRemoteCfg",value:function t(e){var r=this.currentConfig,n=r.pid,o=r.app,i=r.endpoint,a=r.remoteConfig,u=r.beforeReport,c=r.properties;return Object.assign(Object.assign(Object.assign({},this.currentConfig),e),{pid:n,app:o,endpoint:i,remoteConfig:a,beforeReport:u,properties:c})}},{key:"destroy",value:function t(){this.currentConfig=null,this.initialized=!1}}])}();e.ConfigManager=p},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";function n(t){return 0!==t&&100*Math.random()<=t}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t)return t;var n=t.toString(),o=n.indexOf(".");n=-1!==o?n.substring(0,e+o+1):n.substring(0);var i=parseFloat(n);return i>=r?i:void 0}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNumber=e.performDraw=e.ONE_DAY=e.ONE_HOUR=e.ONE_MINUTE=e.ONE_SECOND=void 0,e.ONE_SECOND=1e3,e.ONE_MINUTE=60*e.ONE_SECOND,e.ONE_HOUR=60*e.ONE_MINUTE,e.ONE_DAY=24*e.ONE_HOUR,e.performDraw=n,e.formatNumber=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTracingOptions=e.makeTracingHeaders=e.isTraceOption=void 0;var n=r(13),o=r(1);function i(t){return t&&(0,n.isMatchOption)(t.match)&&(0,o.isArray)(t.propagatorTypes)}function a(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a={},u=r?"1":"0";return n.includes("sw8")&&(n=["sw8"]),(0,o.isArray)(n)||(n=[n]),n.forEach((function(r){switch(r){case"jaeger":a["uber-trace-id"]="".concat(t,":").concat(e,":0:").concat(u);break;case"b3":a.b3="".concat(t,"-").concat(e,"-").concat(u);break;case"b3multi":a["X-B3-TraceId"]=t,a["X-B3-SpanId"]=e,a["X-B3-Sampled"]=u;break;case"sw8":if((0,o.isFunction)(btoa)){var n=btoa(t),c=btoa(e),s=btoa(i.appId),f=btoa(i.appVersion),l=btoa(i.viewName),p=btoa(i.host);a.sw8="".concat(u,"-").concat(n,"-").concat(c,"-",0,"-").concat(s,"-").concat(f,"-").concat(l,"-").concat(p)}break;case"tracecontext":default:a.traceparent="00-".concat(t,"-").concat(e,"-0").concat(u),i.tracestate&&(a.tracestate=i.tracestate)}})),i.baggage&&(a.baggage=i.baggage),a}function u(t){var e=["tracecontext"];if((0,o.isBoolean)(t)||!t)return{enable:!!t,sample:100,propagatorTypes:e,allowedUrls:[],tracestate:!0,baggage:!1};var r=t.enable,a=void 0===r||r,u=t.sample,c=void 0===u?100:u,s=t.propagatorTypes,f=void 0===s?e:s,l=t.allowedUrls,p=void 0===l?[]:l,h=t.tracestate,v=void 0===h||h,y=t.baggage,d=void 0!==y&&y,g=[];return(0,o.isArray)(p)&&p.length&&p.forEach((function(t){(0,n.isMatchOption)(t)?g.push({match:t,propagatorTypes:f}):i(t)&&g.push(t)})),{enable:!(0,o.isBoolean)(a)||a,sample:(0,o.isNumber)(c)?c:100,propagatorTypes:f,allowedUrls:g,tracestate:v,baggage:d}}e.isTraceOption=i,e.makeTracingHeaders=a,e.parseTracingOptions=u},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r,n=0;n<e.length;n++)(r=e[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==n(e)?e:e+""}function c(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(0),f=r(2),l=r(14),p=function(){function t(){var e=this;o(this,t),this.name="pv-collector",this.onLaunch=function(t,r){if(t&&r&&"app"===t.$mpType){var n=(0,f.getRumViewId)(t,e.ctx.session);e.sendPv({id:n,route:r.path})}},this.onBeforeCreate=function(t){if("page"===t.$mpType&&t.route){var r=(0,f.getRumViewId)(t,e.ctx.session);e.sendPv({id:r,route:t.route})}},this.onUnload=function(){var t=(0,f.getCurView)(e.ctx);e.ctx.removeView(t.id)},this.sendPv=function(t){e.prevPage&&t.id===e.prevPage.id||(t.name=e.getViewName(t.route),e.prevPage=t,e.ctx.addView(t),e.sendEvent(Object.assign({event_type:s.RumEventType.VIEW,type:"pv",loading_type:"initial_load"},t)))}}return a(t,[{key:"setup",value:function(t,e){this.ctx=t,this.sendEvent=e,(0,l.addEventListener)("onLaunch",this.onLaunch),(0,l.addEventListener)("beforeCreate",this.onBeforeCreate),(0,l.addEventListener)("onUnload",this.onUnload)}},{key:"getViewName",value:function(t){var e,r=this.ctx.getConfig().parseViewName,n=t;return(0,s.isFunction)(r)&&(n=r(t)),n}},{key:"destroy",value:function(){(0,l.removeEventListener)("onLaunch",this.onLaunch),(0,l.removeEventListener)("beforeCreate",this.onBeforeCreate)}}])}();e.default=p},function(t,e,r){"use strict";(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r,n=0;n<e.length;n++)(r=e[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==n(e)?e:e+""}function c(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(0),f=r(2),l=function(){function e(){var t=this;o(this,e),this.name="exception-collector",this.uniError=function(e){t.errorHandle(e,"uni.onError")},this.onError=function(e){t.errorHandle(e,"onError")},this.onUnhandledRejection=function(e){if(e){var r=e.reason;if(r){var n=r.errMsg;if(n&&(0,s.isString)(n)){(r=new Error(n)).name="",r.stack="";for(var o,i,a=0,u=["navigateTo","redirectTo","appLaunch","switchTab","getLocation","onLocationChange"];a<u.length;a++)if(o=u[a],n.startsWith(o)){r.name=o;break}r.name||(r.name=n.split(":")[0])}t.errorHandle(r,"onUnhandledRejection")}}},this.errorHandle=function(e){var r,n,o,i,a,u,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",l=(0,f.getCurView)(t.ctx);if(e instanceof Object){if(r=e.name,n=e.message,o=e.filename||e.fileName,i=e.stack,a=e.lineno||e.lineNumber,u=e.colno||e.columnNumber,e.error instanceof Error){var p=e.error;r=p.name,n=p.message,i=p.stack}}else if("string"==typeof e){i=e;var h=t.getErrorByStack(e);h&&(r=h.name,n=h.message)}r&&n&&t.sendEvent({event_type:s.RumEventType.EXCEPTION,source:c,type:"error",name:r,message:n,file:o,stack:i,line:a,column:u,times:1,view:l})}}return a(e,[{key:"setup",value:function(t,e){this.ctx=t,this.sendEvent=e,this.hackOrigin()}},{key:"hackOrigin",value:function(){var e=this,r,n=this.ctx.getConfig().collectors,o=void 0===n?{}:n;if(!1!==o.jsError)try{uni.onError(this.uniError),t.addEventListener("error",this.onError),t.addEventListener("unhandledrejection",this.onUnhandledRejection)}catch(e){console.error(e)}!1!==o.consoleError&&(0,s.interceptFunction)(console,"error",(function(t){e.errorHandle(t,"console.error")}))}},{key:"getErrorByStack",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=t.split("\n");if(!(2>e.length))for(var r=1;r<e.length;r++)if(e[r].trim().startsWith("at ")){var n=e[r-1],o=n.indexOf(": ");return{name:n.substring(0,o),message:n.substring(o+2)}}}},{key:"destroy",value:function(){(0,s.restoreFunction)(t.console,"error")}}])}();e.default=l}).call(this,r(15))},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,r,n){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),u=new v(n||[]);return w(a,"_invoke",{value:f(t,r,u)}),a}function r(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function i(){}function a(){}function u(){}function c(e){["next","throw","return"].forEach((function(r){t(e,r,(function(t){return this._invoke(r,t)}))}))}function s(t,e){function o(i,a,u,c){var s=r(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==n(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function f(t,e,n){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=l(u,n);if(c){if(c===_)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===o)throw o="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o="executing";var s=r(t,e,n);if("normal"===s.type){if(o=n.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o="completed",n.method="throw",n.arg=s.arg)}}}function l(t,e){var n=e.method,o=t.iterator[n];if(o===d)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;var i=r(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function v(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function y(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(b.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(n(t)+" is not iterable")}o=function(){return g};var d,g={},m=Object.prototype,b=m.hasOwnProperty,w=Object.defineProperty||function(t,e,r){t[e]=r.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",x=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,r){return t[e]=r}}g.wrap=e;var _={},j={};t(j,O,(function(){return this}));var k=Object.getPrototypeOf,P=k&&k(k(y([])));P&&P!==m&&b.call(P,O)&&(j=P);var T=u.prototype=i.prototype=Object.create(j);return a.prototype=u,w(T,"constructor",{value:u,configurable:!0}),w(u,"constructor",{value:a,configurable:!0}),a.displayName=t(u,x,"GeneratorFunction"),g.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},g.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,t(e,x,"GeneratorFunction")),e.prototype=Object.create(T),e},g.awrap=function(t){return{__await:t}},c(s.prototype),t(s.prototype,S,(function(){return this})),g.AsyncIterator=s,g.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new s(e(t,r,n,o),i);return g.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},c(T),t(T,x,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),g.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},g.values=y,v.prototype={constructor:v,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,n){return i.type="throw",i.arg=t,r.next=e,n&&(r.method="next",r.arg=d),!!n}if(this.done)throw t;for(var r=this,n=this.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var r,n=this.tryEntries.length-1;0<=n;--n)if((r=this.tryEntries[n]).tryLoc<=this.prev&&b.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,r=this.tryEntries.length-1;0<=r;--r)if((e=this.tryEntries[r]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,r=this.tryEntries.length-1;0<=r;--r)if((e=this.tryEntries[r]).tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:y(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=d),_}},g}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var r,n=0;n<e.length;n++)(r=e[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}function u(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==n(e)?e:e+""}function s(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});var l=r(0),p=r(3),h=r(34),v=r(5),y=r(2),d=r(35),g=function(){function t(){var e=this;i(this,t),this.name="api-collector",this.sendApi=function(t,r,n){return f(e,void 0,void 0,o().mark((function e(){var i,a,u,c,s,f,p,h,y,g;return o().wrap((function e(o){for(;;)switch(o.prev=o.next){case 0:if(i=this.ctx.getConfig(),a=i.evaluateApi,u=r.statusCode,c=r.status,s=r.errMsg,f=r.errorMessage,p=r.message,!(0,l.isFunction)(a)){o.next=13;break}return o.prev=3,0===t.success&&(h=new Error("request error")),o.next=7,a(n,r,h);case 7:y=o.sent,t=Object.assign(Object.assign({},t),(0,d.reviseApiAttr)(y)),o.next=13;break;case 11:o.prev=11,o.t0=o.catch(3);case 13:if(!((g=Object.assign({event_type:l.RumEventType.RESOURCE,type:"api",status_code:c||u,message:f||s||p,duration:(0,v.getCurrentTime)()-t.timestamp,times:1},t)).duration>l.ONE_DAY)){o.next=16;break}return o.abrupt("return");case 16:this.sendEvent(g);case 17:case"end":return o.stop()}}),e,this,[[3,11]])})))}}return u(t,[{key:"setup",value:function t(e,r){var n,o=e.getConfig().collectors,i;!1===(void 0===o?{}:o).api||(this.ctx=e,this.sendEvent=r,this.interceptorRequest())}},{key:"interceptorRequest",value:function t(){if((0,l.isFunction)(p.sdk.addInterceptor)){var e=this;p.sdk.addInterceptor("request",{invoke:function t(r){e.rebuildRequestOptions(r)}})}}},{key:"injectTracing",value:function t(e,r){var n,o=this.ctx.getConfig(),i=o.tracing,a=o.pid,u=o.version,c=void 0===u?"1.0.0":u,s=(0,l.parseTracingOptions)(i),f=s.enable,h=s.sample,v=s.propagatorTypes,y=s.allowedUrls,d=s.tracestate,g=!(void 0!==d)||d,m=s.baggage,b=void 0!==m&&m;if(f){var w=(0,l.find)(y,(function(t){return(0,l.matchList)([t.match],e.url)}));if(w){var E=w.propagatorTypes;0===E.length&&(E=v);var O=!1;E.includes("sw8")&&(E=["sw8"],O=!0);var S=O?(0,l.generateGUID)():(0,l.generateTraceId)(),x=O?(0,l.generateGUID)():(0,l.generateSpanId)(),_=(0,l.performDraw)(h),j=this.ctx.session.getUserId(),k=this.ctx.session.getSessionId(),P=g?"rum=v2&uniapp&".concat(a,"&").concat(k,"&").concat(j):void 0,T=b?"rum=v2,appType=uniapp,pid=".concat(a,",sid=").concat(k,",uid=").concat(j):void 0,C=(0,l.makeTracingHeaders)(S,x,_,E,{tracestate:P,baggage:T,appId:a,appVersion:c,viewName:null===(n=e.view)||void 0===n?void 0:n.name,host:p.appName});_&&(e.trace_id=S,e.trace_data=JSON.stringify({spanId:x,sample:h,sampled:_,header:C})),r(C)}}}},{key:"rebuildRequestOptions",value:function t(e){var r=this,n=e.url,o=e.success,i=e.fail,a=e.complete,u=e.header,c=(0,v.getCurrentTime)();if((0,h.isEndpoint)(this.ctx,n)||(0,l.urlMatch)(n))return e;var s={view:(0,y.getCurView)(this.ctx),timestamp:c,url:n,name:this.getResourceName(n),method:e.method||"GET"};return this.injectTracing(s,(function(t){e.header=Object.assign(Object.assign({},u),t)})),e.success=function(){s.success=1;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];o&&o.apply(this,e)},e.fail=function(){s.success=0;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];i&&i.apply(this,e)},e.complete=function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];var i=Object.assign({},n[0]);try{s.success=s.success&&200<=i.statusCode&&300>i.statusCode?1:0,s.size=(0,v.getStringSize)(JSON.stringify(i)),r.sendApi(s,i,e)}catch(t){}a&&a.apply(this,n)},e}},{key:"getResourceName",value:function t(e){var r,n,o=this.ctx.getConfig().parseResourceName;return r=(0,l.isFunction)(o)?o(e):(0,h.getPathByURL)(e)}}])}();e.default=g},function(t,e,r){"use strict";function n(t){var e=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1];try{var r=a(t);return e?r.hash:r.pathname}catch(t){return""}}function o(t,e){var r,n=t.getConfig().endpoint;try{return a(e).hostname===a(n).hostname}catch(t){return!1}}Object.defineProperty(e,"__esModule",{value:!0}),e.getURL=e.isEndpoint=e.getPathByURL=void 0,e.getPathByURL=n,e.isEndpoint=o;var i=/^(?:([^:\/?#]+):\/\/)?((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?)?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i;function a(t){var e=decodeURIComponent(t).match(i),r,n=(e[3]||"").split(":").length?(e[2]||"").replace(/(.*\@)/,""):e[2];return{uri:e[0],protocol:e[1],host:n,hostname:e[4],port:e[5],pathname:e[6],search:e[7],hash:e[8]}}e.getURL=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reviseApiAttr=void 0;var n=r(0);function o(t){if(t&&(0,n.isObject)(t)){var e={};return(0,n.isString)(t.name)&&(e.name=t.name.substring(0,1e3)),(0,n.isString)(t.message)&&(e.message=t.message.substring(0,1e3)),"success"in t&&(e.success=t.success?1:0),(0,n.isNumber)(t.duration)&&0<=t.duration&&(e.duration=t.duration),(0,n.isString)(t.status_code)&&(e.status_code=t.status_code.substring(0,100)),(0,n.isNumber)(t.status_code)&&(e.status_code=t.status_code),(0,n.isString)(t.snapshots)&&(e.snapshots=t.snapshots.substring(0,5e3)),e}}e.reviseApiAttr=o},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r,n=0;n<e.length;n++)(r=e[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==n(e)?e:e+""}function c(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(5),f=r(2),l=function(){function t(){o(this,t),this.name="default-processor"}return a(t,[{key:"process",value:function(t){var e=t.getRumEvent(),r=(0,f.getCurView)(t),n;return Object.assign({timestamp:(0,s.getCurrentTime)(),session_id:t.session.getSessionId(),event_id:t.session.getEventId(),view:r},e)}}])}();e.default=l},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r,n=0;n<e.length;n++)(r=e[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==n(e)?e:e+""}function c(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=r(0),f=function(){function t(){var e=this;o(this,t),this.name="session-processor",this.update=function(t){t&&!t.isTrusted||e.ctx.session.updateSession()}}return a(t,[{key:"setup",value:function(t){this.ctx=t,this.update=(0,s.debounce)(this.update,s.ONE_SECOND)}},{key:"process",value:function(t){return this.update(),t.getRumEvent()}}])}();e.default=f},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r,n=0;n<e.length;n++)(r=e[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==n(e)?e:e+""}function c(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function s(t,e,r){return e=h(e),f(t,p()?Reflect.construct(e,r||[],h(t).constructor):e.apply(t,r))}function f(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}function y(t,e){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0});var d=r(0),g=r(3),m=function(t){function e(){var t;return o(this,e),(t=s(this,e,arguments)).name="uni-reporter",t}return v(e,t),a(e,[{key:"init",value:function(){var t=this;g.sdk.onAppHide((function(){t.flushEventQueue()}))}},{key:"request",value:function(t,e){var r=t.getConfig();(0,g.fixAttrs)(e).then((function(t){g.sdk.request({url:r.endpoint,method:"POST",dataType:"text",data:JSON.stringify(t)})})).catch((function(t){console.warn("[arms] sendRequest fail",t)}))}}])}(d.Reporter);e.default=m},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return s(t)||c(t,e)||a(t,e)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function c(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(c){s=!0,o=c}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}function s(t){if(Array.isArray(t))return t}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var r,n=0;n<e.length;n++)(r=e[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,h(r.key),r)}function p(t,e,r){return e&&l(t.prototype,e),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t){var e=v(t,"string");return"symbol"==n(e)?e:e+""}function v(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.RumSession=void 0;var y=r(0),d=r(5),g=r(2),m=r(3),b="_arms_uid",w="_arms_session",E=function(){function t(){f(this,t)}return p(t,[{key:"init",value:function(t){var e;this.ctx=t,this.sessionConfig=this.fixSessionConfig(null===(e=t.config)||void 0===e?void 0:e.sessionConfig)}},{key:"getSessionId",value:function(){return this.getSessionInfo().sessionId}},{key:"getSampled",value:function(){return this.getSessionInfo().sampled}},{key:"checkSession",value:function(t){var e=this.sessionConfig,r=e.overtime,n=e.maxDuration,o=(0,d.getCurrentTime)();return!(t.startTime+n<o||t.lastTime+r<o)}},{key:"updateSession",value:function(){var t=this.getSessionInfo();if(!t.isNew){var e=t.startTime,r=(0,d.getCurrentTime)(),n=t.sampled?1:0;(0,m.setStorageSync)(w,"".concat(t.sessionId,"-").concat(n,"-").concat(e,"-").concat(r))}}},{key:"getSessionInfo",value:function(){var t,e=o(((0,m.getStorageSync)(w)||"").split("-"),4),r=e[0],n=e[1],i=e[2],a=e[3],u={sessionId:r,sampled:"0"!==n,startTime:parseInt(i||"")||0,lastTime:parseInt(a||"")||0};return this.checkSession(u)||(u=this.resetSession()),u}},{key:"getEventId",value:function(){return(0,y.generateEventId)(this.getSessionId())}},{key:"getViewId",value:function(){return this.getUUID()}},{key:"getUserId",value:function(){var t=(0,m.getStorageSync)(b);return t&&0===t.indexOf("user_")&&(t=""),t||(t="uid_".concat((0,y.generateSpanId)(16,36)),(0,m.setStorageSync)(b,t)),t}},{key:"resetSession",value:function(){var t=this.sessionConfig.sampleRate,e=this.getUUID(),r=(0,d.getCurrentTime)(),n=(0,y.performDraw)(100*t),o="".concat(e,"-").concat(n?1:0,"-").concat(r,"-").concat(r);return(0,m.setStorageSync)(w,o),{sessionId:e,sampled:n,startTime:r,lastTime:r,isNew:!0}}},{key:"getUUID",value:function(){return(0,y.generateGUID)().replace(/-/g,"")}},{key:"fixSessionConfig",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.sampleRate,r=t.maxDuration,n=t.overtime;return(!(0,y.isNumber)(e)||0>e||1<e)&&(e=1),(!(0,y.isNumber)(r)||r<4*y.ONE_HOUR||r>y.ONE_DAY)&&(r=y.ONE_DAY),(!(0,y.isNumber)(n)||n>y.ONE_HOUR||n<10*y.ONE_MINUTE)&&(n=30*y.ONE_MINUTE),{sampleRate:e,maxDuration:r,overtime:n}}},{key:"getBaseEvent",value:function(){return{timestamp:(0,d.getCurrentTime)(),session_id:this.getSessionId(),event_id:this.getEventId(),view:this.ctx?(0,g.getCurView)(this.ctx):void 0,times:1}}}])}();e.RumSession=E}]);
@@ -1,4 +1,4 @@
1
- import _extends from"@babel/runtime/helpers/extends";import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _regeneratorRuntime from"@babel/runtime/regenerator";import{find,generateGUID,generateSpanId,generateTraceId,isFunction,makeTracingHeaders,matchList,parseTracingOptions,performDraw,RumEventType,urlMatch,ONE_DAY}from"@arms/rum-core";import{sdk,appName}from"../../utils/platform";import{getPathByURL,isEndpoint}from"../../utils/url";import{getCurrentTime}from"../../utils/base";import{getCurView}from"../../utils/view";import{reviseApiAttr}from"../../utils/api";var ApiCollector=/*#__PURE__*/function(){function a(){var a=this;this.name="api-collector",this.ctx=void 0,this.sendEvent=void 0,this.sendApi=/*#__PURE__*/function(){var b=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function e(b,c,d){var f,g,h,i,j,k,l,m,n,o,p;return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(f=a.ctx.getConfig(),g=f.evaluateApi,h=c.statusCode,i=c.status,j=c.errMsg,k=c.errorMessage,l=c.message,m=c.profile,!isFunction(g)){e.next=13;break}return e.prev=3,0===b.success&&(n=new Error("request error")),e.next=7,g(d,c,n);case 7:o=e.sent,b=_extends({},b,reviseApiAttr(o)),e.next=13;break;case 11:e.prev=11,e.t0=e["catch"](3);case 13:if(p=_extends({event_type:RumEventType.RESOURCE,type:"api",status_code:i||h,message:k||j||l,duration:getCurrentTime()-b.timestamp,times:1},b),!(p.duration>ONE_DAY)){e.next=16;break}return e.abrupt("return");case 16:a.sendEvent(p);case 17:case"end":return e.stop()}},e,null,[[3,11]])}));return function(){return b.apply(this,arguments)}}()}var b=a.prototype;return b.setup=// origin = {
1
+ import _extends from"@babel/runtime/helpers/extends";import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _regeneratorRuntime from"@babel/runtime/regenerator";import{find,generateGUID,generateSpanId,generateTraceId,isFunction,makeTracingHeaders,matchList,parseTracingOptions,performDraw,RumEventType,urlMatch,ONE_DAY}from"@arms/rum-core";import{sdk,appName}from"../../utils/platform";import{getPathByURL,isEndpoint}from"../../utils/url";import{getCurrentTime,getStringSize}from"../../utils/base";import{getCurView}from"../../utils/view";import{reviseApiAttr}from"../../utils/api";var ApiCollector=/*#__PURE__*/function(){function a(){var a=this;this.name="api-collector",this.ctx=void 0,this.sendEvent=void 0,this.sendApi=/*#__PURE__*/function(){var b=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function e(b,c,d){var f,g,h,i,j,k,l,m,n,o;return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(f=a.ctx.getConfig(),g=f.evaluateApi,h=c.statusCode,i=c.status,j=c.errMsg,k=c.errorMessage,l=c.message,!isFunction(g)){e.next=13;break}return e.prev=3,0===b.success&&(m=new Error("request error")),e.next=7,g(d,c,m);case 7:n=e.sent,b=_extends({},b,reviseApiAttr(n)),e.next=13;break;case 11:e.prev=11,e.t0=e["catch"](3);case 13:if(o=_extends({event_type:RumEventType.RESOURCE,type:"api",status_code:i||h,message:k||j||l,duration:getCurrentTime()-b.timestamp,times:1},b),!(o.duration>ONE_DAY)){e.next=16;break}return e.abrupt("return");case 16:a.sendEvent(o);case 17:case"end":return e.stop()}},e,null,[[3,11]])}));return function(){return b.apply(this,arguments)}}()}var b=a.prototype;return b.setup=// origin = {
2
2
  // request: sdk.request
3
3
  // }
4
4
  function(a,b){var c=a.getConfig(),d=c.collectors,e=void 0===d?{}:d;!1===e.api||(// Object.keys(this.origin).forEach((key) => this.hackRequest(key));
@@ -21,11 +21,12 @@ var r=!1;q.includes("sw8")&&(q=["sw8"],r=!0);var s=r?generateGUID():generateTrac
21
21
  // // }
22
22
  // // });
23
23
  // }
24
- ,b.rebuildRequestOptions=function(a){var b=this,c=a.url,d=a.success,e=a.fail,f=a.header,g=getCurrentTime();// SDK自己的请求不监控 & 过滤不需要监控的url
24
+ ,b.rebuildRequestOptions=function(a){var b=this,c=a.url,d=a.success,e=a.fail,f=a.complete,g=a.header,h=getCurrentTime();// SDK自己的请求不监控 & 过滤不需要监控的url
25
25
  if(isEndpoint(this.ctx,c)||urlMatch(c))return a;// const newOptions = {
26
26
  // ...options,
27
27
  // };
28
- var h={view:getCurView(this.ctx),timestamp:g,url:c,name:this.getResourceName(c),method:a.method||"GET"};return this.injectTracing(h,function(b){a.header=_extends({},f,b)}),a.success=function(){h.success=1;for(var c=arguments.length,e=Array(c),f=0;f<c;f++)e[f]=arguments[f];b.sendApi(h,e[0],a),d&&d.apply(this,e)},a.fail=function(){h.success=0;for(var c=arguments.length,d=Array(c),f=0;f<c;f++)d[f]=arguments[f];b.sendApi(h,d[0],a),e&&e.apply(this,d)},a},b.getResourceName=function(a){var b,c=this.ctx.getConfig(),d=c.parseResourceName;return b=isFunction(d)?d(a):getPathByURL(a),b}// /**
28
+ var i={view:getCurView(this.ctx),timestamp:h,url:c,name:this.getResourceName(c),method:a.method||"GET"};return this.injectTracing(i,function(b){a.header=_extends({},g,b)}),a.success=function(){i.success=1;for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];d&&d.apply(this,b)},a.fail=function(){i.success=0;for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];e&&e.apply(this,b)},a.complete=function(){for(var c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];var g=_extends({},d[0]);try{i.success=i.success&&200<=g.statusCode&&300>g.statusCode?1:0,i.size=getStringSize(JSON.stringify(g)),b.sendApi(i,g,a)}catch(a){//
29
+ }f&&f.apply(this,d)},a},b.getResourceName=function(a){var b,c=this.ctx.getConfig(),d=c.parseResourceName;return b=isFunction(d)?d(a):getPathByURL(a),b}// /**
29
30
  // * 解析小程序的性能数据
30
31
  // * 参考:https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html
31
32
  // * https://opendocs.alipay.com/mini/api/owycmh?pathHash=c91640f8
package/es/shell.d.ts CHANGED
@@ -11,15 +11,12 @@ export declare class ArmsRum extends Shell {
11
11
  /**
12
12
  * 初始化
13
13
  */
14
- init(config: IUniConfig): void;
14
+ init(config: IUniConfig): this;
15
15
  /**
16
16
  * set config
17
17
  */
18
18
  setConfig<T extends keyof IUniConfig>(key: T, value: IUniConfig[T]): void;
19
19
  setConfig(value: IUniConfig): void;
20
- getLocalConfig(duration: number, pid: string): any;
21
- getRemoteConfig(url: string, config: any): object;
22
- storeRemoteConfig(config: any, pid: string): boolean;
23
20
  setVue(vue: Vue): void;
24
21
  }
25
22
  declare const _default: ArmsRum;
package/es/shell.js CHANGED
@@ -8,8 +8,10 @@ import{VERSION}from"./utils/platform";import{RumSession}from"./utils/session";im
8
8
  * 3. 基于 Disposable 模式,对于事件的绑定、快捷键的绑定函数,返回值则是解绑函数
9
9
  */export var ArmsRum=/*#__PURE__*/function(a){function b(){for(var b,c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];return b=a.call.apply(a,[this].concat(d))||this,b.version=VERSION,b}_inheritsLoose(b,a);var c=b.prototype;return c.init=/**
10
10
  * 初始化
11
- */function(a){a.vue&&this.setVue(a.vue),this.client.useCollectors([new PvCollector,// new PerfCollector(),
11
+ */function(a){// 监听网络类型变化
12
+ // getNetType(this.updateNetType);
13
+ return a.vue&&this.setVue(a.vue),this.client.useCollectors([new PvCollector,// new PerfCollector(),
12
14
  new ExceptionCollector,new ApiCollector// new ActionCollector(),
13
- ]),this.client.useProcessors([new DefaultProcessor,new SessionProcessor]),this.client.useReporter(new Reporter),this.client.init(a,new RumSession)}/**
15
+ ]),this.client.useProcessors([new DefaultProcessor,new SessionProcessor]),this.client.useReporter(new Reporter),this.client.init(a,new RumSession),this}/**
14
16
  * set config
15
- */,c.setConfig=function(){var a=this.client.getContext();if(2===arguments.length){var b,c=this.client.getContext(),d=c.getConfig();c.setConfig(_extends({},d,(b={},b[0>=arguments.length?void 0:arguments[0]]=1>=arguments.length?void 0:arguments[1],b)))}else a.setConfig(0>=arguments.length?void 0:arguments[0])},c.getLocalConfig=function(){},c.getRemoteConfig=function(){},c.storeRemoteConfig=function(){return!1},c.setVue=function(a){this.setConfig("vue",a),mixin(a)},b}(Shell);export default new ArmsRum;
17
+ */,c.setConfig=function(){var a=this.client.getContext();if(2===arguments.length){var b,c=this.client.getContext(),d=c.getConfig();c.setConfig(_extends({},d,(b={},b[0>=arguments.length?void 0:arguments[0]]=1>=arguments.length?void 0:arguments[1],b)))}else a.setConfig(0>=arguments.length?void 0:arguments[0])},c.setVue=function(a){this.setConfig("vue",a),mixin(a)},b}(Shell);export default new ArmsRum;
package/es/utils/api.d.ts CHANGED
@@ -7,6 +7,7 @@ export interface IApiBaseAttr {
7
7
  message?: string;
8
8
  success?: ResourceStatus;
9
9
  duration?: number;
10
+ size?: number;
10
11
  status_code?: number | string;
11
12
  snapshots?: string;
12
13
  }
@@ -25,5 +26,6 @@ export interface Options {
25
26
  header?: any;
26
27
  success?: (res: any) => void;
27
28
  fail?: (res: any) => void;
29
+ complete?: (res: any) => void;
28
30
  }
29
31
  export declare function reviseApiAttr(attrs: IApiBaseAttr): IApiBaseAttr;
@@ -1,13 +1,7 @@
1
- /**
2
- * 保留指定位数的小数
3
- * @param num 原数据
4
- * @param decimal 小数位数
5
- * @returns
6
- */
7
- export declare function formatNumber(num: number, decimal?: number): number;
8
1
  /**
9
2
  * 获取获取当前时间 fix Data.now() 存在的缺陷
10
3
  * duration方法用于计算时间跨度,由于Date.now存在bug,可能为负数,尽可能使用performance.now计算
11
4
  * @returns
12
5
  */
13
6
  export declare function getCurrentTime(): number;
7
+ export declare function getStringSize(str: string, encode?: string): number;
package/es/utils/base.js CHANGED
@@ -1,10 +1,28 @@
1
+ // /**
2
+ // * 保留指定位数的小数
3
+ // * @param num 原数据
4
+ // * @param decimal 小数位数
5
+ // * @returns
6
+ // */
7
+ // export function formatNumber(num: number, decimal: number = 3): number {
8
+ // if (!num) {
9
+ // return num;
10
+ // }
11
+ // let str = num.toString();
12
+ // const index = str.indexOf('.');
13
+ // if (index !== -1) {
14
+ // str = str.substring(0, decimal + index + 1);
15
+ // } else {
16
+ // str = str.substring(0);
17
+ // }
18
+ // return parseFloat(str);
19
+ // }
1
20
  /**
2
- * 保留指定位数的小数
3
- * @param num 原数据
4
- * @param decimal 小数位数
5
- * @returns
6
- */export function formatNumber(a,b){if(void 0===b&&(b=3),!a)return a;var c=a.toString(),d=c.indexOf(".");return c=-1===d?c.substring(0):c.substring(0,b+d+1),parseFloat(c)}/**
7
21
  * 获取获取当前时间 fix Data.now() 存在的缺陷
8
22
  * duration方法用于计算时间跨度,由于Date.now存在bug,可能为负数,尽可能使用performance.now计算
9
23
  * @returns
10
- */export function getCurrentTime(){return new Date().getTime()}
24
+ */export function getCurrentTime(){return new Date().getTime()}export function getStringSize(a,b){if(void 0===b&&(b="utf8"),"string"!=typeof a)throw new TypeError("Input must be a string");var c=b.toLowerCase();if("utf16"===c){for(var d,e=0,f=0;f<a.length;f++){// 检查代理对(有效的高位代理后跟低位代理)
25
+ if(d=a.charCodeAt(f),55296<=d&&56319>=d&&f+1<a.length){var g=a.charCodeAt(f+1);if(56320<=g&&57343>=g){e+=4,f++;// 跳过低位代理
26
+ continue}}e+=2}return e}if("utf8"===c){for(var h,j=0,k=0;k<a.length;k++){// 处理代理对(UTF-16辅助平面)
27
+ if(h=a.charCodeAt(k),55296<=h&&56319>=h&&k+1<a.length){var l=a.charCodeAt(k+1);56320<=l&&57343>=l&&(h=1024*(h-55296)+(l-56320)+65536,k++)}// 根据码点值计算UTF-8字节长度
28
+ j+=127>=h?1:2047>=h?2:65535>=h?3:1114111>=h?4:3}return j}throw new Error("Unsupported encoding. Use \"utf8\" or \"utf16\".")}
@@ -1,4 +1,4 @@
1
- import _extends from"@babel/runtime/helpers/extends";import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _regeneratorRuntime from"@babel/runtime/regenerator";import{AppType}from"@arms/rum-core";export var global2=global||window;export var VERSION='npm-0.0.1-beta.2';export var sdk=uni;export var appName="uniapp";// export {
1
+ import _extends from"@babel/runtime/helpers/extends";import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _regeneratorRuntime from"@babel/runtime/regenerator";import{AppType}from"@arms/rum-core";export var global2=global||window;export var VERSION='npm-0.1.1';export var sdk=uni;export var appName="uniapp";// export {
2
2
  // // sdk: global.uni,
3
3
  // appName: 'uniapp',
4
4
  // }
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_rumCore=require("@arms/rum-core"),_platform=require("../../utils/platform"),_url=require("../../utils/url"),_base=require("../../utils/base"),_view=require("../../utils/view"),_api=require("../../utils/api"),ApiCollector=exports["default"]=/*#__PURE__*/function(){function a(){var a=this;this.name="api-collector",this.ctx=void 0,this.sendEvent=void 0,this.sendApi=/*#__PURE__*/function(){var b=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function e(b,c,d){var f,g,h,i,j,k,l,m,n,o,p;return _regenerator["default"].wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(f=a.ctx.getConfig(),g=f.evaluateApi,h=c.statusCode,i=c.status,j=c.errMsg,k=c.errorMessage,l=c.message,m=c.profile,!(0,_rumCore.isFunction)(g)){e.next=13;break}return e.prev=3,0===b.success&&(n=new Error("request error")),e.next=7,g(d,c,n);case 7:o=e.sent,b=(0,_extends2["default"])({},b,(0,_api.reviseApiAttr)(o)),e.next=13;break;case 11:e.prev=11,e.t0=e["catch"](3);case 13:if(p=(0,_extends2["default"])({event_type:_rumCore.RumEventType.RESOURCE,type:"api",status_code:i||h,message:k||j||l,duration:(0,_base.getCurrentTime)()-b.timestamp,times:1},b),!(p.duration>_rumCore.ONE_DAY)){e.next=16;break}return e.abrupt("return");case 16:a.sendEvent(p);case 17:case"end":return e.stop()}},e,null,[[3,11]])}));return function(){return b.apply(this,arguments)}}()}var b=a.prototype;return b.setup=// origin = {
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_rumCore=require("@arms/rum-core"),_platform=require("../../utils/platform"),_url=require("../../utils/url"),_base=require("../../utils/base"),_view=require("../../utils/view"),_api=require("../../utils/api"),ApiCollector=exports["default"]=/*#__PURE__*/function(){function a(){var a=this;this.name="api-collector",this.ctx=void 0,this.sendEvent=void 0,this.sendApi=/*#__PURE__*/function(){var b=(0,_asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function e(b,c,d){var f,g,h,i,j,k,l,m,n,o;return _regenerator["default"].wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(f=a.ctx.getConfig(),g=f.evaluateApi,h=c.statusCode,i=c.status,j=c.errMsg,k=c.errorMessage,l=c.message,!(0,_rumCore.isFunction)(g)){e.next=13;break}return e.prev=3,0===b.success&&(m=new Error("request error")),e.next=7,g(d,c,m);case 7:n=e.sent,b=(0,_extends2["default"])({},b,(0,_api.reviseApiAttr)(n)),e.next=13;break;case 11:e.prev=11,e.t0=e["catch"](3);case 13:if(o=(0,_extends2["default"])({event_type:_rumCore.RumEventType.RESOURCE,type:"api",status_code:i||h,message:k||j||l,duration:(0,_base.getCurrentTime)()-b.timestamp,times:1},b),!(o.duration>_rumCore.ONE_DAY)){e.next=16;break}return e.abrupt("return");case 16:a.sendEvent(o);case 17:case"end":return e.stop()}},e,null,[[3,11]])}));return function(){return b.apply(this,arguments)}}()}var b=a.prototype;return b.setup=// origin = {
2
2
  // request: sdk.request
3
3
  // }
4
4
  function(a,b){var c=a.getConfig(),d=c.collectors,e=void 0===d?{}:d;!1===e.api||(// Object.keys(this.origin).forEach((key) => this.hackRequest(key));
@@ -21,11 +21,12 @@ var r=!1;q.includes("sw8")&&(q=["sw8"],r=!0);var s=r?(0,_rumCore.generateGUID)()
21
21
  // // }
22
22
  // // });
23
23
  // }
24
- ,b.rebuildRequestOptions=function(a){var b=this,c=a.url,d=a.success,e=a.fail,f=a.header,g=(0,_base.getCurrentTime)();// SDK自己的请求不监控 & 过滤不需要监控的url
24
+ ,b.rebuildRequestOptions=function(a){var b=this,c=a.url,d=a.success,e=a.fail,f=a.complete,g=a.header,h=(0,_base.getCurrentTime)();// SDK自己的请求不监控 & 过滤不需要监控的url
25
25
  if((0,_url.isEndpoint)(this.ctx,c)||(0,_rumCore.urlMatch)(c))return a;// const newOptions = {
26
26
  // ...options,
27
27
  // };
28
- var h={view:(0,_view.getCurView)(this.ctx),timestamp:g,url:c,name:this.getResourceName(c),method:a.method||"GET"};return this.injectTracing(h,function(b){a.header=(0,_extends2["default"])({},f,b)}),a.success=function(){h.success=1;for(var c=arguments.length,e=Array(c),f=0;f<c;f++)e[f]=arguments[f];b.sendApi(h,e[0],a),d&&d.apply(this,e)},a.fail=function(){h.success=0;for(var c=arguments.length,d=Array(c),f=0;f<c;f++)d[f]=arguments[f];b.sendApi(h,d[0],a),e&&e.apply(this,d)},a},b.getResourceName=function(a){var b,c=this.ctx.getConfig(),d=c.parseResourceName;return b=(0,_rumCore.isFunction)(d)?d(a):(0,_url.getPathByURL)(a),b}// /**
28
+ var i={view:(0,_view.getCurView)(this.ctx),timestamp:h,url:c,name:this.getResourceName(c),method:a.method||"GET"};return this.injectTracing(i,function(b){a.header=(0,_extends2["default"])({},g,b)}),a.success=function(){i.success=1;for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];d&&d.apply(this,b)},a.fail=function(){i.success=0;for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];e&&e.apply(this,b)},a.complete=function(){for(var c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];var g=(0,_extends2["default"])({},d[0]);try{i.success=i.success&&200<=g.statusCode&&300>g.statusCode?1:0,i.size=(0,_base.getStringSize)(JSON.stringify(g)),b.sendApi(i,g,a)}catch(a){//
29
+ }f&&f.apply(this,d)},a},b.getResourceName=function(a){var b,c=this.ctx.getConfig(),d=c.parseResourceName;return b=(0,_rumCore.isFunction)(d)?d(a):(0,_url.getPathByURL)(a),b}// /**
29
30
  // * 解析小程序的性能数据
30
31
  // * 参考:https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html
31
32
  // * https://opendocs.alipay.com/mini/api/owycmh?pathHash=c91640f8
package/lib/shell.d.ts CHANGED
@@ -11,15 +11,12 @@ export declare class ArmsRum extends Shell {
11
11
  /**
12
12
  * 初始化
13
13
  */
14
- init(config: IUniConfig): void;
14
+ init(config: IUniConfig): this;
15
15
  /**
16
16
  * set config
17
17
  */
18
18
  setConfig<T extends keyof IUniConfig>(key: T, value: IUniConfig[T]): void;
19
19
  setConfig(value: IUniConfig): void;
20
- getLocalConfig(duration: number, pid: string): any;
21
- getRemoteConfig(url: string, config: any): object;
22
- storeRemoteConfig(config: any, pid: string): boolean;
23
20
  setVue(vue: Vue): void;
24
21
  }
25
22
  declare const _default: ArmsRum;
package/lib/shell.js CHANGED
@@ -1,10 +1,12 @@
1
1
  "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=exports.ArmsRum=void 0;var _extends3=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")),_rumCore=require("@arms/rum-core"),_pv=_interopRequireDefault(require("./collector/view/pv")),_exception=_interopRequireDefault(require("./collector/exception")),_api=_interopRequireDefault(require("./collector/resource/api")),_defaultProcessor=_interopRequireDefault(require("./processor/default-processor")),_sessionProcessor=_interopRequireDefault(require("./processor/session-processor")),_reporter=_interopRequireDefault(require("./reporter")),_platform=require("./utils/platform"),_session=require("./utils/session"),_mixin=require("./utils/mixin"),ArmsRum=exports.ArmsRum=/*#__PURE__*/function(a){function b(){for(var b,c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];return b=a.call.apply(a,[this].concat(d))||this,b.version=_platform.VERSION,b}(0,_inheritsLoose2["default"])(b,a);var c=b.prototype;return c.init=/**
2
2
  * 初始化
3
- */function(a){a.vue&&this.setVue(a.vue),this.client.useCollectors([new _pv["default"],// new PerfCollector(),
3
+ */function(a){// 监听网络类型变化
4
+ // getNetType(this.updateNetType);
5
+ return a.vue&&this.setVue(a.vue),this.client.useCollectors([new _pv["default"],// new PerfCollector(),
4
6
  new _exception["default"],new _api["default"]// new ActionCollector(),
5
- ]),this.client.useProcessors([new _defaultProcessor["default"],new _sessionProcessor["default"]]),this.client.useReporter(new _reporter["default"]),this.client.init(a,new _session.RumSession)}/**
7
+ ]),this.client.useProcessors([new _defaultProcessor["default"],new _sessionProcessor["default"]]),this.client.useReporter(new _reporter["default"]),this.client.init(a,new _session.RumSession),this}/**
6
8
  * set config
7
- */,c.setConfig=function(){var a=this.client.getContext();if(2===arguments.length){var b,c=this.client.getContext(),d=c.getConfig();c.setConfig((0,_extends3["default"])({},d,(b={},b[0>=arguments.length?void 0:arguments[0]]=1>=arguments.length?void 0:arguments[1],b)))}else a.setConfig(0>=arguments.length?void 0:arguments[0])},c.getLocalConfig=function(){},c.getRemoteConfig=function(){},c.storeRemoteConfig=function(){return!1},c.setVue=function(a){this.setConfig("vue",a),(0,_mixin.mixin)(a)},b}(_rumCore.Shell),_default=exports["default"]=new ArmsRum;// import PerfCollector from './collector/view/perf';
9
+ */,c.setConfig=function(){var a=this.client.getContext();if(2===arguments.length){var b,c=this.client.getContext(),d=c.getConfig();c.setConfig((0,_extends3["default"])({},d,(b={},b[0>=arguments.length?void 0:arguments[0]]=1>=arguments.length?void 0:arguments[1],b)))}else a.setConfig(0>=arguments.length?void 0:arguments[0])},c.setVue=function(a){this.setConfig("vue",a),(0,_mixin.mixin)(a)},b}(_rumCore.Shell),_default=exports["default"]=new ArmsRum;// import PerfCollector from './collector/view/perf';
8
10
  // import ActionCollector from './collector/action';
9
11
  // import { getNetType } from "./utils/network";
10
12
  /**
@@ -7,6 +7,7 @@ export interface IApiBaseAttr {
7
7
  message?: string;
8
8
  success?: ResourceStatus;
9
9
  duration?: number;
10
+ size?: number;
10
11
  status_code?: number | string;
11
12
  snapshots?: string;
12
13
  }
@@ -25,5 +26,6 @@ export interface Options {
25
26
  header?: any;
26
27
  success?: (res: any) => void;
27
28
  fail?: (res: any) => void;
29
+ complete?: (res: any) => void;
28
30
  }
29
31
  export declare function reviseApiAttr(attrs: IApiBaseAttr): IApiBaseAttr;
@@ -1,13 +1,7 @@
1
- /**
2
- * 保留指定位数的小数
3
- * @param num 原数据
4
- * @param decimal 小数位数
5
- * @returns
6
- */
7
- export declare function formatNumber(num: number, decimal?: number): number;
8
1
  /**
9
2
  * 获取获取当前时间 fix Data.now() 存在的缺陷
10
3
  * duration方法用于计算时间跨度,由于Date.now存在bug,可能为负数,尽可能使用performance.now计算
11
4
  * @returns
12
5
  */
13
6
  export declare function getCurrentTime(): number;
7
+ export declare function getStringSize(str: string, encode?: string): number;
package/lib/utils/base.js CHANGED
@@ -1,10 +1,28 @@
1
- "use strict";exports.__esModule=!0,exports.formatNumber=formatNumber,exports.getCurrentTime=getCurrentTime;/**
2
- * 保留指定位数的小数
3
- * @param num 原数据
4
- * @param decimal 小数位数
5
- * @returns
6
- */function formatNumber(a,b){if(void 0===b&&(b=3),!a)return a;var c=a.toString(),d=c.indexOf(".");return c=-1===d?c.substring(0):c.substring(0,b+d+1),parseFloat(c)}/**
1
+ "use strict";exports.__esModule=!0,exports.getCurrentTime=getCurrentTime,exports.getStringSize=getStringSize;// /**
2
+ // * 保留指定位数的小数
3
+ // * @param num 原数据
4
+ // * @param decimal 小数位数
5
+ // * @returns
6
+ // */
7
+ // export function formatNumber(num: number, decimal: number = 3): number {
8
+ // if (!num) {
9
+ // return num;
10
+ // }
11
+ // let str = num.toString();
12
+ // const index = str.indexOf('.');
13
+ // if (index !== -1) {
14
+ // str = str.substring(0, decimal + index + 1);
15
+ // } else {
16
+ // str = str.substring(0);
17
+ // }
18
+ // return parseFloat(str);
19
+ // }
20
+ /**
7
21
  * 获取获取当前时间 fix Data.now() 存在的缺陷
8
22
  * duration方法用于计算时间跨度,由于Date.now存在bug,可能为负数,尽可能使用performance.now计算
9
23
  * @returns
10
- */function getCurrentTime(){return new Date().getTime()}
24
+ */function getCurrentTime(){return new Date().getTime()}function getStringSize(a,b){if(void 0===b&&(b="utf8"),"string"!=typeof a)throw new TypeError("Input must be a string");var c=b.toLowerCase();if("utf16"===c){for(var d,e=0,f=0;f<a.length;f++){// 检查代理对(有效的高位代理后跟低位代理)
25
+ if(d=a.charCodeAt(f),55296<=d&&56319>=d&&f+1<a.length){var g=a.charCodeAt(f+1);if(56320<=g&&57343>=g){e+=4,f++;// 跳过低位代理
26
+ continue}}e+=2}return e}if("utf8"===c){for(var h,j=0,k=0;k<a.length;k++){// 处理代理对(UTF-16辅助平面)
27
+ if(h=a.charCodeAt(k),55296<=h&&56319>=h&&k+1<a.length){var l=a.charCodeAt(k+1);56320<=l&&57343>=l&&(h=1024*(h-55296)+(l-56320)+65536,k++)}// 根据码点值计算UTF-8字节长度
28
+ j+=127>=h?1:2047>=h?2:65535>=h?3:1114111>=h?4:3}return j}throw new Error("Unsupported encoding. Use \"utf8\" or \"utf16\".")}
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.fixAttrs=exports.appName=exports.VERSION=void 0,exports.getNetType=getNetType,exports.getPerformance=getPerformance,exports.getStorageSync=getStorageSync,exports.sdk=exports.global2=void 0,exports.setStorageSync=setStorageSync;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_rumCore=require("@arms/rum-core"),global2=exports.global2=global||window,VERSION=exports.VERSION='npm-0.0.1-beta.2',sdk=exports.sdk=uni,appName=exports.appName="uniapp";// export {
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.fixAttrs=exports.appName=exports.VERSION=void 0,exports.getNetType=getNetType,exports.getPerformance=getPerformance,exports.getStorageSync=getStorageSync,exports.sdk=exports.global2=void 0,exports.setStorageSync=setStorageSync;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_rumCore=require("@arms/rum-core"),global2=exports.global2=global||window,VERSION=exports.VERSION='npm-0.1.1',sdk=exports.sdk=uni,appName=exports.appName="uniapp";// export {
2
2
  // // sdk: global.uni,
3
3
  // appName: 'uniapp',
4
4
  // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arms/rum-uniapp",
3
- "version": "0.0.1-beta.2",
3
+ "version": "0.1.1",
4
4
  "description": "arms rum javascript sdk for uniapp native",
5
5
  "author": "guangli.fj <guangli.fj@alibaba-inc.com>",
6
6
  "license": "ISC",
@@ -25,7 +25,7 @@
25
25
  "prepublishOnly": "npm run build"
26
26
  },
27
27
  "dependencies": {
28
- "@arms/rum-core": "0.0.36"
28
+ "@arms/rum-core": "0.1.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "typescript": "^4.9.4"