Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@apmplus/web

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apmplus/web - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0-alpha.0

cn/bridge.ios.2.3.0-alpha.0.cn.js

2

cn/browser.cn.js

@@ -1,1 +0,1 @@

!function(){"use strict";var u,O=function(){return(O=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)};function k(n,t){var e="function"==typeof Symbol&&n[Symbol.iterator];if(!e)return n;var r,o,i=e.call(n),u=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function b(n,t,e){if(e||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return n.concat(r||Array.prototype.slice.call(t))}"undefined"==typeof Element||Element.prototype.addEventListener||(u=[],co=function(n,t){for(var e=0;e<u.length;){var r=u[e];if(r.object===this&&r.type===n&&r.listener===t){"DOMContentLoaded"===n?this.detachEvent("onreadystatechange",r.wrapper):this.detachEvent("on"+n,r.wrapper),u.splice(e,1);break}++e}},Element.prototype.addEventListener=vo=function(n,t){function e(n){n.target=n.srcElement,n.currentTarget=i,void 0!==t.handleEvent?t.handleEvent(n):t.call(i,n)}var r,o,i=this;"DOMContentLoaded"===n?(r=function(n){"complete"===document.readyState&&e(n)},document.attachEvent("onreadystatechange",r),u.push({object:this,type:n,listener:t,wrapper:r}),"complete"===document.readyState&&((o=new window.Event).srcElement=window,r(o))):(this.attachEvent("on"+n,e),u.push({object:this,type:n,listener:t,wrapper:e}))},Element.prototype.removeEventListener=co,HTMLDocument&&!HTMLDocument.prototype.addEventListener&&(HTMLDocument.prototype.addEventListener=vo,HTMLDocument.prototype.removeEventListener=co),Window&&!Window.prototype.addEventListener&&(Window.prototype.addEventListener=vo,Window.prototype.removeEventListener=co));function v(n){return JSON.stringify({ev_type:"batch",list:n})}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],E=function(){return{}};function _(n){return n}function x(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(x(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function a(n){return"[object Array]"===t.toString.call(n)}function S(n){return"function"==typeof n}function q(n){return"number"==typeof n}function m(n){return"string"==typeof n}function o(n){return"undefined"!=typeof Event&&function(n,t){try{return n instanceof t}catch(n){return}}(n,Event)}function d(n,t){var e,r,o=O({},n);for(e in t)r=e,Object.prototype.hasOwnProperty.call(t,r)&&void 0!==t[e]&&(x(t[e])&&i(t[e])?o[e]=d(x(n[e])?n[e]:{},t[e]):a(t[e])&&a(n[e])?o[e]=function t(n,e){n=a(n)?n:[];e=a(e)?e:[];return Array.prototype.concat.call(n,e).map(function(n){return n instanceof RegExp?n:x(n)&&i(n)?d({},n):a(n)?t([],n):n})}(n[e],t[e]):o[e]=t[e]);return o}function T(n,t){if(!a(n))return!1;if(0===n.length)return!1;for(var e=0;e<n.length;){if(n[e]===t)return!0;e++}return!1}function L(n,t){if(!a(n))return n;var e=n.indexOf(t);if(0<=e){t=n.slice();return t.splice(e,1),t}return n}function l(n,t,e){for(var r,o=(t=k(t.split(".")))[0],i=t.slice(1);n&&0<i.length;)n=n[o],o=(r=k(i))[0],i=r.slice(1);if(n)return e(n,o)}function p(n){return a(n)&&n.length?function(n){for(var t=[],e=n.length,r=0;r<e;r++){var o=n[r];m(o)?t.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&t.push(o.source)}return new RegExp(t.join("|"),"i")}(n):null}function c(n){try{return m(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function h(i,u,a,c){return void 0===c&&(c=!0),function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];if(!i)return E;var e=i[u],r=a.apply(void 0,b([e],k(n),!1)),o=r;return S(o)&&c&&(o=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return r.apply(this,t)}catch(n){return S(e)&&e.apply(this,t)}}),i[u]=o,function(n){n||(o===i[u]?i[u]=e:r=e)}}}function f(i,u,a){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];if(!i)return E;var e=i[u],r=a.apply(void 0,b([e],k(n),!1)),o=r;return S(o)&&(o=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return r.apply(this,n)}),i[u]=o,function(){o===i[u]?i[u]=e:r=e}}}function R(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];console.warn.apply(console,b(["[SDK]",Date.now(),(""+r++).padStart(8," ")],k(n),!1))}function j(r){return function(n){for(var t=n,e=0;e<r.length&&t;e++)try{t=r[e](t)}catch(n){s(n)}return t}}var e=0,s=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];console.error.apply(console,b(["[SDK]",Date.now(),(""+e++).padStart(8," ")],k(n),!1))},r=0,g=function(n){return Math.random()<Number(n)},y=function(n,t){return n<Number(t)};function C(){var n=function(){for(var n=new Array(16),t=0,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var t=[],e=0;e<256;++e)t[e]=(e+256).toString(16).substr(1);var r=0,o=t;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function I(r,n){var t=[];try{t=n.reduce(function(n,t){try{var e=t(r);"function"==typeof e&&n.push(e)}catch(n){}return n},[])}catch(n){}return function(n){return I(n,t)}}function D(n,t,e){e=M(e);try{n(e.next,e.attach),t&&e.complete(t)}catch(n){}return[e.subscribe,e.unsubscribe]}var M=function(n){function t(n){a=L(a,n),f||s()}var e,r,o,i,u,a=[],c=[],f=!1,s=(r=function(){return a.length},o=function(){f=!0,e&&e[0](),c.forEach(function(n){return n()}),c.length=0,e=void 0},-1===(i=n=void(u=0)===n?3e5:n)?E:function(){if(r())return u&&clearTimeout(u),void(u=0);0===u&&(u=setTimeout(o,i))});return{next:function(n){return I(n,a)},complete:function(n){c.push(n)},attach:function(n,t){e=[n,t]},subscribe:function(n){if(f)throw new Error("Observer is closed");return a.push(n),e&&e[1]&&e[1](n),s(),function(){return t(n)}},unsubscribe:t}};function A(){function e(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function t(n){r[n]&&r[n].forEach(function(n){e(n[1])}),r[n]=void 0}var r={};return{set:function(n,t,e){r[n]?r[n].push([t,e]):r[n]=[[t,e]]},remove:t,removeByEvType:function(t){Object.keys(r).forEach(function(n){r[n]&&r[n].forEach(function(n){n[0]===t&&e(n[1])})})},clear:function(){Object.keys(r).forEach(function(n){t(n)})}}}var N=function(n,t,e,r){return n.destroyAgent.set(t,e,r)};var B=function(n){var e,r,o,t=(e={},r={},o={set:function(n,t){return e[n]=t,r[n]=c(t),o},merge:function(t){return e=O(O({},e),t),Object.keys(t).forEach(function(n){r[n]=c(t[n])}),o},delete:function(n){return delete e[n],delete r[n],o},clear:function(){return e={},r={},o},get:function(n){return r[n]},toString:function(){return O({},r)}});n.provide("context",t),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=t.toString(),n})},H=function(a,c,e){function f(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=n[0];if(e){var r=e.split(".")[0];if(r in f)return i=f,u=e,o=[].slice.call(n,1),l(i,u,function(n,t){if(n&&t in n&&S(n[t]))try{return n[t].apply(n,o)}catch(n){return}});var o,i=s[r]||[],u=null!==(u=null==c?void 0:c(a))&&void 0!==u?u:{};i.push(b([u],k(n),!1)),void(s[r]=i)}}var n,s={};for(n in h(a,"provide",function(e){return function(n,t){f[n]=t,e.call(a,n,t)}})(),a)Object.prototype.hasOwnProperty.call(a,n)&&(f[n]=a[n]);return a.on("provide",function(n){s[n]&&(s[n].forEach(function(n){var t=k(n),n=t[0],t=t.slice(1);null!=e&&e(a,n,t)}),s[n]=null)}),f};function P(n,t){return n.initSubject(t)}function U(n,t,e){var t=k(t,2),r=t[0],t=t[1],o=n.privateSubject||{};return o[r]||(o[r]=D(t,function(){o[r]=void 0},e)),o[r]}var W=function(){return Date.now()};function X(){if("object"==typeof window&&x(window))return window}function z(){if("object"==typeof document&&x(document))return document}function F(){if(X()&&x(window.performance))return window.performance}function G(){if("function"==typeof XMLHttpRequest&&S(XMLHttpRequest))return XMLHttpRequest}function J(){if(X()&&S(window.MutationObserver))return window.MutationObserver}function Y(){if(X()&&S(window.PerformanceObserver))return window.PerformanceObserver}function $(){var n=function(){if(X()&&"navigator"in window)return window.navigator}();if(n)return n.connection||n.mozConnection||n.webkitConnection}function V(n){var t=z();if(!t||!n)return"";t=t.createElement("a");return t.href=n,t.href}function K(n){var t=z();if(!t||!n)return{url:n,protocol:"",domain:"",query:"",path:"",hash:""};t=t.createElement("a");t.href=n;n=t.pathname||"/";return"/"!==n[0]&&(n="/"+n),{url:t.href,protocol:t.protocol.slice(0,-1),domain:t.hostname,query:t.search.substring(1),path:n,hash:t.hash}}function Q(){var n=X()&&X()&&window.location;return null==n?void 0:n.href}function Z(n){return{pid:n.pid,view_id:n.viewId,url:Q()}}function nn(n){var t=n.config();return(t=Z(t)).context=n.context?n.context.toString():{},t}function tn(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=cn(X());e&&(e.errors||(e.errors=[]),e.errors.push(n))}var en=function(t,n){void 0===n&&(n=!1);var e=nn(t);return n&&(e.timestamp=W()),function(n){t.report(O(O({},n),{overrides:e}))}},rn="view_0",on=function(o){return function(e,n){function t(n){var t;n.viewId&&n.viewId!==(null===(t=o.config())||void 0===t?void 0:t.viewId)&&(e(r),r=O(O({},nn(o)),Z(n)))}var r=nn(o);o.on("beforeConfig",t),n(function(){o.off("beforeConfig",t)})}},un="f_view_0",an=function(r){return function(n,t){var e=nn(r);t(E,function(n){e&&n(e)})}},cn=function(n){if(n)return n.__SLARDAR_REGISTRY__||(n.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),n.__SLARDAR_REGISTRY__.Slardar},fn=function(n,t){var e=n&&new n(t);return[function(n,t){e&&n&&e.observe(n,t)},function(){return e&&e.disconnect()}]},sn=function(e){var n=e&&e.timing||void 0;return[n,function(){return e&&e.now?e.now():(Date.now?Date.now():+new Date)-(n&&n.navigationStart||0)},function(n){var t=(e||{}).getEntriesByType;return S(t)&&t.call(e,n)||[]},function(){var n=(e||{}).clearResourceTimings;S(n)&&n.call(e)},function(n){var t=(e||{}).getEntriesByName;return S(t)&&t.call(e,n)||[]}]},ln=function(t){return t.requestIdleCallback||function(n){return t.setTimeout(n,1)}},dn=function(n){var t={url:Q(),timestamp:W()},e=n.config();return null!=e&&e.pid&&(t.pid=e.pid),null!=n&&n.context&&(t.context=n.context.toString()),t},pn=function(e,r){return function(n){function t(n){return n.overrides=r,n}e.on("report",t),n(),e.off("report",t)}};function vn(n){try{for(var t,e=n,r=[],o=0,i=0,u=" > ".length;e&&o++<5&&!("html"===(t=function(n){var t,e,r,o,i=n,u=[];if(!i||!i.tagName)return"";u.push(i.tagName.toLowerCase()),i.id&&u.push("#"+i.id);n=i.className;if(n&&m(n))for(t=n.split(/\s+/),o=0;o<t.length;o++)u.push("."+t[o]);var a=["type","name","title","alt"];for(o=0;o<a.length;o++)e=a[o],(r=i.getAttribute(e))&&u.push("["+e+'="'+r+'"]');return u.join("")}(e))||1<o&&80<=i+r.length*u+t.length);)r.push(t),i+=t.length,e=e.parentNode;return r.reverse().join(" > ")}catch(n){return"<unknown>"}}function hn(o){function i(t,e){var r;return function(n){u=void 0,n&&r!==n&&e({event:r=n,name:t})}}var u;return[i,function(r){return function(n){var t;try{t=n.target}catch(n){return}var e=t&&t.tagName;e&&("INPUT"===e||"TEXTAREA"===e||t.isContentEditable)&&(u||i("input",r)(n),clearTimeout(u),u=window.setTimeout(function(){u=void 0},o))}}]}function mn(t,e){return function(n){if(e)try{t(n)}catch(n){}}}function gn(n){var t,e=X();e&&(t=k(wn(n),1)[0],["unload","beforeunload","pagehide"].forEach(function(n){e.addEventListener(n,t)}))}function yn(n,t){return x(n)?O(O({},t),n):!!n&&t}function bn(){return!!btoa&&!!atob}var wn=function(t){var e=!1;return[function(n){e||(e=!0,t&&t(n))}]};function En(n){try{var t=localStorage.getItem(n),e=t,r=e=t&&"string"==typeof t?JSON.parse((u=t,bn()?decodeURI(atob(u)):u)):e,o=r.expires,i=function(n,t){var e={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]]);return e}(r,["expires"]);return o>=W()?i:void 0}catch(n){return}var u}function _n(n,t,e){var r;if(!(e<=0))try{localStorage.setItem(n,(r=JSON.stringify(O(O({},t),{expires:W()+e})),bn()?btoa(encodeURI(r)):r))}catch(n){}}function xn(n){return!1===n?0:!0!==n&&void 0!==n&&q(n)?n:7776e6}function Sn(r){return function(){for(var n,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n=k(t,2),this._method=n[0],this._url=n[1],r.apply(this,t)}}function Tn(o){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._reqHeaders=this._reqHeaders||{};var e=k(n,2),r=e[0],e=e[1];return this._reqHeaders[r]=e,o&&o.apply(this,n)}}function Ln(i,u){var t,a=(t=new RegExp("\\/monitor_web\\/collect|\\/monitor_browser\\/collect\\/batch","i"),function(n){return t.test(n)});return function(){for(var n,r,o,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._start=W(),this._data=null==t?void 0:t[0],a(this._url)||(n=u([this._method,this._url,this._start,this]),o=n,f(r=this,"onreadystatechange",function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return 4===this.readyState&&o(r),e&&e.apply(this,n)}})()),i.apply(this,t)}}function Rn(r,o){return function(n,t){var e=o([n,t=void 0===t?{}:t]),t=r(n,t);return t.then(function(n){e(n)},function(){e(void 0)}),t}}function jn(n,t,e){return n=k(Nn(n,t),3),t=n[1],n=n[2],t(e),n}function Cn(){var n=window&&(window.crypto||window.msCrypto);if(void 0!==n&&n.getRandomValues){var t=new Uint16Array(8);n.getRandomValues(t);n=function(n){for(var t=n.toString(16);t.length<4;)t="0"+t;return t};return n(t[0])+n(t[1])+n(t[2])+n(t[3])+n(t[4])+n(t[5])+n(t[6])+n(t[7])}return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/[x]/g,function(){return(16*Math.random()|0).toString(16)})}function On(n,t){return!!(n=p(n||[]))&&n.test(t)}function kn(n,t){return!(!n||!t)&&(Zn.test(n)||nt.test(t))}var qn="xhr_0",In=function(r){return function(n,t){var e;r&&((e=[]).push(f(r,"open",Sn)()),e.push(f(r,"setRequestHeader",Tn)()),e.push(f(r,"send",Ln)(n)),t(function(){e.forEach(function(n){return n()})}))}},Dn=["fetch_0",function(n,t){var e,r=X();r&&fetch&&((e=[]).push(f(r,"fetch",Rn)(n)),t(function(){e.forEach(function(n){return n()})}))}],Mn=["resource"],An=["longtask"],Nn=function(t,o,e){var r=t&&new t(function(n,r){n.getEntries?n.getEntries().forEach(function(n,t,e){return o(n,t,e,r)}):e&&e()});return[function(n){if(!t||!r)return e&&e();try{r.observe({entryTypes:n})}catch(n){return e&&e()}},function(n){if(!t||!r)return e&&e();try{r.observe({type:n,buffered:!0})}catch(n){return e&&e()}r.observe({type:n,buffered:!1})},function(){return r&&r.disconnect()}]},Bn=function(n,t,e){n=k(Nn(n,t),3),t=n[0],n=n[2];return t(e),n},Hn=["longtask_0",function(n,t){var e=Y();e&&t(Bn(e,n,An))}],Pn=["resource_0",function(n,t){var e=Y();e&&t(Bn(e,n,Mn))}],Un="pageview",Wn="js_error",Xn="http",zn="resource_error",Fn="resource",Gn="custom",Jn="performance",Yn="performance_timing",$n="performance_longtask",Vn="blank_screen",Kn={sampleRate:1,origins:[]},Qn=function(n,r){var o=yn(n,Kn);if(o&&g(o.sampleRate))return function(n,t){var e=o.origins;e.length&&Boolean(n.match(new RegExp(e.join("|"))))&&(t("x-rum-traceparent","00-"+Cn()+"-"+Cn().substring(16)+"-01"),t("x-rum-tracestate",r))}},Zn=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),nt=new RegExp("(bearer|session)","i"),tt=function(n,t,a){var e=k(t,2),t=e[0],c=e[1],f=a.setTraceHeader,s=a.ignoreUrls,l=a.setContextAtReq;n.push(t[0](function(n){var t=k(n,4);t[0];n=t[1];t[2];var e=t[3];if(On(s,n))return E;f&&f(n,function(n,t){return e.setRequestHeader(n,t)});var r=l(),o=V(n),i=void 0,u=c()[0](function(n){o!==n.name||i||(i=n)});return function(n){var t=function(n,t){var e=n._method,r=n._reqHeaders,o=n._url,i=n._start,u=n._data,a,c={api:"xhr",request:{url:V(o),method:(e||"").toLowerCase(),headers:r&&rt(r),timestamp:i},response:{status:n.status||0,is_custom_error:false,timestamp:W()},duration:W()-i};if(typeof n.getAllResponseHeaders==="function")c.response.headers=et(n.getAllResponseHeaders());var f=c.response.status,s=t.collectBodyOnError,l=t.extraExtractor;try{var d=l===null||l===void 0?void 0:l(n.response,c);d&&(c.extra=d);d&&(c.response.is_custom_error=true);if(s&&f>=400){c.request.body=u?""+u:undefined;c.response.body=n.response?""+n.response:undefined}}catch(n){}return c}(n,a);setTimeout(function(){i&&(t.response.timing=i),r&&r({ev_type:Xn,payload:t}),u()},100)}}))};function et(n){return m(n)&&n?n.split("\r\n").reduce(function(n,t){var e;return m(t)&&(t=(e=k(t.split(": "),2))[0],e=e[1],kn(t,e)||(n[t.toLowerCase()]=e)),n},{}):{}}function rt(e){return Object.keys(e).reduce(function(n,t){return kn(t,e[t])||(n[t.toLowerCase()]=e[t]),n},{})}function ot(n,t,e){t=null===(n=n.config())||void 0===n?void 0:n.plugins[t];return yn(t,e)}var it="ajax",ut={autoWrap:!0,setContextAtReq:function(){return _},ignoreUrls:[],collectBodyOnError:!1};var at="click",ct=["click_0",function(n,t){var e=z();e&&(e.addEventListener(at,n,!0),t(function(){e.removeEventListener(at,n,!0)}))}],ft="keypress",st=["keypress_0",function(n,t){var e=z();e&&(e.addEventListener(ft,n,!0),t(function(){e.removeEventListener(ft,n,!0)}))}],lt=function(n,t,e){var r,o=k(t,2),i=o[0],u=o[1],a=e.maxBreadcrumbs,c=e.onAddBreadcrumb,f=e.onMaxBreadcrumbs,t=e.dom,o=k(hn(100),2),e=o[0],o=o[1],c=k(function(e,r,o){void 0===e&&(e=20),void 0===r&&(r=_),void 0===o&&(o=function(n,t){return n.slice(-t)});var i=[];return[function(){return i},function(n){var t=r(n);t&&(n=O(O({},t),{timestamp:n.timestamp||W()}),i=0<=e&&i.length+1>e?o(b(b([],k(i),!1),[n],!1),e):b(b([],k(i),!1),[n],!1))}]}(a,c,f),2),f=c[0],c=c[1];return t&&(r=c,n.push(i[0](e(at,mn(e=function(n){var t;try{t=n.event.target?vn(n.event.target):vn(n.event)}catch(n){t="<unknown>"}0!==t.length&&r({type:"dom",category:"ui."+n.name,message:t})},"dom")))),n.push(u[0](o(mn(e,"dom"))))),[f,c]},dt="breadcrumb",pt={maxBreadcrumbs:20,dom:!0};var vt=function(n,t,l){var e=k(t,2),t=e[0],r=e[1],o=l.setTraceHeader,d=l.ignoreUrls,p=l.setContextAtReq,v=window.Headers,h=window.Request;h&&v&&n.push(t[0](function(n){var n=k(n,2),i=n[0],u=n[1],t=V(i instanceof h?i.url:i);if(!function(n){if(!m(n))return false;var t=k(n.split(":"),2),e=t[0],r;return!t[1]||e==="http"||e==="https"}(t)||On(d,t))return E;o&&o(t,function(n,t){return function(n,t,e,r,o,i){var u;if(ht(e,o))e.headers.set(n,t);else if(r.headers instanceof i)r.headers.set(n,t);else r.headers=O(O({},r.headers),(u={},u[n]=t,u))}(n,t,i,u,h,v)});var a=p(),c=W(),f=void 0,s=r()[0](function(n){t!==n.name||f||(f=n)});return function(n){var t,e,r=function(n,t,e,r,o,i,u){var a,c,f={api:"fetch",request:{method:mt(n,t,r),timestamp:u,url:V(n instanceof r?n.url:n),headers:gt(o,n.headers,t.headers)},response:{status:e&&e.status||0,is_custom_error:false,timestamp:W()},duration:W()-u},s=i.collectBodyOnError,l=i.extraExtractor;if(e)try{f.response.headers=gt(o,e.headers);try{l&&e.clone().json().then(function(n){var t=l(n,f);if(t){f.extra=t;f.response.is_custom_error=true}}).catch(E)}catch(n){}if(s&&e.status>=400)f.request.body=(a=yt(n,t,r))===null||a===void 0?void 0:a.toString()}catch(n){}else s&&(f.request.body=(c=yt(n,t,r))===null||c===void 0?void 0:c.toString());return f}(i,u,n,h,v,l,c),o=(e=!(t=function(n){f&&(n.response.timing=f),a&&a({ev_type:Xn,payload:n}),s()}),function(n){e||(e=!0,t(n))});setTimeout(function(){o(r)},1e3)}}))},ht=function(n,t){return n instanceof t},mt=function(n,t,e){t=t&&t.method||"get";return(t=ht(n,e)?n.method||t:t).toLowerCase()},gt=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];try{return n.reduce(function(e,n){return new t(n||{}).forEach(function(n,t){return!kn(t,n)&&(e[t]=n)}),e},{})}catch(n){return{}}},yt=function(n,t,e){return ht(n,e)?n.body:null==t?void 0:t.body},bt="fetch",wt={autoWrap:!0,setContextAtReq:function(){return _},ignoreUrls:[],collectBodyOnError:!1};function Et(n){var t,e,r;return!function(n){switch(Object.prototype.toString.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return 1;default:return n instanceof Error}}(n)?(i(n)||o(n)||m(n))&&(t={message:c(n)}):(r=Ot,t=(e=n)&&x(e)?r.reduce(function(n,t){return n[t]=e[t],n},{}):e),t}function _t(n){return Et(n.error)}function xt(n){var t;try{var e=void 0;if("reason"in n?e=n.reason:"detail"in n&&"reason"in n.detail&&(e=n.detail.reason),e){var r=Et(e);return O(O({},r),{name:null!==(t=r&&r.name)&&void 0!==t?t:"UnhandledRejection"})}}catch(n){}}function St(n){return"[object ErrorEvent]"===Object.prototype.toString.call(n)?_t(n):("[object PromiseRejectionEvent]"===Object.prototype.toString.call(n)?xt:Et)(n)}function Tt(o,t,n){function u(n,e){if(!S(n))return n;var r={type:"capture-global",data:O({},e)},t=n._w_||(n._w_=function(){try{return(n.handleEvent&&S(n.handleEvent)?n.handleEvent:n).apply(this,[].map.call(arguments,function(n){return u(n,e)}))}catch(n){var t=Et(n);throw t&&o({error:t,source:r}),n}});return t._hook_=!0,t}void 0===t&&(t=X()),void 0===n&&(n=G());var e=[];return t&&e.push.apply(e,b([],k(qt.filter(function(n){return t[n]}).map(function(o){return h(t,o,function(r){return function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return r&&r.call.apply(r,b([this,u(n,{function:o})],k(t),!1))}},!1)()})),!1)),n&&n.prototype&&e.push(h(n.prototype,"send",function(r){return function(){for(var t=this,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return It.filter(function(n){return t[n]&&!t[n]._hook_}).forEach(function(n){t[n]=u(t[n],{function:n})}),r.apply(this,n)}},!1)()),kt.forEach(function(i){var n=t[i]&&t[i].prototype;n&&n[Dt]&&(e.push(h(n,Dt,function(o){return function(n,t,e){try{var r=t.handleEvent;S(r)&&(t.handleEvent=u(r,{function:"handleEvent",target:i}))}catch(n){}return o&&o.call(this,n,u(t,{function:Dt,target:i}),e)}},!1)()),e.push(h(n,"removeEventListener",function(r){return function(n,t,e){return null!=t&&t._w_&&r.call(this,n,t._w_,e),r.call(this,n,t,e)}},!1)()))}),e}function Lt(n,t){return n&&t&&n===t}function Rt(){var r;return function(n){try{if(e=r,!(!(t=n)||!e)&&!(!Lt(t.message,e.message)||!Lt(t.stack,e.stack)))return void(r=n)}catch(n){tn(n)}var t,e;return r=n}}var jt=["err_0",function(n,t){var e=X();e&&(e.addEventListener("error",n,!0),t(function(){e.removeEventListener("error",n,!0)}))}],Ct=["perr_0",function(n,t){var e=X();e&&(e.addEventListener("unhandledrejection",n,!0),t(function(){e.removeEventListener("unhandledrejection",n,!0)}))}],Ot=["name","message","stack","filename","lineno","colno"],kt=["EventTarget","Window","Node","ApplicationCache","ChannelMergerNode","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","MessagePort","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],qt=["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"],It=["onload","onerror","onprogress","onreadystatechange"],Dt="addEventListener",Mt=function(o,n,t,e){function r(n){var t=n.error,e=n.extra,r=n.react,n=n.source;!(t=f?l(t):t)||!t.message||s&&s.test(t.message)||o({ev_type:Wn,payload:{error:t,breadcrumbs:[],extra:e,react:r,source:n}})}var i=k(t,2),u=i[0],a=i[1],c=e.ignoreErrors,t=e.onerror,i=e.onunhandledrejection,f=e.dedupe,e=e.captureGlobalAsync,s=p(c),l=Rt();return t&&n.push(u[0](function(n){return r({error:_t(n),source:{type:"onerror"}})})),i&&n.push(a[0](function(n){return r({error:xt(n),source:{type:"onunhandledrejection"}})})),e&&n.push.apply(n,b([],k(Tt(r)),!1)),function(n,t,e){return r({error:St(n),extra:t,react:e,source:{type:"manual"}})}},At="jsError",Nt={ignoreErrors:[],onerror:!0,onunhandledrejection:!0,captureGlobalAsync:!1,dedupe:!0};function Bt(e){return function(n,t){e({ev_type:Un,payload:{pid:t,source:n}})}}var Ht=["hash_0",function(n,t){var e,r=X();r&&(r.addEventListener("hashchange",e=function(){return n(location.href)},!0),t(function(){return r.removeEventListener("hashchange",e,!0)}))}],Pt=["history_0",function(n,t){var e,r,o,i=X()&&window.history;i&&(r=function(){return n(location.href)},(e=[]).push(h(i,"pushState",o=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{e.apply(i,n)}finally{r()}}})(),h(i,"replaceState",o)()),window.addEventListener("popstate",r,!0),e.push(function(){return window.removeEventListener("popstate",r,!0)}),t(function(){e.forEach(function(n){return n()})}))}],Ut=function(n){return"manual"===n},Wt=function(n,t,e,r){var o,i,u,a,c,f,s=r.sendInit,l=r.initPid,d=r.routeMode,p=r.extractPid,r=r.onPidUpdate,v=Ut(d)?function(){return""}:(o=d,function(n){var t;return"hash"===o?(null===(t=K(n).hash)||void 0===t?void 0:t.replace(/^#/,""))||"/":K(n).path}),h=p||function(){},r=k(function(r,n,t,o){var i=t,u=n;o&&o(n);return[function(n,t,e){"user_set"!==n&&t!==i?(i=t,u=null!=e?e:i,o&&o(u),r(n,u)):"user_set"===n&&t!==u&&(u=t,o&&o(u),r(n,u))},function(){n&&r("init",n)}]}(Bt(n),l||(i=location.href,null!==(u=h(i))&&void 0!==u?u:v(i)),v(location.href),r),2),m=r[0],r=r[1];return Ut(d)||(a=k((c=function(n,t){return m(n,v(t),h(t))},f="",[function(n,t){t!==f&&c(n,f=t)}]),1)[0],e.length&&e.forEach(function(n){return t.push(n[0](function(n){return a(d,n)}))})),s&&r(),[m.bind(null,"user_set")]},Xt="pageview",zt={sendInit:!0,routeMode:"history"};var Ft=["hidden_0",function(n,t){var e,r,o=X(),i=z();o&&i&&(e=function(){"hidden"===i.visibilityState&&n()},addEventListener("visibilitychange",e,!0),r=ln(o),t(function(){removeEventListener("visibilitychange",e,!0)},function(n){"hidden"===i.visibilityState&&r(function(){n()})}))}],Gt=["load_0",function(n,t){var e,r,o=X(),i=z();o&&i&&(o.addEventListener("load",e=function(){setTimeout(function(){n()},0)},!1),r=ln(o),t(function(){o.removeEventListener("load",e,!1)},function(n){"complete"===i.readyState&&r(function(){n()})}))}],Jt=["unload_0",function(n,t){var e,r,o,i=X();i&&(e=k(wn(n),1)[0],o=function(){e()},(r=["unload","beforeunload","pagehide"]).forEach(function(n){i.addEventListener(n,o)}),t(function(){r.forEach(function(n){i.removeEventListener(n,o)})}))}],Yt=["domLoad_0",function(n,t){var e,r,o=X(),i=z();o&&i&&(o.addEventListener("DOMContentLoaded",e=function(){setTimeout(function(){n()},0)},!1),r=ln(o),t(function(){o.removeEventListener("DOMContentLoaded",e,!1)},function(n){"loading"!==i.readyState&&r(function(){n()})}))}],$t=["xmlhttprequest","fetch","beacon"],Vt=function(e,r,n,t){var o,i,u,a,c=k(n,2),n=c[0],f=c[1],s=F();s&&(c=t.ignoreUrls,o=t.slowSessionThreshold,i=t.ignoreTypes,u=p(c),a=function(n,t){void 0===t&&(t=!1),T(i||$t,n.initiatorType)||u&&u.test(n.name)||(n={ev_type:Fn,payload:n},t&&(n.extra={sample_rate:1}),e(n))},r.push(n[0](function(){var n=k(sn(s),3),t=n[0],n=n[2],e=function(){if(!t)return!1;var n=t.loadEventEnd-t.navigationStart;return o<n}();n("resource").forEach(function(n){return a(n,e)}),r.push(f()[0](function(n){a(n)}))})))},Kt="resource",Qt={ignoreUrls:[],slowSessionThreshold:4e3};function Zt(n){return n="link"===(t=n).tagName.toLowerCase()?"href":"src",S(t.getAttribute)?t.getAttribute(n)||"":t[n]||"";var t}var ne=function(i,n,t,e){var r=k(t,1)[0],o=X();if(o){var u=e.ignoreUrls,t=e.includeUrls,a=e.dedupe,c=p(t),f=p(u),s=k(sn(F()),5)[4],l=void 0,d=function(n){var t,e,r,o=location&&location.href;o&&n.url===o||c&&!c.test(n.url)||f&&f.test(n.url)||n.url&&(a&&n.url===l||(l=n.url,e=s,r=(t=n).url,o=n.tagName,t=n.xpath,r=V(r),e=e(r)[0],e={type:o.toLowerCase(),url:r,xpath:t,timing:e},i({ev_type:zn,payload:e})))};return n.push(r[0](function(n){n=n||o.event;!n||(n=function(n){var t=n.target||n.srcElement;if(t){n=t.tagName;if(n&&m(n))return{url:Zt(t),tagName:n}}}(n))&&d(n)})),d}},te="resourceError",ee={includeUrls:[],ignoreUrls:[],dedupe:!0};function re(t){function e(n){n<o||!r||(u(),i=window.setTimeout(r,n-t()),o=n)}var r,o=-1/0,i=void 0,u=function(){return window.clearTimeout(i)};return[function(n,t){r=n,e(t)},function(){u(),r=void 0},e]}function oe(n,e){var r=["img","script","iframe","link","audio","video","source"],t=(n=k(fn(n,function(n){for(var t=0;t<n.length;t++)("childList"===n[t].type&&function n(t,e){for(var r=0;r<t.length;r++)if(T(e,t[r].nodeName.toLowerCase())||t[r].children&&n(t[r].children,e))return 1}(n[t].addedNodes,r)||"attributes"===n[t].type&&T(r,n[t].target.nodeName.toLowerCase()))&&e(n[t])}),2))[0];return[function(){return t(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]})},n[1]]}function ie(n){var n=(t=n||{}).domContentLoadedEventEnd,t=t.navigationStart;return n?n-(void 0===t?0:t):null}function ue(n,t){var e=n.startTime,r=n.duration;n.start=e,n.end=e+r,t.push(n)}function ae(d,n,p){var v=(n=k(n,5))[0],h=n[1],m=n[2],g=n[3],y=n[4];return function(e,n){var r,o=[],i=[],t=k([r={},function(n,t){return r[n]=t},function(n){return delete r[n]}],3),u=t[0],a=t[1],c=t[2];p.forEach(function(n){n.entryType===An[0]&&ue(n,o)});var f=0;d.push(v[0](function(n){if("get"!==(k(n,1)[0]||"").toLowerCase())return E;var t=f+=1;return a(t,W()),function(){c(t)}})),d.push(h[0](function(n){var t=k(n,2),n=t[0],t=t[1];if(!window.Request||"get"!==mt(n,t,window.Request))return E;var e=f+=1;return a(e,W()),function(){c(e)}}));var s=k(y&&oe(y,function(){return e(n()+5e3)})||[],2),t=s[0],s=s[1];t&&t();function l(){return function(n,t,e){if(2<n.length)return e();for(var r=[],o=0;o<t.length;o++)r.push([t[o].start,0],[t[o].end,1]);for(o=0;o<n.length;o++)r.push([n[o],0]);r.sort(function(n,t){return n[0]-t[0]});for(var i=n.length,o=r.length-1;0<=o;o--){var u=k(r[o],2),a=u[0];switch(u[1]){case 0:i--;break;case 1:if(2<++i)return a}}return 0}(function(n){for(var t=Object.keys(n),e=[],r=0;r<t.length;r++){var o=n[t[r]];"number"==typeof o&&e.push(o)}return e}(u),i,n)}return s&&d.push(s),d.push(m[0](function(n){ue(n,o);var t=n.startTime,n=n.duration;e(t+n+5e3)})),d.push(g[0](function(n){var t=n.fetchStart,n=n.responseEnd;i.push({start:t,end:n}),e(l()+5e3)})),d.push(function(){o.length=0,i.length=0}),[o,l]}}var ce={isSupport:!0,isPolyfill:!1,isBounced:!1,isCustom:!1,type:"perf"},fe=function(n,t){return O({name:n,value:t},ce)},se="performance",le={entries:[],observer:void 0},de=function(t,e,r){var o=!1;return function(n){r.length&&r.forEach(function(n){n()}),r.length=0,o||(o=!0,e&&e(t(n)))}},pe=function(n,t){return{ev_type:Jn,payload:n,overrides:t}},ve=function(t){var e=0,r=fe("spa_load",0);return[function(){e=W()},function(){var n;n=W()-e,r.value=n,t&&t(pe(r)),e=0}]},he="first-contentful-paint",me="first-paint",ge="paint",ye=function(t,n,e,r,o){var i=k(o,2),u=i[0],a=i[1],o=Y(),i=F(),c=fe(n,0),f=de(pe,e,r);if(!i||!o)return c.isSupport=!1,void f(c);function s(n){n=n.startTime,c.value=n,f(c)}i=(0,k(sn(i),5)[4])(t)[0];i?s(i):(r.push(Bn(o,function(n){n.name===t&&s(n)},[ge])),r.push(u[0](function(){c.isSupport=!1,f(c)})),r.push(a[0](function(){c.isBounced=!0,f(c)})))},be=["fp",function(n,t,e){return ye(me,"fp",n,t,e)}],we=["fcp",function(n,t,e){return ye(he,"fcp",n,t,e)}],Ee=function(n,t,e,r){var o=k(e,5),i=o[0],u=o[1],a=o[2],c=o[3],e=o[4],f=fe("tti",0),s=de(pe,n,t),o=F(),n=r||{},r=n.entries,l=void 0===r?[]:r,d=n.observer;if(t.push(function(){d&&d.disconnect(),l.length=0}),!window||!XMLHttpRequest||!o||!PerformanceObserver||PerformanceObserver.supportedEntryTypes&&!T(PerformanceObserver.supportedEntryTypes||[],An[0]))return f.isSupport=!1,void s(f);var r=k(sn(o),5),p=r[0],v=r[1],h=r[4],n=k(re(v),3),o=n[0],r=n[1],m=n[2],c=k(ae(t,[i,u,a,c,J()],l)(m,v),2),g=c[0],y=c[1];t.push(r);function b(n){var t=h(he)[0];if(!(t=function(n,t,e,r,o){if(r-e<5e3)return null;o=0===o.length?n:o[o.length-1].end;return r-o<5e3?null:Math.max(o,t)}((t?t.startTime:ie(p))||0,ie(p)||0,y(),v(),g)))return m(v()+1e3);n(t)}function w(n){f.value=n,s(f)}r=g[g.length-1];o(function(){return b(w)},Math.max(y()+5e3,r?r.end:0)),t.push(e[0](function(){f.isSupport=!1,s(f)}))},_e="tti";function xe(n,e,t,r){if(!n||-1<r.indexOf(n.tagName))return 0;var o=n.children;if((o=[].slice.call(void 0===o?[]:o).reduceRight(function(n,t){return n+xe(t,e+1,0<n,r)},0))<=0&&!t){if(!S(n.getBoundingClientRect))return 0;t=n.getBoundingClientRect()||{},n=t.top,t=t.height;if(n>window.innerHeight||t<=0)return 0}return o+1+.5*e}var Se=["SCRIPT","STYLE","META","HEAD"],Te=function(n,t,e){var r=k(e,2),o=r[0],i=r[1],u=z(),a=J(),c=F(),f=c&&c.timing&&c.timing.navigationStart||void 0,s=fe("fmp",0),l=de(pe,n,t);if(!u||!a||!f)return s.isSupport=!1,void l(s);function d(){return y.push({time:W()-g,score:xe(u&&u.body,1,!1,Se)})}function p(n){void 0===n&&(n=0);var t,e=(e=(t=k(void 0===(e=y)?[]:e))[0],(t=t.slice(1))&&t.reduce(function(n,t){var e=k(n,2),r=e[0],n=e[1],e=t.score-r.score;return[t,t.time>=r.time&&n.rate<e?{time:t.time,rate:e}:n]},[e,{time:null==e?void 0:e.time,rate:0}])[1].time||0);s.value=e?e+n:0,l(s),y.length=0}var v,h,m,g=W(),y=[],e=function(){if(X()&&"requestAnimationFrame"in window)return window.requestAnimationFrame}(),r=function(){if(X()&&"cancelAnimationFrame"in window)return window.cancelAnimationFrame}(),b=k((c=u,n=r,r=!0,h=!S(e=e)||r&&c&&c.hidden?function(n){return n(0),0}:e,m=S(n)?n:E,[function(n){v&&m(v),v=h(n)},h,m]),1)[0],n=k(fn(a,function(){return b(d)}),2),a=n[0],n=n[1],w=g-(f||0);a(u,{subtree:!0,childList:!0}),t.push(n),t.push(i[0](function(){s.isSupport=!1,l(s)})),t.push(o[0](function(){setTimeout(function(){p(w)},200)}))},Le="fmp",Re={renderType:"CSR"};function je(n,t){return~Oe.indexOf(n.tagName)||Ae<t}function Ce(n){return{width:(n=n.getBoundingClientRect()).width,height:n.height,top:n.top}}var Oe=["SCRIPT","STYLE","META","HEAD"],ke=[Wn,Xn,zn],qe=1e4,Ie=8e3,De=2e3,Me=1e4,Ae=4,Ne=[Jn,$n,Yn,Gn],Be=function(n){return~Ne.indexOf(n.ev_type)},He=function(n,t){if(-1===ke.indexOf(t.ev_type))return n;if(t.ev_type===Xn&&t.payload.response.status<400)return n;if(n&&ke.indexOf(n.type)<ke.indexOf(t.ev_type))return n;var e="";switch(t.ev_type){case Wn:e=t.payload.error.message;break;case Xn:e=t.payload.request.url;break;case zn:e=t.payload.url}return{type:t.ev_type,message:e,timestamp:W()}},Pe=function(n){return n?document.querySelector(n):document.body},Ue=function(e,r,n,o){if(void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=1.5),!e||je(e,r)||o<=n)return n;var t=function(){if(!r)return 0;var n=Ce(e),t=n.top,n=n.height;return t>innerHeight||n<=0?0:1/Math.pow(2,r-1)}();return[].reduceRight.call(e.children,function(n,t){return Ue(t,r+1,n,o)},n+t)};var We=function(n){var t=n.cb,e=n.screenshotUrl,r=n.window,o=n.document,i=n.mask,u=n.partialShot,a=n.quality,c=n.rootSelector;if(X()&&"Promise"in window&&Promise&&r&&o){if(r.html2canvas)return f();n=o.createElement("script");n.src=e,null!==(e=o.head)&&void 0!==e&&e.appendChild(n),n.onload=f}function f(){ln(r)(function(){r.html2canvas&&r.html2canvas(u&&c&&o.querySelector(c)||o.body,{scale:360/r.innerWidth,mask:i}).then(function(n){t("data:image"===(n=n.toDataURL("image/jpeg",a)).slice(0,10)?n:function(n,t){void 0===n&&(n=192);void 0===t&&(t=108);var e=document.createElement("canvas");e.width=n,e.height=t;var r=e.getContext("2d");r&&(r.fillStyle="#ffffff",r.fillRect(0,0,n,t));return e.toDataURL("image/jpeg")}())})})}};function Xe(t,r,n,e){function o(n){u&&t({ev_type:Vn,payload:{timestamp:u[0],score:u[1],screenshot:n,error:a,serialized_dom:function e(n,r){if(void 0===r&&(r=0),!n||je(n,r))return"";var o=O(O({},Ce(n)),{id:n.getAttribute("id"),class:n.getAttribute("class")}),t=Object.keys(o).reduce(function(n,t){return n+(q(o[t])||o[t]?" "+t+'="'+o[t]+'"':"")},""),i=n.tagName.toLowerCase();return"<"+i+t+">"+[].reduce.call(n.children,function(n,t){return n+e(t,r+1)},"")+"</"+i+">"}(Pe(g))}})}function i(){c&&clearTimeout(c),c=x.setTimeout(function(){T(function(){x.requestAnimationFrame(function(){var n=Pe(g);n&&((n=Ue(n,0,0,h))<h?(u=[W(),n],C()):u=void 0)})})},1e3)}var u,a,c,f,s,l,d=(y=k(n,4))[0],p=y[1],v=y[2],n=y[3],h=e.threshold,m=e.screenshot,g=e.rootSelector,y=e.autoDetect,b=e.ssUrl,w=e.quality,E=e.mask,_=e.partialShot,x=X(),S=z(),T=ln(x),L=k(sn(performance),2)[1],R=0,j=!1,C=(f=function(){u&&!j&&(j=!0,r.forEach(function(n){return n()}),r.length=0,m?We({cb:o,screenshotUrl:b,window:x,document:S,mask:E,partialShot:_,quality:w,rootSelector:g}):o())},function(){s||(l=W(),s=x.setTimeout(function(){s=0,(l<R?i:f)()},L()>qe?De:Ie))});return r.push(n[0](function(){!j&&a&&o()})),y&&r.push(d[0](function(){var n=k(fn(J(),i),2),t=n[0],e=n[1];r.push(function(){clearTimeout(c),e&&e()}),t(null===(t=z())||void 0===t?void 0:t.body,{subtree:!0,childList:!0}),r.push(p()[0](function(){c&&i()})),r.push(v()[0](function(){c&&i()})),i()})),[function(n){j||Be(n)||(R=W(),a&&R-a.timestamp>Me&&(a=void 0),a=He(a,n))},i]}var ze="blankScreen";var Fe={autoDetect:!0,threshold:1.5,screenshot:!0,ssUrl:"https://apm.volccdn.com/mars-web/apmplus/web/html2canvas.min.js",mask:!1,partialShot:!1,quality:.1};function n(n,t){var o,i,u;i=Fe,u=t,(o=n).on("init",function(){var t,n,e=z(),r=X();e&&r&&((e=ot(o,ze,i)||yn(u,i))&&(r=[],e=k(Xe(o.report.bind(o),r,[P(o,Yt),function(){return P(o,Hn)},function(){return P(o,Pn)},P(o,Jt)],e),2),t=e[0],e=e[1],o.on("report",n=function(n){return t(n),n}),r.push(function(){o.off("report",n)}),N(o,ze,Vn,r),o.provide("detectBlankScreen",e)))})}var Ge=["keydown","click"],Je=["lcp",function(n,t,e){var r=k(e,2),o=r[0],e=r[1],r=Y(),i=fe("lcp",0),u=de(pe,n,t);if(!r)return i.isSupport=!1,void u(i);t.push(jn(r,function(n){n=n.startTime;i.value=n},"largest-contentful-paint"));function a(){u(i)}Ge.forEach(function(n){window.addEventListener(n,a,!0),t.push(function(){window.removeEventListener(n,a,!0)})}),t.push(o[0](function(){i.isSupport=!1,u(i)})),t.push(e[0](function(){i.isBounced=!0,u(i)}))}],Ye="first-input",$e=["fid",function(n,t){var e=Y(),r=F(),o=fe("fid",0),i=de(pe,n,t);if(!r||!e)return o.isSupport=!1,void i(o);n=function(n){var t=n.processingStart,n=n.startTime;o.value=t-n,i(o)},r=(0,k(sn(r),3)[2])(Ye)[0];r?n(r):t.push(Bn(e,n,[Ye]))}],Ve=["cls",function(n,t,e){var r,o=k(e,3),i=o[0],u=o[1],e=o[2],o=Y(),a=fe("cls",0),c=(r=n,function(n,t){r(pe(n,t))});if(!o)return a.isSupport=!1,void c(a);var f,s,n=k((f=0,s=[],[function(){f=0},function(n,t){var e,r;t.hadRecentInput||(e=s[0],r=s[s.length-1],f&&t.startTime-r<1e3&&t.startTime-e<5e3?(f+=t.value,s.push(t.startTime)):(f=t.value,s=[t.startTime]),n(f))}]),2),l=n[0],n=n[1].bind(null,function(n){n>a.value&&(a.value=n)});t.push(jn(o,n,"layout-shift")),t.push(i[0](l)),t.push(e[0](function(n){c(a,n),l(),a=fe("cls",0)})),t.push(u[0](function(){c(a)}))}],Ke="longtask",Qe=[Ke,function(t,n,e){e=k(e,3)[2];n.push(e[0](function(n){t({ev_type:$n,payload:{type:"perf",longtasks:[n]}})}))}],Ze="timing",nr=[Ze,function(n,t,e){var r=k(e,2),e=r[0],r=r[1],o=F(),i=k(sn(o),3)[2],u=de(function(n){var t=o&&o.timing||void 0,e=i("navigation")[0];return{ev_type:Yn,payload:{isBounced:n,timing:t,navigation_timing:e}}},n,t);t.push(e[0](function(){u(!1)})),t.push(r[0](function(){u(!0)}))}],tr=["mpfid",function(n,t,e){var r=k(e,3),o=r[0],e=r[2],r=Y(),i=F(),u=fe("mpfid",0),a=[],c=de(pe,n,t);if(!r)return u.isSupport=!1,void c(u);t.push(e[0](function(n){a.push(n)}));function f(){var n=(0,k(sn(i),5)[4])(he)[0],r=n&&n.startTime||0;u.value=a.reduce(function(n,t){var e=t.duration,t=t.startTime;return n<e&&r<t?e:n},0),a.length=0,c(u)}t.push(o[0](function(){setTimeout(f,200)}))}];var er=function(n){if(n&&x(n)&&n.name&&m(n.name)){var t={name:n.name,type:"event"};if("metrics"in n&&x(n.metrics)){var e=n.metrics,r={};for(o in e)q(e[o])&&(r[o]=e[o]);t.metrics=r}if("categories"in n&&x(n.categories)){var o,i=n.categories,u={};for(o in i)u[o]=c(i[o]);t.categories=u}return t}},rr=function(n){if(n&&x(n)&&n.content&&m(n.content)){var t={content:c(n.content),type:"log",level:"info"};if("level"in n&&(t.level=n.level),"extra"in n&&x(n.extra)){var e,r=n.extra,o={},i={};for(e in r)q(r[e])?o[e]=r[e]:i[e]=c(r[e]);t.metrics=o,t.categories=i}return t}};function or(n){return(null==n?void 0:n.effectiveType)||(null==n?void 0:n.type)||""}function ir(n,t){var e=n.common||{};return e.sample_rate=t,n.common=e,n}function ur(n,t,e,r,o){return n?(i=o(r,t),function(){return i}):function(){return e(t)};var i}function ar(n,t,e,r){if(void 0===(n=l(n,t,function(n,t){return n[t]})))return!1;var o,t="boolean"==typeof n?"bool":q(n)?"number":"string";return function(n,t,e){switch(e){case"eq":return T(t,n);case"neq":return!T(t,n);case"gt":return n>t[0];case"gte":return n>=t[0];case"lt":return n<t[0];case"lte":return n<=t[0];case"regex":return Boolean(n.match(new RegExp(t.join("|"))));case"not_regex":return!n.match(new RegExp(t.join("|")));default:return!1}}(n,(o=t,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),e)}function cr(t,n){try{return"rule"===n.type?ar(t,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return cr(t,n)}):n.children.some(function(n){return cr(t,n)})}catch(n){return tn(n),!1}}function fr(){var e=X();return e&&e.navigator.sendBeacon?{get:function(){},post:function(n,t){e.navigator.sendBeacon(n,t)}}:{get:E,post:E}}function sr(n,t,e){var r=t.url,o=t.data,i=t.success,u=void 0===i?E:i,a=void 0===(i=t.fail)?E:i,c=void 0===(i=t.getResponseText)?E:i,t=void 0!==(t=t.withCredentials)&&t;(e=new e).withCredentials=t,e.open(n,r,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){null!=c&&c(this.responseText);try{var n;this.responseText?(n=JSON.parse(this.responseText),u(n)):u({})}catch(n){a(n)}},e.onerror=function(){a(new Error("Network request failed"))},e.onabort=function(){a(new Error("Network request aborted"))},e.send(o)}var lr=function(n){var t=$(),e=or(t);t&&(t.onchange=function(){e=or(t)}),n.on("report",function(n){return O(O({},n),{extra:O(O({},n.extra||{}),{network_type:e})})})},dr=function(n,t,e,r,o){if(!t)return _;var i=t.sample_rate,u=t.include_users,a=t.sample_granularity,c=t.rules,t=t.r,t=void 0===t?Math.random():t;if(T(u,n))return function(n){return ir(n,1)};var f,s,l,d,p,v,h,m="session"===a,g=ur(m,i,e,t,r),y=(f=c,s=m,l=i,d=e,p=t,v=r,h={},Object.keys(f).forEach(function(n){var t=f[n],e=t.enable,r=t.sample_rate,t=t.conditional_sample_rules;e?(h[n]={enable:e,sample_rate:r,effectiveSampleRate:r*l,hit:ur(s,r,d,p,v)},t&&(h[n].conditional_hit_rules=t.map(function(n){var t=n.sample_rate,n=n.filter;return{sample_rate:t,hit:ur(s,t,d,p,v),effectiveSampleRate:t*l,filter:n}}))):h[n]={enable:e,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(n){if(!g())return m&&o[0](),!1;if(!(n.ev_type in y))return ir(n,i);if(!y[n.ev_type].enable)return m&&o[1](n.ev_type),!1;if(null!==(t=n.common)&&void 0!==t&&t.sample_rate)return n;var t=y[n.ev_type],e=t.conditional_hit_rules;if(e)for(var r=0;r<e.length;r++)if(cr(n,e[r].filter))return!!e[r].hit()&&ir(n,e[r].effectiveSampleRate);return t.hit()?ir(n,t.effectiveSampleRate):(m&&o[1](n.ev_type),!1)}};function pr(n){var t,e,r,o,i,u,a,c,f,s=(r=(t=n).transport,o=n.endpoint,i=n.size,u=void 0===i?10:i,a=void 0===(t=n.wait)?1e3:t,c=[],f=0,{getSize:function(){return u},getWait:function(){return a},setSize:function(n){u=n},setWait:function(n){a=n},getEndpoint:function(){return o},setEndpoint:function(n){o=n},send:function(n){c.push(n),c.length>=u&&l.call(this),clearTimeout(f),f=setTimeout(l.bind(this),a)},flush:function(){clearTimeout(f),l.call(this)},getBatchData:function(){return c.length?v(c):""},clear:function(){clearTimeout(f),c=[]},fail:function(n){e=n}});function l(){var t;c.length&&(t=this.getBatchData(),r.post({url:o,data:t,fail:function(n){e&&e(n,t)}}),c=[])}function d(n){p.post(s.getEndpoint(),v([n]))}var p=fr();return gn(function(){var n=s.getBatchData();n&&(p.post(s.getEndpoint(),n),s.clear()),s.send=d}),s}var vr={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:O(O({},n.extra||{}),n.overrides||{})}}};function hr(n){var t,e=n.plugins||{};for(t in e)e[t]&&!x(e[t])&&(e[t]={});return O(O({},n),{plugins:e})}function mr(n){return x(n)&&"aid"in n}function gr(n){return O({},n)}function yr(){var n=X(),t=z();if(n&&t)return(null===(t=null===(t=null===(t=function(){if(!document)return null;if(document.currentScript)return document.currentScript;try{throw new Error}catch(n){var t=0,e=/at\s+(.*)\s+\((.*):(\d*):(\d*)\)/i.exec(n.stack),r=e&&e[2]||!1,o=e&&e[3]||0,i=document.location.href.replace(document.location.hash,""),u="",a=document.getElementsByTagName("script");for(r===i&&(e=document.documentElement.outerHTML,o=new RegExp("(?:[^\\n]+?\\n){0,"+(o-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),u=e.replace(o,"$1").trim());t<a.length;t++){if("interactive"===a[t].readyState)return a[t];if(a[t].src===r)return a[t];if(r===i&&a[t].innerHTML&&a[t].innerHTML.trim()===u)return a[t]}return null}}())||void 0===t?void 0:t.getAttribute("src"))||void 0===t?void 0:t.match(/globalName=(.+)$/))||void 0===t?void 0:t[1])||Er}function br(n){return"APMPLUS"+n}function wr(n,t){void 0===n&&(n=0);var e={userId:C(),deviceId:C(),r:Math.random()};return t<=0?e:(function(n,t){var e=localStorage.getItem(n);if(e&&bn()&&"{"===e[0])try{_n(n,JSON.parse(e),t)}catch(n){}}(n=br(n),t),En(n)||e)}var Er="APM_PLUS_WEB",_r="/settings/get/webpro",xr="/monitor_web/collect",Sr=[xr,_r,"/monitor_browser/collect"],Tr={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},Lr=20,Rr=function(n,t){return void 0===t&&(t=xr),(n&&0<=n.indexOf("//")?"":"https://")+n+t},jr=C,Cr=function(t){var o,i,u,a=t,c={},f=E,e=E;return{getConfig:function(){return a},setConfig:function(n){var t,e,r;return c=O(O({},c),n||{}),s(),o||(o=n,a.useLocalConfig?(u={},f()):i?l():(t=a.transport,e=a.domain,n=a.aid,r=function(n){i=n,l()},t.get({withCredentials:!0,url:function(n,t){return void 0===t&&(t=_r),(n&&0<=n.indexOf("//")?"":"https://")+n+t}(e)+"?aid="+n,success:function(n){r(n.data||{})},fail:function(){r()}}))),a},onChange:function(n){e=n},onReady:function(n){f=function(){!function(){t.userId!==a.userId&&(t.sample.r=Math.random(),s());!function(n){var t=n.aid,e=n.userId,r=n.deviceId,o=n.sample,n=n.storageExpires,t=br(t);_n(t,{userId:e,deviceId:r,r:o.r},xn(n))}(a)}(),n()},u&&f()}};function s(){var n=O(O(O({},t),u||{}),c);n.plugins=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];for(var e={},r=0;r<n.length;)e=d(e,n[r++]);return e}(t.plugins,(null==u?void 0:u.plugins)||{},c.plugins||{}),n.sample=Or(Or(t.sample,null==u?void 0:u.sample),c.sample),a=n,e()}function l(){u=function(n){if(!n)return{};var t=n.sample,e=n.timestamp,r=n.status;if(!t)return{};var o=t.sample_rate,n=t.sample_granularity;return{sample:{include_users:t.include_users,sample_rate:r&&4===r?0:o,sample_granularity:n,rules:t.rules.reduce(function(n,t){var e=t.name,r=t.enable,o=t.sample_rate,t=t.conditional_sample_rules;return n[e]={enable:r,sample_rate:o,conditional_sample_rules:t},n},{})},serverTimestamp:e}}(i),s(),f()}};function Or(r,o){if(!r||!o)return r||o;var n=O(O({},r),o);return n.include_users=b(b([],k(r.include_users||[]),!1),k(o.include_users||[]),!1),n.rules=b(b([],k(Object.keys(r.rules||{})),!1),k(Object.keys(o.rules||{})),!1).reduce(function(n,t){var e;return t in n||(t in(r.rules||{})&&t in(o.rules||{})?(n[t]=O(O({},r.rules[t]),o.rules[t]),n[t].conditional_sample_rules=b(b([],k(r.rules[t].conditional_sample_rules||[]),!1),k(o.rules[t].conditional_sample_rules||[]),!1)):n[t]=(null===(e=r.rules)||void 0===e?void 0:e[t])||(null===(e=o.rules)||void 0===e?void 0:e[t])),n},{}),n}var kr,qr,Ir,Dr,Mr,Ar,Nr,Br,Hr,Pr,Ur,Wr,Xr,zr,Fr,Gr,Jr,Yr,$r=function(n){n.on("report",function(n){return t=n,n={url:Q(),timestamp:Date.now()},O(O({},t),{extra:O(O({},n),t.extra||{})});var t})},Vr={sri:"reportSri",st:"reportResourceError",err:"captureException",reject:"captureException"},Kr=function(n){return Object.keys(n).reduce(function(n,t){return n[t]=[],n},{})},Qr=function(e){return Object.keys(e).reduce(function(n,t){return n[e[t]]?n[e[t]].push(t):n[e[t]]=[t],n},{})},Zr=function(o,i,u){return function(n,t,e,r){void 0===e&&(e=W()),void 0===r&&(r=location.href);r=O(O({},dn(o)),{url:r,timestamp:e});i[n]&&(o[u[n]]?pn(o,r)(function(){o[u[n]](t)}):null!==(e=i[n])&&void 0!==e&&e.push([t,r]))}},no=function(r,o,n){return function(e){e in n&&n[e].forEach(function(n){var t;null!==(t=o[n])&&void 0!==t&&t.forEach(function(n){var n=k(n,2),t=n[0],n=n[1];pn(r,n)(function(){r[e](t)})}),o[n]=null})}},to=function(n,t){return"err"===t?!1!==l(n,"plugins."+At+".onerror",function(n,t){return n[t]}):"reject"!==t||!1!==l(n,"plugins."+At+".onunhandledrejection",function(n,t){return n[t]})},eo=function(e){var r,o=!1;e.on("init",function(){r=(new Date).getTime(),e.on("config",function(){var n,t=null===(n=e.config())||void 0===n?void 0:n.serverTimestamp;isNaN(t)||Number(t)<=0||o||(o=!0,(n=(new Date).getTime())-r<700&&t&&(n=t-(n+r)/2,!isNaN(n)&&(0<n||n<-6e5)&&e.set({offset:n})))})})},ro=function(r){r.on("beforeBuild",function(n){return t=n,e=r.config(),(n={}).aid=e.aid,n.pid=e.pid,n.view_id=e.viewId,n.user_id=e.userId,O(O({},t),{extra:O(O({},n),t.extra||{})});var t,e})},oo=function(c){c.on("start",function(){var e,n=c.config(),t=n.deviceId,r=n.sessionId,o=n.release,i=n.env,u=n.offset,a=n.aid,n=n.token,a={did:t,sid:r,release:o,env:i,sname:Er,sversion:"2.2.0",soffset:u||0,biz_id:a,x_auth_token:n},n=c.getSender();n.setEndpoint(n.getEndpoint()+(x(e=a)?Object.keys(e).reduce(function(n,t){return n+="&"+t+"="+e[t]},"").replace("&","?"):""))})},io=function(n){var t,e=xn(n.storageExpires),n=wr(n.aid,e);return{aid:0,pid:"",token:"",viewId:"__"+Date.now(),userId:n.userId,deviceId:n.deviceId,sessionId:jr(),storageExpires:e,domain:"apmplus.volces.com",plugins:{ajax:{ignoreUrls:Sr},fetch:{ignoreUrls:Sr},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1},release:"",env:"production",sample:O(O({},Tr),{r:n.r}),transport:(t=G())?{get:function(n){sr("GET",n,t)},post:function(n){sr("POST",n,t)}}:{get:E,post:E}}},uo=(Yr=function(n){var t=void 0===n?{}:n,e=t.createSender,n=t.builder,t=t.createDefaultConfig,r=function(n){var e,r,t=n.builder,o=n.createSender,i=n.createDefaultConfig,u=n.createConfigManager,a=n.userConfigNormalizer,c=n.initConfigNormalizer,f=n.validateInitConfig,s={};w.forEach(function(n){return s[n]=[]});var l=!1,d=!1,p=!1,v=[],h=[],m=A(),g={getBuilder:function(){return t},getSender:function(){return e},getPreStartQueue:function(){return v},init:function(n){if(l)R("already inited");else{if(!(n&&x(n)&&f(n)))throw new Error("invalid InitConfig, init failed");var t=i(n);if(!t)throw new Error("defaultConfig missing");n=c(n);if((r=u(t)).setConfig(n),r.onChange(function(){y("config")}),!(e=o(r.getConfig())))throw new Error("sender missing");y("init",l=!0)}},set:function(n){l&&n&&x(n)&&(y("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(l)return n&&x(n)&&(y("beforeConfig",!1,n),null!=r&&r.setConfig(a(n))),null==r?void 0:r.getConfig()},provide:function(n,t){T(h,n)?R("cannot provide "+n+", reserved"):(g[n]=t,y("provide",!1,n))},start:function(){var t=this;l&&(d||null!=r&&r.onReady(function(){y("start",d=!0),v.forEach(function(n){return t.build(n)}),v=[]}))},report:function(n){n&&(!(n=j(s.beforeReport)(n))||(n=j(s.report)(n))&&(d?this.build(n):v.push(n)))},build:function(n){!d||(n=j(s.beforeBuild)(n))&&(!(n=t.build(n))||(n=j(s.build)(n))&&this.send(n))},send:function(n){!d||(n=j(s.beforeSend)(n))&&(e.send(n),y("send",!1,n))},destroy:function(){m.clear(),y("beforeDestroy",p=!0)},on:function(n,t){"init"===n&&l||"start"===n&&d||"beforeDestroy"===n&&p?t():s[n]&&s[n].push(t)},off:function(n,t){s[n]&&(s[n]=L(s[n],t))},destroyAgent:m},h=Object.keys(g);return g;function y(n,t){void 0===t&&(t=!1);for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];s[n].forEach(function(n){try{n.apply(void 0,b([],k(e),!1))}catch(n){}}),t&&(s[n].length=0)}}({validateInitConfig:mr,initConfigNormalizer:hr,userConfigNormalizer:gr,createSender:void 0===e?function(n){return pr({size:Lr,endpoint:Rr(n.domain),transport:n.transport})}:e,builder:void 0===n?vr:n,createDefaultConfig:void 0===t?io:t,createConfigManager:Cr});B(r);var o,n=cn(X());t=r,n=n&&n.subject,o=n||{},t.provide("initSubject",function(n){var n=k(n,2),t=n[0],n=n[1];return o[t]||(o[t]=D(n,function(){o[t]=void 0})),o[t]}),t.provide("getSubject",function(n){return o[n]}),t.provide("privateSubject",{}),eo(r),ro(r),$r(r),lr(r),oo(r);var i,t=H(r,dn,function(n,t,e){return pn(n,t)(function(){var n=k(e),t=n[0],n=n.slice(1);r[t].apply(r,b([],k(n),!1))})});return(i=t).on("init",function(){var t=[],n=i.config();n&&n.integrations&&n.integrations.forEach(function(n){T(t,n.name)||(t.push(n.name),n.setup(i),n.tearDown&&i.on("beforeDestroy",n.tearDown))})}),t}(kr=void 0===kr?{}:kr),(qr=Yr).on("start",function(){var n=qr.config(),t=n.userId,n=n.sample,n=dr(t,n,g,y,[function(){qr.destroy()},function(n){qr.destroyAgent.removeByEvType(n)}]);qr.on("build",n)}),Ir=Yr,Mr=Kr(Dr=void 0===Dr?Vr:Dr),kr=Qr(Dr),Ar=Zr(Ir,Mr,Dr),null!==(Dr=Ir.p)&&void 0!==Dr&&Dr.a&&"observe"in Ir.p.a&&Ir.p.a.observe(function(n){var t=k(n,5);t[0];var e=t[1],r=t[2],o=t[3],n=t[4],t=Ir.config();to(t,e)&&Ar(e,r,o,n)}),Ir.on("init",function(){var n,o=Ir.config();null!==(n=Ir.p)&&void 0!==n&&n.a.forEach(function(n){var t=k(n,5);t[0];var e=t[1],r=t[2],n=t[3],t=t[4];to(o,e)&&Ar(e,r,n,t)}),Ir.p&&Ir.p.a&&(Ir.p.a.length=0),Ir.provide("precollect",function(n,t,e,r){void 0===e&&(e=W()),void 0===r&&(r=location.href),to(o,n)&&Ar(n,t,e,r)})}),Ir.on("provide",no(Ir,Mr,kr)),(Nr=Yr).provide("sendEvent",function(n){n=er(n);n&&Nr.report({ev_type:Gn,payload:n,extra:{timestamp:W()}})}),Nr.provide("sendLog",function(n){n=rr(n);n&&Nr.report({ev_type:Gn,payload:n,extra:{timestamp:W()}})}),(Br=Yr).on("init",function(){var n,t,e,r=ot(Br,Xt,zt);r&&location&&(n=[],t=r.routeMode,e=k(Wt(Br.report.bind(Br),n,Ut(t)?[]:[Br.initSubject(Ht),Br.initSubject(Pt)],O(O({},r),{initPid:null===(r=Br.config())||void 0===r?void 0:r.pid,onPidUpdate:function(n){Br.set({pid:n,viewId:n+"_"+W(),actionId:void 0})}})),1)[0],U(Br,[un,an(Br)],-1),Br.on("config",function(){e(Br.config().pid)}),N(Br,Xt,Un,n),Br.provide("sendPageview",e))}),(Hr=Yr).on("init",function(){var n,t=ot(Hr,it,ut);t&&(n=[],(t=O(O({},t),{setContextAtReq:function(){return en(Hr,!0)},setTraceHeader:Qn(t.trace,"app_id="+(null===(t=Hr.config())||void 0===t?void 0:t.aid)+",origin=web")})).autoWrap&&tt(n,[P(Hr,[qn,In(XMLHttpRequest&&XMLHttpRequest.prototype)]),function(){return P(Hr,Pn)}],t),N(Hr,it,Xn,n))}),(Pr=Yr).on("init",function(){var n,t=ot(Pr,bt,wt);t&&(n=[],(t=O(O({},t),{setContextAtReq:function(){return en(Pr,!0)},setTraceHeader:Qn(t.trace,"app_id="+(null===(t=Pr.config())||void 0===t?void 0:t.aid)+",origin=web")})).autoWrap&&vt(n,[P(Pr,Dn),function(){return P(Pr,Pn)}],t),N(Pr,bt,Xn,n))}),(Ur=Yr).on("init",function(){var n;ot(Ur,_e,{})&&(n=[],Ee(en(Ur),n,[P(Ur,[qn,In(XMLHttpRequest&&XMLHttpRequest.prototype)]),P(Ur,Dn),P(Ur,Hn),P(Ur,Pn),U(Ur,[rn,on(Ur)])],Ur.pp),N(Ur,_e,Jn,n))}),(Wr=Yr).on("init",function(){var n,t,e=ot(Wr,Le,Re);e&&(n=[],t=P(Wr,Gt),"SSR"===e.renderType?ye(me,Le,en(Wr),n,[P(Wr,Ft),P(Wr,Jt)]):Te(en(Wr),n,[t,U(Wr,[rn,on(Wr)])]),N(Wr,Le,Jn,n))}),(Xr=Yr).on("init",function(){var n,t,e,r,o=ot(Xr,dt,pt);o&&(o=(t=k(lt(n=[],[P(Xr,ct),P(Xr,st)],o),2))[0],e=t[1],Xr.on("report",r=function(n){return n.ev_type===Xn&&e({type:Xn,category:n.payload.api,message:"",data:{method:n.payload.request.method,url:n.payload.request.url,status_code:String(n.payload.response.status)},timestamp:n.payload.request.timestamp}),n}),n.push(function(){Xr.off("report",r)}),N(Xr,dt,Wn,n),Xr.provide("getBreadcrumbs",o),Xr.provide("addBreadcrumb",e))}),(zr=Yr).on("init",function(){window.removeEventListener("error",zr.pcErr,!0),window.removeEventListener("unhandledrejection",zr.pcRej,!0);var n,t=ot(zr,At,Nt);t&&(t=Mt(function(n){zr.getBreadcrumbs&&(n.payload.breadcrumbs=zr.getBreadcrumbs()),zr.report(n)},n=[],[P(zr,jt),P(zr,Ct)],t),N(zr,At,Wn,n),zr.provide("captureException",t))}),(Fr=Yr).on("init",function(){var n=Fr.pp||le;null!==(c=n.observer)&&void 0!==c&&c.disconnect();var t,e,r,o,i,u,a,c,f,s=ot(Fr,se,{});s&&(t=P(Fr,Ft),e=P(Fr,Jt),r=P(Fr,Gt),o=P(Fr,Hn),i=void 0,U(Fr,[un,an(Fr)],-1)[0](function(n){i=n})(),u=function(n){n=n.ev_type===Jn&&n.payload.name===Ve[0]||n.ev_type===$n?n:O(O({},n),{overrides:i});Fr.report(n)},a=U(Fr,[rn,on(Fr)]),[be,we,Je,$e,Ve].forEach(function(n){!1!==s[n[0]]&&(n[1](u,n=[],[t,e,a]),N(Fr,se,Jn,n))}),[Qe,nr,tr].forEach(function(n){var t;!1!==s[n[0]]&&(n[1](u,t=[],[r,e,o]),n=n[0]===Ke?$n:n[0]===Ze?Yn:Jn,N(Fr,se,n,t))}),c=(f=k(ve(Fr.report.bind(Fr)),2))[0],f=f[1],Fr.provide("performanceInit",c),Fr.provide("performanceSend",f),n.entries.length=0,Fr.provide("sendCustomPerfMetric",function(n){n=O(O(O({},ce),n),{isCustom:!0});Fr.report(pe(n))}))}),(Gr=Yr).on("init",function(){var n,t=ot(Gr,te,ee);t&&(n=[],t=ne(Gr.report.bind(Gr),n,[P(Gr,jt)],t),N(Gr,te,zn,n),t&&Gr.provide("reportResourceError",t))}),(Jr=Yr).on("init",function(){var n,t=ot(Jr,Kt,Qt);t&&(n=[],Vt(Jr.report.bind(Jr),n,[P(Jr,Gt),function(){return P(Jr,Pn)}],t),N(Jr,Kt,Fn,n))}),n(Yr),Yr),ao=function(){var n=X(),t=yr();if(n&&t)return n[t]}();ao&&["p","pp","pcErr","pcRej"].forEach(function(n){uo.provide(n,ao[n])});var co,fo,so,lo,po=X(),vo=yr();po&&vo&&(co=(null==(co=po[vo])?void 0:co.q)||[],po[vo]=uo,co.forEach(function(n){var t,e;e=n,n=O(O({},dn(t=uo)),{url:e.pop(),timestamp:e.pop()}),pn(t,n)(function(){t.apply(void 0,b([],k(e),!1))})}),co.length=0,uo.p&&("observe"in uo.p.a&&console.warn("global precollect queue already updated"),uo.p.a=(so=uo.p.a,lo=[],so.observe=function(n){lo.push(n)},so.push=function(){for(var n,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.forEach(function(t){lo.forEach(function(n){return n(t)})}),(n=[].push).call.apply(n,b([so],k(t),!1))},so),(fo=uo.precollect)&&uo.provide("precollect",function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return uo.p.a.push(b(["precollect"],k(n),!1)),fo.apply(void 0,b([],k(n),!1))})))}();
!function(){"use strict";var u,q=function(){return(q=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)};function I(n,t){var e="function"==typeof Symbol&&n[Symbol.iterator];if(!e)return n;var r,o,i=e.call(n),u=[];try{for(;(void 0===t||0<t--)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function b(n,t,e){if(e||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return n.concat(r||Array.prototype.slice.call(t))}"undefined"==typeof Element||Element.prototype.addEventListener||(u=[],uo=function(n,t){for(var e=0;e<u.length;){var r=u[e];if(r.object===this&&r.type===n&&r.listener===t){"DOMContentLoaded"===n?this.detachEvent("onreadystatechange",r.wrapper):this.detachEvent("on"+n,r.wrapper),u.splice(e,1);break}++e}},Element.prototype.addEventListener=io=function(n,t){function e(n){n.target=n.srcElement,n.currentTarget=i,void 0!==t.handleEvent?t.handleEvent(n):t.call(i,n)}var r,o,i=this;"DOMContentLoaded"===n?(r=function(n){"complete"===document.readyState&&e(n)},document.attachEvent("onreadystatechange",r),u.push({object:this,type:n,listener:t,wrapper:r}),"complete"===document.readyState&&((o=new window.Event).srcElement=window,r(o))):(this.attachEvent("on"+n,e),u.push({object:this,type:n,listener:t,wrapper:e}))},Element.prototype.removeEventListener=uo,HTMLDocument&&!HTMLDocument.prototype.addEventListener&&(HTMLDocument.prototype.addEventListener=io,HTMLDocument.prototype.removeEventListener=uo),Window&&!Window.prototype.addEventListener&&(Window.prototype.addEventListener=io,Window.prototype.removeEventListener=uo));function v(n){return JSON.stringify({ev_type:"batch",list:n})}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],A=function(){return{}};function E(n){return n}function _(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(_(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function a(n){return"[object Array]"===t.toString.call(n)}function l(n){return"function"==typeof n}function D(n){return"number"==typeof n}function s(n){return"string"==typeof n}function e(n){return"undefined"!=typeof Event&&function(n,t){try{return n instanceof t}catch(n){return}}(n,Event)}function d(n,t){var e,r,o=q({},n);for(e in t)r=e,Object.prototype.hasOwnProperty.call(t,r)&&void 0!==t[e]&&(_(t[e])&&i(t[e])?o[e]=d(_(n[e])?n[e]:{},t[e]):a(t[e])&&a(n[e])?o[e]=function t(n,e){n=a(n)?n:[];e=a(e)?e:[];return Array.prototype.concat.call(n,e).map(function(n){return n instanceof RegExp?n:_(n)&&i(n)?d({},n):a(n)?t([],n):n})}(n[e],t[e]):o[e]=t[e]);return o}function x(n,t){if(!a(n))return!1;if(0===n.length)return!1;for(var e=0;e<n.length;){if(n[e]===t)return!0;e++}return!1}function S(n,t){if(!a(n))return n;var e=n.indexOf(t);if(0<=e){t=n.slice();return t.splice(e,1),t}return n}function p(n,t,e){for(var r,o=(t=I(t.split(".")))[0],i=t.slice(1);n&&0<i.length;)n=n[o],o=(r=I(i))[0],i=r.slice(1);if(n)return e(n,o)}var r=function(e,n){return e&&_(e)?n.reduce(function(n,t){return n[t]=e[t],n},{}):e};function h(n){return a(n)&&n.length?function(n){for(var t=[],e=n.length,r=0;r<e;r++){var o=n[r];s(o)?t.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&t.push(o.source)}return new RegExp(t.join("|"),"i")}(n):null}function c(n){try{return s(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function m(i,u,a,c){return void 0===c&&(c=!0),function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];if(!i)return A;var e=i[u],r=a.apply(void 0,b([e],I(n),!1)),o=r;return l(o)&&c&&(o=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return r.apply(this,t)}catch(n){return l(e)&&e.apply(this,t)}}),i[u]=o,function(n){n||(o===i[u]?i[u]=e:r=e)}}}function T(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];console.warn.apply(console,b(["[SDK]",Date.now(),(""+y++).padStart(8," ")],I(n),!1))}function L(r){return function(n){for(var t=n,e=0;e<r.length&&t;e++)try{t=r[e](t)}catch(n){g(n)}return t}}var f=function(i,u,a){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];if(!i)return A;var e=i[u],r=a.apply(void 0,b([e],I(n),!1)),o=r;return l(o)&&(o=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return r.apply(this,n)}),i[u]=o,function(){o===i[u]?i[u]=e:r=e}}},o=0,g=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];console.error.apply(console,b(["[SDK]",Date.now(),(""+o++).padStart(8," ")],I(n),!1))},y=0,R=function(n){return Math.random()<Number(n)},j=function(n,t){return n<Number(t)};function C(){var n=function(){for(var n=new Array(16),t=0,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var t=[],e=0;e<256;++e)t[e]=(e+256).toString(16).substr(1);var r=0,o=t;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function O(r,n){var t=[];try{t=n.reduce(function(n,t){try{var e=t(r);"function"==typeof e&&n.push(e)}catch(n){}return n},[])}catch(n){}return function(n){return O(n,t)}}var k=function(n){function t(n){a=S(a,n),f||s()}var e,r,o,i,u,a=[],c=[],f=!1,s=(r=function(){return a.length},o=function(){f=!0,e&&e[0](),c.forEach(function(n){return n()}),c.length=0,e=void 0},-1===(i=n=void(u=0)===n?3e5:n)?A:function(){if(r())return u&&clearTimeout(u),void(u=0);0===u&&(u=setTimeout(o,i))});return{next:function(n){return O(n,a)},complete:function(n){c.push(n)},attach:function(n,t){e=[n,t]},subscribe:function(n){if(f)throw new Error("Observer is closed");return a.push(n),e&&e[1]&&e[1](n),s(),function(){return t(n)}},unsubscribe:t}},M=function(n,t,e){e=k(e);try{n(e.next,e.attach),t&&e.complete(t)}catch(n){}return[e.subscribe,e.unsubscribe]};function N(){function r(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function t(n){i[n]&&i[n].forEach(function(n){r(n[1])}),i[n]=void 0}var o=!1,i={};return{set:function(n,t,e){i[n]?i[n].push([t,e]):i[n]=[[t,e]],o&&r(e)},has:function(n){return!!i[n]},remove:t,removeByEvType:function(t){Object.keys(i).forEach(function(n){i[n]&&i[n].forEach(function(n){n[0]===t&&r(n[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(n){t(n)})}}}var B=function(n,t,e,r){return n.destroyAgent.set(t,e,r)};var H=function(n){var e,r,o,t=(e={},r={},o={set:function(n,t){return e[n]=t,r[n]=c(t),o},merge:function(t){return e=q(q({},e),t),Object.keys(t).forEach(function(n){r[n]=c(t[n])}),o},delete:function(n){return delete e[n],delete r[n],o},clear:function(){return e={},r={},o},get:function(n){return r[n]},toString:function(){return q({},r)}});n.provide("context",t),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=t.toString(),n})},P=function(a,c,e){function f(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=n[0];if(e){var r=e.split(".")[0];if(r in f)return i=f,u=e,o=[].slice.call(n,1),p(i,u,function(n,t){if(n&&t in n&&l(n[t]))try{return n[t].apply(n,o)}catch(n){return}});var o,i=s[r]||[],u=null!==(u=null==c?void 0:c(a))&&void 0!==u?u:{};i.push(b([u],I(n),!1)),void(s[r]=i)}}var n,s={};for(n in m(a,"provide",function(e){return function(n,t){f[n]=t,e.call(a,n,t)}})(),a)Object.prototype.hasOwnProperty.call(a,n)&&(f[n]=a[n]);return a.on("provide",function(n){s[n]&&(s[n].forEach(function(n){var t=I(n),n=t[0],t=t.slice(1);null!=e&&e(a,n,t)}),s[n]=null)}),f};function U(n,t){return n.initSubject(t)}function W(n,t,e){var t=I(t,2),r=t[0],t=t[1],o=n.privateSubject||{};return o[r]||(o[r]=M(t,function(){o[r]=void 0},e)),o[r]}var X=function(){return Date.now()};function z(){if("object"==typeof window&&_(window))return window}function F(){if("object"==typeof document&&_(document))return document}function G(){if(z()&&_(window.performance))return window.performance}function J(){if("function"==typeof XMLHttpRequest&&l(XMLHttpRequest))return XMLHttpRequest}function Y(){if(z()&&l(window.MutationObserver))return window.MutationObserver}function $(){if(z()&&l(window.PerformanceObserver))return window.PerformanceObserver}function V(){var n=function(){if(z()&&"navigator"in window)return window.navigator}();if(n)return n.connection||n.mozConnection||n.webkitConnection}function K(n){var t=F();if(!t||!n)return"";t=t.createElement("a");return t.href=n,t.href}function Q(n){var t=F();if(!t||!n)return{url:n,protocol:"",domain:"",query:"",path:"",hash:""};t=t.createElement("a");t.href=n;n=t.pathname||"/";return"/"!==n[0]&&(n="/"+n),{url:t.href,protocol:t.protocol.slice(0,-1),domain:t.hostname,query:t.search.substring(1),path:n,hash:t.hash}}function Z(){var n=z()&&z()&&window.location;return null==n?void 0:n.href}function nn(t,n){void 0===n&&(n=!1);var e=un(t);return n&&(e.timestamp=X()),function(n){t.report(q(q({},n),{overrides:e}))}}function tn(o){return function(e,n){function t(n){var t;n.viewId&&n.viewId!==(null===(t=o.config())||void 0===t?void 0:t.viewId)&&(e(r),r=q(q({},un(o)),on(n)))}var r=un(o);o.on("beforeConfig",t),n(function(){o.off("beforeConfig",t)})}}function en(r){return function(n,t){var e=un(r);t(A,function(n){e&&n(e)})}}function rn(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=fn(z());e&&(e.errors||(e.errors=[]),e.errors.push(n))}var on=function(n){return{pid:n.pid,view_id:n.viewId,url:Z()}},un=function(n){var t=n.config(),t=on(t);return t.context=n.context?n.context.toString():{},t},an="view_0",cn="f_view_0",fn=function(n){if(n)return n.__SLARDAR_REGISTRY__||(n.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),n.__SLARDAR_REGISTRY__.Slardar},sn=function(n,t){var e=n&&new n(t);return[function(n,t){e&&n&&e.observe(n,t)},function(){return e&&e.disconnect()}]},ln=function(n,t,e,r){var o,i=!l(t)||r&&n&&n.hidden?function(n){return n(0),0}:t,u=l(e)?e:A;return[function(n){o&&u(o),o=i(n)},i,u]},dn=function(e){var n=e&&e.timing||void 0;return[n,function(){return e&&e.now?e.now():(Date.now?Date.now():+new Date)-(n&&n.navigationStart||0)},function(n){var t=(e||{}).getEntriesByType;return l(t)&&t.call(e,n)||[]},function(){var n=(e||{}).clearResourceTimings;l(n)&&n.call(e)},function(n){var t=(e||{}).getEntriesByName;return l(t)&&t.call(e,n)||[]}]},pn=function(n){var t={url:Z(),timestamp:X()},e=n.config();return null!=e&&e.pid&&(t.pid=e.pid),null!=n&&n.context&&(t.context=n.context.toString()),t},vn=function(e,r){return function(n){function t(n){return n.overrides=r,n}e.on("report",t),n(),e.off("report",t)}};function hn(n){try{for(var t,e=n,r=[],o=0,i=0,u=" > ".length;e&&o++<5&&!("html"===(t=function(n){var t,e,r,o,i=n,u=[];if(!i||!i.tagName)return"";u.push(i.tagName.toLowerCase()),i.id&&u.push("#"+i.id);n=i.className;if(n&&s(n))for(t=n.split(/\s+/),o=0;o<t.length;o++)u.push("."+t[o]);var a=["type","name","title","alt"];for(o=0;o<a.length;o++)e=a[o],(r=i.getAttribute(e))&&u.push("["+e+'="'+r+'"]');return u.join("")}(e))||1<o&&80<=i+r.length*u+t.length);)r.push(t),i+=t.length,e=e.parentNode;return r.reverse().join(" > ")}catch(n){return"<unknown>"}}var mn=function(o){function i(t,e){var r;return function(n){u=void 0,n&&r!==n&&e({event:r=n,name:t})}}var u;return[i,function(r){return function(n){var t;try{t=n.target}catch(n){return}var e=t&&t.tagName;e&&("INPUT"===e||"TEXTAREA"===e||t.isContentEditable)&&(u||i("input",r)(n),clearTimeout(u),u=window.setTimeout(function(){u=void 0},o))}}]},gn=function(t,e){return function(n){if(e)try{t(n)}catch(n){}}},yn=function(e){return function(n){var t;try{t=n.event.target?hn(n.event.target):hn(n.event)}catch(n){t="<unknown>"}0!==t.length&&e({type:"dom",category:"ui."+n.name,message:t})}};function bn(n,t){n&&t.push(function(){return clearTimeout(n)})}function wn(n){var t,e=z();e&&(t=I(_n(n),1)[0],["unload","beforeunload","pagehide"].forEach(function(n){e.addEventListener(n,t)}))}function En(){return!!btoa&&!!atob}var _n=function(t){var e=!1;return[function(n){e||(e=!0,t&&t(n))}]},xn=function(n,t){return _(n)?q(q({},t),n):!!n&&t};function Sn(n){try{var t=localStorage.getItem(n),e=t,r=e=t&&"string"==typeof t?JSON.parse((u=t,En()?decodeURI(atob(u)):u)):e,o=r.expires,i=function(n,t){var e={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]]);return e}(r,["expires"]);return o>=X()?i:void 0}catch(n){return}var u}function Tn(n,t,e){var r;if(!(e<=0))try{localStorage.setItem(n,(r=JSON.stringify(q(q({},t),{expires:X()+e})),En()?btoa(encodeURI(r)):r))}catch(n){}}function Ln(n){return!1===n?0:!0!==n&&void 0!==n&&D(n)?n:7776e6}function Rn(r){return function(n,t){var e;r&&((e=[]).push(f(r,"open",qn)()),e.push(f(r,"setRequestHeader",In)()),e.push(f(r,"send",An)(n)),t(function(){e.forEach(function(n){return n()})}))}}function jn(r,o){return function(n,t){var e=o([n,t=void 0===t?{}:t]),t=r(n,t);return t.then(function(n){e(n)},function(){e(void 0)}),t}}function Cn(n,t,e){return n=I(Bn(n,t),3),t=n[1],n=n[2],t(e),n}function On(n,r){var o=xn(n,Zn);if(o&&R(o.sampleRate))return function(n,t){var e=o.origins;e.length&&Boolean(n.match(new RegExp(e.join("|"))))&&(t("x-rum-traceparent","00-"+nt()+"-"+nt().substring(16)+"-"+Qn),t("x-rum-tracestate",r))}}function kn(n,t){return!(!n||!t)&&(tt.test(n)||et.test(t))}var qn=function(r){return function(){for(var n,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n=I(t,2),this._method=n[0],this._url=n[1],r.apply(this,t)}},In=function(o){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this._reqHeaders=this._reqHeaders||{};var e=I(n,2),r=e[0],e=e[1];return this._reqHeaders[r]=e,o&&o.apply(this,n)}},An=function(i,u){var t,a=(t=new RegExp("\\/monitor_web\\/collect|\\/monitor_browser\\/collect\\/batch","i"),function(n){return t.test(n)});return function(){for(var n,r,o,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._start=X(),this._data=null==t?void 0:t[0],a(this._url)||(n=u([this._method,this._url,this._start,this]),o=n,f(r=this,"onreadystatechange",function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return 4===this.readyState&&o(r),e&&e.apply(this,n)}})()),i.apply(this,t)}},Dn=["fetch_0",function(n,t){var e,r=z();r&&fetch&&((e=[]).push(f(r,"fetch",jn)(n)),t(function(){e.forEach(function(n){return n()})}))}],Mn=["resource"],Nn=["longtask"],Bn=function(t,o,e){var r=t&&new t(function(n,r){n.getEntries?n.getEntries().forEach(function(n,t,e){return o(n,t,e,r)}):e&&e()});return[function(n){if(!t||!r)return e&&e();try{r.observe({entryTypes:n})}catch(n){return e&&e()}},function(n){if(!t||!r)return e&&e();try{r.observe({type:n,buffered:!0})}catch(n){return e&&e()}r.observe({type:n,buffered:!1})},function(){return r&&r.disconnect()}]},Hn=function(n,t,e){n=I(Bn(n,t),3),t=n[0],n=n[2];return t(e),n},Pn=["longtask_0",function(n,t){var e=$();e&&t(Hn(e,n,Nn))}],Un=["resource_0",function(n,t){var e=$();e&&t(Hn(e,n,Mn))}],Wn="pageview",Xn="js_error",zn="http",Fn="resource_error",Gn="resource",Jn="custom",Yn="performance",$n="performance_timing",Vn="performance_longtask",Kn="blank_screen",Qn="01",Zn={sampleRate:1,origins:[]},nt=function(){var n=window&&(window.crypto||window.msCrypto);if(void 0!==n&&n.getRandomValues){var t=new Uint16Array(8);n.getRandomValues(t);n=function(n){for(var t=n.toString(16);t.length<4;)t="0"+t;return t};return n(t[0])+n(t[1])+n(t[2])+n(t[3])+n(t[4])+n(t[5])+n(t[6])+n(t[7])}return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/[x]/g,function(){return(16*Math.random()|0).toString(16)})},tt=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),et=new RegExp("(bearer|session)","i"),rt=function(n,t){n=h(n||[]);return!!n&&n.test(t)},ot=function(t){var e=!1;return function(n){e||(e=!0,t(n))}};var it=function(n,t){var e,r=n._method,o=n._reqHeaders,i=n._url,u=n._start,a=n._data,o={api:"xhr",request:{url:K(i),method:(r||"").toLowerCase(),headers:o&&(e=o,Object.keys(e).reduce(function(n,t){return kn(t,e[t])||(n[t.toLowerCase()]=e[t]),n},{})),timestamp:u},response:{status:n.status||0,is_custom_error:!1,timestamp:X()},duration:X()-u};"function"==typeof n.getAllResponseHeaders&&(o.response.headers=s(c=n.getAllResponseHeaders())&&c?c.split("\r\n").reduce(function(n,t){var e;return s(t)&&(t=(e=I(t.split(": "),2))[0],e=e[1],kn(t,e)||(n[t.toLowerCase()]=e)),n},{}):{});var u=o.response.status,c=t.collectBodyOnError,t=t.extraExtractor;try{var f=null==t?void 0:t(n.response,o);f&&(o.extra=f),f&&(o.response.is_custom_error=!0),c&&(f||400<=u)&&(o.request.body=a?""+a:void 0,o.response.body=n.response?""+n.response:void 0)}catch(n){}return o};function ut(n,t,e){t=null===(n=n.config())||void 0===n?void 0:n.plugins[t];return xn(t,e)}var at="ajax",ct={autoWrap:!0,setContextAtReq:function(){return E},ignoreUrls:[],collectBodyOnError:!1};var ft="click",st="dom",lt=[ft+"_0",function(n,t){var e=F();e&&(e.addEventListener(ft,n,!0),t(function(){e.removeEventListener(ft,n,!0)}))}],dt="keypress",pt=["keypress_0",function(n,t){var e=F();e&&(e.addEventListener(dt,n,!0),t(function(){e.removeEventListener(dt,n,!0)}))}],vt=function(e,r,o){void 0===e&&(e=20),void 0===r&&(r=E),void 0===o&&(o=function(n,t){return n.slice(-t)});var i=[];return[function(){return i},function(n){var t=r(n);t&&(n=q(q({},t),{timestamp:n.timestamp||X()}),i=0<=e&&i.length+1>e?o(b(b([],I(i),!1),[n],!1),e):b(b([],I(i),!1),[n],!1))}]},ht="breadcrumb",mt={maxBreadcrumbs:20,dom:!0};function gt(n,t){return n instanceof t}function yt(n,t,e){return t=t&&t.method||"get",(t=gt(n,e)?n.method||t:t).toLowerCase()}function bt(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];try{return n.reduce(function(e,n){return new t(n||{}).forEach(function(n,t){return!kn(t,n)&&(e[t]=n)}),e},{})}catch(n){return{}}}var wt=function(n){if(!s(n))return!1;var t=I(n.split(":"),2),n=t[0];return!t[1]||"http"===n||"https"===n},Et=function(n,t,e,r,o,i){gt(e,o)?e.headers.set(n,t):r.headers instanceof i?r.headers.set(n,t):r.headers=q(q({},r.headers),((r={})[n]=t,r))},_t=function(e,r,n,o,t,i,u){function a(){var n,t;f&&(c.request.body=null===(t=r,t=gt(n=e,o)?n.body:null==t?void 0:t.body)||void 0===t?void 0:t.toString())}var c={api:"fetch",request:{method:yt(e,r,o),timestamp:u,url:K(e instanceof o?e.url:e),headers:bt(t,e.headers,r.headers)},response:{status:n&&n.status||0,is_custom_error:!1,timestamp:X()},duration:X()-u},f=i.collectBodyOnError,s=i.extraExtractor;if(n)try{c.response.headers=bt(t,n.headers);try{s&&n.clone().json().then(function(n){n=s(n,c);n&&(c.extra=n,c.response.is_custom_error=!0,a())}).catch(A)}catch(n){}400<=n.status&&a()}catch(n){}else a();return c},xt="fetch",St={autoWrap:!0,setContextAtReq:function(){return E},ignoreUrls:[],collectBodyOnError:!1};function Tt(n){var t;return!function(n){switch(Object.prototype.toString.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return 1;default:return n instanceof Error}}(n)?(i(n)||e(n)||s(n))&&(t={message:c(n)}):t=r(n,jt),t}function Lt(n,t){return n&&t&&n===t}function Rt(o,n,t,e){function r(n){var t=n.error,e=n.extra,r=n.react,n=n.source;!(t=s?d(t):t)||!t.message||l&&l.test(t.message)||o({ev_type:Xn,payload:{error:t,breadcrumbs:[],extra:e,react:r,source:n}})}var i=(f=I(t,3))[0],u=f[1],a=f[2],c=e.ignoreErrors,t=e.onerror,f=e.onunhandledrejection,s=e.dedupe,e=e.captureGlobalAsync,l=h(c),d=Ht();return t&&n.push(i[0](function(n){return r({error:Ct(n),source:{type:"onerror"}})})),f&&n.push(u[0](function(n){return r({error:Ot(n),source:{type:"onunhandledrejection"}})})),e&&n.push(a()[0](function(n){r(n)})),function(n,t,e){return r({error:kt(n),extra:t,react:e,source:{type:"manual"}})}}var jt=["name","message","stack","filename","lineno","colno"],Ct=function(n){return Tt(n.error)},Ot=function(n){var t;try{var e=void 0;if("reason"in n?e=n.reason:"detail"in n&&"reason"in n.detail&&(e=n.detail.reason),e){var r=Tt(e);return q(q({},r),{name:null!==(t=r&&r.name)&&void 0!==t?t:"UnhandledRejection"})}}catch(n){}},kt=function(n){return"[object ErrorEvent]"===Object.prototype.toString.call(n)?Ct(n):("[object PromiseRejectionEvent]"===Object.prototype.toString.call(n)?Ot:Tt)(n)},qt=["EventTarget","Window","Node","ApplicationCache","ChannelMergerNode","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","MessagePort","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],It=["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"],At=["onload","onerror","onprogress","onreadystatechange"],Dt="addEventListener",Mt=["async_error_0",function(o,n){function u(n,e){if(!l(n))return n;var r={type:"capture-global",data:q({},e)},t=n._w_||(n._w_=function(){try{return(n.handleEvent&&l(n.handleEvent)?n.handleEvent:n).apply(this,[].map.call(arguments,function(n){return u(n,e)}))}catch(n){var t=Tt(n);throw t&&o({source:r,error:t}),n}});return t._hook_=!0,t}var t=z(),e=J(),r=[];t&&r.push.apply(r,b([],I(It.filter(function(n){return t[n]}).map(function(o){return m(t,o,function(r){return function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return r&&r.call.apply(r,b([this,u(n,{function:o})],I(t),!1))}},!1)()})),!1)),e&&e.prototype&&r.push(m(e.prototype,"send",function(r){return function(){for(var t=this,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return At.filter(function(n){return t[n]&&!t[n]._hook_}).forEach(function(n){t[n]=u(t[n],{function:n})}),r.apply(this,n)}},!1)()),qt.forEach(function(i){var n=t&&t[i]&&t[i].prototype;n&&n[Dt]&&(r.push(m(n,Dt,function(o){return function(n,t,e){try{var r=t.handleEvent;l(r)&&(t.handleEvent=u(r,{function:"handleEvent",target:i}))}catch(n){}return o&&o.call(this,n,u(t,{function:Dt,target:i}),e)}},!1)()),r.push(m(n,"removeEventListener",function(r){return function(n,t,e){return null!=t&&t._w_&&r.call(this,n,t._w_,e),r.call(this,n,t,e)}},!1)()))}),n(function(){return r.forEach(function(n){return n()})})}],Nt=["err_0",function(n,t){var e=z();e&&(e.addEventListener("error",n,!0),t(function(){e.removeEventListener("error",n,!0)}))}],Bt=["perr_0",function(n,t){var e=z();e&&(e.addEventListener("unhandledrejection",n,!0),t(function(){e.removeEventListener("unhandledrejection",n,!0)}))}],Ht=function(){var r;return function(n){try{if(e=r,!(!(t=n)||!e)&&!(!Lt(t.message,e.message)||!Lt(t.stack,e.stack)))return void(r=n)}catch(n){rn(n)}var t,e;return r=n}},Pt="jsError",Ut={ignoreErrors:[],onerror:!0,onunhandledrejection:!0,captureGlobalAsync:!1,dedupe:!0};var Wt=["hash_0",function(n,t){var e,r=z();r&&(r.addEventListener("hashchange",e=function(){return n(location.href)},!0),t(function(){return r.removeEventListener("hashchange",e,!0)}))}],Xt=["history_0",function(n,t){var e,r,o,i=z()&&window.history;i&&(r=function(){return n(location.href)},(e=[]).push(m(i,"pushState",o=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{e.apply(i,n)}finally{r()}}})(),m(i,"replaceState",o)()),window.addEventListener("popstate",r,!0),e.push(function(){return window.removeEventListener("popstate",r,!0)}),t(function(){e.forEach(function(n){return n()})}))}],zt=function(e){return function(n){var t;return"hash"===e?(null===(t=Q(n).hash)||void 0===t?void 0:t.replace(/^#/,""))||"/":Q(n).path}},Ft=function(r,n,t,o){var i=t,u=n;o&&o(n);return[function(n,t,e){"user_set"!==n&&t!==i?(i=t,u=null!=e?e:i,o&&o(u),r(n,u)):"user_set"===n&&t!==u&&(u=t,o&&o(u),r(n,u))},function(){n&&r("init",n)}]},Gt=function(e,n){var r=n;return[function(n,t){t!==r&&e(n,r=t)}]},Jt=function(e){return function(n,t){e({ev_type:Wn,payload:{pid:t,source:n}})}},Yt=function(n){return"manual"===n},$t="pageview",Vt={sendInit:!0,routeMode:"history"};var Kt=["hidden_1",function(n,t){var e,r=z(),o=F();r&&o&&(e=function(){"hidden"===o.visibilityState&&n()},addEventListener("visibilitychange",e,!0),t(function(){removeEventListener("visibilitychange",e,!0)},function(n){"hidden"===o.visibilityState&&n()}))}],Qt=["load_1",function(n,t){var e,r,o=z(),i=F();o&&i&&(e=!1,r=function(){setTimeout(function(){n(),e=!0},0)},"complete"===i.readyState?r():o.addEventListener("load",r,!1),t(function(){o.removeEventListener("load",r,!1)},function(n){e&&n()}))}],Zt=["unload_0",function(n,t){var e,r,o,i=z();i&&(e=I(_n(n),1)[0],o=function(){e()},(r=["unload","beforeunload","pagehide"]).forEach(function(n){i.addEventListener(n,o)}),t(function(){r.forEach(function(n){i.removeEventListener(n,o)})}))}],ne=["domLoad_1",function(n,t){var e,r,o=z(),i=F();o&&i&&(e=!1,r=function(){setTimeout(function(){n(),e=!0},0)},"loading"!==i.readyState?r():o.addEventListener("DOMContentLoaded",r,!1),t(function(){o.removeEventListener("DOMContentLoaded",r,!1)},function(n){e&&n()}))}],te="resource",ee=["xmlhttprequest","fetch","beacon"],re="resource",oe={ignoreUrls:[],slowSessionThreshold:4e3};function ie(n){return n="link"===(t=n).tagName.toLowerCase()?"href":"src",l(t.getAttribute)?t.getAttribute(n)||"":t[n]||"";var t}var ue=function(n){var t=n.target||n.srcElement;if(t){n=t.tagName;if(n&&s(n))return{url:ie(t),tagName:n}}},ae=function(n,t){var e=n.url,r=n.tagName,n=n.xpath,e=K(e),t=t(e)[0];return{type:r.toLowerCase(),url:e,xpath:n,timing:t}},ce="resourceError",fe={includeUrls:[],ignoreUrls:[],dedupe:!0};function se(t){var e=0,r=me(n,0);return[function(){e=X()},function(){var n;n=X()-e,r.value=n,t&&t(we(r)),e=0}]}function le(t,n,e,r,o){var i,u=(c=I(o,2))[0],a=c[1],o=$(),c=G(),f=me(n,0),s=be(we,e,r);if(!c||!o)return f.isSupport=!1,void s(f);function l(n){n=n.startTime,f.value=n,s(f)}(c=(0,I(dn(c),5)[4])(t)[0])?l(c):(r.push(Hn(o,function(n){n.name===t&&l(n)},[xe])),r.push(a[0](function(){f.isBounced=!0,s(f)})),i=function(){f.isSupport=!1,s(f)},r.push(function(){return u[1](i)}),u[0](i))}function de(n,e){var r=["img","script","iframe","link","audio","video","source"],t=(n=I(sn(n,function(n){for(var t=0;t<n.length;t++)("childList"===n[t].type&&function n(t,e){for(var r=0;r<t.length;r++)if(x(e,t[r].nodeName.toLowerCase())||t[r].children&&n(t[r].children,e))return 1}(n[t].addedNodes,r)||"attributes"===n[t].type&&x(r,n[t].target.nodeName.toLowerCase()))&&e(n[t])}),2))[0];return[function(){return t(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]})},n[1]]}function pe(n,t){var e=n.startTime,r=n.duration;n.start=e,n.end=e+r,t.push(n)}function ve(n,t,e,r){var o=(s=I(e,5))[0],i=s[1],u=s[2],a=s[3],e=s[4],c=me(Le,0),f=be(we,n,t),s=G(),l=void 0===(r=(n=r||{}).entries)?[]:r,d=n.observer;if(t.push(function(){d&&d.disconnect(),l.length=0}),!window||!XMLHttpRequest||!s||!PerformanceObserver||PerformanceObserver.supportedEntryTypes&&!x(PerformanceObserver.supportedEntryTypes||[],Nn[0]))return c.isSupport=!1,f(c),0;var p=(r=I(dn(s),5))[0],v=r[1],h=r[4],s=(n=I(je(v),3))[0],r=n[1],m=n[2],g=(a=I(ke(t,[o,i,u,a,Y()],l)(m,v),2))[0],y=a[1];function b(n){c.value=n,f(c)}t.push(r),r=g[g.length-1],s(function(){return function(n){var t=h(Ee)[0],t=Oe((t?t.startTime:Ce(p))||0,Ce(p)||0,y(),v(),g);if(!t)return m(v()+1e3);n(t)}(b)},Math.max(y()+Re,r?r.end:0)),t.push(e[0](function(){c.isSupport=!1,f(c)}))}var he={isSupport:!0,isPolyfill:!1,isBounced:!1,isCustom:!1,type:"perf"},me=function(n,t){return q({name:n,value:t},he)},ge="performance",ye={entries:[],observer:void 0},be=function(t,e,r){var o=!1;return function(n){r.length&&r.forEach(function(n){n()}),r.length=0,o||(o=!0,e&&e(t(n)))}},we=function(n,t){return{ev_type:Yn,payload:n,overrides:t}},n="spa_load",Ee="first-contentful-paint",_e="first-paint",xe="paint",Se=["fp",function(n,t,e){return le(_e,"fp",n,t,e)}],Te=["fcp",function(n,t,e){return le(Ee,"fcp",n,t,e)}],Le="tti",Re=5e3,je=function(t){function e(n){n<o||!r||(u(),i=window.setTimeout(r,n-t()),o=n)}var r,o=-1/0,i=void 0,u=function(){return window.clearTimeout(i)};return[function(n,t){r=n,e(t)},function(){u(),r=void 0},e]},Ce=function(n){var t=n||{},n=t.domContentLoadedEventEnd,t=t.navigationStart;return n?n-(void 0===t?0:t):null},Oe=function(n,t,e,r,o){if(r-e<Re)return null;o=0===o.length?n:o[o.length-1].end;return r-o<Re?null:Math.max(o,t)},ke=function(d,n,p){var n=I(n,5),v=n[0],h=n[1],m=n[2],g=n[3],y=n[4];return function(e,n){var r,o=[],i=[],t=I([r={},function(n,t){return r[n]=t},function(n){return delete r[n]}],3),u=t[0],a=t[1],c=t[2];p.forEach(function(n){n.entryType===Nn[0]&&pe(n,o)});var f=0;d.push(v[0](function(n){if("get"!==(I(n,1)[0]||"").toLowerCase())return A;var t=f+=1;return a(t,X()),function(){c(t)}})),d.push(h[0](function(n){var t=I(n,2),n=t[0],t=t[1];if(!window.Request||"get"!==yt(n,t,window.Request))return A;var e=f+=1;return a(e,X()),function(){c(e)}}));var s=I(y&&de(y,function(){return e(n()+Re)})||[],2),t=s[0],s=s[1];t&&t();function l(){return function(n,t,e){if(2<n.length)return e();for(var r=[],o=0;o<t.length;o++)r.push([t[o].start,0],[t[o].end,1]);for(o=0;o<n.length;o++)r.push([n[o],0]);r.sort(function(n,t){return n[0]-t[0]});for(var i=n.length,o=r.length-1;0<=o;o--){var u=I(r[o],2),a=u[0];switch(u[1]){case 0:i--;break;case 1:if(2<++i)return a}}return 0}(function(n){for(var t=Object.keys(n),e=[],r=0;r<t.length;r++){var o=n[t[r]];"number"==typeof o&&e.push(o)}return e}(u),i,n)}return s&&d.push(s),d.push(m[0](function(n){pe(n,o);var t=n.startTime,n=n.duration;e(t+n+Re)})),d.push(g[0](function(n){var t=n.fetchStart,n=n.responseEnd;i.push({start:t,end:n}),e(l()+Re)})),d.push(function(){o.length=0,i.length=0}),[o,l]}};function qe(n,t,e){var r=(a=I(e,2))[0],o=a[1],i=F(),u=Y(),a=(e=G())&&e.timing&&e.timing.navigationStart||void 0,c=me(Ie,0),f=be(we,n,t);if(!i||!u||!a)return c.isSupport=!1,f(c),0;function s(){return d.push({time:X()-l,score:De(i&&i.body,1,!1,Ae)})}var l=X(),d=[],e=function(){if(z()&&"requestAnimationFrame"in window)return window.requestAnimationFrame}(),n=function(){if(z()&&"cancelAnimationFrame"in window)return window.cancelAnimationFrame}(),p=I(ln(i,e,n,!0),1)[0],u=(n=I(sn(u,function(){return p(s)}),2))[0],n=n[1],v=l-(a||0);u(i,{subtree:!0,childList:!0}),t.push(n),t.push(o[0](function(){c.isSupport=!1,f(c)})),t.push(r[0](function(){bn(window.setTimeout(function(){!function(n){void 0===n&&(n=0);var t=Me(d);c.value=t?t+n:0,f(c),d.length=0}(v)},200),t)}))}var Ie="fmp",Ae=["SCRIPT","STYLE","META","HEAD"],De=function(n,e,t,r){if(!n||-1<r.indexOf(n.tagName))return 0;var o=n.children,o=[].slice.call(void 0===o?[]:o).reduceRight(function(n,t){return n+De(t,e+1,0<n,r)},0);if(o<=0&&!t){if(!l(n.getBoundingClientRect))return 0;t=n.getBoundingClientRect()||{},n=t.top,t=t.height;if(n>window.innerHeight||t<=0)return 0}return o+1+.5*e},Me=function(n){var t=I(void 0===n?[]:n),n=t[0],t=t.slice(1);return t&&t.reduce(function(n,t){var e=I(n,2),r=e[0],n=e[1],e=t.score-r.score;return[t,t.time>=r.time&&n.rate<e?{time:t.time,rate:e}:n]},[n,{time:null==n?void 0:n.time,rate:0}])[1].time||0},Ne="fmp",Be={renderType:"CSR"};function He(n,t){return~Xe.indexOf(n.tagName)||Fe<t}function Pe(n){return{width:(n=n.getBoundingClientRect()).width,height:n.height,top:n.top}}function Ue(n){return n?document.querySelector(n):document.body}function We(e,r,n,o){if(void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=1.5),!e||He(e,r)||o<=n)return n;var t=function(){if(!r)return 0;var n=Pe(e),t=n.top,n=n.height;return t>innerHeight||n<=0?0:1/Math.pow(2,r-1)}();return[].reduceRight.call(e.children,function(n,t){return We(t,r+1,n,o)},n+t)}var Xe=["SCRIPT","STYLE","META","HEAD"],ze=[Xn,zn,Fn],Fe=4,Ge=[Yn,Vn,$n,Jn];function Je(n){var e=n.cb,t=n.screenshotUrl,r=n.window,o=n.document,i=n.mask,u=n.partialShot,a=n.quality,c=n.rootSelector;if(z()&&"Promise"in window&&Promise&&r&&o){if(r.html2canvas)return f(),0;n=o.createElement("script");n.src=t,null!==(t=o.head)&&void 0!==t&&t.appendChild(n),n.onload=f}function f(){var t;((t=r).requestIdleCallback||function(n){return t.setTimeout(n,1)})(function(){r.html2canvas&&r.html2canvas(u&&c&&o.querySelector(c)||o.body,{scale:360/r.innerWidth,mask:i}).then(function(n){e("data:image"===(n=n.toDataURL("image/jpeg",a)).slice(0,10)?n:function(n,t){void 0===n&&(n=192);void 0===t&&(t=108);var e=document.createElement("canvas");e.width=n,e.height=t;var r=e.getContext("2d");r&&(r.fillStyle="#ffffff",r.fillRect(0,0,n,t));return e.toDataURL("image/jpeg")}())})})}}var Ye=function(t,r,n,e){function o(n){u&&t({ev_type:Kn,payload:{timestamp:u[0],score:u[1],screenshot:n,error:a,serialized_dom:function e(n,r,t){if(void 0===r&&(r=0),void 0===t&&(t=!0),!n||He(n,r))return"";var o=q(q({},Pe(n)),{id:n.getAttribute("id"),class:n.getAttribute("class")}),i=Object.keys(o).reduce(function(n,t){return n+(D(o[t])||o[t]?" "+t+'="'+o[t]+'"':"")},""),u=n.tagName.toLowerCase(),n=[].reduce.call(n.children,function(n,t){return n+e(t,r+1,!1)},"");return"<"+u+i+(t?' innerHeight="'+innerHeight+'"':"")+">"+n+"</"+u+">"}(Ue(b))}})}function i(){c&&clearTimeout(c),c=S.setTimeout(function(){f=L(function(){var n=Ue(b);n&&((n=We(n,0,0,g))<g?(u=[X(),n],k()):u=void 0)})},1e3)}var u,a,c,f,s,l,d,p=I(n,4),v=p[0],h=p[1],m=p[2],n=p[3],g=e.threshold,y=e.screenshot,b=e.rootSelector,p=e.autoDetect,w=e.ssUrl,E=e.quality,_=e.mask,x=e.partialShot,S=z(),T=F(),L=S.requestAnimationFrame||A,R=S.cancelAnimationFrame||A,j=I(dn(performance),2)[1],C=0,O=!1,k=(l=function(){u&&!O&&(O=!0,r.forEach(function(n){return n()}),r.length=0,y?Je({cb:o,screenshotUrl:w,window:S,document:T,mask:_,partialShot:x,quality:E,rootSelector:b}):o())},function(){s||(d=X(),s=S.setTimeout(function(){s=0,(d<C?i:l)()},1e4<j()?2e3:8e3))});return r.push(n[0](function(){!O&&a&&o()})),p&&r.push(v[0](function(){var n=I(sn(Y(),i),2),t=n[0],e=n[1];r.push(function(){clearTimeout(c),clearTimeout(s),R(f),e&&e()}),t(null===(t=F())||void 0===t?void 0:t.body,{subtree:!0,childList:!0}),r.push(h()[0](function(){c&&i()})),r.push(m()[0](function(){c&&i()})),i()})),[function(n){O||~Ge.indexOf(n.ev_type)||(C=X(),a=function(n,t){if(-1===ze.indexOf(t.ev_type))return n;if(t.ev_type===zn&&t.payload.response.status<400)return n;if(n&&ze.indexOf(n.type)<ze.indexOf(t.ev_type))return n;var e="";switch(t.ev_type){case Xn:e=t.payload.error.message;break;case zn:e=t.payload.request.url;break;case Fn:e=t.payload.url}return{type:t.ev_type,message:e,timestamp:X()}}(a=a&&1e4<C-a.timestamp?void 0:a,n))},i]},$e="blankScreen";var Ve={autoDetect:!0,threshold:1.5,screenshot:!0,ssUrl:"https://apm.volccdn.com/mars-web/apmplus/web/html2canvas.min.js",mask:!1,partialShot:!1,quality:.1};var Ke=["keydown","click"],Qe=["lcp",function(n,t,e){var r=I(e,2),o=r[0],e=r[1],r=$(),i=me("lcp",0),u=be(we,n,t);if(!r)return i.isSupport=!1,void u(i);t.push(Cn(r,function(n){n=n.startTime;i.value=n},"largest-contentful-paint"));function a(){u(i)}Ke.forEach(function(n){window.addEventListener(n,a,!0),t.push(function(){window.removeEventListener(n,a,!0)})}),t.push(e[0](function(){i.isBounced=!0,u(i)}));function c(){i.isSupport=!1,u(i)}t.push(function(){return o[1](c)}),o[0](c)}],Ze="first-input",nr=["fid",function(n,t){var e=$(),r=G(),o=me("fid",0),i=be(we,n,t);if(!r||!e)return o.isSupport=!1,void i(o);n=function(n){var t=n.processingStart,n=n.startTime;o.value=t-n,i(o)},r=(0,I(dn(r),3)[2])(Ze)[0];r?n(r):t.push(Hn(e,n,[Ze]))}],tr=["cls",function(n,t,e){var r,o=I(e,3),i=o[0],u=o[1],e=o[2],o=$(),a=me("cls",0),c=(r=n,function(n,t){r(we(n,t))});if(!o)return a.isSupport=!1,void c(a);var f,s,n=I((f=0,s=[],[function(){f=0},function(n,t){var e,r;t.hadRecentInput||(e=s[0],r=s[s.length-1],f&&t.startTime-r<1e3&&t.startTime-e<5e3?(f+=t.value,s.push(t.startTime)):(f=t.value,s=[t.startTime]),n(f))}]),2),l=n[0],n=n[1].bind(null,function(n){n>a.value&&(a.value=n)});t.push(Cn(o,n,"layout-shift")),t.push(i[0](l)),t.push(e[0](function(n){c(a,n),l(),a=me("cls",0)})),t.push(u[0](function(){c(a)}))}],er="longtask",rr=[er,function(t,n,e){e=I(e,3)[2];n.push(e[0](function(n){t({ev_type:Vn,payload:{type:"perf",longtasks:[n]}})}))}],or=["timing",function(n,t,e){var e=I(e,2),r=e[0],e=e[1],o=G(),i=I(dn(o),3)[2],u=be(function(n){var t=o&&o.timing||void 0,e=i("navigation")[0];return{ev_type:$n,payload:{isBounced:n,timing:t,navigation_timing:e}}},n,t);t.push(e[0](function(){u(!0)}));function a(){u(!1)}t.push(function(){return r[1](a)}),r[0](a)}],ir=["mpfid",function(n,t,e){var r=I(e,3),o=r[0],e=r[2],r=$(),i=G(),u=me("mpfid",0),a=[],c=be(we,n,t);if(!r)return u.isSupport=!1,void c(u);t.push(e[0](function(n){a.push(n)}));function f(){var n=(0,I(dn(i),5)[4])(Ee)[0],r=n&&n.startTime||0;u.value=a.reduce(function(n,t){var e=t.duration,t=t.startTime;return n<e&&r<t?e:n},0),a.length=0,c(u)}t.push(o[0](function(){bn(window.setTimeout(f,200),t)}))}];var ur=function(n){if(n&&_(n)&&n.name&&s(n.name)){var t={name:n.name,type:"event"};if("metrics"in n&&_(n.metrics)){var e=n.metrics,r={};for(o in e)D(e[o])&&(r[o]=e[o]);t.metrics=r}if("categories"in n&&_(n.categories)){var o,i=n.categories,u={};for(o in i)u[o]=c(i[o]);t.categories=u}return t}},ar=function(n){if(n&&_(n)&&n.content&&s(n.content)){var t={content:c(n.content),type:"log",level:"info"};if("level"in n&&(t.level=n.level),"extra"in n&&_(n.extra)){var e,r=n.extra,o={},i={};for(e in r)D(r[e])?o[e]=r[e]:i[e]=c(r[e]);t.metrics=o,t.categories=i}return t}};function cr(n){return(null==n?void 0:n.effectiveType)||(null==n?void 0:n.type)||""}function fr(n,t){var e=n.common||{};return e.sample_rate=t,n.common=e,n}function sr(n,t,e,r,o){return n?(i=o(r,t),function(){return i}):function(){return e(t)};var i}function lr(n,t,e,r){if(void 0===(n=p(n,t,function(n,t){return n[t]})))return!1;var o,t="boolean"==typeof n?"bool":D(n)?"number":"string";return function(n,t,e){switch(e){case"eq":return x(t,n);case"neq":return!x(t,n);case"gt":return n>t[0];case"gte":return n>=t[0];case"lt":return n<t[0];case"lte":return n<=t[0];case"regex":return Boolean(n.match(new RegExp(t.join("|"))));case"not_regex":return!n.match(new RegExp(t.join("|")));default:return!1}}(n,(o=t,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),e)}function dr(t,n){try{return"rule"===n.type?lr(t,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return dr(t,n)}):n.children.some(function(n){return dr(t,n)})}catch(n){return rn(n),!1}}function pr(){var e=z();return e&&e.navigator.sendBeacon?{get:function(){},post:function(n,t){e.navigator.sendBeacon(n,t)}}:{get:A,post:A}}function vr(n,t,e){var r=t.url,o=t.data,i=t.success,u=void 0===i?A:i,a=void 0===(i=t.fail)?A:i,c=void 0===(i=t.getResponseText)?A:i,t=void 0!==(t=t.withCredentials)&&t;(e=new e).withCredentials=t,e.open(n,r,!0),e.setRequestHeader("Content-Type","application/json"),e.onload=function(){null!=c&&c(this.responseText);try{var n;this.responseText?(n=JSON.parse(this.responseText),u(n)):u({})}catch(n){a(n)}},e.onerror=function(){a(new Error("Network request failed"))},e.onabort=function(){a(new Error("Network request aborted"))},e.send(o)}var hr=function(n){var t=V(),e=cr(t);t&&(t.onchange=function(){e=cr(t)}),n.on("report",function(n){return q(q({},n),{extra:q(q({},n.extra||{}),{network_type:e})})})},mr=function(n,t,e,r,o){if(!t)return E;var i=t.sample_rate,u=t.include_users,a=t.sample_granularity,c=t.rules,t=t.r,t=void 0===t?Math.random():t;if(x(u,n))return function(n){return fr(n,1)};var f,s,l,d,p,v,h,m="session"===a,g=sr(m,i,e,t,r),y=(f=c,s=m,l=i,d=e,p=t,v=r,h={},Object.keys(f).forEach(function(n){var t=f[n],e=t.enable,r=t.sample_rate,t=t.conditional_sample_rules;e?(h[n]={enable:e,sample_rate:r,effectiveSampleRate:r*l,hit:sr(s,r,d,p,v)},t&&(h[n].conditional_hit_rules=t.map(function(n){var t=n.sample_rate,n=n.filter;return{sample_rate:t,hit:sr(s,t,d,p,v),effectiveSampleRate:t*l,filter:n}}))):h[n]={enable:e,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(n){if(!g())return m&&o[0](),!1;if(!(n.ev_type in y))return fr(n,i);if(!y[n.ev_type].enable)return m&&o[1](n.ev_type),!1;if(null!==(t=n.common)&&void 0!==t&&t.sample_rate)return n;var t=y[n.ev_type],e=t.conditional_hit_rules;if(e)for(var r=0;r<e.length;r++)if(dr(n,e[r].filter))return!!e[r].hit()&&fr(n,e[r].effectiveSampleRate);return t.hit()?fr(n,t.effectiveSampleRate):(m&&o[1](n.ev_type),!1)}};function gr(n){var t,e,r,o,i,u,a,c,f,s=(r=(t=n).transport,o=n.endpoint,i=n.size,u=void 0===i?10:i,a=void 0===(t=n.wait)?1e3:t,c=[],f=0,{getSize:function(){return u},getWait:function(){return a},setSize:function(n){u=n},setWait:function(n){a=n},getEndpoint:function(){return o},setEndpoint:function(n){o=n},send:function(n){c.push(n),c.length>=u&&l.call(this),clearTimeout(f),f=setTimeout(l.bind(this),a)},flush:function(){clearTimeout(f),l.call(this)},getBatchData:function(){return c.length?v(c):""},clear:function(){clearTimeout(f),c=[]},fail:function(n){e=n}});function l(){var t;c.length&&(t=this.getBatchData(),r.post({url:o,data:t,fail:function(n){e&&e(n,t)}}),c=[])}function d(n){p.post(s.getEndpoint(),v([n]))}var p=pr();return wn(function(){var n=s.getBatchData();n&&(p.post(s.getEndpoint(),n),s.clear()),s.send=d}),s}var yr="2.3.0-alpha.0",br="APM_PLUS_WEB",wr="/settings/get/webpro",Er="/monitor_web/collect",_r=[Er,wr,"/monitor_browser/collect"],xr={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},Sr=20;function Tr(n,t){return n.plugins.filter(function(n){return n.name===t&&n.version===yr})[0]}function Lr(n,t,e){(e=void 0===e?fn(z()):e)&&e.plugins&&(Tr(e,n)||e.plugins.push({name:n,version:yr,apply:t}))}function Rr(r){r.provide("reloadPlugin",function(n,t){var e;r.destroyAgent.has(n)&&r.destroyAgent.remove(n),void 0!==t&&r.set({plugins:q(q({},r.config().plugins),((e={})[n]=t,e))}),r.config().plugins[n]&&function(n,t,e){void 0===e&&(e=fn(z()));if(e){e=Tr(e,t);if(e)try{if(n.destroyAgent.has(t))return;e.apply(n)}catch(n){T("[loader].applyPlugin failed",t,n)}else T("[loader].applyPlugin not found",t)}}(r,n)})}var jr={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:q(q({},n.extra||{}),n.overrides||{})}}};function Cr(n){var t,e=n.plugins||{};for(t in e)e[t]&&!_(e[t])&&(e[t]={});return q(q({},n),{plugins:e})}function Or(n){return _(n)&&"aid"in n}function kr(n){return q({},n)}function qr(){var n=z(),t=F();if(n&&t)return(null===(t=null===(t=null===(t=function(){if(!document)return null;if(document.currentScript)return document.currentScript;try{throw new Error}catch(n){var t=0,e=/at\s+(.*)\s+\((.*):(\d*):(\d*)\)/i.exec(n.stack),r=e&&e[2]||!1,o=e&&e[3]||0,i=document.location.href.replace(document.location.hash,""),u="",a=document.getElementsByTagName("script");for(r===i&&(e=document.documentElement.outerHTML,o=new RegExp("(?:[^\\n]+?\\n){0,"+(o-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),u=e.replace(o,"$1").trim());t<a.length;t++){if("interactive"===a[t].readyState)return a[t];if(a[t].src===r)return a[t];if(r===i&&a[t].innerHTML&&a[t].innerHTML.trim()===u)return a[t]}return null}}())||void 0===t?void 0:t.getAttribute("src"))||void 0===t?void 0:t.match(/globalName=(.+)$/))||void 0===t?void 0:t[1])||br}function Ir(n){return"APMPLUS"+n}function Ar(n,t){void 0===n&&(n=0);var e={userId:C(),deviceId:C(),r:Math.random()};return t<=0?e:(function(n,t){var e=localStorage.getItem(n);if(e&&En()&&"{"===e[0])try{Tn(n,JSON.parse(e),t)}catch(n){}}(n=Ir(n),t),Sn(n)||e)}var Dr=function(n,t){return void 0===t&&(t=Er),(n&&0<=n.indexOf("//")?"":"https://")+n+t},Mr=C,Nr=function(t){var o,i,u,a=t,c={},f=A,e=A;return{getConfig:function(){return a},setConfig:function(n){var t,e,r;return c=q(q({},c),n||{}),s(),o||(o=n,a.useLocalConfig?(u={},f()):i?l():(t=a.transport,e=a.domain,n=a.aid,r=function(n){i=n,l()},t.get({withCredentials:!0,url:function(n,t){return void 0===t&&(t=wr),(n&&0<=n.indexOf("//")?"":"https://")+n+t}(e)+"?aid="+n,success:function(n){r(n.data||{})},fail:function(){r()}}))),a},onChange:function(n){e=n},onReady:function(n){f=function(){!function(){t.userId!==a.userId&&(t.sample.r=Math.random(),s());!function(n){var t=n.aid,e=n.userId,r=n.deviceId,o=n.sample,n=n.storageExpires,t=Ir(t);Tn(t,{userId:e,deviceId:r,r:o.r},Ln(n))}(a)}(),n()},u&&f()}};function s(){var n=q(q(q({},t),u||{}),c);n.plugins=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];for(var e={},r=0;r<n.length;)e=d(e,n[r++]);return e}(t.plugins,(null==u?void 0:u.plugins)||{},c.plugins||{}),n.sample=Br(Br(t.sample,null==u?void 0:u.sample),c.sample),a=n,e()}function l(){u=function(n){if(!n)return{};var t=n.sample,e=n.timestamp,r=n.status;if(!t)return{};var o=t.sample_rate,n=t.sample_granularity;return{sample:{include_users:t.include_users,sample_rate:r&&4===r?0:o,sample_granularity:n,rules:t.rules.reduce(function(n,t){var e=t.name,r=t.enable,o=t.sample_rate,t=t.conditional_sample_rules;return n[e]={enable:r,sample_rate:o,conditional_sample_rules:t},n},{})},serverTimestamp:e}}(i),s(),f()}};function Br(r,o){if(!r||!o)return r||o;var n=q(q({},r),o);return n.include_users=b(b([],I(r.include_users||[]),!1),I(o.include_users||[]),!1),n.rules=b(b([],I(Object.keys(r.rules||{})),!1),I(Object.keys(o.rules||{})),!1).reduce(function(n,t){var e;return t in n||(t in(r.rules||{})&&t in(o.rules||{})?(n[t]=q(q({},r.rules[t]),o.rules[t]),n[t].conditional_sample_rules=b(b([],I(r.rules[t].conditional_sample_rules||[]),!1),I(o.rules[t].conditional_sample_rules||[]),!1)):n[t]=(null===(e=r.rules)||void 0===e?void 0:e[t])||(null===(e=o.rules)||void 0===e?void 0:e[t])),n},{}),n}function Hr(n){var t=(e=void 0===n?{}:n).createSender,n=e.builder,e=e.createDefaultConfig,r=function(n){var e,r,t=n.builder,o=n.createSender,i=n.createDefaultConfig,u=n.createConfigManager,a=n.userConfigNormalizer,c=n.initConfigNormalizer,f=n.validateInitConfig,s={};w.forEach(function(n){return s[n]=[]});var l=!1,d=!1,p=!1,v=[],h=[],m=N(),g={getBuilder:function(){return t},getSender:function(){return e},getPreStartQueue:function(){return v},init:function(n){if(l)T("already inited");else{if(!(n&&_(n)&&f(n)))throw new Error("invalid InitConfig, init failed");var t=i(n);if(!t)throw new Error("defaultConfig missing");n=c(n);if((r=u(t)).setConfig(n),r.onChange(function(){y("config")}),!(e=o(r.getConfig())))throw new Error("sender missing");y("init",l=!0)}},set:function(n){l&&n&&_(n)&&(y("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(l)return n&&_(n)&&(y("beforeConfig",!1,n),null!=r&&r.setConfig(a(n))),null==r?void 0:r.getConfig()},provide:function(n,t){x(h,n)?T("cannot provide "+n+", reserved"):(g[n]=t,y("provide",!1,n))},start:function(){var t=this;l&&(d||null!=r&&r.onReady(function(){y("start",d=!0),v.forEach(function(n){return t.build(n)}),v.length=0}))},report:function(n){n&&(!(n=L(s.beforeReport)(n))||(n=L(s.report)(n))&&(d?this.build(n):v.push(n)))},build:function(n){!d||(n=L(s.beforeBuild)(n))&&(!(n=t.build(n))||(n=L(s.build)(n))&&this.send(n))},send:function(n){!d||(n=L(s.beforeSend)(n))&&(e.send(n),y("send",!1,n))},destroy:function(){m.clear(),p=!0,y("beforeDestroy",!(v.length=0))},on:function(n,t){"init"===n&&l||"start"===n&&d||"beforeDestroy"===n&&p?t():s[n]&&s[n].push(t)},off:function(n,t){s[n]&&(s[n]=S(s[n],t))},destroyAgent:m},h=Object.keys(g);return g;function y(n,t){void 0===t&&(t=!1);for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];s[n].forEach(function(n){try{n.apply(void 0,b([],I(e),!1))}catch(n){}}),t&&(s[n].length=0)}}({validateInitConfig:Or,initConfigNormalizer:Cr,userConfigNormalizer:kr,createSender:void 0===t?function(n){return gr({size:Sr,endpoint:Dr(n.domain),transport:n.transport})}:t,builder:void 0===n?jr:n,createDefaultConfig:void 0===e?Kr:e,createConfigManager:Nr});H(r);var o,n=fn(z());e=r,n=n&&n.subject,o=n||{},e.provide("initSubject",function(n){var n=I(n,2),t=n[0],n=n[1];return o[t]||(o[t]=M(n,function(){o[t]=void 0})),o[t]}),e.provide("getSubject",function(n){return o[n]}),e.provide("privateSubject",{}),Yr(r),$r(r),Ur(r),hr(r),Vr(r);var i,u,e=P(r,pn,function(n,t,e){return vn(n,t)(function(){var n=I(e),t=n[0],n=n.slice(1);r[t].apply(r,b([],I(n),!1))})});return u=Lr,(i=e).on("init",function(){var e=[],n=i.config();n&&n.integrations&&n.integrations.forEach(function(n){var t=n.name;x(e,t)||(e.push(t),n.setup(i),u&&u(t,n.setup),n.tearDown&&i.destroyAgent.set(t,t,[n.tearDown]))})}),e}function Pr(n){var e,i,t,r,u,o,a=Hr(n=void 0===n?{}:n);return(e=a).on("start",function(){var n=e.config(),t=n.userId,n=n.sample,n=mr(t,n,R,j,[function(){e.destroy()},function(n){e.destroyAgent.removeByEvType(n)}]);e.on("build",n)}),i=a,r=Xr(t=void 0===t?Wr:t),n=zr(t),u=Fr(i,r,t),null!==(t=i.p)&&void 0!==t&&t.a&&"observe"in i.p.a&&i.p.a.observe(function(n){var t=I(n,5);t[0];var e=t[1],r=t[2],o=t[3],n=t[4],t=i.config();Jr(t,e)&&u(e,r,o,n)}),i.on("init",function(){var n,o=i.config();null!==(n=i.p)&&void 0!==n&&n.a.forEach(function(n){var t=I(n,5);t[0];var e=t[1],r=t[2],n=t[3],t=t[4];Jr(o,e)&&u(e,r,n,t)}),i.p&&i.p.a&&(i.p.a.length=0),i.provide("precollect",function(n,t,e,r){void 0===e&&(e=X()),void 0===r&&(r=location.href),Jr(o,n)&&u(n,t,e,r)})}),i.on("provide",Gr(i,r,n)),(o=a).provide("sendEvent",function(n){n=ur(n);n&&o.report({ev_type:Jn,payload:n,extra:{timestamp:X()}})}),o.provide("sendLog",function(n){n=ar(n);n&&o.report({ev_type:Jn,payload:n,extra:{timestamp:X()}})}),Object.keys(Qr).forEach(function(n){Lr(n,Qr[n]),Qr[n](a)}),Rr(a),a.provide("create",Pr),a}var Ur=function(n){n.on("report",function(n){return t=n,n={url:Z(),timestamp:Date.now()},q(q({},t),{extra:q(q({},n),t.extra||{})});var t})},Wr={sri:"reportSri",st:"reportResourceError",err:"captureException",reject:"captureException"},Xr=function(n){return Object.keys(n).reduce(function(n,t){return n[t]=[],n},{})},zr=function(e){return Object.keys(e).reduce(function(n,t){return n[e[t]]?n[e[t]].push(t):n[e[t]]=[t],n},{})},Fr=function(o,i,u){return function(n,t,e,r){void 0===e&&(e=X()),void 0===r&&(r=location.href);r=q(q({},pn(o)),{url:r,timestamp:e});i[n]&&(o[u[n]]?vn(o,r)(function(){o[u[n]](t)}):null!==(e=i[n])&&void 0!==e&&e.push([t,r]))}},Gr=function(r,o,n){return function(e){e in n&&n[e].forEach(function(n){var t;null!==(t=o[n])&&void 0!==t&&t.forEach(function(n){var n=I(n,2),t=n[0],n=n[1];vn(r,n)(function(){r[e](t)})}),o[n]=null})}},Jr=function(n,t){return"err"===t?!1!==p(n,"plugins."+Pt+".onerror",function(n,t){return n[t]}):"reject"!==t||!1!==p(n,"plugins."+Pt+".onunhandledrejection",function(n,t){return n[t]})},Yr=function(e){var r,o=!1;e.on("init",function(){r=(new Date).getTime(),e.on("config",function(){var n,t=null===(n=e.config())||void 0===n?void 0:n.serverTimestamp;isNaN(t)||Number(t)<=0||o||(o=!0,(n=(new Date).getTime())-r<700&&t&&(n=t-(n+r)/2,!isNaN(n)&&(0<n||n<-6e5)&&e.set({offset:n})))})})},$r=function(r){r.on("beforeBuild",function(n){return t=n,e=r.config(),(n={}).aid=e.aid,n.pid=e.pid,n.view_id=e.viewId,n.user_id=e.userId,q(q({},t),{extra:q(q({},n),t.extra||{})});var t,e})},Vr=function(c){c.on("start",function(){var e,n=c.config(),t=n.deviceId,r=n.sessionId,o=n.release,i=n.env,u=n.offset,a=n.aid,n=n.token,a={did:t,sid:r,release:o,env:i,sname:br,sversion:yr,soffset:u||0,biz_id:a,x_auth_token:n},n=c.getSender();n.setEndpoint(n.getEndpoint()+(_(e=a)?Object.keys(e).reduce(function(n,t){return n+="&"+t+"="+e[t]},"").replace("&","?"):""))})},Kr=function(n){var t,e=Ln(n.storageExpires),n=Ar(n.aid,e);return{aid:0,pid:"",token:"",viewId:"__"+Date.now(),userId:n.userId,deviceId:n.deviceId,sessionId:Mr(),storageExpires:e,domain:"apmplus.volces.com",plugins:{ajax:{ignoreUrls:_r},fetch:{ignoreUrls:_r},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1},release:"",env:"production",sample:q(q({},xr),{r:n.r}),transport:(t=J())?{get:function(n){vr("GET",n,t)},post:function(n){vr("POST",n,t)}}:{get:A,post:A}}},Qr=((to={})[$t]=function(v){v.on("init",function(){var n,t,e,r,o,i,u,a,c,f,s,l,d,p=ut(v,$t,Vt);p&&location&&(n=[],a=p.routeMode,t=I((i=v.report.bind(v),e=n,r=Yt(a)?[]:[v.initSubject(Wt),v.initSubject(Xt)],o=q(q({},p),{initPid:null===(f=v.config())||void 0===f?void 0:f.pid,onPidUpdate:function(n){v.set({pid:n,viewId:n+"_"+X(),actionId:void 0})}}),a=o.sendInit,p=o.initPid,c=o.routeMode,f=o.extractPid,o=o.onPidUpdate,s=Yt(c)?function(){return""}:zt(c),l=f||function(){},o=I(Ft(Jt(i),p||(i=location.href,null!==(p=l(i))&&void 0!==p?p:s(i)),s(location.href),o),2),d=o[0],o=o[1],Yt(c)||(u=I(Gt(function(n,t){return d(n,s(t),l(t))},""),1)[0],r.length&&r.forEach(function(n){return e.push(n[0](function(n){return u(c,n)}))})),a&&o(),[d.bind(null,"user_set")]),1)[0],W(v,[cn,en(v)],-1),v.on("config",function(){t(v.config().pid)}),B(v,$t,Wn,n),v.provide("sendPageview",t))})},to[at]=function(o){o.on("init",function(){var n,t,a,e,c,f,s,l,r=ut(o,at,ct);r&&(n=[],(e=q(q({},r),{setContextAtReq:function(){return nn(o,!0)},setTraceHeader:On(r.trace,"app_id="+(null===(t=o.config())||void 0===t?void 0:t.aid)+",origin=web")})).autoWrap&&(r=n,t=[U(o,["xhr_0",Rn(XMLHttpRequest&&XMLHttpRequest.prototype)]),function(){return U(o,Un)}],a=e,e=I(t,2),t=e[0],c=e[1],f=a.setTraceHeader,s=a.ignoreUrls,l=a.setContextAtReq,r.push(t[0](function(n){var t=I(n,4);t[0];n=t[1];t[2];var e=t[3];if(!n||rt(s,n))return A;f&&f(n,function(n,t){return e.setRequestHeader(n,t)});var r=l(),o=K(n),i=void 0,u=c()[0](function(n){o!==n.name||i||(i=n)});return function(n){var t=it(n,a);setTimeout(function(){i&&(t.response.timing=i),r&&r({ev_type:zn,payload:t}),u()},100)}}))),B(o,at,zn,n))})},to[xt]=function(o){o.on("init",function(){var n,t,f,e,s,l,d,p,v,h,r=ut(o,xt,St);r&&(n=[],(e=q(q({},r),{setContextAtReq:function(){return nn(o,!0)},setTraceHeader:On(r.trace,"app_id="+(null===(t=o.config())||void 0===t?void 0:t.aid)+",origin=web")})).autoWrap&&(r=n,t=[U(o,Dn),function(){return U(o,Un)}],f=e,e=I(t,2),t=e[0],s=e[1],l=f.setTraceHeader,d=f.ignoreUrls,p=f.setContextAtReq,v=window.Headers,(h=window.Request)&&v&&r.push(t[0](function(n){var n=I(n,2),r=n[0],o=n[1],t=K(r instanceof h?r.url:r);if(!wt(t)||rt(d,t))return A;l&&l(t,function(n,t){return Et(n,t,r,o,h,v)});var i=p(),u=X(),a=void 0,c=s()[0](function(n){t!==n.name||a||(a=n)});return function(n){var t=_t(r,o,n,h,v,f,u),e=ot(function(n){a&&(n.response.timing=a),i&&i({ev_type:zn,payload:n}),c()});setTimeout(function(){e(t)},1e3)}}))),B(o,xt,zn,n))})},to.tti=function(t){t.on("init",function(){var n;ut(t,"tti",{})&&(n=[],ve(nn(t),n,[U(t,["xhr_0",Rn(XMLHttpRequest&&XMLHttpRequest.prototype)]),U(t,Dn),U(t,Pn),U(t,Un),W(t,[an,tn(t)])],t.pp),B(t,"tti",Yn,n))})},to.fmp=function(r){r.on("init",function(){var n,t,e=ut(r,Ne,Be);e&&(n=[],t=U(r,Qt),"SSR"===e.renderType?le(_e,Ne,nn(r),n,[U(r,Kt),U(r,Zt)]):qe(nn(r),n,[t,W(r,[an,tn(r)])]),B(r,Ne,Yn,n))})},to[ht]=function(d){d.on("init",function(){var n,t,e,r,o,i,u,a,c,f,s,l=ut(d,ht,mt);l&&(f=(l=I((e=n=[],r=[U(d,lt),U(d,pt)],o=l,i=I(r,2),u=i[0],a=i[1],c=o.maxBreadcrumbs,f=o.onAddBreadcrumb,l=o.onMaxBreadcrumbs,r=o.dom,i=I(mn(100),2),o=i[0],i=i[1],f=I(vt(c,f,l),2),l=f[0],f=f[1],r&&(r=yn(f),e.push(u[0](o(ft,gn(r,st)))),e.push(a[0](i(gn(r,st))))),[l,f]),2))[0],t=l[1],d.on("report",s=function(n){return n.ev_type===zn&&t({type:zn,category:n.payload.api,message:"",data:{method:n.payload.request.method,url:n.payload.request.url,status_code:String(n.payload.response.status)},timestamp:n.payload.request.timestamp}),n}),n.push(function(){d.off("report",s)}),B(d,ht,Xn,n),d.provide("getBreadcrumbs",f),d.provide("addBreadcrumb",t))})},to[Pt]=function(e){e.on("init",function(){window.removeEventListener("error",e.pcErr,!0),window.removeEventListener("unhandledrejection",e.pcRej,!0);var n,t=ut(e,Pt,Ut);t&&(t=Rt(function(n){e.getBreadcrumbs&&(n.payload.breadcrumbs=e.getBreadcrumbs()),e.report(n)},n=[],[U(e,Nt),U(e,Bt),function(){return U(e,Mt)}],t),B(e,Pt,Xn,n),e.provide("captureException",t))})},to[ge]=function(l){l.on("init",function(){var n=l.pp||ye;null!==(c=n.observer)&&void 0!==c&&c.disconnect();var t,e,r,o,i,u,a,c,f,s=ut(l,ge,{});s&&(t=U(l,Kt),e=U(l,Zt),r=U(l,Qt),o=U(l,Pn),i=void 0,W(l,[cn,en(l)],-1)[0](function(n){i=n})(),u=function(n){n=n.ev_type===Yn&&n.payload.name===tr[0]||n.ev_type===Vn?n:q(q({},n),{overrides:i});l.report(n)},a=W(l,[an,tn(l)]),[Se,Te,Qe,nr,tr].forEach(function(n){!1!==s[n[0]]&&(n[1](u,n=[],[t,e,a]),B(l,ge,Yn,n))}),[rr,or,ir].forEach(function(n){var t;!1!==s[n[0]]&&(n[1](u,t=[],[r,e,o]),n=n[0]===er?Vn:"timing"===n[0]?$n:Yn,B(l,ge,n,t))}),c=(f=I(se(l.report.bind(l)),2))[0],f=f[1],l.provide("performanceInit",c),l.provide("performanceSend",f),n.entries.length=0,l.provide("sendCustomPerfMetric",function(n){n=q(q(q({},he),n),{isCustom:!0});l.report(we(n))}))})},to[ce]=function(e){e.on("init",function(){var n,t=ut(e,ce,fe);t&&(n=[],t=function(e,n,t,r){var o=I(t,1)[0],i=z();if(i){var u=r.ignoreUrls,t=r.includeUrls,a=r.dedupe,c=h(t),f=h(u),s=I(dn(G()),5)[4],l=void 0,d=function(n){var t=location&&location.href;t&&n.url===t||c&&!c.test(n.url)||f&&f.test(n.url)||n.url&&(a&&n.url===l||(l=n.url,(n=ae(n,s))&&e({ev_type:Fn,payload:n})))};return n.push(o[0](function(n){n=n||i.event;!n||(n=ue(n))&&d(n)})),d}}(e.report.bind(e),n,[U(e,Nt)],t),B(e,ce,Fn,n),t&&e.provide("reportResourceError",t))})},to[re]=function(d){d.on("init",function(){var n,e,r,t,o,i,u,a,c,f,s,l=ut(d,re,oe);l&&(n=[],e=d.report.bind(d),r=n,t=[U(d,Qt),function(){return U(d,Un)}],o=l,l=I(t,2),t=l[0],f=l[1],(s=G())&&(l=o.ignoreUrls,i=o.slowSessionThreshold,u=o.ignoreTypes,a=h(l),c=function(n,t){void 0===t&&(t=!1),x(u||ee,n.initiatorType)||a&&a.test(n.name)||(n={ev_type:Gn,payload:n},t&&(n.extra={sample_rate:1}),e(n))},r.push(t[0](function(){var n=I(dn(s),3),t=n[0],n=n[2],e=function(){if(!t)return!1;var n=t.loadEventEnd-t.navigationStart;return i<n}();n(te).forEach(function(n){return c(n,e)}),r.push(f()[0](function(n){c(n)}))}))),B(d,re,Gn,n))})},to[$e]=function(n,t){var o,i,u;i=Ve,u=t,(o=n).on("init",function(){var t,n,e=F(),r=z();e&&r&&((e=ut(o,$e,i)||xn(u,i))&&(r=[],e=I(Ye(o.report.bind(o),r,[U(o,ne),function(){return U(o,Pn)},function(){return U(o,Un)},U(o,Zt)],e),2),t=e[0],e=e[1],o.on("report",n=function(n){return t(n),n}),r.push(function(){o.off("report",n)}),B(o,$e,Kn,r),o.provide("detectBlankScreen",e)))})},to),Zr=Pr(),no=function(){var n=z(),t=qr();if(n&&t)return n[t]}();no&&["p","pp","pcErr","pcRej"].forEach(function(n){Zr.provide(n,no[n])});var to,eo,ro,oo,io=z(),uo=qr();io&&uo&&(to=(null==(to=io[uo])?void 0:to.q)||[],io[uo]=Zr,to.forEach(function(n){var t,e;e=n,n=q(q({},pn(t=Zr)),{url:e.pop(),timestamp:e.pop()}),vn(t,n)(function(){t.apply(void 0,b([],I(e),!1))})}),to.length=0,Zr.p&&("observe"in Zr.p.a&&console.warn("global precollect queue already updated"),Zr.p.a=(ro=Zr.p.a,oo=[],ro.observe=function(n){oo.push(n)},ro.push=function(){for(var n,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.forEach(function(t){oo.forEach(function(n){return n(t)})}),(n=[].push).call.apply(n,b([ro],I(t),!1))},ro),(eo=Zr.precollect)&&Zr.provide("precollect",function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return Zr.p.a.push(b(["precollect"],I(n),!1)),eo.apply(void 0,b([],I(n),!1))})))}();

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var REPORT_DOMAIN="apmplus.volces.com",SETTINGS_DOMAIN=REPORT_DOMAIN,SDK_VERSION="2.2.0",SDK_NAME="APM_PLUS_WEB",SETTINGS_PATH="/settings/get/webpro",BATCH_REPORT_PATH="/monitor_web/collect",STORAGE_PREFIX="APMPLUS",DEFAULT_IGNORE_PATHS=[BATCH_REPORT_PATH,SETTINGS_PATH,"/monitor_browser/collect"],DEFAULT_SAMPLE_CONFIG={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},DEFAULT_SENDER_SIZE=20;exports.BATCH_REPORT_PATH=BATCH_REPORT_PATH,exports.DEFAULT_IGNORE_PATHS=DEFAULT_IGNORE_PATHS,exports.DEFAULT_SAMPLE_CONFIG=DEFAULT_SAMPLE_CONFIG,exports.DEFAULT_SENDER_SIZE=DEFAULT_SENDER_SIZE,exports.REPORT_DOMAIN=REPORT_DOMAIN,exports.SDK_NAME=SDK_NAME,exports.SDK_VERSION=SDK_VERSION,exports.SETTINGS_DOMAIN=SETTINGS_DOMAIN,exports.SETTINGS_PATH=SETTINGS_PATH,exports.STORAGE_PREFIX=STORAGE_PREFIX;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var REPORT_DOMAIN="apmplus.volces.com",SETTINGS_DOMAIN=REPORT_DOMAIN,SDK_VERSION="2.3.0-alpha.0",SDK_NAME="APM_PLUS_WEB",SETTINGS_PATH="/settings/get/webpro",BATCH_REPORT_PATH="/monitor_web/collect",STORAGE_PREFIX="APMPLUS",DEFAULT_IGNORE_PATHS=[BATCH_REPORT_PATH,SETTINGS_PATH,"/monitor_browser/collect"],DEFAULT_SAMPLE_CONFIG={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},DEFAULT_SENDER_SIZE=20;exports.BATCH_REPORT_PATH=BATCH_REPORT_PATH,exports.DEFAULT_IGNORE_PATHS=DEFAULT_IGNORE_PATHS,exports.DEFAULT_SAMPLE_CONFIG=DEFAULT_SAMPLE_CONFIG,exports.DEFAULT_SENDER_SIZE=DEFAULT_SENDER_SIZE,exports.REPORT_DOMAIN=REPORT_DOMAIN,exports.SDK_NAME=SDK_NAME,exports.SDK_VERSION=SDK_VERSION,exports.SETTINGS_DOMAIN=SETTINGS_DOMAIN,exports.SETTINGS_PATH=SETTINGS_PATH,exports.STORAGE_PREFIX=STORAGE_PREFIX;

@@ -17,2 +17,3 @@ interface ContextAgent {

set: (pluginName: string, evType: string, tearDownGroup: (() => void)[]) => void;
has: (pluginName: string) => boolean;
remove: (k: string) => void;

@@ -22,2 +23,9 @@ removeByEvType: (k: string) => void;

}
declare type WithCommandDestroy<C extends AnyClient> = C & {
'destroyAgent.set': DestroyAgent['set'];
'destroyAgent.has': DestroyAgent['has'];
'destroyAgent.remove': DestroyAgent['remove'];
'destroyAgent.removeByEvType': DestroyAgent['removeByEvType'];
'destroyAgent.clear': DestroyAgent['clear'];
};

@@ -147,4 +155,4 @@ declare type ReportEventFromClient<C extends AnyClient> = C extends {

declare type WithCommandArray<C extends AnyClient> = C & GetCommandFunction<C>;
declare type PropertyToFunction<C extends Record<string, any>, P extends keyof C> = P extends infer K ? K extends keyof C ? C[K] extends (...args: any) => any ? (m: K, ...args: Parameters<C[K]>) => ReturnType<C[K]> : C[K] extends ((...args: any) => any) | undefined ? (m: K, ...args: Parameters<NonNullable<C[K]>>) => ReturnType<NonNullable<C[K]>> | undefined : (m: K) => C[K] : never : never;
declare type WithCommandArray<C extends AnyClient, ExcludeKeys extends keyof AnyClient | string = ''> = C & GetCommandFunction<C, ExcludeKeys>;
declare type PropertyToFunction<C extends Record<string, any>, P extends keyof C> = P extends infer K ? K extends keyof C ? C[K] extends ((...args: any) => any) | undefined ? <K extends keyof C>(m: K, ...args: Parameters<NonNullable<C[K]>>) => ReturnType<NonNullable<C[K]>> | undefined : (m: K) => C[K] : never : never;
declare type Event<C extends AnyClient> = ClientEvent<ReportEventFromClient<C>, SendEventFromClient<C>, any>;

@@ -154,3 +162,3 @@ declare type EventToOnFunctions<Event extends ClientEvent<any, any, any>, T extends keyof Event> = T extends infer K ? K extends keyof Event ? (m: 'on', ev: K, handler: Event[K]) => void : never : never;

declare type EventFunctions<C extends AnyClient> = EventToOnFunctions<Event<C>, keyof Event<C>> | EventToOffFunctions<Event<C>, keyof Event<C>>;
declare type GetCommandFunction<C extends AnyClient> = Function & UnionToIntersection<PropertyToFunction<C, Exclude<keyof C, 'on' | 'off'>> | EventFunctions<C>>;
declare type GetCommandFunction<C extends AnyClient, ExcludeKeys extends keyof AnyClient | string = ''> = Function & UnionToIntersection<PropertyToFunction<Omit<C, 'on' | 'off' | ExcludeKeys>, Exclude<keyof C, 'on' | 'off' | ExcludeKeys>> | EventFunctions<C>>;

@@ -217,2 +225,3 @@ interface Integration<T extends AnyClient> {

declare type PluginsConfig = AjaxMonitorPluginConfig & BreadcrumbMonitorPluginConfig & FMPMonitorPluginConfig & FetchMonitorPluginConfig & JsErrorMonitorPluginConfig & PerformanceMonitorPluginConfig & ResourceErrorMonitorPluginConfig & ResourceMonitorPluginConfig & TTIMonitorPluginConfig & PageviewMonitorPluginConfig & BlankScreenMonitorPluginConfig & ActionMonitorPluginConfig & HeatmapMonitorPluginConfig;
declare type WebConfig = {

@@ -225,3 +234,3 @@ pid: string;

actionId?: string;
plugins: AjaxMonitorPluginConfig & BreadcrumbMonitorPluginConfig & FMPMonitorPluginConfig & FetchMonitorPluginConfig & JsErrorMonitorPluginConfig & PerformanceMonitorPluginConfig & ResourceErrorMonitorPluginConfig & ResourceMonitorPluginConfig & TTIMonitorPluginConfig & PageviewMonitorPluginConfig & BlankScreenMonitorPluginConfig & ActionMonitorPluginConfig & HeatmapMonitorPluginConfig;
plugins: PluginsConfig;
sample?: SampleConfig$1;

@@ -678,2 +687,5 @@ heatmap?: any;

declare type WebClient = Client<WebReportEvent, any, any, any, any, any, WebConfig>;
declare type WebVolClient = Client<WebReportEvent, any, any, any, any, any, WebConfig & {
aid: number;
}>;
interface UrlParams {

@@ -714,2 +726,3 @@ url?: string;

}
declare function AjaxMonitorVolPlugin<C extends WithSubject<WebVolClient>>(client: C): void;

@@ -737,2 +750,3 @@ declare type PreBreadcrumb = Omit<Breadcrumb, 'timestamp'> & Partial<Pick<Breadcrumb, 'timestamp'>>;

}
declare function BreadcrumbMonitorPlugin<C extends WithSubject<WebClient>>(client: C): void;

@@ -743,2 +757,3 @@ declare const FETCH_MONITOR_PLUGIN_NAME = "fetch";

}
declare function FetchMonitorVolPlugin<C extends WithSubject<WebVolClient>>(client: C): void;

@@ -758,2 +773,6 @@ declare type ReportJsError = (ex: any, extra?: Record<string, string>, react?: ReactInfo) => void;

};
declare type WithJSErrorPrecollect<C extends WebClient> = C & {
pcErr?: (e: ErrorEvent) => void;
pcRej?: (e: PromiseRejectionEvent) => void;
};
declare type JsErrorMonitorConfig = JsErrorConfig;

@@ -763,2 +782,3 @@ interface JsErrorMonitorPluginConfig {

}
declare function JsErrorMonitorPlugin<C extends WithJSErrorPrecollect<WithBreadcrumb<WithSubject<WebClient>>>>(client: C): void;

@@ -787,2 +807,3 @@ interface SendPageview {

}
declare function PageviewMonitorPlugin<C extends WithSubject<WebClient>>(client: C): void;

@@ -800,2 +821,3 @@ interface ResourceProps {

}
declare function ResourceMonitorPlugin<C extends WithSubject<WebClient>>(client: C): void;

@@ -824,2 +846,3 @@ interface ResourceErrorData {

}
declare function ResourceErrorMonitorPlugin<C extends WithSubject<WebClient>>(client: C): void;

@@ -854,2 +877,5 @@ declare type PerformanceInit = () => void;

};
declare type WithPerformancePrecollect<C extends WebClient> = C & {
pp?: PerformancePrecollect;
};
interface PerformanceMonitorPluginConfig {

@@ -863,2 +889,3 @@ [PERFORMANCE_MONITOR_PLUGIN_NAME]?: Partial<PerformanceMonitorUserConfig> | boolean;

}
declare function TTIMonitorPlugin<C extends WithPerformancePrecollect<WithSubject<WebClient>>>(client: C): void;

@@ -873,2 +900,3 @@ interface FMPMonitorConfig {

}
declare function FMPMonitorPlugin<C extends WithSubject<WebClient>>(client: C): void;

@@ -899,2 +927,3 @@ interface BlankScreenMonitorConfig {

}
declare function BlankScreenMonitorVolPlugin<C extends WithSubject<WebClient>>(client: C, overrideConfig?: Partial<BlankScreenMonitorConfig>): void;

@@ -918,2 +947,4 @@ interface ActionMonitorConfig {

declare function PerformanceMonitorPlugin<C extends WithPerformancePrecollect<WithSubject<WebClient>>>(client: C): void;
declare type CustomEventData = {

@@ -958,2 +989,11 @@ name: string;

declare type PluginKeys = keyof PluginsConfig;
declare type ReloadPluginType = <T extends PluginKeys | string>(pluginName: T, pluginConfig?: T extends PluginKeys ? PluginsConfig[T] : any) => void;
declare type WithReloadPlugin<C extends AnyClient> = C & {
reloadPlugin?: ReloadPluginType;
};
declare type WithCommandReloadPlugin<C extends AnyClient> = C & {
<T extends PluginKeys | string, M extends 'reloadPlugin'>(m: M, pluginName: T, pluginConfig?: T extends keyof PluginsConfig ? PluginsConfig[T] : any): void;
};
declare type BrowserSender = BatchSender<WebSendEvent>;

@@ -1114,4 +1154,52 @@

declare const getDefaultConfig: (c: Partial<BrowserConfig>) => {
aid: number;
pid: string;
token: string;
viewId: string;
userId: string;
deviceId: string;
sessionId: string;
storageExpires: number;
domain: string;
plugins: {
ajax: {
ignoreUrls: string[];
};
fetch: {
ignoreUrls: string[];
};
breadcrumb: {};
pageview: {};
jsError: {};
resource: {};
resourceError: {};
performance: {};
tti: {};
fmp: {};
blankScreen: boolean;
};
release: string;
env: string;
sample: {
r: number;
sample_rate: number;
include_users: string[];
sample_granularity: string;
rules: Record<string, Omit<EventSampleRule$1, "name">>;
};
transport: {
get(options: XhrGetOptions<any>): void;
post(options: XhrPostOptions<any>): void;
};
};
interface CreateBrowserClientConfig {
createSender?: (c: BrowserConfig) => BrowserSender;
builder?: BrowserBuilder;
createDefaultConfig?: (c: Partial<BrowserConfig>) => BrowserConfig;
}
declare const createMinimalBrowserClient: ({ createSender, builder, createDefaultConfig, }?: CreateBrowserClientConfig) => WithCommandArray<WithCommandDestroy<WithCommandContext<BrowserClient>>, "">;
declare type PrecollectArg = [string, string, PrecollectData, number, string];
declare type BrowserClient = WithDetectBlankScreen<WithBreadcrumb<WithReportResourceError<WithSendPerformance<WithCaptureException<WithSendCustom<WithSendPageview<WithContext<WithSubject<Client<BrowserReportEvent, BrowserSendEvent, BrowserBuilder, BrowserSender, BrowserInitConfig, BrowserUserConfig, BrowserConfig>>>>>>>>>> & LoadableTarget & {
declare type BrowserClient = WithReloadPlugin<WithDetectBlankScreen<WithBreadcrumb<WithReportResourceError<WithSendPerformance<WithCaptureException<WithSendCustom<WithSendPageview<WithContext<WithSubject<Client<BrowserReportEvent, BrowserSendEvent, BrowserBuilder, BrowserSender, BrowserInitConfig, BrowserUserConfig, BrowserConfig>>>>>>>>>>> & {
q?: any[];

@@ -1125,6 +1213,4 @@ p?: {

};
declare type BrowserCommandClient = WithPrecollect<WithCommandArray<WithCommandContext<BrowserClient>>>;
declare type LoadableTarget = {
loaded: string[];
loading: string[];
declare type BrowserCommandClient = WithCommandReloadPlugin<WithPrecollect<WithCommandArray<WithCommandDestroy<WithCommandContext<BrowserClient>>, 'reloadPlugin'>>> & {
create?: (config?: CreateBrowserClientConfig) => BrowserCommandClient;
};

@@ -1188,52 +1274,17 @@

declare const getDefaultConfig: (c: Partial<BrowserConfig>) => {
aid: number;
pid: string;
token: string;
viewId: string;
userId: string;
deviceId: string;
sessionId: string;
storageExpires: number;
domain: string;
plugins: {
ajax: {
ignoreUrls: string[];
};
fetch: {
ignoreUrls: string[];
};
breadcrumb: {};
pageview: {};
jsError: {};
resource: {};
resourceError: {};
performance: {};
tti: {};
fmp: {};
blankScreen: boolean;
};
release: string;
env: string;
sample: {
r: number;
sample_rate: number;
include_users: string[];
sample_granularity: string;
rules: Record<string, Omit<EventSampleRule$1, "name">>;
};
transport: {
get(options: XhrGetOptions<any>): void;
post(options: XhrPostOptions<any>): void;
};
declare const PluginMap: {
pageview: typeof PageviewMonitorPlugin;
ajax: typeof AjaxMonitorVolPlugin;
fetch: typeof FetchMonitorVolPlugin;
tti: typeof TTIMonitorPlugin;
fmp: typeof FMPMonitorPlugin;
breadcrumb: typeof BreadcrumbMonitorPlugin;
jsError: typeof JsErrorMonitorPlugin;
performance: typeof PerformanceMonitorPlugin;
resourceError: typeof ResourceErrorMonitorPlugin;
resource: typeof ResourceMonitorPlugin;
blankScreen: typeof BlankScreenMonitorVolPlugin;
};
interface CreateBrowserClientConfig {
createSender?: (c: BrowserConfig) => BrowserSender;
builder?: BrowserBuilder;
createDefaultConfig?: (c: Partial<BrowserConfig>) => BrowserConfig;
}
declare const createMinimalBrowserClient: ({ createSender, builder, createDefaultConfig, }?: CreateBrowserClientConfig) => WithCommandArray<WithCommandContext<BrowserClient>>;
declare const createBrowserClient: (config?: CreateBrowserClientConfig) => BrowserCommandClient;
declare const createBrowserClient: (config?: CreateBrowserClientConfig) => WithPrecollect<WithCommandArray<WithCommandContext<BrowserClient>>>;
declare const REPORT_DOMAIN = "apmplus.volces.com";

@@ -1264,2 +1315,2 @@ declare const SETTINGS_DOMAIN = "apmplus.volces.com";

export { ActionPayload, BATCH_REPORT_PATH, BlankScreenPayload, BrowserBuilder, BrowserClient, BrowserCommandClient, BrowserConfig, BrowserInitConfig, BrowserReportEvent, BrowserSendEvent, BrowserServerConfig, BrowserUserConfig, Common as CommonContext, CommonSend, CreateBrowserClientConfig, CustomPayload, DEFAULT_IGNORE_PATHS, DEFAULT_SAMPLE_CONFIG, DEFAULT_SENDER_SIZE, EV_METHOD_MAP, HeatmapPayload, HttpPayload, InjectConfigPlugin, InjectEnvPlugin, InjectQueryPlugin, JsErrorPayload, LoadableTarget, ObservableArray, PageviewPayload, PerformanceLongtaskPayload, PerformancePayload, PerformanceTimingPayload, Precollect, PrecollectData, PrecollectPlugin, REPORT_DOMAIN, ReportToReportEvent, ResourceErrorPayload, ResourcePayload, SDK_NAME, SDK_VERSION, SETTINGS_DOMAIN, SETTINGS_PATH, STORAGE_PREFIX, SriPayload, TimeCalibrationPlugin, WithPrecollect, addConfigToReportEvent, addEnvToSendEvent, browserBuilder, createBrowserClient, createBrowserConfigManager, createMinimalBrowserClient, createStore, _default as default, filterIfPluginDisabled, getConsumeStored, getDefaultConfig, getDefaultSessionId, getGlobalInstance, getGlobalName, getReportUrl, getServerConfig, getSettingsUrl, getStorageKey, getStoreInfo, getStoreOrConsume, getViewId, glueCodeForStorageSecurity, mergeSampleConfig, normalizeInitConfig, normalizeUserConfig, parseServerConfig, reverseMap, saveStoreInfo, toObservableArray, validateInitConfig };
export { ActionPayload, BATCH_REPORT_PATH, BlankScreenPayload, BrowserBuilder, BrowserClient, BrowserCommandClient, BrowserConfig, BrowserInitConfig, BrowserReportEvent, BrowserSendEvent, BrowserServerConfig, BrowserUserConfig, Common as CommonContext, CommonSend, CreateBrowserClientConfig, CustomPayload, DEFAULT_IGNORE_PATHS, DEFAULT_SAMPLE_CONFIG, DEFAULT_SENDER_SIZE, EV_METHOD_MAP, HeatmapPayload, HttpPayload, InjectConfigPlugin, InjectEnvPlugin, InjectQueryPlugin, JsErrorPayload, ObservableArray, PageviewPayload, PerformanceLongtaskPayload, PerformancePayload, PerformanceTimingPayload, PluginMap, Precollect, PrecollectData, PrecollectPlugin, REPORT_DOMAIN, ReportToReportEvent, ResourceErrorPayload, ResourcePayload, SDK_NAME, SDK_VERSION, SETTINGS_DOMAIN, SETTINGS_PATH, STORAGE_PREFIX, SriPayload, TimeCalibrationPlugin, WithPrecollect, addConfigToReportEvent, addEnvToSendEvent, browserBuilder, createBrowserClient, createBrowserConfigManager, createMinimalBrowserClient, createStore, _default as default, filterIfPluginDisabled, getConsumeStored, getDefaultConfig, getDefaultSessionId, getGlobalInstance, getGlobalName, getReportUrl, getServerConfig, getSettingsUrl, getStorageKey, getStoreInfo, getStoreOrConsume, getViewId, glueCodeForStorageSecurity, mergeSampleConfig, normalizeInitConfig, normalizeUserConfig, parseServerConfig, reverseMap, saveStoreInfo, toObservableArray, validateInitConfig };

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var __assign=function(){return(__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function __rest(e,n){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)n.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(r[o[t]]=e[o[t]]);return r}function __read(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var t,o,i=r.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(t=i.next()).done;)a.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function __spreadArray(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||((t=t||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}var DEFAULT_SIZE=10,DEFAULT_WAIT=1e3,stringifyBatch=function(e){return JSON.stringify({ev_type:"batch",list:e})};function createBatchSender(e){var r,t=e.transport,o=e.endpoint,n=e.size,i=void 0===n?DEFAULT_SIZE:n,e=e.wait,a=void 0===e?DEFAULT_WAIT:e,u=[],s=0;function c(){var n;u.length&&(n=this.getBatchData(),t.post({url:o,data:n,fail:function(e){r&&r(e,n)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(e){i=e},setWait:function(e){a=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){u.push(e),u.length>=i&&c.call(this),clearTimeout(s),s=setTimeout(c.bind(this),a)},flush:function(){clearTimeout(s),c.call(this)},getBatchData:function(){return u.length?stringifyBatch(u):""},clear:function(){clearTimeout(s),u=[]},fail:function(e){r=e}}}var EVENTS=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],noop=function(){return{}};function isObject(e){return"object"==typeof e&&null!==e}var objProto=Object.prototype;function isPlainObject(e){if(isObject(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===objProto.toString.call(e);e=Object.getPrototypeOf(e);return e===objProto||null===e}return!1}function isArray(e){return"[object Array]"===objProto.toString.call(e)}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function hasKey(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function mergeDeepConcatArray(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r={},t=0;t<e.length;)r=_mergeDeepMergeArray(r,e[t++]);return r}function _mergeDeepMergeArray(e,n){var r,t=__assign({},e);for(r in n)hasKey(n,r)&&void 0!==n[r]&&(isObject(n[r])&&isPlainObject(n[r])?t[r]=_mergeDeepMergeArray(isObject(e[r])?e[r]:{},n[r]):isArray(n[r])&&isArray(e[r])?t[r]=_mergeDeepArray(e[r],n[r]):t[r]=n[r]);return t}function _mergeDeepArray(e,n){e=isArray(e)?e:[],n=isArray(n)?n:[];return Array.prototype.concat.call(e,n).map(function(e){return e instanceof RegExp?e:isObject(e)&&isPlainObject(e)?_mergeDeepMergeArray({},e):isArray(e)?_mergeDeepArray([],e):e})}function arrayIncludes(e,n){if(!isArray(e))return!1;if(0===e.length)return!1;for(var r=0;r<e.length;){if(e[r]===n)return!0;r++}return!1}var arrayRemove=function(e,n){if(!isArray(e))return e;var r=e.indexOf(n);if(0<=r){n=e.slice();return n.splice(r,1),n}return e},safeVisit=function(e,n,r){for(var t,n=__read(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(t=__read(i))[0],i=t.slice(1);if(e)return r(e,o)},safeCall=function(e,n,r){return safeVisit(e,n,function(e,n){if(e&&n in e&&isFunction(e[n]))try{return e[n].apply(e,r)}catch(e){return}})};function safeStringify(e){try{return isString(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}var joinQueryWithMap=function(r){return isObject(r)?Object.keys(r).reduce(function(e,n){return e+="&"+n+"="+r[n]},"").replace("&","?"):""};function createContextAgent(){var r={},t={},o={set:function(e,n){return r[e]=n,t[e]=safeStringify(n),o},merge:function(n){return r=__assign(__assign({},r),n),Object.keys(n).forEach(function(e){t[e]=safeStringify(n[e])}),o},delete:function(e){return delete r[e],delete t[e],o},clear:function(){return r={},t={},o},get:function(e){return t[e]},toString:function(){return __assign({},t)}};return o}var hookObjectProperty=function(i,a,u,s){return void 0===s&&(s=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return noop;var r=i[a],t=u.apply(void 0,__spreadArray([r],__read(e),!1)),o=t;return isFunction(o)&&s&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return t.apply(this,n)}catch(e){return isFunction(r)&&r.apply(this,n)}}),i[a]=o,function(e){e||(o===i[a]?i[a]=r:t=r)}}},errCount=0,error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,__spreadArray(["[SDK]",Date.now(),(""+errCount++).padStart(8," ")],__read(e),!1))},warnCount=0,warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,__spreadArray(["[SDK]",Date.now(),(""+warnCount++).padStart(8," ")],__read(e),!1))},runProcessors=function(t){return function(e){for(var n=e,r=0;r<t.length&&n;r++)try{n=t[r](n)}catch(e){error(e)}return n}};function mathRNG(){for(var e=new Array(16),n=0,r=0;r<16;r++)0==(3&r)&&(n=4294967296*Math.random()),e[r]=n>>>((3&r)<<3)&255;return e}function bytesToUuid(e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);var t=0,o=n;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[+t]],o[e[15]]].join("")}function uuid(){var e=mathRNG();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,bytesToUuid(e)}var BUFFER_TIME=3e5,applyBufferTimer=function(e,n,r){var t=0;return-1===r?noop:function(){if(e())return t&&clearTimeout(t),void(t=0);0===t&&(t=setTimeout(n,r))}},nextLink=function(t,e){var n=[];try{n=e.reduce(function(e,n){try{var r=n(t);"function"==typeof r&&e.push(r)}catch(e){}return e},[])}catch(e){}return function(e){return nextLink(e,n)}},toObservable=function(e){function n(e){t=arrayRemove(t,e),i||a()}var r,t=[],o=[],i=!1,a=applyBufferTimer(function(){return!!t.length},function(){i=!0,r&&r[0](),o.forEach(function(e){return e()}),o.length=0,r=void 0},e=void 0===e?BUFFER_TIME:e);return{next:function(e){return nextLink(e,t)},complete:function(e){o.push(e)},attach:function(e,n){r=[e,n]},subscribe:function(e){if(i)throw new Error("Observer is closed");return t.push(e),r&&r[1]&&r[1](e),a(),function(){return n(e)}},unsubscribe:n}},createSafeObserver=function(e,n,r){r=toObservable(r);try{e(r.next,r.attach),n&&r.complete(n)}catch(e){}return[r.subscribe,r.unsubscribe]};function createDestroyAgent(){function r(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){t[e]&&t[e].forEach(function(e){r(e[1])}),t[e]=void 0}var t={};return{set:function(e,n,r){t[e]?t[e].push([n,r]):t[e]=[[n,r]]},remove:n,removeByEvType:function(n){Object.keys(t).forEach(function(e){t[e]&&t[e].forEach(function(e){e[0]===n&&r(e[1])})})},clear:function(){Object.keys(t).forEach(function(e){n(e)})}}}function createClient(e){var r,t,n=e.builder,o=e.createSender,i=e.createDefaultConfig,a=e.createConfigManager,u=e.userConfigNormalizer,s=e.initConfigNormalizer,c=e.validateInitConfig,f={};EVENTS.forEach(function(e){return f[e]=[]});var l=!1,g=!1,d=!1,p=[],_=[],v=createDestroyAgent(),y={getBuilder:function(){return n},getSender:function(){return r},getPreStartQueue:function(){return p},init:function(e){if(l)warn("already inited");else{if(!(e&&isObject(e)&&c(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=s(e);if((t=a(n)).setConfig(e),t.onChange(function(){h("config")}),!(r=o(t.getConfig())))throw new Error("sender missing");h("init",l=!0)}},set:function(e){l&&e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(e))},config:function(e){if(l)return e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(u(e))),null==t?void 0:t.getConfig()},provide:function(e,n){arrayIncludes(_,e)?warn("cannot provide "+e+", reserved"):(y[e]=n,h("provide",!1,e))},start:function(){var n=this;l&&(g||null!=t&&t.onReady(function(){h("start",g=!0),p.forEach(function(e){return n.build(e)}),p=[]}))},report:function(e){e&&(!(e=runProcessors(f.beforeReport)(e))||(e=runProcessors(f.report)(e))&&(g?this.build(e):p.push(e)))},build:function(e){!g||(e=runProcessors(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=runProcessors(f.build)(e))&&this.send(e))},send:function(e){!g||(e=runProcessors(f.beforeSend)(e))&&(r.send(e),h("send",!1,e))},destroy:function(){v.clear(),h("beforeDestroy",d=!0)},on:function(e,n){"init"===e&&l||"start"===e&&g||"beforeDestroy"===e&&d?n():f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=arrayRemove(f[e],n))},destroyAgent:v},_=Object.keys(y);return y;function h(e,n){void 0===n&&(n=!1);for(var r=[],t=2;t<arguments.length;t++)r[t-2]=arguments[t];f[e].forEach(function(e){try{e.apply(void 0,__spreadArray([],__read(r),!1))}catch(e){}}),n&&(f[e].length=0)}}var ContextPlugin=function(e){var n=createContextAgent();e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})},withCommandArray=function(i,a,r){function u(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(o=e[0]){var r=o.split(".")[0];if(r in u)return safeCall(u,o,[].slice.call(e,1));var t=s[r]||[],o=null!==(o=null==a?void 0:a(i))&&void 0!==o?o:{};t.push(__spreadArray([o],__read(e),!1)),void(s[r]=t)}}var e,s={};for(e in hookObjectProperty(i,"provide",function(r){return function(e,n){u[e]=n,r.call(i,e,n)}})(),i)Object.prototype.hasOwnProperty.call(i,e)&&(u[e]=i[e]);return i.on("provide",function(e){s[e]&&(s[e].forEach(function(e){var n=__read(e),e=n[0],n=n.slice(1);null!=r&&r(i,e,n)}),s[e]=null)}),u};function IntegrationPlugin(r){r.on("init",function(){var n=[],e=r.config();e&&e.integrations&&e.integrations.forEach(function(e){arrayIncludes(n,e.name)||(n.push(e.name),e.setup(r),e.tearDown&&r.on("beforeDestroy",e.tearDown))})})}function SubjectPlugin(e,n){var r=n||{};e.provide("initSubject",function(e){var e=__read(e,2),n=e[0],e=e[1];return r[n]||(r[n]=createSafeObserver(e,function(){r[n]=void 0})),r[n]}),e.provide("getSubject",function(e){return r[e]}),e.provide("privateSubject",{})}var now=function(){return Date.now()};function getDefaultBrowser(){if("object"==typeof window&&isObject(window))return window}function getDefaultLocation(){return getDefaultBrowser()&&window.location}function getDefaultXMLHttpRequest(){if("function"==typeof XMLHttpRequest&&isFunction(XMLHttpRequest))return XMLHttpRequest}function getDefaultNavigator(){if(getDefaultBrowser()&&"navigator"in window)return window.navigator}function getDefaultNetworkInformation(){var e=getDefaultNavigator();if(e)return e.connection||e.mozConnection||e.webkitConnection}function getLocationUrl(){var e=getDefaultBrowser()&&getDefaultLocation();return null==e?void 0:e.href}var getGlobalRegistry=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar},captureCurrentContext=function(e){var n={url:getLocationUrl(),timestamp:now()},r=e.config();return null!=r&&r.pid&&(n.pid=r.pid),null!=e&&e.context&&(n.context=e.context.toString()),n},syncReportWithCapturedContext=function(r,t){return function(e){function n(e){return e.overrides=t,e}r.on("report",n),e(),r.off("report",n)}},invokeCallbackOnce=function(n){var r=!1;return[function(e){r||(r=!0,n&&n(e))}]},onPageUnload=function(e){var n,r=getDefaultBrowser();r&&(n=__read(invokeCallbackOnce(e),1)[0],["unload","beforeunload","pagehide"].forEach(function(e){r.addEventListener(e,n)}))},isSupportEncrypt=function(){return!!btoa&&!!atob};function encodeToBase64(e){return isSupportEncrypt()?btoa(encodeURI(e)):e}function decodeWithBase64(e){return isSupportEncrypt()?decodeURI(atob(e)):e}var getStorageWithDecoding=function(e){try{var n=localStorage.getItem(e),r=n,t=r=n&&"string"==typeof n?JSON.parse(decodeWithBase64(n)):r,o=t.expires,i=__rest(t,["expires"]);return o>=now()?i:void 0}catch(e){return}},setStorageWithEncoding=function(e,n,r){if(!(r<=0))try{localStorage.setItem(e,encodeToBase64(JSON.stringify(__assign(__assign({},n),{expires:now()+r}))))}catch(e){}},DEFAULT_STORAGE_EXPIRES=7776e6,formatStorageExpires=function(e){return!1===e?0:!0!==e&&void 0!==e&&isNumber(e)?e:DEFAULT_STORAGE_EXPIRES};function getNetworkType(e){return(null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||""}var InjectNetworkTypePlugin=function(e){var n=getDefaultNetworkInformation(),r=getNetworkType(n);n&&(n.onchange=function(){r=getNetworkType(n)}),e.on("report",function(e){return __assign(__assign({},e),{extra:__assign(__assign({},e.extra||{}),{network_type:r})})})},getBeaconTransport=function(){var r=getDefaultBrowser();return r&&r.navigator.sendBeacon?{get:function(){},post:function(e,n){r.navigator.sendBeacon(e,n)}}:{get:noop,post:noop}},request=function(e,n,r){var t=n.url,o=n.data,i=n.success,a=void 0===i?noop:i,i=n.fail,u=void 0===i?noop:i,i=n.getResponseText,s=void 0===i?noop:i,n=n.withCredentials,n=void 0!==n&&n,r=new r;r.withCredentials=n,r.open(e,t,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){null!=s&&s(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),a(e)):a({})}catch(e){u(e)}},r.onerror=function(){u(new Error("Network request failed"))},r.onabort=function(){u(new Error("Network request aborted"))},r.send(o)},getXhrTransport=function(){var n=getDefaultXMLHttpRequest();return n?{get:function(e){request("GET",e,n)},post:function(e){request("POST",e,n)}}:{get:noop,post:noop}};function createBrowserSender(e){function n(e){t.post(r.getEndpoint(),stringifyBatch([e]))}var r=createBatchSender(e),t=getBeaconTransport();return onPageUnload(function(){var e=r.getBatchData();e&&(t.post(r.getEndpoint(),e),r.clear()),r.send=n}),r}var browserBuilder={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:__assign(__assign({},e.extra||{}),e.overrides||{})}}};function normalizeInitConfig(e){var n,r=e.plugins||{};for(n in r)r[n]&&!isObject(r[n])&&(r[n]={});return __assign(__assign({},e),{plugins:r})}function validateInitConfig(e){return isObject(e)&&"aid"in e}function normalizeUserConfig(e){return __assign({},e)}function parseServerConfig(e){if(!e)return{};var n=e.sample,r=e.timestamp,t=e.status;if(!n)return{};var o=n.sample_rate,e=n.sample_granularity;return{sample:{include_users:n.include_users,sample_rate:t&&4===t?0:o,sample_granularity:e,rules:n.rules.reduce(function(e,n){var r=n.name,t=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[r]={enable:t,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r}}var REPORT_DOMAIN="apmplus.volces.com",SDK_VERSION="2.2.0",SDK_NAME="APM_PLUS_WEB",SETTINGS_PATH="/settings/get/webpro",BATCH_REPORT_PATH="/monitor_web/collect",STORAGE_PREFIX="APMPLUS",DEFAULT_IGNORE_PATHS=[BATCH_REPORT_PATH,SETTINGS_PATH,"/monitor_browser/collect"],DEFAULT_SAMPLE_CONFIG={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},DEFAULT_SENDER_SIZE=20,getReportUrl=function(e,n){return void 0===n&&(n=BATCH_REPORT_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getSettingsUrl=function(e,n){return void 0===n&&(n=SETTINGS_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getViewId=function(e){return e+"_"+Date.now()},getDefaultSessionId=function(){return uuid()},getStorageKey=function(e){return STORAGE_PREFIX+e},glueCodeForStorageSecurity=function(e,n){var r=localStorage.getItem(e);if(r&&isSupportEncrypt()&&"{"===r[0])try{setStorageWithEncoding(e,JSON.parse(r),n)}catch(e){}},getStoreInfo=function(e,n){void 0===e&&(e=0);var r={userId:uuid(),deviceId:uuid(),r:Math.random()};if(n<=0)return r;e=getStorageKey(e);return glueCodeForStorageSecurity(e,n),getStorageWithDecoding(e)||r},saveStoreInfo=function(e){var n=e.aid,r=e.userId,t=e.deviceId,o=e.sample,e=e.storageExpires,n=getStorageKey(n);setStorageWithEncoding(n,{userId:r,deviceId:t,r:o.r},formatStorageExpires(e))},createBrowserConfigManager=function(n){var r,t,o,i=n,a={},u=noop,s=noop;return{getConfig:function(){return i},setConfig:function(e){return a=__assign(__assign({},a),e||{}),c(),r||(r=e,i.useLocalConfig?(o={},u()):t?f():getServerConfig(i.transport,i.domain,i.aid,function(e){t=e,f()})),i},onChange:function(e){s=e},onReady:function(e){u=function(){!function(){n.userId!==i.userId&&(n.sample.r=Math.random(),c());saveStoreInfo(i)}(),e()},o&&u()}};function c(){var e=__assign(__assign(__assign({},n),o||{}),a);e.plugins=mergeDeepConcatArray(n.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),e.sample=mergeSampleConfig(mergeSampleConfig(n.sample,null==o?void 0:o.sample),a.sample),i=e,s()}function f(){o=parseServerConfig(t),c(),u()}};function getServerConfig(e,n,r,t){e.get({withCredentials:!0,url:getSettingsUrl(n)+"?aid="+r,success:function(e){t(e.data||{})},fail:function(){t()}})}function mergeSampleConfig(t,o){if(!t||!o)return t||o;var e=__assign(__assign({},t),o);return e.include_users=__spreadArray(__spreadArray([],__read(t.include_users||[]),!1),__read(o.include_users||[]),!1),e.rules=__spreadArray(__spreadArray([],__read(Object.keys(t.rules||{})),!1),__read(Object.keys(o.rules||{})),!1).reduce(function(e,n){var r;return n in e||(n in(t.rules||{})&&n in(o.rules||{})?(e[n]=__assign(__assign({},t.rules[n]),o.rules[n]),e[n].conditional_sample_rules=__spreadArray(__spreadArray([],__read(t.rules[n].conditional_sample_rules||[]),!1),__read(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(r=t.rules)||void 0===r?void 0:r[n])||(null===(r=o.rules)||void 0===r?void 0:r[n])),e},{}),e}var addEnvToSendEvent=function(e){var n={url:getLocationUrl(),timestamp:Date.now()};return __assign(__assign({},e),{extra:__assign(__assign({},n),e.extra||{})})},InjectEnvPlugin=function(e){e.on("report",function(e){return addEnvToSendEvent(e)})},MAX_RTT=700,TimeCalibrationPlugin=function(r){var t,o=!1;r.on("init",function(){t=(new Date).getTime(),r.on("config",function(){var e,n=null===(e=r.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=(new Date).getTime())-t<MAX_RTT&&n&&(e=n-(e+t)/2,!isNaN(e)&&(0<e||e<-6e5)&&r.set({offset:e})))})})},addConfigToReportEvent=function(e,n){var r={};return r.aid=n.aid,r.pid=n.pid,r.view_id=n.viewId,r.user_id=n.userId,__assign(__assign({},e),{extra:__assign(__assign({},r),e.extra||{})})},InjectConfigPlugin=function(n){n.on("beforeBuild",function(e){return addConfigToReportEvent(e,n.config())})},InjectQueryPlugin=function(u){u.on("start",function(){var e=u.config(),n=e.deviceId,r=e.sessionId,t=e.release,o=e.env,i=e.offset,a=e.aid,e=e.token,a={did:n,sid:r,release:t,env:o,sname:SDK_NAME,sversion:SDK_VERSION,soffset:i||0,biz_id:a,x_auth_token:e},e=u.getSender();e.setEndpoint(e.getEndpoint()+joinQueryWithMap(a))})},getDefaultConfig=function(e){var n=formatStorageExpires(e.storageExpires),e=getStoreInfo(e.aid,n);return{aid:0,pid:"",token:"",viewId:getViewId("_"),userId:e.userId,deviceId:e.deviceId,sessionId:getDefaultSessionId(),storageExpires:n,domain:REPORT_DOMAIN,plugins:{ajax:{ignoreUrls:DEFAULT_IGNORE_PATHS},fetch:{ignoreUrls:DEFAULT_IGNORE_PATHS},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1},release:"",env:"production",sample:__assign(__assign({},DEFAULT_SAMPLE_CONFIG),{r:e.r}),transport:getXhrTransport()}},createMinimalBrowserClient=function(e){var n=void 0===e?{}:e,r=n.createSender,e=n.builder,n=n.createDefaultConfig,t=createClient({validateInitConfig:validateInitConfig,initConfigNormalizer:normalizeInitConfig,userConfigNormalizer:normalizeUserConfig,createSender:void 0===r?function(e){return createBrowserSender({size:DEFAULT_SENDER_SIZE,endpoint:getReportUrl(e.domain),transport:e.transport})}:r,builder:void 0===e?browserBuilder:e,createDefaultConfig:void 0===n?getDefaultConfig:n,createConfigManager:createBrowserConfigManager});ContextPlugin(t);n=getGlobalRegistry(getDefaultBrowser());SubjectPlugin(t,n&&n.subject),TimeCalibrationPlugin(t),InjectConfigPlugin(t),InjectEnvPlugin(t),InjectNetworkTypePlugin(t),InjectQueryPlugin(t);n=withCommandArray(t,captureCurrentContext,function(e,n,r){return syncReportWithCapturedContext(e,n)(function(){var e=__read(r),n=e[0],e=e.slice(1);t[n].apply(t,__spreadArray([],__read(e),!1))})});return IntegrationPlugin(n),n};exports.createMinimalBrowserClient=createMinimalBrowserClient,exports.getDefaultConfig=getDefaultConfig;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var __assign=function(){return(__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function __rest(e,n){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)n.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(r[o[t]]=e[o[t]]);return r}function __read(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var t,o,i=r.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(t=i.next()).done;)a.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function __spreadArray(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||((t=t||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}var DEFAULT_SIZE=10,DEFAULT_WAIT=1e3,stringifyBatch=function(e){return JSON.stringify({ev_type:"batch",list:e})};function createBatchSender(e){var r,t=e.transport,o=e.endpoint,n=e.size,i=void 0===n?DEFAULT_SIZE:n,e=e.wait,a=void 0===e?DEFAULT_WAIT:e,u=[],s=0;function c(){var n;u.length&&(n=this.getBatchData(),t.post({url:o,data:n,fail:function(e){r&&r(e,n)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(e){i=e},setWait:function(e){a=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){u.push(e),u.length>=i&&c.call(this),clearTimeout(s),s=setTimeout(c.bind(this),a)},flush:function(){clearTimeout(s),c.call(this)},getBatchData:function(){return u.length?stringifyBatch(u):""},clear:function(){clearTimeout(s),u=[]},fail:function(e){r=e}}}var EVENTS=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],noop=function(){return{}};function isObject(e){return"object"==typeof e&&null!==e}var objProto=Object.prototype;function isPlainObject(e){if(isObject(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===objProto.toString.call(e);e=Object.getPrototypeOf(e);return e===objProto||null===e}return!1}function isArray(e){return"[object Array]"===objProto.toString.call(e)}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function hasKey(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function mergeDeepConcatArray(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r={},t=0;t<e.length;)r=_mergeDeepMergeArray(r,e[t++]);return r}function _mergeDeepMergeArray(e,n){var r,t=__assign({},e);for(r in n)hasKey(n,r)&&void 0!==n[r]&&(isObject(n[r])&&isPlainObject(n[r])?t[r]=_mergeDeepMergeArray(isObject(e[r])?e[r]:{},n[r]):isArray(n[r])&&isArray(e[r])?t[r]=_mergeDeepArray(e[r],n[r]):t[r]=n[r]);return t}function _mergeDeepArray(e,n){e=isArray(e)?e:[],n=isArray(n)?n:[];return Array.prototype.concat.call(e,n).map(function(e){return e instanceof RegExp?e:isObject(e)&&isPlainObject(e)?_mergeDeepMergeArray({},e):isArray(e)?_mergeDeepArray([],e):e})}function arrayIncludes(e,n){if(!isArray(e))return!1;if(0===e.length)return!1;for(var r=0;r<e.length;){if(e[r]===n)return!0;r++}return!1}var arrayRemove=function(e,n){if(!isArray(e))return e;var r=e.indexOf(n);if(0<=r){n=e.slice();return n.splice(r,1),n}return e},safeVisit=function(e,n,r){for(var t,n=__read(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(t=__read(i))[0],i=t.slice(1);if(e)return r(e,o)},safeCall=function(e,n,r){return safeVisit(e,n,function(e,n){if(e&&n in e&&isFunction(e[n]))try{return e[n].apply(e,r)}catch(e){return}})};function safeStringify(e){try{return isString(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}var joinQueryWithMap=function(r){return isObject(r)?Object.keys(r).reduce(function(e,n){return e+="&"+n+"="+r[n]},"").replace("&","?"):""};function createContextAgent(){var r={},t={},o={set:function(e,n){return r[e]=n,t[e]=safeStringify(n),o},merge:function(n){return r=__assign(__assign({},r),n),Object.keys(n).forEach(function(e){t[e]=safeStringify(n[e])}),o},delete:function(e){return delete r[e],delete t[e],o},clear:function(){return r={},t={},o},get:function(e){return t[e]},toString:function(){return __assign({},t)}};return o}var hookObjectProperty=function(i,a,u,s){return void 0===s&&(s=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return noop;var r=i[a],t=u.apply(void 0,__spreadArray([r],__read(e),!1)),o=t;return isFunction(o)&&s&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return t.apply(this,n)}catch(e){return isFunction(r)&&r.apply(this,n)}}),i[a]=o,function(e){e||(o===i[a]?i[a]=r:t=r)}}},errCount=0,error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,__spreadArray(["[SDK]",Date.now(),(""+errCount++).padStart(8," ")],__read(e),!1))},warnCount=0,warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,__spreadArray(["[SDK]",Date.now(),(""+warnCount++).padStart(8," ")],__read(e),!1))},runProcessors=function(t){return function(e){for(var n=e,r=0;r<t.length&&n;r++)try{n=t[r](n)}catch(e){error(e)}return n}};function mathRNG(){for(var e=new Array(16),n=0,r=0;r<16;r++)0==(3&r)&&(n=4294967296*Math.random()),e[r]=n>>>((3&r)<<3)&255;return e}function bytesToUuid(e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);var t=0,o=n;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[+t]],o[e[15]]].join("")}function uuid(){var e=mathRNG();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,bytesToUuid(e)}var BUFFER_TIME=3e5,applyBufferTimer=function(e,n,r){var t=0;return-1===r?noop:function(){if(e())return t&&clearTimeout(t),void(t=0);0===t&&(t=setTimeout(n,r))}},nextLink=function(t,e){var n=[];try{n=e.reduce(function(e,n){try{var r=n(t);"function"==typeof r&&e.push(r)}catch(e){}return e},[])}catch(e){}return function(e){return nextLink(e,n)}},toObservable=function(e){function n(e){t=arrayRemove(t,e),i||a()}var r,t=[],o=[],i=!1,a=applyBufferTimer(function(){return!!t.length},function(){i=!0,r&&r[0](),o.forEach(function(e){return e()}),o.length=0,r=void 0},e=void 0===e?BUFFER_TIME:e);return{next:function(e){return nextLink(e,t)},complete:function(e){o.push(e)},attach:function(e,n){r=[e,n]},subscribe:function(e){if(i)throw new Error("Observer is closed");return t.push(e),r&&r[1]&&r[1](e),a(),function(){return n(e)}},unsubscribe:n}},createSafeObserver=function(e,n,r){r=toObservable(r);try{e(r.next,r.attach),n&&r.complete(n)}catch(e){}return[r.subscribe,r.unsubscribe]};function createDestroyAgent(){function t(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){i[e]&&i[e].forEach(function(e){t(e[1])}),i[e]=void 0}var o=!1,i={};return{set:function(e,n,r){i[e]?i[e].push([n,r]):i[e]=[[n,r]],o&&t(r)},has:function(e){return!!i[e]},remove:n,removeByEvType:function(n){Object.keys(i).forEach(function(e){i[e]&&i[e].forEach(function(e){e[0]===n&&t(e[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(e){n(e)})}}}function createClient(e){var r,t,n=e.builder,o=e.createSender,i=e.createDefaultConfig,a=e.createConfigManager,u=e.userConfigNormalizer,s=e.initConfigNormalizer,c=e.validateInitConfig,f={};EVENTS.forEach(function(e){return f[e]=[]});var l=!1,g=!1,d=!1,p=[],_=[],v=createDestroyAgent(),y={getBuilder:function(){return n},getSender:function(){return r},getPreStartQueue:function(){return p},init:function(e){if(l)warn("already inited");else{if(!(e&&isObject(e)&&c(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=s(e);if((t=a(n)).setConfig(e),t.onChange(function(){h("config")}),!(r=o(t.getConfig())))throw new Error("sender missing");h("init",l=!0)}},set:function(e){l&&e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(e))},config:function(e){if(l)return e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(u(e))),null==t?void 0:t.getConfig()},provide:function(e,n){arrayIncludes(_,e)?warn("cannot provide "+e+", reserved"):(y[e]=n,h("provide",!1,e))},start:function(){var n=this;l&&(g||null!=t&&t.onReady(function(){h("start",g=!0),p.forEach(function(e){return n.build(e)}),p.length=0}))},report:function(e){e&&(!(e=runProcessors(f.beforeReport)(e))||(e=runProcessors(f.report)(e))&&(g?this.build(e):p.push(e)))},build:function(e){!g||(e=runProcessors(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=runProcessors(f.build)(e))&&this.send(e))},send:function(e){!g||(e=runProcessors(f.beforeSend)(e))&&(r.send(e),h("send",!1,e))},destroy:function(){v.clear(),d=!0,h("beforeDestroy",!(p.length=0))},on:function(e,n){"init"===e&&l||"start"===e&&g||"beforeDestroy"===e&&d?n():f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=arrayRemove(f[e],n))},destroyAgent:v},_=Object.keys(y);return y;function h(e,n){void 0===n&&(n=!1);for(var r=[],t=2;t<arguments.length;t++)r[t-2]=arguments[t];f[e].forEach(function(e){try{e.apply(void 0,__spreadArray([],__read(r),!1))}catch(e){}}),n&&(f[e].length=0)}}var ContextPlugin=function(e){var n=createContextAgent();e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})},withCommandArray=function(i,a,r){function u(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(o=e[0]){var r=o.split(".")[0];if(r in u)return safeCall(u,o,[].slice.call(e,1));var t=s[r]||[],o=null!==(o=null==a?void 0:a(i))&&void 0!==o?o:{};t.push(__spreadArray([o],__read(e),!1)),void(s[r]=t)}}var e,s={};for(e in hookObjectProperty(i,"provide",function(r){return function(e,n){u[e]=n,r.call(i,e,n)}})(),i)Object.prototype.hasOwnProperty.call(i,e)&&(u[e]=i[e]);return i.on("provide",function(e){s[e]&&(s[e].forEach(function(e){var n=__read(e),e=n[0],n=n.slice(1);null!=r&&r(i,e,n)}),s[e]=null)}),u};function IntegrationPlugin(t,o){t.on("init",function(){var r=[],e=t.config();e&&e.integrations&&e.integrations.forEach(function(e){var n=e.name;arrayIncludes(r,n)||(r.push(n),e.setup(t),o&&o(n,e.setup),e.tearDown&&t.destroyAgent.set(n,n,[e.tearDown]))})})}function SubjectPlugin(e,n){var r=n||{};e.provide("initSubject",function(e){var e=__read(e,2),n=e[0],e=e[1];return r[n]||(r[n]=createSafeObserver(e,function(){r[n]=void 0})),r[n]}),e.provide("getSubject",function(e){return r[e]}),e.provide("privateSubject",{})}var now=function(){return Date.now()};function getDefaultBrowser(){if("object"==typeof window&&isObject(window))return window}function getDefaultLocation(){return getDefaultBrowser()&&window.location}function getDefaultXMLHttpRequest(){if("function"==typeof XMLHttpRequest&&isFunction(XMLHttpRequest))return XMLHttpRequest}function getDefaultNavigator(){if(getDefaultBrowser()&&"navigator"in window)return window.navigator}function getDefaultNetworkInformation(){var e=getDefaultNavigator();if(e)return e.connection||e.mozConnection||e.webkitConnection}function getLocationUrl(){var e=getDefaultBrowser()&&getDefaultLocation();return null==e?void 0:e.href}var getGlobalRegistry=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar},captureCurrentContext=function(e){var n={url:getLocationUrl(),timestamp:now()},r=e.config();return null!=r&&r.pid&&(n.pid=r.pid),null!=e&&e.context&&(n.context=e.context.toString()),n},syncReportWithCapturedContext=function(r,t){return function(e){function n(e){return e.overrides=t,e}r.on("report",n),e(),r.off("report",n)}},invokeCallbackOnce=function(n){var r=!1;return[function(e){r||(r=!0,n&&n(e))}]},onPageUnload=function(e){var n,r=getDefaultBrowser();r&&(n=__read(invokeCallbackOnce(e),1)[0],["unload","beforeunload","pagehide"].forEach(function(e){r.addEventListener(e,n)}))},isSupportEncrypt=function(){return!!btoa&&!!atob};function encodeToBase64(e){return isSupportEncrypt()?btoa(encodeURI(e)):e}function decodeWithBase64(e){return isSupportEncrypt()?decodeURI(atob(e)):e}var getStorageWithDecoding=function(e){try{var n=localStorage.getItem(e),r=n,t=r=n&&"string"==typeof n?JSON.parse(decodeWithBase64(n)):r,o=t.expires,i=__rest(t,["expires"]);return o>=now()?i:void 0}catch(e){return}},setStorageWithEncoding=function(e,n,r){if(!(r<=0))try{localStorage.setItem(e,encodeToBase64(JSON.stringify(__assign(__assign({},n),{expires:now()+r}))))}catch(e){}},DEFAULT_STORAGE_EXPIRES=7776e6,formatStorageExpires=function(e){return!1===e?0:!0!==e&&void 0!==e&&isNumber(e)?e:DEFAULT_STORAGE_EXPIRES};function getNetworkType(e){return(null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||""}var InjectNetworkTypePlugin=function(e){var n=getDefaultNetworkInformation(),r=getNetworkType(n);n&&(n.onchange=function(){r=getNetworkType(n)}),e.on("report",function(e){return __assign(__assign({},e),{extra:__assign(__assign({},e.extra||{}),{network_type:r})})})},getBeaconTransport=function(){var r=getDefaultBrowser();return r&&r.navigator.sendBeacon?{get:function(){},post:function(e,n){r.navigator.sendBeacon(e,n)}}:{get:noop,post:noop}},request=function(e,n,r){var t=n.url,o=n.data,i=n.success,a=void 0===i?noop:i,i=n.fail,u=void 0===i?noop:i,i=n.getResponseText,s=void 0===i?noop:i,n=n.withCredentials,n=void 0!==n&&n,r=new r;r.withCredentials=n,r.open(e,t,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){null!=s&&s(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),a(e)):a({})}catch(e){u(e)}},r.onerror=function(){u(new Error("Network request failed"))},r.onabort=function(){u(new Error("Network request aborted"))},r.send(o)},getXhrTransport=function(){var n=getDefaultXMLHttpRequest();return n?{get:function(e){request("GET",e,n)},post:function(e){request("POST",e,n)}}:{get:noop,post:noop}};function createBrowserSender(e){function n(e){t.post(r.getEndpoint(),stringifyBatch([e]))}var r=createBatchSender(e),t=getBeaconTransport();return onPageUnload(function(){var e=r.getBatchData();e&&(t.post(r.getEndpoint(),e),r.clear()),r.send=n}),r}var browserBuilder={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:__assign(__assign({},e.extra||{}),e.overrides||{})}}};function normalizeInitConfig(e){var n,r=e.plugins||{};for(n in r)r[n]&&!isObject(r[n])&&(r[n]={});return __assign(__assign({},e),{plugins:r})}function validateInitConfig(e){return isObject(e)&&"aid"in e}function normalizeUserConfig(e){return __assign({},e)}function parseServerConfig(e){if(!e)return{};var n=e.sample,r=e.timestamp,t=e.status;if(!n)return{};var o=n.sample_rate,e=n.sample_granularity;return{sample:{include_users:n.include_users,sample_rate:t&&4===t?0:o,sample_granularity:e,rules:n.rules.reduce(function(e,n){var r=n.name,t=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[r]={enable:t,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r}}var REPORT_DOMAIN="apmplus.volces.com",SDK_VERSION="2.3.0-alpha.0",SDK_NAME="APM_PLUS_WEB",SETTINGS_PATH="/settings/get/webpro",BATCH_REPORT_PATH="/monitor_web/collect",STORAGE_PREFIX="APMPLUS",DEFAULT_IGNORE_PATHS=[BATCH_REPORT_PATH,SETTINGS_PATH,"/monitor_browser/collect"],DEFAULT_SAMPLE_CONFIG={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},DEFAULT_SENDER_SIZE=20,getReportUrl=function(e,n){return void 0===n&&(n=BATCH_REPORT_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getSettingsUrl=function(e,n){return void 0===n&&(n=SETTINGS_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getViewId=function(e){return e+"_"+Date.now()},getDefaultSessionId=function(){return uuid()},getStorageKey=function(e){return STORAGE_PREFIX+e},glueCodeForStorageSecurity=function(e,n){var r=localStorage.getItem(e);if(r&&isSupportEncrypt()&&"{"===r[0])try{setStorageWithEncoding(e,JSON.parse(r),n)}catch(e){}},getStoreInfo=function(e,n){void 0===e&&(e=0);var r={userId:uuid(),deviceId:uuid(),r:Math.random()};if(n<=0)return r;e=getStorageKey(e);return glueCodeForStorageSecurity(e,n),getStorageWithDecoding(e)||r},saveStoreInfo=function(e){var n=e.aid,r=e.userId,t=e.deviceId,o=e.sample,e=e.storageExpires,n=getStorageKey(n);setStorageWithEncoding(n,{userId:r,deviceId:t,r:o.r},formatStorageExpires(e))},createBrowserConfigManager=function(n){var r,t,o,i=n,a={},u=noop,s=noop;return{getConfig:function(){return i},setConfig:function(e){return a=__assign(__assign({},a),e||{}),c(),r||(r=e,i.useLocalConfig?(o={},u()):t?f():getServerConfig(i.transport,i.domain,i.aid,function(e){t=e,f()})),i},onChange:function(e){s=e},onReady:function(e){u=function(){!function(){n.userId!==i.userId&&(n.sample.r=Math.random(),c());saveStoreInfo(i)}(),e()},o&&u()}};function c(){var e=__assign(__assign(__assign({},n),o||{}),a);e.plugins=mergeDeepConcatArray(n.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),e.sample=mergeSampleConfig(mergeSampleConfig(n.sample,null==o?void 0:o.sample),a.sample),i=e,s()}function f(){o=parseServerConfig(t),c(),u()}};function getServerConfig(e,n,r,t){e.get({withCredentials:!0,url:getSettingsUrl(n)+"?aid="+r,success:function(e){t(e.data||{})},fail:function(){t()}})}function mergeSampleConfig(t,o){if(!t||!o)return t||o;var e=__assign(__assign({},t),o);return e.include_users=__spreadArray(__spreadArray([],__read(t.include_users||[]),!1),__read(o.include_users||[]),!1),e.rules=__spreadArray(__spreadArray([],__read(Object.keys(t.rules||{})),!1),__read(Object.keys(o.rules||{})),!1).reduce(function(e,n){var r;return n in e||(n in(t.rules||{})&&n in(o.rules||{})?(e[n]=__assign(__assign({},t.rules[n]),o.rules[n]),e[n].conditional_sample_rules=__spreadArray(__spreadArray([],__read(t.rules[n].conditional_sample_rules||[]),!1),__read(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(r=t.rules)||void 0===r?void 0:r[n])||(null===(r=o.rules)||void 0===r?void 0:r[n])),e},{}),e}function getPluginFromRegistry(e,n){return e.plugins.filter(function(e){return e.name===n&&e.version===SDK_VERSION})[0]}function register(e,n,r){(r=void 0===r?getGlobalRegistry(getDefaultBrowser()):r)&&r.plugins&&(getPluginFromRegistry(r,e)||r.plugins.push({name:e,version:SDK_VERSION,apply:n}))}var addEnvToSendEvent=function(e){var n={url:getLocationUrl(),timestamp:Date.now()};return __assign(__assign({},e),{extra:__assign(__assign({},n),e.extra||{})})},InjectEnvPlugin=function(e){e.on("report",function(e){return addEnvToSendEvent(e)})},MAX_RTT=700,TimeCalibrationPlugin=function(r){var t,o=!1;r.on("init",function(){t=(new Date).getTime(),r.on("config",function(){var e,n=null===(e=r.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=(new Date).getTime())-t<MAX_RTT&&n&&(e=n-(e+t)/2,!isNaN(e)&&(0<e||e<-6e5)&&r.set({offset:e})))})})},addConfigToReportEvent=function(e,n){var r={};return r.aid=n.aid,r.pid=n.pid,r.view_id=n.viewId,r.user_id=n.userId,__assign(__assign({},e),{extra:__assign(__assign({},r),e.extra||{})})},InjectConfigPlugin=function(n){n.on("beforeBuild",function(e){return addConfigToReportEvent(e,n.config())})},InjectQueryPlugin=function(u){u.on("start",function(){var e=u.config(),n=e.deviceId,r=e.sessionId,t=e.release,o=e.env,i=e.offset,a=e.aid,e=e.token,a={did:n,sid:r,release:t,env:o,sname:SDK_NAME,sversion:SDK_VERSION,soffset:i||0,biz_id:a,x_auth_token:e},e=u.getSender();e.setEndpoint(e.getEndpoint()+joinQueryWithMap(a))})},getDefaultConfig=function(e){var n=formatStorageExpires(e.storageExpires),e=getStoreInfo(e.aid,n);return{aid:0,pid:"",token:"",viewId:getViewId("_"),userId:e.userId,deviceId:e.deviceId,sessionId:getDefaultSessionId(),storageExpires:n,domain:REPORT_DOMAIN,plugins:{ajax:{ignoreUrls:DEFAULT_IGNORE_PATHS},fetch:{ignoreUrls:DEFAULT_IGNORE_PATHS},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1},release:"",env:"production",sample:__assign(__assign({},DEFAULT_SAMPLE_CONFIG),{r:e.r}),transport:getXhrTransport()}},createMinimalBrowserClient=function(e){var n=void 0===e?{}:e,r=n.createSender,e=n.builder,n=n.createDefaultConfig,t=createClient({validateInitConfig:validateInitConfig,initConfigNormalizer:normalizeInitConfig,userConfigNormalizer:normalizeUserConfig,createSender:void 0===r?function(e){return createBrowserSender({size:DEFAULT_SENDER_SIZE,endpoint:getReportUrl(e.domain),transport:e.transport})}:r,builder:void 0===e?browserBuilder:e,createDefaultConfig:void 0===n?getDefaultConfig:n,createConfigManager:createBrowserConfigManager});ContextPlugin(t);n=getGlobalRegistry(getDefaultBrowser());SubjectPlugin(t,n&&n.subject),TimeCalibrationPlugin(t),InjectConfigPlugin(t),InjectEnvPlugin(t),InjectNetworkTypePlugin(t),InjectQueryPlugin(t);n=withCommandArray(t,captureCurrentContext,function(e,n,r){return syncReportWithCapturedContext(e,n)(function(){var e=__read(r),n=e[0],e=e.slice(1);t[n].apply(t,__spreadArray([],__read(e),!1))})});return IntegrationPlugin(n,register),n};exports.createMinimalBrowserClient=createMinimalBrowserClient,exports.getDefaultConfig=getDefaultConfig;

@@ -17,2 +17,3 @@ interface ContextAgent {

set: (pluginName: string, evType: string, tearDownGroup: (() => void)[]) => void;
has: (pluginName: string) => boolean;
remove: (k: string) => void;

@@ -22,2 +23,9 @@ removeByEvType: (k: string) => void;

}
declare type WithCommandDestroy<C extends AnyClient> = C & {
'destroyAgent.set': DestroyAgent['set'];
'destroyAgent.has': DestroyAgent['has'];
'destroyAgent.remove': DestroyAgent['remove'];
'destroyAgent.removeByEvType': DestroyAgent['removeByEvType'];
'destroyAgent.clear': DestroyAgent['clear'];
};

@@ -147,4 +155,4 @@ declare type ReportEventFromClient<C extends AnyClient> = C extends {

declare type WithCommandArray<C extends AnyClient> = C & GetCommandFunction<C>;
declare type PropertyToFunction<C extends Record<string, any>, P extends keyof C> = P extends infer K ? K extends keyof C ? C[K] extends (...args: any) => any ? (m: K, ...args: Parameters<C[K]>) => ReturnType<C[K]> : C[K] extends ((...args: any) => any) | undefined ? (m: K, ...args: Parameters<NonNullable<C[K]>>) => ReturnType<NonNullable<C[K]>> | undefined : (m: K) => C[K] : never : never;
declare type WithCommandArray<C extends AnyClient, ExcludeKeys extends keyof AnyClient | string = ''> = C & GetCommandFunction<C, ExcludeKeys>;
declare type PropertyToFunction<C extends Record<string, any>, P extends keyof C> = P extends infer K ? K extends keyof C ? C[K] extends ((...args: any) => any) | undefined ? <K extends keyof C>(m: K, ...args: Parameters<NonNullable<C[K]>>) => ReturnType<NonNullable<C[K]>> | undefined : (m: K) => C[K] : never : never;
declare type Event<C extends AnyClient> = ClientEvent<ReportEventFromClient<C>, SendEventFromClient<C>, any>;

@@ -154,3 +162,3 @@ declare type EventToOnFunctions<Event extends ClientEvent<any, any, any>, T extends keyof Event> = T extends infer K ? K extends keyof Event ? (m: 'on', ev: K, handler: Event[K]) => void : never : never;

declare type EventFunctions<C extends AnyClient> = EventToOnFunctions<Event<C>, keyof Event<C>> | EventToOffFunctions<Event<C>, keyof Event<C>>;
declare type GetCommandFunction<C extends AnyClient> = Function & UnionToIntersection<PropertyToFunction<C, Exclude<keyof C, 'on' | 'off'>> | EventFunctions<C>>;
declare type GetCommandFunction<C extends AnyClient, ExcludeKeys extends keyof AnyClient | string = ''> = Function & UnionToIntersection<PropertyToFunction<Omit<C, 'on' | 'off' | ExcludeKeys>, Exclude<keyof C, 'on' | 'off' | ExcludeKeys>> | EventFunctions<C>>;

@@ -217,2 +225,3 @@ interface Integration<T extends AnyClient> {

declare type PluginsConfig = AjaxMonitorPluginConfig & BreadcrumbMonitorPluginConfig & FMPMonitorPluginConfig & FetchMonitorPluginConfig & JsErrorMonitorPluginConfig & PerformanceMonitorPluginConfig & ResourceErrorMonitorPluginConfig & ResourceMonitorPluginConfig & TTIMonitorPluginConfig & PageviewMonitorPluginConfig & BlankScreenMonitorPluginConfig & ActionMonitorPluginConfig & HeatmapMonitorPluginConfig;
declare type WebConfig = {

@@ -225,3 +234,3 @@ pid: string;

actionId?: string;
plugins: AjaxMonitorPluginConfig & BreadcrumbMonitorPluginConfig & FMPMonitorPluginConfig & FetchMonitorPluginConfig & JsErrorMonitorPluginConfig & PerformanceMonitorPluginConfig & ResourceErrorMonitorPluginConfig & ResourceMonitorPluginConfig & TTIMonitorPluginConfig & PageviewMonitorPluginConfig & BlankScreenMonitorPluginConfig & ActionMonitorPluginConfig & HeatmapMonitorPluginConfig;
plugins: PluginsConfig;
sample?: SampleConfig;

@@ -932,2 +941,11 @@ heatmap?: any;

declare type PluginKeys = keyof PluginsConfig;
declare type ReloadPluginType = <T extends PluginKeys | string>(pluginName: T, pluginConfig?: T extends PluginKeys ? PluginsConfig[T] : any) => void;
declare type WithReloadPlugin<C extends AnyClient> = C & {
reloadPlugin?: ReloadPluginType;
};
declare type WithCommandReloadPlugin<C extends AnyClient> = C & {
<T extends PluginKeys | string, M extends 'reloadPlugin'>(m: M, pluginName: T, pluginConfig?: T extends keyof PluginsConfig ? PluginsConfig[T] : any): void;
};
declare type BrowserSender = BatchSender<WebSendEvent>;

@@ -1034,3 +1052,3 @@

declare type PrecollectArg = [string, string, PrecollectData, number, string];
declare type BrowserClient = WithDetectBlankScreen<WithBreadcrumb<WithReportResourceError<WithSendPerformance<WithCaptureException<WithSendCustom<WithSendPageview<WithContext<WithSubject<Client<BrowserReportEvent, BrowserSendEvent, BrowserBuilder, BrowserSender, BrowserInitConfig, BrowserUserConfig, BrowserConfig>>>>>>>>>> & LoadableTarget & {
declare type BrowserClient = WithReloadPlugin<WithDetectBlankScreen<WithBreadcrumb<WithReportResourceError<WithSendPerformance<WithCaptureException<WithSendCustom<WithSendPageview<WithContext<WithSubject<Client<BrowserReportEvent, BrowserSendEvent, BrowserBuilder, BrowserSender, BrowserInitConfig, BrowserUserConfig, BrowserConfig>>>>>>>>>>> & {
q?: any[];

@@ -1044,6 +1062,4 @@ p?: {

};
declare type BrowserCommandClient = WithPrecollect<WithCommandArray<WithCommandContext<BrowserClient>>>;
declare type LoadableTarget = {
loaded: string[];
loading: string[];
declare type BrowserCommandClient = WithCommandReloadPlugin<WithPrecollect<WithCommandArray<WithCommandDestroy<WithCommandContext<BrowserClient>>, 'reloadPlugin'>>> & {
create?: (config?: CreateBrowserClientConfig) => BrowserCommandClient;
};

@@ -1099,4 +1115,4 @@

}
declare const createMinimalBrowserClient: ({ createSender, builder, createDefaultConfig, }?: CreateBrowserClientConfig) => WithCommandArray<WithCommandContext<BrowserClient>>;
declare const createMinimalBrowserClient: ({ createSender, builder, createDefaultConfig, }?: CreateBrowserClientConfig) => WithCommandArray<WithCommandDestroy<WithCommandContext<BrowserClient>>, "">;
export { CreateBrowserClientConfig, createMinimalBrowserClient, getDefaultConfig };

@@ -1,1 +0,1 @@

var __assign=function(){return(__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function __rest(e,n){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)n.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(r[o[t]]=e[o[t]]);return r}function __read(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var t,o,i=r.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(t=i.next()).done;)a.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function __spreadArray(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||((t=t||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}var DEFAULT_SIZE=10,DEFAULT_WAIT=1e3,stringifyBatch=function(e){return JSON.stringify({ev_type:"batch",list:e})};function createBatchSender(e){var r,t=e.transport,o=e.endpoint,n=e.size,i=void 0===n?DEFAULT_SIZE:n,e=e.wait,a=void 0===e?DEFAULT_WAIT:e,u=[],c=0;function s(){var n;u.length&&(n=this.getBatchData(),t.post({url:o,data:n,fail:function(e){r&&r(e,n)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(e){i=e},setWait:function(e){a=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){u.push(e),u.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),a)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return u.length?stringifyBatch(u):""},clear:function(){clearTimeout(c),u=[]},fail:function(e){r=e}}}var EVENTS=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],noop=function(){return{}};function isObject(e){return"object"==typeof e&&null!==e}var objProto=Object.prototype;function isPlainObject(e){if(isObject(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===objProto.toString.call(e);e=Object.getPrototypeOf(e);return e===objProto||null===e}return!1}function isArray(e){return"[object Array]"===objProto.toString.call(e)}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function hasKey(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function mergeDeepConcatArray(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r={},t=0;t<e.length;)r=_mergeDeepMergeArray(r,e[t++]);return r}function _mergeDeepMergeArray(e,n){var r,t=__assign({},e);for(r in n)hasKey(n,r)&&void 0!==n[r]&&(isObject(n[r])&&isPlainObject(n[r])?t[r]=_mergeDeepMergeArray(isObject(e[r])?e[r]:{},n[r]):isArray(n[r])&&isArray(e[r])?t[r]=_mergeDeepArray(e[r],n[r]):t[r]=n[r]);return t}function _mergeDeepArray(e,n){e=isArray(e)?e:[],n=isArray(n)?n:[];return Array.prototype.concat.call(e,n).map(function(e){return e instanceof RegExp?e:isObject(e)&&isPlainObject(e)?_mergeDeepMergeArray({},e):isArray(e)?_mergeDeepArray([],e):e})}function arrayIncludes(e,n){if(!isArray(e))return!1;if(0===e.length)return!1;for(var r=0;r<e.length;){if(e[r]===n)return!0;r++}return!1}var arrayRemove=function(e,n){if(!isArray(e))return e;var r=e.indexOf(n);if(0<=r){n=e.slice();return n.splice(r,1),n}return e},safeVisit=function(e,n,r){for(var t,n=__read(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(t=__read(i))[0],i=t.slice(1);if(e)return r(e,o)},safeCall=function(e,n,r){return safeVisit(e,n,function(e,n){if(e&&n in e&&isFunction(e[n]))try{return e[n].apply(e,r)}catch(e){return}})};function safeStringify(e){try{return isString(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}var joinQueryWithMap=function(r){return isObject(r)?Object.keys(r).reduce(function(e,n){return e+="&"+n+"="+r[n]},"").replace("&","?"):""};function createContextAgent(){var r={},t={},o={set:function(e,n){return r[e]=n,t[e]=safeStringify(n),o},merge:function(n){return r=__assign(__assign({},r),n),Object.keys(n).forEach(function(e){t[e]=safeStringify(n[e])}),o},delete:function(e){return delete r[e],delete t[e],o},clear:function(){return r={},t={},o},get:function(e){return t[e]},toString:function(){return __assign({},t)}};return o}var hookObjectProperty=function(i,a,u,c){return void 0===c&&(c=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return noop;var r=i[a],t=u.apply(void 0,__spreadArray([r],__read(e),!1)),o=t;return isFunction(o)&&c&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return t.apply(this,n)}catch(e){return isFunction(r)&&r.apply(this,n)}}),i[a]=o,function(e){e||(o===i[a]?i[a]=r:t=r)}}},errCount=0,error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,__spreadArray(["[SDK]",Date.now(),(""+errCount++).padStart(8," ")],__read(e),!1))},warnCount=0,warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,__spreadArray(["[SDK]",Date.now(),(""+warnCount++).padStart(8," ")],__read(e),!1))},runProcessors=function(t){return function(e){for(var n=e,r=0;r<t.length&&n;r++)try{n=t[r](n)}catch(e){error(e)}return n}};function mathRNG(){for(var e=new Array(16),n=0,r=0;r<16;r++)0==(3&r)&&(n=4294967296*Math.random()),e[r]=n>>>((3&r)<<3)&255;return e}function bytesToUuid(e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);var t=0,o=n;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[+t]],o[e[15]]].join("")}function uuid(){var e=mathRNG();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,bytesToUuid(e)}var BUFFER_TIME=3e5,applyBufferTimer=function(e,n,r){var t=0;return-1===r?noop:function(){if(e())return t&&clearTimeout(t),void(t=0);0===t&&(t=setTimeout(n,r))}},nextLink=function(t,e){var n=[];try{n=e.reduce(function(e,n){try{var r=n(t);"function"==typeof r&&e.push(r)}catch(e){}return e},[])}catch(e){}return function(e){return nextLink(e,n)}},toObservable=function(e){function n(e){t=arrayRemove(t,e),i||a()}var r,t=[],o=[],i=!1,a=applyBufferTimer(function(){return!!t.length},function(){i=!0,r&&r[0](),o.forEach(function(e){return e()}),o.length=0,r=void 0},e=void 0===e?BUFFER_TIME:e);return{next:function(e){return nextLink(e,t)},complete:function(e){o.push(e)},attach:function(e,n){r=[e,n]},subscribe:function(e){if(i)throw new Error("Observer is closed");return t.push(e),r&&r[1]&&r[1](e),a(),function(){return n(e)}},unsubscribe:n}},createSafeObserver=function(e,n,r){r=toObservable(r);try{e(r.next,r.attach),n&&r.complete(n)}catch(e){}return[r.subscribe,r.unsubscribe]};function createDestroyAgent(){function r(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){t[e]&&t[e].forEach(function(e){r(e[1])}),t[e]=void 0}var t={};return{set:function(e,n,r){t[e]?t[e].push([n,r]):t[e]=[[n,r]]},remove:n,removeByEvType:function(n){Object.keys(t).forEach(function(e){t[e]&&t[e].forEach(function(e){e[0]===n&&r(e[1])})})},clear:function(){Object.keys(t).forEach(function(e){n(e)})}}}function createClient(e){var r,t,n=e.builder,o=e.createSender,i=e.createDefaultConfig,a=e.createConfigManager,u=e.userConfigNormalizer,c=e.initConfigNormalizer,s=e.validateInitConfig,f={};EVENTS.forEach(function(e){return f[e]=[]});var l=!1,g=!1,d=!1,p=[],_=[],v=createDestroyAgent(),y={getBuilder:function(){return n},getSender:function(){return r},getPreStartQueue:function(){return p},init:function(e){if(l)warn("already inited");else{if(!(e&&isObject(e)&&s(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=c(e);if((t=a(n)).setConfig(e),t.onChange(function(){h("config")}),!(r=o(t.getConfig())))throw new Error("sender missing");h("init",l=!0)}},set:function(e){l&&e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(e))},config:function(e){if(l)return e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(u(e))),null==t?void 0:t.getConfig()},provide:function(e,n){arrayIncludes(_,e)?warn("cannot provide "+e+", reserved"):(y[e]=n,h("provide",!1,e))},start:function(){var n=this;l&&(g||null!=t&&t.onReady(function(){h("start",g=!0),p.forEach(function(e){return n.build(e)}),p=[]}))},report:function(e){e&&(!(e=runProcessors(f.beforeReport)(e))||(e=runProcessors(f.report)(e))&&(g?this.build(e):p.push(e)))},build:function(e){!g||(e=runProcessors(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=runProcessors(f.build)(e))&&this.send(e))},send:function(e){!g||(e=runProcessors(f.beforeSend)(e))&&(r.send(e),h("send",!1,e))},destroy:function(){v.clear(),h("beforeDestroy",d=!0)},on:function(e,n){"init"===e&&l||"start"===e&&g||"beforeDestroy"===e&&d?n():f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=arrayRemove(f[e],n))},destroyAgent:v},_=Object.keys(y);return y;function h(e,n){void 0===n&&(n=!1);for(var r=[],t=2;t<arguments.length;t++)r[t-2]=arguments[t];f[e].forEach(function(e){try{e.apply(void 0,__spreadArray([],__read(r),!1))}catch(e){}}),n&&(f[e].length=0)}}var ContextPlugin=function(e){var n=createContextAgent();e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})},withCommandArray=function(i,a,r){function u(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(o=e[0]){var r=o.split(".")[0];if(r in u)return safeCall(u,o,[].slice.call(e,1));var t=c[r]||[],o=null!==(o=null==a?void 0:a(i))&&void 0!==o?o:{};t.push(__spreadArray([o],__read(e),!1)),void(c[r]=t)}}var e,c={};for(e in hookObjectProperty(i,"provide",function(r){return function(e,n){u[e]=n,r.call(i,e,n)}})(),i)Object.prototype.hasOwnProperty.call(i,e)&&(u[e]=i[e]);return i.on("provide",function(e){c[e]&&(c[e].forEach(function(e){var n=__read(e),e=n[0],n=n.slice(1);null!=r&&r(i,e,n)}),c[e]=null)}),u};function IntegrationPlugin(r){r.on("init",function(){var n=[],e=r.config();e&&e.integrations&&e.integrations.forEach(function(e){arrayIncludes(n,e.name)||(n.push(e.name),e.setup(r),e.tearDown&&r.on("beforeDestroy",e.tearDown))})})}function SubjectPlugin(e,n){var r=n||{};e.provide("initSubject",function(e){var e=__read(e,2),n=e[0],e=e[1];return r[n]||(r[n]=createSafeObserver(e,function(){r[n]=void 0})),r[n]}),e.provide("getSubject",function(e){return r[e]}),e.provide("privateSubject",{})}var now=function(){return Date.now()};function getDefaultBrowser(){if("object"==typeof window&&isObject(window))return window}function getDefaultLocation(){return getDefaultBrowser()&&window.location}function getDefaultXMLHttpRequest(){if("function"==typeof XMLHttpRequest&&isFunction(XMLHttpRequest))return XMLHttpRequest}function getDefaultNavigator(){if(getDefaultBrowser()&&"navigator"in window)return window.navigator}function getDefaultNetworkInformation(){var e=getDefaultNavigator();if(e)return e.connection||e.mozConnection||e.webkitConnection}function getLocationUrl(){var e=getDefaultBrowser()&&getDefaultLocation();return null==e?void 0:e.href}var getGlobalRegistry=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar},captureCurrentContext=function(e){var n={url:getLocationUrl(),timestamp:now()},r=e.config();return null!=r&&r.pid&&(n.pid=r.pid),null!=e&&e.context&&(n.context=e.context.toString()),n},syncReportWithCapturedContext=function(r,t){return function(e){function n(e){return e.overrides=t,e}r.on("report",n),e(),r.off("report",n)}},invokeCallbackOnce=function(n){var r=!1;return[function(e){r||(r=!0,n&&n(e))}]},onPageUnload=function(e){var n,r=getDefaultBrowser();r&&(n=__read(invokeCallbackOnce(e),1)[0],["unload","beforeunload","pagehide"].forEach(function(e){r.addEventListener(e,n)}))},isSupportEncrypt=function(){return!!btoa&&!!atob};function encodeToBase64(e){return isSupportEncrypt()?btoa(encodeURI(e)):e}function decodeWithBase64(e){return isSupportEncrypt()?decodeURI(atob(e)):e}var getStorageWithDecoding=function(e){try{var n=localStorage.getItem(e),r=n,t=r=n&&"string"==typeof n?JSON.parse(decodeWithBase64(n)):r,o=t.expires,i=__rest(t,["expires"]);return o>=now()?i:void 0}catch(e){return}},setStorageWithEncoding=function(e,n,r){if(!(r<=0))try{localStorage.setItem(e,encodeToBase64(JSON.stringify(__assign(__assign({},n),{expires:now()+r}))))}catch(e){}},DEFAULT_STORAGE_EXPIRES=7776e6,formatStorageExpires=function(e){return!1===e?0:!0!==e&&void 0!==e&&isNumber(e)?e:DEFAULT_STORAGE_EXPIRES};function getNetworkType(e){return(null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||""}var InjectNetworkTypePlugin=function(e){var n=getDefaultNetworkInformation(),r=getNetworkType(n);n&&(n.onchange=function(){r=getNetworkType(n)}),e.on("report",function(e){return __assign(__assign({},e),{extra:__assign(__assign({},e.extra||{}),{network_type:r})})})},getBeaconTransport=function(){var r=getDefaultBrowser();return r&&r.navigator.sendBeacon?{get:function(){},post:function(e,n){r.navigator.sendBeacon(e,n)}}:{get:noop,post:noop}},request=function(e,n,r){var t=n.url,o=n.data,i=n.success,a=void 0===i?noop:i,i=n.fail,u=void 0===i?noop:i,i=n.getResponseText,c=void 0===i?noop:i,n=n.withCredentials,n=void 0!==n&&n,r=new r;r.withCredentials=n,r.open(e,t,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){null!=c&&c(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),a(e)):a({})}catch(e){u(e)}},r.onerror=function(){u(new Error("Network request failed"))},r.onabort=function(){u(new Error("Network request aborted"))},r.send(o)},getXhrTransport=function(){var n=getDefaultXMLHttpRequest();return n?{get:function(e){request("GET",e,n)},post:function(e){request("POST",e,n)}}:{get:noop,post:noop}};function createBrowserSender(e){function n(e){t.post(r.getEndpoint(),stringifyBatch([e]))}var r=createBatchSender(e),t=getBeaconTransport();return onPageUnload(function(){var e=r.getBatchData();e&&(t.post(r.getEndpoint(),e),r.clear()),r.send=n}),r}var browserBuilder={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:__assign(__assign({},e.extra||{}),e.overrides||{})}}};function normalizeInitConfig(e){var n,r=e.plugins||{};for(n in r)r[n]&&!isObject(r[n])&&(r[n]={});return __assign(__assign({},e),{plugins:r})}function validateInitConfig(e){return isObject(e)&&"aid"in e}function normalizeUserConfig(e){return __assign({},e)}function parseServerConfig(e){if(!e)return{};var n=e.sample,r=e.timestamp,t=e.status;if(!n)return{};var o=n.sample_rate,e=n.sample_granularity;return{sample:{include_users:n.include_users,sample_rate:t&&4===t?0:o,sample_granularity:e,rules:n.rules.reduce(function(e,n){var r=n.name,t=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[r]={enable:t,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r}}var REPORT_DOMAIN="apmplus.volces.com",SDK_VERSION="2.2.0",SDK_NAME="APM_PLUS_WEB",SETTINGS_PATH="/settings/get/webpro",BATCH_REPORT_PATH="/monitor_web/collect",STORAGE_PREFIX="APMPLUS",DEFAULT_IGNORE_PATHS=[BATCH_REPORT_PATH,SETTINGS_PATH,"/monitor_browser/collect"],DEFAULT_SAMPLE_CONFIG={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},DEFAULT_SENDER_SIZE=20,getReportUrl=function(e,n){return void 0===n&&(n=BATCH_REPORT_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getSettingsUrl=function(e,n){return void 0===n&&(n=SETTINGS_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getViewId=function(e){return e+"_"+Date.now()},getDefaultSessionId=function(){return uuid()},getStorageKey=function(e){return STORAGE_PREFIX+e},glueCodeForStorageSecurity=function(e,n){var r=localStorage.getItem(e);if(r&&isSupportEncrypt()&&"{"===r[0])try{setStorageWithEncoding(e,JSON.parse(r),n)}catch(e){}},getStoreInfo=function(e,n){void 0===e&&(e=0);var r={userId:uuid(),deviceId:uuid(),r:Math.random()};if(n<=0)return r;e=getStorageKey(e);return glueCodeForStorageSecurity(e,n),getStorageWithDecoding(e)||r},saveStoreInfo=function(e){var n=e.aid,r=e.userId,t=e.deviceId,o=e.sample,e=e.storageExpires,n=getStorageKey(n);setStorageWithEncoding(n,{userId:r,deviceId:t,r:o.r},formatStorageExpires(e))},createBrowserConfigManager=function(n){var r,t,o,i=n,a={},u=noop,c=noop;return{getConfig:function(){return i},setConfig:function(e){return a=__assign(__assign({},a),e||{}),s(),r||(r=e,i.useLocalConfig?(o={},u()):t?f():getServerConfig(i.transport,i.domain,i.aid,function(e){t=e,f()})),i},onChange:function(e){c=e},onReady:function(e){u=function(){!function(){n.userId!==i.userId&&(n.sample.r=Math.random(),s());saveStoreInfo(i)}(),e()},o&&u()}};function s(){var e=__assign(__assign(__assign({},n),o||{}),a);e.plugins=mergeDeepConcatArray(n.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),e.sample=mergeSampleConfig(mergeSampleConfig(n.sample,null==o?void 0:o.sample),a.sample),i=e,c()}function f(){o=parseServerConfig(t),s(),u()}};function getServerConfig(e,n,r,t){e.get({withCredentials:!0,url:getSettingsUrl(n)+"?aid="+r,success:function(e){t(e.data||{})},fail:function(){t()}})}function mergeSampleConfig(t,o){if(!t||!o)return t||o;var e=__assign(__assign({},t),o);return e.include_users=__spreadArray(__spreadArray([],__read(t.include_users||[]),!1),__read(o.include_users||[]),!1),e.rules=__spreadArray(__spreadArray([],__read(Object.keys(t.rules||{})),!1),__read(Object.keys(o.rules||{})),!1).reduce(function(e,n){var r;return n in e||(n in(t.rules||{})&&n in(o.rules||{})?(e[n]=__assign(__assign({},t.rules[n]),o.rules[n]),e[n].conditional_sample_rules=__spreadArray(__spreadArray([],__read(t.rules[n].conditional_sample_rules||[]),!1),__read(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(r=t.rules)||void 0===r?void 0:r[n])||(null===(r=o.rules)||void 0===r?void 0:r[n])),e},{}),e}var addEnvToSendEvent=function(e){var n={url:getLocationUrl(),timestamp:Date.now()};return __assign(__assign({},e),{extra:__assign(__assign({},n),e.extra||{})})},InjectEnvPlugin=function(e){e.on("report",function(e){return addEnvToSendEvent(e)})},MAX_RTT=700,TimeCalibrationPlugin=function(r){var t,o=!1;r.on("init",function(){t=(new Date).getTime(),r.on("config",function(){var e,n=null===(e=r.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=(new Date).getTime())-t<MAX_RTT&&n&&(e=n-(e+t)/2,!isNaN(e)&&(0<e||e<-6e5)&&r.set({offset:e})))})})},addConfigToReportEvent=function(e,n){var r={};return r.aid=n.aid,r.pid=n.pid,r.view_id=n.viewId,r.user_id=n.userId,__assign(__assign({},e),{extra:__assign(__assign({},r),e.extra||{})})},InjectConfigPlugin=function(n){n.on("beforeBuild",function(e){return addConfigToReportEvent(e,n.config())})},InjectQueryPlugin=function(u){u.on("start",function(){var e=u.config(),n=e.deviceId,r=e.sessionId,t=e.release,o=e.env,i=e.offset,a=e.aid,e=e.token,a={did:n,sid:r,release:t,env:o,sname:SDK_NAME,sversion:SDK_VERSION,soffset:i||0,biz_id:a,x_auth_token:e},e=u.getSender();e.setEndpoint(e.getEndpoint()+joinQueryWithMap(a))})},getDefaultConfig=function(e){var n=formatStorageExpires(e.storageExpires),e=getStoreInfo(e.aid,n);return{aid:0,pid:"",token:"",viewId:getViewId("_"),userId:e.userId,deviceId:e.deviceId,sessionId:getDefaultSessionId(),storageExpires:n,domain:REPORT_DOMAIN,plugins:{ajax:{ignoreUrls:DEFAULT_IGNORE_PATHS},fetch:{ignoreUrls:DEFAULT_IGNORE_PATHS},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1},release:"",env:"production",sample:__assign(__assign({},DEFAULT_SAMPLE_CONFIG),{r:e.r}),transport:getXhrTransport()}},createMinimalBrowserClient=function(e){var n=void 0===e?{}:e,r=n.createSender,e=n.builder,n=n.createDefaultConfig,t=createClient({validateInitConfig:validateInitConfig,initConfigNormalizer:normalizeInitConfig,userConfigNormalizer:normalizeUserConfig,createSender:void 0===r?function(e){return createBrowserSender({size:DEFAULT_SENDER_SIZE,endpoint:getReportUrl(e.domain),transport:e.transport})}:r,builder:void 0===e?browserBuilder:e,createDefaultConfig:void 0===n?getDefaultConfig:n,createConfigManager:createBrowserConfigManager});ContextPlugin(t);n=getGlobalRegistry(getDefaultBrowser());SubjectPlugin(t,n&&n.subject),TimeCalibrationPlugin(t),InjectConfigPlugin(t),InjectEnvPlugin(t),InjectNetworkTypePlugin(t),InjectQueryPlugin(t);n=withCommandArray(t,captureCurrentContext,function(e,n,r){return syncReportWithCapturedContext(e,n)(function(){var e=__read(r),n=e[0],e=e.slice(1);t[n].apply(t,__spreadArray([],__read(e),!1))})});return IntegrationPlugin(n),n};export{createMinimalBrowserClient,getDefaultConfig};
var __assign=function(){return(__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function __rest(e,n){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)n.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(r[o[t]]=e[o[t]]);return r}function __read(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var t,o,i=r.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(t=i.next()).done;)a.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function __spreadArray(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||((t=t||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}var DEFAULT_SIZE=10,DEFAULT_WAIT=1e3,stringifyBatch=function(e){return JSON.stringify({ev_type:"batch",list:e})};function createBatchSender(e){var r,t=e.transport,o=e.endpoint,n=e.size,i=void 0===n?DEFAULT_SIZE:n,e=e.wait,a=void 0===e?DEFAULT_WAIT:e,u=[],s=0;function c(){var n;u.length&&(n=this.getBatchData(),t.post({url:o,data:n,fail:function(e){r&&r(e,n)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(e){i=e},setWait:function(e){a=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){u.push(e),u.length>=i&&c.call(this),clearTimeout(s),s=setTimeout(c.bind(this),a)},flush:function(){clearTimeout(s),c.call(this)},getBatchData:function(){return u.length?stringifyBatch(u):""},clear:function(){clearTimeout(s),u=[]},fail:function(e){r=e}}}var EVENTS=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],noop=function(){return{}};function isObject(e){return"object"==typeof e&&null!==e}var objProto=Object.prototype;function isPlainObject(e){if(isObject(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===objProto.toString.call(e);e=Object.getPrototypeOf(e);return e===objProto||null===e}return!1}function isArray(e){return"[object Array]"===objProto.toString.call(e)}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function hasKey(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function mergeDeepConcatArray(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r={},t=0;t<e.length;)r=_mergeDeepMergeArray(r,e[t++]);return r}function _mergeDeepMergeArray(e,n){var r,t=__assign({},e);for(r in n)hasKey(n,r)&&void 0!==n[r]&&(isObject(n[r])&&isPlainObject(n[r])?t[r]=_mergeDeepMergeArray(isObject(e[r])?e[r]:{},n[r]):isArray(n[r])&&isArray(e[r])?t[r]=_mergeDeepArray(e[r],n[r]):t[r]=n[r]);return t}function _mergeDeepArray(e,n){e=isArray(e)?e:[],n=isArray(n)?n:[];return Array.prototype.concat.call(e,n).map(function(e){return e instanceof RegExp?e:isObject(e)&&isPlainObject(e)?_mergeDeepMergeArray({},e):isArray(e)?_mergeDeepArray([],e):e})}function arrayIncludes(e,n){if(!isArray(e))return!1;if(0===e.length)return!1;for(var r=0;r<e.length;){if(e[r]===n)return!0;r++}return!1}var arrayRemove=function(e,n){if(!isArray(e))return e;var r=e.indexOf(n);if(0<=r){n=e.slice();return n.splice(r,1),n}return e},safeVisit=function(e,n,r){for(var t,n=__read(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(t=__read(i))[0],i=t.slice(1);if(e)return r(e,o)},safeCall=function(e,n,r){return safeVisit(e,n,function(e,n){if(e&&n in e&&isFunction(e[n]))try{return e[n].apply(e,r)}catch(e){return}})};function safeStringify(e){try{return isString(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}var joinQueryWithMap=function(r){return isObject(r)?Object.keys(r).reduce(function(e,n){return e+="&"+n+"="+r[n]},"").replace("&","?"):""};function createContextAgent(){var r={},t={},o={set:function(e,n){return r[e]=n,t[e]=safeStringify(n),o},merge:function(n){return r=__assign(__assign({},r),n),Object.keys(n).forEach(function(e){t[e]=safeStringify(n[e])}),o},delete:function(e){return delete r[e],delete t[e],o},clear:function(){return r={},t={},o},get:function(e){return t[e]},toString:function(){return __assign({},t)}};return o}var hookObjectProperty=function(i,a,u,s){return void 0===s&&(s=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return noop;var r=i[a],t=u.apply(void 0,__spreadArray([r],__read(e),!1)),o=t;return isFunction(o)&&s&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return t.apply(this,n)}catch(e){return isFunction(r)&&r.apply(this,n)}}),i[a]=o,function(e){e||(o===i[a]?i[a]=r:t=r)}}},errCount=0,error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,__spreadArray(["[SDK]",Date.now(),(""+errCount++).padStart(8," ")],__read(e),!1))},warnCount=0,warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,__spreadArray(["[SDK]",Date.now(),(""+warnCount++).padStart(8," ")],__read(e),!1))},runProcessors=function(t){return function(e){for(var n=e,r=0;r<t.length&&n;r++)try{n=t[r](n)}catch(e){error(e)}return n}};function mathRNG(){for(var e=new Array(16),n=0,r=0;r<16;r++)0==(3&r)&&(n=4294967296*Math.random()),e[r]=n>>>((3&r)<<3)&255;return e}function bytesToUuid(e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);var t=0,o=n;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[+t]],o[e[15]]].join("")}function uuid(){var e=mathRNG();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,bytesToUuid(e)}var BUFFER_TIME=3e5,applyBufferTimer=function(e,n,r){var t=0;return-1===r?noop:function(){if(e())return t&&clearTimeout(t),void(t=0);0===t&&(t=setTimeout(n,r))}},nextLink=function(t,e){var n=[];try{n=e.reduce(function(e,n){try{var r=n(t);"function"==typeof r&&e.push(r)}catch(e){}return e},[])}catch(e){}return function(e){return nextLink(e,n)}},toObservable=function(e){function n(e){t=arrayRemove(t,e),i||a()}var r,t=[],o=[],i=!1,a=applyBufferTimer(function(){return!!t.length},function(){i=!0,r&&r[0](),o.forEach(function(e){return e()}),o.length=0,r=void 0},e=void 0===e?BUFFER_TIME:e);return{next:function(e){return nextLink(e,t)},complete:function(e){o.push(e)},attach:function(e,n){r=[e,n]},subscribe:function(e){if(i)throw new Error("Observer is closed");return t.push(e),r&&r[1]&&r[1](e),a(),function(){return n(e)}},unsubscribe:n}},createSafeObserver=function(e,n,r){r=toObservable(r);try{e(r.next,r.attach),n&&r.complete(n)}catch(e){}return[r.subscribe,r.unsubscribe]};function createDestroyAgent(){function t(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){i[e]&&i[e].forEach(function(e){t(e[1])}),i[e]=void 0}var o=!1,i={};return{set:function(e,n,r){i[e]?i[e].push([n,r]):i[e]=[[n,r]],o&&t(r)},has:function(e){return!!i[e]},remove:n,removeByEvType:function(n){Object.keys(i).forEach(function(e){i[e]&&i[e].forEach(function(e){e[0]===n&&t(e[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(e){n(e)})}}}function createClient(e){var r,t,n=e.builder,o=e.createSender,i=e.createDefaultConfig,a=e.createConfigManager,u=e.userConfigNormalizer,s=e.initConfigNormalizer,c=e.validateInitConfig,f={};EVENTS.forEach(function(e){return f[e]=[]});var l=!1,g=!1,d=!1,p=[],_=[],v=createDestroyAgent(),y={getBuilder:function(){return n},getSender:function(){return r},getPreStartQueue:function(){return p},init:function(e){if(l)warn("already inited");else{if(!(e&&isObject(e)&&c(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=s(e);if((t=a(n)).setConfig(e),t.onChange(function(){h("config")}),!(r=o(t.getConfig())))throw new Error("sender missing");h("init",l=!0)}},set:function(e){l&&e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(e))},config:function(e){if(l)return e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(u(e))),null==t?void 0:t.getConfig()},provide:function(e,n){arrayIncludes(_,e)?warn("cannot provide "+e+", reserved"):(y[e]=n,h("provide",!1,e))},start:function(){var n=this;l&&(g||null!=t&&t.onReady(function(){h("start",g=!0),p.forEach(function(e){return n.build(e)}),p.length=0}))},report:function(e){e&&(!(e=runProcessors(f.beforeReport)(e))||(e=runProcessors(f.report)(e))&&(g?this.build(e):p.push(e)))},build:function(e){!g||(e=runProcessors(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=runProcessors(f.build)(e))&&this.send(e))},send:function(e){!g||(e=runProcessors(f.beforeSend)(e))&&(r.send(e),h("send",!1,e))},destroy:function(){v.clear(),d=!0,h("beforeDestroy",!(p.length=0))},on:function(e,n){"init"===e&&l||"start"===e&&g||"beforeDestroy"===e&&d?n():f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=arrayRemove(f[e],n))},destroyAgent:v},_=Object.keys(y);return y;function h(e,n){void 0===n&&(n=!1);for(var r=[],t=2;t<arguments.length;t++)r[t-2]=arguments[t];f[e].forEach(function(e){try{e.apply(void 0,__spreadArray([],__read(r),!1))}catch(e){}}),n&&(f[e].length=0)}}var ContextPlugin=function(e){var n=createContextAgent();e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})},withCommandArray=function(i,a,r){function u(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(o=e[0]){var r=o.split(".")[0];if(r in u)return safeCall(u,o,[].slice.call(e,1));var t=s[r]||[],o=null!==(o=null==a?void 0:a(i))&&void 0!==o?o:{};t.push(__spreadArray([o],__read(e),!1)),void(s[r]=t)}}var e,s={};for(e in hookObjectProperty(i,"provide",function(r){return function(e,n){u[e]=n,r.call(i,e,n)}})(),i)Object.prototype.hasOwnProperty.call(i,e)&&(u[e]=i[e]);return i.on("provide",function(e){s[e]&&(s[e].forEach(function(e){var n=__read(e),e=n[0],n=n.slice(1);null!=r&&r(i,e,n)}),s[e]=null)}),u};function IntegrationPlugin(t,o){t.on("init",function(){var r=[],e=t.config();e&&e.integrations&&e.integrations.forEach(function(e){var n=e.name;arrayIncludes(r,n)||(r.push(n),e.setup(t),o&&o(n,e.setup),e.tearDown&&t.destroyAgent.set(n,n,[e.tearDown]))})})}function SubjectPlugin(e,n){var r=n||{};e.provide("initSubject",function(e){var e=__read(e,2),n=e[0],e=e[1];return r[n]||(r[n]=createSafeObserver(e,function(){r[n]=void 0})),r[n]}),e.provide("getSubject",function(e){return r[e]}),e.provide("privateSubject",{})}var now=function(){return Date.now()};function getDefaultBrowser(){if("object"==typeof window&&isObject(window))return window}function getDefaultLocation(){return getDefaultBrowser()&&window.location}function getDefaultXMLHttpRequest(){if("function"==typeof XMLHttpRequest&&isFunction(XMLHttpRequest))return XMLHttpRequest}function getDefaultNavigator(){if(getDefaultBrowser()&&"navigator"in window)return window.navigator}function getDefaultNetworkInformation(){var e=getDefaultNavigator();if(e)return e.connection||e.mozConnection||e.webkitConnection}function getLocationUrl(){var e=getDefaultBrowser()&&getDefaultLocation();return null==e?void 0:e.href}var getGlobalRegistry=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar},captureCurrentContext=function(e){var n={url:getLocationUrl(),timestamp:now()},r=e.config();return null!=r&&r.pid&&(n.pid=r.pid),null!=e&&e.context&&(n.context=e.context.toString()),n},syncReportWithCapturedContext=function(r,t){return function(e){function n(e){return e.overrides=t,e}r.on("report",n),e(),r.off("report",n)}},invokeCallbackOnce=function(n){var r=!1;return[function(e){r||(r=!0,n&&n(e))}]},onPageUnload=function(e){var n,r=getDefaultBrowser();r&&(n=__read(invokeCallbackOnce(e),1)[0],["unload","beforeunload","pagehide"].forEach(function(e){r.addEventListener(e,n)}))},isSupportEncrypt=function(){return!!btoa&&!!atob};function encodeToBase64(e){return isSupportEncrypt()?btoa(encodeURI(e)):e}function decodeWithBase64(e){return isSupportEncrypt()?decodeURI(atob(e)):e}var getStorageWithDecoding=function(e){try{var n=localStorage.getItem(e),r=n,t=r=n&&"string"==typeof n?JSON.parse(decodeWithBase64(n)):r,o=t.expires,i=__rest(t,["expires"]);return o>=now()?i:void 0}catch(e){return}},setStorageWithEncoding=function(e,n,r){if(!(r<=0))try{localStorage.setItem(e,encodeToBase64(JSON.stringify(__assign(__assign({},n),{expires:now()+r}))))}catch(e){}},DEFAULT_STORAGE_EXPIRES=7776e6,formatStorageExpires=function(e){return!1===e?0:!0!==e&&void 0!==e&&isNumber(e)?e:DEFAULT_STORAGE_EXPIRES};function getNetworkType(e){return(null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||""}var InjectNetworkTypePlugin=function(e){var n=getDefaultNetworkInformation(),r=getNetworkType(n);n&&(n.onchange=function(){r=getNetworkType(n)}),e.on("report",function(e){return __assign(__assign({},e),{extra:__assign(__assign({},e.extra||{}),{network_type:r})})})},getBeaconTransport=function(){var r=getDefaultBrowser();return r&&r.navigator.sendBeacon?{get:function(){},post:function(e,n){r.navigator.sendBeacon(e,n)}}:{get:noop,post:noop}},request=function(e,n,r){var t=n.url,o=n.data,i=n.success,a=void 0===i?noop:i,i=n.fail,u=void 0===i?noop:i,i=n.getResponseText,s=void 0===i?noop:i,n=n.withCredentials,n=void 0!==n&&n,r=new r;r.withCredentials=n,r.open(e,t,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){null!=s&&s(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),a(e)):a({})}catch(e){u(e)}},r.onerror=function(){u(new Error("Network request failed"))},r.onabort=function(){u(new Error("Network request aborted"))},r.send(o)},getXhrTransport=function(){var n=getDefaultXMLHttpRequest();return n?{get:function(e){request("GET",e,n)},post:function(e){request("POST",e,n)}}:{get:noop,post:noop}};function createBrowserSender(e){function n(e){t.post(r.getEndpoint(),stringifyBatch([e]))}var r=createBatchSender(e),t=getBeaconTransport();return onPageUnload(function(){var e=r.getBatchData();e&&(t.post(r.getEndpoint(),e),r.clear()),r.send=n}),r}var browserBuilder={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:__assign(__assign({},e.extra||{}),e.overrides||{})}}};function normalizeInitConfig(e){var n,r=e.plugins||{};for(n in r)r[n]&&!isObject(r[n])&&(r[n]={});return __assign(__assign({},e),{plugins:r})}function validateInitConfig(e){return isObject(e)&&"aid"in e}function normalizeUserConfig(e){return __assign({},e)}function parseServerConfig(e){if(!e)return{};var n=e.sample,r=e.timestamp,t=e.status;if(!n)return{};var o=n.sample_rate,e=n.sample_granularity;return{sample:{include_users:n.include_users,sample_rate:t&&4===t?0:o,sample_granularity:e,rules:n.rules.reduce(function(e,n){var r=n.name,t=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[r]={enable:t,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r}}var REPORT_DOMAIN="apmplus.volces.com",SDK_VERSION="2.3.0-alpha.0",SDK_NAME="APM_PLUS_WEB",SETTINGS_PATH="/settings/get/webpro",BATCH_REPORT_PATH="/monitor_web/collect",STORAGE_PREFIX="APMPLUS",DEFAULT_IGNORE_PATHS=[BATCH_REPORT_PATH,SETTINGS_PATH,"/monitor_browser/collect"],DEFAULT_SAMPLE_CONFIG={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},DEFAULT_SENDER_SIZE=20,getReportUrl=function(e,n){return void 0===n&&(n=BATCH_REPORT_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getSettingsUrl=function(e,n){return void 0===n&&(n=SETTINGS_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getViewId=function(e){return e+"_"+Date.now()},getDefaultSessionId=function(){return uuid()},getStorageKey=function(e){return STORAGE_PREFIX+e},glueCodeForStorageSecurity=function(e,n){var r=localStorage.getItem(e);if(r&&isSupportEncrypt()&&"{"===r[0])try{setStorageWithEncoding(e,JSON.parse(r),n)}catch(e){}},getStoreInfo=function(e,n){void 0===e&&(e=0);var r={userId:uuid(),deviceId:uuid(),r:Math.random()};if(n<=0)return r;e=getStorageKey(e);return glueCodeForStorageSecurity(e,n),getStorageWithDecoding(e)||r},saveStoreInfo=function(e){var n=e.aid,r=e.userId,t=e.deviceId,o=e.sample,e=e.storageExpires,n=getStorageKey(n);setStorageWithEncoding(n,{userId:r,deviceId:t,r:o.r},formatStorageExpires(e))},createBrowserConfigManager=function(n){var r,t,o,i=n,a={},u=noop,s=noop;return{getConfig:function(){return i},setConfig:function(e){return a=__assign(__assign({},a),e||{}),c(),r||(r=e,i.useLocalConfig?(o={},u()):t?f():getServerConfig(i.transport,i.domain,i.aid,function(e){t=e,f()})),i},onChange:function(e){s=e},onReady:function(e){u=function(){!function(){n.userId!==i.userId&&(n.sample.r=Math.random(),c());saveStoreInfo(i)}(),e()},o&&u()}};function c(){var e=__assign(__assign(__assign({},n),o||{}),a);e.plugins=mergeDeepConcatArray(n.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),e.sample=mergeSampleConfig(mergeSampleConfig(n.sample,null==o?void 0:o.sample),a.sample),i=e,s()}function f(){o=parseServerConfig(t),c(),u()}};function getServerConfig(e,n,r,t){e.get({withCredentials:!0,url:getSettingsUrl(n)+"?aid="+r,success:function(e){t(e.data||{})},fail:function(){t()}})}function mergeSampleConfig(t,o){if(!t||!o)return t||o;var e=__assign(__assign({},t),o);return e.include_users=__spreadArray(__spreadArray([],__read(t.include_users||[]),!1),__read(o.include_users||[]),!1),e.rules=__spreadArray(__spreadArray([],__read(Object.keys(t.rules||{})),!1),__read(Object.keys(o.rules||{})),!1).reduce(function(e,n){var r;return n in e||(n in(t.rules||{})&&n in(o.rules||{})?(e[n]=__assign(__assign({},t.rules[n]),o.rules[n]),e[n].conditional_sample_rules=__spreadArray(__spreadArray([],__read(t.rules[n].conditional_sample_rules||[]),!1),__read(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(r=t.rules)||void 0===r?void 0:r[n])||(null===(r=o.rules)||void 0===r?void 0:r[n])),e},{}),e}function getPluginFromRegistry(e,n){return e.plugins.filter(function(e){return e.name===n&&e.version===SDK_VERSION})[0]}function register(e,n,r){(r=void 0===r?getGlobalRegistry(getDefaultBrowser()):r)&&r.plugins&&(getPluginFromRegistry(r,e)||r.plugins.push({name:e,version:SDK_VERSION,apply:n}))}var addEnvToSendEvent=function(e){var n={url:getLocationUrl(),timestamp:Date.now()};return __assign(__assign({},e),{extra:__assign(__assign({},n),e.extra||{})})},InjectEnvPlugin=function(e){e.on("report",function(e){return addEnvToSendEvent(e)})},MAX_RTT=700,TimeCalibrationPlugin=function(r){var t,o=!1;r.on("init",function(){t=(new Date).getTime(),r.on("config",function(){var e,n=null===(e=r.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=(new Date).getTime())-t<MAX_RTT&&n&&(e=n-(e+t)/2,!isNaN(e)&&(0<e||e<-6e5)&&r.set({offset:e})))})})},addConfigToReportEvent=function(e,n){var r={};return r.aid=n.aid,r.pid=n.pid,r.view_id=n.viewId,r.user_id=n.userId,__assign(__assign({},e),{extra:__assign(__assign({},r),e.extra||{})})},InjectConfigPlugin=function(n){n.on("beforeBuild",function(e){return addConfigToReportEvent(e,n.config())})},InjectQueryPlugin=function(u){u.on("start",function(){var e=u.config(),n=e.deviceId,r=e.sessionId,t=e.release,o=e.env,i=e.offset,a=e.aid,e=e.token,a={did:n,sid:r,release:t,env:o,sname:SDK_NAME,sversion:SDK_VERSION,soffset:i||0,biz_id:a,x_auth_token:e},e=u.getSender();e.setEndpoint(e.getEndpoint()+joinQueryWithMap(a))})},getDefaultConfig=function(e){var n=formatStorageExpires(e.storageExpires),e=getStoreInfo(e.aid,n);return{aid:0,pid:"",token:"",viewId:getViewId("_"),userId:e.userId,deviceId:e.deviceId,sessionId:getDefaultSessionId(),storageExpires:n,domain:REPORT_DOMAIN,plugins:{ajax:{ignoreUrls:DEFAULT_IGNORE_PATHS},fetch:{ignoreUrls:DEFAULT_IGNORE_PATHS},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1},release:"",env:"production",sample:__assign(__assign({},DEFAULT_SAMPLE_CONFIG),{r:e.r}),transport:getXhrTransport()}},createMinimalBrowserClient=function(e){var n=void 0===e?{}:e,r=n.createSender,e=n.builder,n=n.createDefaultConfig,t=createClient({validateInitConfig:validateInitConfig,initConfigNormalizer:normalizeInitConfig,userConfigNormalizer:normalizeUserConfig,createSender:void 0===r?function(e){return createBrowserSender({size:DEFAULT_SENDER_SIZE,endpoint:getReportUrl(e.domain),transport:e.transport})}:r,builder:void 0===e?browserBuilder:e,createDefaultConfig:void 0===n?getDefaultConfig:n,createConfigManager:createBrowserConfigManager});ContextPlugin(t);n=getGlobalRegistry(getDefaultBrowser());SubjectPlugin(t,n&&n.subject),TimeCalibrationPlugin(t),InjectConfigPlugin(t),InjectEnvPlugin(t),InjectNetworkTypePlugin(t),InjectQueryPlugin(t);n=withCommandArray(t,captureCurrentContext,function(e,n,r){return syncReportWithCapturedContext(e,n)(function(){var e=__read(r),n=e[0],e=e.slice(1);t[n].apply(t,__spreadArray([],__read(e),!1))})});return IntegrationPlugin(n,register),n};export{createMinimalBrowserClient,getDefaultConfig};

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var __assign=function(){return(__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function __rest(e,n){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)n.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(r[o[t]]=e[o[t]]);return r}function __read(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var t,o,i=r.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(t=i.next()).done;)a.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function __spreadArray(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||((t=t||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}var DEFAULT_SIZE=10,DEFAULT_WAIT=1e3,stringifyBatch=function(e){return JSON.stringify({ev_type:"batch",list:e})};function createBatchSender(e){var r,t=e.transport,o=e.endpoint,n=e.size,i=void 0===n?DEFAULT_SIZE:n,e=e.wait,a=void 0===e?DEFAULT_WAIT:e,u=[],s=0;function c(){var n;u.length&&(n=this.getBatchData(),t.post({url:o,data:n,fail:function(e){r&&r(e,n)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(e){i=e},setWait:function(e){a=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){u.push(e),u.length>=i&&c.call(this),clearTimeout(s),s=setTimeout(c.bind(this),a)},flush:function(){clearTimeout(s),c.call(this)},getBatchData:function(){return u.length?stringifyBatch(u):""},clear:function(){clearTimeout(s),u=[]},fail:function(e){r=e}}}var EVENTS=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],noop=function(){return{}};function isObject(e){return"object"==typeof e&&null!==e}var objProto=Object.prototype;function isPlainObject(e){if(isObject(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===objProto.toString.call(e);e=Object.getPrototypeOf(e);return e===objProto||null===e}return!1}function isArray(e){return"[object Array]"===objProto.toString.call(e)}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function hasKey(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function mergeDeepConcatArray(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r={},t=0;t<e.length;)r=_mergeDeepMergeArray(r,e[t++]);return r}function _mergeDeepMergeArray(e,n){var r,t=__assign({},e);for(r in n)hasKey(n,r)&&void 0!==n[r]&&(isObject(n[r])&&isPlainObject(n[r])?t[r]=_mergeDeepMergeArray(isObject(e[r])?e[r]:{},n[r]):isArray(n[r])&&isArray(e[r])?t[r]=_mergeDeepArray(e[r],n[r]):t[r]=n[r]);return t}function _mergeDeepArray(e,n){e=isArray(e)?e:[],n=isArray(n)?n:[];return Array.prototype.concat.call(e,n).map(function(e){return e instanceof RegExp?e:isObject(e)&&isPlainObject(e)?_mergeDeepMergeArray({},e):isArray(e)?_mergeDeepArray([],e):e})}function arrayIncludes(e,n){if(!isArray(e))return!1;if(0===e.length)return!1;for(var r=0;r<e.length;){if(e[r]===n)return!0;r++}return!1}var arrayRemove=function(e,n){if(!isArray(e))return e;var r=e.indexOf(n);if(0<=r){n=e.slice();return n.splice(r,1),n}return e},safeVisit=function(e,n,r){for(var t,n=__read(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(t=__read(i))[0],i=t.slice(1);if(e)return r(e,o)},safeCall=function(e,n,r){return safeVisit(e,n,function(e,n){if(e&&n in e&&isFunction(e[n]))try{return e[n].apply(e,r)}catch(e){return}})};function safeStringify(e){try{return isString(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}var joinQueryWithMap=function(r){return isObject(r)?Object.keys(r).reduce(function(e,n){return e+="&"+n+"="+r[n]},"").replace("&","?"):""};function createContextAgent(){var r={},t={},o={set:function(e,n){return r[e]=n,t[e]=safeStringify(n),o},merge:function(n){return r=__assign(__assign({},r),n),Object.keys(n).forEach(function(e){t[e]=safeStringify(n[e])}),o},delete:function(e){return delete r[e],delete t[e],o},clear:function(){return r={},t={},o},get:function(e){return t[e]},toString:function(){return __assign({},t)}};return o}var hookObjectProperty=function(i,a,u,s){return void 0===s&&(s=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return noop;var r=i[a],t=u.apply(void 0,__spreadArray([r],__read(e),!1)),o=t;return isFunction(o)&&s&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return t.apply(this,n)}catch(e){return isFunction(r)&&r.apply(this,n)}}),i[a]=o,function(e){e||(o===i[a]?i[a]=r:t=r)}}},errCount=0,error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,__spreadArray(["[SDK]",Date.now(),(""+errCount++).padStart(8," ")],__read(e),!1))},warnCount=0,warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,__spreadArray(["[SDK]",Date.now(),(""+warnCount++).padStart(8," ")],__read(e),!1))},runProcessors=function(t){return function(e){for(var n=e,r=0;r<t.length&&n;r++)try{n=t[r](n)}catch(e){error(e)}return n}};function mathRNG(){for(var e=new Array(16),n=0,r=0;r<16;r++)0==(3&r)&&(n=4294967296*Math.random()),e[r]=n>>>((3&r)<<3)&255;return e}function bytesToUuid(e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);var t=0,o=n;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[+t]],o[e[15]]].join("")}function uuid(){var e=mathRNG();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,bytesToUuid(e)}var BUFFER_TIME=3e5,applyBufferTimer=function(e,n,r){var t=0;return-1===r?noop:function(){if(e())return t&&clearTimeout(t),void(t=0);0===t&&(t=setTimeout(n,r))}},nextLink=function(t,e){var n=[];try{n=e.reduce(function(e,n){try{var r=n(t);"function"==typeof r&&e.push(r)}catch(e){}return e},[])}catch(e){}return function(e){return nextLink(e,n)}},toObservable=function(e){function n(e){t=arrayRemove(t,e),i||a()}var r,t=[],o=[],i=!1,a=applyBufferTimer(function(){return!!t.length},function(){i=!0,r&&r[0](),o.forEach(function(e){return e()}),o.length=0,r=void 0},e=void 0===e?BUFFER_TIME:e);return{next:function(e){return nextLink(e,t)},complete:function(e){o.push(e)},attach:function(e,n){r=[e,n]},subscribe:function(e){if(i)throw new Error("Observer is closed");return t.push(e),r&&r[1]&&r[1](e),a(),function(){return n(e)}},unsubscribe:n}},createSafeObserver=function(e,n,r){r=toObservable(r);try{e(r.next,r.attach),n&&r.complete(n)}catch(e){}return[r.subscribe,r.unsubscribe]};function createDestroyAgent(){function r(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){t[e]&&t[e].forEach(function(e){r(e[1])}),t[e]=void 0}var t={};return{set:function(e,n,r){t[e]?t[e].push([n,r]):t[e]=[[n,r]]},remove:n,removeByEvType:function(n){Object.keys(t).forEach(function(e){t[e]&&t[e].forEach(function(e){e[0]===n&&r(e[1])})})},clear:function(){Object.keys(t).forEach(function(e){n(e)})}}}function createClient(e){var r,t,n=e.builder,o=e.createSender,i=e.createDefaultConfig,a=e.createConfigManager,u=e.userConfigNormalizer,s=e.initConfigNormalizer,c=e.validateInitConfig,f={};EVENTS.forEach(function(e){return f[e]=[]});var l=!1,g=!1,d=!1,p=[],_=[],v=createDestroyAgent(),y={getBuilder:function(){return n},getSender:function(){return r},getPreStartQueue:function(){return p},init:function(e){if(l)warn("already inited");else{if(!(e&&isObject(e)&&c(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=s(e);if((t=a(n)).setConfig(e),t.onChange(function(){h("config")}),!(r=o(t.getConfig())))throw new Error("sender missing");h("init",l=!0)}},set:function(e){l&&e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(e))},config:function(e){if(l)return e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(u(e))),null==t?void 0:t.getConfig()},provide:function(e,n){arrayIncludes(_,e)?warn("cannot provide "+e+", reserved"):(y[e]=n,h("provide",!1,e))},start:function(){var n=this;l&&(g||null!=t&&t.onReady(function(){h("start",g=!0),p.forEach(function(e){return n.build(e)}),p=[]}))},report:function(e){e&&(!(e=runProcessors(f.beforeReport)(e))||(e=runProcessors(f.report)(e))&&(g?this.build(e):p.push(e)))},build:function(e){!g||(e=runProcessors(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=runProcessors(f.build)(e))&&this.send(e))},send:function(e){!g||(e=runProcessors(f.beforeSend)(e))&&(r.send(e),h("send",!1,e))},destroy:function(){v.clear(),h("beforeDestroy",d=!0)},on:function(e,n){"init"===e&&l||"start"===e&&g||"beforeDestroy"===e&&d?n():f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=arrayRemove(f[e],n))},destroyAgent:v},_=Object.keys(y);return y;function h(e,n){void 0===n&&(n=!1);for(var r=[],t=2;t<arguments.length;t++)r[t-2]=arguments[t];f[e].forEach(function(e){try{e.apply(void 0,__spreadArray([],__read(r),!1))}catch(e){}}),n&&(f[e].length=0)}}var ContextPlugin=function(e){var n=createContextAgent();e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})},withCommandArray=function(i,a,r){function u(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(o=e[0]){var r=o.split(".")[0];if(r in u)return safeCall(u,o,[].slice.call(e,1));var t=s[r]||[],o=null!==(o=null==a?void 0:a(i))&&void 0!==o?o:{};t.push(__spreadArray([o],__read(e),!1)),void(s[r]=t)}}var e,s={};for(e in hookObjectProperty(i,"provide",function(r){return function(e,n){u[e]=n,r.call(i,e,n)}})(),i)Object.prototype.hasOwnProperty.call(i,e)&&(u[e]=i[e]);return i.on("provide",function(e){s[e]&&(s[e].forEach(function(e){var n=__read(e),e=n[0],n=n.slice(1);null!=r&&r(i,e,n)}),s[e]=null)}),u};function IntegrationPlugin(r){r.on("init",function(){var n=[],e=r.config();e&&e.integrations&&e.integrations.forEach(function(e){arrayIncludes(n,e.name)||(n.push(e.name),e.setup(r),e.tearDown&&r.on("beforeDestroy",e.tearDown))})})}function SubjectPlugin(e,n){var r=n||{};e.provide("initSubject",function(e){var e=__read(e,2),n=e[0],e=e[1];return r[n]||(r[n]=createSafeObserver(e,function(){r[n]=void 0})),r[n]}),e.provide("getSubject",function(e){return r[e]}),e.provide("privateSubject",{})}var now=function(){return Date.now()};function getDefaultBrowser(){if("object"==typeof window&&isObject(window))return window}function getDefaultLocation(){return getDefaultBrowser()&&window.location}function getDefaultXMLHttpRequest(){if("function"==typeof XMLHttpRequest&&isFunction(XMLHttpRequest))return XMLHttpRequest}function getDefaultNavigator(){if(getDefaultBrowser()&&"navigator"in window)return window.navigator}function getDefaultNetworkInformation(){var e=getDefaultNavigator();if(e)return e.connection||e.mozConnection||e.webkitConnection}function getLocationUrl(){var e=getDefaultBrowser()&&getDefaultLocation();return null==e?void 0:e.href}var getGlobalRegistry=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar},captureCurrentContext=function(e){var n={url:getLocationUrl(),timestamp:now()},r=e.config();return null!=r&&r.pid&&(n.pid=r.pid),null!=e&&e.context&&(n.context=e.context.toString()),n},syncReportWithCapturedContext=function(r,t){return function(e){function n(e){return e.overrides=t,e}r.on("report",n),e(),r.off("report",n)}},invokeCallbackOnce=function(n){var r=!1;return[function(e){r||(r=!0,n&&n(e))}]},onPageUnload=function(e){var n,r=getDefaultBrowser();r&&(n=__read(invokeCallbackOnce(e),1)[0],["unload","beforeunload","pagehide"].forEach(function(e){r.addEventListener(e,n)}))},isSupportEncrypt=function(){return!!btoa&&!!atob};function encodeToBase64(e){return isSupportEncrypt()?btoa(encodeURI(e)):e}function decodeWithBase64(e){return isSupportEncrypt()?decodeURI(atob(e)):e}var getStorageWithDecoding=function(e){try{var n=localStorage.getItem(e),r=n,t=r=n&&"string"==typeof n?JSON.parse(decodeWithBase64(n)):r,o=t.expires,i=__rest(t,["expires"]);return o>=now()?i:void 0}catch(e){return}},setStorageWithEncoding=function(e,n,r){if(!(r<=0))try{localStorage.setItem(e,encodeToBase64(JSON.stringify(__assign(__assign({},n),{expires:now()+r}))))}catch(e){}},DEFAULT_STORAGE_EXPIRES=7776e6,formatStorageExpires=function(e){return!1===e?0:!0!==e&&void 0!==e&&isNumber(e)?e:DEFAULT_STORAGE_EXPIRES};function getNetworkType(e){return(null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||""}var InjectNetworkTypePlugin=function(e){var n=getDefaultNetworkInformation(),r=getNetworkType(n);n&&(n.onchange=function(){r=getNetworkType(n)}),e.on("report",function(e){return __assign(__assign({},e),{extra:__assign(__assign({},e.extra||{}),{network_type:r})})})},getBeaconTransport=function(){var r=getDefaultBrowser();return r&&r.navigator.sendBeacon?{get:function(){},post:function(e,n){r.navigator.sendBeacon(e,n)}}:{get:noop,post:noop}},request=function(e,n,r){var t=n.url,o=n.data,i=n.success,a=void 0===i?noop:i,i=n.fail,u=void 0===i?noop:i,i=n.getResponseText,s=void 0===i?noop:i,n=n.withCredentials,n=void 0!==n&&n,r=new r;r.withCredentials=n,r.open(e,t,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){null!=s&&s(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),a(e)):a({})}catch(e){u(e)}},r.onerror=function(){u(new Error("Network request failed"))},r.onabort=function(){u(new Error("Network request aborted"))},r.send(o)},getXhrTransport=function(){var n=getDefaultXMLHttpRequest();return n?{get:function(e){request("GET",e,n)},post:function(e){request("POST",e,n)}}:{get:noop,post:noop}};function createBrowserSender(e){function n(e){t.post(r.getEndpoint(),stringifyBatch([e]))}var r=createBatchSender(e),t=getBeaconTransport();return onPageUnload(function(){var e=r.getBatchData();e&&(t.post(r.getEndpoint(),e),r.clear()),r.send=n}),r}var browserBuilder={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:__assign(__assign({},e.extra||{}),e.overrides||{})}}};function normalizeInitConfig(e){var n,r=e.plugins||{};for(n in r)r[n]&&!isObject(r[n])&&(r[n]={});return __assign(__assign({},e),{plugins:r})}function validateInitConfig(e){return isObject(e)&&"aid"in e}function normalizeUserConfig(e){return __assign({},e)}function parseServerConfig(e){if(!e)return{};var n=e.sample,r=e.timestamp,t=e.status;if(!n)return{};var o=n.sample_rate,e=n.sample_granularity;return{sample:{include_users:n.include_users,sample_rate:t&&4===t?0:o,sample_granularity:e,rules:n.rules.reduce(function(e,n){var r=n.name,t=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[r]={enable:t,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r}}var REPORT_DOMAIN="apmplus.volces.com",SDK_VERSION="2.2.0",SDK_NAME="APM_PLUS_WEB",SETTINGS_PATH="/settings/get/webpro",BATCH_REPORT_PATH="/monitor_web/collect",STORAGE_PREFIX="APMPLUS",DEFAULT_IGNORE_PATHS=[BATCH_REPORT_PATH,SETTINGS_PATH,"/monitor_browser/collect"],DEFAULT_SAMPLE_CONFIG={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},DEFAULT_SENDER_SIZE=20,getReportUrl=function(e,n){return void 0===n&&(n=BATCH_REPORT_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getSettingsUrl=function(e,n){return void 0===n&&(n=SETTINGS_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getViewId=function(e){return e+"_"+Date.now()},getDefaultSessionId=function(){return uuid()},getStorageKey=function(e){return STORAGE_PREFIX+e},glueCodeForStorageSecurity=function(e,n){var r=localStorage.getItem(e);if(r&&isSupportEncrypt()&&"{"===r[0])try{setStorageWithEncoding(e,JSON.parse(r),n)}catch(e){}},getStoreInfo=function(e,n){void 0===e&&(e=0);var r={userId:uuid(),deviceId:uuid(),r:Math.random()};if(n<=0)return r;e=getStorageKey(e);return glueCodeForStorageSecurity(e,n),getStorageWithDecoding(e)||r},saveStoreInfo=function(e){var n=e.aid,r=e.userId,t=e.deviceId,o=e.sample,e=e.storageExpires,n=getStorageKey(n);setStorageWithEncoding(n,{userId:r,deviceId:t,r:o.r},formatStorageExpires(e))},createBrowserConfigManager=function(n){var r,t,o,i=n,a={},u=noop,s=noop;return{getConfig:function(){return i},setConfig:function(e){return a=__assign(__assign({},a),e||{}),c(),r||(r=e,i.useLocalConfig?(o={},u()):t?f():getServerConfig(i.transport,i.domain,i.aid,function(e){t=e,f()})),i},onChange:function(e){s=e},onReady:function(e){u=function(){!function(){n.userId!==i.userId&&(n.sample.r=Math.random(),c());saveStoreInfo(i)}(),e()},o&&u()}};function c(){var e=__assign(__assign(__assign({},n),o||{}),a);e.plugins=mergeDeepConcatArray(n.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),e.sample=mergeSampleConfig(mergeSampleConfig(n.sample,null==o?void 0:o.sample),a.sample),i=e,s()}function f(){o=parseServerConfig(t),c(),u()}};function getServerConfig(e,n,r,t){e.get({withCredentials:!0,url:getSettingsUrl(n)+"?aid="+r,success:function(e){t(e.data||{})},fail:function(){t()}})}function mergeSampleConfig(t,o){if(!t||!o)return t||o;var e=__assign(__assign({},t),o);return e.include_users=__spreadArray(__spreadArray([],__read(t.include_users||[]),!1),__read(o.include_users||[]),!1),e.rules=__spreadArray(__spreadArray([],__read(Object.keys(t.rules||{})),!1),__read(Object.keys(o.rules||{})),!1).reduce(function(e,n){var r;return n in e||(n in(t.rules||{})&&n in(o.rules||{})?(e[n]=__assign(__assign({},t.rules[n]),o.rules[n]),e[n].conditional_sample_rules=__spreadArray(__spreadArray([],__read(t.rules[n].conditional_sample_rules||[]),!1),__read(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(r=t.rules)||void 0===r?void 0:r[n])||(null===(r=o.rules)||void 0===r?void 0:r[n])),e},{}),e}var addEnvToSendEvent=function(e){var n={url:getLocationUrl(),timestamp:Date.now()};return __assign(__assign({},e),{extra:__assign(__assign({},n),e.extra||{})})},InjectEnvPlugin=function(e){e.on("report",function(e){return addEnvToSendEvent(e)})},MAX_RTT=700,TimeCalibrationPlugin=function(r){var t,o=!1;r.on("init",function(){t=(new Date).getTime(),r.on("config",function(){var e,n=null===(e=r.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=(new Date).getTime())-t<MAX_RTT&&n&&(e=n-(e+t)/2,!isNaN(e)&&(0<e||e<-6e5)&&r.set({offset:e})))})})},addConfigToReportEvent=function(e,n){var r={};return r.aid=n.aid,r.pid=n.pid,r.view_id=n.viewId,r.user_id=n.userId,__assign(__assign({},e),{extra:__assign(__assign({},r),e.extra||{})})},InjectConfigPlugin=function(n){n.on("beforeBuild",function(e){return addConfigToReportEvent(e,n.config())})},InjectQueryPlugin=function(u){u.on("start",function(){var e=u.config(),n=e.deviceId,r=e.sessionId,t=e.release,o=e.env,i=e.offset,a=e.aid,e=e.token,a={did:n,sid:r,release:t,env:o,sname:SDK_NAME,sversion:SDK_VERSION,soffset:i||0,biz_id:a,x_auth_token:e},e=u.getSender();e.setEndpoint(e.getEndpoint()+joinQueryWithMap(a))})},getDefaultConfig=function(e){var n=formatStorageExpires(e.storageExpires),e=getStoreInfo(e.aid,n);return{aid:0,pid:"",token:"",viewId:getViewId("_"),userId:e.userId,deviceId:e.deviceId,sessionId:getDefaultSessionId(),storageExpires:n,domain:REPORT_DOMAIN,plugins:{ajax:{ignoreUrls:DEFAULT_IGNORE_PATHS},fetch:{ignoreUrls:DEFAULT_IGNORE_PATHS},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1},release:"",env:"production",sample:__assign(__assign({},DEFAULT_SAMPLE_CONFIG),{r:e.r}),transport:getXhrTransport()}},createMinimalBrowserClient=function(e){var n=void 0===e?{}:e,r=n.createSender,e=n.builder,n=n.createDefaultConfig,t=createClient({validateInitConfig:validateInitConfig,initConfigNormalizer:normalizeInitConfig,userConfigNormalizer:normalizeUserConfig,createSender:void 0===r?function(e){return createBrowserSender({size:DEFAULT_SENDER_SIZE,endpoint:getReportUrl(e.domain),transport:e.transport})}:r,builder:void 0===e?browserBuilder:e,createDefaultConfig:void 0===n?getDefaultConfig:n,createConfigManager:createBrowserConfigManager});ContextPlugin(t);n=getGlobalRegistry(getDefaultBrowser());SubjectPlugin(t,n&&n.subject),TimeCalibrationPlugin(t),InjectConfigPlugin(t),InjectEnvPlugin(t),InjectNetworkTypePlugin(t),InjectQueryPlugin(t);n=withCommandArray(t,captureCurrentContext,function(e,n,r){return syncReportWithCapturedContext(e,n)(function(){var e=__read(r),n=e[0],e=e.slice(1);t[n].apply(t,__spreadArray([],__read(e),!1))})});return IntegrationPlugin(n),n};exports.createMinimalBrowserClient=createMinimalBrowserClient,exports.getDefaultConfig=getDefaultConfig;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var __assign=function(){return(__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function __rest(e,n){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++)n.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(r[o[t]]=e[o[t]]);return r}function __read(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var t,o,i=r.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(t=i.next()).done;)a.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function __spreadArray(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||((t=t||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}var DEFAULT_SIZE=10,DEFAULT_WAIT=1e3,stringifyBatch=function(e){return JSON.stringify({ev_type:"batch",list:e})};function createBatchSender(e){var r,t=e.transport,o=e.endpoint,n=e.size,i=void 0===n?DEFAULT_SIZE:n,e=e.wait,a=void 0===e?DEFAULT_WAIT:e,u=[],s=0;function c(){var n;u.length&&(n=this.getBatchData(),t.post({url:o,data:n,fail:function(e){r&&r(e,n)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(e){i=e},setWait:function(e){a=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){u.push(e),u.length>=i&&c.call(this),clearTimeout(s),s=setTimeout(c.bind(this),a)},flush:function(){clearTimeout(s),c.call(this)},getBatchData:function(){return u.length?stringifyBatch(u):""},clear:function(){clearTimeout(s),u=[]},fail:function(e){r=e}}}var EVENTS=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],noop=function(){return{}};function isObject(e){return"object"==typeof e&&null!==e}var objProto=Object.prototype;function isPlainObject(e){if(isObject(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===objProto.toString.call(e);e=Object.getPrototypeOf(e);return e===objProto||null===e}return!1}function isArray(e){return"[object Array]"===objProto.toString.call(e)}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function hasKey(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function mergeDeepConcatArray(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r={},t=0;t<e.length;)r=_mergeDeepMergeArray(r,e[t++]);return r}function _mergeDeepMergeArray(e,n){var r,t=__assign({},e);for(r in n)hasKey(n,r)&&void 0!==n[r]&&(isObject(n[r])&&isPlainObject(n[r])?t[r]=_mergeDeepMergeArray(isObject(e[r])?e[r]:{},n[r]):isArray(n[r])&&isArray(e[r])?t[r]=_mergeDeepArray(e[r],n[r]):t[r]=n[r]);return t}function _mergeDeepArray(e,n){e=isArray(e)?e:[],n=isArray(n)?n:[];return Array.prototype.concat.call(e,n).map(function(e){return e instanceof RegExp?e:isObject(e)&&isPlainObject(e)?_mergeDeepMergeArray({},e):isArray(e)?_mergeDeepArray([],e):e})}function arrayIncludes(e,n){if(!isArray(e))return!1;if(0===e.length)return!1;for(var r=0;r<e.length;){if(e[r]===n)return!0;r++}return!1}var arrayRemove=function(e,n){if(!isArray(e))return e;var r=e.indexOf(n);if(0<=r){n=e.slice();return n.splice(r,1),n}return e},safeVisit=function(e,n,r){for(var t,n=__read(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(t=__read(i))[0],i=t.slice(1);if(e)return r(e,o)},safeCall=function(e,n,r){return safeVisit(e,n,function(e,n){if(e&&n in e&&isFunction(e[n]))try{return e[n].apply(e,r)}catch(e){return}})};function safeStringify(e){try{return isString(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}var joinQueryWithMap=function(r){return isObject(r)?Object.keys(r).reduce(function(e,n){return e+="&"+n+"="+r[n]},"").replace("&","?"):""};function createContextAgent(){var r={},t={},o={set:function(e,n){return r[e]=n,t[e]=safeStringify(n),o},merge:function(n){return r=__assign(__assign({},r),n),Object.keys(n).forEach(function(e){t[e]=safeStringify(n[e])}),o},delete:function(e){return delete r[e],delete t[e],o},clear:function(){return r={},t={},o},get:function(e){return t[e]},toString:function(){return __assign({},t)}};return o}var hookObjectProperty=function(i,a,u,s){return void 0===s&&(s=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return noop;var r=i[a],t=u.apply(void 0,__spreadArray([r],__read(e),!1)),o=t;return isFunction(o)&&s&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return t.apply(this,n)}catch(e){return isFunction(r)&&r.apply(this,n)}}),i[a]=o,function(e){e||(o===i[a]?i[a]=r:t=r)}}},errCount=0,error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,__spreadArray(["[SDK]",Date.now(),(""+errCount++).padStart(8," ")],__read(e),!1))},warnCount=0,warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,__spreadArray(["[SDK]",Date.now(),(""+warnCount++).padStart(8," ")],__read(e),!1))},runProcessors=function(t){return function(e){for(var n=e,r=0;r<t.length&&n;r++)try{n=t[r](n)}catch(e){error(e)}return n}};function mathRNG(){for(var e=new Array(16),n=0,r=0;r<16;r++)0==(3&r)&&(n=4294967296*Math.random()),e[r]=n>>>((3&r)<<3)&255;return e}function bytesToUuid(e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);var t=0,o=n;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[+t]],o[e[15]]].join("")}function uuid(){var e=mathRNG();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,bytesToUuid(e)}var BUFFER_TIME=3e5,applyBufferTimer=function(e,n,r){var t=0;return-1===r?noop:function(){if(e())return t&&clearTimeout(t),void(t=0);0===t&&(t=setTimeout(n,r))}},nextLink=function(t,e){var n=[];try{n=e.reduce(function(e,n){try{var r=n(t);"function"==typeof r&&e.push(r)}catch(e){}return e},[])}catch(e){}return function(e){return nextLink(e,n)}},toObservable=function(e){function n(e){t=arrayRemove(t,e),i||a()}var r,t=[],o=[],i=!1,a=applyBufferTimer(function(){return!!t.length},function(){i=!0,r&&r[0](),o.forEach(function(e){return e()}),o.length=0,r=void 0},e=void 0===e?BUFFER_TIME:e);return{next:function(e){return nextLink(e,t)},complete:function(e){o.push(e)},attach:function(e,n){r=[e,n]},subscribe:function(e){if(i)throw new Error("Observer is closed");return t.push(e),r&&r[1]&&r[1](e),a(),function(){return n(e)}},unsubscribe:n}},createSafeObserver=function(e,n,r){r=toObservable(r);try{e(r.next,r.attach),n&&r.complete(n)}catch(e){}return[r.subscribe,r.unsubscribe]};function createDestroyAgent(){function t(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){i[e]&&i[e].forEach(function(e){t(e[1])}),i[e]=void 0}var o=!1,i={};return{set:function(e,n,r){i[e]?i[e].push([n,r]):i[e]=[[n,r]],o&&t(r)},has:function(e){return!!i[e]},remove:n,removeByEvType:function(n){Object.keys(i).forEach(function(e){i[e]&&i[e].forEach(function(e){e[0]===n&&t(e[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(e){n(e)})}}}function createClient(e){var r,t,n=e.builder,o=e.createSender,i=e.createDefaultConfig,a=e.createConfigManager,u=e.userConfigNormalizer,s=e.initConfigNormalizer,c=e.validateInitConfig,f={};EVENTS.forEach(function(e){return f[e]=[]});var l=!1,g=!1,d=!1,p=[],_=[],v=createDestroyAgent(),y={getBuilder:function(){return n},getSender:function(){return r},getPreStartQueue:function(){return p},init:function(e){if(l)warn("already inited");else{if(!(e&&isObject(e)&&c(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=s(e);if((t=a(n)).setConfig(e),t.onChange(function(){h("config")}),!(r=o(t.getConfig())))throw new Error("sender missing");h("init",l=!0)}},set:function(e){l&&e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(e))},config:function(e){if(l)return e&&isObject(e)&&(h("beforeConfig",!1,e),null!=t&&t.setConfig(u(e))),null==t?void 0:t.getConfig()},provide:function(e,n){arrayIncludes(_,e)?warn("cannot provide "+e+", reserved"):(y[e]=n,h("provide",!1,e))},start:function(){var n=this;l&&(g||null!=t&&t.onReady(function(){h("start",g=!0),p.forEach(function(e){return n.build(e)}),p.length=0}))},report:function(e){e&&(!(e=runProcessors(f.beforeReport)(e))||(e=runProcessors(f.report)(e))&&(g?this.build(e):p.push(e)))},build:function(e){!g||(e=runProcessors(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=runProcessors(f.build)(e))&&this.send(e))},send:function(e){!g||(e=runProcessors(f.beforeSend)(e))&&(r.send(e),h("send",!1,e))},destroy:function(){v.clear(),d=!0,h("beforeDestroy",!(p.length=0))},on:function(e,n){"init"===e&&l||"start"===e&&g||"beforeDestroy"===e&&d?n():f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=arrayRemove(f[e],n))},destroyAgent:v},_=Object.keys(y);return y;function h(e,n){void 0===n&&(n=!1);for(var r=[],t=2;t<arguments.length;t++)r[t-2]=arguments[t];f[e].forEach(function(e){try{e.apply(void 0,__spreadArray([],__read(r),!1))}catch(e){}}),n&&(f[e].length=0)}}var ContextPlugin=function(e){var n=createContextAgent();e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})},withCommandArray=function(i,a,r){function u(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(o=e[0]){var r=o.split(".")[0];if(r in u)return safeCall(u,o,[].slice.call(e,1));var t=s[r]||[],o=null!==(o=null==a?void 0:a(i))&&void 0!==o?o:{};t.push(__spreadArray([o],__read(e),!1)),void(s[r]=t)}}var e,s={};for(e in hookObjectProperty(i,"provide",function(r){return function(e,n){u[e]=n,r.call(i,e,n)}})(),i)Object.prototype.hasOwnProperty.call(i,e)&&(u[e]=i[e]);return i.on("provide",function(e){s[e]&&(s[e].forEach(function(e){var n=__read(e),e=n[0],n=n.slice(1);null!=r&&r(i,e,n)}),s[e]=null)}),u};function IntegrationPlugin(t,o){t.on("init",function(){var r=[],e=t.config();e&&e.integrations&&e.integrations.forEach(function(e){var n=e.name;arrayIncludes(r,n)||(r.push(n),e.setup(t),o&&o(n,e.setup),e.tearDown&&t.destroyAgent.set(n,n,[e.tearDown]))})})}function SubjectPlugin(e,n){var r=n||{};e.provide("initSubject",function(e){var e=__read(e,2),n=e[0],e=e[1];return r[n]||(r[n]=createSafeObserver(e,function(){r[n]=void 0})),r[n]}),e.provide("getSubject",function(e){return r[e]}),e.provide("privateSubject",{})}var now=function(){return Date.now()};function getDefaultBrowser(){if("object"==typeof window&&isObject(window))return window}function getDefaultLocation(){return getDefaultBrowser()&&window.location}function getDefaultXMLHttpRequest(){if("function"==typeof XMLHttpRequest&&isFunction(XMLHttpRequest))return XMLHttpRequest}function getDefaultNavigator(){if(getDefaultBrowser()&&"navigator"in window)return window.navigator}function getDefaultNetworkInformation(){var e=getDefaultNavigator();if(e)return e.connection||e.mozConnection||e.webkitConnection}function getLocationUrl(){var e=getDefaultBrowser()&&getDefaultLocation();return null==e?void 0:e.href}var getGlobalRegistry=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar},captureCurrentContext=function(e){var n={url:getLocationUrl(),timestamp:now()},r=e.config();return null!=r&&r.pid&&(n.pid=r.pid),null!=e&&e.context&&(n.context=e.context.toString()),n},syncReportWithCapturedContext=function(r,t){return function(e){function n(e){return e.overrides=t,e}r.on("report",n),e(),r.off("report",n)}},invokeCallbackOnce=function(n){var r=!1;return[function(e){r||(r=!0,n&&n(e))}]},onPageUnload=function(e){var n,r=getDefaultBrowser();r&&(n=__read(invokeCallbackOnce(e),1)[0],["unload","beforeunload","pagehide"].forEach(function(e){r.addEventListener(e,n)}))},isSupportEncrypt=function(){return!!btoa&&!!atob};function encodeToBase64(e){return isSupportEncrypt()?btoa(encodeURI(e)):e}function decodeWithBase64(e){return isSupportEncrypt()?decodeURI(atob(e)):e}var getStorageWithDecoding=function(e){try{var n=localStorage.getItem(e),r=n,t=r=n&&"string"==typeof n?JSON.parse(decodeWithBase64(n)):r,o=t.expires,i=__rest(t,["expires"]);return o>=now()?i:void 0}catch(e){return}},setStorageWithEncoding=function(e,n,r){if(!(r<=0))try{localStorage.setItem(e,encodeToBase64(JSON.stringify(__assign(__assign({},n),{expires:now()+r}))))}catch(e){}},DEFAULT_STORAGE_EXPIRES=7776e6,formatStorageExpires=function(e){return!1===e?0:!0!==e&&void 0!==e&&isNumber(e)?e:DEFAULT_STORAGE_EXPIRES};function getNetworkType(e){return(null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||""}var InjectNetworkTypePlugin=function(e){var n=getDefaultNetworkInformation(),r=getNetworkType(n);n&&(n.onchange=function(){r=getNetworkType(n)}),e.on("report",function(e){return __assign(__assign({},e),{extra:__assign(__assign({},e.extra||{}),{network_type:r})})})},getBeaconTransport=function(){var r=getDefaultBrowser();return r&&r.navigator.sendBeacon?{get:function(){},post:function(e,n){r.navigator.sendBeacon(e,n)}}:{get:noop,post:noop}},request=function(e,n,r){var t=n.url,o=n.data,i=n.success,a=void 0===i?noop:i,i=n.fail,u=void 0===i?noop:i,i=n.getResponseText,s=void 0===i?noop:i,n=n.withCredentials,n=void 0!==n&&n,r=new r;r.withCredentials=n,r.open(e,t,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){null!=s&&s(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),a(e)):a({})}catch(e){u(e)}},r.onerror=function(){u(new Error("Network request failed"))},r.onabort=function(){u(new Error("Network request aborted"))},r.send(o)},getXhrTransport=function(){var n=getDefaultXMLHttpRequest();return n?{get:function(e){request("GET",e,n)},post:function(e){request("POST",e,n)}}:{get:noop,post:noop}};function createBrowserSender(e){function n(e){t.post(r.getEndpoint(),stringifyBatch([e]))}var r=createBatchSender(e),t=getBeaconTransport();return onPageUnload(function(){var e=r.getBatchData();e&&(t.post(r.getEndpoint(),e),r.clear()),r.send=n}),r}var browserBuilder={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:__assign(__assign({},e.extra||{}),e.overrides||{})}}};function normalizeInitConfig(e){var n,r=e.plugins||{};for(n in r)r[n]&&!isObject(r[n])&&(r[n]={});return __assign(__assign({},e),{plugins:r})}function validateInitConfig(e){return isObject(e)&&"aid"in e}function normalizeUserConfig(e){return __assign({},e)}function parseServerConfig(e){if(!e)return{};var n=e.sample,r=e.timestamp,t=e.status;if(!n)return{};var o=n.sample_rate,e=n.sample_granularity;return{sample:{include_users:n.include_users,sample_rate:t&&4===t?0:o,sample_granularity:e,rules:n.rules.reduce(function(e,n){var r=n.name,t=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[r]={enable:t,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r}}var REPORT_DOMAIN="apmplus.volces.com",SDK_VERSION="2.3.0-alpha.0",SDK_NAME="APM_PLUS_WEB",SETTINGS_PATH="/settings/get/webpro",BATCH_REPORT_PATH="/monitor_web/collect",STORAGE_PREFIX="APMPLUS",DEFAULT_IGNORE_PATHS=[BATCH_REPORT_PATH,SETTINGS_PATH,"/monitor_browser/collect"],DEFAULT_SAMPLE_CONFIG={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},DEFAULT_SENDER_SIZE=20,getReportUrl=function(e,n){return void 0===n&&(n=BATCH_REPORT_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getSettingsUrl=function(e,n){return void 0===n&&(n=SETTINGS_PATH),(e&&0<=e.indexOf("//")?"":"https://")+e+n},getViewId=function(e){return e+"_"+Date.now()},getDefaultSessionId=function(){return uuid()},getStorageKey=function(e){return STORAGE_PREFIX+e},glueCodeForStorageSecurity=function(e,n){var r=localStorage.getItem(e);if(r&&isSupportEncrypt()&&"{"===r[0])try{setStorageWithEncoding(e,JSON.parse(r),n)}catch(e){}},getStoreInfo=function(e,n){void 0===e&&(e=0);var r={userId:uuid(),deviceId:uuid(),r:Math.random()};if(n<=0)return r;e=getStorageKey(e);return glueCodeForStorageSecurity(e,n),getStorageWithDecoding(e)||r},saveStoreInfo=function(e){var n=e.aid,r=e.userId,t=e.deviceId,o=e.sample,e=e.storageExpires,n=getStorageKey(n);setStorageWithEncoding(n,{userId:r,deviceId:t,r:o.r},formatStorageExpires(e))},createBrowserConfigManager=function(n){var r,t,o,i=n,a={},u=noop,s=noop;return{getConfig:function(){return i},setConfig:function(e){return a=__assign(__assign({},a),e||{}),c(),r||(r=e,i.useLocalConfig?(o={},u()):t?f():getServerConfig(i.transport,i.domain,i.aid,function(e){t=e,f()})),i},onChange:function(e){s=e},onReady:function(e){u=function(){!function(){n.userId!==i.userId&&(n.sample.r=Math.random(),c());saveStoreInfo(i)}(),e()},o&&u()}};function c(){var e=__assign(__assign(__assign({},n),o||{}),a);e.plugins=mergeDeepConcatArray(n.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),e.sample=mergeSampleConfig(mergeSampleConfig(n.sample,null==o?void 0:o.sample),a.sample),i=e,s()}function f(){o=parseServerConfig(t),c(),u()}};function getServerConfig(e,n,r,t){e.get({withCredentials:!0,url:getSettingsUrl(n)+"?aid="+r,success:function(e){t(e.data||{})},fail:function(){t()}})}function mergeSampleConfig(t,o){if(!t||!o)return t||o;var e=__assign(__assign({},t),o);return e.include_users=__spreadArray(__spreadArray([],__read(t.include_users||[]),!1),__read(o.include_users||[]),!1),e.rules=__spreadArray(__spreadArray([],__read(Object.keys(t.rules||{})),!1),__read(Object.keys(o.rules||{})),!1).reduce(function(e,n){var r;return n in e||(n in(t.rules||{})&&n in(o.rules||{})?(e[n]=__assign(__assign({},t.rules[n]),o.rules[n]),e[n].conditional_sample_rules=__spreadArray(__spreadArray([],__read(t.rules[n].conditional_sample_rules||[]),!1),__read(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(r=t.rules)||void 0===r?void 0:r[n])||(null===(r=o.rules)||void 0===r?void 0:r[n])),e},{}),e}function getPluginFromRegistry(e,n){return e.plugins.filter(function(e){return e.name===n&&e.version===SDK_VERSION})[0]}function register(e,n,r){(r=void 0===r?getGlobalRegistry(getDefaultBrowser()):r)&&r.plugins&&(getPluginFromRegistry(r,e)||r.plugins.push({name:e,version:SDK_VERSION,apply:n}))}var addEnvToSendEvent=function(e){var n={url:getLocationUrl(),timestamp:Date.now()};return __assign(__assign({},e),{extra:__assign(__assign({},n),e.extra||{})})},InjectEnvPlugin=function(e){e.on("report",function(e){return addEnvToSendEvent(e)})},MAX_RTT=700,TimeCalibrationPlugin=function(r){var t,o=!1;r.on("init",function(){t=(new Date).getTime(),r.on("config",function(){var e,n=null===(e=r.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=(new Date).getTime())-t<MAX_RTT&&n&&(e=n-(e+t)/2,!isNaN(e)&&(0<e||e<-6e5)&&r.set({offset:e})))})})},addConfigToReportEvent=function(e,n){var r={};return r.aid=n.aid,r.pid=n.pid,r.view_id=n.viewId,r.user_id=n.userId,__assign(__assign({},e),{extra:__assign(__assign({},r),e.extra||{})})},InjectConfigPlugin=function(n){n.on("beforeBuild",function(e){return addConfigToReportEvent(e,n.config())})},InjectQueryPlugin=function(u){u.on("start",function(){var e=u.config(),n=e.deviceId,r=e.sessionId,t=e.release,o=e.env,i=e.offset,a=e.aid,e=e.token,a={did:n,sid:r,release:t,env:o,sname:SDK_NAME,sversion:SDK_VERSION,soffset:i||0,biz_id:a,x_auth_token:e},e=u.getSender();e.setEndpoint(e.getEndpoint()+joinQueryWithMap(a))})},getDefaultConfig=function(e){var n=formatStorageExpires(e.storageExpires),e=getStoreInfo(e.aid,n);return{aid:0,pid:"",token:"",viewId:getViewId("_"),userId:e.userId,deviceId:e.deviceId,sessionId:getDefaultSessionId(),storageExpires:n,domain:REPORT_DOMAIN,plugins:{ajax:{ignoreUrls:DEFAULT_IGNORE_PATHS},fetch:{ignoreUrls:DEFAULT_IGNORE_PATHS},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1},release:"",env:"production",sample:__assign(__assign({},DEFAULT_SAMPLE_CONFIG),{r:e.r}),transport:getXhrTransport()}},createMinimalBrowserClient=function(e){var n=void 0===e?{}:e,r=n.createSender,e=n.builder,n=n.createDefaultConfig,t=createClient({validateInitConfig:validateInitConfig,initConfigNormalizer:normalizeInitConfig,userConfigNormalizer:normalizeUserConfig,createSender:void 0===r?function(e){return createBrowserSender({size:DEFAULT_SENDER_SIZE,endpoint:getReportUrl(e.domain),transport:e.transport})}:r,builder:void 0===e?browserBuilder:e,createDefaultConfig:void 0===n?getDefaultConfig:n,createConfigManager:createBrowserConfigManager});ContextPlugin(t);n=getGlobalRegistry(getDefaultBrowser());SubjectPlugin(t,n&&n.subject),TimeCalibrationPlugin(t),InjectConfigPlugin(t),InjectEnvPlugin(t),InjectNetworkTypePlugin(t),InjectQueryPlugin(t);n=withCommandArray(t,captureCurrentContext,function(e,n,r){return syncReportWithCapturedContext(e,n)(function(){var e=__read(r),n=e[0],e=e.slice(1);t[n].apply(t,__spreadArray([],__read(e),!1))})});return IntegrationPlugin(n,register),n};exports.createMinimalBrowserClient=createMinimalBrowserClient,exports.getDefaultConfig=getDefaultConfig;
{
"name": "@apmplus/web",
"version": "2.2.0",
"version": "2.3.0-alpha.0",
"description": "APM Plus Web SDK",

@@ -5,0 +5,0 @@ "main": "cn/index.cjs.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc