@arms/rum-miniapp 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/miniapp-sdk.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/package.json +2 -3
package/dist/miniapp-sdk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function e(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.RumSDK=n():t.RumSDK=n()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./dist/",n(n.s=13)}([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(17);t.Reporter=a.default;var c=n(19);t.Shell=c.default,o(n(8),t),o(n(20),t),o(n(21),t),o(n(22),t),o(n(6),t),o(n(23),t),o(n(24),t),o(n(10),t),o(n(1),t),o(n(25),t),o(n(11),t),o(n(26),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.isObject=t.isNull=t.isNumber=t.isBoolean=t.isRegExp=t.isArray=t.isToString=t.isString=t.isUndefined=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,"]")}t.isFunction=i,t.isUndefined=function(e){return o(e,"undefined")},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 o(e,"null")},t.isObject=function(e){return!(0,t.isNull)(e)&&o(e,"object")}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o;Object.defineProperty(t,"__esModule",{value:!0}),t.getPerformance=t.setStorageSync=t.getStorageSync=t.appName=t.sdk=t.VERSION=void 0,t.VERSION="0.0.26";var i="object",u="qq",a="bytedance",c="wechat",s="dingtalk",f="alipay",l="swan";function p(){var e,t="unknown";if(("undefined"==typeof qq?"undefined":r(qq))===i)e=qq,t="qq";else if(("undefined"==typeof tt?"undefined":r(tt))===i)e=tt,t="bytedance";else if(("undefined"==typeof wx?"undefined":r(wx))===i)e=wx,t="wechat";else if(("undefined"==typeof dd?"undefined":r(dd))===i)e=dd,t="dingtalk";else if(("undefined"==typeof my?"undefined":r(my))===i)e=my,t="alipay";else{if(("undefined"==typeof swan?"undefined":r(swan))!==i)throw new Error("Current platform is not supported.");e=swan,t="swan"}return{sdk:e,appName:t}}function y(e){return"function"==typeof t.sdk.getStorageSync?"alipay"===t.appName||"dingtalk"===t.appName?t.sdk.getStorageSync({key:e}).data:t.sdk.getStorageSync(e):void 0}function v(e,n){return"function"==typeof t.sdk.setStorageSync?"alipay"===t.appName||"dingtalk"===t.appName?t.sdk.setStorageSync({key:e,data:n}):t.sdk.setStorageSync(e,n):void 0}function d(){return"function"==typeof t.sdk.getPerformance?t.sdk.getPerformance():"performance"in t.sdk?t.sdk.performance:void 0}o=p(),t.sdk=o.sdk,t.appName=o.appName,t.getStorageSync=y,t.setStorageSync=v,t.getPerformance=d,t.default=t.sdk},function(e,t,n){"use strict";function r(){if("function"==typeof getCurrentPages)try{var e=getCurrentPages()||[];return e[e.length-1]}catch(e){console.warn("[arms] error in getCurView",e)}}function o(e){if(e){var t=e.getViews();if(t&&t.length)return t[t.length-1]}}Object.defineProperty(t,"__esModule",{value:!0}),t.getCurView=t.getCurPage=void 0,t.getCurPage=r,t.getCurView=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getViewId=t.getEventId=t.getUserID=t.setSessionID=t.getSessionID=void 0;var r=n(2),o=n(0),i=n(5),u="_arms_sid",a="_arms_sid_exp",c="_arms_uid";function s(){var e=(0,r.getStorageSync)(u),t=parseInt((0,r.getStorageSync)(a)),n=(0,i.getCurrentTime)();return(!e||32>e.length||!t.valueOf()||t<n)&&(e=f()),e}function f(){var e=(0,o.generateGUID)().replace(/-/g,"");(0,r.setStorageSync)(u,e);var t=(0,i.getCurrentTime)()+o.ONE_DAY;return(0,r.setStorageSync)(a,t.toString()),e}function l(){var e=(0,r.getStorageSync)(c);return e&&0===e.indexOf("user_")&&(e=""),e||(e="uid_".concat((0,o.generateSpanId)(16,36)),(0,r.setStorageSync)(c,e)),e}function p(){var e=s();return(0,o.generateEventId)(e)}function y(){return(0,o.generateGUID)().replace(/-/g,"")}(0,r.setStorageSync)(u,void 0),(0,r.setStorageSync)(a,void 0),t.getSessionID=s,t.setSessionID=f,t.getUserID=l,t.getEventId=p,t.getViewId=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentTime=t.formatNumber=void 0;var r=n(2);function o(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:3;if(!e)return e;var n=e.toString(),r=n.indexOf(".");return n=-1===r?n.substring(0):n.substring(0,t+r+1),parseFloat(n)}function i(e){var t=(0,r.getPerformance)(),n=0;return t&&t.timeOrigin&&t.now&&(n=Math.round(t.timeOrigin+(e||t.now()))),1e12>n&&(n=(new Date).getTime()),n}t.formatNumber=o,t.getCurrentTime=i},function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.AppType=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"}(r=t.RumEventType||(t.RumEventType={})),function(e){e.browser="browser",e.miniapp="miniapp"}(o=t.AppType||(t.AppType={}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=i(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function e(){};return{s:o,n:function t(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=!0,a=!1,c;return{s:function t(){n=n.call(e)},n:function e(){var t=n.next();return u=t.done,t},e:function e(t){a=!0,c=t},f:function e(){try{u||null==n.return||n.return()}finally{if(a)throw c}}}}function i(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.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=new 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),y=n(16),v=n(9),d=n(1),h=function(){function e(){var t=this;a(this,e),this.emitter=new y.EventEmitter,this.sendEvent=function(e){t.emitter.emit(p.EventType.collect,e)}}return s(e,[{key:"init",value:function e(t,n){var r=this;this.ctx=new v.default(t,n);var i=this.ctx,u=this.collectors,a=this.processors,c=this.reporter;a.forEach((function(e){(0,d.isFunction)(e.setup)&&e.setup(i)})),this.emitter.on(p.EventType.collect,(function(e){i.setRumEvent(e);var t=o(a),n;try{for(t.s();!(n=t.n()).done;){var r=n.value;if(r.match||(r.match=function(){return!0}),r.match(i)){var u=r.process(i);u&&i.setRumEvent(u)}}}catch(e){t.e(e)}finally{t.f()}c.report(i)})),u.forEach((function(e){e.setup(i,r.sendEvent)}))}},{key:"setContext",value:function e(t){this.ctx=t}},{key:"getContext",value:function e(){return this.ctx}},{key:"useCollectors",value:function e(t){this.collectors=t}},{key:"useProcessors",value:function e(t){this.processors=t}},{key:"useReporter",value:function e(t){this.reporter=t}}])}();t.default=h},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.EventType=void 0,function(e){e.collect="collect"}(r=t.EventType||(t.EventType={}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(t,n){o(this,e),this.config=t,this.views=[],n&&(this.session=n,this.session.init(t))}return u(e,[{key:"getConfig",value:function e(){return this.config}},{key:"setConfig",value:function e(t){this.config=t}},{key:"getViews",value:function e(){return this.views}},{key:"addView",value:function e(t){this.views.push(t)}},{key:"removeView",value:function e(t){this.views=this.views.filter((function(e){return e.id!==t}))}},{key:"getRumEvent",value:function e(){return this.rumEvent}},{key:"setRumEvent",value:function e(t){this.rumEvent=t}}])}();t.default=s},function(e,t,n){"use strict";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=Object.prototype.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=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.urlMatch=t.matchList=t.isMatchOption=void 0;var s=n(1),f=n(10);function l(e){return(0,s.isString)(e)||(0,s.isFunction)(e)||(0,s.isRegExp)(e)}function p(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e.some((function(e){try{if("function"==typeof e)return e(t);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{var n=[/https?:\/\/.*rum|retcode\.aliyuncs\.com/,/https?:\/\/.*log-global\.aliyuncs\.com/,/https?:\/\/.*\.mmstat\.com/].concat(r(t));return p(n,e)}catch(e){return!1}}t.isMatchOption=l,t.matchList=p,t.urlMatch=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removePageListener=t.addPageListener=t.originalComponent=t.originalPage=void 0;var r=n(0),o={onShow:[]};function i(e){Object.keys(o).forEach((function(t){var n=o[t];(0,r.interceptFunction)(e,t,(function(){for(var e=this,t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];n.forEach((function(t){t.apply(e,r)}))}))}))}function u(e,t){e in o||(o[e]=[]),o[e].push(t)}function a(e,t){if(e in o){var n=o[e],r=n.indexOf(t);n.splice(r,1)}}t.originalPage=Page,t.originalComponent=Component,Page=function e(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];try{i.apply(this,r)}catch(n){}return t.originalPage.apply(this,r)},Component=function e(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];try{var u=r[0]||{};u.methods||(u.methods={}),i.call(this,u.methods)}catch(n){}return t.originalComponent.apply(this,r)},t.addPageListener=u,t.removePageListener=a},function(e,t,n){e.exports=n(14)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArmsRum=void 0;var r=n(15);Object.defineProperty(t,"ArmsRum",{enumerable:!0,get:function e(){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=v(t),l(e,y()?Reflect.construct(t,n||[],v(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 y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}function v(e){return(v=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&&h(e,t)}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ArmsRum=void 0;var m=n(0),g=n(28),b=n(29),w=n(30),S=n(31),O=n(34),E=n(35),_=n(36),j=n(37),P=n(38),x=n(2),T=function(e){function t(){var e;return i(this,t),(e=f(this,t,arguments)).version=x.VERSION,e.updateNetType=function(t){var n,r=e.getConfig().net,o=void 0===r?{}:r;e.setConfig("net",Object.assign(Object.assign({},o),{type:t}))},e}return d(t,e),a(t,[{key:"init",value:function e(t){this.client.useCollectors([new g.default,new b.default,new w.default,new S.default,new O.default]),this.client.useProcessors([new E.default,new _.default]),this.client.useReporter(new j.default),this.client.init(t),(0,P.getNetType)(this.updateNetType)}},{key:"setConfig",value:function e(){var t=this.client.getContext();if(2===arguments.length){var n=this.client.getContext(),r=n.getConfig();n.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])}}])}(m.Shell);t.ArmsRum=T,t.default=new T},function(e,t,n){"use strict";var r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function e(t,n,r){return Function.prototype.apply.call(t,n,r)},i;function u(e){console&&console.warn&&console.warn(e)}i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function e(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function e(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function e(t){return t!=t};function c(){c.init.call(this)}e.exports=c,e.exports.once=w,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var s=10;function f(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function p(e,t,n,r){var o,i,a;if(f(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=l(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,u(c)}return e}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function v(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=y.bind(r);return o.listener=n,r.wrapFn=o,o}function d(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?b(o):m(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function b(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function w(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}O(e,t,i,{once:!0}),"error"!==t&&S(e,o,{once:!0})}))}function S(e,t,n){"function"==typeof e.on&&O(e,"error",t,n)}function O(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),c.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function e(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},c.prototype.getMaxListeners=function e(){return l(this)},c.prototype.emit=function e(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i="error"===t,u=this._events;if(void 0!==u)i=i&&void 0===u.error;else if(!i)return!1;if(i){var a;if(n.length>0&&(a=n[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var s=u[t];if(void 0===s)return!1;if("function"==typeof s)o(s,this,n);else for(var f=s.length,l=m(s,f),r=0;r<f;++r)o(l[r],this,n);return!0},c.prototype.addListener=function e(t,n){return p(this,t,n,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function e(t,n){return p(this,t,n,!0)},c.prototype.once=function e(t,n){return f(n),this.on(t,v(this,t,n)),this},c.prototype.prependOnceListener=function e(t,n){return f(n),this.prependListener(t,v(this,t,n)),this},c.prototype.removeListener=function e(t,n){var r,o,i,u,a;if(f(n),void 0===(o=this._events))return this;if(void 0===(r=o[t]))return this;if(r===n||r.listener===n)0==--this._eventsCount?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,r.listener||n));else if("function"!=typeof r){for(i=-1,u=r.length-1;u>=0;u--)if(r[u]===n||r[u].listener===n){a=r[u].listener,i=u;break}if(i<0)return this;0===i?r.shift():g(r,i),1===r.length&&(o[t]=r[0]),void 0!==o.removeListener&&this.emit("removeListener",t,a||n)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function e(t){var n,r,o;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i=Object.keys(r),u;for(o=0;o<i.length;++o)"removeListener"!==(u=i[o])&&this.removeAllListeners(u);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(n=r[t]))this.removeListener(t,n);else if(void 0!==n)for(o=n.length-1;o>=0;o--)this.removeListener(t,n[o]);return this},c.prototype.listeners=function e(t){return d(this,t,!0)},c.prototype.rawListeners=function e(t){return d(this,t,!1)},c.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},c.prototype.listenerCount=h,c.prototype.eventNames=function e(){return this._eventsCount>0?i(this._events):[]}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(6),f=n(18),l=n(1),p=3e3,y=20,v=function(){function e(){o(this,e),this.name="reporter",this.eventQueue=[]}return u(e,[{key:"getReportCfg",value:function e(){var t=this.ctx.getConfig().reportConfig;return(0,l.isObject)(t)||(t={}),(!t.flushTime||t.flushTime<0||t.flushTime>1e4)&&(t.flushTime=3e3),(!t.maxEventCount||t.maxEventCount<1||t.maxEventCount>100)&&(t.maxEventCount=20),t}},{key:"report",value:function e(t){var n=this;this.ctx=t,this.init(t),clearTimeout(this.timer),this.pushToQueue();var r=this.getReportCfg();this.eventQueue.length>=r.maxEventCount?this.flushEventQueue():this.timer=setTimeout((function(){n.flushEventQueue()}),r.flushTime)}},{key:"pushToQueue",value:function e(){var t=this.ctx,n=this.eventQueue,r=t.getRumEvent();if(r.event_type===s.RumEventType.EXCEPTION){var o=r.message,i=r.stack,u=(0,f.getErrorID)({message:o,stack:i}),a=this.eventQueue.find((function(e){if(e.event_type===s.RumEventType.EXCEPTION){var t=e.message,n=e.stack;return(0,f.getErrorID)({message:t,stack:n})===u}}));if(a)return void a.times++}if(r.event_type===s.RumEventType.ACTION){var c=r.target_name,l=this.eventQueue.find((function(e){if(e.event_type===s.RumEventType.ACTION)return c===e.target_name}));if(l)return void l.times++}n.push(r)}},{key:"flushEventQueue",value:function e(){var t=this.ctx,n=this.eventQueue;if(n.length){var r=t.getViews(),o=r[r.length-1];r.forEach((function(e){var t;e.id===o.id&&n.filter((function(t){var n;return(null===(n=t.view)||void 0===n?void 0:n.id)===e.id})).forEach((function(e){delete e.view}))}));var i=t.session,u;(!i||i.getSampled())&&this.request(t,n,o),this.eventQueue=[]}}},{key:"init",value:function e(t){}}])}();t.default=v},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(6),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:"sendException",value:function e(t){if(t.name&&t.message){var n=Object.assign(Object.assign({times:1},t),{event_type:s.RumEventType.EXCEPTION,type:"custom",source:"custom"});this.sendEvent(n)}}},{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";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}),t.delay=t.debounce=t.generateEventId=t.generateSpanId=t.generateTraceId=t.generateGUID=t.interceptFunction=void 0;var r=n(1);function o(e,t,n){var r=e[t];e[t]=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];if(n.apply(this,t),r)return r.apply(this,t)}}function i(){var e="";try{if(crypto&&crypto.randomUUID)e=crypto.randomUUID();else if(crypto&&crypto.getRandomValues){var t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128,e=t.reduce((function(e,t){return e+t.toString(16).padStart(2,"0")}),"").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/,"$1-$2-$3-$4-$5")}}catch(e){}return e||(e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0,n;return("x"==e?t:3&t|8).toString(16)}))),e}function u(){var e=i().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 a(){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 c(e){var t=a();return"00-".concat(e,"-").concat(t)}function s(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 f(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))}}t.interceptFunction=o,t.generateGUID=i,t.generateTraceId=u,t.generateSpanId=a,t.generateEventId=c,t.debounce=s,t.delay=f},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(11),o=n(1),i=n(27);function u(e){return e&&(0,r.isMatchOption)(e.match)&&(0,o.isArray)(e.propagatorTypes)}function a(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},u={},a=n?"1":"0";return r.includes("sw8")&&(r=["sw8"]),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":var r=String((0,i.encode)(e)),c=String((0,i.encode)(t)),s=String((0,i.encode)(o.appId)),f=String((0,i.encode)(o.appVersion)),l=String((0,i.encode)(o.viewName)),p=String((0,i.encode)(o.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),o.tracestate&&(u.tracestate=o.tracestate)}})),o.baggage&&(u.baggage=o.baggage),u}function c(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,i=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,y=e.tracestate,v=void 0===y||y,d=e.baggage,h=void 0!==d&&d,m=[];return(0,o.isArray)(p)&&p.length&&p.forEach((function(e){(0,r.isMatchOption)(e)?m.push({match:e,propagatorTypes:f}):u(e)&&m.push(e)})),{enable:!(0,o.isBoolean)(i)||i,sample:(0,o.isNumber)(c)?c:100,propagatorTypes:f,allowedUrls:m,tracestate:v,baggage:h}}t.isTraceOption=u,t.makeTracingHeaders=a,t.parseTracingOptions=c},function(e,t,n){"use strict";n.r(t),n.d(t,"version",(function(){return r})),n.d(t,"VERSION",(function(){return o})),n.d(t,"atob",(function(){return k})),n.d(t,"atobPolyfill",(function(){return C})),n.d(t,"btoa",(function(){return m})),n.d(t,"btoaPolyfill",(function(){return h})),n.d(t,"fromBase64",(function(){return I})),n.d(t,"toBase64",(function(){return _})),n.d(t,"utob",(function(){return O})),n.d(t,"encode",(function(){return _})),n.d(t,"encodeURI",(function(){return j})),n.d(t,"encodeURL",(function(){return j})),n.d(t,"btou",(function(){return T})),n.d(t,"decode",(function(){return I})),n.d(t,"isValid",(function(){return M})),n.d(t,"fromUint8Array",(function(){return b})),n.d(t,"toUint8Array",(function(){return N})),n.d(t,"extendString",(function(){return D})),n.d(t,"extendUint8Array",(function(){return B})),n.d(t,"extendBuiltins",(function(){return F})),n.d(t,"Base64",(function(){return V}));const r="3.7.7",o=r,i="function"==typeof Buffer,u="function"==typeof TextDecoder?new TextDecoder:void 0,a="function"==typeof TextEncoder?new TextEncoder:void 0,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(c),f=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(s),l=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,p=String.fromCharCode.bind(String),y="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),v=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),d=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),h=e=>{let t,n,r,o,i="";const u=e.length%3;for(let u=0;u<e.length;){if((n=e.charCodeAt(u++))>255||(r=e.charCodeAt(u++))>255||(o=e.charCodeAt(u++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|o,i+=s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}return u?i.slice(0,u-3)+"===".substring(u):i},m="function"==typeof btoa?e=>btoa(e):i?e=>Buffer.from(e,"binary").toString("base64"):h,g=i?e=>Buffer.from(e).toString("base64"):e=>{const t=4096;let n=[];for(let t=0,r=e.length;t<r;t+=4096)n.push(p.apply(null,e.subarray(t,t+4096)));return m(n.join(""))},b=(e,t=!1)=>t?v(g(e)):g(e),w=e=>{var t;if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?p(192|t>>>6)+p(128|63&t):p(224|t>>>12&15)+p(128|t>>>6&63)+p(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return p(240|t>>>18&7)+p(128|t>>>12&63)+p(128|t>>>6&63)+p(128|63&t)},S=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,O=e=>e.replace(S,w),E=i?e=>Buffer.from(e,"utf8").toString("base64"):a?e=>g(a.encode(e)):e=>m(O(e)),_=(e,t=!1)=>t?v(E(e)):E(e),j=e=>_(e,!0),P=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=e=>{switch(e.length){case 4:var t,n=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return p(55296+(n>>>10))+p(56320+(1023&n));case 3:return p((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return p((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},T=e=>e.replace(P,x),C=e=>{if(e=e.replace(/\s+/g,""),!l.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n="",r,o;for(let i=0;i<e.length;)t=f[e.charAt(i++)]<<18|f[e.charAt(i++)]<<12|(r=f[e.charAt(i++)])<<6|(o=f[e.charAt(i++)]),n+=64===r?p(t>>16&255):64===o?p(t>>16&255,t>>8&255):p(t>>16&255,t>>8&255,255&t);return n},k="function"==typeof atob?e=>atob(d(e)):i?e=>Buffer.from(e,"base64").toString("binary"):C,A=i?e=>y(Buffer.from(e,"base64")):e=>y(k(e).split("").map(e=>e.charCodeAt(0))),N=e=>A(R(e)),L=i?e=>Buffer.from(e,"base64").toString("utf8"):u?e=>u.decode(A(e)):e=>T(k(e)),R=e=>d(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),I=e=>L(R(e)),M=e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},U=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),D=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,U(t));e("fromBase64",(function(){return I(this)})),e("toBase64",(function(e){return _(this,e)})),e("toBase64URI",(function(){return _(this,!0)})),e("toBase64URL",(function(){return _(this,!0)})),e("toUint8Array",(function(){return N(this)}))},B=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,U(t));e("toBase64",(function(e){return b(this,e)})),e("toBase64URI",(function(){return b(this,!0)})),e("toBase64URL",(function(){return b(this,!0)}))},F=()=>{D(),B()},V={version:r,VERSION:o,atob:k,atobPolyfill:C,btoa:m,btoaPolyfill:h,fromBase64:I,toBase64:_,encode:_,encodeURI:j,encodeURL:j,utob:O,btou:T,decode:I,isValid:M,fromUint8Array:b,toUint8Array:N,extendString:D,extendUint8Array:B,extendBuiltins: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)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),f=n(4),l=n(3),p=n(12),y=function(){function e(){var t=this;o(this,e),this.name="pv-collector",this.sendPv=function(){var e=(0,l.getCurPage)();if(e){var n=e.route,r=e.__rum_view_id;if(!t.prevPage||n!==t.prevPage.route||r!==t.prevPage.viewId){var o=r?"route_back":"initial_load";r=e.__rum_view_id=(0,f.getViewId)(),t.prevPage={route:n,viewId:r};var i=t.getViewName(n);t.ctx.addView({id:r,name:i}),t.sendEvent({event_type:s.RumEventType.VIEW,type:"pv",url:n,name:i,loading_type:o})}}}}return u(e,[{key:"setup",value:function e(t,n){this.ctx=t,this.sendEvent=n,(0,p.addPageListener)("onShow",this.sendPv)}},{key:"getViewName",value:function e(t){var n,r=this.ctx.getConfig().parseViewName,o=t;return(0,s.isFunction)(r)&&(o=r(t)),o}},{key:"destroy",value:function e(){(0,p.removePageListener)("onShow",this.sendPv)}}])}();t.default=y},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),f=n(2),l=n(3),p=function(){function e(){var t=this;o(this,e),this.name="perf-collector",this.observerHandler=function(e){var n=(0,s.isArray)(e)?e:e.getEntries(),r={view:(0,l.getCurView)(t.ctx)};if(Array.isArray(n)&&0<n.length)for(var o,i=0;i<n.length;i++)if("number"==typeof(o=n[i]).duration)switch(o.name){case"appLaunch":case"app-click":r.launch=o.duration;break;case"firstPaint":r["first-paint"]=o.duration;break;case"firstRender":r.first_render=o.duration;break;case"firstContentfulPaint":r.first_contentful_paint=o.duration;break;case"largestContentfulPaint":r.largest_contentful_paint=o.duration;break;case"resourceTiming":case"resource-timing":r.timing_data=JSON.stringify(o)}Object.keys(r).length}}return u(e,[{key:"setup",value:function e(t,n){var r,o=t.getConfig().collectors,i;if(!1!==(void 0===o?{}:o).perf){this.ctx=t,this.sendEvent=n;var u=(0,f.getPerformance)();u&&u.createObserver&&(this.perfObserver=u.createObserver(this.observerHandler),this.perfObserver.observe({entryTypes:["launch","navigation","render","paint","resource"]}))}}},{key:"destroy",value:function e(){this.perfObserver&&this.perfObserver.disconnect()}}])}();t.default=p},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,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(0),l=n(3),p=function(){function e(){var t=this;o(this,e),this.name="exception-collector",this.origin={app:App,consoleError:console.error},this.errorHandle=function(e){var n,r,o,i,u,a,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",f=(0,l.getCurView)(t.ctx);if(e instanceof Object)n=e.name,r=e.message,o=e.filename||e.fileName,i=e.stack,u=e.lineno||e.lineNumber,a=e.colno||e.columnNumber;else if("string"==typeof e){i=e;var p=t.getErrorByStack(e);p&&(n=p.name,r=p.message)}n&&r&&t.sendEvent({event_type:s.RumEventType.EXCEPTION,source:c,type:"error",name:n,message:r,file:o,stack:i,line:u,column:a,times:1,view:f})}}return u(e,[{key:"setup",value:function e(t,n){this.ctx=t,this.sendEvent=n,this.hackOrigin()}},{key:"hackOrigin",value:function e(){var t=this,n,r=this.ctx.getConfig().collectors,o=void 0===r?{}:r;!1!==o.jsError&&(App=function e(n){n||(n={}),["onError","onUnhandledRejection","onPageNotFound","onLazyLoadError"].forEach((function(e){(0,f.interceptFunction)(n,e,(function(n){n.reason&&n.reason instanceof Error&&(n=n.reason),t.errorHandle(n,e)}))})),t.origin.app(n)}),!1!==o.consoleError&&(0,f.interceptFunction)(console,"error",(function(e){t.errorHandle(e,"console.error")}))}},{key:"getErrorByStack",value:function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",n=t.split("\n");if(!(2>n.length))for(var r=1;r<n.length;r++)if(n[r].trim().startsWith("at ")){var o=n[r-1],i=o.indexOf(": ");return{name:o.substring(0,i),message:o.substring(i+2)}}}},{key:"destroy",value:function e(){var t=this.origin;t.app&&(App=t.app),t.consoleError&&(console.error=t.consoleError)}}])}();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/facebook/regenerator/blob/main/LICENSE */function e(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}function t(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,u=Object.create(o.prototype),a=new v(r||[]);return w(u,"_invoke",{value:f(e,n,a)}),u}function n(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function u(){}function a(){}function c(t){["next","throw","return"].forEach((function(n){e(t,n,(function(e){return this._invoke(n,e)}))}))}function s(e,t){function o(i,u,a,c){var s=n(e[i],e,u);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?t.resolve(l.__await).then((function(e){o("next",e,a,c)}),(function(e){o("throw",e,a,c)})):t.resolve(l).then((function(e){f.value=e,a(f)}),(function(e){return o("throw",e,a,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function e(n,r){function u(){return new t((function(e,t){o(n,r,e,t)}))}return i=i?i.then(u,u):u()}})}function f(e,t,r){var o="suspendedStart";return function(i,u){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw u;return{value:h,done:!0}}for(r.method=i,r.arg=u;;){var a=r.delegate;if(a){var c=l(a,r);if(c){if(c===j)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(e,t,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===j)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(e,t){var r=t.method,o=e.iterator[r];if(o===h)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=h,l(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),j;var i=n(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,j;var u=i.arg;return u?u.done?(t[e.resultName]=u.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=h),t.delegate=null,j):u:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,j)}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function y(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function v(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset(!0)}function d(e){if(e||""===e){var t=e[O];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(b.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=h,t.done=!0,t};return o.next=o}}throw new TypeError(r(e)+" is not iterable")}o=function(){return m};var h,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(e,t,n){e[t]=n.value},S="function"==typeof Symbol?Symbol:{},O=S.iterator||"@@iterator",E=S.asyncIterator||"@@asyncIterator",_=S.toStringTag||"@@toStringTag";try{e({},"")}catch(E){e=function(e,t,n){return e[t]=n}}m.wrap=t;var j={},P={};e(P,O,(function(){return this}));var x=Object.getPrototypeOf,T=x&&x(x(d([])));T&&T!==g&&b.call(T,O)&&(P=T);var C=a.prototype=i.prototype=Object.create(P);return u.prototype=a,w(C,"constructor",{value:a,configurable:!0}),w(a,"constructor",{value:u,configurable:!0}),u.displayName=e(a,_,"GeneratorFunction"),m.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===u||"GeneratorFunction"===(t.displayName||t.name))},m.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,e(t,_,"GeneratorFunction")),t.prototype=Object.create(C),t},m.awrap=function(e){return{__await:e}},c(s.prototype),e(s.prototype,E,(function(){return this})),m.AsyncIterator=s,m.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var u=new s(t(e,n,r,o),i);return m.isGeneratorFunction(n)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},c(C),e(C,_,"Generator"),e(C,O,(function(){return this})),e(C,"toString",(function(){return"[object Generator]"})),m.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},m.values=d,v.prototype={constructor:v,reset:function e(t){if(this.prev=0,this.next=0,this.sent=this._sent=h,this.done=!1,this.delegate=null,this.method="next",this.arg=h,this.tryEntries.forEach(y),!t)for(var n in this)"t"===n.charAt(0)&&b.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=h)},stop:function e(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function e(t){function n(e,n){return u.type="throw",u.arg=t,r.next=e,n&&(r.method="next",r.arg=h),!!n}if(this.done)throw t;for(var r=this,o=this.tryEntries.length-1;0<=o;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=b.call(i,"catchLoc"),c=b.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function e(t,n){for(var r,o=this.tryEntries.length-1;0<=o;--o)if((r=this.tryEntries[o]).tryLoc<=this.prev&&b.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,j):this.complete(u)},complete:function e(t,n){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&&n&&(this.next=n),j},finish:function e(t){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).finallyLoc===t)return this.complete(n.completion,n.afterLoc),y(n),j},catch:function e(t){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc===t){var o=n.completion;if("throw"===o.type){var i=o.arg;y(n)}return i}throw Error("illegal catch attempt")},delegateYield:function e(t,n,r){return this.delegate={iterator:d(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=h),j}},m}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}function a(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=s(e,"string");return"symbol"==r(t)?t:t+""}function s(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var f=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):o(e.value).then(u,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),p=n(2),y=n(32),v=n(5),d=n(3),h=n(4),m=n(33),g=function(){function e(){var t=this;i(this,e),this.name="api-collector",this.origin={request:p.default.request,httpRequest:p.default.httpRequest},this.sendApi=function(e,n,r){return f(t,void 0,void 0,o().mark((function t(){var i,u,a,c,s,f,p,y,d,h,g,b,w;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:if(i=this.ctx.getConfig(),u=i.evaluateApi,a=n.statusCode,c=n.status,s=n.errMsg,f=n.errorMessage,p=n.message,(y=n.profile)&&(d=this.parseProfile(y),h=JSON.stringify(y)),!(0,l.isFunction)(u)){o.next=14;break}return o.prev=4,0===e.success&&(g=new Error("request error")),o.next=8,u(r,n,g);case 8:b=o.sent,e=Object.assign(Object.assign({},e),(0,m.reviseApiAttr)(b)),o.next=14;break;case 12:o.prev=12,o.t0=o.catch(4);case 14:if(!((w=Object.assign(Object.assign(Object.assign({event_type:l.RumEventType.RESOURCE,type:"api",status_code:c||a,message:f||s||p,duration:(0,v.getCurrentTime)()-e.timestamp,times:1},e),d),{timing_data:h})).duration>l.ONE_DAY)){o.next=17;break}return o.abrupt("return");case 17:this.sendEvent(w);case 18:case"end":return o.stop()}}),t,this,[[4,12]])})))}}return a(e,[{key:"setup",value:function e(t,n){var r=this,o,i=t.getConfig().collectors,u;!1===(void 0===i?{}:i).api||(this.ctx=t,this.sendEvent=n,Object.keys(this.origin).forEach((function(e){return r.hackRequest(e)})))}},{key:"injectTracing",value:function e(t,n){var r,o=this.ctx.getConfig(),i=o.tracing,u=o.pid,a=o.version,c=void 0===a?"1.0.0":a,s=(0,l.parseTracingOptions)(i),f=s.enable,y=s.sample,v=s.propagatorTypes,d=s.allowedUrls,m=s.tracestate,g=!(void 0!==m)||m,b=s.baggage,w=void 0!==b&&b;if(f){var S=(0,l.find)(d,(function(e){return(0,l.matchList)([e.match],t.url)}));if(S){var O=S.propagatorTypes;0===O.length&&(O=v);var E=!1;O.includes("sw8")&&(O=["sw8"],E=!0);var _=E?(0,l.generateGUID)():(0,l.generateTraceId)(),j=E?(0,l.generateGUID)():(0,l.generateSpanId)(),P=(0,l.performDraw)(y),x=(0,h.getUserID)(),T=(0,h.getSessionID)(),C=g?"rum=v2&miniapp&".concat(u,"&").concat(T,"&").concat(x):void 0,k=w?"rum=v2,appType=miniapp,pid=".concat(u,",sid=").concat(T,",uid=").concat(x):void 0,A=(0,l.makeTracingHeaders)(_,j,P,O,{tracestate:C,baggage:k,appId:u,appVersion:c,viewName:null===(r=t.view)||void 0===r?void 0:r.name,host:"miniapp_".concat(p.appName)});P&&(t.trace_id=_,t.trace_data=JSON.stringify({spanId:j,sample:y,sampled:P,header:A})),n(A)}}}},{key:"hackRequest",value:function e(t){var n=this;(0,l.isFunction)(p.default[t])&&Object.defineProperty(p.default,t,{configurable:!0,enumerable:!0,writable:!0,value:function e(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return o[0]=n.rebuildRequestOptions(o[0]),n.origin[t].apply(this,o)}})}},{key:"rebuildRequestOptions",value:function e(t){var n=this,r=t.url,o=t.success,i=t.fail,u=(0,v.getCurrentTime)();if((0,y.isEndpoint)(this.ctx,r)||(0,l.urlMatch)(r))return t;var a=Object.assign({},t),c={view:(0,d.getCurView)(this.ctx),timestamp:u,url:r,name:this.getResourceName(r),method:t.method||"GET"};return this.injectTracing(c,(function(e){a.header=Object.assign(Object.assign({},a.header),e)})),a.success=function(){c.success=1;for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];n.sendApi(c,t[0],a),o&&o.apply(this,t)},a.fail=function(){c.success=0;for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];n.sendApi(c,t[0],a),i&&i.apply(this,t)},a}},{key:"getResourceName",value:function e(t){var n,r,o=this.ctx.getConfig().parseResourceName;return n=(0,l.isFunction)(o)?o(t):(0,y.getPathByURL)(t)}},{key:"parseProfile",value:function e(t){function n(e,n){e in t&&0<t[e]&&(o[n]=t[e])}function r(e,n,r){if(e in t&&e in t){var i=t[n]-t[e];0<i&&(o[r]=i)}}var o={};return n("domainLookup","dns_duration"),n("connect","connect_duration"),n("SSLconnection","ssl_duration"),n("Waiting","first_byte_duration"),n("totalTime","duration"),n("receivedBytedCount","size"),r("connectStart","connectEnd","connect_duration"),r("SSLconnectionStart","SSLconnectionEnd","ssl_duration"),r("domainLookUpStart","domainLookUpEnd","dns_duration"),r("redirectStart","redirectEnd","redirect_duration"),r("responseStart","requestStart","first_byte_duration"),r("responseStart","requestEnd","download_duration"),r("redirectStart","responseEnd","duration"),Object.keys(o).forEach((function(e){o[e]>l.ONE_DAY&&delete o[e]})),o}}])}();t.default=g},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(0),f=n(3),l=n(12),p=function(){function e(){var t=this;o(this,e),this.name="action-collector",this.DELAY_TIME=300,this.events=["tap"],this.onEvent=function(e){if(e&&t.events.includes(e.type)&&e.target){var n=e.target,r=e.currentTarget,o=e.type,i=n.dataset,u=n.id;if(!u)return;if(r&&u!==r.id)return;var a=(0,f.getCurView)(t.ctx),c={event_type:s.RumEventType.ACTION,type:o,name:u,snapshots:Object.keys(i).length?JSON.stringify(i):void 0,times:1,view:a};clearTimeout(t.timer),t.lastEvent?t.lastEvent.name===c.name?t.lastEvent.times+=1:t.sendAction():t.lastEvent=c,t.timer=setTimeout(t.sendAction,t.DELAY_TIME)}},this.sendAction=function(){t.sendEvent(t.lastEvent),t.lastEvent=null}}return u(e,[{key:"setup",value:function e(t,n){var r,o=t.getConfig().collectors,i;!1===(void 0===o?{}:o).action||(this.ctx=t,this.sendEvent=n,(0,l.addPageListener)("*",this.onEvent))}},{key:"destroy",value:function e(){(0,l.removePageListener)("*",this.onEvent)}}])}();t.default=p},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,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(4),f=n(5),l=n(3),p=function(){function e(){o(this,e),this.name="default-processor"}return u(e,[{key:"process",value:function e(t){var n=t.getRumEvent(),r=(0,l.getCurView)(t),o;return Object.assign({timestamp:(0,f.getCurrentTime)(),event_id:(0,s.getEventId)(),view:r},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(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(4),f=n(5),l=function(){function e(){o(this,e),this.name="session-processor",this.lastTime=(0,f.getCurrentTime)(),this.sessionOvertime=36e5}return u(e,[{key:"process",value:function e(t){var n=(0,f.getCurrentTime)();return n-this.lastTime>this.sessionOvertime&&(0,s.setSessionID)(),this.lastTime=n,t.getRumEvent()}}])}();t.default=l},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,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=y(t),f(e,p()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function f(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var h=n(0),m=n(4),g=n(2),b=function(e){function t(){var e;return o(this,t),(e=s(this,t,arguments)).name="miniapp-reporter",e}return v(t,e),u(t,[{key:"init",value:function e(){var t=this;g.default.onAppHide((function(){t.flushEventQueue()}))}},{key:"request",value:function(e,t,n){var r=e.getConfig(),o=r.pid,i=r.env,u=r.version,a=r.endpoint,c=r.beforeReport,s=r.user,f=void 0===s?{}:s,l=r.net,p={app:{id:o,env:i,version:u,type:h.AppType.miniapp},user:Object.assign({id:(0,m.getUserID)()},f),session:{id:(0,m.getSessionID)()},view:n,net:l,events:t,_v:g.VERSION};if("function"!=typeof c||(p=c(p)))try{var y;(g.default.request||g.default.httpRequest)({url:a,method:"POST",dataType:"text",data:JSON.stringify(p)})}catch(e){console.warn("[arms] sendRequest fail",e)}}}])}(h.Reporter);t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNetType=void 0;var r=n(2);function o(e){r.default.getNetworkType&&r.default.getNetworkType({success:function t(n){var r=n.networkType;e(r?r.toLowerCase():void 0)}}),r.default.onNetworkStatusChange&&r.default.onNetworkStatusChange((function(t){var n=t.networkType;e(n?n.toLowerCase():void 0)}))}t.getNetType=o}])}));
|
|
1
|
+
!function e(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.RumSDK=n():t.RumSDK=n()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./dist/",n(n.s=13)}([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(17);t.Reporter=a.default;var c=n(19);t.Shell=c.default,o(n(8),t),o(n(20),t),o(n(21),t),o(n(22),t),o(n(6),t),o(n(23),t),o(n(24),t),o(n(10),t),o(n(1),t),o(n(25),t),o(n(11),t),o(n(26),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.isObject=t.isNull=t.isNumber=t.isBoolean=t.isRegExp=t.isArray=t.isToString=t.isString=t.isUndefined=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,"]")}t.isFunction=i,t.isUndefined=function(e){return o(e,"undefined")},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 o(e,"null")},t.isObject=function(e){return!(0,t.isNull)(e)&&o(e,"object")}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o;Object.defineProperty(t,"__esModule",{value:!0}),t.getPerformance=t.setStorageSync=t.getStorageSync=t.appName=t.sdk=t.VERSION=void 0,t.VERSION="0.0.27";var i="object",u="qq",a="bytedance",c="wechat",s="dingtalk",f="alipay",l="swan";function p(){var e,t="unknown";if(("undefined"==typeof qq?"undefined":r(qq))===i)e=qq,t="qq";else if(("undefined"==typeof tt?"undefined":r(tt))===i)e=tt,t="bytedance";else if(("undefined"==typeof wx?"undefined":r(wx))===i)e=wx,t="wechat";else if(("undefined"==typeof dd?"undefined":r(dd))===i)e=dd,t="dingtalk";else if(("undefined"==typeof my?"undefined":r(my))===i)e=my,t="alipay";else{if(("undefined"==typeof swan?"undefined":r(swan))!==i)throw new Error("Current platform is not supported.");e=swan,t="swan"}return{sdk:e,appName:t}}function y(e){return"function"==typeof t.sdk.getStorageSync?"alipay"===t.appName||"dingtalk"===t.appName?t.sdk.getStorageSync({key:e}).data:t.sdk.getStorageSync(e):void 0}function v(e,n){return"function"==typeof t.sdk.setStorageSync?"alipay"===t.appName||"dingtalk"===t.appName?t.sdk.setStorageSync({key:e,data:n}):t.sdk.setStorageSync(e,n):void 0}function d(){return"function"==typeof t.sdk.getPerformance?t.sdk.getPerformance():"performance"in t.sdk?t.sdk.performance:void 0}o=p(),t.sdk=o.sdk,t.appName=o.appName,t.getStorageSync=y,t.setStorageSync=v,t.getPerformance=d,t.default=t.sdk},function(e,t,n){"use strict";function r(){if("function"==typeof getCurrentPages)try{var e=getCurrentPages()||[];return e[e.length-1]}catch(e){console.warn("[arms] error in getCurView",e)}}function o(e){if(e){var t=e.getViews();if(t&&t.length)return t[t.length-1]}}Object.defineProperty(t,"__esModule",{value:!0}),t.getCurView=t.getCurPage=void 0,t.getCurPage=r,t.getCurView=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getViewId=t.getEventId=t.getUserID=t.setSessionID=t.getSessionID=void 0;var r=n(2),o=n(0),i=n(5),u="_arms_sid",a="_arms_sid_exp",c="_arms_uid";function s(){var e=(0,r.getStorageSync)(u),t=parseInt((0,r.getStorageSync)(a)),n=(0,i.getCurrentTime)();return(!e||32>e.length||!t.valueOf()||t<n)&&(e=f()),e}function f(){var e=(0,o.generateGUID)().replace(/-/g,"");(0,r.setStorageSync)(u,e);var t=(0,i.getCurrentTime)()+o.ONE_DAY;return(0,r.setStorageSync)(a,t.toString()),e}function l(){var e=(0,r.getStorageSync)(c);return e&&0===e.indexOf("user_")&&(e=""),e||(e="uid_".concat((0,o.generateSpanId)(16,36)),(0,r.setStorageSync)(c,e)),e}function p(){var e=s();return(0,o.generateEventId)(e)}function y(){return(0,o.generateGUID)().replace(/-/g,"")}(0,r.setStorageSync)(u,void 0),(0,r.setStorageSync)(a,void 0),t.getSessionID=s,t.setSessionID=f,t.getUserID=l,t.getEventId=p,t.getViewId=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentTime=t.formatNumber=void 0;var r=n(2);function o(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:3;if(!e)return e;var n=e.toString(),r=n.indexOf(".");return n=-1===r?n.substring(0):n.substring(0,t+r+1),parseFloat(n)}function i(e){var t=(0,r.getPerformance)(),n=0;return t&&t.timeOrigin&&t.now&&(n=Math.round(t.timeOrigin+(e||t.now()))),1e12>n&&(n=(new Date).getTime()),n}t.formatNumber=o,t.getCurrentTime=i},function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.AppType=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"}(r=t.RumEventType||(t.RumEventType={})),function(e){e.browser="browser",e.miniapp="miniapp"}(o=t.AppType||(t.AppType={}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=i(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function e(){};return{s:o,n:function t(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=!0,a=!1,c;return{s:function t(){n=n.call(e)},n:function e(){var t=n.next();return u=t.done,t},e:function e(t){a=!0,c=t},f:function e(){try{u||null==n.return||n.return()}finally{if(a)throw c}}}}function i(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.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=new 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),y=n(16),v=n(9),d=n(1),h=function(){function e(){var t=this;a(this,e),this.emitter=new y.EventEmitter,this.sendEvent=function(e){t.emitter.emit(p.EventType.collect,e)}}return s(e,[{key:"init",value:function e(t,n){var r=this;this.ctx=new v.default(t,n);var i=this.ctx,u=this.collectors,a=this.processors,c=this.reporter;a.forEach((function(e){(0,d.isFunction)(e.setup)&&e.setup(i)})),this.emitter.on(p.EventType.collect,(function(e){i.setRumEvent(e);var t=o(a),n;try{for(t.s();!(n=t.n()).done;){var r=n.value;if(r.match||(r.match=function(){return!0}),r.match(i)){var u=r.process(i);u&&i.setRumEvent(u)}}}catch(e){t.e(e)}finally{t.f()}c.report(i)})),u.forEach((function(e){e.setup(i,r.sendEvent)}))}},{key:"setContext",value:function e(t){this.ctx=t}},{key:"getContext",value:function e(){return this.ctx}},{key:"useCollectors",value:function e(t){this.collectors=t}},{key:"useProcessors",value:function e(t){this.processors=t}},{key:"useReporter",value:function e(t){this.reporter=t}}])}();t.default=h},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.EventType=void 0,function(e){e.collect="collect"}(r=t.EventType||(t.EventType={}))},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(t,n){o(this,e),this.config=t,this.views=[],n&&(this.session=n,this.session.init(t))}return u(e,[{key:"getConfig",value:function e(){return this.config}},{key:"setConfig",value:function e(t){this.config=t}},{key:"getViews",value:function e(){return this.views}},{key:"addView",value:function e(t){this.views.push(t)}},{key:"removeView",value:function e(t){this.views=this.views.filter((function(e){return e.id!==t}))}},{key:"getRumEvent",value:function e(){return this.rumEvent}},{key:"setRumEvent",value:function e(t){this.rumEvent=t}}])}();t.default=s},function(e,t,n){"use strict";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=Object.prototype.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=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.urlMatch=t.matchList=t.isMatchOption=void 0;var s=n(1),f=n(10);function l(e){return(0,s.isString)(e)||(0,s.isFunction)(e)||(0,s.isRegExp)(e)}function p(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e.some((function(e){try{if("function"==typeof e)return e(t);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{var n=[/https?:\/\/.*rum|retcode\.aliyuncs\.com/,/https?:\/\/.*log-global\.aliyuncs\.com/,/https?:\/\/.*\.mmstat\.com/].concat(r(t));return p(n,e)}catch(e){return!1}}t.isMatchOption=l,t.matchList=p,t.urlMatch=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removePageListener=t.addPageListener=t.originalComponent=t.originalPage=void 0;var r=n(0),o={onShow:[]};function i(e){Object.keys(o).forEach((function(t){var n=o[t];(0,r.interceptFunction)(e,t,(function(){for(var e=this,t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];n.forEach((function(t){t.apply(e,r)}))}))}))}function u(e,t){e in o||(o[e]=[]),o[e].push(t)}function a(e,t){if(e in o){var n=o[e],r=n.indexOf(t);n.splice(r,1)}}t.originalPage=Page,t.originalComponent=Component,Page=function e(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];try{i.apply(this,r)}catch(n){}return t.originalPage.apply(this,r)},Component=function e(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];try{var u=r[0]||{};u.methods||(u.methods={}),i.call(this,u.methods)}catch(n){}return t.originalComponent.apply(this,r)},t.addPageListener=u,t.removePageListener=a},function(e,t,n){e.exports=n(14)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArmsRum=void 0;var r=n(15);Object.defineProperty(t,"ArmsRum",{enumerable:!0,get:function e(){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=v(t),l(e,y()?Reflect.construct(t,n||[],v(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 y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}function v(e){return(v=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&&h(e,t)}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ArmsRum=void 0;var m=n(0),g=n(28),b=n(29),w=n(30),S=n(31),O=n(34),E=n(35),_=n(36),j=n(37),P=n(38),x=n(2),T=function(e){function t(){var e;return i(this,t),(e=f(this,t,arguments)).version=x.VERSION,e.updateNetType=function(t){var n,r=e.getConfig().net,o=void 0===r?{}:r;e.setConfig("net",Object.assign(Object.assign({},o),{type:t}))},e}return d(t,e),a(t,[{key:"init",value:function e(t){this.client.useCollectors([new g.default,new b.default,new w.default,new S.default,new O.default]),this.client.useProcessors([new E.default,new _.default]),this.client.useReporter(new j.default),this.client.init(t),(0,P.getNetType)(this.updateNetType)}},{key:"setConfig",value:function e(){var t=this.client.getContext();if(2===arguments.length){var n=this.client.getContext(),r=n.getConfig();n.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])}}])}(m.Shell);t.ArmsRum=T,t.default=new T},function(e,t,n){"use strict";var r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function e(t,n,r){return Function.prototype.apply.call(t,n,r)},i;function u(e){console&&console.warn&&console.warn(e)}i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function e(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function e(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function e(t){return t!=t};function c(){c.init.call(this)}e.exports=c,e.exports.once=w,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var s=10;function f(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function p(e,t,n,r){var o,i,a;if(f(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=l(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,u(c)}return e}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function v(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=y.bind(r);return o.listener=n,r.wrapFn=o,o}function d(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?b(o):m(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function b(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function w(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}O(e,t,i,{once:!0}),"error"!==t&&S(e,o,{once:!0})}))}function S(e,t,n){"function"==typeof e.on&&O(e,"error",t,n)}function O(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),c.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function e(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},c.prototype.getMaxListeners=function e(){return l(this)},c.prototype.emit=function e(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i="error"===t,u=this._events;if(void 0!==u)i=i&&void 0===u.error;else if(!i)return!1;if(i){var a;if(n.length>0&&(a=n[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var s=u[t];if(void 0===s)return!1;if("function"==typeof s)o(s,this,n);else for(var f=s.length,l=m(s,f),r=0;r<f;++r)o(l[r],this,n);return!0},c.prototype.addListener=function e(t,n){return p(this,t,n,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function e(t,n){return p(this,t,n,!0)},c.prototype.once=function e(t,n){return f(n),this.on(t,v(this,t,n)),this},c.prototype.prependOnceListener=function e(t,n){return f(n),this.prependListener(t,v(this,t,n)),this},c.prototype.removeListener=function e(t,n){var r,o,i,u,a;if(f(n),void 0===(o=this._events))return this;if(void 0===(r=o[t]))return this;if(r===n||r.listener===n)0==--this._eventsCount?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,r.listener||n));else if("function"!=typeof r){for(i=-1,u=r.length-1;u>=0;u--)if(r[u]===n||r[u].listener===n){a=r[u].listener,i=u;break}if(i<0)return this;0===i?r.shift():g(r,i),1===r.length&&(o[t]=r[0]),void 0!==o.removeListener&&this.emit("removeListener",t,a||n)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function e(t){var n,r,o;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i=Object.keys(r),u;for(o=0;o<i.length;++o)"removeListener"!==(u=i[o])&&this.removeAllListeners(u);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(n=r[t]))this.removeListener(t,n);else if(void 0!==n)for(o=n.length-1;o>=0;o--)this.removeListener(t,n[o]);return this},c.prototype.listeners=function e(t){return d(this,t,!0)},c.prototype.rawListeners=function e(t){return d(this,t,!1)},c.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},c.prototype.listenerCount=h,c.prototype.eventNames=function e(){return this._eventsCount>0?i(this._events):[]}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(6),f=n(18),l=n(1),p=3e3,y=20,v=function(){function e(){o(this,e),this.name="reporter",this.eventQueue=[]}return u(e,[{key:"getReportCfg",value:function e(){var t=this.ctx.getConfig().reportConfig;return(0,l.isObject)(t)||(t={}),(!t.flushTime||t.flushTime<0||t.flushTime>1e4)&&(t.flushTime=3e3),(!t.maxEventCount||t.maxEventCount<1||t.maxEventCount>100)&&(t.maxEventCount=20),t}},{key:"report",value:function e(t){var n=this;this.ctx=t,this.init(t),clearTimeout(this.timer),this.pushToQueue();var r=this.getReportCfg();this.eventQueue.length>=r.maxEventCount?this.flushEventQueue():this.timer=setTimeout((function(){n.flushEventQueue()}),r.flushTime)}},{key:"pushToQueue",value:function e(){var t=this.ctx,n=this.eventQueue,r=t.getRumEvent();if(r.event_type===s.RumEventType.EXCEPTION){var o=r.message,i=r.stack,u=(0,f.getErrorID)({message:o,stack:i}),a=this.eventQueue.find((function(e){if(e.event_type===s.RumEventType.EXCEPTION){var t=e.message,n=e.stack;return(0,f.getErrorID)({message:t,stack:n})===u}}));if(a)return void a.times++}if(r.event_type===s.RumEventType.ACTION){var c=r.target_name,l=this.eventQueue.find((function(e){if(e.event_type===s.RumEventType.ACTION)return c===e.target_name}));if(l)return void l.times++}n.push(r)}},{key:"flushEventQueue",value:function e(){var t=this.ctx,n=this.eventQueue;if(n.length){var r=t.getViews(),o=r[r.length-1];r.forEach((function(e){var t;e.id===o.id&&n.filter((function(t){var n;return(null===(n=t.view)||void 0===n?void 0:n.id)===e.id})).forEach((function(e){delete e.view}))}));var i=t.session,u;(!i||i.getSampled())&&this.request(t,n,o),this.eventQueue=[]}}},{key:"init",value:function e(t){}}])}();t.default=v},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(6),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:"sendException",value:function e(t){if(t.name&&t.message){var n=Object.assign(Object.assign({times:1},t),{event_type:s.RumEventType.EXCEPTION,type:"custom",source:"custom"});this.sendEvent(n)}}},{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";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}),t.delay=t.debounce=t.generateEventId=t.generateSpanId=t.generateTraceId=t.generateGUID=t.interceptFunction=void 0;var r=n(1);function o(e,t,n){var r=e[t];e[t]=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];if(n.apply(this,t),r)return r.apply(this,t)}}function i(){var e="";try{if(crypto&&crypto.randomUUID)e=crypto.randomUUID();else if(crypto&&crypto.getRandomValues){var t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128,e=t.reduce((function(e,t){return e+t.toString(16).padStart(2,"0")}),"").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/,"$1-$2-$3-$4-$5")}}catch(e){}return e||(e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0,n;return("x"==e?t:3&t|8).toString(16)}))),e}function u(){var e=i().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 a(){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 c(e){var t=a();return"00-".concat(e,"-").concat(t)}function s(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 f(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))}}t.interceptFunction=o,t.generateGUID=i,t.generateTraceId=u,t.generateSpanId=a,t.generateEventId=c,t.debounce=s,t.delay=f},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(11),o=n(1),i=n(27);function u(e){return e&&(0,r.isMatchOption)(e.match)&&(0,o.isArray)(e.propagatorTypes)}function a(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},u={},a=n?"1":"0";return r.includes("sw8")&&(r=["sw8"]),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":var r=String((0,i.encode)(e)),c=String((0,i.encode)(t)),s=String((0,i.encode)(o.appId)),f=String((0,i.encode)(o.appVersion)),l=String((0,i.encode)(o.viewName)),p=String((0,i.encode)(o.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),o.tracestate&&(u.tracestate=o.tracestate)}})),o.baggage&&(u.baggage=o.baggage),u}function c(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,i=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,y=e.tracestate,v=void 0===y||y,d=e.baggage,h=void 0!==d&&d,m=[];return(0,o.isArray)(p)&&p.length&&p.forEach((function(e){(0,r.isMatchOption)(e)?m.push({match:e,propagatorTypes:f}):u(e)&&m.push(e)})),{enable:!(0,o.isBoolean)(i)||i,sample:(0,o.isNumber)(c)?c:100,propagatorTypes:f,allowedUrls:m,tracestate:v,baggage:h}}t.isTraceOption=u,t.makeTracingHeaders=a,t.parseTracingOptions=c},function(e,t,n){"use strict";n.r(t),n.d(t,"version",(function(){return r})),n.d(t,"VERSION",(function(){return o})),n.d(t,"atob",(function(){return k})),n.d(t,"atobPolyfill",(function(){return C})),n.d(t,"btoa",(function(){return m})),n.d(t,"btoaPolyfill",(function(){return h})),n.d(t,"fromBase64",(function(){return I})),n.d(t,"toBase64",(function(){return _})),n.d(t,"utob",(function(){return O})),n.d(t,"encode",(function(){return _})),n.d(t,"encodeURI",(function(){return j})),n.d(t,"encodeURL",(function(){return j})),n.d(t,"btou",(function(){return T})),n.d(t,"decode",(function(){return I})),n.d(t,"isValid",(function(){return M})),n.d(t,"fromUint8Array",(function(){return b})),n.d(t,"toUint8Array",(function(){return N})),n.d(t,"extendString",(function(){return D})),n.d(t,"extendUint8Array",(function(){return B})),n.d(t,"extendBuiltins",(function(){return F})),n.d(t,"Base64",(function(){return V}));const r="3.7.7",o=r,i="function"==typeof Buffer,u="function"==typeof TextDecoder?new TextDecoder:void 0,a="function"==typeof TextEncoder?new TextEncoder:void 0,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(c),f=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(s),l=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,p=String.fromCharCode.bind(String),y="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),v=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),d=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),h=e=>{let t,n,r,o,i="";const u=e.length%3;for(let u=0;u<e.length;){if((n=e.charCodeAt(u++))>255||(r=e.charCodeAt(u++))>255||(o=e.charCodeAt(u++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|o,i+=s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}return u?i.slice(0,u-3)+"===".substring(u):i},m="function"==typeof btoa?e=>btoa(e):i?e=>Buffer.from(e,"binary").toString("base64"):h,g=i?e=>Buffer.from(e).toString("base64"):e=>{const t=4096;let n=[];for(let t=0,r=e.length;t<r;t+=4096)n.push(p.apply(null,e.subarray(t,t+4096)));return m(n.join(""))},b=(e,t=!1)=>t?v(g(e)):g(e),w=e=>{var t;if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?p(192|t>>>6)+p(128|63&t):p(224|t>>>12&15)+p(128|t>>>6&63)+p(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return p(240|t>>>18&7)+p(128|t>>>12&63)+p(128|t>>>6&63)+p(128|63&t)},S=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,O=e=>e.replace(S,w),E=i?e=>Buffer.from(e,"utf8").toString("base64"):a?e=>g(a.encode(e)):e=>m(O(e)),_=(e,t=!1)=>t?v(E(e)):E(e),j=e=>_(e,!0),P=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=e=>{switch(e.length){case 4:var t,n=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return p(55296+(n>>>10))+p(56320+(1023&n));case 3:return p((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return p((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},T=e=>e.replace(P,x),C=e=>{if(e=e.replace(/\s+/g,""),!l.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n="",r,o;for(let i=0;i<e.length;)t=f[e.charAt(i++)]<<18|f[e.charAt(i++)]<<12|(r=f[e.charAt(i++)])<<6|(o=f[e.charAt(i++)]),n+=64===r?p(t>>16&255):64===o?p(t>>16&255,t>>8&255):p(t>>16&255,t>>8&255,255&t);return n},k="function"==typeof atob?e=>atob(d(e)):i?e=>Buffer.from(e,"base64").toString("binary"):C,A=i?e=>y(Buffer.from(e,"base64")):e=>y(k(e).split("").map(e=>e.charCodeAt(0))),N=e=>A(R(e)),L=i?e=>Buffer.from(e,"base64").toString("utf8"):u?e=>u.decode(A(e)):e=>T(k(e)),R=e=>d(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),I=e=>L(R(e)),M=e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},U=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),D=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,U(t));e("fromBase64",(function(){return I(this)})),e("toBase64",(function(e){return _(this,e)})),e("toBase64URI",(function(){return _(this,!0)})),e("toBase64URL",(function(){return _(this,!0)})),e("toUint8Array",(function(){return N(this)}))},B=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,U(t));e("toBase64",(function(e){return b(this,e)})),e("toBase64URI",(function(){return b(this,!0)})),e("toBase64URL",(function(){return b(this,!0)}))},F=()=>{D(),B()},V={version:r,VERSION:o,atob:k,atobPolyfill:C,btoa:m,btoaPolyfill:h,fromBase64:I,toBase64:_,encode:_,encodeURI:j,encodeURL:j,utob:O,btou:T,decode:I,isValid:M,fromUint8Array:b,toUint8Array:N,extendString:D,extendUint8Array:B,extendBuiltins: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)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),f=n(4),l=n(3),p=n(12),y=function(){function e(){var t=this;o(this,e),this.name="pv-collector",this.sendPv=function(){var e=(0,l.getCurPage)();if(e){var n=e.route,r=e.__rum_view_id;if(!t.prevPage||n!==t.prevPage.route||r!==t.prevPage.viewId){var o=r?"route_back":"initial_load";r=e.__rum_view_id=(0,f.getViewId)(),t.prevPage={route:n,viewId:r};var i=t.getViewName(n);t.ctx.addView({id:r,name:i}),t.sendEvent({event_type:s.RumEventType.VIEW,type:"pv",url:n,name:i,loading_type:o})}}}}return u(e,[{key:"setup",value:function e(t,n){this.ctx=t,this.sendEvent=n,(0,p.addPageListener)("onShow",this.sendPv)}},{key:"getViewName",value:function e(t){var n,r=this.ctx.getConfig().parseViewName,o=t;return(0,s.isFunction)(r)&&(o=r(t)),o}},{key:"destroy",value:function e(){(0,p.removePageListener)("onShow",this.sendPv)}}])}();t.default=y},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),f=n(2),l=n(3),p=function(){function e(){var t=this;o(this,e),this.name="perf-collector",this.observerHandler=function(e){var n=(0,s.isArray)(e)?e:e.getEntries(),r={view:(0,l.getCurView)(t.ctx)};if(Array.isArray(n)&&0<n.length)for(var o,i=0;i<n.length;i++)if("number"==typeof(o=n[i]).duration)switch(o.name){case"appLaunch":case"app-click":r.launch=o.duration;break;case"firstPaint":r["first-paint"]=o.duration;break;case"firstRender":r.first_render=o.duration;break;case"firstContentfulPaint":r.first_contentful_paint=o.duration;break;case"largestContentfulPaint":r.largest_contentful_paint=o.duration;break;case"resourceTiming":case"resource-timing":r.timing_data=JSON.stringify(o)}Object.keys(r).length}}return u(e,[{key:"setup",value:function e(t,n){var r,o=t.getConfig().collectors,i;if(!1!==(void 0===o?{}:o).perf){this.ctx=t,this.sendEvent=n;var u=(0,f.getPerformance)();u&&u.createObserver&&(this.perfObserver=u.createObserver(this.observerHandler),this.perfObserver.observe({entryTypes:["launch","navigation","render","paint","resource"]}))}}},{key:"destroy",value:function e(){this.perfObserver&&this.perfObserver.disconnect()}}])}();t.default=p},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,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(0),l=n(3),p=function(){function e(){var t=this;o(this,e),this.name="exception-collector",this.origin={app:App,consoleError:console.error},this.errorHandle=function(e){var n,r,o,i,u,a,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",f=(0,l.getCurView)(t.ctx);if(e instanceof Object)n=e.name,r=e.message,o=e.filename||e.fileName,i=e.stack,u=e.lineno||e.lineNumber,a=e.colno||e.columnNumber;else if("string"==typeof e){i=e;var p=t.getErrorByStack(e);p&&(n=p.name,r=p.message)}n&&r&&t.sendEvent({event_type:s.RumEventType.EXCEPTION,source:c,type:"error",name:n,message:r,file:o,stack:i,line:u,column:a,times:1,view:f})}}return u(e,[{key:"setup",value:function e(t,n){this.ctx=t,this.sendEvent=n,this.hackOrigin()}},{key:"hackOrigin",value:function e(){var t=this,n,r=this.ctx.getConfig().collectors,o=void 0===r?{}:r;!1!==o.jsError&&(App=function e(n){n||(n={}),["onError","onUnhandledRejection","onPageNotFound","onLazyLoadError"].forEach((function(e){(0,f.interceptFunction)(n,e,(function(n){n.reason&&n.reason instanceof Error&&(n=n.reason),t.errorHandle(n,e)}))})),t.origin.app(n)}),!1!==o.consoleError&&(0,f.interceptFunction)(console,"error",(function(e){t.errorHandle(e,"console.error")}))}},{key:"getErrorByStack",value:function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",n=t.split("\n");if(!(2>n.length))for(var r=1;r<n.length;r++)if(n[r].trim().startsWith("at ")){var o=n[r-1],i=o.indexOf(": ");return{name:o.substring(0,i),message:o.substring(i+2)}}}},{key:"destroy",value:function e(){var t=this.origin;t.app&&(App=t.app),t.consoleError&&(console.error=t.consoleError)}}])}();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/facebook/regenerator/blob/main/LICENSE */function e(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}function t(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,u=Object.create(o.prototype),a=new v(r||[]);return w(u,"_invoke",{value:f(e,n,a)}),u}function n(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function u(){}function a(){}function c(t){["next","throw","return"].forEach((function(n){e(t,n,(function(e){return this._invoke(n,e)}))}))}function s(e,t){function o(i,u,a,c){var s=n(e[i],e,u);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?t.resolve(l.__await).then((function(e){o("next",e,a,c)}),(function(e){o("throw",e,a,c)})):t.resolve(l).then((function(e){f.value=e,a(f)}),(function(e){return o("throw",e,a,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function e(n,r){function u(){return new t((function(e,t){o(n,r,e,t)}))}return i=i?i.then(u,u):u()}})}function f(e,t,r){var o="suspendedStart";return function(i,u){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw u;return{value:h,done:!0}}for(r.method=i,r.arg=u;;){var a=r.delegate;if(a){var c=l(a,r);if(c){if(c===j)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(e,t,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===j)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(e,t){var r=t.method,o=e.iterator[r];if(o===h)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=h,l(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),j;var i=n(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,j;var u=i.arg;return u?u.done?(t[e.resultName]=u.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=h),t.delegate=null,j):u:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,j)}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function y(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function v(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset(!0)}function d(e){if(e||""===e){var t=e[O];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(b.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=h,t.done=!0,t};return o.next=o}}throw new TypeError(r(e)+" is not iterable")}o=function(){return m};var h,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(e,t,n){e[t]=n.value},S="function"==typeof Symbol?Symbol:{},O=S.iterator||"@@iterator",E=S.asyncIterator||"@@asyncIterator",_=S.toStringTag||"@@toStringTag";try{e({},"")}catch(E){e=function(e,t,n){return e[t]=n}}m.wrap=t;var j={},P={};e(P,O,(function(){return this}));var x=Object.getPrototypeOf,T=x&&x(x(d([])));T&&T!==g&&b.call(T,O)&&(P=T);var C=a.prototype=i.prototype=Object.create(P);return u.prototype=a,w(C,"constructor",{value:a,configurable:!0}),w(a,"constructor",{value:u,configurable:!0}),u.displayName=e(a,_,"GeneratorFunction"),m.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===u||"GeneratorFunction"===(t.displayName||t.name))},m.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,e(t,_,"GeneratorFunction")),t.prototype=Object.create(C),t},m.awrap=function(e){return{__await:e}},c(s.prototype),e(s.prototype,E,(function(){return this})),m.AsyncIterator=s,m.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var u=new s(t(e,n,r,o),i);return m.isGeneratorFunction(n)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},c(C),e(C,_,"Generator"),e(C,O,(function(){return this})),e(C,"toString",(function(){return"[object Generator]"})),m.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},m.values=d,v.prototype={constructor:v,reset:function e(t){if(this.prev=0,this.next=0,this.sent=this._sent=h,this.done=!1,this.delegate=null,this.method="next",this.arg=h,this.tryEntries.forEach(y),!t)for(var n in this)"t"===n.charAt(0)&&b.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=h)},stop:function e(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function e(t){function n(e,n){return u.type="throw",u.arg=t,r.next=e,n&&(r.method="next",r.arg=h),!!n}if(this.done)throw t;for(var r=this,o=this.tryEntries.length-1;0<=o;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=b.call(i,"catchLoc"),c=b.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function e(t,n){for(var r,o=this.tryEntries.length-1;0<=o;--o)if((r=this.tryEntries[o]).tryLoc<=this.prev&&b.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=n,i?(this.method="next",this.next=i.finallyLoc,j):this.complete(u)},complete:function e(t,n){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&&n&&(this.next=n),j},finish:function e(t){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).finallyLoc===t)return this.complete(n.completion,n.afterLoc),y(n),j},catch:function e(t){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc===t){var o=n.completion;if("throw"===o.type){var i=o.arg;y(n)}return i}throw Error("illegal catch attempt")},delegateYield:function e(t,n,r){return this.delegate={iterator:d(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=h),j}},m}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}function a(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=s(e,"string");return"symbol"==r(t)?t:t+""}function s(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var f=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):o(e.value).then(u,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),p=n(2),y=n(32),v=n(5),d=n(3),h=n(4),m=n(33),g=function(){function e(){var t=this;i(this,e),this.name="api-collector",this.origin={request:p.default.request,httpRequest:p.default.httpRequest},this.sendApi=function(e,n,r){return f(t,void 0,void 0,o().mark((function t(){var i,u,a,c,s,f,p,y,d,h,g,b,w;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:if(i=this.ctx.getConfig(),u=i.evaluateApi,a=n.statusCode,c=n.status,s=n.errMsg,f=n.errorMessage,p=n.message,(y=n.profile)&&(d=this.parseProfile(y),h=JSON.stringify(y)),!(0,l.isFunction)(u)){o.next=14;break}return o.prev=4,0===e.success&&(g=new Error("request error")),o.next=8,u(r,n,g);case 8:b=o.sent,e=Object.assign(Object.assign({},e),(0,m.reviseApiAttr)(b)),o.next=14;break;case 12:o.prev=12,o.t0=o.catch(4);case 14:if(!((w=Object.assign(Object.assign(Object.assign({event_type:l.RumEventType.RESOURCE,type:"api",status_code:c||a,message:f||s||p,duration:(0,v.getCurrentTime)()-e.timestamp,times:1},e),d),{timing_data:h})).duration>l.ONE_DAY)){o.next=17;break}return o.abrupt("return");case 17:this.sendEvent(w);case 18:case"end":return o.stop()}}),t,this,[[4,12]])})))}}return a(e,[{key:"setup",value:function e(t,n){var r=this,o,i=t.getConfig().collectors,u;!1===(void 0===i?{}:i).api||(this.ctx=t,this.sendEvent=n,Object.keys(this.origin).forEach((function(e){return r.hackRequest(e)})))}},{key:"injectTracing",value:function e(t,n){var r,o=this.ctx.getConfig(),i=o.tracing,u=o.pid,a=o.version,c=void 0===a?"1.0.0":a,s=(0,l.parseTracingOptions)(i),f=s.enable,y=s.sample,v=s.propagatorTypes,d=s.allowedUrls,m=s.tracestate,g=!(void 0!==m)||m,b=s.baggage,w=void 0!==b&&b;if(f){var S=(0,l.find)(d,(function(e){return(0,l.matchList)([e.match],t.url)}));if(S){var O=S.propagatorTypes;0===O.length&&(O=v);var E=!1;O.includes("sw8")&&(O=["sw8"],E=!0);var _=E?(0,l.generateGUID)():(0,l.generateTraceId)(),j=E?(0,l.generateGUID)():(0,l.generateSpanId)(),P=(0,l.performDraw)(y),x=(0,h.getUserID)(),T=(0,h.getSessionID)(),C=g?"rum=v2&miniapp&".concat(u,"&").concat(T,"&").concat(x):void 0,k=w?"rum=v2,appType=miniapp,pid=".concat(u,",sid=").concat(T,",uid=").concat(x):void 0,A=(0,l.makeTracingHeaders)(_,j,P,O,{tracestate:C,baggage:k,appId:u,appVersion:c,viewName:null===(r=t.view)||void 0===r?void 0:r.name,host:"miniapp_".concat(p.appName)});P&&(t.trace_id=_,t.trace_data=JSON.stringify({spanId:j,sample:y,sampled:P,header:A})),n(A)}}}},{key:"hackRequest",value:function e(t){var n=this;(0,l.isFunction)(p.default[t])&&Object.defineProperty(p.default,t,{configurable:!0,enumerable:!0,writable:!0,value:function e(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return o[0]=n.rebuildRequestOptions(o[0]),n.origin[t].apply(this,o)}})}},{key:"rebuildRequestOptions",value:function e(t){var n=this,r=t.url,o=t.success,i=t.fail,u=(0,v.getCurrentTime)();if((0,y.isEndpoint)(this.ctx,r)||(0,l.urlMatch)(r))return t;var a=Object.assign({},t),c={view:(0,d.getCurView)(this.ctx),timestamp:u,url:r,name:this.getResourceName(r),method:t.method||"GET"};return this.injectTracing(c,(function(e){a.header=Object.assign(Object.assign({},a.header),e)})),a.success=function(){c.success=1;for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];n.sendApi(c,t[0],a),o&&o.apply(this,t)},a.fail=function(){c.success=0;for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];n.sendApi(c,t[0],a),i&&i.apply(this,t)},a}},{key:"getResourceName",value:function e(t){var n,r,o=this.ctx.getConfig().parseResourceName;return n=(0,l.isFunction)(o)?o(t):(0,y.getPathByURL)(t)}},{key:"parseProfile",value:function e(t){function n(e,n){e in t&&0<t[e]&&(o[n]=t[e])}function r(e,n,r){if(e in t&&e in t){var i=t[n]-t[e];0<i&&(o[r]=i)}}var o={};return n("domainLookup","dns_duration"),n("connect","connect_duration"),n("SSLconnection","ssl_duration"),n("Waiting","first_byte_duration"),n("totalTime","duration"),n("receivedBytedCount","size"),r("connectStart","connectEnd","connect_duration"),r("SSLconnectionStart","SSLconnectionEnd","ssl_duration"),r("domainLookUpStart","domainLookUpEnd","dns_duration"),r("redirectStart","redirectEnd","redirect_duration"),r("responseStart","requestStart","first_byte_duration"),r("responseStart","requestEnd","download_duration"),r("redirectStart","responseEnd","duration"),Object.keys(o).forEach((function(e){o[e]>l.ONE_DAY&&delete o[e]})),o}}])}();t.default=g},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(0),f=n(3),l=n(12),p=function(){function e(){var t=this;o(this,e),this.name="action-collector",this.DELAY_TIME=300,this.events=["tap"],this.onEvent=function(e){if(e&&t.events.includes(e.type)&&e.target){var n=e.target,r=e.currentTarget,o=e.type,i=n.dataset,u=n.id;if(!u)return;if(r&&u!==r.id)return;var a=(0,f.getCurView)(t.ctx),c={event_type:s.RumEventType.ACTION,type:o,name:u,snapshots:Object.keys(i).length?JSON.stringify(i):void 0,times:1,view:a};clearTimeout(t.timer),t.lastEvent?t.lastEvent.name===c.name?t.lastEvent.times+=1:t.sendAction():t.lastEvent=c,t.timer=setTimeout(t.sendAction,t.DELAY_TIME)}},this.sendAction=function(){t.sendEvent(t.lastEvent),t.lastEvent=null}}return u(e,[{key:"setup",value:function e(t,n){var r,o=t.getConfig().collectors,i;!1===(void 0===o?{}:o).action||(this.ctx=t,this.sendEvent=n,(0,l.addPageListener)("*",this.onEvent))}},{key:"destroy",value:function e(){(0,l.removePageListener)("*",this.onEvent)}}])}();t.default=p},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,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(4),f=n(5),l=n(3),p=function(){function e(){o(this,e),this.name="default-processor"}return u(e,[{key:"process",value:function e(t){var n=t.getRumEvent(),r=(0,l.getCurView)(t),o;return Object.assign({timestamp:(0,f.getCurrentTime)(),event_id:(0,s.getEventId)(),view:r},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(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(4),f=n(5),l=function(){function e(){o(this,e),this.name="session-processor",this.lastTime=(0,f.getCurrentTime)(),this.sessionOvertime=36e5}return u(e,[{key:"process",value:function e(t){var n=(0,f.getCurrentTime)();return n-this.lastTime>this.sessionOvertime&&(0,s.setSessionID)(),this.lastTime=n,t.getRumEvent()}}])}();t.default=l},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,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=y(t),f(e,p()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function f(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var h=n(0),m=n(4),g=n(2),b=function(e){function t(){var e;return o(this,t),(e=s(this,t,arguments)).name="miniapp-reporter",e}return v(t,e),u(t,[{key:"init",value:function e(){var t=this;g.default.onAppHide((function(){t.flushEventQueue()}))}},{key:"request",value:function(e,t,n){var r=e.getConfig(),o=r.pid,i=r.env,u=r.version,a=r.endpoint,c=r.beforeReport,s=r.user,f=void 0===s?{}:s,l=r.net,p={app:{id:o,env:i,version:u,type:h.AppType.miniapp},user:Object.assign({id:(0,m.getUserID)()},f),session:{id:(0,m.getSessionID)()},view:n,net:l,events:t,_v:g.VERSION};if("function"!=typeof c||(p=c(p)))try{var y;(g.default.request||g.default.httpRequest)({url:a,method:"POST",dataType:"text",data:JSON.stringify(p)})}catch(e){console.warn("[arms] sendRequest fail",e)}}}])}(h.Reporter);t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNetType=void 0;var r=n(2);function o(e){r.default.getNetworkType&&r.default.getNetworkType({success:function t(n){var r=n.networkType;e(r?r.toLowerCase():void 0)}}),r.default.onNetworkStatusChange&&r.default.onNetworkStatusChange((function(t){var n=t.networkType;e(n?n.toLowerCase():void 0)}))}t.getNetType=o}])}));
|
package/lib/utils/platform.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.__esModule=!0,exports["default"]=exports.appName=exports.VERSION=void 0,exports.getPerformance=getPerformance,exports.getStorageSync=getStorageSync,exports.sdk=void 0,exports.setStorageSync=setStorageSync;var VERSION=exports.VERSION=
|
|
1
|
+
"use strict";exports.__esModule=!0,exports["default"]=exports.appName=exports.VERSION=void 0,exports.getPerformance=getPerformance,exports.getStorageSync=getStorageSync,exports.sdk=void 0,exports.setStorageSync=setStorageSync;var VERSION=exports.VERSION='0.0.27',OBJ="object",qqName="qq",bytedanceName="bytedance",wechatName="wechat",dingtalkName="dingtalk",alipayName="alipay",swanName="swan";/**
|
|
2
2
|
* 获取跨平台的 SDK
|
|
3
3
|
*/function getSDK(){var a,b="unknown";if(typeof qq===OBJ)// qq的全局也有wx命名空间,和qq等效,这会导致判断AppName失效
|
|
4
4
|
a=qq,b=qqName;else if(typeof tt===OBJ)// 字节的全局也有wx命名空间,和tt等效,这会导致判断AppName失效
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arms/rum-miniapp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"description": "arms rum javascript sdk for miniapp",
|
|
5
5
|
"author": "guangli.fj <guangli.fj@alibaba-inc.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"start": "build-scripts build --watch",
|
|
21
21
|
"build": "build-scripts build",
|
|
22
|
-
"prepublishOnly": "npm run build",
|
|
23
22
|
"test": "node ./__tests__/@arms/miniapp.test.js"
|
|
24
23
|
},
|
|
25
24
|
"dependencies": {
|
|
@@ -28,5 +27,5 @@
|
|
|
28
27
|
"devDependencies": {
|
|
29
28
|
"typescript": "^4.9.4"
|
|
30
29
|
},
|
|
31
|
-
"homepage": "https://unpkg.com/@arms/rum-miniapp@0.0.
|
|
30
|
+
"homepage": "https://unpkg.com/@arms/rum-miniapp@0.0.27/build/index.html"
|
|
32
31
|
}
|