24 lines
278 KiB
JavaScript
24 lines
278 KiB
JavaScript
!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=27)}([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(13);t.Client=i.default;var a=n(15);t.Context=a.default;var s=n(30);t.Reporter=s.default;var u=n(32);t.Shell=u.default,o(n(33),t),o(n(14),t),o(n(34),t),o(n(35),t),o(n(36),t),o(n(9),t),o(n(37),t),o(n(38),t),o(n(18),t),o(n(19),t),o(n(3),t),o(n(39),t),o(n(20),t),o(n(40),t),o(n(16),t),o(n(17),t),o(n(8),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=t.history=t.location=t.document=t.global=void 0,t.global=window,t.document=window.document,t.location=window.location,t.history=window.history,t.VERSION="cdn-0.1.8"},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)}Object.defineProperty(t,"__esModule",{value:!0}),t.initPerfObserver=t.getCurrentTime=t.restoreHackFunction=t.hackFunction=void 0;var o=n(0),i=n(1),a="__";function s(e,t,n){if("object"===r(e)&&"function"==typeof e[t]){var o=e[t];e["".concat("__").concat(t).concat("__")]=o;var i=n(o);e[t]=i}}function u(e,t){var n="".concat("__").concat(t).concat("__");"function"==typeof e[n]&&(e[t]=e[n],delete e[n])}function c(e){return(null===performance||void 0===performance?void 0:performance.timeOrigin)&&(null===performance||void 0===performance?void 0:performance.now)?Math.round(performance.timeOrigin+(e||performance.now())):Date.now()}function l(e,t,n){var r,a=i.global.PerformanceObserver;if((0,o.isFunction)(a)&&null!==(r=a.supportedEntryTypes)&&void 0!==r&&r.includes(e)){var s=new a((function(e){t(e.getEntries())}));try{s.observe(Object.assign({type:e,buffered:!0},n))}catch(t){s.observe(Object.assign({entryTypes:[e]},n))}return s}}t.hackFunction=s,t.restoreHackFunction=u,t.getCurrentTime=c,t.initPerfObserver=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){return r(e)===t}Object.defineProperty(t,"__esModule",{value:!0}),t.isZero=t.isObject=t.isNull=t.isNumber=t.isBoolean=t.isRegExp=t.isArray=t.isToString=t.isString=t.isFunction=t.isTypeof=void 0,t.isTypeof=o;var i=function e(t){return"function"==typeof t};function a(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function s(){for(var e=0;e<arguments.length;e++)if(0!==(e<0||arguments.length<=e?void 0:arguments[e]))return!1;return!0}t.isFunction=i,t.isString=function(e){return o(e,"string")},t.isToString=a,t.isArray=function(e){return a(e,"Array")},t.isRegExp=function(e){return a(e,"RegExp")},t.isBoolean=function(e){return o(e,"boolean")},t.isNumber=function(e){return o(e,"number")&&!isNaN(e)||o(e,"bigint")},t.isNull=function(e){return null===e},t.isObject=function(e){return!(0,t.isNull)(e)&&o(e,"object")},t.isZero=s},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){function e(e,n,r,o){var a=n&&n.prototype instanceof t?n:t,c=Object.create(a.prototype);return i(c,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,u=0;!f&&c&&!n&&u<l.length;u++){var n,r=l[u],o=p.p,h=r[2];3<e?(n=h===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=s):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,p.v=t,p.n=r[1]):o<h&&(n=3>e||r[0]>t||t>h)&&(r[4]=e,r[5]=t,p.n=h,i=0))}if(n||1<e)return d;throw f=!0,t}var o,i,a,c=0,l=n||[],f=!1,p={p:0,n:0,v:s,a:r,f:r.bind(s,4),d:function e(t,n){return o=t,i=0,a=s,p.n=n,d}};return function(n,l,h){if(1<c)throw TypeError("Generator is already running");for(f&&1===l&&r(l,h),i=l,a=h;(u=2>i?s:a)||!f;){o||(i?3>i?(1<i&&(p.n=-1),r(i,a)):p.n=a:p.v=a);try{if(c=2,o){if(i||(n="next"),u=o[n]){if(!(u=u.call(o,a)))throw TypeError("iterator result is not an object");if(!u.done)return u;a=u.value,2>i&&(i=0)}else 1===i&&(u=o.return)&&u.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=s}else if((u=(f=0>p.n)?a:e.call(t,p))!==d)break}catch(e){o=s,i=1,a=e}finally{c=1}}return{value:u,done:f}}}(e,r,o),!0),c}function t(){}function n(){}function r(){}function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,i(e,f,"GeneratorFunction")),e.prototype=Object.create(h),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var s,u,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",f=c.toStringTag||"@@toStringTag",d={};u=Object.getPrototypeOf;var p=[][l]?u(u([][l]())):(i(u={},l,(function(){return this})),u),h=r.prototype=t.prototype=Object.create(p);return n.prototype=r,i(h,"constructor",r),i(r,"constructor",n),n.displayName="GeneratorFunction",i(r,f,"GeneratorFunction"),i(h),i(h,f,"Generator"),i(h,l,(function(){return this})),i(h,"toString",(function(){return"[object Generator]"})),(o=function t(){return{w:e,m:a}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,a){function s(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=l(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function f(e,t,n){return t=m(t),d(e,h()?Reflect.construct(t,n||[],m(e).constructor):t.apply(e,n))}function d(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 h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function t(){return!!e})()}function m(e){return(m=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&&y(e,t)}function y(e,t){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var g=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.checkEnable=void 0;var b=n(0),S=n(1),C="arms_rum2_local_config";function w(e){var t,n,r,o,i={};i.enable=null===(t=e.enable)||void 0===t||t;var a=e.session;if(a){var s={};s.sampleRate=(null!==(n=a.sampling)&&void 0!==n?n:100)/100,s.storage=null!==(r=a.storage)&&void 0!==r?r:"auto",i.sessionConfig=s}var u=e.report;if(u){var c={};c.flushTime=u.flush_interval,c.maxEventCount=u.max_batch_count,i.reportConfig=c}var l=e.tracing;if(l){var f={enable:null===(o=l.enable)||void 0===o||o},d=[];(l.rules||[]).forEach((function(e){var t={enable:e.enable,tracestate:e.tracestate,baggage:e.baggage,propagatorTypes:e.protocols,sampling:e.sampling};return"{location.origin}"===e.match?void(f=Object.assign(Object.assign({},f),t)):(t.match=(0,b.parseRule2Match)(e),void d.push(t))})),f.allowedUrls=d,i.tracing=f}var p=e.collectors;if(p&&0<Object.keys(p).length){var h={};p.forEach((function(e){var t=e.name;if(t){var n=Object.assign({},e),r=e.filters;0<(null==r?void 0:r.length)&&(n.filters=n.filters.map((function(e){return(0,b.parseRule2Match)(e)}))),"view"===t&&(i.spaMode=n.spaMode),h[t]=n}})),i.collectors=Object.assign(Object.assign({},i.collectors),h)}return i}var E=function(e){function t(){var e;return a(this,t),(e=f(this,t,arguments)).version="v2",e}return v(t,e),u(t,[{key:"fetchRemoteCfg",value:function e(t){return g(this,void 0,void 0,o().m((function e(){var t;return o().w((function(e){for(;;)switch(e.n){case 0:if(t=this.getRemoteConfigUrl()){e.n=1;break}return e.a(2);case 1:if(!t.includes(".rum.aliyuncs.com")){e.n=2;break}return this.version="v1",e.a(2,this.getV1Config(t));case 2:return e.a(2,this.getV2Config(t))}}),e,this)})))}},{key:"getV1Config",value:function e(t){return g(this,void 0,void 0,o().m((function e(){return o().w((function(e){for(;;)switch(e.n){case 0:return e.a(2,fetch(t).then((function(e){return e.json()})))}}),e)})))}},{key:"getV2Config",value:function e(t){return g(this,void 0,void 0,o().m((function e(){var n,r;return o().w((function(e){for(;;)switch(e.n){case 0:return n=(0,b.getUrlParams)(t),r={instanceId:"",agentType:"rum_web_sdk",attributes:n,instanceConfigs:[{configType:"rum_web_config",version:1}],capabilities:2},e.a(2,fetch(t,{method:"POST",headers:{"Content-Type":"application/json","x-log-apiversion":"0.6.0"},body:JSON.stringify(r)}).then((function(e){return e.json()})))}}),e)})))}},{key:"getCacheConfig",value:function e(){var t=S.global.localStorage.getItem(C);if(t){var n,r=this.currentConfig;try{if("pid"in(n=JSON.parse(t))&&n.pid===r.pid||"endpoint"in n&&n.endpoint)return n}catch(e){}return n}}},{key:"setCacheConfig",value:function e(t){var n=this.currentConfig,r=Object.assign(Object.assign({},t),{pid:n.pid,endpoint:n.endpoint});S.global.localStorage.setItem(C,JSON.stringify(r))}},{key:"getRemoteConfigUrl",value:function e(){var t=this.currentConfig,n=t.pid,r=t.remoteConfig,o=t.endpoint,i=r||{},a=i.url,s=i.region;if(a)return a;if(n){var u=n.split("@");return!u||2>u.length?void 0:"//".concat(u[0],"-sdk.rum.aliyuncs.com/config/").concat(s||"cn-hangzhou","/").concat(u[1],"?t=").concat(Date.now())}try{var c=new URL(o);c.pathname="/agentconfig";var l=c.searchParams.get("service_id");return l?(c.searchParams.delete("service_id"),c.searchParams.set("service",l),c.toString()):void 0}catch(e){}}},{key:"parseConfig",value:function e(t){try{return"v2"===this.version?w(JSON.parse(t.instanceConfigs[0].config)):t}catch(e){return t}}}])}(b.ConfigManager);function I(e,t){var n,r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],o=e.getConfig();if(!1===o.enable)return!1;var i=null===(n=o.collectors)||void 0===n?void 0:n[t];return(0,b.isBoolean)(i)?i:(0,b.isObject)(i)&&"enable"in i?i.enable:r}t.default=E,t.checkEnable=I},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getResourceName=t.fixRelativeUrl=t.getPathByURL=t.getCurrentURL=void 0;var r=n(0),o=n(1);function i(){return o.location?o.location.href:""}function a(e){if(!(0,r.isString)(e)||!e)return"";var t;0===e.indexOf("#")&&(e=e.substring(1));var n=e.indexOf("?");return 0<=n&&(e=e.substring(0,n)),e}function s(e){var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1];try{var n=new URL(u(e));if("auto"===t||!0===t){var r=a(n.hash||"");return n.pathname+(r?"#":"")+r}return"hash"===t?a(n.hash||""):n.pathname||"/"}catch(t){return e}}function u(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:o.location.protocol,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:o.location.host;if(!(0,r.isString)(e))throw new Error("Invalid URL provided");""===e&&(e=o.location.href);var i=/^https?:\/\//i.test(e);if(i)return e;var a=/^\/\//i.test(e);if(a)return"".concat(t).concat(e);var s=/^\//.test(e);return"".concat(t,"//").concat(n).concat(s?"":"/").concat(e)}function c(e,t){var n;return n=(0,r.isFunction)(t)?t(e):s(e)}t.getCurrentURL=i,t.getPathByURL=s,t.fixRelativeUrl=u,t.getResourceName=c},function(e,t,n){"use strict";function r(e){var t=e.getViews();if(t&&t.length)return t[t.length-1]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCurView=void 0,t.getCurView=r},function(e,t,n){"use strict";function r(){function e(e,n,r,i){var a=n&&n.prototype instanceof t?n:t,c=Object.create(a.prototype);return o(c,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,u=0;!f&&c&&!n&&u<l.length;u++){var n,r=l[u],o=p.p,h=r[2];3<e?(n=h===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=s):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,p.v=t,p.n=r[1]):o<h&&(n=3>e||r[0]>t||t>h)&&(r[4]=e,r[5]=t,p.n=h,i=0))}if(n||1<e)return d;throw f=!0,t}var o,i,a,c=0,l=n||[],f=!1,p={p:0,n:0,v:s,a:r,f:r.bind(s,4),d:function e(t,n){return o=t,i=0,a=s,p.n=n,d}};return function(n,l,h){if(1<c)throw TypeError("Generator is already running");for(f&&1===l&&r(l,h),i=l,a=h;(u=2>i?s:a)||!f;){o||(i?3>i?(1<i&&(p.n=-1),r(i,a)):p.n=a:p.v=a);try{if(c=2,o){if(i||(n="next"),u=o[n]){if(!(u=u.call(o,a)))throw TypeError("iterator result is not an object");if(!u.done)return u;a=u.value,2>i&&(i=0)}else 1===i&&(u=o.return)&&u.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=s}else if((u=(f=0>p.n)?a:e.call(t,p))!==d)break}catch(e){o=s,i=1,a=e}finally{c=1}}return{value:u,done:f}}}(e,r,i),!0),c}function t(){}function n(){}function i(){}function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,o(e,f,"GeneratorFunction")),e.prototype=Object.create(h),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var s,u,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",f=c.toStringTag||"@@toStringTag",d={};u=Object.getPrototypeOf;var p=[][l]?u(u([][l]())):(o(u={},l,(function(){return this})),u),h=i.prototype=t.prototype=Object.create(p);return n.prototype=i,o(h,"constructor",i),o(i,"constructor",n),n.displayName="GeneratorFunction",o(i,f,"GeneratorFunction"),o(h),o(h,f,"Generator"),o(h,l,(function(){return this})),o(h,"toString",(function(){return"[object Generator]"})),(r=function t(){return{w:e,m:a}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(o=function e(t,n,r,a){function s(e,n){o(t,e,(function(t){return this._invoke(e,n,t)}))}n?i?i(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}function i(e){return c(e)||u(e)||s(e)||a()}function a(){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 s(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function u(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function c(e){if(Array.isArray(e))return l(e)}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}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 a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getDocumentInfo=t.addEventListeners=t.getElementSelector=t.getElementXpath=t.onReadyState=t.getClosestTargetAncestorElement=t.DOM_EVENT=void 0;var d,p=n(1),h;function m(e,t){for(var n=e;n!==p.document.documentElement;){var r=n,o=r.localName,i=r.nodeName,a=r.parentElement;if(t.includes((o||i).toLocaleLowerCase()))return n;if(!a)break;n=a}return null}(h=d=t.DOM_EVENT||(t.DOM_EVENT={})).READY_STATE="readystatechange",h.BEFORE_UNLOAD="beforeunload",h.LOAD="load",h.SCROLL="scroll",h.VISIBILITY_CHANGE="visibilitychange",h.FREEZE="freeze",h.FOCUS="focus",h.BLUR="blur",h.INPUT="input",h.DOM_CONTENT_LOADED="DOMContentLoaded",t.getClosestTargetAncestorElement=m;var v={loading:1,interactive:2,complete:3},y={};function g(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"interactive";return f(this,void 0,void 0,r().m((function t(){return r().w((function(t){for(;;)switch(t.n){case 0:return t.a(2,new Promise((function(t,n){if(e in v){var r=p.document.readyState,o,a;if(v[r]>=v[e])t(!0);else{var s=y[e]||[];y[e]=[].concat(i(s),[t])}}else n(!1)})))}}),t)})))}function b(e){for(var t=e.nodeName,n=1,r=!1,o=e.previousSibling;o;)o.nodeType===Node.ELEMENT_NODE&&o.nodeName===t&&n++,o=o.previousSibling;for(o=e.nextSibling;o;){if(o.nodeType===Node.ELEMENT_NODE&&o.nodeName===t){r=!0;break}o=o.nextSibling}return{position:n,hasSiblings:r}}function S(e){return e.includes('"')?"'".concat(e.replace(/'/g,"''"),"'"):'"'.concat(e,'"')}function C(e){var t,n=null===(t=e.textContent)||void 0===t?void 0:t.trim();return n?50<n.length?n.substring(0,50)+"...":n:""}function w(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=t.ignoreId,r=void 0!==n&&n,o=t.preferId,i=!(void 0!==o)||o,a=t.includeText,s=void 0!==a&&a,u=t.maxDepth,c=void 0===u?50:u,l=t.simplified,f=void 0!==l&&l;if(!e||!e.nodeType||e.nodeType!==Node.ELEMENT_NODE)return"";if(i&&!r&&e.id){var d=S(e.id);return"//*[@id=".concat(d,"]")}for(var h=[],m=e,v=0;m&&m.nodeType===Node.ELEMENT_NODE&&v<c&&m!==p.document.body&&m!==p.document.documentElement;){var y=m.localName||m.nodeName.toLowerCase(),g=b(m),w=g.position,E=g.hasSiblings,I=y;if(!f&&(1<w||E)&&(I+="[".concat(w,"]")),s){var T=C(m);if(T){var O=S(T);I+="[contains(text(), ".concat(O,")]")}}h.push(I),m=m.parentElement,v++}return 0<h.length?"/"+h.reverse().join("/"):""}function E(e){return e.replace(/([ !"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function I(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return"";for(var t,n=[],r=e,o=20,i=0,a=function e(){if(r===p.document.body||r===p.document.documentElement)return 0;var t=(r.localName||r.nodeName).toLowerCase(),o="";if(r.id)return o="#".concat(E(r.id)),n.push(o),r=r.parentElement,i++,1;o=t;var a=r.classList,s;a&&0<a.length&&(o+=Array.from(a).slice(0,3).map((function(e){return".".concat(E(e))})).join(""));var u=r.parentElement;if(u){var c=Array.from(u.children),l;if(1<c.filter((function(e){return(e.localName||e.nodeName).toLowerCase()===t})).length){var f=c.indexOf(r)+1;o+=":nth-child(".concat(f,")")}}n.push(o),r=u,i++};r&&r.nodeType===Node.ELEMENT_NODE&&i<o&&0!==(t=a()););return 0<n.length?n.reverse().join(" > "):""}function T(e,t,n){return t.forEach((function(t){e.addEventListener(t,n)})),function(){t.forEach((function(t){e.removeEventListener(t,n)}))}}function O(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:p.document,t=e.documentElement;return{isFocused:e.hasFocus(),isVisible:"visible"===e.visibilityState,width:p.global.innerWidth||t.clientWidth||0,height:p.global.innerHeight||t.clientHeight||0,scrollTop:p.global.pageYOffset||t.scrollTop||0,scrollHeight:t.scrollHeight||e.body.scrollHeight||0,clientHeight:t.clientHeight||p.global.innerHeight||0}}p.document.addEventListener(d.READY_STATE,(function(e){var t=e.target.readyState;if(t in y){var n=y[t]||[];n.forEach((function(e){return e(!0)})),n.length=0}})),t.onReadyState=g,t.getElementXpath=w,t.getElementSelector=I,t.addEventListeners=T,t.getDocumentInfo=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=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter=void 0;var c=function(){function e(){o(this,e),this.events={}}return a(e,[{key:"on",value:function e(t,n){this.events[t]||(this.events[t]=[]),this.events[t].push(n)}},{key:"emit",value:function e(t){var n=this.events[t];if(n){for(var r=n.slice(),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];for(var s=0;s<r.length;s++)try{r[s].apply(r,i)}catch(e){console.error('Error in handler for "'.concat(t,'":'),e)}}}},{key:"off",value:function e(t,n){var r=this.events[t];if(r)if(n){for(var o=r.length;o--;)r[o]===n&&r.splice(o,1);0===r.length&&delete this.events[t]}else delete this.events[t]}},{key:"once",value:function e(t,n){var r=this,o=function e(){r.off(t,o),n.apply(void 0,arguments)};this.on(t,o)}}])}();t.EventEmitter=c},function(e,t,n){"use strict";var r,o,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AppType=t.ResourceStatus=t.RumEventType=void 0,function(e){e.VIEW="view",e.RESOURCE="resource",e.EXCEPTION="exception",e.LONG_TASK="longTask",e.ACTION="action",e.CUSTOM="custom",e.APPLICATION="application"}(r=t.RumEventType||(t.RumEventType={})),function(e){e[e.Unknown=-1]="Unknown",e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(o=t.ResourceStatus||(t.ResourceStatus={})),function(e){e.browser="browser",e.miniapp="miniapp",e.minigame="minigame",e.uniapp="uniapp",e.reactnative="reactnative"}(i=t.AppType||(t.AppType={}))},function(e,t,n){"use strict";(function(e){function r(e,t){return a(e)||i(e,t)||u(e,t)||o()}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(u){c=!0,o=u}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function a(e){if(Array.isArray(e))return e}function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=u(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function u(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.initPerfObserver=t.getTimingStartTime=t.delBadMea=t.getResourceType=t.RESOURCE_TYPES=t.ResourceType=t.calcResourceTimingData=t.getResourceStatus=t.getResourceSuccessByCode=void 0;var l=n(0),f,d;function p(e){var t,n=[200,300];if(e){var r=+e;t=r>=n[0]&&r<n[1]?l.ResourceStatus.Success:l.ResourceStatus.Failed}else t=l.ResourceStatus.Unknown;return t}function h(e){var t,n=e.responseStatus,r=e.transferSize,o=e.encodedBodySize,i=e.decodedBodySize,a=e.responseEnd,s=e.startTime;return t=n?p(n):(0,l.isZero)(r,o,i)?l.ResourceStatus.Failed:a>s&&(0<r||0<o||0<i)?l.ResourceStatus.Success:l.ResourceStatus.Unknown}function m(){for(var e=1;e<arguments.length;e+=1)if((0>e-1||arguments.length<=e-1?void 0:arguments[e-1])>(0>e||arguments.length<=e?void 0:arguments[e]))return!1;return!0}function v(e){var n=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],r=e.startTime,o=e.fetchStart,i=e.transferSize,a=e.encodedBodySize,s=e.decodedBodySize,u=e.redirectStart,c=e.redirectEnd,f=e.domainLookupStart,d=e.domainLookupEnd,p=e.connectStart,h=e.secureConnectionStart,v=e.connectEnd,y=e.requestStart,g=e.responseStart,S=e.responseEnd,C=e.duration;if(!n){if(!m(r,o,f,d,p,v,y,g,S))return;if((0,l.isZero)(C)||(0,l.isZero)(g)||r>g||(0,l.isZero)(i)&&0<a&&0<s||"cache"===e.deliveryType||!("responseStatus"in e)&&(0,l.isZero)(i,a,s))return}u<r&&(u=r),c<r&&(c=o);var w={duration:C};return v&&(w.connect_duration=(0,l.formatNumber)(v-p)),d&&(w.dns_duration=(0,l.formatNumber)(d-f)),c&&(w.redirect_duration=(0,l.formatNumber)(c-u)),g&&(w.first_byte_duration=(0,l.formatNumber)(g-(0,t.getTimingStartTime)(e,"requestStart"))),S&&(w.download_duration=(0,l.formatNumber)(S-(0,t.getTimingStartTime)(e,"responseStart"))),s&&(w.size=(0,l.formatNumber)(s)),i&&(w.transfer_size=(0,l.formatNumber)(i)),h&&(w.ssl_duration=(0,l.formatNumber)(v-h)),b(w)}function y(e,n){var o;try{o=new URL(e)}catch(e){return f.OTHER}var i=o.search,a=o.pathname;if(i&&(0,l.startsWith)(i,"??")){var u=i.slice(2),c;a=u.split(",")[0]||u}var d,p=s(t.RESOURCE_TYPES);try{for(p.s();!(d=p.n()).done;){var h=r(d.value,2),m=h[0],v;if((0,h[1])(n,a))return m}}catch(e){p.e(e)}finally{p.f()}return f.OTHER}t.getResourceSuccessByCode=p,t.getResourceStatus=h,t.calcResourceTimingData=v,(d=f=t.ResourceType||(t.ResourceType={})).DOCUMENT="document",d.XHR="xmlhttprequest",d.BEACON="beacon",d.FETCH="fetch",d.CSS="css",d.JS="js",d.IMAGE="image",d.FONT="font",d.MEDIA="media",d.OTHER="other",t.RESOURCE_TYPES=[[f.DOCUMENT,function(e){return"navigation"===e}],[f.XHR,function(e){return"xmlhttprequest"===e}],[f.FETCH,function(e){return"fetch"===e}],[f.BEACON,function(e){return"beacon"===e}],[f.CSS,function(e,t){return/\.css$/i.test(t)}],[f.JS,function(e,t){return/\.js$/i.test(t)}],[f.IMAGE,function(e,t){return["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.test(t)}],[f.FONT,function(e,t){return/\.(woff|eot|woff2|ttf)$/i.test(t)}],[f.MEDIA,function(e,t){return["audio","video"].includes(e)||/\.(mp3|mp4)$/i.test(t)}]],t.getResourceType=y;var g=["duration","connect_duration","ssl_duration","dns_duration","redirect_duration","first_byte_duration","download_duration"];function b(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:g,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[0,l.ONE_HOUR];if((0,l.isObject)(e))return t.forEach((function(t){!(t in e)||(e[t]<=n[0]||e[t]>=n[1])&&delete e[t]})),e}t.delBadMea=b;var S=["responseStart","requestStart","connectEnd","domainLookupEnd","fetchStart","workerStart","redirectEnd","startTime"],C=function(e){for(var t,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"fetchStart",r=new Map(S.map((function(e,t){return[e,t]}))),o=null!==(t=r.get(n))&&void 0!==t?t:0,i=o;i<S.length;i++){var a=S[i],s=e[a];if("number"==typeof s&&0<s)return s}return 0};function w(t,n,r){var o=e.PerformanceObserver;if((0,l.isFunction)(o)){var i=t.filter((function(e){var t;return null===(t=o.supportedEntryTypes)||void 0===t?void 0:t.includes(e)}));if(0!==i.length){var a=new o((function(e){n(e.getEntries())}));try{i.forEach((function(e){a.observe(Object.assign({type:e,buffered:!0},r))}))}catch(t){i.forEach((function(e){try{a.observe(Object.assign({entryTypes:[e]},r))}catch(t){console.warn("Failed to observe ".concat(e,":"),t)}}))}return a}}}t.getTimingStartTime=C,t.initPerfObserver=w}).call(this,n(23))},function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.LifeCycleEventType=void 0,(o=r=t.LifeCycleEventType||(t.LifeCycleEventType={})).VIEW_CREATED="VIEW_CREATED",o.VIEW_ENDED="VIEW_ENDED"},function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.RecordType=t.ReplayStatus=void 0,(o=r=t.ReplayStatus||(t.ReplayStatus={})).IDLE="idle",o.RECORDING="recording",o.PAUSED="paused",o.STOPPED="stopped",t.RecordType={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=i(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function e(){};return{s:o,n:function t(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function t(){n=n.call(e)},n:function e(){var t=n.next();return s=t.done,t},e:function e(t){u=!0,a=t},f:function e(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=f(e,"string");return"symbol"==r(t)?t:t+""}function f(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var d=n(14),p=n(8),h=n(15),m=n(3),v=function(){function e(){var t=this;s(this,e),this.emitter=new p.EventEmitter,this.sendEvent=function(e){t.emitter.emit(d.EventType.collect,e)}}return c(e,[{key:"init",value:function e(t,n,r){var i=this;this.ctx=new h.default(t,n,r);var a=this.ctx,s=this.collectors,u=this.processors,c=this.reporter;u.forEach((function(e){(0,m.isFunction)(e.setup)&&e.setup(a)})),this.emitter.on(d.EventType.collect,(function(e){a.setRumEvent(e);var t=o(u),n;try{for(t.s();!(n=t.n()).done;){var r=n.value;if(r.match||(r.match=function(){return!0}),r.match(a)){var i=r.process(a);i&&a.setRumEvent(i)}}}catch(e){t.e(e)}finally{t.f()}c.report(a)})),s.forEach((function(e){e.setup(a,i.sendEvent)}))}},{key:"setContext",value:function e(t){this.ctx=t}},{key:"getContext",value:function e(){return this.ctx}},{key:"useCollectors",value:function e(t){this.collectors=t}},{key:"getCollectors",value:function e(){return this.collectors}},{key:"useProcessors",value:function e(t){this.processors=t}},{key:"useReporter",value:function e(t){this.reporter=t}}])}();t.default=v},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,s(r.key),r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(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 c=n(8),l=function(){function e(t,n,r){o(this,e),this.config=t,this.views=[],this.emitter=new c.EventEmitter,n&&(this.session=n,this.session.init(this)),r&&(this.configManager=r)}return a(e,[{key:"getConfig",value:function e(){return this.configManager?this.configManager.getConfig():this.config}},{key:"setConfig",value:function e(t){this.configManager?this.configManager.setConfig(t):this.config=t}},{key:"getViews",value:function e(){return this.views}},{key:"addView",value:function e(t){var n=this.views.findIndex((function(e){return e.id===t.id}));n>=0&&this.views.splice(n,1),this.views.push(t)}},{key:"removeView",value:function e(t){this.views=this.views.filter((function(e){return e.id!==t}))}},{key:"getRumEvent",value:function e(){return this.rumEvent}},{key:"setRumEvent",value:function e(t){this.rumEvent=t}}])}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyProperties=void 0;var r=n(3);function o(e){if((0,r.isObject)(e)){var t=Object.assign({},e);Object.keys(t).forEach((function(e){var n=t[e];if(e.length>50){var o=e.substring(0,50);t[o]=n,delete t[e],e=o}(0,r.isString)(n)||(0,r.isNumber)(n)?(0,r.isString)(n)&&n.length>2e3&&(t[e]=n.substring(0,2e3)):delete t[e]}));var n=Object.keys(t);if(n.length)return n.length>20&&n.forEach((function(e,n){n>19&&delete t[e]})),t}}t.verifyProperties=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUrlParams=void 0;var r=function e(t){if(0===t.length)return"";try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ").replace(/%20/g," ").replace(/%2F/g,"/").replace(/%3D/g,"=").replace(/%26/g,"&").replace(/%3F/g,"?")}},o=function e(t){if(0===t.length)return"";var n=t.indexOf("#"),r=n>=0?t.slice(0,n):t,o=r.indexOf("?");return-1===o?"":r.slice(o+1)};function i(e){if("string"!=typeof e||!e.trim())return{};var t={},n=o(e);if(!n)return t;for(var i=n.split("&"),a=0;a<i.length;a++){var s=i[a];if(s){var u=s.indexOf("=");if(!(u<=0)){var c=r(s.slice(0,u)),l=u<s.length-1?r(s.slice(u+1)):"",f=t[c];void 0!==f?Array.isArray(f)?f.push(l):t[c]=[f,l]:t[c]=l}}}return t}t.getUrlParams=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRegExpString=t.delay=t.debounce=t.generateEventId=t.generateSpanId=t.generateTraceId=t.generateGUID=t.restoreFunction=t.interceptFunction=void 0;var r=n(3);function o(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e[t],a=function t(){for(var a=o?this:e,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];if(n.apply(a,u),(0,r.isFunction)(i))return i.apply(a,u)};a._rum_intercepted=i,e[t]=a}function i(e,t){var n=e[t];if(!(0,r.isFunction)(n)){var o=n._rum_intercepted;(0,r.isFunction)(o)||(e[t]=o)}}function a(){var e="";try{if(crypto&&crypto.randomUUID)e=crypto.randomUUID();else if(crypto&&crypto.getRandomValues){var t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128,e=t.reduce((function(e,t){return e+t.toString(16).padStart(2,"0")}),"").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/,"$1-$2-$3-$4-$5")}}catch(t){e=""}return e||(e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0,n;return("x"==e?t:3&t|8).toString(16)}))),e}function s(){var e=a().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 u(){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=u();return"00-".concat(e,"-").concat(t)}function l(e,t){var n;if((0,r.isFunction)(e))return function(){var r=this,o=arguments;n&&clearTimeout(n),n=setTimeout((function(){e.apply(r,o)}),t)}}function 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))}}function d(e){if("string"!=typeof e)throw new TypeError("input must be a string");if(e.length>2&&"/"===e[0]){var t=e.lastIndexOf("/");if(t>0){var n=e.substring(1,t),r=e.substring(t+1);return new RegExp(n,r)}return new RegExp(e.substring(1,e.length-1))}return new RegExp(e)}t.interceptFunction=o,t.restoreFunction=i,t.generateGUID=a,t.generateTraceId=s,t.generateSpanId=u,t.generateEventId=c,t.debounce=l,t.delay=f,t.parseRegExpString=d},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n))return r}}function o(e,t){return e.slice(0,t.length)===t}function i(e,t){return e.slice(-t.length)===t}function a(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}Object.defineProperty(t,"__esModule",{value:!0}),t.assign=t.endsWith=t.startsWith=t.find=void 0,t.find=r,t.startsWith=o,t.endsWith=i,t.assign=a},function(e,t,n){"use strict";function r(e){return s(e)||a(e)||i(e)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e){if(Array.isArray(e))return u(e)}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.parseRule2Match=t.urlMatch=t.matchList=t.isMatchOption=void 0;var c=n(3),l=n(19),f=n(18);function d(e){return(0,c.isString)(e)||(0,c.isFunction)(e)||(0,c.isRegExp)(e)}function p(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0;return e.some((function(e){try{if("function"==typeof e)return e(t,r);if(e instanceof RegExp)return e.test(t);if("string"==typeof e)return n?(0,l.startsWith)(t,e):e===t}catch(e){}return!1}))}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{(0,c.isArray)(t)||(t=[t]);var n=[/^(https?:)?\/\/.*rum|retcode|log-global|log\.aliyuncs\.com/,/^(https?:)?\/\/.*\.mmstat\.com/,/^(https?:)?\/\/.*hm\.baidu\.com/,/^(https?:)?\/\/.*google-analytics\.com/,/data:(.+?)(;base64)?,(.+)$/].concat(r(t));return p(n,e)}catch(e){return!1}}function m(e){if(d(e))return e;var t;switch(e.match_exp){case"equals":t=function t(n){return n===e.match};break;case"not_equals":t=function t(n){return n!==e.match};break;case"regex":t=(0,f.parseRegExpString)(e.match);break;case"includes":t=function t(n){return n.includes(e.match)};break;case"starts_with":default:t=function t(n){return(0,l.startsWith)(n,e.match)}}return t}t.isMatchOption=d,t.matchList=p,t.urlMatch=h,t.parseRule2Match=m},function(e,t,n){"use strict";var r,o,i;Object.defineProperty(t,"__esModule",{value:!0}),t.ExceptionEventType=t.ExceptionSource=void 0,(o=r=t.ExceptionSource||(t.ExceptionSource={})).console="console.error",o.onError="onError",o.unhandled="onUnhandledRejection",function(e){e.error="error",e.unhandled="unhandledrejection",e.console="consoleError"}(i=t.ExceptionEventType||(t.ExceptionEventType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTrueArea=t.getElementsBySelectors=void 0;var r=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document,n=[];return e.forEach((function(e){var r=Array.from(t.querySelectorAll(e));r&&n.push.apply(n,r)})),n};t.getElementsBySelectors=r;var o=function(e){var t=e.getBoundingClientRect(),n=t.left,r=t.top,o=t.right,i=t.bottom,a=window.innerHeight||document.documentElement.clientHeight,s=window.innerWidth||document.documentElement.clientWidth,u=Math.max(0,n),c=Math.max(0,r),l=Math.min(s,o),f=Math.min(a,i);return{left:u,top:c,right:l,bottom:f,width:l-u,height:f-c}};t.getTrueArea=o},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reviseApiAttr=t.ApiType=void 0;var r=n(0);function o(e){if((0,r.isObject)(e)){var t={};(0,r.isString)(e.name)&&(t.name=e.name.substring(0,1e3)),(0,r.isString)(e.message)&&(t.message=e.message.substring(0,1e3)),(0,r.isNumber)(e.success)&&-1<=e.success&&1>=e.success&&(t.success=e.success),(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)),(0,r.isString)(e.trace_id)&&(t.trace_id=e.trace_id.substring(0,100));var n=(0,r.verifyProperties)(e.properties);return n&&(t.properties=n),t}}t.ApiType={XHR:"xmlhttprequest",FETCH:"fetch"},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){return c(e)||u(e,t)||a(e,t)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(u){c=!0,o=u}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function c(e){if(Array.isArray(e))return e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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,p(n.key),n)}function d(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=h(e,"string");return"symbol"==r(t)?t:t+""}function h(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.RumSession=t.SESSION_STORAGE=t.SessionEventType=void 0;var m,v=n(0),y=n(2),g=n(6),b=n(58),S=n(1),C=n(26),w=n(12),E="_arms_uid",I="_arms_session",T;(T=m=t.SessionEventType||(t.SessionEventType={})).INIT="init",T.UPDATE="update",T.EVENT="event";var O,A="_test_",k=function(){try{return localStorage.setItem(A,"1"),localStorage.removeItem(A),!0}catch(e){return!1}}(),_=function(){try{S.document.cookie="".concat(A,"=1; path=/");var e=-1!==S.document.cookie.indexOf("".concat(A,"="));return S.document.cookie="".concat(A,"=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT"),e}catch(e){return!1}}(),R=S.global.__RUM_MEMORY_STORAGE={};function M(e){var t=e.sessionConfig||{},n=t.sampleRate,r=t.maxDuration,o=t.overtime,i=t.storage,a=void 0===i?O.AUTO:i,s=t.domain;return(!(0,v.isNumber)(n)||0>n||1<n)&&(n=1),(!(0,v.isNumber)(r)||r<4*v.ONE_HOUR||r>v.ONE_DAY)&&(r=v.ONE_DAY),(!(0,v.isNumber)(o)||o>v.ONE_HOUR||o<10*v.ONE_MINUTE)&&(o=30*v.ONE_MINUTE),a!==O.COOKIE&&a!==O.LOCAL_STORAGE&&a!==O.MEMORY&&(a=O.AUTO),a===O.AUTO&&(a=O.LOCAL_STORAGE),a!==O.LOCAL_STORAGE||k||(a=O.COOKIE),a!==O.COOKIE||_||(a=O.MEMORY),{sampleRate:n,maxDuration:r,overtime:o,storage:a,domain:s}}!function(e){e.AUTO="auto",e.LOCAL_STORAGE="localStorage",e.COOKIE="cookie",e.MEMORY="memory"}(O=t.SESSION_STORAGE||(t.SESSION_STORAGE={}));var j=function(){function e(){l(this,e),this.rumUserKey=E,this.rumSessionKey=I,this._lastTime=0}return d(e,[{key:"init",value:function(e){this.ctx=e;var t=e.getConfig();this.sessionConfig=M(t),this.replayConfig=(0,C.fixReplayConfig)(t);var n=this.sessionConfig.domain;n&&(this.rumUserKey="".concat(E,":").concat(n),this.rumSessionKey="".concat(I,":").concat(n))}},{key:"getSessionId",value:function(){return this.getSessionInfo().sessionId}},{key:"getSampled",value:function(){return this.getSessionInfo().sampled}},{key:"checkSession",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.getSessionInfo(),t=this.sessionConfig,n=t.overtime,r=t.maxDuration,o=(0,y.getCurrentTime)();return!(e.startTime+r<o||e.lastTime+n<o)}},{key:"updateSession",value:function(){var e=this.getSessionInfo();if(!e.isNew){var t=e.startTime,n=(0,y.getCurrentTime)(),r=e.sampled?1:0,o=e.replaySampled?1:0;this.setItem(this.rumSessionKey,"".concat(e.sessionId,"-").concat(r,"-").concat(t,"-").concat(n,"-").concat(o))}}},{key:"getSessionInfo",value:function(){var e=this.ctx.emitter,t,n=o((this.getItem(this.rumSessionKey)||"").split("-"),5),r=n[0],i=n[1],a=n[2],s=n[3],u=n[4],c={sessionId:r,sampled:"0"!==i,startTime:parseInt(a||"")||0,lastTime:parseInt(s||"")||0,replaySampled:"1"===u};return this.checkSession(c)?e.emit(m.UPDATE,c):(c=this.resetSession(),e.emit(m.INIT,c)),c}},{key:"getEventId",value:function(){return(0,v.generateEventId)(this.getSessionId())}},{key:"getViewId",value:function(){return this.getUUID()}},{key:"getUserId",value:function(){var e=this.getItem(this.rumUserKey);return e&&0===e.indexOf("user_")&&(e=""),e||(e="uid_".concat((0,v.generateSpanId)(16,36)),this.setItem(this.rumUserKey,e)),e}},{key:"resetSession",value:function(){var e=this.sessionConfig.sampleRate,t=this.replayConfig,n=t.enable,r=t.sampling,o=this.getUUID(),i=(0,y.getCurrentTime)(),a=(0,v.performDraw)(100*e),s=!(!n||!a)&&(0,v.performDraw)(r);return this.setItem(this.rumSessionKey,"".concat(o,"-").concat(a?1:0,"-").concat(i,"-").concat(i,"-").concat(s?1:0)),{sessionId:o,sampled:a,startTime:i,lastTime:i,isNew:!0,replaySampled:s}}},{key:"getUUID",value:function(){return(0,v.generateGUID)().replace(/-/g,"")}},{key:"getBaseEvent",value:function(){var e=this.getSessionInfo(),t={timestamp:(0,y.getCurrentTime)(),session_id:e.sessionId,event_id:this.getEventId(),view:this.ctx?(0,g.getCurView)(this.ctx):void 0,times:1};return C.replayManager.getStatus()===w.ReplayStatus.RECORDING&&(t.has_replay=1),t}},{key:"setItem",value:function(e,t){var n=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:365,o=this.sessionConfig,i=o.storage,a=o.domain,s=(0,y.getCurrentTime)();R[e]=t,this._lastTime=s,clearTimeout(this._timeout),this._timeout=setTimeout((function(){try{i===O.LOCAL_STORAGE?localStorage.setItem(e,t):i===O.COOKIE&&(0,b.setCookie)(e,t,r*v.ONE_DAY,a)}catch(e){n.sessionConfig.storage=O.MEMORY}}),v.ONE_SECOND)}},{key:"getItem",value:function(e){var t=this.sessionConfig.storage,n=(0,y.getCurrentTime)(),r=n-this._lastTime,o=R[e];if(o&&r<2*v.ONE_SECOND)return o;this._lastTime=n;try{t===O.LOCAL_STORAGE?o=localStorage.getItem(e):t===O.COOKIE&&(o=(0,b.getCookie)(e)),R[e]=o}catch(e){}return o}}])}();t.RumSession=j},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,s(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.replayManager=t.ReplayManager=t.fixReplayConfig=void 0;var c,l=n(59),f=n(0),d=n(12),p=n(1),h,m;(h=c||(c={})).START="start",h.STOP="stop",h.DATA="data",h.ERROR="error",function(e){e.blockClass="rum-block",e.ignoreClass="rum-ignore",e.maskTextClass="rum-mask"}(m||(m={}));var v=function(e){return{scale:e.scale,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,pageLeft:e.pageLeft,pageTop:e.pageTop,height:e.height,width:e.width}};function y(e){var t,n=e.replay,r=e.endpoint;try{var o=new URL(r);t="".concat(o.origin,"/logstores/logstore-rum/objects/session-replay/v1")}catch(e){}var i={enable:!1,sampling:1,privacy:{level:"mask"},url:t};if((0,f.isObject)(n)){var a=n.enable,s=n.sampling,u=n.privacy,c=n.url,l=void 0===c?t:c;i.enable=!(null==a)&&a,i.sampling=null!=s?s:1,i.privacy=null!=u?u:i.privacy,i.url=l}else i.enable=!!n;return i}t.fixReplayConfig=y;var g=function(){function e(){o(this,e),this.status=d.ReplayStatus.IDLE,this.stopFn=null,this.listeners=new Set}return a(e,[{key:"start",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(this.status!==d.ReplayStatus.RECORDING){this.status=d.ReplayStatus.RECORDING;try{var n={blockClass:m.blockClass,ignoreClass:m.ignoreClass,maskTextClass:m.maskTextClass,emit:function(t){var n=t.type,r=t.timestamp;e.emit(c.DATA,t),n===d.RecordType.Meta?e.emit(c.DATA,{data:{has_focus:document.hasFocus()},type:d.RecordType.Focus,timestamp:r}):n===d.RecordType.FullSnapshot&&p.global.visualViewport&&e.emit(c.DATA,{data:v(p.global.visualViewport),type:d.RecordType.VisualViewport,timestamp:r})},sampling:{scroll:200,media:800},recordAfter:"DOMContentLoaded"};if(t.privacy){var r=t.privacy,o=r.level,i=r.allowlisted;"mask"===o||("user-input"===o?n.maskAllInputs=!0:"allowlisted"===o&&i&&0<i.length&&(n.blockSelector=":not(".concat(i.filter((function(e){return(0,f.isString)(e)})).join(", "),")")))}this.stopFn=l(n),this.emit(c.START)}catch(e){throw this.status=d.ReplayStatus.IDLE,this.emit(c.ERROR,void 0,e),e}}}},{key:"stop",value:function(){this.status===d.ReplayStatus.IDLE||this.status===d.ReplayStatus.STOPPED||(this.stopFn&&(this.stopFn(),this.stopFn=null),this.status=d.ReplayStatus.STOPPED,this.emit(c.STOP))}},{key:"getStatus",value:function(){return this.status}},{key:"on",value:function(e){var t=this;return this.listeners.add(e),function(){t.listeners.delete(e)}}},{key:"off",value:function(e){this.listeners.delete(e)}},{key:"emit",value:function(e,t,n){var r={type:e,data:t,error:n};this.listeners.forEach((function(e){try{e(r)}catch(e){}}))}},{key:"takeFullSnapshot",value:function(){l.takeFullSnapshot()}},{key:"addCustomEvent",value:function(e,t){l.addCustomEvent(e,t)}}])}();t.ReplayManager=g,t.replayManager=new g},function(e,t,n){e.exports=n(28)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendEvent=t.ArmsRum=void 0;var r=n(29);Object.defineProperty(t,"ArmsRum",{enumerable:!0,get:function(){return r.ArmsRum}}),Object.defineProperty(t,"sendEvent",{enumerable:!0,get:function(){return r.sendEvent}}),window.RumSDK||(window.RumSDK={ArmsRum:r.ArmsRum,sendEvent:r.sendEvent,default:r.default}),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=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){function e(e,n,r,o){var i=n&&n.prototype instanceof t?n:t,c=Object.create(i.prototype);return a(c,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,u=0;!f&&c&&!n&&u<l.length;u++){var n,r=l[u],o=p.p,h=r[2];3<e?(n=h===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=s):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,p.v=t,p.n=r[1]):o<h&&(n=3>e||r[0]>t||t>h)&&(r[4]=e,r[5]=t,p.n=h,i=0))}if(n||1<e)return d;throw f=!0,t}var o,i,a,c=0,l=n||[],f=!1,p={p:0,n:0,v:s,a:r,f:r.bind(s,4),d:function e(t,n){return o=t,i=0,a=s,p.n=n,d}};return function(n,l,h){if(1<c)throw TypeError("Generator is already running");for(f&&1===l&&r(l,h),i=l,a=h;(u=2>i?s:a)||!f;){o||(i?3>i?(1<i&&(p.n=-1),r(i,a)):p.n=a:p.v=a);try{if(c=2,o){if(i||(n="next"),u=o[n]){if(!(u=u.call(o,a)))throw TypeError("iterator result is not an object");if(!u.done)return u;a=u.value,2>i&&(i=0)}else 1===i&&(u=o.return)&&u.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=s}else if((u=(f=0>p.n)?a:e.call(t,p))!==d)break}catch(e){o=s,i=1,a=e}finally{c=1}}return{value:u,done:f}}}(e,r,o),!0),c}function t(){}function n(){}function r(){}function o(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,a(e,f,"GeneratorFunction")),e.prototype=Object.create(h),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var s,u,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",f=c.toStringTag||"@@toStringTag",d={};u=Object.getPrototypeOf;var p=[][l]?u(u([][l]())):(a(u={},l,(function(){return this})),u),h=r.prototype=t.prototype=Object.create(p);return n.prototype=r,a(h,"constructor",r),a(r,"constructor",n),n.displayName="GeneratorFunction",a(r,f,"GeneratorFunction"),a(h),a(h,f,"Generator"),a(h,l,(function(){return this})),a(h,"toString",(function(){return"[object Generator]"})),(i=function t(){return{w:e,m:o}})()}function a(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(a=function e(t,n,r,i){function s(e,n){a(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!i,configurable:!i,writable:!i}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}function s(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,l(n.key),n)}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=f(e,"string");return"symbol"==r(t)?t:t+""}function f(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function d(e,t,n){return t=v(t),p(e,m()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function p(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function t(){return!!e})()}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function b(e){return E(e)||w(e)||C(e)||S()}function S(){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 C(e,t){if(e){if("string"==typeof e)return I(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,t):void 0}}function w(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function E(e){if(Array.isArray(e))return I(e)}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var T=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sendEvent=t.ArmsRum=void 0;var O=n(0),A=n(41),k=n(69),_=n(70),R=n(71),M=n(1),j=n(25),N=n(4),x=b(Object.values(A).filter((function(e){return(0,O.isFunction)(e)}))),P=[],L=function(e){function t(){var e;return s(this,t),(e=d(this,t,arguments)).version=M.VERSION,e}return y(t,e),c(t,[{key:"init",value:function e(t){return T(this,void 0,void 0,i().m((function e(){var n;return i().w((function(e){for(;;)switch(e.n){case 0:return this.configManager=new N.default,e.n=1,this.configManager.init(t);case 1:if(!1!==(n=this.configManager.getConfig()).enable){e.n=2;break}return e.a(2);case 2:return this.client.useCollectors(x.map((function(e){return new e}))),this.client.useProcessors([new k.default,new _.default]),this.client.useReporter(new R.default),this.client.init(n,new j.RumSession,this.configManager),P.push(this),e.a(2,this)}}),e,this)})))}},{key:"getConfig",value:function e(){var t=this.configManager;if(t)return t.getConfig()}},{key:"setConfig",value:function e(){var t=this.configManager;if(t)if(2===arguments.length){var n=t.getConfig();t.setConfig(Object.assign(Object.assign({},n),o({},0>=arguments.length?void 0:arguments[0],1>=arguments.length?void 0:arguments[1])))}else t.setConfig(0>=arguments.length?void 0:arguments[0])}},{key:"getCollector",value:function e(t){return this.client.getCollectors().find((function(e){return e.name===t}))}}])}(O.Shell);function F(e){P.forEach((function(t){return t.client.sendEvent(e)}))}t.ArmsRum=L,t.sendEvent=F,t.default=new L(M.global.__rum)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function s(n,r,o,a){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return i(l,"_invoke",function(n,r,o){var i,a,s,c=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function t(n,r){return i=n,a=0,s=e,d.n=r,u}};function p(n,r){for(a=n,s=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],p=d.p,h=i[2];n>3?(o=h===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(a=0,d.v=r,d.n=i[1]):p<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,d.n=h,a=0))}if(o||n>1)return u;throw f=!0,r}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!f;){i||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=d.n<0)?s:n.call(r,d))!==u)break}catch(t){i=e,a=1,s=t}finally{c=1}}return{value:t,done:f}}}(n,o,a),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(i(t={},r,(function(){return this})),t),p=f.prototype=c.prototype=Object.create(d);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return l.prototype=f,i(p,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,a,"GeneratorFunction"),i(p),i(p,a,"Generator"),i(p,r,(function(){return this})),i(p,"toString",(function(){return"[object Generator]"})),(o=function e(){return{w:s,m:h}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,a){function s(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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,c(r.key),r)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(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)}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 a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});var d=n(9),p=n(31),h=n(3),m=n(16),v=n(17),y=3e3,g=20,b=["app","user","device","os","geo","isp","net","properties"],S=function(){function e(){a(this,e),this.name="reporter",this.eventQueue=[],this._init=!1}return u(e,[{key:"getReportCfg",value:function e(){var t=this.ctx.getConfig().reportConfig;return(0,h.isObject)(t)||(t={}),(!t.flushTime||t.flushTime<0||t.flushTime>1e4)&&(t.flushTime=3e3),(!t.maxEventCount||t.maxEventCount<1||t.maxEventCount>100)&&(t.maxEventCount=20),t}},{key:"report",value:function e(t){var n=this;this.ctx=t,this._init||(this.init(t),this._init=!0),clearTimeout(this.timer),this.pushToQueue();var r=this.getReportCfg();this.eventQueue.length>=r.maxEventCount?this.flushEventQueue():this.timer=setTimeout((function(){n.flushEventQueue()}),r.flushTime)}},{key:"pushToQueue",value:function e(){var t=this.ctx,n=this.eventQueue,r=t.getRumEvent();if(r.event_type===d.RumEventType.EXCEPTION){var o=r.message,i=r.stack,a=(0,p.getErrorID)({message:o,stack:i}),s=this.eventQueue.find((function(e){if(e.event_type===d.RumEventType.EXCEPTION){var t=e.message,n=e.stack;return(0,p.getErrorID)({message:t,stack:n})===a}}));if(s)return void s.times++}if(r.event_type===d.RumEventType.ACTION){var u=r.target_name,c=this.eventQueue.find((function(e){if(e.event_type===d.RumEventType.ACTION)return u===e.target_name}));if(c)return void c.times++}n.push(r)}},{key:"flushEventQueue",value:function e(){var t=this.ctx,n=this.eventQueue;if(n.length){var r=t.getViews(),o=r[r.length-1];r.forEach((function(e){var t;e.id===o.id&&n.filter((function(t){var n;return(null===(n=t.view)||void 0===n?void 0:n.id)===e.id})).forEach((function(e){delete e.view}))}));var i=t.session,a;(!i||i.getSampled())&&this.mergeEvent(t,n,o),this.eventQueue=[]}}},{key:"mergeEvent",value:function e(t,n,r){for(var o=t.getConfig(),i=t.session,a=i.getSessionId(),s=0;s<n.length;s++){var u=n[s];u.session_id===a?delete u.session_id:(n.splice(s,1),s--)}if(0!==n.length){var c=(0,v.getUrlParams)(o.endpoint),l=Object.assign({app:{id:o.pid,env:o.env||"prod",version:o.version,type:""},user:{id:i.getUserId()},session:{id:a},net:{},view:r,events:n},c);b.forEach((function(e){var t=o[e];(0,h.isObject)(t)&&Object.keys(t).forEach((function(n){var r=t[n];"user"===e&&"id"===n||("properties"===e?l[e]=(0,m.verifyProperties)(t):((0,h.isString)(r)||(0,h.isNumber)(r))&&(e in l||(l[e]={}),l[e][n]=r))}))})),("function"!=typeof o.beforeReport||(l=o.beforeReport(l)))&&this.tryRequest(l)}}},{key:"tryRequest",value:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r,i,a;return f(this,void 0,void 0,o().m((function e(){var s=this,u,c,l,f;return o().w((function(e){for(;;)switch(e.p=e.n){case 0:return u=null===(r=this.ctx.getConfig())||void 0===r?void 0:r.reportConfig,c=null!==(i=null==u?void 0:u.maxRetryCount)&&void 0!==i?i:0,l=null!==(a=null==u?void 0:u.retryDelay)&&void 0!==a?a:3e3,e.p=1,t._retry=n,e.n=2,this.request(this.ctx,t);case 2:e.n=4;break;case 3:e.p=3,f=e.v,n<c-1&&setTimeout((function(){return s.tryRequest(t,n+1)}),l);case 4:return e.a(2)}}),e,this,[[1,3]])})))}},{key:"init",value:function e(t){}}])}();t.default=S},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,s(r.key),r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(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 c=n(9),l=n(13),f=n(3),d=function(){function e(t){o(this,e),this.client=new l.default,t&&this.init&&this.init(t)}return a(e,[{key:"sendEvent",value:function e(t){this.client&&this.client.sendEvent(t)}},{key:"getConfig",value:function e(){if(this.client)return this.client.getContext().getConfig()}},{key:"sendCustom",value:function e(t){if(t.name&&t.type){var n=Object.assign(Object.assign({},t),{event_type:c.RumEventType.CUSTOM});this.sendEvent(n)}}},{key:"sendView",value:function e(t){if((0,f.isObject)(t)){if(t.type||(t.type="custom"),"custom"===t.type){var n=0;if(["t1","t2","t3"].forEach((function(e){(0,f.isNumber)(t[e])||delete t[e],e in t&&n++})),0===n)return}var r=Object.assign(Object.assign({},t),{event_type:c.RumEventType.VIEW});this.sendEvent(r)}}},{key:"sendException",value:function e(t){if(t.name&&t.message){var n=t.name,r=t.message,o=t.stack,i=Object.assign(Object.assign({times:1,name:n,message:r,stack:o},t),{event_type:c.RumEventType.EXCEPTION,type:"custom",source:"custom"});this.sendEvent(i)}}},{key:"sendResource",value:function e(t){if(t.name&&t.type&&(0,f.isNumber)(t.duration)){var n=Object.assign(Object.assign({times:1},t),{event_type:c.RumEventType.RESOURCE});this.sendEvent(n)}}}])}();t.default=d},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function s(n,r,o,a){var s=r&&r.prototype instanceof c?r:c,l=Object.create(s.prototype);return i(l,"_invoke",function(n,r,o){var i,a,s,c=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function t(n,r){return i=n,a=0,s=e,d.n=r,u}};function p(n,r){for(a=n,s=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],p=d.p,h=i[2];n>3?(o=h===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(a=0,d.v=r,d.n=i[1]):p<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,d.n=h,a=0))}if(o||n>1)return u;throw f=!0,r}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!f;){i||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=d.n<0)?s:n.call(r,d))!==u)break}catch(t){i=e,a=1,s=t}finally{c=1}}return{value:t,done:f}}}(n,o,a),!0),l}var u={};function c(){}function l(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(i(t={},r,(function(){return this})),t),p=f.prototype=c.prototype=Object.create(d);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return l.prototype=f,i(p,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,a,"GeneratorFunction"),i(p),i(p,a,"Generator"),i(p,r,(function(){return this})),i(p,"toString",(function(){return"[object Generator]"})),(o=function e(){return{w:s,m:h}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,a){function s(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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,c(r.key),r)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(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)}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 a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function d(e){var t=e.remoteConfig||{},n=!1;return"enable"in t?n=!!t.enable:(t.region||t.url)&&(n=!0),{enable:n,url:t.url||"",mode:t.mode||"launch-first",cacheTimeout:t.cacheTimeout||36e5,region:t.region}}Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigManager=void 0;var p=function(){function e(){a(this,e),this.currentConfig=null,this.initialized=!1}return u(e,[{key:"init",value:function e(t){return f(this,void 0,void 0,o().m((function e(){var n=this,r,i,a;return o().w((function(e){for(;;)switch(e.n){case 0:if(!this.initialized){e.n=1;break}return e.a(2);case 1:if(this.currentConfig=Object.assign({},t),this.initialized=!0,r=d(t),this.currentConfig.remoteConfig=r,r.enable){e.n=2;break}return e.a(2);case 2:return e.n=3,this.getCacheConfig();case 3:if((i=e.v)&&i.content&&(this.currentConfig=this.mergeRemoteCfg(i.content)),!this.isCacheValid(i,r.cacheTimeout)){e.n=4;break}return e.a(2);case 4:if(a=this.fetchRemoteCfg(this.currentConfig).then((function(e){if(e){var t=n.parseConfig(e);n.currentConfig=n.mergeRemoteCfg(t),n.setCacheConfig({timestamp:Date.now(),content:e})}})),"remote-first"!==r.mode){e.n=5;break}return e.n=5,a;case 5:return e.a(2)}}),e,this)})))}},{key:"getConfig",value:function e(){if(!this.currentConfig)throw new Error("Config not initialized");return this.currentConfig}},{key:"setConfig",value:function e(t){return f(this,void 0,void 0,o().m((function e(){return o().w((function(e){for(;;)switch(e.n){case 0:if(this.currentConfig){e.n=1;break}return e.a(2);case 1:this.currentConfig=Object.assign(Object.assign({},this.currentConfig),t);case 2:return e.a(2)}}),e,this)})))}},{key:"isCacheValid",value:function e(t,n){if(!t||!t.timestamp)return!1;var r=n||36e5;return Date.now()-t.timestamp<r}},{key:"mergeRemoteCfg",value:function e(t){var n=this.currentConfig,r=n.pid,o=n.app,i=n.endpoint,a=n.remoteConfig,s=n.beforeReport,u=n.properties;return Object.assign(Object.assign(Object.assign({},this.currentConfig),t),{pid:r,app:o,endpoint:i,remoteConfig:a,beforeReport:s,properties:u})}},{key:"destroy",value:function e(){this.currentConfig=null,this.initialized=!1}}])}();t.ConfigManager=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})},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(20),o=n(3);function i(e){return e&&(0,r.isMatchOption)(e.match)&&(0,o.isArray)(e.propagatorTypes)}function a(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a={},s=n?"1":"0";return r.includes("sw8")&&(r=["sw8"]),(0,o.isArray)(r)||(r=[r]),r.forEach((function(n){switch(n){case"jaeger":a["uber-trace-id"]="".concat(e,":").concat(t,":0:").concat(s);break;case"b3":a.b3="".concat(e,"-").concat(t,"-").concat(s);break;case"b3multi":a["X-B3-TraceId"]=e,a["X-B3-SpanId"]=t,a["X-B3-Sampled"]=s;break;case"sw8":if((0,o.isFunction)(btoa)){var r=btoa(e),u=btoa(t),c=btoa(i.appId),l=btoa(i.appVersion),f=btoa(i.viewName),d=btoa(i.host);a.sw8="".concat(s,"-").concat(r,"-").concat(u,"-",0,"-").concat(c,"-").concat(l,"-").concat(f,"-").concat(d)}break;case"tracecontext":default:a.traceparent="00-".concat(e,"-").concat(t,"-0").concat(s),i.tracestate&&(a.tracestate=i.tracestate)}})),i.baggage&&(a.baggage=i.baggage),a}function s(e){var t=["tracecontext"];if((0,o.isBoolean)(e)||!e)return{enable:!!e,sample:100,propagatorTypes:t,allowedUrls:[],tracestate:!0,baggage:!1};var n=e.enable,a=void 0===n||n,s=e.sample,u=void 0===s?100:s,c=e.propagatorTypes,l=void 0===c?t:c,f=e.allowedUrls,d=void 0===f?[]:f,p=e.tracestate,h=void 0===p||p,m=e.baggage,v=void 0!==m&&m,y=[];return(0,o.isArray)(d)&&d.length&&d.forEach((function(e){(0,r.isMatchOption)(e)?y.push({match:e,propagatorTypes:l}):i(e)&&y.push(e)})),{enable:!(0,o.isBoolean)(a)||a,sample:(0,o.isNumber)(u)?u:100,propagatorTypes:l,allowedUrls:y,tracestate:h,baggage:v}}t.isTraceOption=i,t.makeTracingHeaders=a,t.parseTracingOptions=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewStatsCollector=t.ReplayCollector=t.WebVitalsCollector=t.PerfCollector=t.PvCollector=t.StaticResourceCollector=t.ApiCollector=t.LongTaskCollector=t.WhiteScreenCollector=t.ExceptionCollector=t.ClickCollector=void 0;var r=n(42);Object.defineProperty(t,"ClickCollector",{enumerable:!0,get:function(){return r.default}});var o=n(43);Object.defineProperty(t,"ExceptionCollector",{enumerable:!0,get:function(){return o.default}});var i=n(45);Object.defineProperty(t,"WhiteScreenCollector",{enumerable:!0,get:function(){return i.default}});var a=n(50);Object.defineProperty(t,"LongTaskCollector",{enumerable:!0,get:function(){return a.default}});var s=n(51);Object.defineProperty(t,"ApiCollector",{enumerable:!0,get:function(){return s.default}});var u=n(52);Object.defineProperty(t,"StaticResourceCollector",{enumerable:!0,get:function(){return u.default}});var c=n(53);Object.defineProperty(t,"PvCollector",{enumerable:!0,get:function(){return c.default}});var l=n(54);Object.defineProperty(t,"PerfCollector",{enumerable:!0,get:function(){return l.default}});var f=n(55);Object.defineProperty(t,"WebVitalsCollector",{enumerable:!0,get:function(){return f.default}});var d=n(57);Object.defineProperty(t,"ReplayCollector",{enumerable:!0,get:function(){return d.default}});var p=n(68);Object.defineProperty(t,"ViewStatsCollector",{enumerable:!0,get:function(){return p.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){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,s(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(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 c=n(0),l=n(2),f=n(7),d=n(1),p=n(4),h=["button","a","input","select","option","textarea"],m=["id","name","className","href","src"],v=["button","a","input","select","option","textarea","details","summary","audio","video"],y=function(){function e(){var t=this;o(this,e),this.name="click-collector",this.actionHandler=function(e){var n=e.target;if(n instanceof HTMLElement){var r=t.getConfig();if(r.enable){var o=t.getTargetElement(n,r);if(o){var i=(0,l.getCurrentTime)(e.timeStamp),a=(0,c.formatNumber)(performance.now()-e.timeStamp),s=t.ctx.session.getBaseEvent(),u=Object.assign(Object.assign({},s),{timestamp:i,event_type:c.RumEventType.ACTION,type:"click",name:t.getElementName(o),target_name:(0,f.getElementXpath)(o),duration:a,snapshots:t.getElementSnapshots(o)});if(r.trackUserInteractions){u.position=t.getClickPosition(e,o),u.target=t.getTargetInfo(o,e);var d=(0,f.getDocumentInfo)(),p=d.width,h=d.height;u.viewport={width:p,height:h}}t.sendEvent(u)}}}}}return a(e,[{key:"setup",value:function(e,t){(0,p.checkEnable)(e,"click")&&(this.ctx=e,this.sendEvent=t,d.document.addEventListener("click",this.actionHandler,!0))}},{key:"getConfig",value:function(){var e,t,n={name:"click",enable:!1,trackUserInteractions:!1},r=null===(t=null===(e=this.ctx.getConfig())||void 0===e?void 0:e.collectors)||void 0===t?void 0:t.action;return!1===r?n:!0===r?Object.assign(Object.assign({},n),{enable:!0}):(0,c.isObject)(r)?Object.assign(Object.assign(Object.assign({},n),{enable:!0}),r):n}},{key:"getTargetElement",value:function(e,t){return t.enable?t.trackUserInteractions?e:(0,f.getClosestTargetAncestorElement)(e,h):null}},{key:"getElementName",value:function(e){var t=e.localName,n=e.nodeName,r=e.innerText,o=(t||n).toLowerCase(),i=e.getAttribute("type"),a=r?": "+(r.length>20?r.slice(0,20)+"...":r):"",s=i?"".concat(i,"-"):"";return"click on ".concat(s).concat(o).concat(a)}},{key:"getElementSnapshots",value:function(e){var t={};return m.forEach((function(n){var r;"id"===n?r=e.id:"name"===n?r=e.name:"className"===n?r=e.className:"href"===n?r=e.href:"src"===n&&(r=e.src),r&&(t[n]=r)})),0<Object.keys(t).length?JSON.stringify(t).substring(0,1e3):void 0}},{key:"getClickPosition",value:function(e,t){var n,r,o=null!==(n=e.pageX)&&void 0!==n?n:e.clientX+(window.pageXOffset||d.document.documentElement.scrollLeft||0),i=null!==(r=e.pageY)&&void 0!==r?r:e.clientY+(window.pageYOffset||d.document.documentElement.scrollTop||0),a=t.getBoundingClientRect(),s=a.left+(window.pageXOffset||d.document.documentElement.scrollLeft||0),u=a.top+(window.pageYOffset||d.document.documentElement.scrollTop||0);return{x:Math.round(o),y:Math.round(i),ex:Math.round(o-s),ey:Math.round(i-u)}}},{key:"isInteractiveElement",value:function(e){var t=(e.localName||e.nodeName).toLowerCase();return v.includes(t)||e.hasAttribute("onclick")||e.hasAttribute("role")&&["button","link","tab"].includes(e.getAttribute("role")||"")||null!==e.getAttribute("tabindex")||"pointer"===e.style.cursor?1:0}},{key:"isTrustedInteraction",value:function(e,t){if(!t.isTrusted)return 0;var n=e.getBoundingClientRect(),r=20;if(n.width<r||n.height<r)return 0;var o=window.getComputedStyle(e);return"none"===o.display||"hidden"===o.visibility||"0"===o.opacity?0:1}},{key:"getTargetInfo",value:function(e,t){var n=e.getBoundingClientRect();return{selector:(0,f.getElementSelector)(e),width:Math.round(n.width),height:Math.round(n.height),reaction:this.isInteractiveElement(e),trust:this.isTrustedInteraction(e,t)}}},{key:"destroy",value:function(){d.document.removeEventListener("click",this.actionHandler,!0)}}])}();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){return u(e)||s(e)||a(e)||i()}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function s(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e){if(Array.isArray(e))return c(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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,p(n.key),n)}function d(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=h(e,"string");return"symbol"==r(t)?t:t+""}function h(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 m=n(0),v=n(1),y=n(44),g=n(4),b=n(21),S=function(){function e(){l(this,e),this.name="exception-collector"}return d(e,[{key:"setup",value:function(e,t){this.ctx=e,this.sendEvent=t;var n=this;(0,g.checkEnable)(e,"consoleError")&&(0,m.interceptFunction)(v.global.console,b.ExceptionEventType.error,(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];(t||[]).forEach((function(e){return n.sendError(b.ExceptionSource.console,e)}))})),(0,g.checkEnable)(e,"jsError")&&(!this.errorHandle&&(this.errorHandle=this.sendError.bind(this,b.ExceptionSource.onError)),!this.rejectHandle&&(this.rejectHandle=this.sendError.bind(this,b.ExceptionSource.unhandled)),v.global.addEventListener(b.ExceptionEventType.error,this.errorHandle,!0),v.global.addEventListener(b.ExceptionEventType.unhandled,this.rejectHandle,!0))}},{key:"destroy",value:function(){(0,m.restoreFunction)(v.global.console,b.ExceptionEventType.error),v.global.removeEventListener(b.ExceptionEventType.error,this.errorHandle,!0),v.global.removeEventListener(b.ExceptionEventType.unhandled,this.rejectHandle,!0)}},{key:"sendError",value:function(e,t){if((0,m.isObject)(t)){var n=t.target||t.srcElement,r,o,i,a;if(!n||!n.nodeName||1!==n.nodeType)if(t instanceof PromiseRejectionEvent?r=t.reason:t instanceof ErrorEvent?(r=t.error,o=t.colno,i=t.lineno,a=t.filename):r=t,(0,m.isObject)(r)){var s=r,u=s.name,c=s.message,l=s.stack;if(u&&c&&!this.errorFilter(r)){var f=this.ctx.session.getBaseEvent(),d=Object.assign(Object.assign({},f),{event_type:m.RumEventType.EXCEPTION,type:b.ExceptionEventType.error,source:e,name:u,message:c,stack:l,file:a,line:i,column:o}),p=(0,y.getDebugIdsMap)(l);p&&(d.binary_images=p),this.sendEvent(d)}}}}},{key:"errorFilter",value:function(e){var t,n,r=(this.ctx.getConfig().filters||{}).exception;if(r)if((0,m.isMatchOption)(r))t=[r];else{if(!(0,m.isArray)(r))return!1;t=r}else t=[];t&&!(0,m.isArray)(t)&&(t=[t]);var i=[].concat(o(t),[/^Script error\.?$/,/failed[\w\s]+fetch/i]);return(0,m.matchList)(i,e.name,!0,e)||(0,m.matchList)(i,e.message,!0,e)||(0,m.matchList)(i,e.stack,!0,e)}}])}();t.default=S},function(e,t,n){"use strict";function r(e,t){return u(e)||s(e,t)||i(e,t)||o()}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(u){c=!0,o=u}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function u(e){if(Array.isArray(e))return e}Object.defineProperty(t,"__esModule",{value:!0}),t.getDebugIdsMap=void 0;var c=n(1),l=new Map,f=function(e){var t,n;return p(e).reduce((function(e,t){var n=t.filename;return n?(l.has(n)||d(),l.has(n)&&(e[n]=l.get(n)),e):e}),{})};t.getDebugIdsMap=f;var d=function(){[c.global._armsRumDebugIds,c.global._sentryDebugIds].forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=p(t,{onlyTop:!0}),r=n.length&&n[0].filename;r&&!l.has(r)&&l.set(r,e[t])}))}))},p=function(e,t){var n=t||{},r=n.initLine,o=void 0===r?0:r,i=n.onlyTop,a=[];if("string"!=typeof e)return a;var s=e.split("\n");if(s.length)for(var u,c=o;c<s.length;c++)if(u=s[c],h(u))try{u=v(u);var l=y(u);if(l&&(a.push(l),void 0!==i&&i))break}catch(e){}return a},h=function(e){return!(1024<e.length)},m=/\(error: (.*)\)/,v=function(e){return m.test(e)?e.replace(m,"$1"):e},y=function(e){var t;return(t=C(e))||(t=I(e)),t},g=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,b=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,S=/\((\S*)(?::(\d+))(?::(\d+))\)/,C=function(e){var t=g.exec(e);if(t){var n=r(t,4),o=n[1],i=n[2],a=n[3];return A(o,O,+i,+a)}var s=b.exec(e);if(s){var u;if(s[2]&&0===s[2].indexOf("eval")){var c=S.exec(s[2]);c&&(s[2]=c[1],s[3]=c[2],s[4]=c[3])}var l,f=r(T(s[1]||O,s[2]),2),d=f[0],p=f[1];return A(p,d,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}return null},w=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,E=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,I=function(e){var t=w.exec(e);if(t){var n;if(t[3]&&-1<t[3].indexOf(" > eval")){var o=E.exec(t[3]);o&&(t[1]=t[1]||"eval",t[3]=o[1],t[4]=o[2],t[5]="")}var i=t[3],a=t[1]||O,s,u=r(T(a,i),2);return a=u[0],i=u[1],A(i,a,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}return null},T=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1===e.indexOf("@")?O:e.split("@")[0],n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},O="UNKNOWN_FUNCTION",A=function(e,t,n,r){var o={filename:e,function:"<anonymous>"===t?O:t};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),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(){function e(e,n,r,o){var a=n&&n.prototype instanceof t?n:t,c=Object.create(a.prototype);return i(c,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,u=0;!f&&c&&!n&&u<l.length;u++){var n,r=l[u],o=p.p,h=r[2];3<e?(n=h===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=s):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,p.v=t,p.n=r[1]):o<h&&(n=3>e||r[0]>t||t>h)&&(r[4]=e,r[5]=t,p.n=h,i=0))}if(n||1<e)return d;throw f=!0,t}var o,i,a,c=0,l=n||[],f=!1,p={p:0,n:0,v:s,a:r,f:r.bind(s,4),d:function e(t,n){return o=t,i=0,a=s,p.n=n,d}};return function(n,l,h){if(1<c)throw TypeError("Generator is already running");for(f&&1===l&&r(l,h),i=l,a=h;(u=2>i?s:a)||!f;){o||(i?3>i?(1<i&&(p.n=-1),r(i,a)):p.n=a:p.v=a);try{if(c=2,o){if(i||(n="next"),u=o[n]){if(!(u=u.call(o,a)))throw TypeError("iterator result is not an object");if(!u.done)return u;a=u.value,2>i&&(i=0)}else 1===i&&(u=o.return)&&u.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=s}else if((u=(f=0>p.n)?a:e.call(t,p))!==d)break}catch(e){o=s,i=1,a=e}finally{c=1}}return{value:u,done:f}}}(e,r,o),!0),c}function t(){}function n(){}function r(){}function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,i(e,f,"GeneratorFunction")),e.prototype=Object.create(h),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var s,u,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",f=c.toStringTag||"@@toStringTag",d={};u=Object.getPrototypeOf;var p=[][l]?u(u([][l]())):(i(u={},l,(function(){return this})),u),h=r.prototype=t.prototype=Object.create(p);return n.prototype=r,i(h,"constructor",r),i(r,"constructor",n),n.displayName="GeneratorFunction",i(r,f,"GeneratorFunction"),i(h),i(h,f,"Generator"),i(h,l,(function(){return this})),i(h,"toString",(function(){return"[object Generator]"})),(o=function t(){return{w:e,m:a}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,a){function s(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=s(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 i,a=!0,u=!1;return{s:function t(){n=n.call(e)},n:function e(){var t=n.next();return a=t.done,t},e:function e(t){u=!0,i=t},f:function e(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function s(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d(n.key),n)}function f(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=p(e,"string");return"symbol"==r(t)?t:t+""}function p(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 h=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});var m=n(0),v=n(46),y=n(1),g=n(5),b=null,S={LEAVE:function e(t){return y.document.addEventListener("beforeunload",t),function(){return y.document.removeEventListener("beforeunload",t)}},ROUTE_CHANGE:function e(t,n){return(0,m.interceptFunction)(y.global.history,"pushState",t),(0,m.interceptFunction)(y.global.history,"replaceState",t),y.global.addEventListener("popstate",t),function(){y.global.removeEventListener("popstate",t)}},ERROR:function e(t){return y.global.addEventListener("error",t),function(){return y.global.removeEventListener("error",t)}},LOAD:function e(t){return"complete"===y.document.readyState?(setTimeout(t,0),function(){}):(y.global.addEventListener("load",t),function(){return y.global.removeEventListener("load",t)})}},C=function(){function e(){var t=this;c(this,e),this.name="white-screen-collector",this.observers=[],this.abort=function(){t.observers.forEach((function(e){return e()})),t.observers=[]},this.blankHandler=function(e,n){var r=e.target,i=e.tester,s=e.delay,u=void 0===s?0:s,c=e.configOptions,l=void 0===c?{}:c,f=e.ignoreUrlList,d=void 0===f?[]:f,p=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];return h(t,void 0,void 0,o().m((function e(){var t,s,c,f,h,m,S,C,w=this;return o().w((function(e){for(;;)switch(e.p=e.n){case 0:if(!p){e.n=10;break}if(!d.includes(y.location.pathname)&&!d.includes(y.location.hash)){e.n=1;break}return e.a(2);case 1:e.p=1,t=a(d),e.p=2,t.s();case 3:if((s=t.n()).done){e.n=5;break}if(c=s.value,!(f=new RegExp(c)).test(y.location.href)){e.n=4;break}return e.a(2);case 4:e.n=3;break;case 5:e.n=7;break;case 6:e.p=6,S=e.v,t.e(S);case 7:return e.p=7,t.f(),e.f(7);case 8:e.n=10;break;case 9:e.p=9,C=e.v;case 10:if((h=y.document.querySelector(r))&&i){e.n=11;break}return e.a(2);case 11:if((0,v.testerValidator)(i)){e.n=12;break}return console.warn("[RUM] Invalid tester type. Expected either a function or a string."),e.a(2);case 12:b&&(clearTimeout(b),b=null),m=(0,g.getCurrentURL)(),b="LEAVE"!==n&&"ERROR"!==n?setTimeout((function(){w.blankChecker(i,h,l,n,m)}),u):setTimeout((function(){w.blankChecker(i,h,l,n,m)}),0);case 13:return e.a(2)}}),e,null,[[2,6,7,8],[1,9]])})))},this.blankChecker=function(e,n,r,i,a){return h(t,void 0,void 0,o().m((function t(){var s,u,c,l,f,d,p;return o().w((function(t){for(;;)switch(t.n){case 0:return t.n=1,(0,v.blankCheck)(e,n,r);case 1:if(s=t.v,u=s.hasContent,c=s.message,l=void 0===c?"":c,f=s.snapshot,!u){t.n=2;break}return t.a(2);case 2:d=this.ctx.session.getBaseEvent(),p=Object.assign(Object.assign({},d),{event_type:m.RumEventType.EXCEPTION,name:"A white screen occurs at ".concat(i),type:"blank",message:l,snapshots:JSON.stringify(Object.assign(Object.assign({},f),{when:i,url:a}))}),this.sendEvent(p),this.abort();case 3:return t.a(2)}}),t,this)})))},this.checkWhiteBlank=function(e){return h(t,void 0,void 0,o().m((function t(){return o().w((function(t){for(;;)switch(t.n){case 0:this.blankHandler(e,"CUSTOM");case 1:return t.a(2)}}),t,this)})))}}return f(e,[{key:"setup",value:function e(t,n){var r=this;this.ctx=t,this.sendEvent=n;var o=t.getConfig(),i=o.whiteScreen,a=o.spaMode;if(i){var s=i.detectionRules;Array.isArray(s)&&s.length&&s.forEach((function(e){e.test_when&&e.test_when.forEach((function(t){var n,o=S[t];if(o){var i=o((function n(){try{r.blankHandler(e,t)}catch(e){console.warn("[RUM] Failed to inject blank handler: ",e)}}),a);r.observers.push(i)}}))}))}}},{key:"destroy",value:function e(){this.abort()}}])}();t.default=C},function(e,t,n){"use strict";function r(){function e(e,n,r,i){var a=n&&n.prototype instanceof t?n:t,c=Object.create(a.prototype);return o(c,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,u=0;!f&&c&&!n&&u<l.length;u++){var n,r=l[u],o=p.p,h=r[2];3<e?(n=h===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=s):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,p.v=t,p.n=r[1]):o<h&&(n=3>e||r[0]>t||t>h)&&(r[4]=e,r[5]=t,p.n=h,i=0))}if(n||1<e)return d;throw f=!0,t}var o,i,a,c=0,l=n||[],f=!1,p={p:0,n:0,v:s,a:r,f:r.bind(s,4),d:function e(t,n){return o=t,i=0,a=s,p.n=n,d}};return function(n,l,h){if(1<c)throw TypeError("Generator is already running");for(f&&1===l&&r(l,h),i=l,a=h;(u=2>i?s:a)||!f;){o||(i?3>i?(1<i&&(p.n=-1),r(i,a)):p.n=a:p.v=a);try{if(c=2,o){if(i||(n="next"),u=o[n]){if(!(u=u.call(o,a)))throw TypeError("iterator result is not an object");if(!u.done)return u;a=u.value,2>i&&(i=0)}else 1===i&&(u=o.return)&&u.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=s}else if((u=(f=0>p.n)?a:e.call(t,p))!==d)break}catch(e){o=s,i=1,a=e}finally{c=1}}return{value:u,done:f}}}(e,r,i),!0),c}function t(){}function n(){}function i(){}function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,o(e,f,"GeneratorFunction")),e.prototype=Object.create(h),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var s,u,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",f=c.toStringTag||"@@toStringTag",d={};u=Object.getPrototypeOf;var p=[][l]?u(u([][l]())):(o(u={},l,(function(){return this})),u),h=i.prototype=t.prototype=Object.create(p);return n.prototype=i,o(h,"constructor",i),o(i,"constructor",n),n.displayName="GeneratorFunction",o(i,f,"GeneratorFunction"),o(h),o(h,f,"Generator"),o(h,l,(function(){return this})),o(h,"toString",(function(){return"[object Generator]"})),(r=function t(){return{w:e,m:a}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(o=function e(t,n,r,a){function s(e,n){o(t,e,(function(t){return this._invoke(e,n,t)}))}n?i?i(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}var i=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};Object.defineProperty(t,"__esModule",{value:!0}),t.blankCheckWithSingleMethod=t.blankCheck=t.testerValidator=void 0;var s=n(47),u=n(49),c=function e(t){return"function"==typeof t||!("string"!=typeof t)&&["HAS_CONTENT","SCREENSHOT","SAMPLE"].includes(t)};t.testerValidator=c;var l=function e(n,o,a){return i(void 0,void 0,void 0,r().m((function e(){var i,s,u,c,l,f;return r().w((function(e){for(;;)switch(e.n){case 0:if("function"!=typeof n){e.n=2;break}return e.n=1,n(o);case 1:return i=e.v,s=i.hasContent,u=i.message,c=void 0===u?"":u,l=i.snapshot,f=void 0===l?{}:l,e.a(2,{hasContent:s,message:c,snapshot:Object.assign(Object.assign({},f),{method:"CUSTOM"})});case 2:if("string"!=typeof n){e.n=4;break}return e.n=3,(0,t.blankCheckWithSingleMethod)(n,o,a);case 3:return e.a(2,e.v);case 4:return e.a(2)}}),e)})))};t.blankCheck=l;var f=function e(t,n,o){return i(void 0,void 0,void 0,r().m((function e(){var i,c,l,f,p,h;return r().w((function(e){for(;;)switch(e.n){case 0:if("HAS_CONTENT"!==t){e.n=1;break}return e.a(2,{hasContent:null!=n&&n.textContent,snapshot:{method:t}});case 1:if("SCREENSHOT"!==t){e.n=3;break}return e.n=2,(0,s.performScreenshotCheck)(n,o);case 2:return i=e.v,c=i.result,l=a(i,["result"]),e.a(2,{hasContent:c,message:c?"":d(l),snapshot:Object.assign({method:t},l)});case 3:if("SAMPLE"!==t){e.n=4;break}return f=(0,u.performSampleCheck)(n,o),p=f.result,h=a(f,["result"]),e.a(2,{hasContent:p,message:p?"":d(h),snapshot:Object.assign({method:t},h)});case 4:return e.a(2)}}),e)})))};t.blankCheckWithSingleMethod=f;var d=function e(t){return"The white screen occurrence rate is ".concat(t.rate,", exceeding the threshold of ").concat(t.threshold,". A total of ").concat(t.checkPoints," detection points were set, and ").concat(t.whitePixels," of them were hit.")}},function(e,t,n){"use strict";function r(){function e(e,n,r,i){var a=n&&n.prototype instanceof t?n:t,c=Object.create(a.prototype);return o(c,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,u=0;!f&&c&&!n&&u<l.length;u++){var n,r=l[u],o=p.p,h=r[2];3<e?(n=h===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=s):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,p.v=t,p.n=r[1]):o<h&&(n=3>e||r[0]>t||t>h)&&(r[4]=e,r[5]=t,p.n=h,i=0))}if(n||1<e)return d;throw f=!0,t}var o,i,a,c=0,l=n||[],f=!1,p={p:0,n:0,v:s,a:r,f:r.bind(s,4),d:function e(t,n){return o=t,i=0,a=s,p.n=n,d}};return function(n,l,h){if(1<c)throw TypeError("Generator is already running");for(f&&1===l&&r(l,h),i=l,a=h;(u=2>i?s:a)||!f;){o||(i?3>i?(1<i&&(p.n=-1),r(i,a)):p.n=a:p.v=a);try{if(c=2,o){if(i||(n="next"),u=o[n]){if(!(u=u.call(o,a)))throw TypeError("iterator result is not an object");if(!u.done)return u;a=u.value,2>i&&(i=0)}else 1===i&&(u=o.return)&&u.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=s}else if((u=(f=0>p.n)?a:e.call(t,p))!==d)break}catch(e){o=s,i=1,a=e}finally{c=1}}return{value:u,done:f}}}(e,r,i),!0),c}function t(){}function n(){}function i(){}function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,o(e,f,"GeneratorFunction")),e.prototype=Object.create(h),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var s,u,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",f=c.toStringTag||"@@toStringTag",d={};u=Object.getPrototypeOf;var p=[][l]?u(u([][l]())):(o(u={},l,(function(){return this})),u),h=i.prototype=t.prototype=Object.create(p);return n.prototype=i,o(h,"constructor",i),o(i,"constructor",n),n.displayName="GeneratorFunction",o(i,f,"GeneratorFunction"),o(h),o(h,f,"Generator"),o(h,l,(function(){return this})),o(h,"toString",(function(){return"[object Generator]"})),(r=function t(){return{w:e,m:a}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(o=function e(t,n,r,a){function s(e,n){o(t,e,(function(t){return this._invoke(e,n,t)}))}n?i?i(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}var i=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.performScreenshotCheck=void 0;var a=n(48),s=n(1),u=function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return i(void 0,void 0,void 0,r().m((function e(){var o,i,u,l,f,d,p,h,m,v,y,g,b,S,C,w,E,I,T,O,A,k,_,R,M,j,N,x,P,L,F;return r().w((function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=window.innerWidth,i=window.innerHeight,u={colorRange:["rgb(255, 255, 255)"],horizontalOffset:0,verticalOffset:0,pixels:10,threshold:.8,dpr:.3,debug:!1,ignoreElements:[],fillColor:"rgba(0, 100, 200, 255)"},l=Object.assign(Object.assign({},u),n),f=l.debug,d=l.colorRange,p=l.horizontalOffset,h=l.verticalOffset,m=l.pixels,v=l.threshold,y=l.dpr,g=o*y,b=i*y,(S=s.document.createElement("canvas")).height=b,S.width=g,S.style.width="".concat(g,"px"),S.style.height="".concat(b,"px"),C=S.getContext("2d",{willReadFrequently:!0}),"string"!=typeof(w=(0,a.html2canvas)(t,{ignoreElements:l.ignoreElements,fillColor:l.fillColor}))){e.n=1;break}return e.a(2,{result:!0,image:null,error:null});case 1:return(E=new Image).src=w.toDataURL("image/png"),E.crossOrigin="Anonymous",e.n=2,new Promise((function(e){E.addEventListener("load",(function(){return e()}))}));case 2:for(C.drawImage(E,0,0,g,b),I=0,T=2*m,O=2*m,A=Math.floor((g-p*y)/T),k=Math.floor((b-h*y)/O),_=A*k,R=0;R<A;R++)for(M=0;M<k;M++)j=R*T,N=M*O,x=C.getImageData(j+p*y,N+h*y,m,m),P=x.data,c(P,d)&&I++;return L={result:I<_*v,rate:I/_,image:E.src,whitePixels:I,checkPoints:_,threshold:v},f&&console.log(L),e.a(2,L);case 3:return e.p=3,F=e.v,(null==n?void 0:n.debug)&&console.log("[RUM] Failed to inject blank handler: ",F),e.a(2,{result:!0,image:null,error:F.toString()})}}),e,null,[[0,3]])})))};t.performScreenshotCheck=u;var c=function e(t,n){for(var r,o=!0,i=0;i<t.length;i+=4)if(r="rgb(".concat(t[i],", ").concat(t[i+1],", ").concat(t[i+2],")"),!n.includes(r)){o=!1;break}return o}},function(e,t,n){"use strict";function r(e,t){return u(e)||s(e,t)||i(e,t)||o()}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(u){c=!0,o=u}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function u(e){if(Array.isArray(e))return e}function c(e,t,n){return t=p(t),l(e,d()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function l(e,t){if(t&&("object"==v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function v(e){return(v="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 y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,S(n.key),n)}function b(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(e){var t=C(e,"string");return"symbol"==v(t)?t:t+""}function C(e,t){if("object"!=v(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.html2canvas=void 0;var w=n(22),E=function(){function e(t){y(this,e);var n=t.getBoundingClientRect(),r=n.top,o=n.left,i=n.width,a=n.height;this.top=r,this.left=o,this.width=i,this.height=a}return b(e,null,[{key:"getPoints",value:function(e){var t=e.top,n=e.left,r=e.width,o=e.height;return[[n,t],[n+r,t],[n+r,t+o],[n,t+o]]}}])}(),I=function(){function e(t){y(this,e),this.container=t,this.negativeZIndex=[],this.nonInlineLevel=[],this.inlineLevel=[],this.positiveZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[]}return b(e,null,[{key:"stackingSortCompare",value:function(e,t){return+e.container.styles.zIndex-+t.container.styles.zIndex}}])}(),T=function(){function e(t,n,r){y(this,e),this.bounds=this.getTrueBounds(n,r),this.text=t,this.parent=n}return b(e,[{key:"getTrueBounds",value:function(e,t){if(t)try{var n=document.createRange();n.selectNodeContents(t);var r=n.getBoundingClientRect();return{top:r.top,left:r.left,width:r.width,height:r.height}}catch(e){}return this.getTrueBoundsFallback(e)}},{key:"getTrueBoundsFallback",value:function(e){var t=e.bounds,n=t.top,r=t.left,o=t.width,i=t.height,a=e.styles,s=a.paddingLeft,u=a.paddingTop,c=a.borderWidth,l=a.fontSize;return{top:n+=parseInt(u)+parseInt(c)+parseInt(l),left:r+=parseInt(s)+parseInt(c),width:o,height:i}}}])}(),O=b((function e(t){y(this,e),this.styles=window.getComputedStyle(t),this.bounds=new E(t),this.elements=[],this.textNodes=[],this.stackingFlag=!1,this.element=t})),A=function(e){function t(e){var n;return y(this,t),(n=c(this,t,[e])).intrinsicWidth=e.width,n.intrinsicHeight=e.height,n}return h(t,e),b(t)}(O),k=function(e){function t(e){var n;return y(this,t),(n=c(this,t,[e])).type=e.type.toLowerCase(),n.value="password"===e.type?Array(e.value.length+1).join("\u2022"):e.value||e.placeholder,n}return h(t,e),b(t)}(O),_=function(e){function t(e){var n;y(this,t),n=c(this,t,[e]);var r=e.options[e.selectedIndex||0];return n.value=r&&r.text||"",n}return h(t,e),b(t)}(O),R=function(e){function t(e){var n;return y(this,t),(n=c(this,t,[e])).intrinsicWidth=e.width,n.intrinsicHeight=e.height,n}return h(t,e),b(t)}(O),M=function(e){function t(e){var n;return y(this,t),(n=c(this,t,[e])).intrinsicWidth=e.offsetWidth,n.intrinsicHeight=e.offsetHeight,n}return h(t,e),b(t)}(O),j=function(e){function t(e){var n;return y(this,t),(n=c(this,t,[e])).intrinsicWidth=e.width.baseVal.value,n.intrinsicHeight=e.height.baseVal.value,n}return h(t,e),b(t)}(O),N=function(e){function t(e){var n;y(this,t),n=c(this,t,[e]);var r=new E(e),o=r.width,i=r.height;return n.intrinsicWidth=o,n.intrinsicHeight=i,n}return h(t,e),b(t)}(O),x=function(){function e(t){y(this,e),this.canvas=document.createElement("canvas"),this.ctx2d=this.canvas.getContext("2d"),this.options=t}return b(e,[{key:"renderStack",value:function(e){var t=this,n=e.negativeZIndex,r=void 0===n?[]:n,o=e.nonInlineLevel,i=void 0===o?[]:o,a=e.inlineLevel,s=void 0===a?[]:a,u=e.positiveZIndex,c=void 0===u?[]:u,l=e.zeroOrAutoZIndexOrTransformedOrOpacity,f=void 0===l?[]:l;r.sort(I.stackingSortCompare),c.sort(I.stackingSortCompare),this.ctx2d.save(),this.setOpacity(e.container),this.renderNodeBackgroundAndBorders(e.container),r.map((function(e){return t.renderStack(e)})),this.renderNodeContent(e.container),i.map((function(e){return t.renderNode(e)})),s.map((function(e){return t.renderNode(e)})),f.map((function(e){return t.renderStack(e)})),c.map((function(e){return t.renderStack(e)})),this.ctx2d.restore()}},{key:"renderNode",value:function(e){this.renderNodeBackgroundAndBorders(e),this.renderNodeContent(e)}},{key:"setOpacity",value:function(e){var t=e.styles,n=this.ctx2d,r=+t.opacity;1>r&&(n.globalAlpha=r)}},{key:"renderNodeBackgroundAndBorders",value:function(e){var t=e.bounds,n=e.styles,r=n.backgroundColor,o=n.backgroundImage,i=parseInt(n.borderWidth),a=E.getPoints(t);if("none"!==o){var s=this.options.fillColor;this.drawFillRect(a,s)}else"0"!==r.slice(5,-1).split(", ")[3]&&this.drawFillRect(a,r);if(i){var u=n.borderColor;this.drawBorderRect(a,i,u)}}},{key:"renderNodeContent",value:function(e){var t=this;("I"===e.element.tagName||e instanceof A||e instanceof N||e instanceof R||e instanceof M||e instanceof j)&&this.renderReplacedElement(e),e instanceof _&&this.renderText(new T(e.value,e),e.styles),e instanceof k&&this.renderInput(e),e.textNodes.length&&e.textNodes.map((function(n){return t.renderText(n,e.styles)}))}},{key:"renderText",value:function(e,t){var n=this.ctx2d;n.save(),n.font="".concat(t.fontWeight," ").concat(t.fontSize," ").concat(t.fontFamily),n.fillStyle=t.color;try{var r=n.measureText("M"),o=parseFloat(t.fontSize)||16,i=parseFloat(t.lineHeight)||1.2*o,a=e.bounds.height>1.5*i,s=["pre","pre-wrap","pre-line"].includes(t.whiteSpace),u=s?e.text:e.text.replace(/\n/g," ");if(a){var c=e.bounds.top+r.fontBoundingBoxAscent;if(s&&u.includes("\n")){var l;u.split("\n").forEach((function(t){n.fillText(t,e.bounds.left,c),c+=i}))}else{var f=n.measureText(u.trim()).width,d=Math.ceil(f/e.bounds.width);if(1>=d)n.fillText(u,e.bounds.left,c);else for(var p=Math.ceil(u.length/d),h=0;h<d;h++){var m=h*p,v=Math.min(m+p,u.length),y=u.substring(m,v);n.fillText(y,e.bounds.left,c),c+=i}}}else n.fillText(u,e.bounds.left,e.bounds.top+r.fontBoundingBoxAscent)}catch(t){n.fillText(e.text,e.bounds.left,e.bounds.top)}n.restore()}},{key:"renderInput",value:function(e){var t=e.value,n=e.styles,r=new T(t,e);this.renderText(r,n)}},{key:"renderReplacedElement",value:function(e){if(0<e.intrinsicWidth&&0<e.intrinsicHeight||"I"===e.element.tagName){var t=e.bounds,n=e.styles,r=this.options.fillColor,o=parseInt(n.borderWidth),i=E.getPoints(t);this.drawFillRect(i,r),o&&this.drawBorderRect(i,o,r)}}},{key:"render",value:function(e){var t=this.canvas,n=this.ctx2d,r=(0,w.getTrueArea)(e),o=r.width,i=r.height,a=r.left,s=r.top;t.width=o,t.height=i,t.style.width=o+"px",t.style.height=i+"px",n.scale(1,1),n.fillStyle="#fff",n.translate(-a,-s),n.fillRect(a,s,o,i);var u=D(e,this.options),c=V(u);return this.renderStack(c),this.canvas}},{key:"drawPathByPoints",value:function(e){var t=this;e.map((function(e,n){0===n?t.ctx2d.moveTo(e[0],e[1]):t.ctx2d.lineTo(e[0],e[1])}))}},{key:"drawFillRect",value:function(e,t){var n=this.ctx2d;n.save(),n.beginPath(),this.drawPathByPoints(e),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}},{key:"drawBorderRect",value:function(e,t,n){var r=this.ctx2d,o=this.getBorderPoints(e,t);r.save(),r.beginPath(),this.drawPathByPoints(o),r.closePath(),r.lineWidth=t,r.strokeStyle=n,r.stroke(),r.restore()}},{key:"getBorderPoints",value:function(e,t){var n=r(e,4),o=n[0],i=n[1],a=n[2],s=n[3];return[[o[0]+t/2,o[1]+t/2],[i[0]-t/2,i[1]+t/2],[a[0]-t/2,a[1]-t/2],[s[0]+t/2,s[1]-t/2]]}}])}(),P=function(e){try{var t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth,o;return 0>t.bottom||0>t.right||t.left>=r||t.top>=n}catch(e){}},L=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return F(e,t)};t.html2canvas=L;var F=function(e,t){if(!e||"object"!==v(e))return"Invalid element provided as first argument";var n={fillColor:t.fillColor,ignoreElements:t.ignoreElements},r,o;return new x(n).render(e)},D=function(e,t){var n=B(e),r=(0,w.getElementsBySelectors)(t.ignoreElements);return U(e,n,r),n},U=function(e,t,n){Array.from(e.childNodes).map((function(e){if(!n.includes(e))if(W(e)){if(0<e.textContent.trim().length){var r=new T(e.textContent,t,e);t.textNodes.push(r)}}else{if(H(e)||P(e))return;var o=B(e),i=o.styles,a=i.position,s=i.transform,u=+i.zIndex,c=+i.opacity;("static"!==a&&!isNaN(u)||1>c||"none"!==s)&&(o.stackingFlag=!0),t.elements.push(o),e.shadowRoot?U(e.shadowRoot,o,n):"TEXTAREA"!==e.tagName&&"svg"!==e.tagName&&"SELECT"!==e.tagName&&U(e,o,n)}}))},B=function(e){return Z(e)?new A(e):K(e)?new R(e):Y(e)?new M(e):z(e)?new j(e):q(e)?new _(e):J(e)?new k(e):Q(e)?new N(e):new O(e)},V=function(e){var t=new I(e);return G(e,t),t},G=function(e,t){e.elements.map((function(e){if(e.stackingFlag){var n=new I(e),r=e.styles.position,o=+e.styles.zIndex;"static"!==r&&0<o?t.positiveZIndex.push(n):"static"!==r&&0>o?t.negativeZIndex.push(n):t.zeroOrAutoZIndexOrTransformedOrOpacity.push(n),G(e,n)}else 0<=e.styles.display.indexOf("inline")?t.inlineLevel.push(e):t.nonInlineLevel.push(e),G(e,t)}))},W=function(e){return 3===e.nodeType},H=function(e){return 8===e.nodeType},Z=function(e){return"IMG"===e.tagName},Y=function(e){return"VIDEO"===e.tagName},K=function(e){return"CANVAS"===e.tagName},z=function(e){return"svg"===e.tagName},q=function(e){return"SELECT"===e.tagName},J=function(e){return"INPUT"===e.tagName},Q=function(e){return"IFRAME"===e.tagName}},function(e,t,n){"use strict";function r(e){return s(e)||a(e)||i(e)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e){if(Array.isArray(e))return u(e)}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.performSampleCheck=void 0;var c=n(22),l=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=t.checkPoints,o=void 0===n?10:n,i=t.sampleMethod,a=void 0===i?2:i,s=t.threshold,u=void 0===s?.8:s,l=t.whiteBoxElements,d=void 0===l?[]:l,p=t.debug,h=[].concat(r((0,c.getElementsBySelectors)(d,e)),[e]),m=f(e,o,a),v=m.length,y=0;m.forEach((function(e){var t;h.includes((t=document).elementFromPoint.apply(t,r(e)))&&y++}));var g=y/v,b={result:g<u,rate:g,whitePixels:y,checkPoints:v,threshold:u};return void 0!==p&&p&&console.log(b,h,m),b};t.performSampleCheck=l;var f=function(e,t,n){var r=(0,c.getTrueArea)(e),o=r.top,i=r.left,a=r.width,s=r.height,u=i+a/2,l=o+s/2,f=a/2/(t+1),d=s/2/(t+1),p=[[u,l]];if([1,3].includes(n))for(var h=1;h<=t;h++)p.push([u+h*f,l]),p.push([u,l+h*d]),p.push([u-h*f,l]),p.push([u,l-h*d]);if([2,3].includes(n))for(var m=1;m<=t;m++)p.push([u+m*f,l+m*d]),p.push([u+m*f,l-m*d]),p.push([u-m*f,l-m*d]),p.push([u-m*f,l+m*d]);return 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){return s(e)||a(e,t)||f(e,t)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(u){c=!0,o=u}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function s(e){if(Array.isArray(e))return e}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function c(e){return p(e)||d(e)||f(e)||l()}function l(){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 f(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function d(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function p(e){if(Array.isArray(e))return h(e)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(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,g(n.key),n)}function y(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e){var t=b(e,"string");return"symbol"==r(t)?t:t+""}function b(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),C=n(2),w=n(6),E=n(1),I=n(4),T=E.global.requestAnimationFrame,O=E.global.cancelAnimationFrame,A=function(){function e(){m(this,e),this.name="longtask-collector",this.CONTINUOUS_FRAME_GAP=17,this.REPORT_CONTINUOUS_FRAME_TIMESHOLD=150,this.LONG_FRAME_THRESHOLD=50,this.ltPerfCache=[],this.rafTimerMap=new Map}return y(e,[{key:"setup",value:function(e,t){if((0,I.checkEnable)(e,S.RumEventType.LONG_TASK,!1)&&(this.ctx=e,this.sendEvent=t,this.loafPerfObserver=(0,C.initPerfObserver)("long-animation-frame",this.loafHandler.bind(this)),!this.loafPerfObserver)){if(!(0,S.isFunction)(T)||!(0,S.isFunction)(O))return;this.ltPerfObserver=(0,C.initPerfObserver)("longtask",this.ltHandler.bind(this)),T(this.initRafObserver.bind(this))}}},{key:"loafHandler",value:function(e){var t=this;e.forEach((function(e){var n=e.startTime,r=e.duration,o=e.scripts,i=void 0===o?[]:o,a=n+r;if(t.clearLoafTimer(),t.loafSeqCache&&n-t.loafSeqCache.endTime<t.CONTINUOUS_FRAME_GAP?(t.loafSeqCache.frameCount++,t.loafSeqCache.endTime=a,t.loafSeqCache.attribution=[].concat(c(t.loafSeqCache.attribution),c(i))):t.loafSeqCache={view:(0,w.getCurView)(t.ctx),source:"LoAF",startTime:n,endTime:a,frameCount:1,attribution:i},t.loafSeqCache.endTime-t.loafSeqCache.startTime>=t.REPORT_CONTINUOUS_FRAME_TIMESHOLD){var s=Object.assign({},t.loafSeqCache);t.loafTimer=setTimeout((function(){try{t.sendLongTask(s),t.loafTimer=null}catch(e){}}),200)}}))}},{key:"clearLoafTimer",value:function(){this.loafTimer&&(clearTimeout(this.loafTimer),this.loafTimer=null)}},{key:"ltHandler",value:function(e){var t=this;e.forEach((function(e){return t.ltPerfCache.push(e)}))}},{key:"initRafObserver",value:function(){var e,t=this,n=(0,C.getCurrentTime)(),r=function(){var o=(0,C.getCurrentTime)();if(o-n>=t.LONG_FRAME_THRESHOLD)e?(e.frameCount++,e.endTime=o):e={view:(0,w.getCurView)(t.ctx),source:"rAF",startTime:n,endTime:o,frameCount:1,attribution:[]};else if(e&&e.endTime-e.startTime>=t.LONG_FRAME_THRESHOLD){var i=Object.assign({},e),a=setTimeout((function(){try{t.mergeLtPerf(i),t.rafTimerMap.delete(n)}catch(e){}}),200);t.rafTimerMap.set(n,a),e=null}n=o,t.rafRequestId=T(r)};T(r)}},{key:"mergeLtPerf",value:function(e){var t,n=-1,r=u(this.ltPerfCache.entries());try{for(r.s();!(t=r.n()).done;){var i=o(t.value,2),a=i[0],s=i[1],l=s.startTime,f=s.attribution,d=void 0===f?[]:f,p=(0,C.getCurrentTime)(l);if(e.endTime<p)break;e.startTime<p&&(e.attribution=[].concat(c(e.attribution),c(d)),n=a)}}catch(e){r.e(e)}finally{r.f()}this.ltPerfCache.splice(0,n+1),this.sendLongTask(e)}},{key:"sendLongTask",value:function(e){var t=e=this.loafSequenceFilter(e),n=t.view,r=t.source,o=t.startTime,i=t.endTime,a=t.frameCount,s=t.attribution,u=i-o,c=Math.round(1e3/(u/a)),l=this.ctx.session.getBaseEvent(),f=(0,C.getCurrentTime)(),d=(0,C.getCurrentTime)(o);d>f&&(d=o);var p=Object.assign(Object.assign(Object.assign({},l),n),{event_type:S.RumEventType.LONG_TASK,type:"fps",source:r,timestamp:d,duration:u,fps:c,snapshots:JSON.stringify(s)});this.sendEvent(p)}},{key:"loafSequenceFilter",value:function(e){var t=e.source,n=e.attribution;return"rAF"===t&&(n=n.filter((function(e){return"unknown"!==e.name}))),5<=n.length&&(n=n.sort((function(e,t){return t.duration-e.duration})).slice(0,5)),e.attribution=n,e}},{key:"clearLoafObserver",value:function(){this.loafPerfObserver&&(this.loafPerfObserver.disconnect(),this.loafPerfObserver=null),this.clearLoafTimer(),this.loafSeqCache=null}},{key:"clearLtObserver",value:function(){this.ltPerfObserver&&(this.ltPerfObserver.disconnect(),this.ltPerfObserver=null),this.ltPerfCache=null}},{key:"clearRafObserver",value:function(){this.rafRequestId&&(O(this.rafRequestId),this.rafRequestId=null),this.rafTimerMap.forEach((function(e){return clearTimeout(e)})),this.rafTimerMap.clear()}},{key:"destroy",value:function(){this.clearLoafObserver(),this.clearLtObserver(),this.clearRafObserver()}}])}();t.default=A},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){function e(e,n,r,o){var a=n&&n.prototype instanceof t?n:t,c=Object.create(a.prototype);return i(c,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,u=0;!f&&c&&!n&&u<l.length;u++){var n,r=l[u],o=p.p,h=r[2];3<e?(n=h===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=s):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,p.v=t,p.n=r[1]):o<h&&(n=3>e||r[0]>t||t>h)&&(r[4]=e,r[5]=t,p.n=h,i=0))}if(n||1<e)return d;throw f=!0,t}var o,i,a,c=0,l=n||[],f=!1,p={p:0,n:0,v:s,a:r,f:r.bind(s,4),d:function e(t,n){return o=t,i=0,a=s,p.n=n,d}};return function(n,l,h){if(1<c)throw TypeError("Generator is already running");for(f&&1===l&&r(l,h),i=l,a=h;(u=2>i?s:a)||!f;){o||(i?3>i?(1<i&&(p.n=-1),r(i,a)):p.n=a:p.v=a);try{if(c=2,o){if(i||(n="next"),u=o[n]){if(!(u=u.call(o,a)))throw TypeError("iterator result is not an object");if(!u.done)return u;a=u.value,2>i&&(i=0)}else 1===i&&(u=o.return)&&u.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=s}else if((u=(f=0>p.n)?a:e.call(t,p))!==d)break}catch(e){o=s,i=1,a=e}finally{c=1}}return{value:u,done:f}}}(e,r,o),!0),c}function t(){}function n(){}function r(){}function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,i(e,f,"GeneratorFunction")),e.prototype=Object.create(h),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var s,u,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",f=c.toStringTag||"@@toStringTag",d={};u=Object.getPrototypeOf;var p=[][l]?u(u([][l]())):(i(u={},l,(function(){return this})),u),h=r.prototype=t.prototype=Object.create(p);return n.prototype=r,i(h,"constructor",r),i(r,"constructor",n),n.displayName="GeneratorFunction",i(r,f,"GeneratorFunction"),i(h),i(h,f,"Generator"),i(h,l,(function(){return this})),i(h,"toString",(function(){return"[object Generator]"})),(o=function t(){return{w:e,m:a}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,a){function s(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}function a(e){return l(e)||c(e)||u(e)||s()}function s(){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 u(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function c(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e){if(Array.isArray(e))return f(e)}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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,m(n.key),n)}function h(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function m(e){var t=v(e,"string");return"symbol"==r(t)?t:t+""}function v(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var y=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});var g=n(0),b=n(10),S=n(5),C=n(2),w=n(1),E=n(24),I=n(4),T=w.global.PerformanceObserver,O=function(){function e(){d(this,e),this.name="api-collector",this.entryTypes=Object.values(E.ApiType),this.entryCacheMap={}}return h(e,[{key:"setup",value:function e(t,n){(0,I.checkEnable)(t,"api")&&(this.sendEvent=n,this.ctx=t,this.perfObserver(),this.hackXhr(),this.hackFetch())}},{key:"destroy",value:function e(){this.sendEvent=function(){};var t=XMLHttpRequest.prototype;(0,g.restoreFunction)(t,"open"),(0,g.restoreFunction)(t,"setRequestHeader"),(0,g.restoreFunction)(t,"send"),(0,C.restoreHackFunction)(w.global,"fetch")}},{key:"filter",value:function e(t,n){var r,o;if("HEAD"===n||8182<t.length)return!0;var i=this.ctx.getConfig(),s=(null===(r=null==i?void 0:i.filters)||void 0===r?void 0:r.resource)||[];(0,g.isArray)(s)||(s=[s]);var u=null===(o=null==i?void 0:i.collectors)||void 0===o?void 0:o.api;return(0,g.isObject)(u)&&(0,g.isArray)(u.filters)&&(s=[].concat(a(s),a(u.filters))),(0,g.urlMatch)(t,s)}},{key:"perfObserver",value:function e(){var t=this;!(0,g.isFunction)(T)||this.pfObserver||(this.pfObserver=new PerformanceObserver((function(e){var n=e.getEntries().filter((function(e){return t.entryTypes.includes(e.initiatorType)}));n&&n.length&&n.forEach((function(e){var n=e.name;t.entryCacheMap[n]?t.entryCacheMap[n].push(e):t.entryCacheMap[n]=[e]}))})),this.pfObserver.observe({entryTypes:["resource"]}))}},{key:"injectTracing",value:function e(t,n){var r,o=this.ctx.getConfig(),i=o.tracing,a=o.pid,s=o.version,u=void 0===s?"1.0.0":s,c=(0,g.parseTracingOptions)(i),l=c.enable,f=c.sample,d=c.propagatorTypes,p=c.allowedUrls,h=c.tracestate,m=!(void 0!==h)||h,v=c.baggage,y=void 0!==v&&v;if(l){p.push({match:function e(t){return/^https?:\/\/*/.test(t)&&(0,g.startsWith)(t,w.location.origin)},propagatorTypes:d});var b=(0,g.find)(p,(function(e){return(0,g.matchList)([e.match],t.url)}));if(b){var S=b.propagatorTypes;0===S.length&&(S=d);var C=!1;-1<S.indexOf("sw8")&&(S=["sw8"],C=!0);var E=this.ctx.session,I=C?(0,g.generateGUID)():(0,g.generateTraceId)(),T=C?(0,g.generateGUID)():(0,g.generateSpanId)(),O=(0,g.performDraw)(f),A=E.getUserId(),k=E.getSessionId(),_=m?"rum=v2&browser&".concat(a,"&").concat(k,"&").concat(A):void 0,R=y?"rum=v2,appType=browser,pid=".concat(a,",sid=").concat(k,",uid=").concat(A):void 0,M=(0,g.makeTracingHeaders)(I,T,O,S,{tracestate:_,baggage:R,appId:a,appVersion:u,viewName:null===(r=t.view)||void 0===r?void 0:r.name,host:w.location.host});O&&(t.trace_id=I,t.trace_data=JSON.stringify({spanId:T,sample:f,sampled:O,headers:M})),n(M)}}}},{key:"hackXhr",value:function e(){var t=XMLHttpRequest.prototype,n=this;(0,g.interceptFunction)(t,"open",(function(e,t,r,o,i){var a=t+"",s=e.toUpperCase();if(!n.filter(a,s)){this.apiCache={type:E.ApiType.XHR,method:e,url:t,async:r,user:o,password:i,headers:{}};var u=n.ctx.session.getBaseEvent();this.apiAttr=Object.assign(Object.assign({},u),{url:(0,S.fixRelativeUrl)(a),method:s})}}),!0),(0,g.interceptFunction)(t,"setRequestHeader",(function(e,t){this.apiCache&&(this.apiCache.headers[e]=t)}),!0),(0,g.interceptFunction)(t,"send",(function(e){var t=this;if(this.apiAttr){var r=this.apiAttr;this.apiCache.data=e,n.injectTracing(this.apiAttr,(function(e){Object.keys(e).forEach((function(n){t.setRequestHeader(n,e[n])}))})),this.addEventListener("loadend",(function(){return y(t,void 0,void 0,o().m((function e(){var t,i,a,s,u,c,l,f,d;return o().w((function(e){for(;;)switch(e.p=e.n){case 0:if(t=this.status,i=this.statusText,a=this.response,s=n.ctx.getConfig(),u=s.evaluateApi,r.status_code=t,r.message=i,c={name:this.apiAttr.url,entryType:E.ApiType.XHR,duration:(0,C.getCurrentTime)()-r.timestamp},!(0,g.isFunction)(u)){e.n=4;break}return e.p=1,r.success===g.ResourceStatus.Failed&&(l=new Error(E.ApiType.XHR+" error")),e.n=2,u(this.apiCache,a,l,this);case 2:f=e.v,this.apiAttr=r=Object.assign(Object.assign({},r),(0,E.reviseApiAttr)(f)),e.n=4;break;case 3:e.p=3,d=e.v;case 4:n.delayHandle({attr:r,entry:c});case 5:return e.a(2)}}),e,this,[[1,3]])})))})),this.addEventListener("error",(function(){t.apiAttr.success=g.ResourceStatus.Failed}))}}),!0)}},{key:"hackFetch",value:function e(){var t=this;(0,C.hackFunction)(w.global,"fetch",(function(e){return function(n){function r(){return y(this,void 0,void 0,o().m((function e(){var r,a,s,u,c;return o().w((function(e){for(;;)switch(e.p=e.n){case 0:if(r=t.ctx.getConfig(),a=r.evaluateApi,s={name:p.url,entryType:E.ApiType.FETCH,duration:(0,C.getCurrentTime)()-p.timestamp},!(0,g.isFunction)(a)){e.n=4;break}return e.p=1,e.n=2,a(Object.assign({url:n},i),l,f);case 2:u=e.v,p=Object.assign(Object.assign({},p),(0,E.reviseApiAttr)(u)),e.n=4;break;case 3:e.p=3,c=e.v;case 4:t.delayHandle({attr:p,entry:s});case 5:return e.a(2)}}),e,null,[[1,3]])})))}var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},a=n instanceof Request,s=a?n.url:(0,g.isString)(n)?n:n.toString(),u=i.method,c=i.headers;if(a&&(!u&&(u=n.method),!c&&(c=n.headers)),u=u?u.toUpperCase():"GET",t.filter(s,u))return e.call(w.global,n,i);var l,f,d=t.ctx.session.getBaseEvent(),p=Object.assign(Object.assign({},d),{url:(0,S.fixRelativeUrl)(s),type:E.ApiType.FETCH,method:u});if(!c)try{i.headers=c=new Headers}catch(e){c=null}c&&!Object.isFrozen(c)&&t.injectTracing(p,(function(e){Object.keys(e).forEach((function(t){c instanceof Headers?c.set(t,e[t]):e[t]=e[t]}))}));var h=e.call(w.global,n,i);return h.then((function(e){if(e||(0,g.isFunction)(e.clone)){var t=l=e.clone(),n=t.status,o=t.statusText;p.status_code=n,p.message=o,r().then()}return e})).catch((function(e){f=e,p.message=e+"",p.success=g.ResourceStatus.Failed,r().then()})),h}}))}},{key:"delayHandle",value:function e(t){var n=this;(0,g.delay)((function(){n.mergeEntry(t)}),200)}},{key:"mergeEntry",value:function e(t){var n=t.attr,r=t.entry;r=this.findRealEntry(r);var o,i=this.ctx.getConfig().parseResourceName,a=n.url,s=n.status_code,u=n.view,c=(0,b.getResourceSuccessByCode)(s),l=(0,b.calcResourceTimingData)(r)||{duration:r.duration},f=Object.assign(Object.assign(Object.assign(Object.assign({event_type:g.RumEventType.RESOURCE,url:a,name:(0,S.getResourceName)(a,i),type:r.initiatorType||r.entryType,success:c},n),{timing_data:JSON.stringify(r)}),l),{view:u});this.sendEvent(f)}},{key:"findRealEntry",value:function e(t){var n=t.name,r=this.entryCacheMap[n]||[],o=r.shift();return r.length||delete this.entryCacheMap[n],o||t}}])}();t.default=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,s(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(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 c=n(0),l=n(10),f=n(5),d=n(6),p=n(1),h=n(2),m=n(4),v=p.global.PerformanceObserver,y=["navigation","audio","video","track","script","css","img","image","link","other"],g=1e3,b=function(){function e(){var t=this;o(this,e),this.name="static-resource-collector",this.errorsCache=[],this.sendResource=function(e){var n=t.ctx.getConfig(),r=n.parseResourceName,o=n.filters,i=void 0===o?{}:o,a=e.responseStatus,s=e.name,u=(0,l.getResourceType)(s,e.initiatorType),d=t.checkError(s),p=d?c.ResourceStatus.Failed:(0,l.getResourceStatus)(e),h=(0,l.calcResourceTimingData)(e,d);if(h){var m=t.ctx.session.getBaseEvent(),v=Object.assign(Object.assign(Object.assign(Object.assign({},m),{event_type:c.RumEventType.RESOURCE,url:s,name:(0,f.getResourceName)(s,r),type:u,method:"GET",status_code:a,success:p}),h),{timing_data:JSON.stringify(e)});(0,c.urlMatch)(v.url,i.resource)||t.sendEvent(v)}},this.errorHandler=function(e){var n=e.target||e.srcElement,r=n&&n.nodeName&&1===n.nodeType,o=n.src||n.href;r&&(0,c.isString)(o)&&0===o.indexOf("http")&&t.errorsCache.push({src:o,timeStamp:(0,h.getCurrentTime)()})},this.perfHandler=function(e){var n=[],r=[];e.forEach((function(e){var t;y.includes(e.initiatorType)&&((0,l.getResourceStatus)(e)===c.ResourceStatus.Success?n.push(e):r.push(e))}));var o=(0,d.getCurView)(t.ctx);n.length&&n.forEach((function(e){t.sendResource(e,o)})),r.length&&setTimeout((function(){r.forEach((function(e){t.sendResource(e,o)}))}),1e3)}}return a(e,[{key:"setup",value:function(e,t){var n;(0,m.checkEnable)(e,"staticResource")&&(this.ctx=e,this.sendEvent=t,(0,c.isFunction)(v)&&null!==(n=v.supportedEntryTypes)&&void 0!==n&&n.includes("resource")&&!this.perfObserver&&(this.perfObserver=(0,l.initPerfObserver)(["navigation","resource"],this.perfHandler),p.global.addEventListener("error",this.errorHandler,!0)))}},{key:"checkError",value:function(e){var t=!1,n=(0,h.getCurrentTime)();return this.errorsCache=this.errorsCache.filter((function(r){return e===r.src?(t=!0,!0):!!(1e4<n-r.timeStamp)})),t}},{key:"destroy",value:function(){p.global.removeEventListener("error",this.errorHandler,!0),this.perfObserver&&(this.perfObserver.disconnect(),this.perfObserver=null)}}])}();t.default=b},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){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,s(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(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 c=n(0),l=n(5),f=n(1),d=n(6),p=n(11),h=f.history&&!!f.history.pushState&&!!f.history.replaceState,m=function(){function e(){var t=this;o(this,e),this.name="pv-collector",this.sendPv=function(e,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"route_change",o=t.ctx,i=(0,d.getCurView)(o),a=t.getViewName(e),s=t.prevUrl;if(t.prevUrl=e,!s||!i||a!==i.name){i&&o.emitter.emit(p.LifeCycleEventType.VIEW_ENDED,Object.assign({type:"pv"},i)),o.addView({id:o.session.getViewId(),loading_type:r,name:a});var u=o.session.getBaseEvent(),l=Object.assign(Object.assign({},u),{event_type:c.RumEventType.VIEW,type:"pv",name:a,url:e,referrer:n,loading_type:r});o.emitter.emit(p.LifeCycleEventType.VIEW_CREATED,l),t.sendEvent(l)}},this.historyFn=function(){var e=t.prevUrl;(0,c.delay)((function(){t.sendPv(f.location.href,e)}),1)},this.popstateFn=function(){var e=(0,l.getCurrentURL)(),n=t.prevUrl;t.sendPv(e,n)}}return a(e,[{key:"setup",value:function(e,t){this.ctx=e,this.sendEvent=t,this.sendPv((0,l.getCurrentURL)(),f.document.referrer||"","initial_load");var n=this.getSpaMode();h&&n&&((0,c.interceptFunction)(f.global.history,"pushState",this.historyFn),(0,c.interceptFunction)(f.global.history,"replaceState",this.historyFn),f.global.addEventListener("popstate",this.popstateFn))}},{key:"getSpaMode",value:function(){var e=this.ctx.getConfig().spaMode;return!!e&&("history"!==e&&"hash"!==e?"auto":e)}},{key:"getViewName",value:function(e){var t=this.ctx.getConfig(),n=(0,l.getPathByURL)(e,this.getSpaMode());return(0,c.isFunction)(t.parseViewName)&&(n=t.parseViewName(e)),n}},{key:"destroy",value:function(){h&&((0,c.restoreFunction)(f.global.history,"pushState"),(0,c.restoreFunction)(f.global.history,"replaceState"),f.global.removeEventListener("popstate",this.popstateFn))}}])}();t.default=m},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,s(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(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 c;Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),f=n(5),d=n(1),p=n(10),h=n(2),m=n(4),v=n(7),y=d.global.PerformanceObserver,g=10*l.ONE_MINUTE,b=(null===(c=performance.timing)||void 0===c?void 0:c.navigationStart)||(0,h.getCurrentTime)(),S=["dom_interactive","dom_content_loaded","dom_complete","load_event","first_paint","first_contentful_paint"],C=function(){function e(){var t=this;o(this,e),this.name="perf-collector",this.eventTiming={},this.events=[],this.onState=function(){var e=d.document.readyState;"interactive"!==e||t.eventTiming.domInteractive||(t.eventTiming.domInteractive=(0,h.getCurrentTime)()-b),"complete"===e&&(t.eventTiming.domComplete=(0,h.getCurrentTime)()-b)},this.onDomLoaded=function(){t.eventTiming.domContentLoaded=(0,h.getCurrentTime)()-b},this.onLoad=function(){t.eventTiming.loadEvent=(0,h.getCurrentTime)()-b,(0,l.delay)(t.sendPerf,200)},this.perfHandler=function(e){for(var n=e.getEntries(),r=t.eventCache,o=0;o<n.length;o++)try{var i=n[o];switch(i.entryType){case"navigation":var a=i.fetchStart,s=i.responseEnd,u=i.domInteractive,c=i.domContentLoadedEventEnd,f=i.domComplete,d=i.loadEventEnd;r.dom_interactive=(0,l.formatNumber)(u-a),r.dom_content_loaded=(0,l.formatNumber)(c-a),r.dom_complete=(0,l.formatNumber)(f-a),r.load_event=(0,l.formatNumber)(d-a),r.first_paint=(0,l.formatNumber)(s-a),r.snapshots=JSON.stringify(i);break;case"paint":"first-paint"===i.name&&i.startTime<g?r.first_paint=(0,l.formatNumber)(i.startTime):"first-contentful-paint"===i.name&&i.startTime<g&&(r.first_contentful_paint=(0,l.formatNumber)(i.startTime));break;default:return}}catch(e){}},this.sendPerf=function(){var e=t.eventCache;if(e){var n=t.eventTiming,r=n.domInteractive,o=n.domContentLoaded,i=n.loadEvent,a=n.domComplete;!e.dom_interactive&&r&&(e.dom_interactive=(0,l.formatNumber)(r)),!e.dom_content_loaded&&o&&(e.dom_content_loaded=(0,l.formatNumber)(o)),!e.dom_complete&&a&&(e.dom_complete=(0,l.formatNumber)(a)),!e.load_event&&i&&(e.load_event=(0,l.formatNumber)(i));var s=(0,p.delBadMea)(e,S);t.sendEvent(s),t.clear()}}}return a(e,[{key:"setup",value:function(e,t){var n=this;if((0,m.checkEnable)(e,"perf")&&(this.ctx=e,this.sendEvent=t,this.sendPerf=(0,l.debounce)(this.sendPerf,200),(0,l.isFunction)(y))){this.perfObserver=new y((function(e){(0,l.delay)(n.perfHandler,100,e)})),this.perfObserver.observe({entryTypes:["navigation","paint"]});var r=this.ctx.session.getBaseEvent();this.eventCache=Object.assign(Object.assign({},r),{event_type:l.RumEventType.VIEW,type:"perf",url:(0,f.getCurrentURL)(),referrer:d.document.referrer||""}),this.events=[(0,v.addEventListeners)(d.document,[v.DOM_EVENT.READY_STATE],this.onState),(0,v.addEventListeners)(d.document,[v.DOM_EVENT.DOM_CONTENT_LOADED],this.onDomLoaded),(0,v.addEventListeners)(window,[v.DOM_EVENT.LOAD],this.onLoad)]}}},{key:"clear",value:function(){this.events.forEach((function(e){return e()})),this.events=[],this.eventTiming={},this.perfObserver&&(this.eventCache=null,this.perfObserver.disconnect(),this.perfObserver=null)}},{key:"destroy",value:function(){this.clear()}}])}();t.default=C},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,n){return(t=u(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 a(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}function s(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=c(e,"string");return"symbol"==r(t)?t:t+""}function c(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),f=n(5),d=n(6),p=n(56),h=n(1),m=n(4),v=function(){function e(){i(this,e),this.name="web-vitals-collector",this.measures={}}return s(e,[{key:"setup",value:function(e,t){(0,m.checkEnable)(e,"webVitals")&&(this.ctx=e,this.sendEvent=t,this.baseEvent={event_type:l.RumEventType.VIEW,type:"webvitals",referrer:h.document.referrer||"",view:(0,d.getCurView)(this.ctx)},this.onWebVitals())}},{key:"sendWebVitals",value:function(e,t){var n=this,r;clearTimeout(this.timer),!1===(this.ctx.getConfig().collectors||{}).webVitals||(this.measures=Object.assign(Object.assign({},this.measures),o({},e,t)),this.timer=setTimeout((function(){var e=n.ctx.session.getBaseEvent();n.sendEvent(Object.assign(Object.assign(Object.assign(Object.assign({},e),n.baseEvent),n.measures),{url:(0,f.getCurrentURL)()})),n.measures={}}),200))}},{key:"onWebVitals",value:function(){var e=this;(0,p.onLCP)((function(t){return e.sendWebVitals("largest_contentful_paint",(0,l.formatNumber)(t.value))}),{reportAllChanges:!1}),(0,p.onFID)((function(t){e.sendWebVitals("first_input_delay",(0,l.formatNumber)(t.value)),(0,l.isArray)(t.entries)&&t.entries.forEach((function(t){t&&"first-input"===t.entryType&&e.sendWebVitals("first_input_time",(0,l.formatNumber)(t.startTime))}))})),(0,p.onCLS)((function(t){return e.sendWebVitals("cumulative_layout_shift",(0,l.formatNumber)(t.value))})),(0,p.onINP)((function(t){return e.sendWebVitals("interaction_to_next_paint",(0,l.formatNumber)(t.value))}))}}])}();t.default=v},function(e,t,n){"use strict";n.r(t),n.d(t,"CLSThresholds",(function(){return A})),n.d(t,"FCPThresholds",(function(){return T})),n.d(t,"FIDThresholds",(function(){return P})),n.d(t,"INPThresholds",(function(){return W})),n.d(t,"LCPThresholds",(function(){return J})),n.d(t,"TTFBThresholds",(function(){return $})),n.d(t,"getCLS",(function(){return k})),n.d(t,"getFCP",(function(){return O})),n.d(t,"getFID",(function(){return L})),n.d(t,"getINP",(function(){return q})),n.d(t,"getLCP",(function(){return X})),n.d(t,"getTTFB",(function(){return te})),n.d(t,"onCLS",(function(){return k})),n.d(t,"onFCP",(function(){return O})),n.d(t,"onFID",(function(){return L})),n.d(t,"onINP",(function(){return q})),n.d(t,"onLCP",(function(){return X})),n.d(t,"onTTFB",(function(){return te}));var r,o,i,a,s,u=-1,c=function(e){addEventListener("pageshow",(function(t){t.persisted&&(u=t.timeStamp,e(t))}),!0)},l=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},f=function(){var e=l();return e&&e.activationStart||0},d=function(e,t){var n=l(),r="navigate";return u>=0?r="back-forward-cache":n&&(document.prerendering||f()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},p=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},h=function(e,t,n,r){var o,i;return function(a){t.value>=0&&(a||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},m=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},v=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},y=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},g=-1,b=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},S=function(e){"hidden"===document.visibilityState&&g>-1&&(g="visibilitychange"===e.type?e.timeStamp:0,w())},C=function(){addEventListener("visibilitychange",S,!0),addEventListener("prerenderingchange",S,!0)},w=function(){removeEventListener("visibilitychange",S,!0),removeEventListener("prerenderingchange",S,!0)},E=function(){return g<0&&(g=b(),C(),c((function(){setTimeout((function(){g=b(),C()}),0)}))),{get firstHiddenTime(){return g}}},I=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},T=[1800,3e3],O=function(e,t){t=t||{},I((function(){var n,r=E(),o=d("FCP"),i=p("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-f(),0),o.entries.push(e),n(!0)))}))}));i&&(n=h(e,o,T,t.reportAllChanges),c((function(r){o=d("FCP"),n=h(e,o,T,t.reportAllChanges),m((function(){o.value=performance.now()-r.timeStamp,n(!0)}))})))}))},A=[.1,.25],k=function(e,t){t=t||{},O(y((function(){var n,r=d("CLS",0),o=0,i=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=i[0],n=i[i.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,i.push(e)):(o=e.value,i=[e])}})),o>r.value&&(r.value=o,r.entries=i,n())},s=p("layout-shift",a);s&&(n=h(e,r,A,t.reportAllChanges),v((function(){a(s.takeRecords()),n(!0)})),c((function(){o=0,r=d("CLS",0),n=h(e,r,A,t.reportAllChanges),m((function(){return n()}))})),setTimeout(n,0))})))},_={passive:!0,capture:!0},R=new Date,M=function(e,t){r||(r=t,o=e,i=new Date,x(removeEventListener),j())},j=function(){if(o>=0&&o<i-R){var e={entryType:"first-input",name:r.type,target:r.target,cancelable:r.cancelable,startTime:r.timeStamp,processingStart:r.timeStamp+o};a.forEach((function(t){t(e)})),a=[]}},N=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){M(e,t),o()},r=function(){o()},o=function(){removeEventListener("pointerup",n,_),removeEventListener("pointercancel",r,_)};addEventListener("pointerup",n,_),addEventListener("pointercancel",r,_)}(t,e):M(t,e)}},x=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,N,_)}))},P=[100,300],L=function(e,t){t=t||{},I((function(){var n,i=E(),s=d("FID"),u=function(e){e.startTime<i.firstHiddenTime&&(s.value=e.processingStart-e.startTime,s.entries.push(e),n(!0))},l=function(e){e.forEach(u)},f=p("first-input",l);n=h(e,s,P,t.reportAllChanges),f&&v(y((function(){l(f.takeRecords()),f.disconnect()}))),f&&c((function(){var i;s=d("FID"),n=h(e,s,P,t.reportAllChanges),a=[],o=-1,r=null,x(addEventListener),i=u,a.push(i),j()}))}))},F=0,D=1/0,U=0,B=function(e){e.forEach((function(e){e.interactionId&&(D=Math.min(D,e.interactionId),U=Math.max(U,e.interactionId),F=U?(U-D)/7+1:0)}))},V=function(){return s?F:performance.interactionCount||0},G=function(){"interactionCount"in performance||s||(s=p("event",B,{type:"event",buffered:!0,durationThreshold:0}))},W=[200,500],H=0,Z=function(){return V()-H},Y=[],K={},z=function(e){var t=Y[Y.length-1],n=K[e.interactionId];if(n||Y.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};K[r.id]=r,Y.push(r)}Y.sort((function(e,t){return t.latency-e.latency})),Y.splice(10).forEach((function(e){delete K[e.id]}))}},q=function(e,t){t=t||{},I((function(){var n;G();var r,o=d("INP"),i=function(e){e.forEach((function(e){e.interactionId&&z(e),"first-input"===e.entryType&&!Y.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&z(e)}));var t,n=(t=Math.min(Y.length-1,Math.floor(Z()/50)),Y[t]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())},a=p("event",i,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=h(e,o,W,t.reportAllChanges),a&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&a.observe({type:"first-input",buffered:!0}),v((function(){i(a.takeRecords()),o.value<0&&Z()>0&&(o.value=0,o.entries=[]),r(!0)})),c((function(){Y=[],H=V(),o=d("INP"),r=h(e,o,W,t.reportAllChanges)})))}))},J=[2500,4e3],Q={},X=function(e,t){t=t||{},I((function(){var n,r=E(),o=d("LCP"),i=function(e){var t=e[e.length-1];t&&t.startTime<r.firstHiddenTime&&(o.value=Math.max(t.startTime-f(),0),o.entries=[t],n())},a=p("largest-contentful-paint",i);if(a){n=h(e,o,J,t.reportAllChanges);var s=y((function(){Q[o.id]||(i(a.takeRecords()),a.disconnect(),Q[o.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return setTimeout(s,0)}),!0)})),v(s),c((function(r){o=d("LCP"),n=h(e,o,J,t.reportAllChanges),m((function(){o.value=performance.now()-r.timeStamp,Q[o.id]=!0,n(!0)}))}))}}))},$=[800,1800],ee=function e(t){document.prerendering?I((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},te=function(e,t){t=t||{};var n=d("TTFB"),r=h(e,n,$,t.reportAllChanges);ee((function(){var o=l();if(o){var i=o.responseStart;if(i<=0||i>performance.now())return;n.value=Math.max(i-f(),0),n.entries=[o],r(!0),c((function(){n=d("TTFB",0),(r=h(e,n,$,t.reportAllChanges))(!0)}))}}))}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){function e(e,n,r,o){var a=n&&n.prototype instanceof t?n:t,c=Object.create(a.prototype);return i(c,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,u=0;!f&&c&&!n&&u<l.length;u++){var n,r=l[u],o=p.p,h=r[2];3<e?(n=h===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=s):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,p.v=t,p.n=r[1]):o<h&&(n=3>e||r[0]>t||t>h)&&(r[4]=e,r[5]=t,p.n=h,i=0))}if(n||1<e)return d;throw f=!0,t}var o,i,a,c=0,l=n||[],f=!1,p={p:0,n:0,v:s,a:r,f:r.bind(s,4),d:function e(t,n){return o=t,i=0,a=s,p.n=n,d}};return function(n,l,h){if(1<c)throw TypeError("Generator is already running");for(f&&1===l&&r(l,h),i=l,a=h;(u=2>i?s:a)||!f;){o||(i?3>i?(1<i&&(p.n=-1),r(i,a)):p.n=a:p.v=a);try{if(c=2,o){if(i||(n="next"),u=o[n]){if(!(u=u.call(o,a)))throw TypeError("iterator result is not an object");if(!u.done)return u;a=u.value,2>i&&(i=0)}else 1===i&&(u=o.return)&&u.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=s}else if((u=(f=0>p.n)?a:e.call(t,p))!==d)break}catch(e){o=s,i=1,a=e}finally{c=1}}return{value:u,done:f}}}(e,r,o),!0),c}function t(){}function n(){}function r(){}function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,i(e,f,"GeneratorFunction")),e.prototype=Object.create(h),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var s,u,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",f=c.toStringTag||"@@toStringTag",d={};u=Object.getPrototypeOf;var p=[][l]?u(u([][l]())):(i(u={},l,(function(){return this})),u),h=r.prototype=t.prototype=Object.create(p);return n.prototype=r,i(h,"constructor",r),i(r,"constructor",n),n.displayName="GeneratorFunction",i(r,f,"GeneratorFunction"),i(h),i(h,f,"Generator"),i(h,l,(function(){return this})),i(h,"toString",(function(){return"[object Generator]"})),(o=function t(){return{w:e,m:a}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,a){function s(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(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)}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 a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});var d=n(0),p=n(7),h=n(25),m=n(12),v=n(1),y=n(26),g=n(66),b=n(2),S=n(11),C=n(67),w=36e5,E=function(){function e(){var t=this;a(this,e),this.name="replay-collector",this.events=[],this.startRecord=function(){return f(t,void 0,void 0,o().m((function e(){var t,n,r,i,a,s,u;return o().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,p.onReadyState)();case 1:if(t=this.ctx.session,n=t.replayConfig,r=t.getSessionInfo(),i=r.startTime,a=r.replaySampled,!((0,b.getCurrentTime)()-i>36e5)){e.n=2;break}return e.a(2);case 2:n.enable&&a&&(s=this.onPageChange,this.ctx.emitter.on(S.LifeCycleEventType.VIEW_CREATED,s),this.events.push((0,p.addEventListeners)(v.document,[p.DOM_EVENT.VISIBILITY_CHANGE,p.DOM_EVENT.FREEZE],s),(0,p.addEventListeners)(v.global,[p.DOM_EVENT.BEFORE_UNLOAD],s)),u=this.extendEvent,this.ctx.emitter.on(S.LifeCycleEventType.VIEW_ENDED,u),this.events.push((0,p.addEventListeners)(v.global,[p.DOM_EVENT.FOCUS,p.DOM_EVENT.BLUR],u)),y.replayManager.on(this.onEvent),y.replayManager.start(n));case 3:return e.a(2)}}),e,this)})))},this.stopRecord=function(){t.ctx.emitter.off(S.LifeCycleEventType.VIEW_CREATED,t.onPageChange),t.ctx.emitter.off(S.LifeCycleEventType.VIEW_ENDED,t.extendEvent),t.events.forEach((function(e){return e()})),y.replayManager.off(t.onEvent),y.replayManager.stop()},this.lastEvent=0,this.extendEvent=function(e){var n=e.type,r=null;if(n===p.DOM_EVENT.FOCUS||n===p.DOM_EVENT.BLUR){var o=(0,b.getCurrentTime)();if(500>o-t.lastEvent)return;t.lastEvent=o,r={data:{has_focus:v.document.hasFocus()},timestamp:(0,b.getCurrentTime)(),type:m.RecordType.Focus}}else"pv"===n&&(r={timestamp:(0,b.getCurrentTime)(),type:m.RecordType.ViewEnd});r&&t.onEvent({data:r})},this.onPageChange=function(e){var n,r=e.type,o=e.loading_type;if(r===p.DOM_EVENT.VISIBILITY_CHANGE)"hidden"===v.document.visibilityState&&(n="visibility_hidden");else if(r===p.DOM_EVENT.FREEZE)n="page_frozen";else if(r===p.DOM_EVENT.BEFORE_UNLOAD)n="before_unload";else{if("pv"!==r||!o)return;n=o}t.flushEvents(n),"pv"===r&&o&&y.replayManager.takeFullSnapshot()},this.onEvent=function(e){var n=t.ctx.session,r,o=n.getSessionInfo().startTime;if((0,b.getCurrentTime)()-o>36e5)t.stopRecord();else{if(!t.segment){var i=n.getBaseEvent();t.segment=new g.ReplaySegment(i,t.flushEvents)}t.segment.addEvent(e)}},this.flushEvents=function(e){var n=t.segment;!n||0<n.rumEvent.records_count&&(t.segment=null,t.upload(e,n))}}return u(e,[{key:"setup",value:function e(t,n){this.ctx=t,this.sendEvent=n,this.startRecord(),t.emitter.on(h.SessionEventType.INIT,this.startRecord)}},{key:"upload",value:function e(t,n){return f(this,void 0,void 0,o().m((function e(){var r,i,a,s,u,c;return o().w((function(e){for(;;)switch(e.n){case 0:return r=n.rumEvent,i=n.getEvents(),e.n=1,(0,C.compressData)(i);case 1:a=e.v,s=a.data,u=a.encoding,c=new Blob([s]).size,this.sendEvent(Object.assign(Object.assign({},r),{event_type:d.RumEventType.VIEW,type:"replay",records_reason:t,records_data:s,records_encoding:u,records_size:c}));case 2:return e.a(2)}}),e,this)})))}},{key:"destroy",value:function e(){this.ctx.emitter.off(h.SessionEventType.INIT,this.startRecord),this.flushEvents()}}])}();t.default=E},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCookie=t.setCookie=void 0;var r=n(1);function o(e,t,n,o){var i="";if(n){var a=new Date;a.setTime(a.getTime()+n),i="; expires="+a.toUTCString()}o||(o=r.document.domain),r.document.cookie=e+"="+(t||"")+i+"; path=/; domain=".concat(o)}function i(e){var t,n="; ".concat(r.document.cookie).split("; ".concat(e,"="));return 2===n.length?decodeURIComponent(n.pop().split(";").shift()):null}t.setCookie=o,t.getCookie=i},function(e,t,n){"use strict";(function(e,t,r){var o;function i(e){return e.nodeType===e.ELEMENT_NODE}function a(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function s(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function u(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function c(e){try{var t=e.rules||e.cssRules;return t?u(Array.from(t).map(l).join("")):null}catch(e){return null}}function l(e){var t=e.cssText;if(f(e))try{t=c(e.styleSheet)||t}catch(e){}return t}function f(e){return"styleSheet"in e}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(o||(o={}));var d=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function p(){return new d}function h(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(a=i?i(a):"*".repeat(a.length)),a}var m="__rrweb_original__";function v(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=50)for(var o=0;o<e.height;o+=50){var i=t.getImageData,a="__rrweb_original__"in i?i.__rrweb_original__:i,s;if(new Uint32Array(a.call(t,r,o,Math.min(50,e.width-r),Math.min(50,e.height-o)).data.buffer).some((function(e){return 0!==e})))return!1}return!0}var y=1,g=new RegExp("[^a-z0-9-_:]"),b=-2,S,C;function w(){return y++}function E(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return g.test(t)?"div":t}function I(e){return e.cssRules?Array.from(e.cssRules).map((function(e){return e.cssText||""})).join(""):""}function T(e){var t="";return t=(t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var O=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,A=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,k=/^(data:)([^,]*),(.*)/i;function _(e,t){return(e||"").replace(O,(function(e,n,r,o,i,a){var s=r||i||a,u=n||o||"";if(!s)return e;if(!A.test(s))return"url(".concat(u).concat(s).concat(u,")");if(k.test(s))return"url(".concat(u).concat(s).concat(u,")");if("/"===s[0])return"url(".concat(u).concat(T(t)+s).concat(u,")");var c=t.split("/"),l=s.split("/");c.pop();for(var f=0,d=l;f<d.length;f++){var p=d[f];"."!==p&&(".."===p?c.pop():c.push(p))}return"url(".concat(u).concat(c.join("/")).concat(u,")")}))}var R=/^[^ \t\n\r\u000c]+/,M=/^[, \t\n\r\u000c]+/;function j(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(M),!(n>=t.length);){var i=r(R);if(","===i.slice(-1))i=N(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=N(e,i);for(var s=!1;;){var u=t.charAt(n);if(""===u){o.push((i+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,o.push((i+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return o.join(", ")}function N(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function x(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function P(){var e=document.createElement("a");return e.href="",e.href}function L(e,t,n,r){return"src"===n||"href"===n&&r&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&r&&"#"!==r[0]?N(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?j(e,r):"style"===n&&r?_(r,P()):"object"===t&&"data"===n&&r?N(e,r):r:N(e,r)}function F(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}function D(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&D(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&D(e.parentNode,t,n)}function U(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(D(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}return!1}function B(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}function V(e,t,n){var r=!1,o;try{o=e.sheet}catch(e){return}if(!o){var i=setTimeout((function(){r||(t(),r=!0)}),n);e.addEventListener("load",(function(){clearTimeout(i),r=!0,t()}))}}function G(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,a=t.blockSelector,s=t.maskTextClass,u=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,f=void 0===l?{}:l,d=t.maskTextFn,p=t.maskInputFn,h=t.dataURLOptions,m=void 0===h?{}:h,v=t.inlineImages,y=t.recordCanvas,g=t.keepIframeSrcFn,b=t.newlyAddedElement,S=void 0!==b&&b,C=W(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:o.Document,childNodes:[],compatMode:e.compatMode}:{type:o.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:o.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return Z(e,{doc:n,blockClass:i,blockSelector:a,inlineStylesheet:c,maskInputOptions:f,maskInputFn:p,dataURLOptions:m,inlineImages:v,recordCanvas:y,keepIframeSrcFn:g,newlyAddedElement:S,rootId:C});case e.TEXT_NODE:return H(e,{maskTextClass:s,maskTextSelector:u,maskTextFn:d,rootId:C});case e.CDATA_SECTION_NODE:return{type:o.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:o.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function W(e,t){if(t.hasNode(e)){var n=t.getId(e);return 1===n?void 0:n}}function H(e,t){var n,r=t.maskTextClass,i=t.maskTextSelector,a=t.maskTextFn,s=t.rootId,u=e.parentNode&&e.parentNode.tagName,c=e.textContent,l="STYLE"===u||void 0,f="SCRIPT"===u||void 0;if(l&&c){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=I(e.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}c=_(c,P())}return f&&(c="SCRIPT_PLACEHOLDER"),!l&&!f&&c&&U(e,r,i)&&(c=a?a(c):c.replace(/[\S]/g,"*")),{type:o.Text,textContent:c||"",isStyle:l,rootId:s}}function Z(e,t){for(var n=t.doc,r=t.blockClass,i=t.blockSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskInputFn,f=t.dataURLOptions,d=void 0===f?{}:f,p=t.inlineImages,m=t.recordCanvas,y=t.keepIframeSrcFn,g=t.newlyAddedElement,b=void 0!==g&&g,w=t.rootId,I=F(e,r,i),T=E(e),O={},A=e.attributes.length,k=0,R;k<A;k++){var M=e.attributes[k];O[M.name]=L(n,T,M.name,M.value)}if("link"===T&&a){var j=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),R=null;j&&(R=c(j)),R&&(delete O.rel,delete O.href,O._cssText=_(R,j.href))}"style"===T&&e.sheet&&!(e.innerText||e.textContent||"").trim().length&&((R=c(e.sheet))&&(O._cssText=_(R,P())));if("input"===T||"textarea"===T||"select"===T){var N=e.value,D=e.checked;"radio"!==O.type&&"checkbox"!==O.type&&"submit"!==O.type&&"button"!==O.type&&N?O.value=h({type:O.type,tagName:T,value:N,maskInputOptions:u,maskInputFn:l}):D&&(O.checked=D)}if("option"===T&&(e.selected&&!u.select?O.selected=!0:delete O.selected),"canvas"===T&&m)if("2d"===e.__context)v(e)||(O.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var U=e.toDataURL(d.type,d.quality),B=document.createElement("canvas"),V;B.width=e.width,B.height=e.height,U!==B.toDataURL(d.type,d.quality)&&(O.rr_dataURL=U)}if("img"===T&&p){S||(S=n.createElement("canvas"),C=S.getContext("2d"));var G=e,W=G.crossOrigin;G.crossOrigin="anonymous";var H=function(){try{S.width=G.naturalWidth,S.height=G.naturalHeight,C.drawImage(G,0,0),O.rr_dataURL=S.toDataURL(d.type,d.quality)}catch(e){console.warn("Cannot inline img src=".concat(G.currentSrc,"! Error: ").concat(e))}W?O.crossOrigin=W:G.removeAttribute("crossorigin")};G.complete&&0!==G.naturalWidth?H():G.onload=H}if("audio"!==T&&"video"!==T||(O.rr_mediaState=e.paused?"paused":"played",O.rr_mediaCurrentTime=e.currentTime),b||(e.scrollLeft&&(O.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(O.rr_scrollTop=e.scrollTop)),I){var Z=e.getBoundingClientRect(),Y=Z.width,K=Z.height;O={class:O.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(K,"px")}}return"iframe"!==T||y(O.src)||(e.contentDocument||(O.rr_src=O.src),delete O.src),{type:o.Element,tagName:T,attributes:O,childNodes:[],isSVG:x(e)||void 0,needBlock:I,rootId:w}}function Y(e){return void 0===e?"":e.toLowerCase()}function K(e,t){if(t.comment&&e.type===o.Comment)return!0;if(e.type===o.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Y(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Y(e.attributes.name)||"icon"===Y(e.attributes.rel)||"apple-touch-icon"===Y(e.attributes.rel)||"shortcut icon"===Y(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Y(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Y(e.attributes.property).match(/^(og|twitter|fb):/)||Y(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Y(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Y(e.attributes.name)||"googlebot"===Y(e.attributes.name)||"bingbot"===Y(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Y(e.attributes.name)||"generator"===Y(e.attributes.name)||"framework"===Y(e.attributes.name)||"publisher"===Y(e.attributes.name)||"progid"===Y(e.attributes.name)||Y(e.attributes.property).match(/^article:/)||Y(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Y(e.attributes.name)||"yandex-verification"===Y(e.attributes.name)||"csrf-token"===Y(e.attributes.name)||"p:domain_verify"===Y(e.attributes.name)||"verify-v1"===Y(e.attributes.name)||"verification"===Y(e.attributes.name)||"shopify-checkout-api-token"===Y(e.attributes.name)))return!0}}return!1}function z(e,t){var n=t.doc,r=t.mirror,u=t.blockClass,c=t.blockSelector,l=t.maskTextClass,f=t.maskTextSelector,d=t.skipChild,p=void 0!==d&&d,h=t.inlineStylesheet,m=void 0===h||h,v=t.maskInputOptions,y=void 0===v?{}:v,g=t.maskTextFn,b=t.maskInputFn,S=t.slimDOMOptions,C=t.dataURLOptions,E=void 0===C?{}:C,I=t.inlineImages,T=void 0!==I&&I,O=t.recordCanvas,A=void 0!==O&&O,k=t.onSerialize,_=t.onIframeLoad,R=t.iframeLoadTimeout,M=void 0===R?5e3:R,j=t.onStylesheetLoad,N=t.stylesheetLoadTimeout,x=void 0===N?5e3:N,P=t.keepIframeSrcFn,L=void 0===P?function(){return!1}:P,F=t.newlyAddedElement,D=void 0!==F&&F,U=t.preserveWhiteSpace,W=void 0===U||U,H=G(e,{doc:n,mirror:r,blockClass:u,blockSelector:c,maskTextClass:l,maskTextSelector:f,inlineStylesheet:m,maskInputOptions:y,maskTextFn:g,maskInputFn:b,dataURLOptions:E,inlineImages:T,recordCanvas:A,keepIframeSrcFn:L,newlyAddedElement:D}),Z;if(!H)return console.warn(e,"not serialized"),null;Z=r.hasNode(e)?r.getId(e):K(H,S)||!W&&H.type===o.Text&&!H.isStyle&&!H.textContent.replace(/^\s+|\s+$/gm,"").length?-2:w();var Y=Object.assign(H,{id:Z});if(r.add(e,Y),-2===Z)return null;k&&k(e);var q=!p;if(Y.type===o.Element){q=q&&!Y.needBlock,delete Y.needBlock;var J=e.shadowRoot;J&&s(J)&&(Y.isShadowHost=!0)}if((Y.type===o.Document||Y.type===o.Element)&&q){S.headWhitespace&&Y.type===o.Element&&"head"===Y.tagName&&(W=!1);for(var Q={doc:n,mirror:r,blockClass:u,blockSelector:c,maskTextClass:l,maskTextSelector:f,skipChild:p,inlineStylesheet:m,maskInputOptions:y,maskTextFn:g,maskInputFn:b,slimDOMOptions:S,dataURLOptions:E,inlineImages:T,recordCanvas:A,preserveWhiteSpace:W,onSerialize:k,onIframeLoad:_,iframeLoadTimeout:M,onStylesheetLoad:j,stylesheetLoadTimeout:x,keepIframeSrcFn:L},X=0,$=Array.from(e.childNodes);X<$.length;X++){var ee,te;(te=z(ee=$[X],Q))&&Y.childNodes.push(te)}if(i(e)&&e.shadowRoot)for(var ne=0,re=Array.from(e.shadowRoot.childNodes);ne<re.length;ne++){var ee,te;(te=z(ee=re[ne],Q))&&(s(e.shadowRoot)&&(te.isShadow=!0),Y.childNodes.push(te))}}return e.parentNode&&a(e.parentNode)&&s(e.parentNode)&&(Y.isShadow=!0),Y.type===o.Element&&"iframe"===Y.tagName&&B(e,(function(){var t=e.contentDocument;if(t&&_){var n=z(t,{doc:t,mirror:r,blockClass:u,blockSelector:c,maskTextClass:l,maskTextSelector:f,skipChild:!1,inlineStylesheet:m,maskInputOptions:y,maskTextFn:g,maskInputFn:b,slimDOMOptions:S,dataURLOptions:E,inlineImages:T,recordCanvas:A,preserveWhiteSpace:W,onSerialize:k,onIframeLoad:_,iframeLoadTimeout:M,onStylesheetLoad:j,stylesheetLoadTimeout:x,keepIframeSrcFn:L});n&&_(e,n)}}),M),Y.type===o.Element&&"link"===Y.tagName&&"stylesheet"===Y.attributes.rel&&V(e,(function(){if(j){var t=z(e,{doc:n,mirror:r,blockClass:u,blockSelector:c,maskTextClass:l,maskTextSelector:f,skipChild:!1,inlineStylesheet:m,maskInputOptions:y,maskTextFn:g,maskInputFn:b,slimDOMOptions:S,dataURLOptions:E,inlineImages:T,recordCanvas:A,preserveWhiteSpace:W,onSerialize:k,onIframeLoad:_,iframeLoadTimeout:M,onStylesheetLoad:j,stylesheetLoadTimeout:x,keepIframeSrcFn:L});t&&j(e,t)}}),x),Y}function q(e,t){var n=t||{},r=n.mirror,o=void 0===r?new d:r,i=n.blockClass,a=void 0===i?"rr-block":i,s=n.blockSelector,u=void 0===s?null:s,c=n.maskTextClass,l=void 0===c?"rr-mask":c,f=n.maskTextSelector,p=void 0===f?null:f,h=n.inlineStylesheet,m=void 0===h||h,v=n.inlineImages,y=void 0!==v&&v,g=n.recordCanvas,b=void 0!==g&&g,S=n.maskAllInputs,C=void 0!==S&&S,w=n.maskTextFn,E=n.maskInputFn,I=n.slimDOM,T=void 0!==I&&I,O=n.dataURLOptions,A=n.preserveWhiteSpace,k=n.onSerialize,_=n.onIframeLoad,R=n.iframeLoadTimeout,M=n.onStylesheetLoad,j=n.stylesheetLoadTimeout,N=n.keepIframeSrcFn,x,P,L;return z(e,{doc:e,mirror:o,blockClass:a,blockSelector:u,maskTextClass:l,maskTextSelector:p,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===C?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===C?{password:!0}:C,maskTextFn:w,maskInputFn:E,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,dataURLOptions:O,inlineImages:y,recordCanvas:b,preserveWhiteSpace:A,onSerialize:k,onIframeLoad:_,iframeLoadTimeout:R,onStylesheetLoad:M,stylesheetLoadTimeout:j,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}function J(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Q="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let X={map:{},getId:()=>(console.error(Q),-1),getNode:()=>(console.error(Q),null),removeNodeFromMap(){console.error(Q)},has:()=>(console.error(Q),!1),reset(){console.error(Q)}};function $(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();o||!1!==n.leading||(o=a);const s=t-(a-o),u=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(u,i)):r||!1===n.trailing||(r=setTimeout(()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(u,i)},s))}}function ee(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>ee(e,t,i||{},!0)}function te(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(e){return()=>{}}}function ne(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function re(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function oe(e,t,n,r){if(!e)return!1;const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(D(o,t,r))return!0;if(n){if(e.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ie(e,t){return-1!==t.getId(e)}function ae(e,t){return-2===t.getId(e)}function se(e,t){if(a(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||se(e.parentNode,t))}function ue(e){return Boolean(e.changedTouches)}function ce(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}function le(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function fe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function de(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(X=new Proxy(X,{get:(e,t,n)=>("map"===t&&console.error(Q),Reflect.get(e,t,n))}));class pe{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var he=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(he||{}),me=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(me||{}),ve=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ve||{}),ye=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ye||{});function ge(e){return"__ln"in e}class be{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ge(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&ge(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const Se=(e,t)=>`${e}@${t}`;class Ce{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new be,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{var o,i,s,u;let c=null;(null===(i=null===(o=r.getRootNode)||void 0===o?void 0:o.call(r))||void 0===i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&r.getRootNode().host&&(c=r.getRootNode().host);let l=c;for(;(null===(u=null===(s=null==l?void 0:l.getRootNode)||void 0===s?void 0:s.call(l))||void 0===u?void 0:u.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host;)l=l.getRootNode().host;const f=!(this.doc.contains(r)||l&&this.doc.contains(l));if(!r.parentNode||f)return;const d=a(r.parentNode)?this.mirror.getId(c):this.mirror.getId(r.parentNode),p=n(r);if(-1===d||-1===p)return t.addNode(r);const h=z(r,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{le(e,this.mirror)&&this.iframeManager.addIframe(e),fe(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),de(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});h&&e.push({parentId:d,nextId:p,node:h})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))Ee(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||r(e);for(const e of Array.from(this.addedSet.values()))Te(this.droppedSet,e)||Ee(this.removes,e,this.mirror)?Te(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let o=null;for(;t.length;){let e=null;if(o){const t=this.mirror.getId(o.value.parentNode),r=n(o.value);-1!==t&&-1!==r&&(e=o)}if(!e)for(let r=t.length-1;r>=0;r--){const o=t.get(r);if(o){const t=this.mirror.getId(o.value.parentNode),r=undefined;if(-1===n(o.value))continue;if(-1!==t){e=o;break}{const t=o.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host,r=undefined;if(-1!==this.mirror.getId(n)){e=o;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}o=e.previous,t.removeNode(e.value),r(e.value)}const i={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))},this.processMutation=e=>{if(!ae(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;oe(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:U(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=h({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),oe(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let r=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(r||(r={node:e.target,attributes:{}},this.attributes.push(r)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==r.attributes.style&&null!==r.attributes.style||(r.attributes.style={});const o=r.attributes.style;for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r===n.style.getPropertyValue(e)&&i===n.style.getPropertyPriority(e)||(o[e]=""===i?r:[r,i])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o[e]=!1)}else r.attributes[e.attributeName]=L(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(oe(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=a(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);oe(e.target,this.blockClass,this.blockSelector,!1)||ae(t,this.mirror)||!ie(t,this.mirror)||(this.addedSet.has(t)?(we(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||se(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Se(n,r)]?we(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!a(e.target)||!s(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(ae(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Se(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);oe(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(e=>this.genAdds(e))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function we(e,t){e.delete(t),t.childNodes.forEach(t=>we(e,t))}function Ee(e,t,n){return 0!==e.length&&Ie(e,t,n)}function Ie(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return!!e.some(e=>e.id===o)||Ie(e,r,n)}function Te(e,t){return 0!==e.size&&Oe(e,t)}function Oe(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Oe(e,n))}const Ae=[],ke="undefined"!=typeof CSSGroupingRule,_e="undefined"!=typeof CSSMediaRule,Re="undefined"!=typeof CSSSupportsRule,Me="undefined"!=typeof CSSConditionRule;function je(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Ne(e,t){var n,r;const o=new Ce;Ae.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);const s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function xe({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a=[],s;const u=$(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null},i),c=$(e=>{const t=je(e),{clientX:n,clientY:o}=ue(e)?e.changedTouches[0]:e;s||(s=Date.now()),a.push({x:n,y:o,id:r.getId(t),timeOffset:Date.now()-s}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?me.Drag:e instanceof MouseEvent?me.MouseMove:me.TouchMove)},o,{trailing:!1}),l=[J("mousemove",c,n),J("touchmove",c,n),J("drag",c,n)];return()=>{l.forEach(e=>e())}}function Pe({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[],u=t=>i=>{const a=je(i);if(oe(a,r,o,!0))return;const s=ue(i)?i.changedTouches[0]:i;if(!s)return;const u=n.getId(a),{clientX:c,clientY:l}=s;e({type:ve[t],id:u,x:c,y:l})};return Object.keys(ve).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]).forEach(e=>{const n=e.toLowerCase(),r=u(e);s.push(J(n,r,t))}),()=>{s.forEach(e=>e())}}function Le({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){const a=undefined;return J("scroll",$(i=>{const a=je(i);if(!a||oe(a,r,o,!0))return;const s=n.getId(a);if(a===t){const n=t.scrollingElement||t.documentElement;e({id:s,x:n.scrollLeft,y:n.scrollTop})}else e({id:s,x:a.scrollLeft,y:a.scrollTop})},i.scroll||100),t)}function Fe({viewportResizeCb:e}){let t=-1,n=-1;const r=undefined;return J("resize",$(()=>{const r=ne(),o=re();t===r&&n===o||(e({width:Number(o),height:Number(r)}),t=r,n=o)},200),window)}function De(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Ue=["INPUT","TEXTAREA","SELECT"],Be=new WeakMap;function Ve({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,maskInputOptions:a,maskInputFn:s,sampling:u,userTriggeredOnInput:c}){function l(e){let n=je(e);const u=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||Ue.indexOf(n.tagName)<0||oe(n,r,o,!0))return;const l=n.type;if(n.classList.contains(i))return;let d=n.value,p=!1;"radio"===l||"checkbox"===l?p=n.checked:(a[n.tagName.toLowerCase()]||a[l])&&(d=h({maskInputOptions:a,tagName:n.tagName,type:l,value:d,maskInputFn:s})),f(n,De({text:d,isChecked:p,userTriggered:u},c));const m=n.name;"radio"===l&&m&&p&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach(e=>{e!==n&&f(e,De({text:e.value,isChecked:!p,userTriggered:!1},c))})}function f(t,r){const o=Be.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Be.set(t,r);const o=n.getId(t);e(Object.assign(Object.assign({},r),{id:o}))}}const d=undefined,p=("last"===u.input?["change"]:["input","change"]).map(e=>J(e,l,t)),m=t.defaultView;if(!m)return()=>{p.forEach(e=>e())};const v=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&p.push(...y.map(e=>ee(e[0],e[1],{set(){l({target:this})}},!1,m))),()=>{p.forEach(e=>e())}}function Ge(e){const t=undefined;function n(e,t){if(ke&&e.parentRule instanceof CSSGroupingRule||_e&&e.parentRule instanceof CSSMediaRule||Re&&e.parentRule instanceof CSSSupportsRule||Me&&e.parentRule instanceof CSSConditionRule){const n=undefined,r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const n=undefined,r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}return n(e,[])}function We(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function He({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(r,i){const{id:a,styleId:s}=We(this,t,n.styleMirror);return(a&&-1!==a||s&&-1!==s)&&e({id:a,styleId:s,adds:[{rule:r,index:i}]}),o.apply(this,[r,i])};const i=r.CSSStyleSheet.prototype.deleteRule;let a,s;r.CSSStyleSheet.prototype.deleteRule=function(r){const{id:o,styleId:a}=We(this,t,n.styleMirror);return(o&&-1!==o||a&&-1!==a)&&e({id:o,styleId:a,removes:[{index:r}]}),i.apply(this,[r])},r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(r){const{id:o,styleId:i}=We(this,t,n.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,replace:r}),a.apply(this,[r])}),r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(r){const{id:o,styleId:i}=We(this,t,n.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,replaceSync:r}),s.apply(this,[r])});const u={};ke?u.CSSGroupingRule=r.CSSGroupingRule:(_e&&(u.CSSMediaRule=r.CSSMediaRule),Me&&(u.CSSConditionRule=r.CSSConditionRule),Re&&(u.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(u).forEach(([r,o])=>{c[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=function(o,i){const{id:a,styleId:s}=We(this.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||s&&-1!==s)&&e({id:a,styleId:s,adds:[{rule:o,index:[...Ge(this),i||0]}]}),c[r].insertRule.apply(this,[o,i])},o.prototype.deleteRule=function(o){const{id:i,styleId:a}=We(this.parentStyleSheet,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,removes:[{index:[...Ge(this),o]}]}),c[r].deleteRule.apply(this,[o])}}),()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(u).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})}}function Ze({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(n.host);const s="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(i=null===(o=n.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===i?void 0:i.ShadowRoot,u=Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets");return null!==a&&-1!==a&&s&&u?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null===(e=u.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=u.set)||void 0===n?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(e){}return r}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}):()=>{}}function Ye({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(o,a,s){var u;if(n.has(o))return i.apply(this,[o,a,s]);const{id:c,styleId:l}=We(null===(u=this.parentRule)||void 0===u?void 0:u.parentStyleSheet,t,r.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,set:{property:o,value:a,priority:s},index:Ge(this.parentRule)}),i.apply(this,[o,a,s])};const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(o){var i;if(n.has(o))return a.apply(this,[o]);const{id:s,styleId:u}=We(null===(i=this.parentRule)||void 0===i?void 0:i.parentStyleSheet,t,r.styleMirror);return(s&&-1!==s||u&&-1!==u)&&e({id:s,styleId:u,remove:{property:o},index:Ge(this.parentRule)}),a.apply(this,[o])},()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}function Ke({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o}){const i=i=>$(o=>{const a=je(o);if(!a||oe(a,t,n,!0))return;const{currentTime:s,volume:u,muted:c,playbackRate:l}=a;e({type:i,id:r.getId(a),currentTime:s,volume:u,muted:c,playbackRate:l})},o.media||500),a=[J("play",i(0)),J("pause",i(1)),J("seeked",i(2)),J("volumechange",i(3)),J("ratechange",i(4))];return()=>{a.forEach(e=>e())}}function ze({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function e(t,n,r){const a=new i(t,n,r);return o.set(a,{family:t,buffer:"string"!=typeof n,descriptors:r,fontSource:"string"==typeof n?n:JSON.stringify(Array.from(new Uint8Array(n)))}),a};const a=te(t.fonts,"add",(function(t){return function(n){return setTimeout(()=>{const t=o.get(n);t&&(e(t),o.delete(n))},0),t.apply(this,[n])}}));return r.push(()=>{n.FontFace=i}),r.push(a),()=>{r.forEach(e=>e())}}function qe(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let a=!0;const s=()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const s=[],u=e.rangeCount||0;for(let t=0;t<u;t++){const i=e.getRangeAt(t),{startContainer:a,startOffset:u,endContainer:c,endOffset:l}=i,f=undefined;oe(a,r,o,!0)||oe(c,r,o,!0)||s.push({start:n.getId(a),startOffset:u,end:n.getId(c),endOffset:l})}i({ranges:s})};return s(),J("selectionchange",s)}function Je(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:u,styleSheetRuleCb:c,styleDeclarationCb:l,canvasMutationCb:f,fontCb:d,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),u(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),l(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),f(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}function Qe(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Je(e,t);const r=Ne(e,e.doc),o=xe(e),i=Pe(e),a=Le(e),s=Fe(e),u=Ve(e),c=Ke(e),l=He(e,{win:n}),f=Ze(e,e.doc),d=Ye(e,{win:n}),p=e.collectFonts?ze(e):()=>{},h=qe(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,n,t.options));return()=>{Ae.forEach(e=>e.reset()),r.disconnect(),o(),i(),a(),s(),u(),c(),l(),f(),d(),p(),h(),m.forEach(e=>e())}}class Xe{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),i.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class $e{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Xe(w),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type){const t=undefined;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case he.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:he.IncrementalSnapshot,data:{source:me.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case he.Meta:case he.Load:case he.DomContentLoaded:return!1;case he.Plugin:return t;case he.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case he.IncrementalSnapshot:switch(t.data.source){case me.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case me.Drag:case me.TouchMove:case me.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case me.ViewportResize:return!1;case me.MediaInteraction:case me.MouseInteraction:case me.Scroll:case me.CanvasMutation:case me.Input:return this.replaceIds(t.data,e,["id"]),t;case me.StyleSheetRule:case me.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case me.Font:return t;case me.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case me.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}}class et{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(te(Element.prototype,"attachShadow",(function(e){return function(n){const r=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),r}})))}addShadowRoot(e,t){s(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),Ne(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Le(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),Ze({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(te(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(r){const o=n.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}})))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}
|
|
/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */function tt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function nt(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))}for(var rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ot="undefined"==typeof Uint8Array?[]:new Uint8Array(256),it=0;it<rt.length;it++)ot[rt.charCodeAt(it)]=it;var at=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=rt[t[n]>>2],o+=rt[(3&t[n])<<4|t[n+1]>>4],o+=rt[(15&t[n+1])<<2|t[n+2]>>6],o+=rt[63&t[n+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o};const st=new Map;function ut(e,t){let n=st.get(e);return n||(n=new Map,st.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const ct=(e,t,n)=>{if(!e||!dt(e,t)&&"object"!=typeof e)return;const r=undefined,o=ut(n,e.constructor.name);let i=o.indexOf(e);return-1===i&&(i=o.length,o.push(e)),i};function lt(e,t,n){if(e instanceof Array)return e.map(e=>lt(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){const t=undefined;return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=undefined,n=undefined;return{rr_type:e.constructor.name,base64:at(e)}}if(e instanceof DataView){const r=undefined;return{rr_type:e.constructor.name,args:[lt(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){const t=undefined,n=undefined;return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){const r=undefined;return{rr_type:e.constructor.name,args:[lt(e.data,t,n),e.width,e.height]}}if(dt(e,t)||"object"==typeof e){const r=undefined,o=undefined;return{rr_type:e.constructor.name,index:ct(e,t,n)}}return e}const ft=(e,t,n)=>[...e].map(e=>lt(e,t,n)),dt=(e,t)=>{const n=undefined,r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(r.find(n=>e instanceof t[n]))};function pt(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const i=te(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(...i){return oe(this.canvas,n,r,!0)||setTimeout(()=>{const n=ft([...i],t,this);e(this.canvas,{type:ye["2D"],property:a,args:n})},0),o.apply(this,i)}}));o.push(i)}catch(n){const r=ee(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:ye["2D"],property:a,args:[t],setter:!0})}});o.push(r)}return()=>{o.forEach(e=>e())}}function ht(e,t,n){const r=[];try{const o=te(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r,...o){return oe(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...o])}}));r.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(e=>e())}}function mt(e,t,n,r,o,i,a){const s=[],u=Object.getOwnPropertyNames(e);for(const i of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if("function"!=typeof e[i])continue;const u=te(e,i,(function(e){return function(...s){const u=e.apply(this,s);if(ct(u,a,this),!oe(this.canvas,r,o,!0)){const e=ft([...s],a,this),r={type:t,property:i,args:e};n(this.canvas,r)}return u}}));s.push(u)}catch(r){const o=ee(e,i,{set(e){n(this.canvas,{type:t,property:i,args:[e],setter:!0})}});s.push(o)}return s}function vt(e,t,n,r,o){const i=[];return i.push(...mt(t.WebGLRenderingContext.prototype,ye.WebGL,e,n,r,o,t)),void 0!==t.WebGL2RenderingContext&&i.push(...mt(t.WebGL2RenderingContext.prototype,ye.WebGL2,e,n,r,o,t)),()=>{i.forEach(e=>e())}}var yt=null;try{var gt="function"==typeof e.require&&n(!function e(){var t=new Error("Cannot find module 'worker_threads'");throw t.code="MODULE_NOT_FOUND",t}())||"function"==typeof require&&require("worker_threads")||n(!function e(){var t=new Error("Cannot find module 'worker_threads'");throw t.code="MODULE_NOT_FOUND",t}());yt=gt.Worker}catch(e){}function bt(e,n){return t.from(e,"base64").toString(n?"utf16":"utf8")}function St(e,t,n){var r=void 0===t?null:t,o,i=bt(e,void 0!==n&&n),a=i.indexOf("\n",10)+1,s=i.substring(a)+(r?"//# sourceMappingURL="+r:"");return function e(t){return new yt(s,Object.assign({},t,{eval:!0}))}}function Ct(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function wt(e,t,n){var r=void 0===t?null:t,o,i=Ct(e,void 0!==n&&n),a=i.indexOf("\n",10)+1,s=i.substring(a)+(r?"//# sourceMappingURL="+r:""),u=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(u)}function Et(e,t,n){var r;return function o(i){return r=r||wt(e,t,n),new Worker(r,i)}}var It="[object process]"===Object.prototype.toString.call(void 0!==r?r:0);function Tt(){return It}function Ot(e,t,n){return Tt()?St(e,t,n):Et(e,t,n)}var At=Ot("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);class kt{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{const n=undefined;!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const i=ht(t,n,r),a=new Map,s=new At;s.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:ye["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const u=1e3/e;let c=0,l;const f=()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{oe(t,n,r,!0)||e.push(t)}),e},d=e=>{c&&e-c<u||(c=e,f().forEach(e=>nt(this,void 0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(a.get(n))return;if(a.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const r=yield createImageBitmap(e);s.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])})))),l=requestAnimationFrame(d)};l=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=ht(e,t,n),o=pt(this.processMutation.bind(this),e,t,n),i=vt(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const t=undefined;return tt(e,["type"])}),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class _t{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new pe,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map((e,t)=>({rule:l(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Rt(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Mt,jt,Nt,xt=!1;const Pt=p();function Lt(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",maskTextClass:s="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:l,maskInputOptions:f,slimDOMOptions:d,maskInputFn:p,maskTextFn:h,hooks:m,packFn:v,sampling:y={},dataURLOptions:g={},mousemoveWait:b,recordCanvas:S=!1,recordCrossOriginIframes:C=!1,userTriggeredOnInput:w=!1,collectFonts:E=!1,inlineImages:I=!1,plugins:T,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:A=new Set([])}=e,k=!C||window.parent===window;let _=!1;if(!k)try{window.parent.document,_=!1}catch(e){_=!0}if(k&&!t)throw new Error("emit function is required");void 0!==b&&void 0===y.mousemove&&(y.mousemove=b),Pt.reset();const R=!0===l?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==f?f:{password:!0},M=!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===d,headMetaDescKeywords:"all"===d}:d||{};let j;ce();let N=0;const x=e=>{for(const t of T||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&(e=v(e)),e};Mt=(e,o)=>{var i;if(!(null===(i=Ae[0])||void 0===i?void 0:i.isFrozen())||e.type===he.FullSnapshot||e.type===he.IncrementalSnapshot&&e.data.source===me.Mutation||Ae.forEach(e=>e.unfreeze()),k)null==t||t(x(e),o);else if(_){const t={type:"rrweb",event:x(e),isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===he.FullSnapshot)j=e,N=0;else if(e.type===he.IncrementalSnapshot){if(e.data.source===me.Mutation&&e.data.isAttachIframe)return;N++;const t=r&&N>=r,o=n&&e.timestamp-j.timestamp>n;(t||o)&&jt(!0)}};const P=e=>{Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.Mutation},e)}))},L=e=>Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.Scroll},e)})),F=e=>Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.CanvasMutation},e)})),D=undefined,U=new _t({mutationCb:P,adoptedStyleSheetCb:e=>Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.AdoptedStyleSheet},e)}))}),B=new $e({mirror:Pt,mutationCb:P,stylesheetManager:U,recordCrossOriginIframes:C,wrappedEmit:Mt});for(const e of T||[])e.getMirror&&e.getMirror({nodeMirror:Pt,crossOriginIframeMirror:B.crossOriginIframeMirror,crossOriginIframeStyleMirror:B.crossOriginIframeStyleMirror});Nt=new kt({recordCanvas:S,mutationCb:F,win:window,blockClass:o,blockSelector:i,mirror:Pt,sampling:y.canvas,dataURLOptions:g});const V=new et({mutationCb:P,scrollCb:L,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:R,dataURLOptions:g,maskTextFn:h,maskInputFn:p,recordCanvas:S,inlineImages:I,sampling:y,slimDOMOptions:M,iframeManager:B,stylesheetManager:U,canvasManager:Nt,keepIframeSrcFn:O},mirror:Pt});jt=(e=!1)=>{var t,n,r,a,l,f;Mt(Rt({type:he.Meta,data:{href:window.location.href,width:re(),height:ne()}}),e),U.reset(),Ae.forEach(e=>e.lock());const d=q(document,{mirror:Pt,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:R,maskTextFn:h,slimDOM:M,dataURLOptions:g,recordCanvas:S,inlineImages:I,onSerialize:e=>{le(e,Pt)&&B.addIframe(e),fe(e,Pt)&&U.trackLinkElement(e),de(e)&&V.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{B.attachIframe(e,t),V.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{U.attachLinkElement(e,t)},keepIframeSrcFn:O});if(!d)return console.warn("Failed to snapshot the document");Mt(Rt({type:he.FullSnapshot,data:{node:d,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(l=null===(a=null===document||void 0===document?void 0:document.body)||void 0===a?void 0:a.parentElement)||void 0===l?void 0:l.scrollTop)||(null===(f=null===document||void 0===document?void 0:document.body)||void 0===f?void 0:f.scrollTop)||0}}})),Ae.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&U.adoptStyleSheets(document.adoptedStyleSheets,Pt.getId(document))};try{const e=[];e.push(J("DOMContentLoaded",()=>{Mt(Rt({type:he.DomContentLoaded,data:{}}))}));const t=e=>{var t;return Qe({mutationCb:P,mousemoveCb:(e,t)=>Mt(Rt({type:he.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.MouseInteraction},e)})),scrollCb:L,viewportResizeCb:e=>Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.ViewportResize},e)})),inputCb:e=>Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.Input},e)})),mediaInteractionCb:e=>Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.MediaInteraction},e)})),styleSheetRuleCb:e=>Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.StyleSheetRule},e)})),styleDeclarationCb:e=>Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.StyleDeclaration},e)})),canvasMutationCb:F,fontCb:e=>Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.Font},e)})),selectionCb:e=>{Mt(Rt({type:he.IncrementalSnapshot,data:Object.assign({source:me.Selection},e)}))},blockClass:o,ignoreClass:a,maskTextClass:s,maskTextSelector:u,maskInputOptions:R,inlineStylesheet:c,sampling:y,recordCanvas:S,inlineImages:I,userTriggeredOnInput:w,collectFonts:E,doc:e,maskInputFn:p,maskTextFn:h,keepIframeSrcFn:O,blockSelector:i,slimDOMOptions:M,dataURLOptions:g,mirror:Pt,iframeManager:B,stylesheetManager:U,shadowDomManager:V,canvasManager:Nt,ignoreCSSAttributes:A,plugins:(null===(t=null==T?void 0:T.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Mt(Rt({type:he.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},m)};B.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{jt(),e.push(t(document)),xt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(J("load",()=>{Mt(Rt({type:he.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),xt=!1}}catch(e){console.warn(e)}}Lt.addCustomEvent=(e,t)=>{if(!xt)throw new Error("please add custom event after start recording");Mt(Rt({type:he.Custom,data:{tag:e,payload:t}}))},Lt.freezePage=()=>{Ae.forEach(e=>e.freeze())},Lt.takeFullSnapshot=e=>{if(!xt)throw new Error("please take full snapshot after start recording");jt(e)},Lt.mirror=Pt,e.exports=Lt}).call(this,n(60)(e),n(61).Buffer,n(65))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";(function(e){
|
|
/*!
|
|
* The buffer module from node.js, for the browser.
|
|
*
|
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
* @license MIT
|
|
*/
|
|
var r=n(62),o=n(63),i=n(64);function a(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?v(e,t,n,r):"string"==typeof t?h(e,t,n):y(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t,n,r){return f(t),t<=0?u(e,t):void 0!==n?"string"==typeof r?u(e,t).fill(n,r):u(e,t).fill(n):u(e,t)}function p(e,t){if(f(t),e=u(e,t<0?0:0|g(t)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function h(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|S(t,n),o=(e=u(e,r)).write(t,n);return o!==r&&(e=e.slice(0,o)),e}function m(e,t){var n=t.length<0?0:0|g(t.length);e=u(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function v(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=m(e,t),e}function y(e,t){if(c.isBuffer(t)){var n=0|g(t.length);return 0===(e=u(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||te(t.length)?u(e,0):m(e,t);if("Buffer"===t.type&&i(t.data))return m(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function g(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function b(e){return+e!=e&&(e=0),c.alloc(+e)}function S(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return J(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(r)return J(e).length;t=(""+t).toLowerCase(),r=!0}}function C(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,n);case"utf8":case"utf-8":return j(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return M(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function w(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function E(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:I(e,t,n,r,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):I(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function I(e,t,n,r,o){var i=1,a=e.length,s=t.length,u;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;i=2,a/=2,s/=2,n/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var l=-1;for(u=n;u<a;u++)if(c(e,u)===c(t,-1===l?0:u-l)){if(-1===l&&(l=u),u-l+1===s)return l*i}else-1!==l&&(u-=u-l),l=-1}else for(n+s>a&&(n=a-s),u=n;u>=0;u--){for(var f=!0,d=0;d<s;d++)if(c(e,u+d)!==c(t,d)){f=!1;break}if(f)return u}return-1}function T(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function O(e,t,n,r){return ee(J(t,e.length-n),e,n,r)}function A(e,t,n,r){return ee(Q(t),e,n,r)}function k(e,t,n,r){return A(e,t,n,r)}function _(e,t,n,r){return ee($(t),e,n,r)}function R(e,t,n,r){return ee(X(t,e.length-n),e,n,r)}function M(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function j(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i=e[o],a=null,s=i>239?4:i>223?3:i>191?2:1,u,c,l,f;if(o+s<=n)switch(s){case 1:i<128&&(a=i);break;case 2:128==(192&(u=e[o+1]))&&(f=(31&i)<<6|63&u)>127&&(a=f);break;case 3:u=e[o+1],c=e[o+2],128==(192&u)&&128==(192&c)&&(f=(15&i)<<12|(63&u)<<6|63&c)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:u=e[o+1],c=e[o+2],l=e[o+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&(f=(15&i)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&f<1114112&&(a=f)}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=s}return x(r)}t.Buffer=c,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:a(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,n){return l(null,e,t,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,n){return d(null,e,t,n)},c.allocUnsafe=function(e){return p(null,e)},c.allocUnsafeSlow=function(e){return p(null,e)},c.isBuffer=function e(t){return!(null==t||!t._isBuffer)},c.compare=function e(t,n){if(!c.isBuffer(t)||!c.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;for(var r=t.length,o=n.length,i=0,a=Math.min(r,o);i<a;++i)if(t[i]!==n[i]){r=t[i],o=n[i];break}return r<o?-1:o<r?1:0},c.isEncoding=function e(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function e(t,n){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===n)for(n=0,r=0;r<t.length;++r)n+=t[r].length;var o=c.allocUnsafe(n),a=0;for(r=0;r<t.length;++r){var s=t[r];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(o,a),a+=s.length}return o},c.byteLength=S,c.prototype._isBuffer=!0,c.prototype.swap16=function e(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<t;n+=2)w(this,n,n+1);return this},c.prototype.swap32=function e(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<t;n+=4)w(this,n,n+3),w(this,n+1,n+2);return this},c.prototype.swap64=function e(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<t;n+=8)w(this,n,n+7),w(this,n+1,n+6),w(this,n+2,n+5),w(this,n+3,n+4);return this},c.prototype.toString=function e(){var t=0|this.length;return 0===t?"":0===arguments.length?j(this,0,t):C.apply(this,arguments)},c.prototype.equals=function e(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function e(){var n="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(n+=" ... ")),"<Buffer "+n+">"},c.prototype.compare=function e(t,n,r,o,i){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),n<0||r>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&n>=r)return 0;if(o>=i)return-1;if(n>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(o>>>=0),s=(r>>>=0)-(n>>>=0),u=Math.min(a,s),l=this.slice(o,i),f=t.slice(n,r),d=0;d<u;++d)if(l[d]!==f[d]){a=l[d],s=f[d];break}return a<s?-1:s<a?1:0},c.prototype.includes=function e(t,n,r){return-1!==this.indexOf(t,n,r)},c.prototype.indexOf=function e(t,n,r){return E(this,t,n,r,!0)},c.prototype.lastIndexOf=function e(t,n,r){return E(this,t,n,r,!1)},c.prototype.write=function e(t,n,r,o){if(void 0===n)o="utf8",r=this.length,n=0;else if(void 0===r&&"string"==typeof n)o=n,r=this.length,n=0;else{if(!isFinite(n))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");n|=0,isFinite(r)?(r|=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var i=this.length-n;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return T(this,t,n,r);case"utf8":case"utf-8":return O(this,t,n,r);case"ascii":return A(this,t,n,r);case"latin1":case"binary":return k(this,t,n,r);case"base64":return _(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n,r);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}},c.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function x(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}function P(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function L(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function F(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=q(e[i]);return o}function D(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function U(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function V(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function G(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function W(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function H(e,t,n,r,i){return i||W(e,t,n,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,n,r,23,4),n+4}function Z(e,t,n,r,i){return i||W(e,t,n,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function e(t,n){var r=this.length,o;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(n=void 0===n?r:~~n)<0?(n+=r)<0&&(n=0):n>r&&(n=r),n<t&&(n=t),c.TYPED_ARRAY_SUPPORT)(o=this.subarray(t,n)).__proto__=c.prototype;else{var i=n-t;o=new c(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+t]}return o},c.prototype.readUIntLE=function e(t,n,r){t|=0,n|=0,r||U(t,n,this.length);for(var o=this[t],i=1,a=0;++a<n&&(i*=256);)o+=this[t+a]*i;return o},c.prototype.readUIntBE=function e(t,n,r){t|=0,n|=0,r||U(t,n,this.length);for(var o=this[t+--n],i=1;n>0&&(i*=256);)o+=this[t+--n]*i;return o},c.prototype.readUInt8=function e(t,n){return n||U(t,1,this.length),this[t]},c.prototype.readUInt16LE=function e(t,n){return n||U(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function e(t,n){return n||U(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function e(t,n){return n||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function e(t,n){return n||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function e(t,n,r){t|=0,n|=0,r||U(t,n,this.length);for(var o=this[t],i=1,a=0;++a<n&&(i*=256);)o+=this[t+a]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*n)),o},c.prototype.readIntBE=function e(t,n,r){t|=0,n|=0,r||U(t,n,this.length);for(var o=n,i=1,a=this[t+--o];o>0&&(i*=256);)a+=this[t+--o]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*n)),a},c.prototype.readInt8=function e(t,n){return n||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function e(t,n){n||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function e(t,n){n||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function e(t,n){return n||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function e(t,n){return n||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function e(t,n){return n||U(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function e(t,n){return n||U(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function e(t,n){return n||U(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function e(t,n){return n||U(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function e(t,n,r,o){var i;(t=+t,n|=0,r|=0,o)||B(this,t,n,r,Math.pow(2,8*r)-1,0);var a=1,s=0;for(this[n]=255&t;++s<r&&(a*=256);)this[n+s]=t/a&255;return n+r},c.prototype.writeUIntBE=function e(t,n,r,o){var i;(t=+t,n|=0,r|=0,o)||B(this,t,n,r,Math.pow(2,8*r)-1,0);var a=r-1,s=1;for(this[n+a]=255&t;--a>=0&&(s*=256);)this[n+a]=t/s&255;return n+r},c.prototype.writeUInt8=function e(t,n,r){return t=+t,n|=0,r||B(this,t,n,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=255&t,n+1},c.prototype.writeUInt16LE=function e(t,n,r){return t=+t,n|=0,r||B(this,t,n,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):V(this,t,n,!0),n+2},c.prototype.writeUInt16BE=function e(t,n,r){return t=+t,n|=0,r||B(this,t,n,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):V(this,t,n,!1),n+2},c.prototype.writeUInt32LE=function e(t,n,r){return t=+t,n|=0,r||B(this,t,n,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=255&t):G(this,t,n,!0),n+4},c.prototype.writeUInt32BE=function e(t,n,r){return t=+t,n|=0,r||B(this,t,n,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):G(this,t,n,!1),n+4},c.prototype.writeIntLE=function e(t,n,r,o){if(t=+t,n|=0,!o){var i=Math.pow(2,8*r-1);B(this,t,n,r,i-1,-i)}var a=0,s=1,u=0;for(this[n]=255&t;++a<r&&(s*=256);)t<0&&0===u&&0!==this[n+a-1]&&(u=1),this[n+a]=(t/s>>0)-u&255;return n+r},c.prototype.writeIntBE=function e(t,n,r,o){if(t=+t,n|=0,!o){var i=Math.pow(2,8*r-1);B(this,t,n,r,i-1,-i)}var a=r-1,s=1,u=0;for(this[n+a]=255&t;--a>=0&&(s*=256);)t<0&&0===u&&0!==this[n+a+1]&&(u=1),this[n+a]=(t/s>>0)-u&255;return n+r},c.prototype.writeInt8=function e(t,n,r){return t=+t,n|=0,r||B(this,t,n,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=255&t,n+1},c.prototype.writeInt16LE=function e(t,n,r){return t=+t,n|=0,r||B(this,t,n,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):V(this,t,n,!0),n+2},c.prototype.writeInt16BE=function e(t,n,r){return t=+t,n|=0,r||B(this,t,n,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):V(this,t,n,!1),n+2},c.prototype.writeInt32LE=function e(t,n,r){return t=+t,n|=0,r||B(this,t,n,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):G(this,t,n,!0),n+4},c.prototype.writeInt32BE=function e(t,n,r){return t=+t,n|=0,r||B(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):G(this,t,n,!1),n+4},c.prototype.writeFloatLE=function e(t,n,r){return H(this,t,n,!0,r)},c.prototype.writeFloatBE=function e(t,n,r){return H(this,t,n,!1,r)},c.prototype.writeDoubleLE=function e(t,n,r){return Z(this,t,n,!0,r)},c.prototype.writeDoubleBE=function e(t,n,r){return Z(this,t,n,!1,r)},c.prototype.copy=function e(t,n,r,o){if(r||(r=0),o||0===o||(o=this.length),n>=t.length&&(n=t.length),n||(n=0),o>0&&o<r&&(o=r),o===r)return 0;if(0===t.length||0===this.length)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-n<o-r&&(o=t.length-n+r);var i=o-r,a;if(this===t&&r<n&&n<o)for(a=i-1;a>=0;--a)t[a+n]=this[a+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)t[a+n]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),n);return i},c.prototype.fill=function e(t,n,r,o){if("string"==typeof t){if("string"==typeof n?(o=n,n=0,r=this.length):"string"==typeof r&&(o=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!c.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else"number"==typeof t&&(t&=255);if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;var a;if(n>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=n;a<r;++a)this[a]=t;else{var s=c.isBuffer(t)?t:J(new c(t,o).toString()),u=s.length;for(a=0;a<r-n;++a)this[a+n]=s[a%u]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function K(e){if((e=z(e).replace(Y,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function J(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function Q(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function X(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,i.push(o),i.push(r);return i}function $(e){return r.toByteArray(K(e))}function ee(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function te(e){return e!=e}}).call(this,n(23))},function(e,t,n){"use strict";t.byteLength=l,t.toByteArray=d,t.fromByteArray=m;for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("="),r;return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r}function f(e,t,n){return 3*(t+n)/4-n}function d(e){var t,n=c(e),r=n[0],a=n[1],s=new i(f(e,r,a)),u=0,l=a>0?r-4:r,d;for(d=0;d<l;d+=4)t=o[e.charCodeAt(d)]<<18|o[e.charCodeAt(d+1)]<<12|o[e.charCodeAt(d+2)]<<6|o[e.charCodeAt(d+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;return 2===a&&(t=o[e.charCodeAt(d)]<<2|o[e.charCodeAt(d+1)]>>4,s[u++]=255&t),1===a&&(t=o[e.charCodeAt(d)]<<10|o[e.charCodeAt(d+1)]<<4|o[e.charCodeAt(d+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t),s}function p(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function h(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(p(r));return o.join("")}function m(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=16383)i.push(h(e,s,s+16383>u?u:s+16383));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){
|
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?o-1:0,d=n?-1:1,p=e[t+f];for(f+=d,i=p&(1<<-l)-1,p>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+p]=255&s,p+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+p]=255&a,p+=h,a/=256,c-=8);e[n+p-h]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){var n=e.exports={},r,o;function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}function u(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{return o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var c=[],l=!1,f,d=-1;function p(){l&&f&&(l=!1,f.length?c=f.concat(c):d=-1,c.length&&h())}function h(){if(!l){var e=s(p);l=!0;for(var t=c.length;t;){for(f=c,c=[];++d<t;)f&&f[d].run();d=-1,t=c.length}f=null,l=!1,u(e)}}function m(e,t){this.fun=e,this.array=t}function v(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new m(e,t)),1!==c.length||l||s(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=v,n.addListener=v,n.once=v,n.off=v,n.removeListener=v,n.removeAllListeners=v,n.emit=v,n.prependListener=v,n.prependOnceListener=v,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},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,s(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaySegment=void 0;var c=1e7,l=5e3,f=200,d={},p=function(){function e(t,n){var r=this,i;if(o(this,e),this.events=[],this.destroyed=!1,this.flush=function(e){clearTimeout(r.timeout),setTimeout((function(){return r.callback(e)}))},this.destroyed)throw new Error("Replay segment was destroyed");var a=null===(i=t.view)||void 0===i?void 0:i.id;if(!a)throw new Error("view.id must be defined");a in d||(d[a]=-1),this.rumEvent=t,this.callback=n,t.records_index=d[a]+=1,t.records_count=0,t.records_end=t.timestamp,t.has_full_snapshot=0,this.timeout=setTimeout((function(){return r.flush("segment_duration_limit")}),5e3)}return a(e,[{key:"addEvent",value:function(e){var t=e.data,n=this.rumEvent;2===t.type&&(n.has_full_snapshot=1);var r=null==t?void 0:t.timestamp;return r&&(n.records_end=Math.max(n.records_end,r),n.timestamp=Math.min(n.timestamp,r)),n.records_count++,this.events.push(t),n.records_count>=200&&this.flush("segment_counts_limit"),!0}},{key:"getEvents",value:function(){var e=this.events;return this.events=null,clearTimeout(this.timeout),this.destroyed=!0,JSON.stringify(e)}}])}();t.ReplaySegment=p},function(e,t,n){"use strict";function r(){function e(e,n,r,i){var a=n&&n.prototype instanceof t?n:t,c=Object.create(a.prototype);return o(c,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,u=0;!f&&c&&!n&&u<l.length;u++){var n,r=l[u],o=p.p,h=r[2];3<e?(n=h===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=s):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,p.v=t,p.n=r[1]):o<h&&(n=3>e||r[0]>t||t>h)&&(r[4]=e,r[5]=t,p.n=h,i=0))}if(n||1<e)return d;throw f=!0,t}var o,i,a,c=0,l=n||[],f=!1,p={p:0,n:0,v:s,a:r,f:r.bind(s,4),d:function e(t,n){return o=t,i=0,a=s,p.n=n,d}};return function(n,l,h){if(1<c)throw TypeError("Generator is already running");for(f&&1===l&&r(l,h),i=l,a=h;(u=2>i?s:a)||!f;){o||(i?3>i?(1<i&&(p.n=-1),r(i,a)):p.n=a:p.v=a);try{if(c=2,o){if(i||(n="next"),u=o[n]){if(!(u=u.call(o,a)))throw TypeError("iterator result is not an object");if(!u.done)return u;a=u.value,2>i&&(i=0)}else 1===i&&(u=o.return)&&u.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=s}else if((u=(f=0>p.n)?a:e.call(t,p))!==d)break}catch(e){o=s,i=1,a=e}finally{c=1}}return{value:u,done:f}}}(e,r,i),!0),c}function t(){}function n(){}function i(){}function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,o(e,f,"GeneratorFunction")),e.prototype=Object.create(h),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var s,u,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",f=c.toStringTag||"@@toStringTag",d={};u=Object.getPrototypeOf;var p=[][l]?u(u([][l]())):(o(u={},l,(function(){return this})),u),h=i.prototype=t.prototype=Object.create(p);return n.prototype=i,o(h,"constructor",i),o(i,"constructor",n),n.displayName="GeneratorFunction",o(i,f,"GeneratorFunction"),o(h),o(h,f,"Generator"),o(h,l,(function(){return this})),o(h,"toString",(function(){return"[object Generator]"})),(r=function t(){return{w:e,m:a}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(o=function e(t,n,r,a){function s(e,n){o(t,e,(function(t){return this._invoke(e,n,t)}))}n?i?i(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}var i=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.compressData=void 0;var a=n(0),s="undefined"!=typeof Worker,u=null,c=null,l=[],f=!1,d=0;function p(){if(u)return u;var e=new Blob(["\n importScripts('https://sdk.rum.aliyuncs.com/module/pako.min.js');\n self.onmessage = function(e) {\n const { taskId, data: jsonString } = e.data;\n try {\n const encoder = new TextEncoder();\n const uint8Array = encoder.encode(jsonString);\n const compressed = pako.deflate(uint8Array, { level: 6 });\n const chunkSize = 8192;\n let compressedString = '';\n for (let i = 0; i < compressed.length; i += chunkSize) {\n const chunk = compressed.slice(i, i + chunkSize);\n compressedString += String.fromCharCode.apply(null, Array.from(chunk));\n }\n self.postMessage({ taskId, success: true, data: compressedString });\n } catch (error) {\n self.postMessage({ taskId, success: false, error: error.message });\n }\n };\n "],{type:"application/javascript"});return u=URL.createObjectURL(e)}function h(e){var t=l.indexOf(e);return-1!==t&&(l.splice(t,1),!0)}function m(e,t){clearTimeout(e.timeout),e.reject(t)}function v(){if(c)return c;try{var e=p();c=new Worker(e)}catch(e){return null}return c.onmessage=function(e){var t=e.data,n=t.taskId,r=t.success,o=t.data,i=t.error,a=l.find((function(e){return e.taskId===n}));a&&(h(a),clearTimeout(a.timeout),r?a.resolve(o):a.reject(new Error(i||"Compression failed")),y())},c.onerror=function(e){var t;l.splice(0).forEach((function(e){m(e,new Error("Worker error occurred"))})),c&&(c.terminate(),c=null),f=!1},c}function y(){if(f||0===l.length)f=!1;else{f=!0;var e=l[0],t=v(),n;if(!t)return l.splice(0).forEach((function(e){m(e,new Error("Failed to create Worker"))})),void(f=!1);var r=++d;e.taskId=r;try{t.postMessage({taskId:r,data:e.data})}catch(t){h(e),m(e,t),f=!1,y()}}}var g=3e4;function b(e){return new Promise((function(t,n){var r={data:e,resolve:t,reject:n,timeout:setTimeout((function(){h(r)&&m(r,new Error("Compression timeout")),0===l.length?f=!1:!f&&y()}),3e4)};l.push(r),f||y()}))}function S(e){return i(this,void 0,void 0,r().m((function t(){var n,o;return r().w((function(t){for(;;)switch(t.p=t.n){case 0:if(!(e&&(0,a.isString)(e)&&s)){t.n=5;break}return t.p=1,t.n=2,b(e);case 2:if(!(n=t.v)||"string"!=typeof n){t.n=3;break}return t.a(2,{data:n,encoding:"deflate"});case 3:t.n=5;break;case 4:t.p=4,o=t.v;case 5:return t.a(2,{data:e,encoding:"json"})}}),t,null,[[1,4]])})))}t.compressData=S},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(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,s(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(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 c=n(0),l=n(5),f=n(6),d=n(1),p=n(7),h=n(2),m=n(11),v=function(){function e(){var t=this;o(this,e),this.name="view-stats-collector",this.currentViewStats=null,this.initData=function(){var e=(0,f.getCurView)(t.ctx);if(e){var n=(0,h.getCurrentTime)(),r=(0,p.getDocumentInfo)(),o=r.width,i=r.height,a=r.isVisible;t.currentViewStats={view:e,startTime:n,scroll:{max_depth:0,max_depth_scroll_top:0,max_scroll_height:0,max_scroll_height_time:0},viewport:{width:o,height:i},accumulatedTime:0,lastActiveTime:n,isActive:a},d.global.addEventListener(p.DOM_EVENT.SCROLL,t.handleScroll,{passive:!0})}},this.handleScroll=(0,c.debounce)((function(){var e=t.currentViewStats;if(e){var n=(0,p.getDocumentInfo)(),r=n.scrollTop,o=n.scrollHeight,i=n.clientHeight,a=(0,h.getCurrentTime)(),s=0<o?(r+i)/o:0,u=Math.round(100*s),c=e.scroll;u>e.scroll.max_depth&&(c.max_depth=u,c.max_depth_scroll_top=r),o>c.max_scroll_height&&(c.max_scroll_height=o,c.max_scroll_height_time=a-e.startTime)}}),100),this.handleBeforeUnload=function(){var e=t.currentViewStats;if(e){if(e.isActive){var n,r=(0,h.getCurrentTime)()-e.lastActiveTime;e.accumulatedTime+=r,e.isActive=!1}t.sendViewStats()}},this.handleVisibilityChange=function(){var e=t.currentViewStats;if(e){var n=(0,h.getCurrentTime)(),r,o=(0,p.getDocumentInfo)().isVisible;if(e.isActive&&!o){var i=n-e.lastActiveTime;e.accumulatedTime+=i,e.isActive=!1}else!e.isActive&&o&&(e.lastActiveTime=n,e.isActive=!0)}},this.sendViewStats=function(){var e=t.currentViewStats;if(e){var n=(0,h.getCurrentTime)(),r=e.accumulatedTime;e.isActive&&(r+=n-e.lastActiveTime);var o=t.ctx.session.getBaseEvent(),i=Object.assign(Object.assign({},o),{event_type:c.RumEventType.VIEW,type:"view-stats",url:(0,l.getCurrentURL)(),time_spent:r,scroll:e.scroll,viewport:e.viewport,view:e.view,duration:n-e.startTime});t.sendEvent(i),t.currentViewStats=null,d.global.removeEventListener(p.DOM_EVENT.SCROLL,t.handleScroll)}}}return a(e,[{key:"setup",value:function(e,t){this.ctx=e,this.sendEvent=t,this.currentViewStats||this.initData(),this.ctx.emitter.on(m.LifeCycleEventType.VIEW_CREATED,this.initData),this.ctx.emitter.on(m.LifeCycleEventType.VIEW_ENDED,this.sendViewStats),d.global.addEventListener(p.DOM_EVENT.BEFORE_UNLOAD,this.handleBeforeUnload),d.document.addEventListener(p.DOM_EVENT.VISIBILITY_CHANGE,this.handleVisibilityChange)}},{key:"destroy",value:function(){this.ctx.emitter.off(m.LifeCycleEventType.VIEW_CREATED,this.initData),this.ctx.emitter.off(m.LifeCycleEventType.VIEW_ENDED,this.sendViewStats),d.global.removeEventListener(p.DOM_EVENT.BEFORE_UNLOAD,this.handleBeforeUnload),d.document.removeEventListener(p.DOM_EVENT.VISIBILITY_CHANGE,this.handleVisibilityChange),d.global.removeEventListener(p.DOM_EVENT.SCROLL,this.handleScroll)}}])}();t.default=v},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,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,s(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(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 c=n(2),l=n(6),f=function(){function e(){o(this,e),this.name="default-processor"}return a(e,[{key:"process",value:function(e){var t=e.getRumEvent(),n=(0,l.getCurView)(e),r;return Object.assign({timestamp:(0,c.getCurrentTime)(),session_id:e.session.getSessionId(),event_id:e.session.getEventId(),view:n},t)}}])}();t.default=f},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=u(e,"string");return"symbol"==r(t)?t:t+""}function u(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 c=n(0),l=n(21),f=n(24),d=function(){function e(){var t=this;o(this,e),this.name="session-processor",this.cache={},this.update=function(e){e&&!e.isTrusted||t.ctx.session.updateSession()}}return a(e,[{key:"setup",value:function(e){this.ctx=e,document.addEventListener("click",this.update,!0)}},{key:"getSampled",value:function(e){var t,n=this.ctx.getConfig().collectors,r=void 0===n?{}:n,o=e.event_type,i=e.type,a=e.source,s=e.event_type;if(o===c.RumEventType.RESOURCE?s=Object.values(f.ApiType).includes(i)?"api":"staticResource":o===c.RumEventType.EXCEPTION&&a&&("blank"===i?s="blank":a===l.ExceptionSource.console?s="consoleError":(a===l.ExceptionSource.onError||a===l.ExceptionSource.unhandled)&&(s="jsError")),s in r){var u=r[s];if((0,c.isBoolean)(u))return u;if((0,c.isObject)(u)){var d=u.sampling,p=void 0===d?100:d;return(0,c.performDraw)(p)}}return!0}},{key:"process",value:function(e){this.update();var t=e.getRumEvent();if(!t)return t;if(e.session.getSampled()){var n=t.view;if(!n)return t;var r=t.event_type,o=t.type,i=n.id,a=this.cache[i],s;if((0,c.isBoolean)(a)||(a=this.cache[i]=this.getSampled(t)),"replay"===o||"custom"===o||a&&"view"===r)return t;if(a)return this.getSampled(t)?t:null}}}])}();t.default=d},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){function e(e,n,r,o){var a=n&&n.prototype instanceof t?n:t,c=Object.create(a.prototype);return i(c,"_invoke",function(e,t,n){function r(e,t){for(i=e,a=t,u=0;!f&&c&&!n&&u<l.length;u++){var n,r=l[u],o=p.p,h=r[2];3<e?(n=h===t)&&(a=r[(i=r[4])?5:(i=3,3)],r[4]=r[5]=s):r[0]<=o&&((n=2>e&&o<r[1])?(i=0,p.v=t,p.n=r[1]):o<h&&(n=3>e||r[0]>t||t>h)&&(r[4]=e,r[5]=t,p.n=h,i=0))}if(n||1<e)return d;throw f=!0,t}var o,i,a,c=0,l=n||[],f=!1,p={p:0,n:0,v:s,a:r,f:r.bind(s,4),d:function e(t,n){return o=t,i=0,a=s,p.n=n,d}};return function(n,l,h){if(1<c)throw TypeError("Generator is already running");for(f&&1===l&&r(l,h),i=l,a=h;(u=2>i?s:a)||!f;){o||(i?3>i?(1<i&&(p.n=-1),r(i,a)):p.n=a:p.v=a);try{if(c=2,o){if(i||(n="next"),u=o[n]){if(!(u=u.call(o,a)))throw TypeError("iterator result is not an object");if(!u.done)return u;a=u.value,2>i&&(i=0)}else 1===i&&(u=o.return)&&u.call(o),2>i&&(a=TypeError("The iterator does not provide a '"+n+"' method"),i=1);o=s}else if((u=(f=0>p.n)?a:e.call(t,p))!==d)break}catch(e){o=s,i=1,a=e}finally{c=1}}return{value:u,done:f}}}(e,r,o),!0),c}function t(){}function n(){}function r(){}function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,r):(e.__proto__=r,i(e,f,"GeneratorFunction")),e.prototype=Object.create(h),e}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var s,u,c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",f=c.toStringTag||"@@toStringTag",d={};u=Object.getPrototypeOf;var p=[][l]?u(u([][l]())):(i(u={},l,(function(){return this})),u),h=r.prototype=t.prototype=Object.create(p);return n.prototype=r,i(h,"constructor",r),i(r,"constructor",n),n.displayName="GeneratorFunction",i(r,f,"GeneratorFunction"),i(h),i(h,f,"Generator"),i(h,l,(function(){return this})),i(h,"toString",(function(){return"[object Generator]"})),(o=function t(){return{w:e,m:a}})()}function i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function e(t,n,r,a){function s(e,n){i(t,e,(function(t){return this._invoke(e,n,t)}))}n?o?o(t,n,{value:r,enumerable:!a,configurable:!a,writable:!a}):t[n]=r:(s("next",0),s("throw",1),s("return",2))})(e,t,n,r)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=l(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function f(e,t,n){return t=m(t),d(e,h()?Reflect.construct(t,n||[],m(e).constructor):t.apply(e,n))}function d(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 h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function t(){return!!e})()}function m(e){return(m=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&&y(e,t)}function y(e,t){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var g=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});var b=n(0),S=n(1),C=n(7),w=function(e){function t(){var e;return a(this,t),(e=f(this,t,arguments)).name="browser-reporter",e}return v(t,e),u(t,[{key:"init",value:function e(t){var n=this;this.ctx=t,S.document.addEventListener(C.DOM_EVENT.VISIBILITY_CHANGE,(function(){"hidden"===S.document.visibilityState&&n.flushEventQueue()}))}},{key:"requestReplay",value:function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return g(this,void 0,void 0,o().m((function e(){var r,i,a,s,u,c,l,f,d,p,h,m,v,y=this;return o().w((function(e){for(;;)switch(e.p=e.n){case 0:if(r=this.ctx.session,i=r.replayConfig.url,a=t.records_data,i&&a){e.n=1;break}return e.a(2);case 1:return e.p=1,s=t.sessionId,u=t.serviceId,c=t.workspace,l=t.timestamp,f=t.records_encoding,d="json"===f?f:"data",p="".concat(i,"/").concat(c,"/").concat(u,"/").concat(s,"/").concat(l,".").concat(d),h={"Content-Type":"application/".concat(f),"x-log-apiversion":"0.6.0","x-log-compresstype":f,"x-log-date":new Date(l).toUTCString()},e.n=2,fetch(p,{method:"PUT",headers:h,body:a});case 2:if((m=e.v).ok){e.n=3;break}throw new Error("request error");case 3:e.n=6;break;case 4:if(e.p=4,v=e.v,!(2<n)){e.n=5;break}return e.a(2);case 5:setTimeout((function(){y.requestReplay(t,n+1)}),3e3);case 6:return e.a(2)}}),e,this,[[1,4]])})))}},{key:"request",value:function e(t,n){var r;return g(this,void 0,void 0,o().m((function e(){var i,a,s,u,c=this;return o().w((function(e){for(;;)switch(e.n){case 0:return i=t.getConfig(),a=navigator||{},n.app.type=b.AppType.browser,n.net.model=(null===(r=a.connection)||void 0===r?void 0:r.effectiveType)||"",n._v=S.VERSION,n.events.forEach((function(e){e.records_data&&(c.requestReplay(Object.assign(Object.assign({},e),{sessionId:n.session.id,serviceId:n.service_id,workspace:n.workspace,appId:n.app.id})),delete e.records_data)})),s=JSON.stringify(n),u=65e3>new Blob([s]).size,e.a(2,fetch(i.endpoint,{method:"POST",headers:{"Content-Type":"text/plain"},body:s,keepalive:u}))}}),e)})))}}])}(b.Reporter);t.default=w}])})); |