@cloudcare/browser-logs 3.1.20 → 3.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(){"use strict";var e,t={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},n=function e(n){var r=[].slice.call(arguments,1);Object.prototype.hasOwnProperty.call(t,n)||(n=t.log),e[n].apply(e,r)};function r(e,t){var n,r=window;return r.Zone&&"function"==typeof r.Zone.__symbol__&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}n.debug=console.debug.bind(console),n.log=console.log.bind(console),n.info=console.info.bind(console),n.warn=console.warn.bind(console),n.error=console.error.bind(console);var o=!1;function i(e){o=e}function s(e){return function(){return a(e,this,arguments)}}function a(n,r,o){try{return n.apply(r,o)}catch(n){if(u(t.error,n),e)try{e(n)}catch(e){u(t.error,e)}}}function u(e){var t=[].slice.call(arguments,1);o&&n.apply(null,[e,"[MONITOR]"].concat(t))}function c(e,t){return function(){var r=[].slice.call(arguments);try{return e.apply(this,r)}catch(e){n.error(t,e)}}}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function l(){if("object"===("undefined"==typeof globalThis?"undefined":f(globalThis)))return globalThis;Object.defineProperty(Object.prototype,"_gc_temp_",{get:function(){return this},configurable:!0});var e=_gc_temp_;return delete Object.prototype._gc_temp_,"object"!==f(e)&&(e="object"===("undefined"==typeof self?"undefined":f(self))?self:"object"===("undefined"==typeof window?"undefined":f(window))?window:{}),e}function d(e,t){return r(l(),"setTimeout")(s(e),t)}function p(e){r(l(),"clearTimeout")(e)}function v(e,t){return r(window,"setInterval")(s(e),t)}function g(e){r(window,"clearInterval")(e)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}var y=Array.prototype,_=(Function.prototype,Object.prototype),m=y.slice,b=_.toString,E=_.hasOwnProperty,w=y.forEach,O=Array.isArray,S=!1,C=function(e,t,n){if(null===e)return!1;if(w&&e.forEach===w)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r,e)===S)return!1}else for(var i in e)if(E.call(e,i)&&t.call(n,e[i],i,e)===S)return!1};function x(e){return C(m.call(arguments,1),(function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}var T=function(e){return C(m.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},R=function(e){return C(m.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(U(t[n])&&U(e[n])?T(e[n],t[n]):e[n]=t[n])})),e},k=O||function(e){return"[object Array]"===b.call(e)},L=function(e){if(!e)return!1;try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},A=function(e){var t=[];return null===e||C(e,(function(e){t[t.length]=e})),t},I=function(e){var t=[];return null===e||C(e,(function(e,n){t[t.length]=n})),t},M=function(e,t,n){if(e.filter)return e.filter(t);for(var r=[],o=0;o<e.length;o++)if(E.call(e,o)){var i=e[o];t.call(n,i,o,e)&&r.push(i)}return r},D=function(e,t,n){if(e.map)return e.map(t);for(var r=[],o=0;o<e.length;o++)if(E.call(e,o)){var i=e[o];r.push(t.call(n,i,o,e))}return r},P=function(e,t,n){if(e.every)return e.every(t);for(var r=!0,o=0;o<e.length;o++)if(E.call(e,o)){var i=e[o];if(!t.call(n,i,o,e)){r=!1;break}}return r},U=function(e){return null!==e&&"[object Object]"===b.call(e)},$=function(e){if(U(e)){for(var t in e)if(E.call(e,t))return!1;return!0}return!1},B=function(e){var t=[];return C(e,(function(e,n){t.push([n,e])})),t},N=function(e){return"[object String]"===b.call(e)},G=function(e){return"[object Boolean]"===b.call(e)},W=function(e){return"[object Number]"===b.call(e)&&/[\d\.]+/.test(String(e))},F=(Date.now,function(e,t,n){var r,o,i=!n||void 0===n.leading||n.leading,s=!n||void 0===n.trailing||n.trailing,a=!1,u=this;return{throttled:function(){a?r=arguments:(i?e.apply(u,arguments):r=arguments,a=!0,o=d((function(){s&&r&&e.apply(u,r),a=!1,r=void 0}),t))},cancel:function(){p(o),a=!1,r=void 0}}}),V=function(e){for(var t,n=[],r={},o=0;o<e.length;o++)(t=e[o])in r||(r[t]=!0,n.push(t));return n};function j(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-",1e3,"-",4e3,"-",8e3,"-",1e11).replace(/[018]/g,j)}var H=function(e){var t=function(e){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=null,this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,void 0!==e&&this._parse(e)};return t.prototype.setUrl=function(e){this._parse(e)},t.prototype._initValues=function(){for(var e in this._fields)this._values[e]=""},t.prototype.addQueryString=function(e){if("object"!==h(e))return!1;var t=this._values.QueryString||"";for(var n in e)t=new RegExp(n+"[^&]+").test(t)?t.replace(new RegExp(n+"[^&]+"),n+"="+e[n]):"&"===t.slice(-1)?t+n+"="+e[n]:""===t?n+"="+e[n]:t+"&"+n+"="+e[n];this._values.QueryString=t},t.prototype.getParse=function(){return this._values},t.prototype.getUrl=function(){var e="";return e+=this._values.Origin,e+=this._values.Path,e+=this._values.QueryString?"?"+this._values.QueryString:""},t.prototype._parse=function(e){this._initValues();var t=this._regex.exec(e);if(!t)throw"DPURLParser::_parse -> Invalid URL";for(var n in this._fields)void 0!==t[this._fields[n]]&&(this._values[n]=t[this._fields[n]]);this._values.Path=this._values.Path||"/",this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname+(this._values.Port?":"+this._values.Port:"")},new t(e)};function q(e){return null===e?"null":Array.isArray(e)?"array":h(e)}function Q(e,t,n){if(void 0===n&&(n=function(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!==h(t)||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;i<t.length;++i)o[i]=Q(o[i],t[i],n);return o}o="object"===q(e)?e:{};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(o[s]=Q(o[s],t[s],n));return o}}function K(e){return Q(void 0,e)}function z(){}var X,Y=1e3,J=60*Y,Z=60*J;function ee(e){return 0!==e&&100*Math.random()<=e}function te(){return performance.now()}function ne(){return{relative:te(),timeStamp:re()}}function re(){return oe()}function oe(){return(new Date).getTime()}function ie(){return void 0===X&&(X=performance.timing.navigationStart),X}var se=/([\w-]+)\s*=\s*([^;]+)/g;function ae(e,t){for(var n=t.split(".");n.length;){var r=n.shift();if(!(e&&r in e&&E.call(e,r)))return;e=e[r]}return e}function ue(e,t){var n=e.charCodeAt(t-1);return n>=55296&&n<=56319?e.slice(0,t+1):e.slice(0,t)}function ce(e,t){return-1!==e.indexOf(t)}function fe(e){if(Array.from)return Array.from(e);var t=[];if(e instanceof Set)e.forEach((function(e){t.push(e)}));else for(var n=0;n<e.length;n++)t.push(e[n]);return t}function le(e){return W(e)&&e>=0&&e<=100}var de,pe={IE:0,CHROMIUM:1,SAFARI:2,OTHER:3};function ve(){return ye(de,de=function(e){var t;void 0===e&&(e=window);var n=e.navigator.userAgent;if(e.chrome||/HeadlessChrome/.test(n))return pe.CHROMIUM;if(0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return pe.SAFARI;if(e.document.documentMode)return pe.IE;return pe.OTHER}())}function ge(e){var t={};return C(e,(function(e,n){var r;t[(r=n,r.replace(/[A-Z]/g,(function(e,t){return(0!==t?"_":"")+e.toLowerCase()})).replace(/-/g,"_"))]=he(e)})),t}function he(e){return k(e)?D(e,(function(e){return he(e)})):"object"===h(e)&&null!==e?ge(e):e}function ye(e,t){return null!=e?e:t}function _e(e,t){return e.slice(0,t.length)===t}var me=function(){this.buffer=[]};me.prototype={add:function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},drain:function(){C(this.buffer,(function(e){e()})),this.buffer.length=0}};var be=me;function Ee(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return we(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return we(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function we(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Oe=1/0,Se=J;function Ce(e){var t=e.expireDelay,n=e.maxEntries,r=[],o=v((function(){return function(){var e=te()-t;for(;r.length>0&&r[r.length-1].endTime<e;)r.pop()}()}),Se);return{add:function(e,t){var o={value:e,startTime:t,endTime:Oe,remove:function(){var e,t,n;t=o,(n=(e=r).indexOf(t))>=0&&e.splice(n,1)},close:function(e){o.endTime=e}};return n&&r.length>=n&&r.pop(),r.unshift(o),o},find:function(e,t){void 0===e&&(e=Oe),void 0===t&&(t={returnInactive:!1});var n,o=Ee(r);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i.startTime<=e){if(t.returnInactive||e<=i.endTime)return i.value;break}}}catch(e){o.e(e)}finally{o.f()}},closeActive:function(e){var t=r[0];t&&t.endTime===Oe&&t.close(e)},findAll:function(e,t){void 0===e&&(e=Oe),void 0===t&&(t=0);var n=e+t;return r.filter((function(t){return t.startTime<=n&&e<=t.endTime})).map((function(e){return e.value}))},reset:function(){r=[]},stop:function(){g(o)}}}var xe={navigator:"undefined"!=typeof window&&void 0!==window.navigator?window.navigator:{},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","IE 11","IE 10","IE 9","IE 8","IE 7","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat",,"WechatWork","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},Te={getMatchMap:s((function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,Edge:e.indexOf("Edge")>-1||e.indexOf("Edg")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}})),matchInfoMap:s((function(e){var t=xe.navigator.userAgent||"",n=Te.getMatchMap(t);for(var r in xe.infoMap)for(var o=0;o<xe.infoMap[r].length;o++){var i=xe.infoMap[r][o];n[i]&&(e[r]=i)}})),getOS:s((function(){return Te.matchInfoMap(this),this.os||"Unknown"})),getOSVersion:s((function(){var e=this,t=xe.navigator.userAgent||"";e.osVersion="",e.osMajor="";var n={Windows:function(){var e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return t.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return t.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return n[e.os]&&(e.osVersion=n[e.os](),e.osVersion===t&&(e.osVersion="")),e.osVersion&&(e.osMajor=e.osVersion.split(".").length&&e.osVersion.split(".")[0]),{version:e.osVersion,osMajor:e.osMajor}})),getOrientationStatu:s((function(){return window.matchMedia("(orientation: portrait)").matches?"竖屏":"横屏"})),getDeviceType:s((function(){var e=this;return e.device="PC",Te.matchInfoMap(e),e.device})),getNetwork:s((function(){var e=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,t="unknown",n=e?e.type||e.effectiveType:null;if(n&&"string"==typeof n)switch(n){case"bluetooth":case"cellular":case"slow-2g":case"2g":case"3g":t="cellular";break;case"none":t="none";break;case"ethernet":case"wifi":case"wimax":case"4g":t="wifi";break;case"other":case"unknown":t="unknown"}return t})),getLanguage:s((function(){var e;return this.language=((e=(xe.navigator.browserLanguage||xe.navigator.language||"").split("-"))[1]&&(e[1]=e[1].toUpperCase()),e.join("_")),this.language})),getBrowserInfo:s((function(){var e=this;Te.matchInfoMap(e);var t=xe.navigator.userAgent||"",n=function(e,t){var n=xe.navigator.mimeTypes;for(var r in n)if(n[r][e]==t)return!0;return!1},r=Te.getMatchMap(t),o=!1;if("undefined"!=typeof window&&window.chrome){var i=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");i>36&&window.showModalDialog?o=!0:i>45&&(o=n("type","application/vnd.chromium.remoting-viewer"))}if(r.Baidu&&r.Opera&&(r.Baidu=!1),r.Mobile&&(r.Mobile=!(t.indexOf("iPad")>-1)),o&&(n("type","application/gameplugin")||xe.navigator&&xe.navigator.connection&&void 0===xe.navigator.connection.saveData?r["360SE"]=!0:r["360EE"]=!0),r.IE||r.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 74:case 105:default:break;case 102:r["360EE"]=!0;break;case 104:r["360SE"]=!0}var s={Safari:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return t.replace(/^.*Edge?\/([\d.]+).*$/,"$1")},Firefox:function(){return t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return t.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return t.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return t.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return t.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return t.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return t.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return t.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return t.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return t.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return t.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return t.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return t.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return t.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return t.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){var e="";t.indexOf("LieBaoFast")>-1&&(e=t.replace(/^.*LieBaoFast\/([\d.]+).*$/,"$1"));var n=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");return e||{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[n]||""},"2345Explorer":function(){return t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return t.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return t.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},WechatWork:function(){return t.replace(/^.*wxwork\/([\d.]+).*$/,"$1")},Taobao:function(){return t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return t.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",e.browserMajor="",s[e.browser]&&(e.browserVersion=s[e.browser](),e.browserVersion==t&&(e.browserVersion="")),"Chrome"==e.browser&&t.match(/\S+Browser/)&&(e.browser=t.match(/\S+Browser/)[0],e.version=t.replace(/^.*Browser\/([\d.]+).*$/,"$1")),"Edge"==e.browser&&(e.version>"75"?e.engine="Blink":e.engine="EdgeHTML"),("Chrome"==e.browser&&parseInt(e.browserVersion)>27||r.Chrome&&"WebKit"==e.engine&&parseInt(e.browserVersion)>27||"Opera"==e.browser&&parseInt(e.version)>12||"Yandex"==e.browser)&&(e.engine="Blink"),e.browserVersion&&(e.browserMajor=e.browserVersion.split(".").length&&this.browserVersion.split(".")[0]),{browser:e.browser,browserVersion:e.browserVersion,engine:e.engine,browserMajor:e.browserMajor}})),getGeoPostion:s((function(e){navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition((function(t){e(t)}),(function(e){n.warn(e)}))}))},Re={};"undefined"!=typeof window&&(Re={os:Te.getOS(),osVersion:Te.getOSVersion().version,osVersionMajor:Te.getOSVersion().osMajor,browser:Te.getBrowserInfo().browser,browserVersion:Te.getBrowserInfo().browserVersion,browserVersionMajor:Te.getBrowserInfo().browserMajor,screenSize:window.screen.width+"*"+window.screen.height,networkType:Te.getNetwork(),device:Te.getDeviceType()});var ke=Re,Le={BEFORE_UNLOAD:"beforeunload",CLICK:"click",DBL_CLICK:"dblclick",KEY_DOWN:"keydown",LOAD:"load",POP_STATE:"popstate",SCROLL:"scroll",TOUCH_START:"touchstart",TOUCH_END:"touchend",TOUCH_MOVE:"touchmove",VISIBILITY_CHANGE:"visibilitychange",PAGE_SHOW:"pageshow",FREEZE:"freeze",RESUME:"resume",DOM_CONTENT_LOADED:"DOMContentLoaded",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_CANCEL:"pointercancel",HASH_CHANGE:"hashchange",PAGE_HIDE:"pagehide",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_MOVE:"mousemove",FOCUS:"focus",BLUR:"blur",CONTEXT_MENU:"contextmenu",RESIZE:"resize",CHANGE:"change",INPUT:"input",PLAY:"play",PAUSE:"pause",SECURITY_POLICY_VIOLATION:"securitypolicyviolation",SELECTION_CHANGE:"selectionchange",STORAGE:"storage"},Ae={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",LOGGER:"logger"},Ie={FETCH:"fetch",XHR:"xhr"},Me={HANDLED:"handled",UNHANDLED:"unhandled"},De={UNCAUGHT:"Uncaught",PROVIDED:"Provided"};function Pe(e){return Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pe(e)}function Ue(e,t,n){if("object"!==Pe(e)||null===e)return JSON.stringify(e);var r=$e(Object.prototype),o=$e(Array.prototype),i=$e(Object.getPrototypeOf(e)),s=$e(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),s()}}function $e(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):z}function Be(e){return Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Be(e)}var Ne="?";function Ge(e){var t=[],n=ze(e,"stack");return n&&C(n.split("\n"),(function(e){var n=function(e){var t=Ve.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=je.exec(t[2]);r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||Ne,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=He.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:Ne,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=qe.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Ne,line:+t[3],url:t[2]}}(e)||function(e){var t=Qe.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=Ke.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||Ne,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=Ne),t.push(n))})),{message:ze(e,"message"),name:ze(e,"name"),stack:t}}var We="((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\w+\\.|\\/).*?)",Fe="(?::(\\d+))",Ve=new RegExp("^\\s*at (.*?) ?\\("+We+Fe+"?"+Fe+"?\\)?\\s*$","i"),je=new RegExp("\\((\\S*)"+Fe+Fe+"\\)");var He=new RegExp("^\\s*at ?"+We+Fe+"?"+Fe+"??\\s*$","i");var qe=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var Qe=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Ke=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function ze(e,t){if("object"===Be(e)&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}var Xe=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Ye(e){var t=function(e){return ht(window,"onerror",(function(t){var n,r=t.parameters,o=r[0],i=r[1],s=r[2],a=r[3],u=r[4];if(u instanceof Error)n=Ge(u);else{var c={url:i,column:a,line:s},f=function(e){var t,n;if("[object String]"==={}.toString.call(e)){var r=Xe.exec(e);r&&(t=r[1],n=r[2])}return{name:t,message:n}}(o);n={name:f.name,message:f.message,stack:[c]}}e(n,ye(u,o))}))}(e),n=function(e){return ht(window,"onunhandledrejection",(function(t){var n=t.parameters[0].reason||"Empty reason",r=Ge(n);e(r,n)}))}(e);return{stop:function(){t.stop(),n.stop()}}}var Je=1024,Ze=1024*Je,et=/[^\u0000-\u007F]/;function tt(e){return et.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function nt(e){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nt(e)}var rt=220*Je,ot="$",it=3;function st(e,t){void 0===t&&(t=rt);var n=$e(Object.prototype),r=$e(Array.prototype),o=[],i=new WeakMap,s=at(e,ot,void 0,o,i),a=JSON.stringify(s)&&JSON.stringify(s).length||0;if(!(a>t)){for(;o.length>0&&a<t;){var u=o.shift(),c=0;if(Array.isArray(u.source))for(var f=0;f<u.source.length;f++){if(a+=void 0!==(l=at(u.source[f],u.path,f,o,i))?JSON.stringify(l).length:4,a+=c,c=1,a>t){ut(t,"truncated",e);break}u.target[f]=l}else for(var f in u.source)if(Object.prototype.hasOwnProperty.call(u.source,f)){var l;if(void 0!==(l=at(u.source[f],u.path,f,o,i))&&(a+=JSON.stringify(l).length+c+f.length+it,c=1),a>t){ut(t,"truncated",e);break}u.target[f]=l}}return n(),r(),s}ut(t,"discarded",e)}function at(e,t,n,r,o){var i=function(e){var t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!i||"object"!==nt(i))return function(e){if("bigint"==typeof e)return"[BigInt] "+e.toString();if("function"==typeof e)return"[Function] "+e.name||0;if("symbol"===nt(e))return"[Symbol] "+e.description||0;return e}(i);var s=function(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return"["+t[1]+"]"}catch(e){}return"[Unserializable]"}(i);if("[Object]"!==s&&"[Array]"!==s&&"[Error]"!==s)return s;var a=e;if(o.has(a))return"[Reference seen at "+o.get(a)+"]";var u=void 0!==n?t+"."+n:t,c=Array.isArray(i)?[]:{};return o.set(a,u),r.push({source:i,target:c,path:u}),c}function ut(e,t,r){n.warn("The data provided has been "+t+" as it is over the limit of "+e+" characters:",r)}var ct="No stack, consider using an instance of Error",ft={AGENT:"agent",CONSOLE:"console",NETWORK:"network",SOURCE:"source",LOGGER:"logger",CUSTOM:"custom"};function lt(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,s=e.source,a=e.handling,u=n instanceof Error,c=function(e,t,n,r){return e&&e.message&&e&&e.name?e.message:t?"Empty message":n+" "+Ue(st(r))}(t,u,i,n),f=function(e,t){if(void 0===t)return!1;if(e)return!0;return t.stack.length>0&&(t.stack.length>1||void 0!==t.stack[0].url)}(u,t)?pt(t):ct,l=u?gt(n,s):void 0;return{startClocks:o,source:s,handling:a,originalError:n,message:c,stack:f,handlingStack:r,type:t&&t.name,causes:l}}function dt(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return a((function(){var n=Ge(t);n.stack=n.stack.slice(2),e=pt(n)})),e}function pt(e){var t=vt(e);return C(e.stack,(function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",o=e.line?":"+e.line:"",i=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+o+i})),t}function vt(e){return(e.name||"Error")+": "+e.message}function gt(e,t){for(var n=e,r=[];n&&n.cause instanceof Error&&r.length<10;){var o=Ge(n.cause);r.push({message:n.cause.message,source:t,type:o&&o.name,stack:o&&pt(o)}),n=n.cause}return r.length?r:void 0}function ht(e,t,n,r){var o=r&&r.computeHandlingStack,i=e[t];if("function"!=typeof i){if(!_e(t,"on"))return{stop:z};i=z}var s=!1,u=function(){if(s)return i.apply(this,arguments);var e,t=fe(arguments);a(n,null,[{target:this,parameters:t,onPostCall:function(t){e=t},handlingStack:o?dt():void 0}]);var r=i.apply(this,t);return e&&a(e,null,[r]),r};return e[t]=u,{stop:function(){s=!0,e[t]===u&&(e[t]=i)}}}var yt=function(e){this.observers=[],this.onLastUnsubscribe=void 0,this.onFirstSubscribe=e};yt.prototype={subscribe:function(e){!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),this.observers.push(e);var t=this;return{unsubscribe:function(){t.observers=M(t.observers,(function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},notify:function(e){C(this.observers,(function(t){t(e)}))}};var _t=yt;function mt(){var e=[].slice.call(arguments);return new _t((function(t){var n=D(e,(function(e){return e.subscribe((function(e){return t.notify(e)}))}));return function(){return C(n,(function(e){return e.unsubscribe()}))}}))}var bt={};function Et(e){var n=D(e,(function(e){return bt[e]||(bt[e]=function(e){return new _t((function(n){var r=console[e];return console[e]=function(){var o=[].slice.call(arguments);r.apply(console,arguments);var i=dt();a((function(){n.notify(function(e,n,r){var o,i,s=D(e,(function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return vt(Ge(e));return Ue(e,void 0,2)}(e)})).join(" ");if(n===t.error){var a=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n,e))return r}}(e,(function(e){return e instanceof Error}));o=a?pt(Ge(a)):void 0,s="console error: "+s,i=a?gt(a,"console"):void 0}return{api:n,message:s,stack:o,handlingStack:r,causes:i}}(o,e,i))}))},function(){console[e]=r}}))}(e)),bt[e]}));return mt.apply(this,n)}function wt(e,t,n,r){return Ot(e,[t],n,r)}function Ot(e,t,n,o){var i=s(o&&o.once?function(e){u(),n(e)}:n);o=o&&o.passive?{capture:o.capture,passive:o.passive}:o&&o.capture;var a=r(e,"addEventListener");C(t,(function(t){a.call(e,t,i,o)}));var u=function(){var n=r(e,"removeEventListener");C(t,(function(t){n.call(e,t,i,o)}))};return{stop:u}}var St={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Ct(e,t){var n=[];ce(t,St.cspViolation)&&n.push(new _t((function(e){var t=function(t){e.notify(function(e){var t=St.cspViolation,n="'"+e.blockedURI+"' blocked by '"+e.effectiveDirective+"' directive";return{type:St.cspViolation,subtype:e.effectiveDirective,message:t+": "+n,stack:xt(e.effectiveDirective,n+' of the policy "'+ue(e.originalPolicy,100)+'"',e.sourceFile,e.lineNumber,e.columnNumber)}}(t))};return wt(document,Le.SECURITY_POLICY_VIOLATION,t).stop})));var r=M(t,(function(e){return e!==St.cspViolation}));return r.length&&n.push(function(e){return new _t((function(t){if(window.ReportingObserver){var n=s((function(e){C(e,(function(e){t.notify(function(e){var t=e.body,n=e.type;return{type:n,subtype:t.id,message:n+": "+t.message,stack:xt(t.id,t.message,t.sourceFile,t.lineNumber,t.columnNumber)}}(e))}))})),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}}))}(r)),mt.apply(this,n)}function xt(e,t,n,r,o){return n&&pt({name:e,message:t,stack:[{func:"?",url:n,line:r,column:o}]})}var Tt=function(){this._events=[],this.pendingEvents=[]};Tt.prototype={emit:function(e){var t=[].slice.call(arguments,1);C(this._events,(function(n){if(n.type!==e)return!1;n.callback.apply(n.context,t)}))},on:function(e,t,n){"function"==typeof t&&this._events.push({type:e,callback:t,context:n||this})}};new Tt;var Rt,kt={PERFORMANCE_ENTRIES_COLLECTED:"PERFORMANCE_ENTRIES_COLLECTED",AUTO_ACTION_COMPLETED:"AUTO_ACTION_COMPLETED",BEFORE_VIEW_CREATED:"BEFORE_VIEW_CREATED",VIEW_CREATED:"VIEW_CREATED",VIEW_UPDATED:"VIEW_UPDATED",VIEW_ENDED:"VIEW_ENDED",AFTER_VIEW_ENDED:"AFTER_VIEW_ENDED",SESSION_RENEWED:"SESSION_RENEWED",SESSION_EXPIRED:"SESSION_EXPIRED",PAGE_EXITED:"PAGE_EXITED",REQUEST_STARTED:"REQUEST_STARTED",REQUEST_COMPLETED:"REQUEST_COMPLETED",RAW_RUM_EVENT_COLLECTED:"RAW_RUM_EVENT_COLLECTED",RUM_EVENT_COLLECTED:"RUM_EVENT_COLLECTED",RAW_ERROR_COLLECTED:"RAW_ERROR_COLLECTED",RAW_LOG_COLLECTED:"RAW_LOG_COLLECTED",LOG_COLLECTED:"LOG_COLLECTED"};function Lt(){this.callbacks={}}function At(e){return It(e,function(e){if(e.origin&&"null"!==e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}(window.location)).href}function It(e,t){if(function(){if(void 0!==Rt)return Rt;try{var e=new URL("http://test/path");return Rt="http://test/path"===e.href}catch(e){Rt=!1}return Rt}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: "+e);var n=document,r=n.createElement("a");if(void 0!==t){var o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=t,n.head.appendChild(o),n.body.appendChild(r)}return r.href=e,r}Lt.prototype={notify:function(e,t){var n=this.callbacks[e];n&&C(n,(function(e){e(t)}))},subscribe:function(e,t){this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t);var n=this;return{unsubscribe:function(){n.callbacks[e]=M(n.callbacks[e],(function(e){return e!==t}))}}}};var Mt=navigator.userAgent.toLowerCase(),Dt=function(){return/iphone os/.test(Mt)};var Pt;function Ut(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires="+o.toUTCString(),s=r&&r.crossSite?"none":"strict",a=r&&r.domain?";domain="+r.domain:"",u=r&&r.secure?";secure":"",c=r&&r.partitioned?";partitioned":"";document.cookie=e+"="+t+";"+i+";path=/;samesite="+s+a+u+c}function $t(e){return function(e,t){for(se.lastIndex=0;;){var n=se.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}var Bt=/^\s+|\s+$/g,Nt={rum:"/rum",log:"/logging",sessionReplay:"/rum/replay"};function Gt(e,t){var n=Nt[t];if(!n)return"";var r=e.datakitOrigin||e.datakitUrl||e.site;0===r.indexOf("/")&&(r=location.origin+Wt(r));var o=r;return o=r.lastIndexOf("/")===r.length-1?Wt(r)+"v1/write"+n:Wt(r)+"/v1/write"+n,e.site&&e.clientToken&&(o=o+"?token="+e.clientToken+"&to_headless=true"),o}function Wt(e){return e.replace(Bt,"")}var Ft,Vt;function jt(e){if(void 0===e.sampleRate||le(e.sampleRate))if(void 0===e.sessionSampleRate||le(e.sessionSampleRate)){if(void 0===e.telemetrySampleRate||le(e.telemetrySampleRate)){var t=e.sessionSampleRate||e.sampleRate;return x({beforeSend:e.beforeSend&&c(e.beforeSend,"beforeSend threw an error:"),cookieOptions:Ht(e),sessionSampleRate:ye(t,100),service:e.service,version:e.version,env:e.env,telemetrySampleRate:ye(e.telemetrySampleRate,100),telemetryEnabled:ye(e.telemetryEnabled,!1),silentMultipleInit:!!e.silentMultipleInit,batchBytesLimit:16*Je,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Y,batchMessagesLimit:50,messageBytesLimit:256*Je,resourceUrlLimit:5*Je,storeContextsToLocal:!!e.storeContextsToLocal,storeContextsKey:e.storeContextsKey,sendContentTypeByJson:!!e.sendContentTypeByJson},function(e){var t=function(e){return!1};"isIntakeUrl"in e&&L(e.isIntakeUrl)&&G(e.isIntakeUrl())&&(t=e.isIntakeUrl);var n=function(e){return!1};return"isServerError"in e&&L(e.isServerError)&&G(e.isServerError())&&(n=e.isServerError),{rumEndpoint:Gt(e,"rum"),logsEndpoint:Gt(e,"log"),sessionReplayEndPoint:Gt(e,"sessionReplay"),isIntakeUrl:t,isServerError:n}}(e))}n.error("Telemetry Sample Rate should be a number between 0 and 100")}else n.error("Sample Rate should be a number between 0 and 100");else n.error("Sample Rate should be a number between 0 and 100")}function Ht(e){var t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===Pt){for(var e="gc_site_test_".concat(j()),t=window.location.hostname.split("."),n=t.pop();t.length&&!$t(e);)n=t.pop()+"."+n,Ut(e,"test",Y,{domain:n});Pt=n}return Pt}()),t}function qt(){return Ft||(Ft=new _t((function(e){if(window.fetch){var t=ht(window,"fetch",(function(t){return function(e,t){var n=e.parameters,r=e.onPostCall,o=e.handlingStack,i=n[0],a=n[1],u=a&&a.method;void 0===u&&i instanceof Request&&(u=i.method);var c=void 0!==u?String(u).toUpperCase():"GET",f=i instanceof Request?i.url:At(String(i)),l=ne(),d={state:"start",init:a,input:i,method:c,startClocks:l,url:f,handlingStack:o};t.notify(d),n[0]=d.input,n[1]=d.init,r((function(e){return function(e,t,n){var r=n,o=function(t){r.state="resolve",x(r,t),e.notify(r)};t.then(s((function(e){var t="";try{t=e.constructor===Response&&e.type||""}catch(e){t=""}o({response:e,responseType:t,status:e.status,isAborted:!1})})),s((function(e){o({status:0,isAborted:r.init&&r.init.signal&&r.init.signal.aborted||e instanceof DOMException&&e.code===DOMException.ABORT_ERR,error:e})})))}(t,e,d)}))}(t,e)}),{computeHandlingStack:!0});return t.stop}}))),Ft}var Qt=new WeakMap;function Kt(){return Vt||(Vt=new _t((function(e){var t=ht(XMLHttpRequest.prototype,"open",zt),n=ht(XMLHttpRequest.prototype,"send",(function(t){!function(e,t){var n=e.target,r=e.handlingStack,o=Qt.get(n);if(o){var i=o;i.state="start",i.startClocks=ne(),i.isAborted=!1,i.xhr=n,i.handlingStack=r;var s=!1,a=ht(n,"onreadystatechange",(function(){n.readyState===XMLHttpRequest.DONE&&u()})).stop,u=function(){if(c(),a(),!s){s=!0;var e,r=o;r.state="complete",r.duration=(e=i.startClocks.timeStamp,re()-e),r.status=n.status,t.notify(x({},r))}},c=wt(n,"loadend",u).stop;t.notify(i)}}(t,e)}),{computeHandlingStack:!0}),r=ht(XMLHttpRequest.prototype,"abort",Xt);return function(){t.stop(),n.stop(),r.stop()}}))),Vt}function zt(e){var t=e.target,n=e.parameters[0],r=e.parameters[1];Qt.set(t,{state:"open",method:String(n).toUpperCase(),url:At(String(r))})}function Xt(e){var t=e.target,n=Qt.get(t);n&&(n.isAborted=!0)}var Yt={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var Jt,Zt={sdk_name:"_gc.sdk_name",sdk_version:"_gc.sdk_version",app_id:"application.id",env:"env",service:"service",version:"version",source:"source",userid:"user.id",user_email:"user.email",user_name:"user.name",session_id:"session.id",session_type:"session.type",session_sampling:"session.is_sampling",is_signin:"user.is_signin",os:"device.os",os_version:"device.os_version",os_version_major:"device.os_version_major",browser:"device.browser",browser_version:"device.browser_version",browser_version_major:"device.browser_version_major",screen_size:"device.screen_size",network_type:"device.network_type",device:"device.device",view_id:"view.id",view_referrer:"view.referrer",view_url:"view.url",view_host:"view.host",view_path:"view.path",view_name:"view.path",view_path_group:"view.path_group"},en={view_url_query:"view.url_query",action_id:"action.id",action_ids:"action.ids",view_in_foreground:"view.in_foreground",display:"display",session_has_replay:"session.has_replay",is_login:"user.is_login",page_states:"_gc.page_states",session_sample_rate:"_gc.configuration.session_sample_rate",session_replay_sample_rate:"_gc.configuration.session_replay_sample_rate",drift:"_gc.drift"},tn={view:{type:Ae.VIEW,tags:{view_loading_type:"view.loading_type",view_apdex_level:"view.apdex_level",view_privacy_replay_level:"privacy.replay_level"},fields:{sampled_for_replay:"session.sampled_for_replay",is_active:"view.is_active",session_replay_stats:"_gc.replay_stats",session_is_active:"session.is_active",view_error_count:"view.error.count",view_resource_count:"view.resource.count",view_long_task_count:"view.long_task.count",view_action_count:"view.action.count",first_contentful_paint:"view.first_contentful_paint",largest_contentful_paint:"view.largest_contentful_paint",largest_contentful_paint_element_selector:"view.largest_contentful_paint_element_selector",cumulative_layout_shift:"view.cumulative_layout_shift",cumulative_layout_shift_time:"view.cumulative_layout_shift_time",cumulative_layout_shift_target_selector:"view.cumulative_layout_shift_target_selector",first_input_delay:"view.first_input_delay",loading_time:"view.loading_time",dom_interactive:"view.dom_interactive",dom_content_loaded:"view.dom_content_loaded",dom_complete:"view.dom_complete",load_event:"view.load_event",first_input_time:"view.first_input_time",first_input_target_selector:"view.first_input_target_selector",first_paint_time:"view.fpt",interaction_to_next_paint:"view.interaction_to_next_paint",interaction_to_next_paint_target_selector:"view.interaction_to_next_paint_target_selector",resource_load_time:"view.resource_load_time",time_to_interactive:"view.tti",dom:"view.dom",dom_ready:"view.dom_ready",time_spent:"view.time_spent",first_byte:"view.first_byte",frustration_count:"view.frustration.count",custom_timings:"view.custom_timings"}},resource:{type:Ae.RESOURCE,tags:{trace_id:"_gc.trace_id",span_id:"_gc.span_id",resource_url:"resource.url",resource_url_host:"resource.url_host",resource_url_path:"resource.url_path",resource_url_path_group:"resource.url_path_group",resource_url_query:"resource.url_query",resource_type:"resource.type",resource_status:"resource.status",resource_status_group:"resource.status_group",resource_method:"resource.method"},fields:{duration:"resource.duration",resource_size:"resource.size",resource_encode_size:"resource.encoded_body_size",resource_decode_size:"resource.decoded_body_size",resource_transfer_size:"resource.transfer_size",resource_render_blocking_status:"resource.render_blocking_status",resource_dns:"resource.dns",resource_tcp:"resource.tcp",resource_ssl:"resource.ssl",resource_ttfb:"resource.ttfb",resource_trans:"resource.trans",resource_redirect:"resource.redirect",resource_first_byte:"resource.firstbyte",resource_dns_time:"resource.dns_time",resource_download_time:"resource.download_time",resource_first_byte_time:"resource.first_byte_time",resource_connect_time:"resource.connect_time",resource_ssl_time:"resource.ssl_time",resource_redirect_time:"resource.redirect_time"}},error:{type:Ae.ERROR,tags:{error_id:"error.id",trace_id:"_gc.trace_id",span_id:"_gc.span_id",error_source:"error.source",error_type:"error.type",error_handling:"error.handling"},fields:{error_message:["string","error.message"],error_stack:["string","error.stack"],error_causes:["string","error.causes"],error_handling_stack:["string","error.handling_stack"]}},long_task:{type:Ae.LONG_TASK,tags:{long_task_id:"long_task.id"},fields:{duration:"long_task.duration"}},action:{type:Ae.ACTION,tags:{action_type:"action.type"},fields:{action_name:"action.target.name",duration:"action.loading_time",action_error_count:"action.error.count",action_resource_count:"action.resource.count",action_frustration_types:"action.frustration.type",action_long_task_count:"action.long_task.count",action_target:"_gc.action.target",action_position:"_gc.action.position"}},telemetry:{type:"telemetry",fields:{status:"telemetry.status",message:["string","telemetry.message"],type:"telemetry.type",error_stack:["string","telemetry.error.stack"],error_kind:["string","telemetry.error.kind"]}},browser_log:{type:Ae.LOGGER,tags:{error_source:"error.source",error_type:"error.type",error_resource_url:"http.url",error_resource_url_host:"http.url_host",error_resource_url_path:"http.url_path",error_resource_url_path_group:"http.url_path_group",error_resource_status:"http.status_code",error_resource_status_group:"http.status_group",error_resource_method:"http.method",action_id:"user_action.id",service:"service",status:"status"},fields:{message:["string","message"]}}},nn=4*Z,rn=15*J,on=/^([a-z]+)=([a-z0-9-]+)$/,sn="&",an="_dataflux_s",un=10,cn=100,fn=[];function ln(e,t){if(void 0===t&&(t=0),Jt||(Jt=e),e===Jt)if(t>=cn)vn();else{var n,r=hn();if(dn()){if(r.lock)return void pn(e,t);if(n=j(),r.lock=n,gn(r,e.options),(r=hn()).lock!==n)return void pn(e,t)}var o=e.process(r);if(dn()&&(r=hn()).lock!==n)pn(e,t);else{if(o&&function(e,t){if(yn(e))return void _n(t);e.expire=String(oe()+rn),gn(e,t)}(o,e.options),dn()&&(!o||!yn(o))){if((r=hn()).lock!==n)return void pn(e,t);delete r.lock,gn(r,e.options),o=r}e.after&&e.after(o||r),vn()}}else fn.push(e)}function dn(){return ve()===pe.CHROMIUM}function pn(e,t){d((function(){ln(e,t+1)}),un)}function vn(){Jt=void 0;var e=fn.shift();e&&ln(e)}function gn(e,t){Ut(an,function(e){return D(B(e),(function(e){return e[0]+"="+e[1]})).join(sn)}(e),rn,t)}function hn(){var e=$t(an),t={};return function(e){return void 0!==e&&(-1!==e.indexOf(sn)||on.test(e))}(e)&&C(e.split(sn),(function(e){var n=on.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}function yn(e){return $(e)}function _n(e){Ut(an,"",0,e)}var mn=Y;function bn(e,t,n){var r=new _t,o=new _t,i=v((function(){ln({options:e,process:function(e){return d(e)?void 0:{}},after:f})}),mn),s=function(){var e=hn();if(d(e))return e;return{}}(),a=F((function(){var o;ln({options:e,process:function(e){var r=f(e);return o=function(e){var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,i&&!e.id&&(e.id=j(),e.created=String(oe()));return i}(r),r},after:function(e){o&&!l()&&function(e){s=e,r.notify()}(e),s=e}})}),mn),u=a.throttled,c=a.cancel;function f(e){return d(e)||(e={}),l()&&(!function(e){return s.id!==e.id||s[t]!==e[t]}(e)?s=e:(s={},o.notify())),e}function l(){return void 0!==s[t]}function d(e){return(void 0===e.created||oe()-Number(e.created)<nn)&&(void 0===e.expire||oe()<Number(e.expire))}return{expandOrRenewSession:u,expandSession:function(){ln({options:e,process:function(e){return l()?f(e):void 0}})},getSession:function(){return s},renewObservable:r,expireObservable:o,expire:function(){c(),_n(e),f({})},stop:function(){g(i)}}}var En=J,wn=nn,On=[],Sn=function(e,t,n){var r=new _t,o=new _t,i=bn(e,t,n);On.push((function(){return i.stop()}));var s,a,u=Ce({expireDelay:wn});function c(){return{id:i.getSession().id,trackingType:i.getSession()[t]}}return On.push((function(){return u.stop()})),i.renewObservable.subscribe((function(){u.add(c(),te()),r.notify()})),i.expireObservable.subscribe((function(){o.notify(),u.closeActive(te())})),i.expandOrRenewSession(),u.add(c(),[0,ie()][0]),s=function(){return i.expandOrRenewSession()},a=Ot(window,[Le.CLICK,Le.TOUCH_START,Le.KEY_DOWN,Le.SCROLL],s,{capture:!0,passive:!0}),On.push(a.stop),function(e){var t=function(){"visible"===document.visibilityState&&e()},n=wt(document,Le.VISIBILITY_CHANGE,t);On.push(n.stop);var r=v(t,En);On.push((function(){g(r)}))}((function(){return i.expandSession()})),{findActiveSession:function(e){return u.find(e)},renewObservable:r,expireObservable:o,expire:i.expire}};var Cn=80*Je,xn=32,Tn=3*Ze,Rn=256*Y,kn=Y,Ln={UP:0,FAILURE_DETECTED:1,DOWN:2},An={AFTER_SUCCESS:0,AFTER_RESUME:1};function In(e,t,n,r,o){t.transportStatus===Ln.UP&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Dn(e,t,n,{onSuccess:function(){return Pn(An.AFTER_SUCCESS,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),Mn(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function Mn(e,t,n,r){e.transportStatus===Ln.DOWN&&d((function(){Dn(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=kn,Pn(An.AFTER_RESUME,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(Rn,2*e.currentBackoffTime),Mn(e,t,n,r)}})}),e.currentBackoffTime)}function Dn(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),!function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||e.status>=500)}(n)?(t.transportStatus=Ln.UP,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?Ln.FAILURE_DETECTED:Ln.DOWN,t.lastFailureStatus=n.status,i())}))}function Pn(e,t,n,r,o){e===An.AFTER_SUCCESS&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max "+r+" events size queued for upload: "+Tn/Ze+"MiB",source:ft.AGENT,startClocks:ne()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=Un();i.size()>0;)In(i.dequeue(),t,n,r,o)}function Un(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=Tn}}}function $n(e){return e?e+(-1===e.indexOf("?")?"?":"&")+"precision=ms":e}function Bn(e,t,n,r){var o=n?"application/json; charset=UTF-8":void 0,i={transportStatus:Ln.UP,lastFailureStatus:0,currentBackoffTime:kn,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=Cn&&this.ongoingRequestCount<xn},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:Un(),queueFullReported:!1},a=function(n,r){return function(e,t,n,r,o){var i=r.data,a=r.bytesCount,u=$n(e),c=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&a<t;if(c){var f={method:"POST",body:i,keepalive:!0,mode:"cors"};n&&(f.headers={"Content-Type":n}),fetch(u,f).then(s((function(e){"function"==typeof o&&o({status:e.status,type:e.type})})),s((function(){Nn(u,n,i,o)})))}else Nn(u,n,i,o)}(e,t,o,n,r)};return{send:function(t){In(t,i,a,e,r)},sendOnExit:function(n){!function(e,t,n,r){var o=r.data,i=r.bytesCount,s=$n(e),a=!!navigator.sendBeacon&&i<t;if(a)try{var u;if(u=n?new Blob([o],{type:n}):o,navigator.sendBeacon(s,u))return}catch(e){}Nn(s,n,o)}(e,t,o,n)}}}function Nn(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",e,!0),t&&o.setRequestHeader("Content-Type",t),wt(o,"loadend",(function(){"function"==typeof r&&r({status:o.status})}),{once:!0}),o.send(n)}function Gn(e){return Gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gn(e)}function Wn(e){if("object"===Gn(e)&&e)e=Ue(e);else if(!N(e))return e;return String(e).replace(/[\s=,"]/g,(function(e){return"\\"+e}))}function Fn(e,t){return"object"===Gn(e)&&e?e=Ue(e):t&&(e=""+e),e}function Vn(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function jn(e){return"object"===Gn(e)&&e?Vn(Ue(e)):N(e)?Vn(e):e}var Hn="custom_keys",qn=function(e){if(!e||!e.type)return{rowStr:"",rowData:void 0};var t={tags:{},fields:{}},n=!1,r="";return C(tn,(function(o,i){if(o.type===e.type){r+=i+",",t.measurement=i;var s=[],a=T({},Zt,o.tags),u=["date","type",Hn];C(a,(function(n,r){var o=ae(e,n);u.push(r),(o||W(o))&&(t.tags[r]=Fn(o,!0),s.push(Wn(r)+"="+Wn(o)))}));var c=[],f=T({},en,o.fields);if(C(f,(function(n,r){if(k(n)&&2===n.length){var o=n[1],i=ae(e,o);u.push(r),null!=i&&(t.fields[r]=Fn(i),c.push(Wn(r)+"="+jn(i)))}else if(N(n)){i=ae(e,n);u.push(r),null!=i&&(t.fields[r]=Fn(i),c.push(Wn(r)+"="+jn(i)))}})),e.context&&U(e.context)&&!$(e.context)){var l=[];C(e.context,(function(e,n){u.indexOf(n)>-1||(u.push(n),null!=e&&(l.push(n),t.fields[n]=Fn(e),c.push(Wn(n)+"="+jn(e))))})),l.length&&(t.fields[Hn]=Fn(l),c.push(Wn(Hn)+"="+jn(l)))}e.type===Ae.LOGGER&&C(e,(function(e,n){-1===u.indexOf(n)&&null!=e&&(t.fields[n]=Fn(e),c.push(Wn(n)+"="+jn(e)))})),s.length&&(r+=s.join(",")),c.length&&(r+=" ",r+=c.join(","),n=!0),r=r+" "+e.date,t.time=e.date}})),{rowStr:n?r:"",rowData:n?t:void 0}},Qn=function(e,t,n,r){this.pushOnlyBuffer=[],this.upsertBuffer={},this.request=e,this.flushController=t,this.messageBytesLimit=n,this.sendContentTypeByJson=r;var o=this;this.flushController.flushObservable.subscribe((function(e){o.flush(e)}))};Qn.prototype.add=function(e){this.addOrUpdate(e)},Qn.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},Qn.prototype.flush=function(e){var t,n=this.pushOnlyBuffer.concat(A(this.upsertBuffer));if(this.pushOnlyBuffer=[],this.upsertBuffer={},n.length>0){var r={data:this.sendContentTypeByJson?"["+n.join(",")+"]":n.join("\n"),bytesCount:e.bytesCount,flushReason:e.reason};t=e.reason,ce(A(Yt),t)?this.request.sendOnExit(r):this.request.send(r)}},Qn.prototype.addOrUpdate=function(e,t){var r=this.process(e),o=r.processedMessage,i=r.messageBytesCount;i>=this.messageBytesLimit?n.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.messageBytesLimit+"KB."):(this.hasMessageFor(t)&&this.remove(t),this.push(o,i,t))},Qn.prototype.process=function(e){var t="";return{processedMessage:t=this.sendContentTypeByJson?Ue(qn(e).rowData):qn(e).rowStr,messageBytesCount:tt(t)}},Qn.prototype.push=function(e,t,n){var r=this.flushController.getMessagesCount()>0?1:0;this.flushController.notifyBeforeAddMessage(t+r),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.flushController.notifyAfterAddMessage()},Qn.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=tt(t),r=this.flushController.getMessagesCount()>1?1:0;this.flushController.notifyAfterRemoveMessage(n+r)},Qn.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]};var Kn=Qn;function zn(e){var t=e.messagesLimit,n=e.bytesLimit,r=e.durationLimit,o=e.pageExitObservable,i=e.sessionExpireObservable,s=new _t;o.subscribe((function(e){return f(e.reason)})),i.subscribe((function(){return f("session_expire")}));var a,u=0,c=0;function f(e){if(0!==c){var t=c,n=u;c=0,u=0,l(),s.notify({reason:e,messagesCount:t,bytesCount:n})}}function l(){p(a),a=void 0}return{flushObservable:s,getMessagesCount:function(){return c},notifyBeforeAddMessage:function(e){u+e>=n&&f("bytes_limit"),c+=1,u+=e,void 0===a&&(a=d((function(){f("duration_limit")}),r))},notifyAfterAddMessage:function(){c>=t?f("messages_limit"):u>=n&&f("bytes_limit")},notifyAfterRemoveMessage:function(e){u-=e,0===(c-=1)&&l()}}}function Xn(e,t,n,r,o){var i=function(t){return new Kn(Bn(t,e.batchBytesLimit,e.sendContentTypeByJson,n),zn({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageExitObservable:r,sessionExpireObservable:o}),e.messageBytesLimit,e.sendContentTypeByJson)}(t);return{add:function(e){i.add(e)}}}function Yn(){var e=l().FTWebViewJavascriptBridge;if(e)return{send:function(t,n){e.sendEvent(JSON.stringify({name:t,data:n}))}}}function Jn(){return!!Yn()}var Zn=3*Je,er={FeatureFlag:"feature flag evaluation",User:"user",GlobalContext:"global context",LoggerContext:"logger context"};var tr=200;function nr(e,t){void 0===t&&(t=tt);var r,o={},i=!1,s=new _t,a=F((function(o){r=t(Ue(o)),i||(i=function(e,t){return e>Zn&&(n.warn("The "+t+"data is over "+Zn/Je+" KiB. On low connectivity, the SDK has the potential to exhaust the user's upload bandwidth."),!0)}(r,e))}),tr).throttled,u={getBytesCount:function(){return r},get:function(){return o},add:function(e,t){o[e]=t,a(o),s.notify()},remove:function(e){delete o[e],a(o),s.notify()},set:function(e){a(o=e),s.notify()},getContext:function(){return K(o)},setContext:function(e){"object"===q(e)?(o=st(e),a(o)):u.clearContext(),s.notify()},setContextProperty:function(e,t){o[e]=K(t),a(o),s.notify()},removeContextProperty:function(e){delete o[e],a(o),s.notify()},clearContext:function(){o={},r=0,s.notify()},changeObservable:s};return u}var rr="_gc_s",or=[];function ir(e,t,n,r){var o=function(e,t,n){return e.storeContextsKey&&N(e.storeContextsKey)?rr+"_"+t+"_"+n+"_"+e.storeContextsKey:rr+"_"+t+"_"+n}(e,n,r);function i(){var e=localStorage.getItem(o);return null!==e?JSON.parse(e):{}}return or.push(wt(window,Le.STORAGE,(function(e){o===e.key&&t.setContext(i())}))),t.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(t.getContext()))})),t.setContext(R(i(),t.getContext())),t}function sr(e){this.map=new WeakMap,e&&e.forEach((function(e){this.map.set(e,1)}))}sr.prototype.add=function(e){return this.map.set(e,1),this},sr.prototype.delete=function(e){return this.map.delete(e)},sr.prototype.has=function(e){return this.map.has(e)};var ar,ur={log:"log",configuration:"configuration"},cr={debug:"debug",error:"error"},fr=["https://static.guance.com","http://localhost","<anonymous>"],lr={LOGS:"browser-logs-sdk",RUM:"browser-rum-sdk"},dr={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1};function pr(t,n){var r,o=new _t;return dr.telemetryEnabled=n.telemetryEnabled&&ee(n.telemetrySampleRate),ar=function(e){if(dr.telemetryEnabled){var n=function(e,t){return R({type:"telemetry",date:re(),service:e,version:"3.1.20",source:"browser",telemetry:t},void 0!==r?r():{})}(t,e);o.notify(n)}},e=vr,x(dr,{maxEventsPerPage:n.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){r=e},observable:o,enabled:dr.telemetryEnabled}}function vr(e,t){gr(x({type:ur.log,status:cr.error},function(e){if(e instanceof Error){var t=Ge(e);return{error:{kind:t.name,stack:pt(hr(t))},message:t.message}}return{error:{stack:ct},message:De.UNCAUGHT+" "+Ue(e)}}(e),t))}function gr(e){ar&&dr.sentEventCount<dr.maxEventsPerPage&&(dr.sentEventCount+=1,ar(e))}function hr(e){return e.stack=e.stack.filter((function(e){return!e.url||fr.some((function(t){return _e(e.url,t)}))})),e}var yr={sdkVersion:"3.1.20",sdkName:"df_web_logs_sdk"},_r=32*Je;function mr(e){var r=function(e){return e.site||e.datakitOrigin||e.datakitUrl?!(e.site&&!e.clientToken&&(n.error("clientToken is not configured, no RUM data will be collected."),1)):(n.error("datakitOrigin or site is not configured, no RUM data will be collected."),!1)}(e);if(r){var o=jt(e),i=br(e.forwardConsoleLogs,A(t),"Forward Console Logs"),s=br(e.forwardReports,A(St),"Forward Reports");if(o&&i&&s)return e.forwardErrorsToLogs&&!ce(i,t.error)&&i.push(t.error),x({forwardErrorsToLogs:!1!==e.forwardErrorsToLogs,forwardConsoleLogs:i,forwardReports:s,requestErrorResponseLengthLimit:_r},o,yr)}}function br(e,t,r){return void 0===e?[]:"all"===e||k(e)&&P(e,(function(e){return ce(t,e)}))?"all"===e?t:V(e):void n.error(r+' should be "all" or an array with allowed values "'+t.join('", "')+'"')}var Er={debug:"debug",error:"error",info:"info",warn:"warn",critical:"critical"},wr={console:"console",http:"http",silent:"silent"},Or=I(Er);function Sr(e,t,n,r,o){this.contextManager=nr(er.LoggerContext),void 0===n&&(n=wr.http),void 0===r&&(r=Er.debug),void 0===o&&(o={}),this.handleLogStrategy=e,this.handlerType=n,this.level=r,this.contextManager.set(x({},o,t?{logger:{name:t}}:void 0))}Sr.prototype={log:s((function(e,t,n,r){var o;if(void 0===n&&(n=Er.info),n===Er.error&&(o={origin:ft.LOGGER}),null!=r){var i=lt({stackTrace:r instanceof Error?Ge(r):void 0,originalError:r,nonErrorPrefix:De.PROVIDED,source:ft.LOGGER,handling:Me.HANDLED,startClocks:ne()});o={origin:ft.LOGGER,stack:i.stack,kind:i.type,message:i.message,causes:i.causes}}var s=st(t),a=o?R({error:o},s):s;this.handleLogStrategy({message:e,context:a,status:n},this)})),debug:function(e,t,n){this.log(e,t,Er.debug,n)},info:function(e,t,n){this.log(e,t,Er.info,n)},warn:function(e,t,n){this.log(e,t,Er.warn,n)},critical:function(e,t,n){this.log(e,t,Er.critical,n)},error:function(e,t,n){var r={error:{origin:ft.LOGGER}};this.log(e,R(r,t),Er.error,n)},setContext:function(e){this.contextManager.set(e)},getContext:function(){return this.contextManager.get()},addContext:function(e,t){this.contextManager.add(e,t)},removeContext:function(e){this.contextManager.remove(e)},clearContext(){this.contextManager.clearContext()},setHandler:function(e){this.handlerType=e},getHandler:function(){return this.handlerType},setLevel:function(e){this.level=e},getLevel:function(){return this.level}};var Cr="logs";var xr="logs",Tr={NOT_TRACKED:"0",TRACKED:"1"};function Rr(e){var t=Sn(e.cookieOptions,xr,(function(t){return function(e,t){var n=function(e){return e===Tr.NOT_TRACKED||e===Tr.TRACKED}(t)?t:kr(e);return{trackingType:n,isTracked:n===Tr.TRACKED}}(e,t)}));return{findTrackedSession:function(e){var n=t.findActiveSession(e);return n&&n.trackingType===Tr.TRACKED?{id:n.id}:void 0},expireObservable:t.expireObservable}}function kr(e){return ee(e.sessionSampleRate)?Tr.TRACKED:Tr.NOT_TRACKED}var Lr={[Er.debug]:0,[Er.info]:1,[Er.warn]:2,[Er.error]:3};function Ar(e,t,n){var r=n.getHandler(),o=k(r)?r:[r];return Lr[e]>=Lr[n.getLevel()]&&ce(o,t)}function Ir(e,t,n,r,o,i){var s=Or.concat(["custom"]),a={};C(s,(function(e){var n,r,o,s,u;a[e]=(n=e,r=t.eventRateLimiterThreshold,o=i,s=0,u=!1,{isLimitReached:function(){if(0===s&&d((function(){s=0}),J),(s+=1)<=r||u)return u=!1,!1;if(s===r+1){u=!0;try{o({message:"Reached max number of "+n+"s by minute: "+r,source:ft.AGENT,startClocks:ne()})}finally{u=!1}}return!0}})})),n.subscribe(kt.RAW_LOG_COLLECTED,(function(i){var s=i.rawLogsEvent,u=i.messageContext||void 0,c=i.savedCommonContext||void 0,f=i.logger||o,l=s.date-ie(),d=e.findTrackedSession(l);if(d){var p=c||r(),v=R({service:t.service||"browser",env:t.env||"",version:t.version||"",_gc:{sdkName:t.sdkName,sdkVersion:t.sdkVersion},session:{id:d.id},view:p.view,user:$(p.user)?void 0:p.user,device:ke,type:Ae.LOGGER},p.context,Mr(l),s,f.getContext(),u);!Ar(s.status,wr.http,f)||t.beforeSend&&!1===t.beforeSend(v)||v.error&&v.error.origin!==ft.AGENT&&ye(a[v.status],a.custom).isLimitReached()||n.notify(kt.LOG_COLLECTED,ge(v))}}))}function Mr(e){return function(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}(window.DATAFLUX_RUM)}var Dr={[t.log]:Er.info,[t.debug]:Er.debug,[t.info]:Er.info,[t.warn]:Er.warn,[t.error]:Er.error};var Pr={[St.cspViolation]:Er.error,[St.intervention]:Er.error,[St.deprecation]:Er.warn};function Ur(e,t){if(!e.forwardErrorsToLogs)return{stop:z};var n=Kt().subscribe((function(e){"complete"===e.state&&o(Ie.XHR,e)})),r=qt().subscribe((function(e){"resolve"===e.state&&o(Ie.FETCH,e)}));function o(n,r){function o(e){var o,i,s,a=H(r.url).getParse();t.notify(kt.RAW_LOG_COLLECTED,{rawLogsEvent:{message:Br(n)+" error "+r.method+" "+r.url,date:r.startClocks.timeStamp,error:{origin:ft.NETWORK,stack:e||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url,statusGroup:(s=r.status,s?String(s).substr(0,1)+String(s).substr(1).replace(/\d*/g,"x"):s),urlHost:a.Host,urlPath:a.Path,urlPathGroup:(o=a.Path,i="",o&&(i=o.replace(/\/([^\/]*)\d([^\/]*)/g,"/?").replace(/\/$/g,"")),i||"/")},status:Er.error,origin:ft.NETWORK}})}!e.isIntakeUrl(r.url)&&(function(e){return 0===e.status&&"opaque"!==e.responseType}(r)||function(e){return e.status>=500}(r)||e.isServerError(r))&&("xhr"in r?function(e,t,n){"string"==typeof e.response?n($r(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){var r=function(e){try{return e.clone()}catch(e){return}}(e);r&&r.body?window.TextDecoder?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],i=0;function a(){var e,s;if(r.cancel().catch(z),n.collectStreamBody){var a;if(1===o.length)a=o[0];else{a=new Uint8Array(i);var u=0;C(o,(function(e){a.set(e,u),u+=e.length}))}e=a.slice(0,n.bytesLimit),s=a.length>n.bytesLimit}t(void 0,e,s)}!function e(){r.read().then(s((function(t){t.done?a():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?a():e())})),s((function(e){t(e)})))}()}(e,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}),{bytesLimit:t,collectStreamBody:!0})}(r.body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: "+e:t)})):r.text().then(s((function(e){return n($r(e,t))})),s((function(e){return n("Unable to retrieve response: "+e)}))):n()}(r.response,e,o):r.error&&function(e,t,n){n($r(pt(Ge(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function $r(e,t){return e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Br(e){return Ie.XHR===e?"XHR":"Fetch"}function Nr(e,t){if(!e.forwardErrorsToLogs)return{stop:z};var n,r=new _t,o=(n=r,Ye((function(e,t){n.notify(lt({stackTrace:e,originalError:t,startClocks:ne(),nonErrorPrefix:De.UNCAUGHT,source:ft.SOURCE,handling:Me.UNHANDLED}))}))),i=r.subscribe((function(e){t.notify(kt.RAW_LOG_COLLECTED,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{kind:e.type,stack:e.stack,causes:e.causes},origin:ft.SOURCE,status:Er.error}})}));return{stop:function(){o.stop(),i.unsubscribe()}}}const Gr=function(e){var t,r,o=!1,a=nr(er.GlobalContext),u=nr(er.User),c={},f=function(){},l=new be,d=function(e,t,n,r){void 0===n&&(n=K(g())),void 0===r&&(r=re()),l.add((function(){return d(e,t,n,r)}))},p=function(){},v=new Sr((function(){return d.apply(this,arguments)}));function g(){return{view:{referrer:document.referrer,url:window.location.href},context:a.getContext(),user:u.getContext()}}return t={logger:v,init:s((function(t){if(function(e){return!o||(e.silentMultipleInit||n.error("DD_LOGS is already initialized."),!1)}(t)){var r=mr(t);if(r){t.storeContextsToLocal&&(ir(r,a,Cr,er.GlobalContext),ir(r,u,Cr,er.User));var i=e(r,g,v);d=i.handleLog,f=i.getInternalContext,p=function(){return K(t)},l.drain(),o=!0}}})),getGlobalContext:s((function(){return a.getContext()})),setGlobalContext:s((function(e){return a.setContext(e)})),setGlobalContextProperty:s((function(e,t){return a.setContextProperty(e,t)})),removeGlobalContextProperty:s((function(e){return a.removeContextProperty(e)})),clearGlobalContext:s((function(){return a.clearContext()})),createLogger:s((function(e,t){return void 0===t&&(t={}),c[e]=new Sr((function(){return d(this.arguments)}),e,t.handler,t.level,t.context),c[e]})),getLogger:s((function(e){return c[e]})),getInitConfiguration:s((function(){return p()})),getInternalContext:s((function(e){return f(e)})),setUser:s((function(e){(function(e){var t="object"===q(e);return t||n.error("Unsupported user:",e),t})(e)&&u.setContext(function(e){var t=x({},e);return C(["id","name","email"],(function(e){e in t&&(t[e]=String(t[e]))})),t}(e))})),getUser:s((function(){return u.getContext()})),removeUserProperty:s((function(e){return u.removeContextProperty(e)})),clearUser:s((function(){return u.clearContext()}))},r=x({onReady:function(e){e()}},t),Object.defineProperty(r,"_setDebug",{get:function(){return i},enumerable:!1}),r}((function(e,r,o){var i=new Lt,s=function(e){i.notify(kt.RAW_LOG_COLLECTED,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{origin:ft.AGENT},origin:ft.AGENT,status:Er.error}})},a=new _t((function(e){var t=Ot(document,[Le.VISIBILITY_CHANGE,Le.FREEZE,Le.PAGE_HIDE],(function(t){t.type===Le.VISIBILITY_CHANGE&&"hidden"===document.visibilityState?e.notify({reason:Yt.HIDDEN}):t.type===Le.FREEZE&&e.notify({reason:Yt.FROZEN})}),{capture:!0}),n=wt(window,Le.BEFORE_UNLOAD,(function(){e.notify({reason:Yt.UNLOADING})}));return function(){t.stop(),n.stop()}})),u=function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="gc_cookie_test_".concat(j()),n="test";return Ut(t,n,Y,e),$t(t)===n}catch(e){return!1}}(e.cookieOptions)?Rr(e):function(e){var t=kr(e)===Tr.TRACKED?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new _t}}(e);(function(e,t,n,r){const o=pr(lr.LOGS,e);if(!Jn()){var i=Xn(e,e.rumEndpoint,t,n,r);o.observable.subscribe((function(e){i.add(e)}))}return o})(e,s,a,u.expireObservable).setContextProvider((function(){var e=Mr();return{application:{id:e&&e.application&&e.application.id},session:{id:u.findTrackedSession()&&u.findTrackedSession().id},view:{id:e&&e.view&&e.view.id},action:{id:e&&e.userAction&&e.userAction.id}}})),Ur(e,i),Nr(e,i),function(e,n){var r=Et(e.forwardConsoleLogs).subscribe((function(e){n.notify(kt.RAW_LOG_COLLECTED,{rawLogsEvent:{date:re(),message:e.message,origin:ft.CONSOLE,error:e.api===t.error?{origin:ft.CONSOLE,stack:e.stack,causes:e.causes}:void 0,status:Dr[e.api]}})}))}(e,i),function(e,t){var n=Ct(0,e.forwardReports).subscribe((function(e){var n,r,o,i=e.message,s=Pr[e.type];s===Er.error?n={kind:e.subtype,origin:ft.REPORT,stack:e.stack}:e.stack&&(i+=" Found in "+(r=e.stack,(o=/@ (.+)/.exec(r))&&o[1])),t.notify(kt.RAW_LOG_COLLECTED,{rawLogsEvent:{date:re(),message:i,origin:ft.REPORT,error:n,status:s}})}))}(e,i);var c=function(e){return{handleLog:function(t,r,o,i){var s=t.context;Ar(t.status,wr.console,r)&&n(t.status,t.message,R(r.getContext(),s)),e.notify(kt.RAW_LOG_COLLECTED,{rawLogsEvent:{date:i||re(),message:t.message,status:t.status,origin:ft.LOGGER},messageContext:s,savedCommonContext:o,logger:r})}}}(i);Ir(u,e,i,r,o,s),Jn()||function(e,t,n,r,o){var i=Xn(e,e.logsEndpoint,n,r,o);t.subscribe(kt.LOG_COLLECTED,(function(e){i.add(e)}))}(e,i,s,a,u.expireObservable);var f,l=(f=u,{get:function(e){var t=f.findTrackedSession(e);if(t)return{session:{id:t.id}}}});return{handleLog:c.handleLog,getInternalContext:l.get}}));var Wr,Fr,Vr,jr;Wr=l(),Vr=Gr,jr=Wr[Fr="DATAFLUX_LOGS"],Wr[Fr]=Vr,jr&&jr.q&&C(jr.q,(function(e){c(e,"onReady callback threw an error:")()}))}();
1
+ !function(){"use strict";var e,t={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},n=function e(n){var r=[].slice.call(arguments,1);Object.prototype.hasOwnProperty.call(t,n)||(n=t.log),e[n].apply(e,r)};function r(e,t){var n,r=window;return r.Zone&&"function"==typeof r.Zone.__symbol__&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}n.debug=console.debug.bind(console),n.log=console.log.bind(console),n.info=console.info.bind(console),n.warn=console.warn.bind(console),n.error=console.error.bind(console);var o=!1;function i(e){o=e}function s(e){return function(){return a(e,this,arguments)}}function a(n,r,o){try{return n.apply(r,o)}catch(n){if(u(t.error,n),e)try{e(n)}catch(e){u(t.error,e)}}}function u(e){var t=[].slice.call(arguments,1);o&&n.apply(null,[e,"[MONITOR]"].concat(t))}function c(e,t){return function(){var r=[].slice.call(arguments);try{return e.apply(this,r)}catch(e){n.error(t,e)}}}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function l(){if("object"===("undefined"==typeof globalThis?"undefined":f(globalThis)))return globalThis;Object.defineProperty(Object.prototype,"_gc_temp_",{get:function(){return this},configurable:!0});var e=_gc_temp_;return delete Object.prototype._gc_temp_,"object"!==f(e)&&(e="object"===("undefined"==typeof self?"undefined":f(self))?self:"object"===("undefined"==typeof window?"undefined":f(window))?window:{}),e}function d(e,t){return r(l(),"setTimeout")(s(e),t)}function p(e){r(l(),"clearTimeout")(e)}function v(e,t){return r(l(),"setInterval")(s(e),t)}function g(e){r(l(),"clearInterval")(e)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}var y=Array.prototype,_=(Function.prototype,Object.prototype),m=y.slice,b=_.toString,E=_.hasOwnProperty,w=y.forEach,O=Array.isArray,S=!1,C=function(e,t,n){if(null===e)return!1;if(w&&e.forEach===w)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r,e)===S)return!1}else for(var i in e)if(E.call(e,i)&&t.call(n,e[i],i,e)===S)return!1};function x(e){return C(m.call(arguments,1),(function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}var T=function(e){return C(m.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},R=function(e){return C(m.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&($(t[n])&&$(e[n])?T(e[n],t[n]):e[n]=t[n])})),e},k=O||function(e){return"[object Array]"===b.call(e)},L=function(e){if(!e)return!1;try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},A=function(e){var t=[];return null===e||C(e,(function(e){t[t.length]=e})),t},I=function(e){var t=[];return null===e||C(e,(function(e,n){t[t.length]=n})),t},M=function(e,t,n){if(e.filter)return e.filter(t);for(var r=[],o=0;o<e.length;o++)if(E.call(e,o)){var i=e[o];t.call(n,i,o,e)&&r.push(i)}return r},D=function(e,t,n){if(e.map)return e.map(t);for(var r=[],o=0;o<e.length;o++)if(E.call(e,o)){var i=e[o];r.push(t.call(n,i,o,e))}return r},P=function(e,t,n){if(e.some)return e.some(t);for(var r=!1,o=0;o<e.length;o++)if(E.call(e,o)){var i=e[o];if(t.call(n,i,o,e)){r=!0;break}}return r},U=function(e,t,n){if(e.every)return e.every(t);for(var r=!0,o=0;o<e.length;o++)if(E.call(e,o)){var i=e[o];if(!t.call(n,i,o,e)){r=!1;break}}return r},$=function(e){return null!==e&&"[object Object]"===b.call(e)},B=function(e){if($(e)){for(var t in e)if(E.call(e,t))return!1;return!0}return!1},N=function(e){var t=[];return C(e,(function(e,n){t.push([n,e])})),t},G=function(e){return"[object String]"===b.call(e)},W=function(e){return"[object Boolean]"===b.call(e)},F=function(e){return"[object Number]"===b.call(e)&&/[\d\.]+/.test(String(e))},V=(Date.now,function(e,t,n){var r,o,i=!n||void 0===n.leading||n.leading,s=!n||void 0===n.trailing||n.trailing,a=!1,u=this;return{throttled:function(){a?r=arguments:(i?e.apply(u,arguments):r=arguments,a=!0,o=d((function(){s&&r&&e.apply(u,r),a=!1,r=void 0}),t))},cancel:function(){p(o),a=!1,r=void 0}}}),j=function(e){for(var t,n=[],r={},o=0;o<e.length;o++)(t=e[o])in r||(r[t]=!0,n.push(t));return n};function H(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-",1e3,"-",4e3,"-",8e3,"-",1e11).replace(/[018]/g,H)}var q=function(e){var t=function(e){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=null,this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,void 0!==e&&this._parse(e)};return t.prototype.setUrl=function(e){this._parse(e)},t.prototype._initValues=function(){for(var e in this._fields)this._values[e]=""},t.prototype.addQueryString=function(e){if("object"!==h(e))return!1;var t=this._values.QueryString||"";for(var n in e)t=new RegExp(n+"[^&]+").test(t)?t.replace(new RegExp(n+"[^&]+"),n+"="+e[n]):"&"===t.slice(-1)?t+n+"="+e[n]:""===t?n+"="+e[n]:t+"&"+n+"="+e[n];this._values.QueryString=t},t.prototype.getParse=function(){return this._values},t.prototype.getUrl=function(){var e="";return e+=this._values.Origin,e+=this._values.Path,e+=this._values.QueryString?"?"+this._values.QueryString:""},t.prototype._parse=function(e){this._initValues();var t=this._regex.exec(e);if(!t)throw"DPURLParser::_parse -> Invalid URL";for(var n in this._fields)void 0!==t[this._fields[n]]&&(this._values[n]=t[this._fields[n]]);this._values.Path=this._values.Path||"/",this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname+(this._values.Port?":"+this._values.Port:"")},new t(e)};function Q(e){return null===e?"null":Array.isArray(e)?"array":h(e)}function K(e,t,n){if(void 0===n&&(n=function(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!==h(t)||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;i<t.length;++i)o[i]=K(o[i],t[i],n);return o}o="object"===Q(e)?e:{};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(o[s]=K(o[s],t[s],n));return o}}function z(e){return K(void 0,e)}function X(){}var Y,J=1e3,Z=60*J,ee=60*Z;function te(e){return 0!==e&&100*Math.random()<=e}function ne(){return performance.now()}function re(){return{relative:ne(),timeStamp:oe()}}function oe(){return ie()}function ie(){return(new Date).getTime()}function se(){return void 0===Y&&(Y=performance.timing.navigationStart),Y}var ae=/([\w-]+)\s*=\s*([^;]+)/g;function ue(e,t){for(var n=t.split(".");n.length;){var r=n.shift();if(!(e&&r in e&&E.call(e,r)))return;e=e[r]}return e}function ce(e,t){var n=e.charCodeAt(t-1);return n>=55296&&n<=56319?e.slice(0,t+1):e.slice(0,t)}function fe(e,t){return-1!==e.indexOf(t)}function le(e){if(Array.from)return Array.from(e);var t=[];if(e instanceof Set)e.forEach((function(e){t.push(e)}));else for(var n=0;n<e.length;n++)t.push(e[n]);return t}function de(e){return F(e)&&e>=0&&e<=100}var pe,ve={IE:0,CHROMIUM:1,SAFARI:2,OTHER:3};function ge(){return _e(pe,pe=function(e){var t;void 0===e&&(e=window);var n=e.navigator.userAgent;if(e.chrome||/HeadlessChrome/.test(n))return ve.CHROMIUM;if(0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return ve.SAFARI;if(e.document.documentMode)return ve.IE;return ve.OTHER}())}function he(e){var t={};return C(e,(function(e,n){var r;t[(r=n,r.replace(/[A-Z]/g,(function(e,t){return(0!==t?"_":"")+e.toLowerCase()})).replace(/-/g,"_"))]=ye(e)})),t}function ye(e){return k(e)?D(e,(function(e){return ye(e)})):"object"===h(e)&&null!==e?he(e):e}function _e(e,t){return null!=e?e:t}function me(e,t){return e.slice(0,t.length)===t}var be=function(){this.buffer=[]};be.prototype={add:function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},drain:function(){C(this.buffer,(function(e){e()})),this.buffer.length=0}};var Ee=be;function we(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Oe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Se=1/0,Ce=Z;function xe(e){var t=e.expireDelay,n=e.maxEntries,r=[],o=v((function(){return function(){var e=ne()-t;for(;r.length>0&&r[r.length-1].endTime<e;)r.pop()}()}),Ce);return{add:function(e,t){var o={value:e,startTime:t,endTime:Se,remove:function(){var e,t,n;t=o,(n=(e=r).indexOf(t))>=0&&e.splice(n,1)},close:function(e){o.endTime=e}};return n&&r.length>=n&&r.pop(),r.unshift(o),o},find:function(e,t){void 0===e&&(e=Se),void 0===t&&(t={returnInactive:!1});var n,o=we(r);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i.startTime<=e){if(t.returnInactive||e<=i.endTime)return i.value;break}}}catch(e){o.e(e)}finally{o.f()}},closeActive:function(e){var t=r[0];t&&t.endTime===Se&&t.close(e)},findAll:function(e,t){void 0===e&&(e=Se),void 0===t&&(t=0);var n=e+t;return r.filter((function(t){return t.startTime<=n&&e<=t.endTime})).map((function(e){return e.value}))},reset:function(){r=[]},stop:function(){g(o)}}}var Te={navigator:"undefined"!=typeof window&&void 0!==window.navigator?window.navigator:{},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","IE 11","IE 10","IE 9","IE 8","IE 7","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat",,"WechatWork","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},Re={getMatchMap:s((function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,Edge:e.indexOf("Edge")>-1||e.indexOf("Edg")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}})),matchInfoMap:s((function(e){var t=Te.navigator.userAgent||"",n=Re.getMatchMap(t);for(var r in Te.infoMap)for(var o=0;o<Te.infoMap[r].length;o++){var i=Te.infoMap[r][o];n[i]&&(e[r]=i)}})),getOS:s((function(){return Re.matchInfoMap(this),this.os||"Unknown"})),getOSVersion:s((function(){var e=this,t=Te.navigator.userAgent||"";e.osVersion="",e.osMajor="";var n={Windows:function(){var e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return t.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return t.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return n[e.os]&&(e.osVersion=n[e.os](),e.osVersion===t&&(e.osVersion="")),e.osVersion&&(e.osMajor=e.osVersion.split(".").length&&e.osVersion.split(".")[0]),{version:e.osVersion,osMajor:e.osMajor}})),getOrientationStatu:s((function(){return window.matchMedia("(orientation: portrait)").matches?"竖屏":"横屏"})),getDeviceType:s((function(){var e=this;return e.device="PC",Re.matchInfoMap(e),e.device})),getNetwork:s((function(){var e=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,t="unknown",n=e?e.type||e.effectiveType:null;if(n&&"string"==typeof n)switch(n){case"bluetooth":case"cellular":case"slow-2g":case"2g":case"3g":t="cellular";break;case"none":t="none";break;case"ethernet":case"wifi":case"wimax":case"4g":t="wifi";break;case"other":case"unknown":t="unknown"}return t})),getLanguage:s((function(){var e;return this.language=((e=(Te.navigator.browserLanguage||Te.navigator.language||"").split("-"))[1]&&(e[1]=e[1].toUpperCase()),e.join("_")),this.language})),getBrowserInfo:s((function(){var e=this;Re.matchInfoMap(e);var t=Te.navigator.userAgent||"",n=function(e,t){var n=Te.navigator.mimeTypes;for(var r in n)if(n[r][e]==t)return!0;return!1},r=Re.getMatchMap(t),o=!1;if("undefined"!=typeof window&&window.chrome){var i=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");i>36&&window.showModalDialog?o=!0:i>45&&(o=n("type","application/vnd.chromium.remoting-viewer"))}if(r.Baidu&&r.Opera&&(r.Baidu=!1),r.Mobile&&(r.Mobile=!(t.indexOf("iPad")>-1)),o&&(n("type","application/gameplugin")||Te.navigator&&Te.navigator.connection&&void 0===Te.navigator.connection.saveData?r["360SE"]=!0:r["360EE"]=!0),r.IE||r.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 74:case 105:default:break;case 102:r["360EE"]=!0;break;case 104:r["360SE"]=!0}var s={Safari:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return t.replace(/^.*Edge?\/([\d.]+).*$/,"$1")},Firefox:function(){return t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return t.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return t.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return t.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return t.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return t.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return t.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return t.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return t.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return t.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return t.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return t.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return t.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return t.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return t.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){var e="";t.indexOf("LieBaoFast")>-1&&(e=t.replace(/^.*LieBaoFast\/([\d.]+).*$/,"$1"));var n=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");return e||{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[n]||""},"2345Explorer":function(){return t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return t.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return t.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},WechatWork:function(){return t.replace(/^.*wxwork\/([\d.]+).*$/,"$1")},Taobao:function(){return t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return t.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",e.browserMajor="",s[e.browser]&&(e.browserVersion=s[e.browser](),e.browserVersion==t&&(e.browserVersion="")),"Chrome"==e.browser&&t.match(/\S+Browser/)&&(e.browser=t.match(/\S+Browser/)[0],e.version=t.replace(/^.*Browser\/([\d.]+).*$/,"$1")),"Edge"==e.browser&&(e.version>"75"?e.engine="Blink":e.engine="EdgeHTML"),("Chrome"==e.browser&&parseInt(e.browserVersion)>27||r.Chrome&&"WebKit"==e.engine&&parseInt(e.browserVersion)>27||"Opera"==e.browser&&parseInt(e.version)>12||"Yandex"==e.browser)&&(e.engine="Blink"),e.browserVersion&&(e.browserMajor=e.browserVersion.split(".").length&&this.browserVersion.split(".")[0]),{browser:e.browser,browserVersion:e.browserVersion,engine:e.engine,browserMajor:e.browserMajor}})),getGeoPostion:s((function(e){navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition((function(t){e(t)}),(function(e){n.warn(e)}))}))},ke={};"undefined"!=typeof window&&(ke={os:Re.getOS(),osVersion:Re.getOSVersion().version,osVersionMajor:Re.getOSVersion().osMajor,browser:Re.getBrowserInfo().browser,browserVersion:Re.getBrowserInfo().browserVersion,browserVersionMajor:Re.getBrowserInfo().browserMajor,screenSize:window.screen.width+"*"+window.screen.height,networkType:Re.getNetwork(),device:Re.getDeviceType()});var Le=ke,Ae={BEFORE_UNLOAD:"beforeunload",CLICK:"click",DBL_CLICK:"dblclick",KEY_DOWN:"keydown",LOAD:"load",POP_STATE:"popstate",SCROLL:"scroll",TOUCH_START:"touchstart",TOUCH_END:"touchend",TOUCH_MOVE:"touchmove",VISIBILITY_CHANGE:"visibilitychange",PAGE_SHOW:"pageshow",FREEZE:"freeze",RESUME:"resume",DOM_CONTENT_LOADED:"DOMContentLoaded",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_CANCEL:"pointercancel",HASH_CHANGE:"hashchange",PAGE_HIDE:"pagehide",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_MOVE:"mousemove",FOCUS:"focus",BLUR:"blur",CONTEXT_MENU:"contextmenu",RESIZE:"resize",CHANGE:"change",INPUT:"input",PLAY:"play",PAUSE:"pause",SECURITY_POLICY_VIOLATION:"securitypolicyviolation",SELECTION_CHANGE:"selectionchange",STORAGE:"storage"},Ie={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",LOGGER:"logger"},Me={FETCH:"fetch",XHR:"xhr"},De={HANDLED:"handled",UNHANDLED:"unhandled"},Pe={UNCAUGHT:"Uncaught",PROVIDED:"Provided"};function Ue(e){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ue(e)}function $e(e,t,n){if("object"!==Ue(e)||null===e)return JSON.stringify(e);var r=Be(Object.prototype),o=Be(Array.prototype),i=Be(Object.getPrototypeOf(e)),s=Be(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),s()}}function Be(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):X}function Ne(e){return Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(e)}var Ge="?";function We(e){var t=[],n=Xe(e,"stack");return n&&C(n.split("\n"),(function(e){var n=function(e){var t=je.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=He.exec(t[2]);r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||Ge,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=qe.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:Ge,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=Qe.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Ge,line:+t[3],url:t[2]}}(e)||function(e){var t=Ke.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=ze.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||Ge,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=Ge),t.push(n))})),{message:Xe(e,"message"),name:Xe(e,"name"),stack:t}}var Fe="((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\w+\\.|\\/).*?)",Ve="(?::(\\d+))",je=new RegExp("^\\s*at (.*?) ?\\("+Fe+Ve+"?"+Ve+"?\\)?\\s*$","i"),He=new RegExp("\\((\\S*)"+Ve+Ve+"\\)");var qe=new RegExp("^\\s*at ?"+Fe+Ve+"?"+Ve+"??\\s*$","i");var Qe=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var Ke=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ze=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Xe(e,t){if("object"===Ne(e)&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}var Ye=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Je(e){var t=function(e){return yt(window,"onerror",(function(t){var n,r=t.parameters,o=r[0],i=r[1],s=r[2],a=r[3],u=r[4];if(u instanceof Error)n=We(u);else{var c={url:i,column:a,line:s},f=function(e){var t,n;if("[object String]"==={}.toString.call(e)){var r=Ye.exec(e);r&&(t=r[1],n=r[2])}return{name:t,message:n}}(o);n={name:f.name,message:f.message,stack:[c]}}e(n,_e(u,o))}))}(e),n=function(e){return yt(window,"onunhandledrejection",(function(t){var n=t.parameters[0].reason||"Empty reason",r=We(n);e(r,n)}))}(e);return{stop:function(){t.stop(),n.stop()}}}var Ze=1024,et=1024*Ze,tt=/[^\u0000-\u007F]/;function nt(e){return tt.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function rt(e){return rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rt(e)}var ot=220*Ze,it="$",st=3;function at(e,t){void 0===t&&(t=ot);var n=Be(Object.prototype),r=Be(Array.prototype),o=[],i=new WeakMap,s=ut(e,it,void 0,o,i),a=JSON.stringify(s)&&JSON.stringify(s).length||0;if(!(a>t)){for(;o.length>0&&a<t;){var u=o.shift(),c=0;if(Array.isArray(u.source))for(var f=0;f<u.source.length;f++){if(a+=void 0!==(l=ut(u.source[f],u.path,f,o,i))?JSON.stringify(l).length:4,a+=c,c=1,a>t){ct(t,"truncated",e);break}u.target[f]=l}else for(var f in u.source)if(Object.prototype.hasOwnProperty.call(u.source,f)){var l;if(void 0!==(l=ut(u.source[f],u.path,f,o,i))&&(a+=JSON.stringify(l).length+c+f.length+st,c=1),a>t){ct(t,"truncated",e);break}u.target[f]=l}}return n(),r(),s}ct(t,"discarded",e)}function ut(e,t,n,r,o){var i=function(e){var t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!i||"object"!==rt(i))return function(e){if("bigint"==typeof e)return"[BigInt] "+e.toString();if("function"==typeof e)return"[Function] "+e.name||0;if("symbol"===rt(e))return"[Symbol] "+e.description||0;return e}(i);var s=function(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return"["+t[1]+"]"}catch(e){}return"[Unserializable]"}(i);if("[Object]"!==s&&"[Array]"!==s&&"[Error]"!==s)return s;var a=e;if(o.has(a))return"[Reference seen at "+o.get(a)+"]";var u=void 0!==n?t+"."+n:t,c=Array.isArray(i)?[]:{};return o.set(a,u),r.push({source:i,target:c,path:u}),c}function ct(e,t,r){n.warn("The data provided has been "+t+" as it is over the limit of "+e+" characters:",r)}var ft="No stack, consider using an instance of Error",lt={AGENT:"agent",CONSOLE:"console",NETWORK:"network",SOURCE:"source",LOGGER:"logger",CUSTOM:"custom"};function dt(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,s=e.source,a=e.handling,u=n instanceof Error,c=function(e,t,n,r){return e&&e.message&&e&&e.name?e.message:t?"Empty message":n+" "+$e(at(r))}(t,u,i,n),f=function(e,t){if(void 0===t)return!1;if(e)return!0;return t.stack.length>0&&(t.stack.length>1||void 0!==t.stack[0].url)}(u,t)?vt(t):ft,l=u?ht(n,s):void 0;return{startClocks:o,source:s,handling:a,originalError:n,message:c,stack:f,handlingStack:r,type:t&&t.name,causes:l}}function pt(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return a((function(){var n=We(t);n.stack=n.stack.slice(2),e=vt(n)})),e}function vt(e){var t=gt(e);return C(e.stack,(function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",o=e.line?":"+e.line:"",i=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+o+i})),t}function gt(e){return(e.name||"Error")+": "+e.message}function ht(e,t){for(var n=e,r=[];n&&n.cause instanceof Error&&r.length<10;){var o=We(n.cause);r.push({message:n.cause.message,source:t,type:o&&o.name,stack:o&&vt(o)}),n=n.cause}return r.length?r:void 0}function yt(e,t,n,r){var o=r&&r.computeHandlingStack,i=e[t];if("function"!=typeof i){if(!me(t,"on"))return{stop:X};i=X}var s=!1,u=function(){if(s)return i.apply(this,arguments);var e,t=le(arguments);a(n,null,[{target:this,parameters:t,onPostCall:function(t){e=t},handlingStack:o?pt():void 0}]);var r=i.apply(this,t);return e&&a(e,null,[r]),r};return e[t]=u,{stop:function(){s=!0,e[t]===u&&(e[t]=i)}}}var _t=function(e){this.observers=[],this.onLastUnsubscribe=void 0,this.onFirstSubscribe=e};_t.prototype={subscribe:function(e){this.observers.push(e),1===!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0);var t=this;return{unsubscribe:function(){t.observers=M(t.observers,(function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},notify:function(e){C(this.observers,(function(t){t(e)}))}};var mt=_t;function bt(){var e=[].slice.call(arguments);return new mt((function(t){var n=D(e,(function(e){return e.subscribe((function(e){return t.notify(e)}))}));return function(){return C(n,(function(e){return e.unsubscribe()}))}}))}var Et={};function wt(e){var n=D(e,(function(e){return Et[e]||(Et[e]=function(e){return new mt((function(n){var r=console[e];return console[e]=function(){var o=[].slice.call(arguments);r.apply(console,arguments);var i=pt();a((function(){n.notify(function(e,n,r){var o,i,s=D(e,(function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return gt(We(e));return $e(e,void 0,2)}(e)})).join(" ");if(n===t.error){var a=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n,e))return r}}(e,(function(e){return e instanceof Error}));o=a?vt(We(a)):void 0,s="console error: "+s,i=a?ht(a,"console"):void 0}return{api:n,message:s,stack:o,handlingStack:r,causes:i}}(o,e,i))}))},function(){console[e]=r}}))}(e)),Et[e]}));return bt.apply(this,n)}function Ot(e,t,n,r){return St(e,[t],n,r)}function St(e,t,n,o){var i=s(o&&o.once?function(e){u(),n(e)}:n);o=o&&o.passive?{capture:o.capture,passive:o.passive}:o&&o.capture;var a=r(e,"addEventListener");C(t,(function(t){a.call(e,t,i,o)}));var u=function(){var n=r(e,"removeEventListener");C(t,(function(t){n.call(e,t,i,o)}))};return{stop:u}}var Ct={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function xt(e,t){var n=[];fe(t,Ct.cspViolation)&&n.push(new mt((function(e){var t=function(t){e.notify(function(e){var t=Ct.cspViolation,n="'"+e.blockedURI+"' blocked by '"+e.effectiveDirective+"' directive";return{type:Ct.cspViolation,subtype:e.effectiveDirective,message:t+": "+n,stack:Tt(e.effectiveDirective,n+' of the policy "'+ce(e.originalPolicy,100)+'"',e.sourceFile,e.lineNumber,e.columnNumber)}}(t))};return Ot(document,Ae.SECURITY_POLICY_VIOLATION,t).stop})));var r=M(t,(function(e){return e!==Ct.cspViolation}));return r.length&&n.push(function(e){return new mt((function(t){if(window.ReportingObserver){var n=s((function(e){C(e,(function(e){t.notify(function(e){var t=e.body,n=e.type;return{type:n,subtype:t.id,message:n+": "+t.message,stack:Tt(t.id,t.message,t.sourceFile,t.lineNumber,t.columnNumber)}}(e))}))})),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}}))}(r)),bt.apply(this,n)}function Tt(e,t,n,r,o){return n&&vt({name:e,message:t,stack:[{func:"?",url:n,line:r,column:o}]})}var Rt=function(){this._events=[],this.pendingEvents=[]};Rt.prototype={emit:function(e){var t=[].slice.call(arguments,1);C(this._events,(function(n){if(n.type!==e)return!1;n.callback.apply(n.context,t)}))},on:function(e,t,n){"function"==typeof t&&this._events.push({type:e,callback:t,context:n||this})}};new Rt;var kt,Lt={PERFORMANCE_ENTRIES_COLLECTED:"PERFORMANCE_ENTRIES_COLLECTED",AUTO_ACTION_COMPLETED:"AUTO_ACTION_COMPLETED",BEFORE_VIEW_CREATED:"BEFORE_VIEW_CREATED",VIEW_CREATED:"VIEW_CREATED",VIEW_UPDATED:"VIEW_UPDATED",VIEW_ENDED:"VIEW_ENDED",AFTER_VIEW_ENDED:"AFTER_VIEW_ENDED",SESSION_RENEWED:"SESSION_RENEWED",SESSION_EXPIRED:"SESSION_EXPIRED",PAGE_EXITED:"PAGE_EXITED",REQUEST_STARTED:"REQUEST_STARTED",REQUEST_COMPLETED:"REQUEST_COMPLETED",RAW_RUM_EVENT_COLLECTED:"RAW_RUM_EVENT_COLLECTED",RUM_EVENT_COLLECTED:"RUM_EVENT_COLLECTED",RAW_ERROR_COLLECTED:"RAW_ERROR_COLLECTED",RAW_LOG_COLLECTED:"RAW_LOG_COLLECTED",LOG_COLLECTED:"LOG_COLLECTED"};function At(){this.callbacks={}}function It(e){return Mt(e,function(e){if(e.origin&&"null"!==e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}(window.location)).href}function Mt(e,t){if(function(){if(void 0!==kt)return kt;try{var e=new URL("http://test/path");return kt="http://test/path"===e.href}catch(e){kt=!1}return kt}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: "+e);var n=document,r=n.createElement("a");if(void 0!==t){var o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=t,n.head.appendChild(o),n.body.appendChild(r)}return r.href=e,r}At.prototype={notify:function(e,t){var n=this.callbacks[e];n&&C(n,(function(e){e(t)}))},subscribe:function(e,t){this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t);var n=this;return{unsubscribe:function(){n.callbacks[e]=M(n.callbacks[e],(function(e){return e!==t}))}}}};var Dt=navigator.userAgent.toLowerCase(),Pt=function(){return/iphone os/.test(Dt)};var Ut;function $t(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires="+o.toUTCString(),s=r&&r.crossSite?"none":"strict",a=r&&r.domain?";domain="+r.domain:"",u=r&&r.secure?";secure":"",c=r&&r.partitioned?";partitioned":"";document.cookie=e+"="+t+";"+i+";path=/;samesite="+s+a+u+c}function Bt(e){return function(e,t){for(ae.lastIndex=0;;){var n=ae.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}var Nt=/^\s+|\s+$/g,Gt={rum:"/rum",log:"/logging",sessionReplay:"/rum/replay"};function Wt(e,t){var n=Gt[t];if(!n)return"";var r=e.datakitOrigin||e.datakitUrl||e.site;0===r.indexOf("/")&&(r=location.origin+Ft(r));var o=r;return o=r.lastIndexOf("/")===r.length-1?Ft(r)+"v1/write"+n:Ft(r)+"/v1/write"+n,e.site&&e.clientToken&&(o=o+"?token="+e.clientToken+"&to_headless=true"),o}function Ft(e){return e.replace(Nt,"")}var Vt,jt;function Ht(e){if(void 0===e.sampleRate||de(e.sampleRate))if(void 0===e.sessionSampleRate||de(e.sessionSampleRate)){if(void 0===e.telemetrySampleRate||de(e.telemetrySampleRate)){var t=e.sessionSampleRate||e.sampleRate;return x({beforeSend:e.beforeSend&&c(e.beforeSend,"beforeSend threw an error:"),cookieOptions:qt(e),sessionSampleRate:_e(t,100),service:e.service,version:e.version,env:e.env,telemetrySampleRate:_e(e.telemetrySampleRate,100),telemetryEnabled:_e(e.telemetryEnabled,!1),silentMultipleInit:!!e.silentMultipleInit,batchBytesLimit:16*Ze,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*J,batchMessagesLimit:50,messageBytesLimit:256*Ze,resourceUrlLimit:5*Ze,storeContextsToLocal:!!e.storeContextsToLocal,storeContextsKey:e.storeContextsKey,sendContentTypeByJson:!!e.sendContentTypeByJson},function(e){var t=function(e){return!1};"isIntakeUrl"in e&&L(e.isIntakeUrl)&&W(e.isIntakeUrl())&&(t=e.isIntakeUrl);var n=function(e){return!1};return"isServerError"in e&&L(e.isServerError)&&W(e.isServerError())&&(n=e.isServerError),{rumEndpoint:Wt(e,"rum"),logsEndpoint:Wt(e,"log"),sessionReplayEndPoint:Wt(e,"sessionReplay"),isIntakeUrl:t,isServerError:n}}(e))}n.error("Telemetry Sample Rate should be a number between 0 and 100")}else n.error("Sample Rate should be a number between 0 and 100");else n.error("Sample Rate should be a number between 0 and 100")}function qt(e){var t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===Ut){for(var e="gc_site_test_".concat(H()),t=window.location.hostname.split("."),n=t.pop();t.length&&!Bt(e);)n=t.pop()+"."+n,$t(e,"test",J,{domain:n});Ut=n}return Ut}()),t}function Qt(){return Vt||(Vt=new mt((function(e){if(window.fetch){var t=yt(window,"fetch",(function(t){return function(e,t){var n=e.parameters,r=e.onPostCall,o=e.handlingStack,i=n[0],a=n[1],u=a&&a.method;void 0===u&&i instanceof Request&&(u=i.method);var c=void 0!==u?String(u).toUpperCase():"GET",f=i instanceof Request?i.url:It(String(i)),l=re(),d={state:"start",init:a,input:i,method:c,startClocks:l,url:f,handlingStack:o};t.notify(d),n[0]=d.input,n[1]=d.init,r((function(e){return function(e,t,n){var r=n,o=function(t){r.state="resolve",x(r,t),e.notify(r)};t.then(s((function(e){var t="";try{t=e.constructor===Response&&e.type||""}catch(e){t=""}o({response:e,responseType:t,status:e.status,isAborted:!1})})),s((function(e){o({status:0,isAborted:r.init&&r.init.signal&&r.init.signal.aborted||e instanceof DOMException&&e.code===DOMException.ABORT_ERR,error:e})})))}(t,e,d)}))}(t,e)}),{computeHandlingStack:!0});return t.stop}}))),Vt}var Kt=new WeakMap;function zt(){return jt||(jt=new mt((function(e){var t=yt(XMLHttpRequest.prototype,"open",Xt),n=yt(XMLHttpRequest.prototype,"send",(function(t){!function(e,t){var n=e.target,r=e.handlingStack,o=Kt.get(n);if(o){var i=o;i.state="start",i.startClocks=re(),i.isAborted=!1,i.xhr=n,i.handlingStack=r;var s=!1,a=yt(n,"onreadystatechange",(function(){n.readyState===XMLHttpRequest.DONE&&u()})).stop,u=function(){if(c(),a(),!s){s=!0;var e,r=o;r.state="complete",r.duration=(e=i.startClocks.timeStamp,oe()-e),r.status=n.status,t.notify(x({},r))}},c=Ot(n,"loadend",u).stop;t.notify(i)}}(t,e)}),{computeHandlingStack:!0}),r=yt(XMLHttpRequest.prototype,"abort",Yt);return function(){t.stop(),n.stop(),r.stop()}}))),jt}function Xt(e){var t=e.target,n=e.parameters[0],r=e.parameters[1];Kt.set(t,{state:"open",method:String(n).toUpperCase(),url:It(String(r))})}function Yt(e){var t=e.target,n=Kt.get(t);n&&(n.isAborted=!0)}var Jt={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var Zt,en={sdk_name:"_gc.sdk_name",sdk_version:"_gc.sdk_version",app_id:"application.id",env:"env",service:"service",version:"version",source:"source",userid:"user.id",user_email:"user.email",user_name:"user.name",session_id:"session.id",session_type:"session.type",session_sampling:"session.is_sampling",is_signin:"user.is_signin",os:"device.os",os_version:"device.os_version",os_version_major:"device.os_version_major",browser:"device.browser",browser_version:"device.browser_version",browser_version_major:"device.browser_version_major",screen_size:"device.screen_size",network_type:"device.network_type",device:"device.device",view_id:"view.id",view_referrer:"view.referrer",view_url:"view.url",view_host:"view.host",view_path:"view.path",view_name:"view.path",view_path_group:"view.path_group"},tn={view_url_query:"view.url_query",action_id:"action.id",action_ids:"action.ids",view_in_foreground:"view.in_foreground",display:"display",session_has_replay:"session.has_replay",is_login:"user.is_login",page_states:"_gc.page_states",session_sample_rate:"_gc.configuration.session_sample_rate",session_replay_sample_rate:"_gc.configuration.session_replay_sample_rate",drift:"_gc.drift"},nn={view:{type:Ie.VIEW,tags:{view_loading_type:"view.loading_type",view_apdex_level:"view.apdex_level",view_privacy_replay_level:"privacy.replay_level"},fields:{sampled_for_replay:"session.sampled_for_replay",is_active:"view.is_active",session_replay_stats:"_gc.replay_stats",session_is_active:"session.is_active",view_error_count:"view.error.count",view_resource_count:"view.resource.count",view_long_task_count:"view.long_task.count",view_action_count:"view.action.count",first_contentful_paint:"view.first_contentful_paint",largest_contentful_paint:"view.largest_contentful_paint",largest_contentful_paint_element_selector:"view.largest_contentful_paint_element_selector",cumulative_layout_shift:"view.cumulative_layout_shift",cumulative_layout_shift_time:"view.cumulative_layout_shift_time",cumulative_layout_shift_target_selector:"view.cumulative_layout_shift_target_selector",first_input_delay:"view.first_input_delay",loading_time:"view.loading_time",dom_interactive:"view.dom_interactive",dom_content_loaded:"view.dom_content_loaded",dom_complete:"view.dom_complete",load_event:"view.load_event",first_input_time:"view.first_input_time",first_input_target_selector:"view.first_input_target_selector",first_paint_time:"view.fpt",interaction_to_next_paint:"view.interaction_to_next_paint",interaction_to_next_paint_target_selector:"view.interaction_to_next_paint_target_selector",resource_load_time:"view.resource_load_time",time_to_interactive:"view.tti",dom:"view.dom",dom_ready:"view.dom_ready",time_spent:"view.time_spent",first_byte:"view.first_byte",frustration_count:"view.frustration.count",custom_timings:"view.custom_timings"}},resource:{type:Ie.RESOURCE,tags:{trace_id:"_gc.trace_id",span_id:"_gc.span_id",resource_url:"resource.url",resource_url_host:"resource.url_host",resource_url_path:"resource.url_path",resource_url_path_group:"resource.url_path_group",resource_url_query:"resource.url_query",resource_type:"resource.type",resource_status:"resource.status",resource_status_group:"resource.status_group",resource_method:"resource.method"},fields:{duration:"resource.duration",resource_size:"resource.size",resource_encode_size:"resource.encoded_body_size",resource_decode_size:"resource.decoded_body_size",resource_transfer_size:"resource.transfer_size",resource_render_blocking_status:"resource.render_blocking_status",resource_dns:"resource.dns",resource_tcp:"resource.tcp",resource_ssl:"resource.ssl",resource_ttfb:"resource.ttfb",resource_trans:"resource.trans",resource_redirect:"resource.redirect",resource_first_byte:"resource.firstbyte",resource_dns_time:"resource.dns_time",resource_download_time:"resource.download_time",resource_first_byte_time:"resource.first_byte_time",resource_connect_time:"resource.connect_time",resource_ssl_time:"resource.ssl_time",resource_redirect_time:"resource.redirect_time"}},error:{type:Ie.ERROR,tags:{error_id:"error.id",trace_id:"_gc.trace_id",span_id:"_gc.span_id",error_source:"error.source",error_type:"error.type",error_handling:"error.handling"},fields:{error_message:["string","error.message"],error_stack:["string","error.stack"],error_causes:["string","error.causes"],error_handling_stack:["string","error.handling_stack"]}},long_task:{type:Ie.LONG_TASK,tags:{long_task_id:"long_task.id"},fields:{duration:"long_task.duration"}},action:{type:Ie.ACTION,tags:{action_type:"action.type"},fields:{action_name:"action.target.name",duration:"action.loading_time",action_error_count:"action.error.count",action_resource_count:"action.resource.count",action_frustration_types:"action.frustration.type",action_long_task_count:"action.long_task.count",action_target:"_gc.action.target",action_position:"_gc.action.position"}},telemetry:{type:"telemetry",fields:{status:"telemetry.status",message:["string","telemetry.message"],type:"telemetry.type",error_stack:["string","telemetry.error.stack"],error_kind:["string","telemetry.error.kind"]}},browser_log:{type:Ie.LOGGER,tags:{error_source:"error.source",error_type:"error.type",error_resource_url:"http.url",error_resource_url_host:"http.url_host",error_resource_url_path:"http.url_path",error_resource_url_path_group:"http.url_path_group",error_resource_status:"http.status_code",error_resource_status_group:"http.status_group",error_resource_method:"http.method",action_id:"user_action.id",service:"service",status:"status"},fields:{message:["string","message"]}}},rn=4*ee,on=15*Z,sn=/^([a-z]+)=([a-z0-9-]+)$/,an="&",un="_dataflux_s",cn=10,fn=100,ln=[];function dn(e,t){if(void 0===t&&(t=0),Zt||(Zt=e),e===Zt)if(t>=fn)gn();else{var n,r=yn();if(pn()){if(r.lock)return void vn(e,t);if(n=H(),r.lock=n,hn(r,e.options),(r=yn()).lock!==n)return void vn(e,t)}var o=e.process(r);if(pn()&&(r=yn()).lock!==n)vn(e,t);else{if(o&&function(e,t){if(_n(e))return void mn(t);e.expire=String(ie()+on),hn(e,t)}(o,e.options),pn()&&(!o||!_n(o))){if((r=yn()).lock!==n)return void vn(e,t);delete r.lock,hn(r,e.options),o=r}e.after&&e.after(o||r),gn()}}else ln.push(e)}function pn(){return ge()===ve.CHROMIUM}function vn(e,t){d((function(){dn(e,t+1)}),cn)}function gn(){Zt=void 0;var e=ln.shift();e&&dn(e)}function hn(e,t){$t(un,function(e){return D(N(e),(function(e){return e[0]+"="+e[1]})).join(an)}(e),on,t)}function yn(){var e=Bt(un),t={};return function(e){return void 0!==e&&(-1!==e.indexOf(an)||sn.test(e))}(e)&&C(e.split(an),(function(e){var n=sn.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}function _n(e){return B(e)}function mn(e){$t(un,"",0,e)}var bn=J;function En(e,t,n){var r=new mt,o=new mt,i=v((function(){dn({options:e,process:function(e){return d(e)?void 0:{}},after:f})}),bn),s=function(){var e=yn();if(d(e))return e;return{}}(),a=V((function(){var o;dn({options:e,process:function(e){var r=f(e);return o=function(e){var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,i&&!e.id&&(e.id=H(),e.created=String(ie()));return i}(r),r},after:function(e){o&&!l()&&function(e){s=e,r.notify()}(e),s=e}})}),bn),u=a.throttled,c=a.cancel;function f(e){return d(e)||(e={}),l()&&(!function(e){return s.id!==e.id||s[t]!==e[t]}(e)?s=e:(s={},o.notify())),e}function l(){return void 0!==s[t]}function d(e){return(void 0===e.created||ie()-Number(e.created)<rn)&&(void 0===e.expire||ie()<Number(e.expire))}return{expandOrRenewSession:u,expandSession:function(){dn({options:e,process:function(e){return l()?f(e):void 0}})},getSession:function(){return s},renewObservable:r,expireObservable:o,expire:function(){c(),mn(e),f({})},stop:function(){g(i)}}}var wn=Z,On=rn,Sn=[],Cn=function(e,t,n){var r=new mt,o=new mt,i=En(e,t,n);Sn.push((function(){return i.stop()}));var s,a,u=xe({expireDelay:On});function c(){return{id:i.getSession().id,trackingType:i.getSession()[t]}}return Sn.push((function(){return u.stop()})),i.renewObservable.subscribe((function(){u.add(c(),ne()),r.notify()})),i.expireObservable.subscribe((function(){o.notify(),u.closeActive(ne())})),i.expandOrRenewSession(),u.add(c(),[0,se()][0]),s=function(){return i.expandOrRenewSession()},a=St(window,[Ae.CLICK,Ae.TOUCH_START,Ae.KEY_DOWN,Ae.SCROLL],s,{capture:!0,passive:!0}),Sn.push(a.stop),function(e){var t=function(){"visible"===document.visibilityState&&e()},n=Ot(document,Ae.VISIBILITY_CHANGE,t);Sn.push(n.stop);var r=v(t,wn);Sn.push((function(){g(r)}))}((function(){return i.expandSession()})),{findActiveSession:function(e){return u.find(e)},renewObservable:r,expireObservable:o,expire:i.expire}};var xn=80*Ze,Tn=32,Rn=3*et,kn=256*J,Ln=J,An={UP:0,FAILURE_DETECTED:1,DOWN:2},In={AFTER_SUCCESS:0,AFTER_RESUME:1};function Mn(e,t,n,r,o){t.transportStatus===An.UP&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Pn(e,t,n,{onSuccess:function(){return Un(In.AFTER_SUCCESS,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),Dn(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function Dn(e,t,n,r){e.transportStatus===An.DOWN&&d((function(){Pn(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=Ln,Un(In.AFTER_RESUME,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(kn,2*e.currentBackoffTime),Dn(e,t,n,r)}})}),e.currentBackoffTime)}function Pn(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),!function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||e.status>=500)}(n)?(t.transportStatus=An.UP,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?An.FAILURE_DETECTED:An.DOWN,t.lastFailureStatus=n.status,i())}))}function Un(e,t,n,r,o){e===In.AFTER_SUCCESS&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max "+r+" events size queued for upload: "+Rn/et+"MiB",source:lt.AGENT,startClocks:re()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=$n();i.size()>0;)Mn(i.dequeue(),t,n,r,o)}function $n(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=Rn}}}function Bn(e){return e?e+(-1===e.indexOf("?")?"?":"&")+"precision=ms":e}function Nn(e,t,n,r){var o=n?"application/json; charset=UTF-8":void 0,i={transportStatus:An.UP,lastFailureStatus:0,currentBackoffTime:Ln,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=xn&&this.ongoingRequestCount<Tn},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:$n(),queueFullReported:!1},a=function(n,r){return function(e,t,n,r,o){var i=r.data,a=r.bytesCount,u=Bn(e),c=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&a<t;if(c){var f={method:"POST",body:i,keepalive:!0,mode:"cors"};n&&(f.headers={"Content-Type":n}),fetch(u,f).then(s((function(e){"function"==typeof o&&o({status:e.status,type:e.type})})),s((function(){Gn(u,n,i,o)})))}else Gn(u,n,i,o)}(e,t,o,n,r)};return{send:function(t){Mn(t,i,a,e,r)},sendOnExit:function(n){!function(e,t,n,r){var o=r.data,i=r.bytesCount,s=Bn(e),a=!!navigator.sendBeacon&&i<t;if(a)try{var u;if(u=n?new Blob([o],{type:n}):o,navigator.sendBeacon(s,u))return}catch(e){}Gn(s,n,o)}(e,t,o,n)}}}function Gn(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",e,!0),t&&o.setRequestHeader("Content-Type",t),Ot(o,"loadend",(function(){"function"==typeof r&&r({status:o.status})}),{once:!0}),o.send(n)}function Wn(e){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wn(e)}function Fn(e){if("object"===Wn(e)&&e)e=$e(e);else if(!G(e))return e;return String(e).replace(/[\s=,"]/g,(function(e){return"\\"+e}))}function Vn(e,t){return"object"===Wn(e)&&e?e=$e(e):t&&(e=""+e),e}function jn(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function Hn(e){return"object"===Wn(e)&&e?jn($e(e)):G(e)?jn(e):e}var qn="custom_keys",Qn=function(e){if(!e||!e.type)return{rowStr:"",rowData:void 0};var t={tags:{},fields:{}},n=!1,r="";return C(nn,(function(o,i){if(o.type===e.type){r+=i+",",t.measurement=i;var s=[],a=T({},en,o.tags),u=["date","type",qn];C(a,(function(n,r){var o=ue(e,n);u.push(r),(o||F(o))&&(t.tags[r]=Vn(o,!0),s.push(Fn(r)+"="+Fn(o)))}));var c=[],f=T({},tn,o.fields);if(C(f,(function(n,r){if(k(n)&&2===n.length){var o=n[1],i=ue(e,o);u.push(r),null!=i&&(t.fields[r]=Vn(i),c.push(Fn(r)+"="+Hn(i)))}else if(G(n)){i=ue(e,n);u.push(r),null!=i&&(t.fields[r]=Vn(i),c.push(Fn(r)+"="+Hn(i)))}})),e.context&&$(e.context)&&!B(e.context)){var l=[];C(e.context,(function(e,n){u.indexOf(n)>-1||(u.push(n),null!=e&&(l.push(n),t.fields[n]=Vn(e),c.push(Fn(n)+"="+Hn(e))))})),l.length&&(t.fields[qn]=Vn(l),c.push(Fn(qn)+"="+Hn(l)))}e.type===Ie.LOGGER&&C(e,(function(e,n){-1===u.indexOf(n)&&null!=e&&(t.fields[n]=Vn(e),c.push(Fn(n)+"="+Hn(e)))})),s.length&&(r+=s.join(",")),c.length&&(r+=" ",r+=c.join(","),n=!0),r=r+" "+e.date,t.time=e.date}})),{rowStr:n?r:"",rowData:n?t:void 0}},Kn=function(e,t,n,r){this.pushOnlyBuffer=[],this.upsertBuffer={},this.request=e,this.flushController=t,this.messageBytesLimit=n,this.sendContentTypeByJson=r;var o=this;this.flushController.flushObservable.subscribe((function(e){o.flush(e)}))};Kn.prototype.add=function(e){this.addOrUpdate(e)},Kn.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},Kn.prototype.flush=function(e){var t,n=this.pushOnlyBuffer.concat(A(this.upsertBuffer));if(this.pushOnlyBuffer=[],this.upsertBuffer={},n.length>0){var r={data:this.sendContentTypeByJson?"["+n.join(",")+"]":n.join("\n"),bytesCount:e.bytesCount,flushReason:e.reason};t=e.reason,fe(A(Jt),t)?this.request.sendOnExit(r):this.request.send(r)}},Kn.prototype.addOrUpdate=function(e,t){var r=this.process(e),o=r.processedMessage,i=r.messageBytesCount;i>=this.messageBytesLimit?n.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.messageBytesLimit+"KB."):(this.hasMessageFor(t)&&this.remove(t),this.push(o,i,t))},Kn.prototype.process=function(e){var t="";return{processedMessage:t=this.sendContentTypeByJson?$e(Qn(e).rowData):Qn(e).rowStr,messageBytesCount:nt(t)}},Kn.prototype.push=function(e,t,n){var r=this.flushController.getMessagesCount()>0?1:0;this.flushController.notifyBeforeAddMessage(t+r),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.flushController.notifyAfterAddMessage()},Kn.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=nt(t),r=this.flushController.getMessagesCount()>1?1:0;this.flushController.notifyAfterRemoveMessage(n+r)},Kn.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]};var zn=Kn;function Xn(e){var t=e.messagesLimit,n=e.bytesLimit,r=e.durationLimit,o=e.pageExitObservable,i=e.sessionExpireObservable,s=new mt;o.subscribe((function(e){return f(e.reason)})),i.subscribe((function(){return f("session_expire")}));var a,u=0,c=0;function f(e){if(0!==c){var t=c,n=u;c=0,u=0,l(),s.notify({reason:e,messagesCount:t,bytesCount:n})}}function l(){p(a),a=void 0}return{flushObservable:s,getMessagesCount:function(){return c},notifyBeforeAddMessage:function(e){u+e>=n&&f("bytes_limit"),c+=1,u+=e,void 0===a&&(a=d((function(){f("duration_limit")}),r))},notifyAfterAddMessage:function(){c>=t?f("messages_limit"):u>=n&&f("bytes_limit")},notifyAfterRemoveMessage:function(e){u-=e,0===(c-=1)&&l()}}}function Yn(e,t,n,r,o){var i=function(t){return new zn(Nn(t,e.batchBytesLimit,e.sendContentTypeByJson,n),Xn({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageExitObservable:r,sessionExpireObservable:o}),e.messageBytesLimit,e.sendContentTypeByJson)}(t);return{add:function(e){i.add(e)}}}function Jn(){var e=l().FTWebViewJavascriptBridge;if(e)return{send:function(t,n){e.sendEvent(JSON.stringify({name:t,data:n}))}}}function Zn(){return!!Jn()}var er=3*Ze,tr={FeatureFlag:"feature flag evaluation",User:"user",GlobalContext:"global context",LoggerContext:"logger context"};var nr=200;function rr(e,t){void 0===t&&(t=nt);var r,o={},i=!1,s=new mt,a=V((function(o){r=t($e(o)),i||(i=function(e,t){return e>er&&(n.warn("The "+t+"data is over "+er/Ze+" KiB. On low connectivity, the SDK has the potential to exhaust the user's upload bandwidth."),!0)}(r,e))}),nr).throttled,u={getBytesCount:function(){return r},get:function(){return o},add:function(e,t){o[e]=t,a(o),s.notify()},remove:function(e){delete o[e],a(o),s.notify()},set:function(e){a(o=e),s.notify()},getContext:function(){return z(o)},setContext:function(e){"object"===Q(e)?(o=at(e),a(o)):u.clearContext(),s.notify()},setContextProperty:function(e,t){o[e]=z(t),a(o),s.notify()},removeContextProperty:function(e){delete o[e],a(o),s.notify()},clearContext:function(){o={},r=0,s.notify()},changeObservable:s};return u}var or="_gc_s",ir=[];function sr(e,t,n,r){var o=function(e,t,n){return e.storeContextsKey&&G(e.storeContextsKey)?or+"_"+t+"_"+n+"_"+e.storeContextsKey:or+"_"+t+"_"+n}(e,n,r);function i(){var e=localStorage.getItem(o);return null!==e?JSON.parse(e):{}}return ir.push(Ot(window,Ae.STORAGE,(function(e){o===e.key&&t.setContext(i())}))),t.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(t.getContext()))})),t.setContext(R(i(),t.getContext())),t}function ar(e){this.map=new WeakMap,e&&e.forEach((function(e){this.map.set(e,1)}))}ar.prototype.add=function(e){return this.map.set(e,1),this},ar.prototype.delete=function(e){return this.map.delete(e)},ar.prototype.has=function(e){return this.map.has(e)};var ur,cr={log:"log",configuration:"configuration"},fr={debug:"debug",error:"error"},lr=["https://static.guance.com","http://localhost","<anonymous>"],dr={LOGS:"browser-logs-sdk",RUM:"browser-rum-sdk"},pr={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1};function vr(t,n){var r,o=new mt;return pr.telemetryEnabled=n.telemetryEnabled&&te(n.telemetrySampleRate),ur=function(e){if(pr.telemetryEnabled){var n=function(e,t){return R({type:"telemetry",date:oe(),service:e,version:"3.1.22",source:"browser",telemetry:t},void 0!==r?r():{})}(t,e);o.notify(n)}},e=gr,x(pr,{maxEventsPerPage:n.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){r=e},observable:o,enabled:pr.telemetryEnabled}}function gr(e,t){hr(x({type:cr.log,status:fr.error},function(e){if(e instanceof Error){var t=We(e);return{error:{kind:t.name,stack:vt(yr(t))},message:t.message}}return{error:{stack:ft},message:Pe.UNCAUGHT+" "+$e(e)}}(e),t))}function hr(e){ur&&pr.sentEventCount<pr.maxEventsPerPage&&(pr.sentEventCount+=1,ur(e))}function yr(e){return e.stack=e.stack.filter((function(e){return!e.url||lr.some((function(t){return me(e.url,t)}))})),e}var _r={sdkVersion:"3.1.22",sdkName:"df_web_logs_sdk"},mr=32*Ze;function br(e){var r=function(e){return e.site||e.datakitOrigin||e.datakitUrl?!(e.site&&!e.clientToken&&(n.error("clientToken is not configured, no RUM data will be collected."),1)):(n.error("datakitOrigin or site is not configured, no RUM data will be collected."),!1)}(e);if(r){var o=Ht(e),i=Er(e.forwardConsoleLogs,A(t),"Forward Console Logs"),s=Er(e.forwardReports,A(Ct),"Forward Reports");if(o&&i&&s)return e.forwardErrorsToLogs&&!fe(i,t.error)&&i.push(t.error),x({forwardErrorsToLogs:!1!==e.forwardErrorsToLogs,forwardConsoleLogs:i,forwardReports:s,requestErrorResponseLengthLimit:mr},o,_r)}}function Er(e,t,r){return void 0===e?[]:"all"===e||k(e)&&U(e,(function(e){return fe(t,e)}))?"all"===e?t:j(e):void n.error(r+' should be "all" or an array with allowed values "'+t.join('", "')+'"')}var wr={debug:"debug",error:"error",info:"info",warn:"warn",critical:"critical"},Or={console:"console",http:"http",silent:"silent"},Sr=I(wr);function Cr(e,t,n,r,o){this.contextManager=rr(tr.LoggerContext),void 0===n&&(n=Or.http),void 0===r&&(r=wr.debug),void 0===o&&(o={}),this.handleLogStrategy=e,this.handlerType=n,this.level=r,this.contextManager.set(x({},o,t?{logger:{name:t}}:void 0))}Cr.prototype={log:s((function(e,t,n,r){var o;if(void 0===n&&(n=wr.info),n===wr.error&&(o={origin:lt.LOGGER}),null!=r){var i=dt({stackTrace:r instanceof Error?We(r):void 0,originalError:r,nonErrorPrefix:Pe.PROVIDED,source:lt.LOGGER,handling:De.HANDLED,startClocks:re()});o={origin:lt.LOGGER,stack:i.stack,kind:i.type,message:i.message,causes:i.causes}}var s=at(t),a=o?R({error:o},s):s;this.handleLogStrategy({message:e,context:a,status:n},this)})),debug:function(e,t,n){this.log(e,t,wr.debug,n)},info:function(e,t,n){this.log(e,t,wr.info,n)},warn:function(e,t,n){this.log(e,t,wr.warn,n)},critical:function(e,t,n){this.log(e,t,wr.critical,n)},error:function(e,t,n){var r={error:{origin:lt.LOGGER}};this.log(e,R(r,t),wr.error,n)},setContext:function(e){this.contextManager.set(e)},getContext:function(){return this.contextManager.get()},addContext:function(e,t){this.contextManager.add(e,t)},removeContext:function(e){this.contextManager.remove(e)},clearContext(){this.contextManager.clearContext()},setHandler:function(e){this.handlerType=e},getHandler:function(){return this.handlerType},setLevel:function(e){this.level=e},getLevel:function(){return this.level}};var xr="logs";var Tr="logs",Rr={NOT_TRACKED:"0",TRACKED:"1"};function kr(e){var t=Cn(e.cookieOptions,Tr,(function(t){return function(e,t){var n=function(e){return e===Rr.NOT_TRACKED||e===Rr.TRACKED}(t)?t:Lr(e);return{trackingType:n,isTracked:n===Rr.TRACKED}}(e,t)}));return{findTrackedSession:function(e){var n=t.findActiveSession(e);return n&&n.trackingType===Rr.TRACKED?{id:n.id}:void 0},expireObservable:t.expireObservable}}function Lr(e){return te(e.sessionSampleRate)?Rr.TRACKED:Rr.NOT_TRACKED}var Ar={[wr.debug]:0,[wr.info]:1,[wr.warn]:2,[wr.error]:3};function Ir(e,t,n){var r=n.getHandler(),o=k(r)?r:[r];return Ar[e]>=Ar[n.getLevel()]&&fe(o,t)}function Mr(e,t,n,r,o,i){var s=Sr.concat(["custom"]),a={};C(s,(function(e){var n,r,o,s,u;a[e]=(n=e,r=t.eventRateLimiterThreshold,o=i,s=0,u=!1,{isLimitReached:function(){if(0===s&&d((function(){s=0}),Z),(s+=1)<=r||u)return u=!1,!1;if(s===r+1){u=!0;try{o({message:"Reached max number of "+n+"s by minute: "+r,source:lt.AGENT,startClocks:re()})}finally{u=!1}}return!0}})})),n.subscribe(Lt.RAW_LOG_COLLECTED,(function(i){var s=i.rawLogsEvent,u=i.messageContext||void 0,c=i.savedCommonContext||void 0,f=i.logger||o,l=s.date-se(),d=e.findTrackedSession(l);if(d){var p=c||r(),v=R({service:t.service||"browser",env:t.env||"",version:t.version||"",_gc:{sdkName:t.sdkName,sdkVersion:t.sdkVersion},session:{id:d.id},view:p.view,user:B(p.user)?void 0:p.user,device:Le,type:Ie.LOGGER},p.context,Dr(l),s,f.getContext(),u);!Ir(s.status,Or.http,f)||t.beforeSend&&!1===t.beforeSend(v)||v.error&&v.error.origin!==lt.AGENT&&_e(a[v.status],a.custom).isLimitReached()||n.notify(Lt.LOG_COLLECTED,he(v))}}))}function Dr(e){return function(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}(window.DATAFLUX_RUM)}var Pr={[t.log]:wr.info,[t.debug]:wr.debug,[t.info]:wr.info,[t.warn]:wr.warn,[t.error]:wr.error};var Ur={[Ct.cspViolation]:wr.error,[Ct.intervention]:wr.error,[Ct.deprecation]:wr.warn};function $r(e,t){if(!e.forwardErrorsToLogs)return{stop:X};var n=zt().subscribe((function(e){"complete"===e.state&&o(Me.XHR,e)})),r=Qt().subscribe((function(e){"resolve"===e.state&&o(Me.FETCH,e)}));function o(n,r){function o(e){var o,i,s,a=q(r.url).getParse();t.notify(Lt.RAW_LOG_COLLECTED,{rawLogsEvent:{message:Nr(n)+" error "+r.method+" "+r.url,date:r.startClocks.timeStamp,error:{origin:lt.NETWORK,stack:e||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url,statusGroup:(s=r.status,s?String(s).substr(0,1)+String(s).substr(1).replace(/\d*/g,"x"):s),urlHost:a.Host,urlPath:a.Path,urlPathGroup:(o=a.Path,i="",o&&(i=o.replace(/\/([^\/]*)\d([^\/]*)/g,"/?").replace(/\/$/g,"")),i||"/")},status:wr.error,origin:lt.NETWORK}})}!function(e,t){var n=[t.rumEndpoint];return t.logsEndpoint&&n.push(t.logsEndpoint),t.sessionReplayEndPoint&&n.push(t.sessionReplayEndPoint),P(n,(function(t){return 0===e.indexOf(t)}))||t.isIntakeUrl(e)}(r.url,e)&&(function(e){return 0===e.status&&"opaque"!==e.responseType}(r)||function(e){return e.status>=500}(r)||e.isServerError(r))&&("xhr"in r?function(e,t,n){"string"==typeof e.response?n(Br(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){var r=function(e){try{return e.clone()}catch(e){return}}(e);r&&r.body?window.TextDecoder?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],i=0;function a(){var e,s;if(r.cancel().catch(X),n.collectStreamBody){var a;if(1===o.length)a=o[0];else{a=new Uint8Array(i);var u=0;C(o,(function(e){a.set(e,u),u+=e.length}))}e=a.slice(0,n.bytesLimit),s=a.length>n.bytesLimit}t(void 0,e,s)}!function e(){r.read().then(s((function(t){t.done?a():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?a():e())})),s((function(e){t(e)})))}()}(e,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}),{bytesLimit:t,collectStreamBody:!0})}(r.body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: "+e:t)})):r.text().then(s((function(e){return n(Br(e,t))})),s((function(e){return n("Unable to retrieve response: "+e)}))):n()}(r.response,e,o):r.error&&function(e,t,n){n(Br(vt(We(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function Br(e,t){return e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Nr(e){return Me.XHR===e?"XHR":"Fetch"}function Gr(e,t){if(!e.forwardErrorsToLogs)return{stop:X};var n,r=new mt,o=(n=r,Je((function(e,t){n.notify(dt({stackTrace:e,originalError:t,startClocks:re(),nonErrorPrefix:Pe.UNCAUGHT,source:lt.SOURCE,handling:De.UNHANDLED}))}))),i=r.subscribe((function(e){t.notify(Lt.RAW_LOG_COLLECTED,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{kind:e.type,stack:e.stack,causes:e.causes},origin:lt.SOURCE,status:wr.error}})}));return{stop:function(){o.stop(),i.unsubscribe()}}}const Wr=function(e){var t,r,o=!1,a=rr(tr.GlobalContext),u=rr(tr.User),c={},f=function(){},l=new Ee,d=function(e,t,n,r){void 0===n&&(n=z(g())),void 0===r&&(r=oe()),l.add((function(){return d(e,t,n,r)}))},p=function(){},v=new Cr((function(){return d.apply(this,arguments)}));function g(){return{view:{referrer:document.referrer,url:window.location.href},context:a.getContext(),user:u.getContext()}}return t={logger:v,init:s((function(t){if(function(e){return!o||(e.silentMultipleInit||n.error("DD_LOGS is already initialized."),!1)}(t)){var r=br(t);if(r){t.storeContextsToLocal&&(sr(r,a,xr,tr.GlobalContext),sr(r,u,xr,tr.User));var i=e(r,g,v);d=i.handleLog,f=i.getInternalContext,p=function(){return z(t)},l.drain(),o=!0}}})),getGlobalContext:s((function(){return a.getContext()})),setGlobalContext:s((function(e){return a.setContext(e)})),setGlobalContextProperty:s((function(e,t){return a.setContextProperty(e,t)})),removeGlobalContextProperty:s((function(e){return a.removeContextProperty(e)})),clearGlobalContext:s((function(){return a.clearContext()})),createLogger:s((function(e,t){return void 0===t&&(t={}),c[e]=new Cr((function(){return d(this.arguments)}),e,t.handler,t.level,t.context),c[e]})),getLogger:s((function(e){return c[e]})),getInitConfiguration:s((function(){return p()})),getInternalContext:s((function(e){return f(e)})),setUser:s((function(e){(function(e){var t="object"===Q(e);return t||n.error("Unsupported user:",e),t})(e)&&u.setContext(function(e){var t=x({},e);return C(["id","name","email"],(function(e){e in t&&(t[e]=String(t[e]))})),t}(e))})),getUser:s((function(){return u.getContext()})),removeUserProperty:s((function(e){return u.removeContextProperty(e)})),clearUser:s((function(){return u.clearContext()}))},r=x({onReady:function(e){e()}},t),Object.defineProperty(r,"_setDebug",{get:function(){return i},enumerable:!1}),r}((function(e,r,o){var i=new At,s=function(e){i.notify(Lt.RAW_LOG_COLLECTED,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{origin:lt.AGENT},origin:lt.AGENT,status:wr.error}})},a=new mt((function(e){var t=St(document,[Ae.VISIBILITY_CHANGE,Ae.FREEZE,Ae.PAGE_HIDE],(function(t){t.type===Ae.VISIBILITY_CHANGE&&"hidden"===document.visibilityState?e.notify({reason:Jt.HIDDEN}):t.type===Ae.FREEZE&&e.notify({reason:Jt.FROZEN})}),{capture:!0}),n=Ot(window,Ae.BEFORE_UNLOAD,(function(){e.notify({reason:Jt.UNLOADING})}));return function(){t.stop(),n.stop()}})),u=function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="gc_cookie_test_".concat(H()),n="test";return $t(t,n,J,e),Bt(t)===n}catch(e){return!1}}(e.cookieOptions)?kr(e):function(e){var t=Lr(e)===Rr.TRACKED?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new mt}}(e);(function(e,t,n,r){const o=vr(dr.LOGS,e);if(!Zn()){var i=Yn(e,e.rumEndpoint,t,n,r);o.observable.subscribe((function(e){i.add(e)}))}return o})(e,s,a,u.expireObservable).setContextProvider((function(){var e=Dr();return{application:{id:e&&e.application&&e.application.id},session:{id:u.findTrackedSession()&&u.findTrackedSession().id},view:{id:e&&e.view&&e.view.id},action:{id:e&&e.userAction&&e.userAction.id}}})),$r(e,i),Gr(e,i),function(e,n){var r=wt(e.forwardConsoleLogs).subscribe((function(e){n.notify(Lt.RAW_LOG_COLLECTED,{rawLogsEvent:{date:oe(),message:e.message,origin:lt.CONSOLE,error:e.api===t.error?{origin:lt.CONSOLE,stack:e.stack,causes:e.causes}:void 0,status:Pr[e.api]}})}))}(e,i),function(e,t){var n=xt(0,e.forwardReports).subscribe((function(e){var n,r,o,i=e.message,s=Ur[e.type];s===wr.error?n={kind:e.subtype,origin:lt.REPORT,stack:e.stack}:e.stack&&(i+=" Found in "+(r=e.stack,(o=/@ (.+)/.exec(r))&&o[1])),t.notify(Lt.RAW_LOG_COLLECTED,{rawLogsEvent:{date:oe(),message:i,origin:lt.REPORT,error:n,status:s}})}))}(e,i);var c=function(e){return{handleLog:function(t,r,o,i){var s=t.context;Ir(t.status,Or.console,r)&&n(t.status,t.message,R(r.getContext(),s)),e.notify(Lt.RAW_LOG_COLLECTED,{rawLogsEvent:{date:i||oe(),message:t.message,status:t.status,origin:lt.LOGGER},messageContext:s,savedCommonContext:o,logger:r})}}}(i);Mr(u,e,i,r,o,s),Zn()||function(e,t,n,r,o){var i=Yn(e,e.logsEndpoint,n,r,o);t.subscribe(Lt.LOG_COLLECTED,(function(e){i.add(e)}))}(e,i,s,a,u.expireObservable);var f,l=(f=u,{get:function(e){var t=f.findTrackedSession(e);if(t)return{session:{id:t.id}}}});return{handleLog:c.handleLog,getInternalContext:l.get}}));var Fr,Vr,jr,Hr;Fr=l(),jr=Wr,Hr=Fr[Vr="DATAFLUX_LOGS"],Fr[Vr]=jr,Hr&&Hr.q&&C(Hr.q,(function(e){c(e,"onReady callback threw an error:")()}))}();
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.buildEnv = void 0;
7
7
  var buildEnv = {
8
- sdkVersion: "3.1.20",
8
+ sdkVersion: "3.1.22",
9
9
  sdkName: 'df_web_logs_sdk'
10
10
  };
11
11
  exports.buildEnv = buildEnv;
@@ -26,7 +26,7 @@ function startNetworkErrorCollection(configuration, lifeCycle) {
26
26
  }
27
27
  });
28
28
  function handleCompleteRequest(type, request) {
29
- if (!configuration.isIntakeUrl(request.url) && (isRejected(request) || isServerError(request) || configuration.isServerError(request))) {
29
+ if (!(0, _browserCore.isIntakeRequest)(request.url, configuration) && (isRejected(request) || isServerError(request) || configuration.isServerError(request))) {
30
30
  if ('xhr' in request) {
31
31
  computeXhrResponseData(request.xhr, configuration, onResponseDataAvailable);
32
32
  } else if (request.response) {
@@ -1 +1 @@
1
- {"version":3,"file":"networkErrorCollection.js","names":["_browserCore","require","_logger","startNetworkErrorCollection","configuration","lifeCycle","forwardErrorsToLogs","stop","noop","xhrSubscription","initXhrObservable","subscribe","context","state","handleCompleteRequest","RequestType","XHR","fetchSubscription","initFetchObservable","FETCH","type","request","isIntakeUrl","url","isRejected","isServerError","computeXhrResponseData","xhr","onResponseDataAvailable","response","computeFetchResponseText","error","computeFetchErrorText","responseData","urlObj","urlParse","getParse","notify","LifeCycleEventType","RAW_LOG_COLLECTED","rawLogsEvent","message","format","method","date","startClocks","timeStamp","origin","ErrorSource","NETWORK","stack","http","status_code","status","statusGroup","getStatusGroup","urlHost","Host","urlPath","Path","urlPathGroup","replaceNumberCharByPath","StatusType","unsubscribe","callback","truncateResponseText","toStackTraceString","computeStackTrace","clonedResponse","tryToClone","body","window","TextDecoder","text","then","monitor","truncateResponseStream","requestErrorResponseLengthLimit","responseText","responseType","length","substring","stream","bytesLimit","readBytesFromStream","bytes","limitExceeded","decode","undefined","collectStreamBody"],"sources":["../../../../src/domain/logsCollection/networkError/networkErrorCollection.js"],"sourcesContent":["import {\n ErrorSource,\n initXhrObservable,\n RequestType,\n initFetchObservable,\n computeStackTrace,\n toStackTraceString,\n noop,\n each,\n LifeCycleEventType,\n getStatusGroup,\n urlParse,\n replaceNumberCharByPath,\n tryToClone,\n readBytesFromStream,\n monitor\n} from '@cloudcare/browser-core'\nimport { StatusType } from '../../logger'\n\nexport function startNetworkErrorCollection(configuration, lifeCycle) {\n if (!configuration.forwardErrorsToLogs) {\n return { stop: noop }\n }\n\n var xhrSubscription = initXhrObservable().subscribe(function (context) {\n if (context.state === 'complete') {\n handleCompleteRequest(RequestType.XHR, context)\n }\n })\n var fetchSubscription = initFetchObservable().subscribe(function (context) {\n if (context.state === 'resolve') {\n handleCompleteRequest(RequestType.FETCH, context)\n }\n })\n\n function handleCompleteRequest(type, request) {\n if (\n !configuration.isIntakeUrl(request.url) &&\n (isRejected(request) ||\n isServerError(request) ||\n configuration.isServerError(request))\n ) {\n if ('xhr' in request) {\n computeXhrResponseData(\n request.xhr,\n configuration,\n onResponseDataAvailable\n )\n } else if (request.response) {\n computeFetchResponseText(\n request.response,\n configuration,\n onResponseDataAvailable\n )\n } else if (request.error) {\n computeFetchErrorText(\n request.error,\n configuration,\n onResponseDataAvailable\n )\n }\n }\n\n function onResponseDataAvailable(responseData) {\n var urlObj = urlParse(request.url).getParse()\n lifeCycle.notify(LifeCycleEventType.RAW_LOG_COLLECTED, {\n rawLogsEvent: {\n message:\n format(type) + ' error ' + request.method + ' ' + request.url,\n date: request.startClocks.timeStamp,\n error: {\n origin: ErrorSource.NETWORK,\n stack: responseData || 'Failed to load'\n },\n http: {\n method: request.method,\n status_code: request.status,\n url: request.url,\n statusGroup: getStatusGroup(request.status),\n urlHost: urlObj.Host,\n urlPath: urlObj.Path,\n urlPathGroup: replaceNumberCharByPath(urlObj.Path)\n },\n status: StatusType.error,\n origin: ErrorSource.NETWORK\n }\n })\n }\n }\n\n return {\n stop: function () {\n xhrSubscription.unsubscribe()\n fetchSubscription.unsubscribe()\n }\n }\n}\n\nexport function computeXhrResponseData(xhr, configuration, callback) {\n if (typeof xhr.response === 'string') {\n callback(truncateResponseText(xhr.response, configuration))\n } else {\n callback(xhr.response)\n }\n}\n\nexport function computeFetchErrorText(error, configuration, callback) {\n callback(\n truncateResponseText(\n toStackTraceString(computeStackTrace(error)),\n configuration\n )\n )\n}\n\nexport function computeFetchResponseText(response, configuration, callback) {\n var clonedResponse = tryToClone(response)\n if (!clonedResponse || !clonedResponse.body) {\n // if the clone failed or if the body is null, let's not try to read it.\n callback()\n } else if (!window.TextDecoder) {\n // If the browser doesn't support TextDecoder, let's read the whole response then truncate it.\n //\n // This should only be the case on early versions of Edge (before they migrated to Chromium).\n // Even if it could be possible to implement a workaround for the missing TextDecoder API (using\n // a Blob and FileReader), we found another issue preventing us from reading only the first\n // bytes from the response: contrary to other browsers, when reading from the cloned response,\n // if the original response gets canceled, the cloned response is also canceled and we can't\n // know about it. In the following illustration, the promise returned by `reader.read()` may\n // never be fulfilled:\n //\n // fetch('/').then((response) => {\n // const reader = response.clone().body.getReader()\n // readMore()\n // function readMore() {\n // reader.read().then(\n // (result) => {\n // if (result.done) {\n // console.log('done')\n // } else {\n // readMore()\n // }\n // },\n // () => console.log('error')\n // )\n // }\n // response.body.getReader().cancel()\n // })\n clonedResponse.text().then(\n monitor(function (text) {\n return callback(truncateResponseText(text, configuration))\n }),\n monitor(function (error) {\n return callback('Unable to retrieve response: ' + error)\n })\n )\n } else {\n truncateResponseStream(\n clonedResponse.body,\n configuration.requestErrorResponseLengthLimit,\n function (error, responseText) {\n if (error) {\n callback('Unable to retrieve response: ' + error)\n } else {\n callback(responseText)\n }\n }\n )\n }\n}\n\nfunction isRejected(request) {\n return request.status === 0 && request.responseType !== 'opaque'\n}\n\nfunction isServerError(request) {\n return request.status >= 500\n}\n\nfunction truncateResponseText(responseText, configuration) {\n if (responseText.length > configuration.requestErrorResponseLengthLimit) {\n return (\n responseText.substring(0, configuration.requestErrorResponseLengthLimit) +\n '...'\n )\n }\n return responseText\n}\n\nfunction format(type) {\n if (RequestType.XHR === type) {\n return 'XHR'\n }\n return 'Fetch'\n}\n\nfunction truncateResponseStream(stream, bytesLimit, callback) {\n readBytesFromStream(\n stream,\n function (error, bytes, limitExceeded) {\n if (error) {\n callback(error)\n } else {\n var responseText = new TextDecoder().decode(bytes)\n if (limitExceeded) {\n responseText += '...'\n }\n callback(undefined, responseText)\n }\n },\n {\n bytesLimit: bytesLimit,\n collectStreamBody: true\n }\n )\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAiBA,IAAAC,OAAA,GAAAD,OAAA;AAEO,SAASE,2BAA2BA,CAACC,aAAa,EAAEC,SAAS,EAAE;EACpE,IAAI,CAACD,aAAa,CAACE,mBAAmB,EAAE;IACtC,OAAO;MAAEC,IAAI,EAAEC;IAAK,CAAC;EACvB;EAEA,IAAIC,eAAe,GAAG,IAAAC,8BAAiB,EAAC,CAAC,CAACC,SAAS,CAAC,UAAUC,OAAO,EAAE;IACrE,IAAIA,OAAO,CAACC,KAAK,KAAK,UAAU,EAAE;MAChCC,qBAAqB,CAACC,wBAAW,CAACC,GAAG,EAAEJ,OAAO,CAAC;IACjD;EACF,CAAC,CAAC;EACF,IAAIK,iBAAiB,GAAG,IAAAC,gCAAmB,EAAC,CAAC,CAACP,SAAS,CAAC,UAAUC,OAAO,EAAE;IACzE,IAAIA,OAAO,CAACC,KAAK,KAAK,SAAS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EC,YAAY,CAACG,SAAS,CAAC,CAAC,EAAE7E,aAAa,CAACyE,+BAA+B,CAAC,GACxE,KAAK;EAET;EACA,OAAOC,YAAY;AACrB;AAEA,SAASpC,MAAMA,CAACtB,IAAI,EAAE;EACpB,IAAIL,wBAAW,CAACC,GAAG,KAAKI,IAAI,EAAE;IAC5B,OAAO,KAAK;EACd;EACA,OAAO,OAAO;AAChB;AAEA,SAASwD,sBAAsBA,CAACM,MAAM,EAAEC,UAAU,EAAEnB,QAAQ,EAAE;EAC5D,IAAAoB,gCAAmB,EACjBF,MAAM,EACN,UAAUnD,KAAK,EAAEsD,KAAK,EAAEC,aAAa,EAAE;IACrC,IAAIvD,KAAK,EAAE;MACTiC,QAAQ,CAACjC,KAAK,CAAC;IACjB,CAAC,MAAM;MACL,IAAI+C,YAAY,GAAG,IAAIN,WAAW,CAAC,CAAC,CAACe,MAAM,CAACF,KAAK,CAAC;MAClD,IAAIC,aAAa,EAAE;QACjBR,YAAY,IAAI,KAAK;MACvB;MACAd,QAAQ,CAACwB,SAAS,EAAEV,YAAY,CAAC;IACnC;EACF,CAAC,EACD;IACEK,UAAU,EAAEA,UAAU;IACtBM,iBAAiB,EAAE;EACrB,CACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"networkErrorCollection.js","names":["_browserCore","require","_logger","startNetworkErrorCollection","configuration","lifeCycle","forwardErrorsToLogs","stop","noop","xhrSubscription","initXhrObservable","subscribe","context","state","handleCompleteRequest","RequestType","XHR","fetchSubscription","initFetchObservable","FETCH","type","request","isIntakeRequest","url","isRejected","isServerError","computeXhrResponseData","xhr","onResponseDataAvailable","response","computeFetchResponseText","error","computeFetchErrorText","responseData","urlObj","urlParse","getParse","notify","LifeCycleEventType","RAW_LOG_COLLECTED","rawLogsEvent","message","format","method","date","startClocks","timeStamp","origin","ErrorSource","NETWORK","stack","http","status_code","status","statusGroup","getStatusGroup","urlHost","Host","urlPath","Path","urlPathGroup","replaceNumberCharByPath","StatusType","unsubscribe","callback","truncateResponseText","toStackTraceString","computeStackTrace","clonedResponse","tryToClone","body","window","TextDecoder","text","then","monitor","truncateResponseStream","requestErrorResponseLengthLimit","responseText","responseType","length","substring","stream","bytesLimit","readBytesFromStream","bytes","limitExceeded","decode","undefined","collectStreamBody"],"sources":["../../../../src/domain/logsCollection/networkError/networkErrorCollection.js"],"sourcesContent":["import {\n ErrorSource,\n initXhrObservable,\n RequestType,\n initFetchObservable,\n computeStackTrace,\n toStackTraceString,\n noop,\n each,\n LifeCycleEventType,\n getStatusGroup,\n urlParse,\n replaceNumberCharByPath,\n tryToClone,\n readBytesFromStream,\n monitor,\n isIntakeRequest\n} from '@cloudcare/browser-core'\nimport { StatusType } from '../../logger'\n\nexport function startNetworkErrorCollection(configuration, lifeCycle) {\n if (!configuration.forwardErrorsToLogs) {\n return { stop: noop }\n }\n\n var xhrSubscription = initXhrObservable().subscribe(function (context) {\n if (context.state === 'complete') {\n handleCompleteRequest(RequestType.XHR, context)\n }\n })\n var fetchSubscription = initFetchObservable().subscribe(function (context) {\n if (context.state === 'resolve') {\n handleCompleteRequest(RequestType.FETCH, context)\n }\n })\n\n function handleCompleteRequest(type, request) {\n if (\n !isIntakeRequest(request.url, configuration) &&\n (isRejected(request) ||\n isServerError(request) ||\n configuration.isServerError(request))\n ) {\n if ('xhr' in request) {\n computeXhrResponseData(\n request.xhr,\n configuration,\n onResponseDataAvailable\n )\n } else if (request.response) {\n computeFetchResponseText(\n request.response,\n configuration,\n onResponseDataAvailable\n )\n } else if (request.error) {\n computeFetchErrorText(\n request.error,\n configuration,\n onResponseDataAvailable\n )\n }\n }\n\n function onResponseDataAvailable(responseData) {\n var urlObj = urlParse(request.url).getParse()\n lifeCycle.notify(LifeCycleEventType.RAW_LOG_COLLECTED, {\n rawLogsEvent: {\n message:\n format(type) + ' error ' + request.method + ' ' + request.url,\n date: request.startClocks.timeStamp,\n error: {\n origin: ErrorSource.NETWORK,\n stack: responseData || 'Failed to load'\n },\n http: {\n method: request.method,\n status_code: request.status,\n url: request.url,\n statusGroup: getStatusGroup(request.status),\n urlHost: urlObj.Host,\n urlPath: urlObj.Path,\n urlPathGroup: replaceNumberCharByPath(urlObj.Path)\n },\n status: StatusType.error,\n origin: ErrorSource.NETWORK\n }\n })\n }\n }\n\n return {\n stop: function () {\n xhrSubscription.unsubscribe()\n fetchSubscription.unsubscribe()\n }\n }\n}\n\nexport function computeXhrResponseData(xhr, configuration, callback) {\n if (typeof xhr.response === 'string') {\n callback(truncateResponseText(xhr.response, configuration))\n } else {\n callback(xhr.response)\n }\n}\n\nexport function computeFetchErrorText(error, configuration, callback) {\n callback(\n truncateResponseText(\n toStackTraceString(computeStackTrace(error)),\n configuration\n )\n )\n}\n\nexport function computeFetchResponseText(response, configuration, callback) {\n var clonedResponse = tryToClone(response)\n if (!clonedResponse || !clonedResponse.body) {\n // if the clone failed or if the body is null, let's not try to read it.\n callback()\n } else if (!window.TextDecoder) {\n // If the browser doesn't support TextDecoder, let's read the whole response then truncate it.\n //\n // This should only be the case on early versions of Edge (before they migrated to Chromium).\n // Even if it could be possible to implement a workaround for the missing TextDecoder API (using\n // a Blob and FileReader), we found another issue preventing us from reading only the first\n // bytes from the response: contrary to other browsers, when reading from the cloned response,\n // if the original response gets canceled, the cloned response is also canceled and we can't\n // know about it. In the following illustration, the promise returned by `reader.read()` may\n // never be fulfilled:\n //\n // fetch('/').then((response) => {\n // const reader = response.clone().body.getReader()\n // readMore()\n // function readMore() {\n // reader.read().then(\n // (result) => {\n // if (result.done) {\n // console.log('done')\n // } else {\n // readMore()\n // }\n // },\n // () => console.log('error')\n // )\n // }\n // response.body.getReader().cancel()\n // })\n clonedResponse.text().then(\n monitor(function (text) {\n return callback(truncateResponseText(text, configuration))\n }),\n monitor(function (error) {\n return callback('Unable to retrieve response: ' + error)\n })\n )\n } else {\n truncateResponseStream(\n clonedResponse.body,\n configuration.requestErrorResponseLengthLimit,\n function (error, responseText) {\n if (error) {\n callback('Unable to retrieve response: ' + error)\n } else {\n callback(responseText)\n }\n }\n )\n }\n}\n\nfunction isRejected(request) {\n return request.status === 0 && request.responseType !== 'opaque'\n}\n\nfunction isServerError(request) {\n return request.status >= 500\n}\n\nfunction truncateResponseText(responseText, configuration) {\n if (responseText.length > configuration.requestErrorResponseLengthLimit) {\n return (\n responseText.substring(0, configuration.requestErrorResponseLengthLimit) +\n '...'\n )\n }\n return responseText\n}\n\nfunction format(type) {\n if (RequestType.XHR === type) {\n return 'XHR'\n }\n return 'Fetch'\n}\n\nfunction truncateResponseStream(stream, bytesLimit, callback) {\n readBytesFromStream(\n stream,\n function (error, bytes, limitExceeded) {\n if (error) {\n callback(error)\n } else {\n var responseText = new TextDecoder().decode(bytes)\n if (limitExceeded) {\n responseText += '...'\n }\n callback(undefined, responseText)\n }\n },\n {\n bytesLimit: bytesLimit,\n collectStreamBody: true\n }\n )\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAkBA,IAAAC,OAAA,GAAAD,OAAA;AAEO,SAASE,2BAA2BA,CAACC,aAAa,EAAEC,SAAS,EAAE;EACpE,IAAI,CAACD,aAAa,CAACE,mBAAmB,EAAE;IACtC,OAAO;MAAEC,IAAI,EAAEC;IAAK,CAAC;EACvB;EAEA,IAAIC,eAAe,GAAG,IAAAC,8BAAiB,EAAC,CAAC,CAACC,SAAS,CAAC,UAAUC,OAAO,EAAE;IACrE,IAAIA,OAAO,CAACC,KAAK,KAAK,UAAU,EAAE;MAChCC,qBAAqB,CAACC,wBAAW,CAACC,GAAG,EAAEJ,OAAO,CAAC;IACjD;EACF,CAAC,CAAC;EACF,IAAIK,iBAAiB,GAAG,IAAAC,gCAAmB,EAAC,CAAC,CAACP,SAAS,CAAC,UAAUC,OAAO,EAAE;IACzE,IAAIA,OAAO,CAACC,KAAK,KAAK,SAAS,EAAE;MAC/BC,qBAAqB,CAACC,wBAAW,CAACI,KAAK,EAAEP,OAAO,CAAC;IACnD;EACF,CAAC,CAAC;EAEF,SAASE,qBA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C,YAAY;AACrB;AAEA,SAASpC,MAAMA,CAACtB,IAAI,EAAE;EACpB,IAAIL,wBAAW,CAACC,GAAG,KAAKI,IAAI,EAAE;IAC5B,OAAO,KAAK;EACd;EACA,OAAO,OAAO;AAChB;AAEA,SAASwD,sBAAsBA,CAACM,MAAM,EAAEC,UAAU,EAAEnB,QAAQ,EAAE;EAC5D,IAAAoB,gCAAmB,EACjBF,MAAM,EACN,UAAUnD,KAAK,EAAEsD,KAAK,EAAEC,aAAa,EAAE;IACrC,IAAIvD,KAAK,EAAE;MACTiC,QAAQ,CAACjC,KAAK,CAAC;IACjB,CAAC,MAAM;MACL,IAAI+C,YAAY,GAAG,IAAIN,WAAW,CAAC,CAAC,CAACe,MAAM,CAACF,KAAK,CAAC;MAClD,IAAIC,aAAa,EAAE;QACjBR,YAAY,IAAI,KAAK;MACvB;MACAd,QAAQ,CAACwB,SAAS,EAAEV,YAAY,CAAC;IACnC;EACF,CAAC,EACD;IACEK,UAAU,EAAEA,UAAU;IACtBM,iBAAiB,EAAE;EACrB,CACF,CAAC;AACH","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  export var buildEnv = {
2
- sdkVersion: "3.1.20",
2
+ sdkVersion: "3.1.22",
3
3
  sdkName: 'df_web_logs_sdk'
4
4
  };
5
5
  //# sourceMappingURL=buildEnv.js.map
@@ -1,4 +1,4 @@
1
- import { ErrorSource, initXhrObservable, RequestType, initFetchObservable, computeStackTrace, toStackTraceString, noop, each, LifeCycleEventType, getStatusGroup, urlParse, replaceNumberCharByPath, tryToClone, readBytesFromStream, monitor } from '@cloudcare/browser-core';
1
+ import { ErrorSource, initXhrObservable, RequestType, initFetchObservable, computeStackTrace, toStackTraceString, noop, each, LifeCycleEventType, getStatusGroup, urlParse, replaceNumberCharByPath, tryToClone, readBytesFromStream, monitor, isIntakeRequest } from '@cloudcare/browser-core';
2
2
  import { StatusType } from '../../logger';
3
3
  export function startNetworkErrorCollection(configuration, lifeCycle) {
4
4
  if (!configuration.forwardErrorsToLogs) {
@@ -17,7 +17,7 @@ export function startNetworkErrorCollection(configuration, lifeCycle) {
17
17
  }
18
18
  });
19
19
  function handleCompleteRequest(type, request) {
20
- if (!configuration.isIntakeUrl(request.url) && (isRejected(request) || isServerError(request) || configuration.isServerError(request))) {
20
+ if (!isIntakeRequest(request.url, configuration) && (isRejected(request) || isServerError(request) || configuration.isServerError(request))) {
21
21
  if ('xhr' in request) {
22
22
  computeXhrResponseData(request.xhr, configuration, onResponseDataAvailable);
23
23
  } else if (request.response) {
@@ -1 +1 @@
1
- {"version":3,"file":"networkErrorCollection.js","names":["ErrorSource","initXhrObservable","RequestType","initFetchObservable","computeStackTrace","toStackTraceString","noop","each","LifeCycleEventType","getStatusGroup","urlParse","replaceNumberCharByPath","tryToClone","readBytesFromStream","monitor","StatusType","startNetworkErrorCollection","configuration","lifeCycle","forwardErrorsToLogs","stop","xhrSubscription","subscribe","context","state","handleCompleteRequest","XHR","fetchSubscription","FETCH","type","request","isIntakeUrl","url","isRejected","isServerError","computeXhrResponseData","xhr","onResponseDataAvailable","response","computeFetchResponseText","error","computeFetchErrorText","responseData","urlObj","getParse","notify","RAW_LOG_COLLECTED","rawLogsEvent","message","format","method","date","startClocks","timeStamp","origin","NETWORK","stack","http","status_code","status","statusGroup","urlHost","Host","urlPath","Path","urlPathGroup","unsubscribe","callback","truncateResponseText","clonedResponse","body","window","TextDecoder","text","then","truncateResponseStream","requestErrorResponseLengthLimit","responseText","responseType","length","substring","stream","bytesLimit","bytes","limitExceeded","decode","undefined","collectStreamBody"],"sources":["../../../../src/domain/logsCollection/networkError/networkErrorCollection.js"],"sourcesContent":["import {\n ErrorSource,\n initXhrObservable,\n RequestType,\n initFetchObservable,\n computeStackTrace,\n toStackTraceString,\n noop,\n each,\n LifeCycleEventType,\n getStatusGroup,\n urlParse,\n replaceNumberCharByPath,\n tryToClone,\n readBytesFromStream,\n monitor\n} from '@cloudcare/browser-core'\nimport { StatusType } from '../../logger'\n\nexport function startNetworkErrorCollection(configuration, lifeCycle) {\n if (!configuration.forwardErrorsToLogs) {\n return { stop: noop }\n }\n\n var xhrSubscription = initXhrObservable().subscribe(function (context) {\n if (context.state === 'complete') {\n handleCompleteRequest(RequestType.XHR, context)\n }\n })\n var fetchSubscription = initFetchObservable().subscribe(function (context) {\n if (context.state === 'resolve') {\n handleCompleteRequest(RequestType.FETCH, context)\n }\n })\n\n function handleCompleteRequest(type, request) {\n if (\n !configuration.isIntakeUrl(request.url) &&\n (isRejected(request) ||\n isServerError(request) ||\n configuration.isServerError(request))\n ) {\n if ('xhr' in request) {\n computeXhrResponseData(\n request.xhr,\n configuration,\n onResponseDataAvailable\n )\n } else if (request.response) {\n computeFetchResponseText(\n request.response,\n configuration,\n onResponseDataAvailable\n )\n } else if (request.error) {\n computeFetchErrorText(\n request.error,\n configuration,\n onResponseDataAvailable\n )\n }\n }\n\n function onResponseDataAvailable(responseData) {\n var urlObj = urlParse(request.url).getParse()\n lifeCycle.notify(LifeCycleEventType.RAW_LOG_COLLECTED, {\n rawLogsEvent: {\n message:\n format(type) + ' error ' + request.method + ' ' + request.url,\n date: request.startClocks.timeStamp,\n error: {\n origin: ErrorSource.NETWORK,\n stack: responseData || 'Failed to load'\n },\n http: {\n method: request.method,\n status_code: request.status,\n url: request.url,\n statusGroup: getStatusGroup(request.status),\n urlHost: urlObj.Host,\n urlPath: urlObj.Path,\n urlPathGroup: replaceNumberCharByPath(urlObj.Path)\n },\n status: StatusType.error,\n origin: ErrorSource.NETWORK\n }\n })\n }\n }\n\n return {\n stop: function () {\n xhrSubscription.unsubscribe()\n fetchSubscription.unsubscribe()\n }\n }\n}\n\nexport function computeXhrResponseData(xhr, configuration, callback) {\n if (typeof xhr.response === 'string') {\n callback(truncateResponseText(xhr.response, configuration))\n } else {\n callback(xhr.response)\n }\n}\n\nexport function computeFetchErrorText(error, configuration, callback) {\n callback(\n truncateResponseText(\n toStackTraceString(computeStackTrace(error)),\n configuration\n )\n )\n}\n\nexport function computeFetchResponseText(response, configuration, callback) {\n var clonedResponse = tryToClone(response)\n if (!clonedResponse || !clonedResponse.body) {\n // if the clone failed or if the body is null, let's not try to read it.\n callback()\n } else if (!window.TextDecoder) {\n // If the browser doesn't support TextDecoder, let's read the whole response then truncate it.\n //\n // This should only be the case on early versions of Edge (before they migrated to Chromium).\n // Even if it could be possible to implement a workaround for the missing TextDecoder API (using\n // a Blob and FileReader), we found another issue preventing us from reading only the first\n // bytes from the response: contrary to other browsers, when reading from the cloned response,\n // if the original response gets canceled, the cloned response is also canceled and we can't\n // know about it. In the following illustration, the promise returned by `reader.read()` may\n // never be fulfilled:\n //\n // fetch('/').then((response) => {\n // const reader = response.clone().body.getReader()\n // readMore()\n // function readMore() {\n // reader.read().then(\n // (result) => {\n // if (result.done) {\n // console.log('done')\n // } else {\n // readMore()\n // }\n // },\n // () => console.log('error')\n // )\n // }\n // response.body.getReader().cancel()\n // })\n clonedResponse.text().then(\n monitor(function (text) {\n return callback(truncateResponseText(text, configuration))\n }),\n monitor(function (error) {\n return callback('Unable to retrieve response: ' + error)\n })\n )\n } else {\n truncateResponseStream(\n clonedResponse.body,\n configuration.requestErrorResponseLengthLimit,\n function (error, responseText) {\n if (error) {\n callback('Unable to retrieve response: ' + error)\n } else {\n callback(responseText)\n }\n }\n )\n }\n}\n\nfunction isRejected(request) {\n return request.status === 0 && request.responseType !== 'opaque'\n}\n\nfunction isServerError(request) {\n return request.status >= 500\n}\n\nfunction truncateResponseText(responseText, configuration) {\n if (responseText.length > configuration.requestErrorResponseLengthLimit) {\n return (\n responseText.substring(0, configuration.requestErrorResponseLengthLimit) +\n '...'\n )\n }\n return responseText\n}\n\nfunction format(type) {\n if (RequestType.XHR === type) {\n return 'XHR'\n }\n return 'Fetch'\n}\n\nfunction truncateResponseStream(stream, bytesLimit, callback) {\n readBytesFromStream(\n stream,\n function (error, bytes, limitExceeded) {\n if (error) {\n callback(error)\n } else {\n var responseText = new TextDecoder().decode(bytes)\n if (limitExceeded) {\n responseText += '...'\n }\n callback(undefined, responseText)\n }\n },\n {\n bytesLimit: bytesLimit,\n collectStreamBody: true\n }\n )\n}\n"],"mappings":"AAAA,SACEA,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,mBAAmB,EACnBC,iBAAiB,EACjBC,kBAAkB,EAClBC,IAAI,EACJC,IAAI,EACJC,kBAAkB,EAClBC,cAAc,EACdC,QAAQ,EACRC,uBAAuB,EACvBC,UAAU,EACVC,mBAAmB,EACnBC,OAAO,QACF,yBAAyB;AAChC,SAASC,UAAU,QAAQ,cAAc;AAEzC,OAAO,SAASC,2BAA2BA,CAACC,aAAa,EAAEC,SAAS,EAAE;EACpE,IAAI,CAACD,aAAa,CAACE,mBAAmB,EAAE;IACtC,OAAO;MAAEC,IAAI,EAAEd;IAAK,CAAC;EACvB;EAEA,IAAIe,eAAe,GAAGpB,iBAAiB,CAAC,CAAC,CAACqB,SAAS,CAAC,UAAUC,OAAO,EAAE;IACrE,IAAIA,OAAO,CAACC,KAAK,KAAK,UAAU,EAAE;MAChCC,qBAAqB,CAACvB,WAAW,CAACwB,GAAG,EAAEH,OAAO,CAAC;IACjD;EACF,CAAC,CAAC;EACF,IAAII,iBAAiB,GAAGxB,mBAAmB,CAAC,CAAC,CAACmB,SAAS,CAAC,UAAUC,OAAO,EAAE;IACzE,IAAIA,OAAO,CAACC,KAAK,KAAK,SAAS,EAAE;MAC/BC,qBAAqB,CAACvB,WAAW,CAAC0B,KAAK,EAAEL,OAAO,CAAC;IACnD;EACF,CAAC,CAAC;EAEF,SAASE,qBAAqBA,CAACI,IAAI,EAAEC,OAAO,EAAE;IAC5C,IACE,CAACb,aAAa,CAACc,WAAW,CAACD,OAAO,CAACE,GAAG,CAAC,KACtCC,UAAU,CAACH,OAAO,CAAC,IAClBI,aAAa,CAACJ,OAAO,CAAC,IACtBb,aAAa,CAACiB,aAAa,CAACJ,OAAO,CAAC,CAAC,EACvC;MACA,IAAI,KAAK,IAAIA,OAAO,EAAE;QACpBK,sBAAs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rC,IAAI5C,KAAK,EAAE;MACT2B,QAAQ,CAAC3B,KAAK,CAAC;IACjB,CAAC,MAAM;MACL,IAAIqC,YAAY,GAAG,IAAIL,WAAW,CAAC,CAAC,CAACa,MAAM,CAACF,KAAK,CAAC;MAClD,IAAIC,aAAa,EAAE;QACjBP,YAAY,IAAI,KAAK;MACvB;MACAV,QAAQ,CAACmB,SAAS,EAAET,YAAY,CAAC;IACnC;EACF,CAAC,EACD;IACEK,UAAU,EAAEA,UAAU;IACtBK,iBAAiB,EAAE;EACrB,CACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"networkErrorCollection.js","names":["ErrorSource","initXhrObservable","RequestType","initFetchObservable","computeStackTrace","toStackTraceString","noop","each","LifeCycleEventType","getStatusGroup","urlParse","replaceNumberCharByPath","tryToClone","readBytesFromStream","monitor","isIntakeRequest","StatusType","startNetworkErrorCollection","configuration","lifeCycle","forwardErrorsToLogs","stop","xhrSubscription","subscribe","context","state","handleCompleteRequest","XHR","fetchSubscription","FETCH","type","request","url","isRejected","isServerError","computeXhrResponseData","xhr","onResponseDataAvailable","response","computeFetchResponseText","error","computeFetchErrorText","responseData","urlObj","getParse","notify","RAW_LOG_COLLECTED","rawLogsEvent","message","format","method","date","startClocks","timeStamp","origin","NETWORK","stack","http","status_code","status","statusGroup","urlHost","Host","urlPath","Path","urlPathGroup","unsubscribe","callback","truncateResponseText","clonedResponse","body","window","TextDecoder","text","then","truncateResponseStream","requestErrorResponseLengthLimit","responseText","responseType","length","substring","stream","bytesLimit","bytes","limitExceeded","decode","undefined","collectStreamBody"],"sources":["../../../../src/domain/logsCollection/networkError/networkErrorCollection.js"],"sourcesContent":["import {\n ErrorSource,\n initXhrObservable,\n RequestType,\n initFetchObservable,\n computeStackTrace,\n toStackTraceString,\n noop,\n each,\n LifeCycleEventType,\n getStatusGroup,\n urlParse,\n replaceNumberCharByPath,\n tryToClone,\n readBytesFromStream,\n monitor,\n isIntakeRequest\n} from '@cloudcare/browser-core'\nimport { StatusType } from '../../logger'\n\nexport function startNetworkErrorCollection(configuration, lifeCycle) {\n if (!configuration.forwardErrorsToLogs) {\n return { stop: noop }\n }\n\n var xhrSubscription = initXhrObservable().subscribe(function (context) {\n if (context.state === 'complete') {\n handleCompleteRequest(RequestType.XHR, context)\n }\n })\n var fetchSubscription = initFetchObservable().subscribe(function (context) {\n if (context.state === 'resolve') {\n handleCompleteRequest(RequestType.FETCH, context)\n }\n })\n\n function handleCompleteRequest(type, request) {\n if (\n !isIntakeRequest(request.url, configuration) &&\n (isRejected(request) ||\n isServerError(request) ||\n configuration.isServerError(request))\n ) {\n if ('xhr' in request) {\n computeXhrResponseData(\n request.xhr,\n configuration,\n onResponseDataAvailable\n )\n } else if (request.response) {\n computeFetchResponseText(\n request.response,\n configuration,\n onResponseDataAvailable\n )\n } else if (request.error) {\n computeFetchErrorText(\n request.error,\n configuration,\n onResponseDataAvailable\n )\n }\n }\n\n function onResponseDataAvailable(responseData) {\n var urlObj = urlParse(request.url).getParse()\n lifeCycle.notify(LifeCycleEventType.RAW_LOG_COLLECTED, {\n rawLogsEvent: {\n message:\n format(type) + ' error ' + request.method + ' ' + request.url,\n date: request.startClocks.timeStamp,\n error: {\n origin: ErrorSource.NETWORK,\n stack: responseData || 'Failed to load'\n },\n http: {\n method: request.method,\n status_code: request.status,\n url: request.url,\n statusGroup: getStatusGroup(request.status),\n urlHost: urlObj.Host,\n urlPath: urlObj.Path,\n urlPathGroup: replaceNumberCharByPath(urlObj.Path)\n },\n status: StatusType.error,\n origin: ErrorSource.NETWORK\n }\n })\n }\n }\n\n return {\n stop: function () {\n xhrSubscription.unsubscribe()\n fetchSubscription.unsubscribe()\n }\n }\n}\n\nexport function computeXhrResponseData(xhr, configuration, callback) {\n if (typeof xhr.response === 'string') {\n callback(truncateResponseText(xhr.response, configuration))\n } else {\n callback(xhr.response)\n }\n}\n\nexport function computeFetchErrorText(error, configuration, callback) {\n callback(\n truncateResponseText(\n toStackTraceString(computeStackTrace(error)),\n configuration\n )\n )\n}\n\nexport function computeFetchResponseText(response, configuration, callback) {\n var clonedResponse = tryToClone(response)\n if (!clonedResponse || !clonedResponse.body) {\n // if the clone failed or if the body is null, let's not try to read it.\n callback()\n } else if (!window.TextDecoder) {\n // If the browser doesn't support TextDecoder, let's read the whole response then truncate it.\n //\n // This should only be the case on early versions of Edge (before they migrated to Chromium).\n // Even if it could be possible to implement a workaround for the missing TextDecoder API (using\n // a Blob and FileReader), we found another issue preventing us from reading only the first\n // bytes from the response: contrary to other browsers, when reading from the cloned response,\n // if the original response gets canceled, the cloned response is also canceled and we can't\n // know about it. In the following illustration, the promise returned by `reader.read()` may\n // never be fulfilled:\n //\n // fetch('/').then((response) => {\n // const reader = response.clone().body.getReader()\n // readMore()\n // function readMore() {\n // reader.read().then(\n // (result) => {\n // if (result.done) {\n // console.log('done')\n // } else {\n // readMore()\n // }\n // },\n // () => console.log('error')\n // )\n // }\n // response.body.getReader().cancel()\n // })\n clonedResponse.text().then(\n monitor(function (text) {\n return callback(truncateResponseText(text, configuration))\n }),\n monitor(function (error) {\n return callback('Unable to retrieve response: ' + error)\n })\n )\n } else {\n truncateResponseStream(\n clonedResponse.body,\n configuration.requestErrorResponseLengthLimit,\n function (error, responseText) {\n if (error) {\n callback('Unable to retrieve response: ' + error)\n } else {\n callback(responseText)\n }\n }\n )\n }\n}\n\nfunction isRejected(request) {\n return request.status === 0 && request.responseType !== 'opaque'\n}\n\nfunction isServerError(request) {\n return request.status >= 500\n}\n\nfunction truncateResponseText(responseText, configuration) {\n if (responseText.length > configuration.requestErrorResponseLengthLimit) {\n return (\n responseText.substring(0, configuration.requestErrorResponseLengthLimit) +\n '...'\n )\n }\n return responseText\n}\n\nfunction format(type) {\n if (RequestType.XHR === type) {\n return 'XHR'\n }\n return 'Fetch'\n}\n\nfunction truncateResponseStream(stream, bytesLimit, callback) {\n readBytesFromStream(\n stream,\n function (error, bytes, limitExceeded) {\n if (error) {\n callback(error)\n } else {\n var responseText = new TextDecoder().decode(bytes)\n if (limitExceeded) {\n responseText += '...'\n }\n callback(undefined, responseText)\n }\n },\n {\n bytesLimit: bytesLimit,\n collectStreamBody: true\n }\n )\n}\n"],"mappings":"AAAA,SACEA,WAAW,EACXC,iBAAiB,EACjBC,WAAW,EACXC,mBAAmB,EACnBC,iBAAiB,EACjBC,kBAAkB,EAClBC,IAAI,EACJC,IAAI,EACJC,kBAAkB,EAClBC,cAAc,EACdC,QAAQ,EACRC,uBAAuB,EACvBC,UAAU,EACVC,mBAAmB,EACnBC,OAAO,EACPC,eAAe,QACV,yBAAyB;AAChC,SAASC,UAAU,QAAQ,cAAc;AAEzC,OAAO,SAASC,2BAA2BA,CAACC,aAAa,EAAEC,SAAS,EAAE;EACpE,IAAI,CAACD,aAAa,CAACE,mBAAmB,EAAE;IACtC,OAAO;MAAEC,IAAI,EAAEf;IAAK,CAAC;EACvB;EAEA,IAAIgB,eAAe,GAAGrB,iBAAiB,CAAC,CAAC,CAACsB,SAAS,CAAC,UAAUC,OAAO,EAAE;IACrE,IAAIA,OAAO,CAACC,KAAK,KAAK,UAAU,EAAE;MAChCC,qBAAqB,CAACxB,WAAW,CAACyB,GAAG,EAAEH,OAAO,CAAC;IACjD;EACF,CAAC,CAAC;EACF,IAAII,iBAAiB,GAAGzB,mBAAmB,CAAC,CAAC,CAACoB,SAAS,CAAC,UAAUC,OAAO,EAAE;IACzE,IAAIA,OAAO,CAACC,KAAK,KAAK,SAAS,EAAE;MAC/BC,qBAAqB,CAACxB,WAAW,CAAC2B,KAAK,EAAEL,OAAO,CAAC;IACnD;EACF,CAAC,CAAC;EAEF,SAASE,qBAAqBA,CAACI,IAAI,EAAEC,OAAO,EAAE;IAC5C,IACE,CAAChB,eAAe,CAACgB,OAAO,CAACC,GAAG,EAAEd,aAAa,CAAC,KAC3Ce,UAAU,CAACF,OAAO,CAAC,IAClBG,aAAa,CAACH,OAAO,CAAC,IACtBb,aAAa,CAACgB,aAAa,CAACH,OAAO,CAAC,CAAC,EACvC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,EACN,UAAUzC,KAAK,EAAE2C,KAAK,EAAEC,aAAa,EAAE;IACrC,IAAI5C,KAAK,EAAE;MACT2B,QAAQ,CAAC3B,KAAK,CAAC;IACjB,CAAC,MAAM;MACL,IAAIqC,YAAY,GAAG,IAAIL,WAAW,CAAC,CAAC,CAACa,MAAM,CAACF,KAAK,CAAC;MAClD,IAAIC,aAAa,EAAE;QACjBP,YAAY,IAAI,KAAK;MACvB;MACAV,QAAQ,CAACmB,SAAS,EAAET,YAAY,CAAC;IACnC;EACF,CAAC,EACD;IACEK,UAAU,EAAEA,UAAU;IACtBK,iBAAiB,EAAE;EACrB,CACF,CAAC;AACH","ignoreList":[]}
package/package.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@cloudcare/browser-logs",
3
3
  "main": "cjs/index.js",
4
4
  "module": "esm/index.js",
5
- "version": "3.1.20",
5
+ "version": "3.1.22",
6
6
  "dependencies": {
7
- "@cloudcare/browser-core": "3.1.20"
7
+ "@cloudcare/browser-core": "3.1.22"
8
8
  },
9
9
  "scripts": {
10
10
  "dev": "webpack serve --open --mode=development",
@@ -30,5 +30,5 @@
30
30
  "author": "dataflux",
31
31
  "license": "MIT",
32
32
  "description": "DataFlux RUM Web 端数据指标监控",
33
- "gitHead": "21b4f565b460261472ddcae1d04f7fc71dd842b6"
33
+ "gitHead": "03ada1b95363260a44bdcef7ccfacd3509064877"
34
34
  }
@@ -13,7 +13,8 @@ import {
13
13
  replaceNumberCharByPath,
14
14
  tryToClone,
15
15
  readBytesFromStream,
16
- monitor
16
+ monitor,
17
+ isIntakeRequest
17
18
  } from '@cloudcare/browser-core'
18
19
  import { StatusType } from '../../logger'
19
20
 
@@ -35,7 +36,7 @@ export function startNetworkErrorCollection(configuration, lifeCycle) {
35
36
 
36
37
  function handleCompleteRequest(type, request) {
37
38
  if (
38
- !configuration.isIntakeUrl(request.url) &&
39
+ !isIntakeRequest(request.url, configuration) &&
39
40
  (isRejected(request) ||
40
41
  isServerError(request) ||
41
42
  configuration.isServerError(request))