@arms/rum-uniapp 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/uniapp-sdk.js +1 -1
  2. package/es/collector/action/index.js +61 -3
  3. package/es/collector/exception/index.d.ts +1 -0
  4. package/es/collector/exception/index.js +3 -2
  5. package/es/collector/resource/api.js +1 -1
  6. package/es/collector/view/perf.js +74 -1
  7. package/es/collector/view/pv.d.ts +2 -12
  8. package/es/collector/view/pv.js +1 -1
  9. package/es/reporter/index.js +2 -2
  10. package/es/shell.js +5 -5
  11. package/es/types/client.d.ts +5 -2
  12. package/es/utils/mixin.d.ts +5 -1
  13. package/es/utils/mixin.js +2 -1
  14. package/es/utils/platform.d.ts +3 -0
  15. package/es/utils/platform.js +2 -2
  16. package/es/utils/session.js +2 -1
  17. package/es/utils/view.d.ts +12 -11
  18. package/es/utils/view.js +6 -24
  19. package/lib/collector/action/index.js +62 -2
  20. package/lib/collector/exception/index.d.ts +1 -0
  21. package/lib/collector/exception/index.js +3 -2
  22. package/lib/collector/resource/api.js +1 -1
  23. package/lib/collector/view/perf.js +75 -1
  24. package/lib/collector/view/pv.d.ts +2 -12
  25. package/lib/collector/view/pv.js +1 -1
  26. package/lib/index.js +1 -1
  27. package/lib/reporter/index.js +1 -1
  28. package/lib/shell.js +5 -5
  29. package/lib/types/client.d.ts +5 -2
  30. package/lib/utils/mixin.d.ts +5 -1
  31. package/lib/utils/mixin.js +2 -1
  32. package/lib/utils/platform.d.ts +3 -0
  33. package/lib/utils/platform.js +2 -2
  34. package/lib/utils/session.js +2 -1
  35. package/lib/utils/view.d.ts +12 -11
  36. package/lib/utils/view.js +6 -24
  37. package/package.json +2 -2
  38. package/es/collector/action/index.d.ts +0 -14
  39. package/es/collector/view/perf.d.ts +0 -10
  40. package/lib/collector/action/index.d.ts +0 -14
  41. package/lib/collector/view/perf.d.ts +0 -10
@@ -1 +1 @@
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
+ 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=17)}([function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function e(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.Shell=t.Reporter=t.Context=t.Client=void 0;var i=n(7);t.Client=i.default;var u=n(9);t.Context=u.default;var a=n(20);t.Reporter=a.default;var c=n(22);t.Shell=c.default,o(n(23),t),o(n(8),t),o(n(24),t),o(n(25),t),o(n(26),t),o(n(5),t),o(n(27),t),o(n(28),t),o(n(12),t),o(n(13),t),o(n(1),t),o(n(29),t),o(n(14),t),o(n(30),t),o(n(10),t),o(n(11),t),o(n(4),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(e){function r(){function e(e,n,r,i){var u=n&&n.prototype instanceof t?n:t,s=Object.create(u.prototype);return o(s,"_invoke",function(e,t,n){function r(e,t){for(i=e,u=t,c=0;!l&&s&&!n&&c<f.length;c++){var n,r=f[c],o=v.p,y=r[2];3<e?(n=y===t)&&(u=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=a):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,v.v=t,v.n=r[1]):o<y&&(n=3>e||r[0]>t||t>y)&&(r[4]=e,r[5]=t,v.n=y,i=0))}if(n||1<e)return p;throw l=!0,t}var o,i,u,s=0,f=n||[],l=!1,v={p:0,n:0,v:a,a:r,f:r.bind(a,4),d:function e(t,n){return o=t,i=0,u=a,v.n=n,p}};return function(n,f,y){if(1<s)throw TypeError("Generator is already running");for(l&&1===f&&r(f,y),i=f,u=y;(c=2>i?a:u)||!l;){o||(i?3>i?(1<i&&(v.n=-1),r(i,u)):v.n=u:v.v=u);try{if(s=2,o){if(i||(n="next"),c=o[n]){if(!(c=c.call(o,u)))throw TypeError("iterator result is not an object");if(!c.done)return c;u=c.value,2>i&&(i=0)}else 1===i&&(c=o.return)&&c.call(o),2>i&&(u=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=a}else if((c=(l=0>v.n)?u:e.call(t,v))!==p)break}catch(e){o=a,i=1,u=e}finally{s=1}}return{value:c,done:l}}}(e,r,i),!0),s}function t(){}function n(){}function i(){}function u(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,o(e,l,"GeneratorFunction")),e.prototype=Object.create(y),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var a,c,s="function"==typeof Symbol?Symbol:{},f=s.iterator||"@@iterator",l=s.toStringTag||"@@toStringTag",p={};c=Object.getPrototypeOf;var v=[][f]?c(c([][f]())):(o(c={},f,(function(){return this})),c),y=i.prototype=t.prototype=Object.create(v);return n.prototype=i,o(y,"constructor",i),o(i,"constructor",n),n.displayName="GeneratorFunction",o(i,l,"GeneratorFunction"),o(y),o(y,l,"Generator"),o(y,f,(function(){return this})),o(y,"toString",(function(){return"[object Generator]"})),(r=function t(){return{w:e,m:u}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(o=function e(t,n,r,u){function a(e,n){o(t,e,(function(t){return this._invoke(e,n,t)}))}n?i?i(t,n,{value:r,enumerable:!u,configurable:!u,writable:!u}):t[n]=r:(a("next",0),a("throw",1),a("return",2))})(e,t,n,r)}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.1.3",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,r().m((function e(){var o,i,a,c,s;return r().w((function(e){for(;;)switch(e.n){case 0:if(n){e.n=1;break}return e.a(2);case 1:return e.n=2,f();case 2:return o=e.v,n.app.type=u.AppType.uniapp,n._v=t.VERSION,n.net=Object.assign({model:o},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),e.a(2,n)}}),e)})))};t.fixAttrs=l}).call(this,n(15))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCurViews=t.getCurView=t.getCurrentPage=void 0;var r=n(0),o="__rum_view";function i(){if("function"==typeof getCurrentPages)try{var e=getCurrentPages()||[];return e[e.length-1]}catch(e){}}function u(e){if(e){var t=i();if(t){if(o in t)return t[o];var n=t.$page||{},u=n.fullPath,a=n.route,c=n.openType,s=e.session.getViewId(),f=u||a||t.route,l=a||t.route,p,v=e.getConfig().parseViewName;return(0,r.isFunction)(v)&&(l=v(f)),t[o]={id:s,name:l,url:f,loading_type:c,_noReport:!0}}}}function a(){var e=[];if("function"==typeof getCurrentPages)try{(getCurrentPages()||[]).forEach((function(t){o in t&&e.push(t[o])}))}catch(e){}return e}t.getCurrentPage=i,t.getCurView=u,t.getCurViews=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=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}),t.EventEmitter=void 0;var s=function(){function e(){o(this,e),this.events={}}return u(e,[{key:"on",value:function e(t,n){this.events[t]||(this.events[t]=[]),this.events[t].push(n)}},{key:"emit",value:function e(t){var n=this.events[t];if(n){for(var r=n.slice(),o=arguments.length,i=new Array(o>1?o-1:0),u=1;u<o;u++)i[u-1]=arguments[u];for(var a=0;a<r.length;a++)try{r[a].apply(r,i)}catch(e){console.error('Error in handler for "'.concat(t,'":'),e)}}}},{key:"off",value:function e(t,n){var r=this.events[t];if(r)if(n){for(var o=r.length;o--;)r[o]===n&&r.splice(o,1);0===r.length&&delete this.events[t]}else delete this.events[t]}},{key:"once",value:function e(t,n){var r=this,o=function e(){r.off(t,o),n.apply(void 0,arguments)};this.on(t,o)}}])}();t.EventEmitter=s},function(e,t,n){"use strict";var r,o,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AppType=t.ResourceStatus=t.RumEventType=void 0,function(e){e.VIEW="view",e.RESOURCE="resource",e.EXCEPTION="exception",e.LONG_TASK="longTask",e.ACTION="action",e.CUSTOM="custom",e.APPLICATION="application"}(r=t.RumEventType||(t.RumEventType={})),function(e){e[e.Unknown=-1]="Unknown",e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(o=t.ResourceStatus||(t.ResourceStatus={})),function(e){e.browser="browser",e.miniapp="miniapp",e.minigame="minigame",e.uniapp="uniapp",e.reactnative="reactnative"}(i=t.AppType||(t.AppType={}))},function(e,t,n){"use strict";function r(){return(new Date).getTime()}function o(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"utf8";if("string"!=typeof e)throw new TypeError("Input must be a string");var n=t.toLowerCase();if("utf16"===n){for(var r,o=0,i=0;i<e.length;i++){if(55296<=(r=e.charCodeAt(i))&&56319>=r&&i+1<e.length){var u=e.charCodeAt(i+1);if(56320<=u&&57343>=u){o+=4,i++;continue}}o+=2}return o}if("utf8"===n){for(var a,c=0,s=0;s<e.length;s++){if(55296<=(a=e.charCodeAt(s))&&56319>=a&&s+1<e.length){var f=e.charCodeAt(s+1);56320<=f&&57343>=f&&(a=1024*(a-55296)+(f-56320)+65536,s++)}c+=127>=a?1:2047>=a?2:65535>=a?3:1114111>=a?4:3}return c}throw new Error('Unsupported encoding. Use "utf8" or "utf16".')}Object.defineProperty(t,"__esModule",{value:!0}),t.getStringSize=t.getCurrentTime=void 0,t.getCurrentTime=r,t.getStringSize=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(8),v=n(4),y=n(9),d=n(1),m=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,r){var i=this;this.ctx=new y.default(t,n,r);var u=this.ctx,a=this.collectors,c=this.processors,s=this.reporter;c.forEach((function(e){(0,d.isFunction)(e.setup)&&e.setup(u)})),this.emitter.on(p.EventType.collect,(function(e){u.setRumEvent(e);var t=o(c),n;try{for(t.s();!(n=t.n()).done;){var r=n.value;if(r.match||(r.match=function(){return!0}),r.match(u)){var i=r.process(u);i&&u.setRumEvent(i)}}}catch(e){t.e(e)}finally{t.f()}s.report(u)})),a.forEach((function(e){e.setup(u,i.sendEvent)}))}},{key:"setContext",value:function e(t){this.ctx=t}},{key:"getContext",value:function e(){return this.ctx}},{key:"useCollectors",value:function e(t){this.collectors=t}},{key:"getCollectors",value:function e(){return this.collectors}},{key:"useProcessors",value:function e(t){this.processors=t}},{key:"useReporter",value:function e(t){this.reporter=t}}])}();t.default=m},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.EventType=void 0,function(e){e.collect="collect"}(r=t.EventType||(t.EventType={}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,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=function(){function e(t,n,r){o(this,e),this.config=t,this.views=[],this.emitter=new s.EventEmitter,n&&(this.session=n,this.session.init(this)),r&&(this.configManager=r)}return u(e,[{key:"getConfig",value:function e(){return this.configManager?this.configManager.getConfig():this.config}},{key:"setConfig",value:function e(t){this.configManager?this.configManager.setConfig(t):this.config=t}},{key:"getViews",value:function e(){return this.views}},{key:"addView",value:function e(t){var n=this.views.findIndex((function(e){return e.id===t.id}));n>=0&&this.views.splice(n,1),this.views.push(t)}},{key:"removeView",value:function e(t){this.views=this.views.filter((function(e){return e.id!==t}))}},{key:"getRumEvent",value:function e(){return this.rumEvent}},{key:"setRumEvent",value:function e(t){this.rumEvent=t}}])}();t.default=f},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.getUrlParams=void 0;var r=function e(t){if(0===t.length)return"";try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ").replace(/%20/g," ").replace(/%2F/g,"/").replace(/%3D/g,"=").replace(/%26/g,"&").replace(/%3F/g,"?")}},o=function e(t){if(0===t.length)return"";var n=t.indexOf("#"),r=n>=0?t.slice(0,n):t,o=r.indexOf("?");return-1===o?"":r.slice(o+1)};function i(e){if("string"!=typeof e||!e.trim())return{};var t={},n=o(e);if(!n)return t;for(var i=n.split("&"),u=0;u<i.length;u++){var a=i[u];if(a){var c=a.indexOf("=");if(!(c<=0)){var s=r(a.slice(0,c)),f=c<a.length-1?r(a.slice(c+1)):"",l=t[s];void 0!==l?Array.isArray(l)?l.push(f):t[s]=[l,f]:t[s]=f}}}return t}t.getUrlParams=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRegExpString=t.delay=t.debounce=t.generateEventId=t.generateSpanId=t.generateTraceId=t.generateGUID=t.restoreFunction=t.interceptFunction=void 0;var r=n(1);function o(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e[t],u=function t(){for(var u=o?this:e,a=arguments.length,c=new Array(a),s=0;s<a;s++)c[s]=arguments[s];if(n.apply(u,c),(0,r.isFunction)(i))return i.apply(u,c)};u._rum_intercepted=i,e[t]=u}function i(e,t){var n=e[t];if((0,r.isFunction)(n)){var o=n._rum_intercepted;(0,r.isFunction)(o)&&(e[t]=o)}}function u(){var e="";try{if(crypto&&crypto.randomUUID)e=crypto.randomUUID();else if(crypto&&crypto.getRandomValues){var t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128,e=t.reduce((function(e,t){return e+t.toString(16).padStart(2,"0")}),"").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/,"$1-$2-$3-$4-$5")}}catch(t){e=""}return e||(e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0,n;return("x"==e?t:3&t|8).toString(16)}))),e}function a(){var e=u().replace(/-/g,"");return"0"===e[0]&&(e="1"+e.substring(1)),"0"===e[16]&&(e=e.substring(0,16)+"1"+e.substring(17)),e}function c(){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 s(e){var t=c();return"00-".concat(e,"-").concat(t)}function f(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 l(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 p(e){if("string"!=typeof e)throw new TypeError("input must be a string");if(e.length>2&&"/"===e[0]){var t=e.lastIndexOf("/");if(t>0){var n=e.substring(1,t),r=e.substring(t+1);return new RegExp(n,r)}return new RegExp(e.substring(1,e.length-1))}return new RegExp(e)}t.interceptFunction=o,t.restoreFunction=i,t.generateGUID=u,t.generateTraceId=a,t.generateSpanId=c,t.generateEventId=s,t.debounce=f,t.delay=l,t.parseRegExpString=p},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.parseRule2Match=t.urlMatch=t.matchList=t.isMatchOption=void 0;var s=n(1),f=n(13),l=n(12);function p(e){return(0,s.isString)(e)||(0,s.isFunction)(e)||(0,s.isRegExp)(e)}function v(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 y(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 v(n,e)}catch(e){return!1}}function d(e){if(p(e))return e;var t;switch(e.match_exp){case"equals":t=function t(n){return n===e.match};break;case"not_equals":t=function t(n){return n!==e.match};break;case"regex":t=(0,l.parseRegExpString)(e.match);break;case"includes":t=function t(n){return n.includes(e.match)};break;case"starts_with":default:t=function t(n){return(0,f.startsWith)(n,e.match)}}return t}t.isMatchOption=p,t.matchList=v,t.urlMatch=y,t.parseRule2Match=d},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){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o;function i(e){return null==e?null:"function"==typeof e.mixin?"function"==typeof e?"vue2":"object"===r(e)?"vue3":null:null}Object.defineProperty(t,"__esModule",{value:!0}),t.removeEventListener=t.addEventListener=t.mixin=t.getVueRuntimeKind=void 0,t.getVueRuntimeKind=i;var u=["onLaunch","onLoad","onShow","beforeCreate","mounted"],a={onError:[]};function c(e,t,n){var r=a[e];if(null!=r&&r.length)for(var o=0;o<r.length;o++)try{r[o](t,n)}catch(t){console.warn("[arms] vue mixin listener failed",e,t)}}function s(e){function t(e,t,n){c("onError",this,{error:e,instance:t,info:n})}for(var n={},r=function e(){var t=u[i];n[t]=function(e){c(t,this,e)}},i=0;i<u.length;i++)r();return"vue2"===e?Object.defineProperty(o.config,"errorHandler",{get:function e(){var n=this;return function(e,r,o){t(e,r,o),n.__errorHandler&&n.__errorHandler(e,r,o)}},set:function e(t){this.__errorHandler=t}}):Object.defineProperty(o.config,"onErrorCaptured",{get:function e(){var n=this;return function(e,r,o){t(e,r,o),n.__onErrorCaptured&&n.__onErrorCaptured(e,r,o)}},set:function e(t){this.__onErrorCaptured=t}}),n}function f(e){if(!o){o=e;var t=i(e);if(t)try{e.mixin(s(t))}catch(e){console.warn("[arms] vue.mixin failed",e)}}}function l(e,t){e in a||(a[e]=[]),a[e].push(t)}function p(e,t){if(e in a&&t){var n=a[e],r=n.indexOf(t);return n.splice(r,1),!0}return!1}u.forEach((function(e){a[e]=[]})),t.mixin=f,t.addEventListener=l,t.removeEventListener=p},function(e,t,n){e.exports=n(18)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArmsRum=void 0;var r=n(19);Object.defineProperty(t,"ArmsRum",{enumerable:!0,get:function(){return r.ArmsRum}}),t.default=r.default},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,n){return(t=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 d(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&&m(e,t)}function m(e,t){return(m=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 g=n(0),b=n(31),h=n(32),w=n(33),O=n(36),S=n(37),E=n(38),j=n(2),_=n(39),T=n(16),P=n(3),C=function(e){function t(){var e;return i(this,t),(e=f(this,t,arguments)).version=j.VERSION,e}return d(t,e),a(t,[{key:"init",value:function(e){var t;return e.vue&&this.setVue(e.vue),this.client.useCollectors([new b.default,new h.default,new w.default]),this.client.useProcessors([new O.default,new S.default]),this.client.useReporter(new E.default),this.client.init(e,new _.RumSession),this.client.getContext().getViews=P.getCurViews,this}},{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:"setVue",value:function(e){this.setConfig("vue",e),(0,T.mixin)(e)}}])}(g.Shell);t.ArmsRum=C,t.default=new C},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",u=n.toStringTag||"@@toStringTag";function a(n,r,o,u){var a=r&&r.prototype instanceof s?r:s,f=Object.create(a.prototype);return i(f,"_invoke",function(n,r,o){var i,u,a,s=0,f=o||[],l=!1,p={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function t(n,r){return i=n,u=0,a=e,p.n=r,c}};function v(n,r){for(u=n,a=r,t=0;!l&&s&&!o&&t<f.length;t++){var o,i=f[t],v=p.p,y=i[2];n>3?(o=y===r)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=v&&((o=n<2&&v<i[1])?(u=0,p.v=r,p.n=i[1]):v<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,u=0))}if(o||n>1)return c;throw l=!0,r}return function(o,f,y){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&v(f,y),u=f,a=y;(t=u<2?e:a)||!l;){i||(u?u<3?(u>1&&(p.n=-1),v(u,a)):p.n=a:p.v=a);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(l=p.n<0)?a:n.call(r,p))!==c)break}catch(t){i=e,u=1,a=t}finally{s=1}}return{value:t,done:l}}}(n,o,u),!0),f}var c={};function s(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(i(t={},r,(function(){return this})),t),v=l.prototype=s.prototype=Object.create(p);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,u,"GeneratorFunction")),e.prototype=Object.create(v),e}return f.prototype=l,i(v,"constructor",l),i(l,"constructor",f),f.displayName="GeneratorFunction",i(l,u,"GeneratorFunction"),i(v),i(v,u,"Generator"),i(v,r,(function(){return this})),i(v,"toString",(function(){return"[object Generator]"})),(o=function e(){return{w:a,m:y}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,u){function a(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!u,configurable:!u,writable:!u}):t[n]=r:(a("next",0),a("throw",1),a("return",2))})(e,t,n,r)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function c(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=f(e,"string");return"symbol"==r(t)?t:t+""}function f(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var l=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function 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 p=n(5),v=n(21),y=n(1),d=n(10),m=n(11),g=3e3,b=20,h=["app","user","device","os","geo","isp","net","properties"],w=function(){function e(){u(this,e),this.name="reporter",this.eventQueue=[],this._init=!1}return c(e,[{key:"getReportCfg",value:function e(){var t=this.ctx.getConfig().reportConfig;return(0,y.isObject)(t)||(t={}),(!t.flushTime||t.flushTime<0||t.flushTime>1e4)&&(t.flushTime=3e3),(!t.maxEventCount||t.maxEventCount<1||t.maxEventCount>100)&&(t.maxEventCount=20),t}},{key:"report",value:function e(t){var n=this;this.ctx=t,this._init||(this.init(t),this._init=!0),clearTimeout(this.timer),this.pushToQueue();var r=this.getReportCfg();this.eventQueue.length>=r.maxEventCount?this.flushEventQueue():this.timer=setTimeout((function(){n.flushEventQueue()}),r.flushTime)}},{key:"pushToQueue",value:function e(){var t=this.ctx,n=this.eventQueue,r=t.getRumEvent();if(r.event_type===p.RumEventType.EXCEPTION){var o=r.message,i=r.stack,u=(0,v.getErrorID)({message:o,stack:i}),a=this.eventQueue.find((function(e){if(e.event_type===p.RumEventType.EXCEPTION){var t=e.message,n=e.stack;return(0,v.getErrorID)({message:t,stack:n})===u}}));if(a)return void a.times++}if(r.event_type===p.RumEventType.ACTION){var c=r.target_name,s=this.eventQueue.find((function(e){if(e.event_type===p.RumEventType.ACTION)return c===e.target_name}));if(s)return void s.times++}n.push(r)}},{key:"flushEventQueue",value:function e(){var t=this.ctx,n=this.eventQueue;if(n.length){var r=t.getViews(),o=r[r.length-1];r.forEach((function(e){var t;e.id===o.id&&n.filter((function(t){var n;return(null===(n=t.view)||void 0===n?void 0:n.id)===e.id})).forEach((function(e){delete e.view}))}));var i=t.session,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=(0,m.getUrlParams)(o.endpoint),f=Object.assign({app:{id:o.pid,env:o.env||"prod",version:o.version,type:""},user:{id:i.getUserId()},session:{id:u},net:{},view:r,events:n},s);h.forEach((function(e){var t=o[e];(0,y.isObject)(t)&&Object.keys(t).forEach((function(n){var r=t[n];"user"===e&&"id"===n||("properties"===e?f[e]=(0,d.verifyProperties)(t):((0,y.isString)(r)||(0,y.isNumber)(r))&&(e in f||(f[e]={}),f[e][n]=r))}))})),("function"!=typeof o.beforeReport||(f=o.beforeReport(f)))&&this.tryRequest(f)}}},{key:"tryRequest",value:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r,i,u;return l(this,void 0,void 0,o().m((function e(){var a=this,c,s,f,l;return o().w((function(e){for(;;)switch(e.p=e.n){case 0:return c=null===(r=this.ctx.getConfig())||void 0===r?void 0:r.reportConfig,s=null!==(i=null==c?void 0:c.maxRetryCount)&&void 0!==i?i:0,f=null!==(u=null==c?void 0:c.retryDelay)&&void 0!==u?u:3e3,e.p=1,t._retry=n,e.n=2,this.request(this.ctx,t);case 2:e.n=4;break;case 3:e.p=3,l=e.v,n<s-1&&setTimeout((function(){return a.tryRequest(t,n+1)}),f);case 4:return e.a(2)}}),e,this,[[1,3]])})))}},{key:"init",value:function e(t){}}])}();t.default=w},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorID=void 0;var r=function e(t){var n=t.message,r=void 0===n?"":n,o=t.stack,i;return r+(void 0===o?"":o)};t.getErrorID=r},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,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(5),f=n(7),l=n(1),p=function(){function e(t){o(this,e),this.client=new f.default,t&&this.init&&this.init(t)}return u(e,[{key:"sendEvent",value:function e(t){this.client&&this.client.sendEvent(t)}},{key:"getConfig",value:function e(){if(this.client)return this.client.getContext().getConfig()}},{key:"sendCustom",value:function e(t){if(t.name&&t.type){var n=Object.assign(Object.assign({},t),{event_type:s.RumEventType.CUSTOM});this.sendEvent(n)}}},{key:"sendView",value:function e(t){if((0,l.isObject)(t)){if(t.type||(t.type="custom"),"custom"===t.type){var n=0;if(["t1","t2","t3"].forEach((function(e){(0,l.isNumber)(t[e])||delete t[e],e in t&&n++})),0===n)return}var r=Object.assign(Object.assign({},t),{event_type:s.RumEventType.VIEW});this.sendEvent(r)}}},{key:"sendException",value:function e(t){if(t.name&&t.message){var n=t.name,r=t.message,o=t.stack,i=Object.assign(Object.assign({times:1,name:n,message:r,stack:o},t),{event_type:s.RumEventType.EXCEPTION,type:"custom",source:"custom"});this.sendEvent(i)}}},{key:"sendResource",value:function e(t){if(t.name&&t.type&&(0,l.isNumber)(t.duration)){var n=Object.assign(Object.assign({times:1},t),{event_type:s.RumEventType.RESOURCE});this.sendEvent(n)}}}])}();t.default=p},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",u=n.toStringTag||"@@toStringTag";function a(n,r,o,u){var a=r&&r.prototype instanceof s?r:s,f=Object.create(a.prototype);return i(f,"_invoke",function(n,r,o){var i,u,a,s=0,f=o||[],l=!1,p={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function t(n,r){return i=n,u=0,a=e,p.n=r,c}};function v(n,r){for(u=n,a=r,t=0;!l&&s&&!o&&t<f.length;t++){var o,i=f[t],v=p.p,y=i[2];n>3?(o=y===r)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=v&&((o=n<2&&v<i[1])?(u=0,p.v=r,p.n=i[1]):v<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,u=0))}if(o||n>1)return c;throw l=!0,r}return function(o,f,y){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&v(f,y),u=f,a=y;(t=u<2?e:a)||!l;){i||(u?u<3?(u>1&&(p.n=-1),v(u,a)):p.n=a:p.v=a);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(l=p.n<0)?a:n.call(r,p))!==c)break}catch(t){i=e,u=1,a=t}finally{s=1}}return{value:t,done:l}}}(n,o,u),!0),f}var c={};function s(){}function f(){}function l(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(i(t={},r,(function(){return this})),t),v=l.prototype=s.prototype=Object.create(p);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,i(e,u,"GeneratorFunction")),e.prototype=Object.create(v),e}return f.prototype=l,i(v,"constructor",l),i(l,"constructor",f),f.displayName="GeneratorFunction",i(l,u,"GeneratorFunction"),i(v),i(v,u,"Generator"),i(v,r,(function(){return this})),i(v,"toString",(function(){return"[object Generator]"})),(o=function e(){return{w:a,m:y}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,u){function a(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!u,configurable:!u,writable:!u}):t[n]=r:(a("next",0),a("throw",1),a("return",2))})(e,t,n,r)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function c(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=f(e,"string");return"symbol"==r(t)?t:t+""}function f(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var l=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function 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())}))};function p(e){var t=e.remoteConfig||{},n=!1;return"enable"in t?n=!!t.enable:(t.region||t.url)&&(n=!0),{enable:n,url:t.url||"",mode:t.mode||"launch-first",cacheTimeout:t.cacheTimeout||36e5,region:t.region}}Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigManager=void 0;var v=function(){function e(){u(this,e),this.currentConfig=null,this.initialized=!1}return c(e,[{key:"init",value:function e(t){return l(this,void 0,void 0,o().m((function e(){var n=this,r,i,u;return o().w((function(e){for(;;)switch(e.n){case 0:if(!this.initialized){e.n=1;break}return e.a(2);case 1:if(this.currentConfig=Object.assign({},t),this.initialized=!0,r=p(t),this.currentConfig.remoteConfig=r,r.enable){e.n=2;break}return e.a(2);case 2:return e.n=3,this.getCacheConfig();case 3:if((i=e.v)&&i.content&&(this.currentConfig=this.mergeRemoteCfg(i.content)),!this.isCacheValid(i,r.cacheTimeout)){e.n=4;break}return e.a(2);case 4:if(u=this.fetchRemoteCfg(this.currentConfig).then((function(e){if(e){var t=n.parseConfig(e);n.currentConfig=n.mergeRemoteCfg(t),n.setCacheConfig({timestamp:Date.now(),content:e})}})),"remote-first"!==r.mode){e.n=5;break}return e.n=5,u;case 5:return e.a(2)}}),e,this)})))}},{key:"getConfig",value:function e(){if(!this.currentConfig)throw new Error("Config not initialized");return this.currentConfig}},{key:"setConfig",value:function e(t){return l(this,void 0,void 0,o().m((function e(){return o().w((function(e){for(;;)switch(e.n){case 0:if(this.currentConfig){e.n=1;break}return e.a(2);case 1:this.currentConfig=Object.assign(Object.assign({},this.currentConfig),t);case 2:return e.a(2)}}),e,this)})))}},{key:"isCacheValid",value:function e(t,n){if(!t||!t.timestamp)return!1;var r=n||36e5;return Date.now()-t.timestamp<r}},{key:"mergeRemoteCfg",value:function e(t){var n=this.currentConfig,r=n.pid,o=n.app,i=n.endpoint,u=n.remoteConfig,a=n.beforeReport,c=n.properties;return Object.assign(Object.assign(Object.assign({},this.currentConfig),t),{pid:r,app:o,endpoint:i,remoteConfig:u,beforeReport:a,properties:c})}},{key:"destroy",value:function e(){this.currentConfig=null,this.initialized=!1}}])}();t.ConfigManager=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";function r(e){return 0!==e&&100*Math.random()<=e}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!e)return e;var r=e.toString(),o=r.indexOf(".");r=-1!==o?r.substring(0,t+o+1):r.substring(0);var i=parseFloat(r);return i>=n?i:void 0}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNumber=t.performDraw=t.ONE_DAY=t.ONE_HOUR=t.ONE_MINUTE=t.ONE_SECOND=void 0,t.ONE_SECOND=1e3,t.ONE_MINUTE=60*t.ONE_SECOND,t.ONE_HOUR=60*t.ONE_MINUTE,t.ONE_DAY=24*t.ONE_HOUR,t.performDraw=r,t.formatNumber=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTracingOptions=t.makeTracingHeaders=t.isTraceOption=void 0;var r=n(14),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,d=e.baggage,m=void 0!==d&&d,g=[];return(0,o.isArray)(p)&&p.length&&p.forEach((function(e){(0,r.isMatchOption)(e)?g.push({match:e,propagatorTypes:f}):i(e)&&g.push(e)})),{enable:!(0,o.isBoolean)(u)||u,sample:(0,o.isNumber)(c)?c:100,propagatorTypes:f,allowedUrls:g,tracestate:y,baggage:m}}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(3),l=n(2),p=["navigateTo","redirectTo","switchTab"],v=function(){function e(){var t=this;o(this,e),this.name="pv-collector",this.sendPv=function(){var e=(0,f.getCurView)(t.ctx);e&&clearInterval(t.timer),e&&"_noReport"in e&&(delete e._noReport,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){var n=this;this.ctx=e,this.sendEvent=t,setTimeout(this.sendPv,100),this.timer=setInterval((function(){n.sendPv()}),100),(0,s.isFunction)(l.sdk.addInterceptor)&&p.forEach((function(e){l.sdk.addInterceptor(e,{success:n.sendPv})}))}},{key:"destroy",value:function(){}}])}();t.default=v},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(16),l=n(2),p=function(){function t(){var e=this;o(this,t),this.name="exception-collector",this.vueError=function(t,n){e.errorHandle(n,"Vue.onError")},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]:"";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 f=t.error;n=f.name,r=f.message,i=f.stack}}else if("string"==typeof t){i=t;var l=e.getErrorByStack(t);l&&(n=l.name,r=l.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})}}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{(0,f.addEventListener)("onError",this.vueError),e.addEventListener("error",this.onError),e.addEventListener("unhandledrejection",this.onUnhandledRejection),(0,s.isFunction)(l.sdk.onError)&&l.sdk.onError(this.uniError)}catch(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=p}).call(this,n(15))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){function e(e,n,r,o){var u=n&&n.prototype instanceof t?n:t,s=Object.create(u.prototype);return i(s,"_invoke",function(e,t,n){function r(e,t){for(i=e,u=t,c=0;!l&&s&&!n&&c<f.length;c++){var n,r=f[c],o=v.p,y=r[2];3<e?(n=y===t)&&(u=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=a):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,v.v=t,v.n=r[1]):o<y&&(n=3>e||r[0]>t||t>y)&&(r[4]=e,r[5]=t,v.n=y,i=0))}if(n||1<e)return p;throw l=!0,t}var o,i,u,s=0,f=n||[],l=!1,v={p:0,n:0,v:a,a:r,f:r.bind(a,4),d:function e(t,n){return o=t,i=0,u=a,v.n=n,p}};return function(n,f,y){if(1<s)throw TypeError("Generator is already running");for(l&&1===f&&r(f,y),i=f,u=y;(c=2>i?a:u)||!l;){o||(i?3>i?(1<i&&(v.n=-1),r(i,u)):v.n=u:v.v=u);try{if(s=2,o){if(i||(n="next"),c=o[n]){if(!(c=c.call(o,u)))throw TypeError("iterator result is not an object");if(!c.done)return c;u=c.value,2>i&&(i=0)}else 1===i&&(c=o.return)&&c.call(o),2>i&&(u=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=a}else if((c=(l=0>v.n)?u:e.call(t,v))!==p)break}catch(e){o=a,i=1,u=e}finally{s=1}}return{value:c,done:l}}}(e,r,o),!0),s}function t(){}function n(){}function r(){}function u(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,i(e,l,"GeneratorFunction")),e.prototype=Object.create(y),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var a,c,s="function"==typeof Symbol?Symbol:{},f=s.iterator||"@@iterator",l=s.toStringTag||"@@toStringTag",p={};c=Object.getPrototypeOf;var v=[][f]?c(c([][f]())):(i(c={},f,(function(){return this})),c),y=r.prototype=t.prototype=Object.create(v);return n.prototype=r,i(y,"constructor",r),i(r,"constructor",n),n.displayName="GeneratorFunction",i(r,l,"GeneratorFunction"),i(y),i(y,l,"Generator"),i(y,f,(function(){return this})),i(y,"toString",(function(){return"[object Generator]"})),(o=function t(){return{w:e,m:u}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,u){function a(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!u,configurable:!u,writable:!u}):t[n]=r:(a("next",0),a("throw",1),a("return",2))})(e,t,n,r)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}function c(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=f(e,"string");return"symbol"==r(t)?t:t+""}function f(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var l=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function 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 p=n(0),v=n(2),y=n(34),d=n(6),m=n(3),g=n(35),b=function(){function e(){var t=this;u(this,e),this.name="api-collector",this.sendApi=function(e,n,r){return l(t,void 0,void 0,o().m((function t(){var i,u,a,c,s,f,l,v,y,m,b;return o().w((function(t){for(;;)switch(t.p=t.n){case 0:if(i=this.ctx.getConfig(),u=i.evaluateApi,a=n.statusCode,c=n.status,s=n.errMsg,f=n.errorMessage,l=n.message,!(0,p.isFunction)(u)){t.n=4;break}return t.p=1,0===e.success&&(v=new Error("request error")),t.n=2,u(r,n,v);case 2:y=t.v,e=Object.assign(Object.assign({},e),(0,g.reviseApiAttr)(y)),t.n=4;break;case 3:t.p=3,b=t.v;case 4:if(!((m=Object.assign({event_type:p.RumEventType.RESOURCE,type:"api",status_code:c||a,message:f||s||l,duration:(0,d.getCurrentTime)()-e.timestamp,times:1},e)).duration>p.ONE_DAY)){t.n=5;break}return t.a(2);case 5:this.sendEvent(m);case 6:return t.a(2)}}),t,this,[[1,3]])})))}}return c(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,p.isFunction)(v.sdk.addInterceptor)){var t=this;v.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,p.parseTracingOptions)(i),f=s.enable,l=s.sample,y=s.propagatorTypes,d=s.allowedUrls,m=s.tracestate,g=!(void 0!==m)||m,b=s.baggage,h=void 0!==b&&b;if(f){var w=(0,p.find)(d,(function(e){return(0,p.matchList)([e.match],t.url)}));if(w){var O=w.propagatorTypes;0===O.length&&(O=y);var S=!1;O.includes("sw8")&&(O=["sw8"],S=!0);var E=S?(0,p.generateGUID)():(0,p.generateTraceId)(),j=S?(0,p.generateGUID)():(0,p.generateSpanId)(),_=(0,p.performDraw)(l),T=this.ctx.session.getUserId(),P=this.ctx.session.getSessionId(),C=g?"rum=v2&uniapp&".concat(u,"&").concat(P,"&").concat(T):void 0,k=h?"rum=v2,appType=uniapp,pid=".concat(u,",sid=").concat(P,",uid=").concat(T):void 0,x=(0,p.makeTracingHeaders)(E,j,_,O,{tracestate:C,baggage:k,appId:u,appVersion:c,viewName:null===(r=t.view)||void 0===r?void 0:r.name,host:v.appName});_&&(t.trace_id=E,t.trace_data=JSON.stringify({spanId:j,sample:l,sampled:_,header:x})),n(x)}}}},{key:"rebuildRequestOptions",value:function e(t){var n=this,r=t.url,o=t.success,i=t.fail,u=t.complete,a=t.header,c=(0,d.getCurrentTime)();if((0,y.isEndpoint)(this.ctx,r)||(0,p.urlMatch)(r))return t;var s={view:(0,m.getCurView)(this.ctx),timestamp:c,url:r,name:this.getResourceName(r),method:t.method||"GET"};return this.injectTracing(s,(function(e){t.header=Object.assign(Object.assign({},a),e)})),t.success=function(){s.success=1;for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];o&&o.apply(this,t)},t.fail=function(){s.success=0;for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];i&&i.apply(this,t)},t.complete=function(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];var i=Object.assign({},r[0]);try{s.success=s.success&&200<=i.statusCode&&300>i.statusCode?1:0,s.size=(0,d.getStringSize)(JSON.stringify(i)),n.sendApi(s,i,t)}catch(e){}u&&u.apply(this,r)},t}},{key:"getResourceName",value:function e(t){var n,r,o=this.ctx.getConfig().parseResourceName;return n=(0,p.isFunction)(o)?o(t):(0,y.getPathByURL)(t)}}])}();t.default=b},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(6),f=n(3),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&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var m=n(0),g=n(2),b=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;(0,m.isFunction)(g.sdk.onAppHide)&&g.sdk.onAppHide((function(){e.flushEventQueue()}))}},{key:"request",value:function(e,t){var n=e.getConfig();(0,g.fixAttrs)(t).then((function(e){g.sdk.request({url:n.endpoint,method:"POST",header:{"Content-Type":"text/plain"},dataType:"text",data:JSON.stringify(e)})})).catch((function(e){console.warn("[arms] sendRequest fail",e)}))}}])}(m.Reporter);t.default=b},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 d=n(0),m=n(6),g=n(3),b=n(2),h="_arms_uid",w="_arms_session",O=function(){function e(){f(this,e)}return p(e,[{key:"init",value:function(e){var t;this.ctx=e,this.sessionConfig=this.fixSessionConfig(null===(t=e.config)||void 0===t?void 0:t.sessionConfig)}},{key:"getSessionId",value:function(){return this.getSessionInfo().sessionId}},{key:"getSampled",value:function(){return this.getSessionInfo().sampled}},{key:"checkSession",value:function(e){var t=this.sessionConfig,n=t.overtime,r=t.maxDuration,o=(0,m.getCurrentTime)();return!(e.startTime+r<o||e.lastTime+n<o)}},{key:"updateSession",value:function(){var e=this.getSessionInfo();if(!e.isNew){var t=e.startTime,n=(0,m.getCurrentTime)(),r=e.sampled?1:0;(0,b.setStorageSync)(w,"".concat(e.sessionId,"-").concat(r,"-").concat(t,"-").concat(n))}}},{key:"getSessionInfo",value:function(){var e,t=o(((0,b.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,d.generateEventId)(this.getSessionId())}},{key:"getViewId",value:function(){return this.getUUID()}},{key:"getUserId",value:function(){var e=(0,b.getStorageSync)(h);return e&&0===e.indexOf("user_")&&(e=""),e||(e="uid_".concat((0,d.generateSpanId)(16,36)),(0,b.setStorageSync)(h,e)),e}},{key:"resetSession",value:function(){var e=this.sessionConfig.sampling,t=this.getUUID(),n=(0,m.getCurrentTime)(),r=(0,d.performDraw)(e),o="".concat(t,"-").concat(r?1:0,"-").concat(n,"-").concat(n);return(0,b.setStorageSync)(w,o),{sessionId:t,sampled:r,startTime:n,lastTime:n,isNew:!0}}},{key:"getUUID",value:function(){return(0,d.generateGUID)().replace(/-/g,"")}},{key:"fixSessionConfig",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.sampleRate,n=e.sampling,r=e.maxDuration,o=e.overtime;return(!(0,d.isNumber)(n)||0>n||100<n)&&(n=(0,d.isNumber)(t)&&0<=t&&1>=t?100*t:100),(!(0,d.isNumber)(r)||r<4*d.ONE_HOUR||r>d.ONE_DAY)&&(r=d.ONE_DAY),(!(0,d.isNumber)(o)||o>d.ONE_HOUR||o<10*d.ONE_MINUTE)&&(o=30*d.ONE_MINUTE),{sampling:n,maxDuration:r,overtime:o}}},{key:"getBaseEvent",value:function(){return{timestamp:(0,m.getCurrentTime)(),session_id:this.getSessionId(),event_id:this.getEventId(),view:this.ctx?(0,g.getCurView)(this.ctx):void 0,times:1}}}])}();t.RumSession=O}]);
@@ -1,3 +1,61 @@
1
- import{RumEventType}from"@arms/rum-core";import{getCurView}from"../../utils/view";// import { addPageListener, removePageListener } from "../../utils/hackPage";
2
- var ActionCollector=/*#__PURE__*/function(){function a(){var a=this;this.name="action-collector",this.DELAY_TIME=300,this.ctx=void 0,this.sendEvent=void 0,this.events=["tap"],this.lastEvent=void 0,this.timer=void 0,this.onEvent=function(b){if(b&&a.events.includes(b.type)&&b.target){var c=b.target,d=b.currentTarget,e=b.type,f=c.dataset,g=c.id;if(!g)return;if(d&&g!==d.id)return;var h=getCurView(a.ctx),i={event_type:RumEventType.ACTION,type:e,name:g,snapshots:Object.keys(f).length?JSON.stringify(f):void 0,times:1,view:h};clearTimeout(a.timer),a.lastEvent?a.lastEvent.name===i.name?a.lastEvent.times+=1:a.sendAction():a.lastEvent=i,a.timer=setTimeout(a.sendAction,a.DELAY_TIME)}},this.sendAction=function(){a.sendEvent(a.lastEvent),a.lastEvent=null}}var b=a.prototype;return b.setup=function(a,b){var c=a.getConfig(),d=c.collectors,e=void 0===d?{}:d;!1===e.action||(this.ctx=a,this.sendEvent=b)},b.destroy=function(){// removePageListener('*', this.onEvent);
3
- },a}();export{ActionCollector as default};
1
+ // import { ICollector, IContext, RumActionEvent, RumEvent, RumEventType } from '@arms/rum-core';
2
+ // import { getCurView } from "../../utils/view";
3
+ // // import { addPageListener, removePageListener } from "../../utils/hackPage";
4
+ //
5
+ // export default class ActionCollector implements ICollector {
6
+ // name = 'action-collector';
7
+ // private DELAY_TIME = 300;
8
+ // ctx: IContext;
9
+ // sendEvent: (payload: RumEvent) => void;
10
+ // events = ['tap'];
11
+ // lastEvent: RumActionEvent;
12
+ // timer: any;
13
+ //
14
+ // setup(ctx: IContext, sendEvent: (payload: RumEvent) => void) {
15
+ // const {collectors = {}} = ctx.getConfig();
16
+ // if (collectors.action === false) {
17
+ // return;
18
+ // }
19
+ // this.ctx = ctx;
20
+ // this.sendEvent = sendEvent;
21
+ // // addPageListener('*', this.onEvent)
22
+ // }
23
+ //
24
+ // onEvent = (e) => {
25
+ // if (e && this.events.includes(e.type) && e.target) {
26
+ // const {target, currentTarget, type} = e;
27
+ // const {dataset, id} = target;
28
+ // if (!id) return;
29
+ // if (currentTarget && id !== currentTarget.id) return;
30
+ // const view = getCurView(this.ctx);
31
+ // const event: RumActionEvent = {
32
+ // event_type: RumEventType.ACTION,
33
+ // type,
34
+ // name: id,
35
+ // snapshots: Object.keys(dataset).length ? JSON.stringify(dataset) : undefined,
36
+ // times: 1,
37
+ // view
38
+ // }
39
+ // clearTimeout(this.timer);
40
+ // if (this.lastEvent) {
41
+ // if (this.lastEvent.name !== event.name) {
42
+ // this.sendAction();
43
+ // } else {
44
+ // this.lastEvent.times += 1;
45
+ // }
46
+ // } else {
47
+ // this.lastEvent = event;
48
+ // }
49
+ // this.timer = setTimeout(this.sendAction, this.DELAY_TIME);
50
+ // }
51
+ // }
52
+ //
53
+ // sendAction = () => {
54
+ // this.sendEvent(this.lastEvent);
55
+ // this.lastEvent = null;
56
+ // }
57
+ //
58
+ // destroy() {
59
+ // // removePageListener('*', this.onEvent);
60
+ // }
61
+ // }
@@ -5,6 +5,7 @@ export default class ExceptionCollector implements ICollector {
5
5
  sendEvent: (payload: RumEvent) => void;
6
6
  setup(ctx: IContext, sendEvent: (payload: RumEvent) => void): void;
7
7
  hackOrigin(): void;
8
+ vueError: (_: any, error: Error) => void;
8
9
  uniError: (error: Error) => void;
9
10
  onError: (error: Error) => void;
10
11
  onUnhandledRejection: (e: PromiseRejectionEvent) => void;
@@ -1,5 +1,6 @@
1
- import{interceptFunction,isString,restoreFunction,RumEventType}from"@arms/rum-core";import{getCurView}from"../../utils/view";var ExceptionCollector=/*#__PURE__*/function(){function a(){var a=this;this.name="exception-collector",this.ctx=void 0,this.sendEvent=void 0,this.uniError=function(b){a.errorHandle(b,"uni.onError")},this.onError=function(b){a.errorHandle(b,"onError")},this.onUnhandledRejection=function(b){if(b){var c=b.reason;if(c){var d=c.errMsg;// 对 Uniapp 内置错误进行解析
2
- if(d&&isString(d)){c=new Error(d),c.name="",c.stack="";for(var e,f=["navigateTo","redirectTo","appLaunch","switchTab","getLocation","onLocationChange"],g=0,h=f;g<h.length;g++)if(e=h[g],d.startsWith(e)){c.name=e;break}c.name||(c.name=d.split(":")[0])}a.errorHandle(c,"onUnhandledRejection")}}},this.errorHandle=function(b,c){void 0===c&&(c="");var d,e,f,g,h,i,j=getCurView(a.ctx);if(b instanceof Object){if(d=b.name,e=b.message,f=b.filename||b.fileName,g=b.stack,h=b.lineno||b.lineNumber,i=b.colno||b.columnNumber,b.error instanceof Error){var k=b.error;d=k.name,e=k.message,g=k.stack}}else if("string"==typeof b){g=b;var l=a.getErrorByStack(b);l&&(d=l.name,e=l.message)}d&&e&&a.sendEvent({event_type:RumEventType.EXCEPTION,source:c,type:"error",name:d,message:e,file:f,stack:g,line:h,column:i,times:1,view:j})}}var b=a.prototype;return b.setup=function(a,b){this.ctx=a,this.sendEvent=b,this.hackOrigin()},b.hackOrigin=function(){var a=this,b=this.ctx.getConfig(),c=b.collectors,d=void 0===c?{}:c;if(!1!==d.jsError)try{uni.onError(this.uniError),global.addEventListener("error",this.onError),global.addEventListener("unhandledrejection",this.onUnhandledRejection)}catch(a){console.error(a)}!1!==d.consoleError&&interceptFunction(console,"error",function(b){a.errorHandle(b,"console.error")})},b.getErrorByStack=/**
1
+ import{interceptFunction,isFunction,isString,restoreFunction,RumEventType}from"@arms/rum-core";import{addEventListener}from"../../utils/mixin";import{sdk}from"../../utils/platform";var ExceptionCollector=/*#__PURE__*/function(){function a(){var a=this;this.name="exception-collector",this.ctx=void 0,this.sendEvent=void 0,this.vueError=function(b,c){a.errorHandle(c,"Vue.onError")},this.uniError=function(b){a.errorHandle(b,"uni.onError")},this.onError=function(b){a.errorHandle(b,"onError")},this.onUnhandledRejection=function(b){if(b){var c=b.reason;if(c){var d=c.errMsg;// 对 Uniapp 内置错误进行解析
2
+ if(d&&isString(d)){c=new Error(d),c.name="",c.stack="";for(var e,f=["navigateTo","redirectTo","appLaunch","switchTab","getLocation","onLocationChange"],g=0,h=f;g<h.length;g++)if(e=h[g],d.startsWith(e)){c.name=e;break}c.name||(c.name=d.split(":")[0])}a.errorHandle(c,"onUnhandledRejection")}}},this.errorHandle=function(b,c){void 0===c&&(c="");var d,e,f,g,h,i;if(b instanceof Object){if(d=b.name,e=b.message,f=b.filename||b.fileName,g=b.stack,h=b.lineno||b.lineNumber,i=b.colno||b.columnNumber,b.error instanceof Error){var j=b.error;d=j.name,e=j.message,g=j.stack}}else if("string"==typeof b){g=b;var k=a.getErrorByStack(b);k&&(d=k.name,e=k.message)}d&&e&&a.sendEvent({event_type:RumEventType.EXCEPTION,source:c,type:"error",name:d,message:e,file:f,stack:g,line:h,column:i,times:1})}}var b=a.prototype;return b.setup=function(a,b){this.ctx=a,this.sendEvent=b,this.hackOrigin()},b.hackOrigin=function(){var a=this,b=this.ctx.getConfig(),c=b.collectors,d=void 0===c?{}:c;if(!1!==d.jsError)try{addEventListener("onError",this.vueError),global.addEventListener("error",this.onError),global.addEventListener("unhandledrejection",this.onUnhandledRejection),isFunction(sdk.onError)&&sdk.onError(this.uniError)}catch(a){// console.error(e)
3
+ }!1!==d.consoleError&&interceptFunction(console,"error",function(b){a.errorHandle(b,"console.error")})},b.getErrorByStack=/**
3
4
  * 根据stack获取Error信息
4
5
  * TODO: 增加基于Stack解析filename和lineNumber的能力
5
6
  * @param stack
@@ -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,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 = {
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,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,!isFunction(g)){e.next=4;break}return e.prev=1,0===b.success&&(m=new Error("request error")),e.next=2,g(d,c,m);case 2:n=e.sent,b=_extends({},b,reviseApiAttr(n)),e.next=4;break;case 3:e.prev=3,p=e["catch"](1);case 4: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=5;break}return e.abrupt("return");case 5:a.sendEvent(o);case 6:case"end":return e.stop()}},e,null,[[1,3]])}));return function(){return b.apply(this,arguments)}}()}var b=a.prototype;return b.setup=// 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));
@@ -1 +1,74 @@
1
- import{isArray}from"@arms/rum-core";import{getPerformance}from"../../utils/platform";import{getCurView}from"../../utils/view";var PerfCollector=/*#__PURE__*/function(){function a(){var a=this;this.name="perf-collector",this.ctx=void 0,this.sendEvent=void 0,this.perfObserver=void 0,this.observerHandler=function(b){var c=isArray(b)?b:b.getEntries(),d={view:getCurView(a.ctx)};if(Array.isArray(c)&&0<c.length)for(var e,f=0;f<c.length;f++)if(e=c[f],"number"==typeof e.duration)switch(e.name){case"appLaunch":case"app-click":d.launch=e.duration;break;case"firstPaint":d["first-paint"]=e.duration;break;case"firstRender":d.first_render=e.duration;break;case"firstContentfulPaint":d.first_contentful_paint=e.duration;break;case"largestContentfulPaint":d.largest_contentful_paint=e.duration;break;case"resourceTiming":case"resource-timing":d.timing_data=JSON.stringify(e);break;default:}!Object.keys(d).length}}var b=a.prototype;return b.setup=function(a,b){var c=a.getConfig(),d=c.collectors,e=void 0===d?{}:d;if(!1!==e.perf){this.ctx=a,this.sendEvent=b;var f=getPerformance();f&&f.createObserver&&(this.perfObserver=f.createObserver(this.observerHandler),this.perfObserver.observe({entryTypes:["launch","navigation","render","paint","resource"]}))}},b.destroy=function(){this.perfObserver&&this.perfObserver.disconnect()},a}();export{PerfCollector as default};
1
+ // import { ICollector, IContext, isArray, RumEvent } from '@arms/rum-core';
2
+ // import { getPerformance } from "../../utils/platform";
3
+ // import { getCurView } from "../../utils/view";
4
+ //
5
+ // export default class PerfCollector implements ICollector {
6
+ // name = 'perf-collector';
7
+ // ctx: IContext;
8
+ // sendEvent: (payload: RumEvent) => void;
9
+ // perfObserver: any;
10
+ //
11
+ // setup(ctx: IContext, sendEvent: (payload: RumEvent) => void) {
12
+ // const {collectors = {}} = ctx.getConfig();
13
+ // if (collectors.perf === false) {
14
+ // return;
15
+ // }
16
+ // this.ctx = ctx;
17
+ // this.sendEvent = sendEvent;
18
+ // const performance = getPerformance();
19
+ // if (!performance || !performance.createObserver) return;
20
+ // this.perfObserver = performance.createObserver(this.observerHandler)
21
+ // this.perfObserver.observe({entryTypes: ['launch', 'navigation', 'render', 'paint', 'resource']});
22
+ // }
23
+ //
24
+ // observerHandler = (ev) => {
25
+ // const entries = isArray(ev) ? ev : ev.getEntries();
26
+ // const perfData = {
27
+ // view: getCurView(this.ctx)
28
+ // };
29
+ // if (Array.isArray(entries) && entries.length > 0) {
30
+ // for (let i = 0; i < entries.length; i++) {
31
+ // const item = entries[i];
32
+ // if (typeof item.duration === 'number') {
33
+ // switch (item.name) {
34
+ // case 'appLaunch':
35
+ // case 'app-click':
36
+ // perfData['launch'] = item.duration;
37
+ // break;
38
+ // case 'firstPaint':
39
+ // // case 'first-paint':
40
+ // perfData['first-paint'] = item.duration;
41
+ // break;
42
+ // case 'firstRender':
43
+ // perfData['first_render'] = item.duration;
44
+ // break;
45
+ // case 'firstContentfulPaint':
46
+ // // case 'first-contentful-paint':
47
+ // perfData['first_contentful_paint'] = item.duration;
48
+ // break;
49
+ // case 'largestContentfulPaint':
50
+ // // case 'largest-contentful-paint':
51
+ // perfData['largest_contentful_paint'] = item.duration;
52
+ // break;
53
+ // case 'resourceTiming':
54
+ // case 'resource-timing':
55
+ // perfData['timing_data'] = JSON.stringify(item);
56
+ // break;
57
+ // default:
58
+ // break;
59
+ // }
60
+ // }
61
+ // }
62
+ // }
63
+ //
64
+ // if (!Object.keys(perfData).length) return;
65
+ // // TODO 处理性能数据
66
+ // // console.warn('perf-collector: ', perfData);
67
+ // };
68
+ //
69
+ // destroy() {
70
+ // if (this.perfObserver) {
71
+ // this.perfObserver.disconnect();
72
+ // }
73
+ // }
74
+ // }