highlight.run
Advanced tools
Comparing version 8.3.1 to 8.3.2
# highlight.run | ||
## 8.3.2 | ||
### Patch Changes | ||
- a07cdf584: correctly record stack trace for async promise rejections | ||
- 4493988b0: support sending structured attributes in browser console logs | ||
## 8.3.1 | ||
@@ -4,0 +11,0 @@ |
import StackTrace from 'stacktrace-js'; | ||
export type ConsoleMessage = { | ||
value?: Array<any> | string; | ||
value?: Array<string>; | ||
attributes?: object; | ||
time: number; | ||
@@ -5,0 +6,0 @@ type: string; |
@@ -1,2 +0,2 @@ | ||
declare const _default: "8.3.1"; | ||
declare const _default: "8.3.2"; | ||
export default _default; |
@@ -368,3 +368,8 @@ var __defProp = Object.defineProperty; | ||
var _a2, _b2, _c, _d; | ||
const o2 = m.parse(r2); | ||
let o2 = []; | ||
try { | ||
o2 = m.parse(r2 != null ? r2 : t2); | ||
} catch (e3) { | ||
o2 = m.parse(new Error()); | ||
} | ||
t2 instanceof Error && (t2 = t2.message); | ||
@@ -379,23 +384,27 @@ const i2 = S(o2); | ||
const t2 = window.onerror = (t3, n3, r3, o2, i2) => { | ||
v(e2, t3, n3, i2 != null ? i2 : Error()); | ||
v(e2, t3, n3, i2); | ||
}, n2 = window.onunhandledrejection = (t3) => { | ||
var _a2; | ||
if (t3.reason) { | ||
const n3 = t3.promise; | ||
n3.getStack ? v(e2, t3.reason, t3.type, (_a2 = n3.getStack()) != null ? _a2 : Error()) : v(e2, t3.reason, t3.type, Error()); | ||
n3.getStack ? v(e2, t3.reason, t3.type, n3.getStack()) : v(e2, t3.reason, t3.type); | ||
} | ||
}, r2 = window.Promise.constructor; | ||
return window.Promise.constructor = function(e3) { | ||
this.promiseCreationError = new Error(), r2(e3); | ||
}, window.Promise.prototype.getStack = function() { | ||
return this.promiseCreationError; | ||
}, r2 = window.Promise; | ||
return window.Promise = class extends r2 { | ||
constructor(e3) { | ||
super(e3); | ||
__publicField(this, "promiseCreationError"); | ||
this.promiseCreationError = new Error(); | ||
} | ||
getStack() { | ||
return this.promiseCreationError; | ||
} | ||
}, () => { | ||
window.Promise.constructor = r2, window.onunhandledrejection = n2, window.onerror = t2; | ||
window.Promise = r2, window.onunhandledrejection = n2, window.onerror = t2; | ||
}; | ||
}, S = (e2) => { | ||
var _a2; | ||
var _a2, _b2; | ||
if (0 === e2.length) | ||
return e2; | ||
const t2 = e2[0]; | ||
return "console.error" === t2.functionName && ((_a2 = t2.fileName) == null ? void 0 : _a2.includes("highlight.run")) || "new HighlightPromise" === t2.functionName ? e2.slice(1) : e2; | ||
return ((_a2 = t2.fileName) == null ? void 0 : _a2.includes("highlight.run")) || ((_b2 = t2.fileName) == null ? void 0 : _b2.includes("highlight.io")) || "new HighlightPromise" === t2.functionName ? e2.slice(1) : e2; | ||
}, E = ["assert", "count", "countReset", "debug", "dir", "dirxml", "error", "group", "groupCollapsed", "groupEnd", "info", "log", "table", "time", "timeEnd", "timeLog", "trace", "warn"]; | ||
@@ -752,3 +761,3 @@ var N, C, _, O; | ||
} | ||
const Z = "8.3.1"; | ||
const Z = "8.3.2"; | ||
let ee = new class { | ||
@@ -825,5 +834,6 @@ constructor() { | ||
else { | ||
const t2 = setInterval(() => { | ||
"HighlightIO" in window && (e2(), clearInterval(t2)); | ||
}, 100); | ||
const t2 = () => { | ||
"HighlightIO" in window ? e2() : setTimeout(t2, 200); | ||
}; | ||
t2(); | ||
} | ||
@@ -943,12 +953,18 @@ }), !((_b2 = (_a2 = o2 == null ? void 0 : o2.integrations) == null ? void 0 : _a2.mixpanel) == null ? void 0 : _b2.disabled) && ((_d = (_c = o2 == null ? void 0 : o2.integrations) == null ? void 0 : _c.mixpanel) == null ? void 0 : _d.projectToken) && (({ projectToken: e2 }) => { | ||
}), onHighlightReady: (e2, t2) => __async(void 0, null, function* () { | ||
try { | ||
ce && (false === (t2 == null ? void 0 : t2.waitForReady) || ce.ready) ? yield e2() : (de.push({ options: t2, func: e2 }), void 0 === se && (se = setInterval(() => __async(void 0, null, function* () { | ||
if (de.push({ options: t2, func: e2 }), void 0 === se) { | ||
const e3 = () => __async(void 0, null, function* () { | ||
var _a2; | ||
const e3 = []; | ||
for (const t3 of de) | ||
ce && (false === ((_a2 = t3.options) == null ? void 0 : _a2.waitForReady) || ce.ready) ? yield t3.func() : e3.push(t3); | ||
de = e3, 0 == de.length && (clearInterval(se), se = void 0); | ||
}), 100))); | ||
} catch (e3) { | ||
ie("onHighlightReady", e3); | ||
const t3 = []; | ||
for (const e4 of de) | ||
if (ce && (false === ((_a2 = e4.options) == null ? void 0 : _a2.waitForReady) || ce.ready)) | ||
try { | ||
yield e4.func(); | ||
} catch (e5) { | ||
ie("onHighlightReady", e5); | ||
} | ||
else | ||
t3.push(e4); | ||
se = void 0, de = t3, de.length > 0 && (se = setTimeout(e3, 200)); | ||
}); | ||
yield e3(); | ||
} | ||
@@ -955,0 +971,0 @@ }) }; |
@@ -1,1 +0,1 @@ | ||
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__objRest=(e,t)=>{var n={};for(var o in e)__hasOwnProp.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&__getOwnPropSymbols)for(var o of __getOwnPropSymbols(e))t.indexOf(o)<0&&__propIsEnum.call(e,o)&&(n[o]=e[o]);return n},__publicField=(e,t,n)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,n),n),__async=(e,t,n)=>new Promise(((o,r)=>{var i=e=>{try{l(n.next(e))}catch(t){r(t)}},s=e=>{try{l(n.throw(e))}catch(t){r(t)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);l((n=n.apply(e,t)).next())}));!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).H={})}(this,(function(e){"use strict";var t,n;const o=({apiKey:e})=>{!function(t,n){var o=t.amplitude||{_q:[],_iq:{}},r=n.createElement("script");r.type="text/javascript",r.integrity="sha384-+EO59vL/X7v6VE2s6/F4HxfHlK0nDUVWKVg8K9oUlvffAeeaShVBmbORTC2D3UF+",r.crossOrigin="anonymous",r.async=!0,r.src="https://cdn.amplitude.com/libs/amplitude-8.17.0-min.gz.js",r.onload=function(){t.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK"),amplitude.getInstance().init(e)};var i=n.getElementsByTagName("script")[0];function s(e,t){e.prototype[t]=function(){return this._q.push([t].concat(Array.prototype.slice.call(arguments,0))),this}}i.parentNode.insertBefore(r,i);for(var l=function(){return this._q=[],this},a=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove"],c=0;c<a.length;c++)s(l,a[c]);o.Identify=l;for(var d=function(){return this._q=[],this},u=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"],p=0;p<u.length;p++)s(d,u[p]);o.Revenue=d;var h=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","enableTracking","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","groupIdentify","onInit","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"];function g(e){function t(t){e[t]=function(){e._q.push([t].concat(Array.prototype.slice.call(arguments,0)))}}for(var n=0;n<h.length;n++)t(h[n])}g(o),o.getInstance=function(e){return e=(e&&0!==e.length?e:"$default_instance").toLowerCase(),Object.prototype.hasOwnProperty.call(o._iq,e)||(o._iq[e]={_q:[]},g(o._iq[e])),o._iq[e]},t.amplitude=o}(window,document)};var r,i;(i=r||(r={})).RECORDING_START_TIME="highlightRecordingStartTime",i.SEGMENT_LAST_SENT_HASH_KEY="HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY",i.SESSION_DATA="sessionData",i.SESSION_SECURE_ID="sessionSecureID",i.USER_IDENTIFIER="highlightIdentifier",i.USER_OBJECT="highlightUserObject",i.PAYLOAD_ID="payloadId";function s(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();let o=e.parentElement,r=[];if(o.children&&o.children.length>0)for(let e=0;e<o.children.length;e++){let t=o.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&r.push(t)}r.length>1&&(n+=":eq("+r.indexOf(e)+")"),t=n+(t?">"+t:""),e=o}return t}function l(e){return"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){if(0===t)return!0;const n=Object.keys(e);for(const o of n)if(l(e[o])&&a(e[o],t-1))return!0;return!1}function c(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const o=[],r=[];return JSON.stringify(e,(function(e,t){if(o.length>0){const n=o.indexOf(this);~n?o.splice(n+1):o.push(this),~n?r.splice(n,1/0,e):r.push(e),~o.indexOf(t)&&(t=o[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,o.indexOf(t)).join(".")+"]")}else o.push(t);if(null==t)return t;if(l(i=t)&&Object.keys(i).length>n.numOfKeysLimit||"function"==typeof i||(i instanceof Event&&!1===i.isTrusted?1===Object.keys(i).length:l(i)&&a(i,n.depthOfLimit)))return function(e){let t=e.toString();return n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`),t}(t);var i;if(t instanceof Event){const e={};for(const n in t){const o=t[n];Array.isArray(o)?e[n]=s(o.length?o[0]:null):e[n]=o}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.name+": "+t.message:t}))}function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var u,p,h,g,f,w={exports:{}},m={exports:{}};w.exports=(u||(u=1,m.exports=function(){function e(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var n=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],r=["fileName","functionName","source"],i=n.concat(o,r,["args"],["evalOrigin"]);function s(t){if(t)for(var n=0;n<i.length;n++)void 0!==t[i[n]]&&this["set"+e(i[n])](t[i[n]])}s.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof s)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new s(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",o=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:o?o+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},s.fromString=function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),o=e.substring(0,t),r=e.substring(t+1,n).split(","),i=e.substring(n+1);if(0===i.indexOf("@"))var l=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i,""),a=l[1],c=l[2],d=l[3];return new s({functionName:o,args:r||void 0,fileName:a,lineNumber:c||void 0,columnNumber:d||void 0})};for(var l=0;l<n.length;l++)s.prototype["get"+e(n[l])]=t(n[l]),s.prototype["set"+e(n[l])]=function(e){return function(t){this[e]=Boolean(t)}}(n[l]);for(var a=0;a<o.length;a++)s.prototype["get"+e(o[a])]=t(o[a]),s.prototype["set"+e(o[a])]=function(e){return function(t){if(n=t,isNaN(parseFloat(n))||!isFinite(n))throw new TypeError(e+" must be a Number");var n;this[e]=Number(t)}}(o[a]);for(var c=0;c<r.length;c++)s.prototype["get"+e(r[c])]=t(r[c]),s.prototype["set"+e(r[c])]=function(e){return function(t){this[e]=String(t)}}(r[c]);return s}()),p=m.exports,h=/(^|@)\S+:\d+/,g=/^\s*at .*(\S+:\d+|\(native\))/m,f=/^(eval@)?(\[native code])?$/,{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(g))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(g)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),o=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:o.pop()),i=o.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new p({functionName:i,fileName:s,lineNumber:r[1],columnNumber:r[2],source:e})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(f)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new p({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),o=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new p({functionName:o,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),o=[],r=2,i=n.length;r<i;r+=2){var s=t.exec(n[r]);s&&o.push(new p({fileName:s[2],lineNumber:s[1],source:n[r]}))}return o},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),o=[],r=0,i=n.length;r<i;r+=2){var s=t.exec(n[r]);s&&o.push(new p({functionName:s[3]||void 0,fileName:s[2],lineNumber:s[1],source:n[r]}))}return o},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(h)&&!e.match(/^Error created at/)}),this).map((function(e){var t,n=e.split("@"),o=this.extractLocation(n.pop()),r=n.shift()||"",i=r.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;r.match(/\(([^)]*)\)/)&&(t=r.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===t||"[arguments not available]"===t?void 0:t.split(",");return new p({functionName:i,args:s,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e})}),this)}});const v=d(w.exports);var b={exports:{}};!function(e,t){function n(e,t){var n=[],o=[];return null==t&&(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]"}),function(r,i){if(n.length>0){var s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?o.splice(s,1/0,r):o.push(r),~n.indexOf(i)&&(i=t.call(this,r,i))}else n.push(i);return null==e?i:e.call(this,r,i)}}(e.exports=function(e,t,o,r){return JSON.stringify(e,n(t,r),o)}).getSerialize=n}(b);const y=d(b.exports);function _(e,t,n,o){var r,i,s,l;const a=v.parse(o);t instanceof Error&&(t=t.message);const c=R(a);e({event:y(t),type:"window.onerror",url:window.location.href,source:null!=n?n:"",lineNumber:(null==(r=c[0])?void 0:r.lineNumber)?null==(i=c[0])?void 0:i.lineNumber:0,columnNumber:(null==(s=c[0])?void 0:s.columnNumber)?null==(l=c[0])?void 0:l.columnNumber:0,stackTrace:c,timestamp:(new Date).toISOString()})}const k=e=>{if("undefined"==typeof window)return()=>{};const t=window.onerror=(t,n,o,r,i)=>{_(e,t,n,null!=i?i:Error())},n=window.onunhandledrejection=t=>{var n;if(t.reason){const o=t.promise;o.getStack?_(e,t.reason,t.type,null!=(n=o.getStack())?n:Error()):_(e,t.reason,t.type,Error())}},o=window.Promise.constructor;return window.Promise.constructor=function(e){this.promiseCreationError=new Error,o(e)},window.Promise.prototype.getStack=function(){return this.promiseCreationError},()=>{window.Promise.constructor=o,window.onunhandledrejection=n,window.onerror=t}},R=e=>{var t;if(0===e.length)return e;const n=e[0];return"console.error"===n.functionName&&(null==(t=n.fileName)?void 0:t.includes("highlight.run"))||"new HighlightPromise"===n.functionName?e.slice(1):e},S=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"];var E,O,N,C;(O=E||(E={})).DeviceMemory="DeviceMemory",O.ViewportHeight="ViewportHeight",O.ViewportWidth="ViewportWidth",O.ViewportArea="ViewportArea",(C=N||(N={})).Device="Device",C.WebVital="WebVital",C.Frontend="Frontend",C.Backend="Backend";const T=['["\\"Script error.\\""]','"Script error."','["\\"Load failed.\\""]','"Load failed."','["\\"Network request failed.\\""]','"Network request failed."','["\\"Document is not focused.\\""]','"Document is not focused."','["\\"Failed to fetch\\""]','"Failed to fetch"','[{"isTrusted":true}]','{"isTrusted":true}','["{}"]','"{}"','[""]','""','["\\"\\""]','""'],L=["websocket error",'\\"ResizeObserver loop'],x=(e,t,n)=>{const o=I(t,e.headers,n);return __spreadProps(__spreadValues({},e),{headers:o})},I=(e,t,n)=>{var o,r;const i=__spreadValues({},t);return n?(null==(o=Object.keys(i))||o.forEach((e=>{[...n].includes(null==e?void 0:e.toLowerCase())||(i[e]="[REDACTED]")})),i):(null==(r=Object.keys(i))||r.forEach((t=>{[...P,...e].includes(null==t?void 0:t.toLowerCase())&&(i[t]="[REDACTED]")})),i)},P=["authorization","cookie","proxy-authorization","token"],H=["https://www.googleapis.com/identitytoolkit","https://securetoken.googleapis.com"],j="X-Highlight-Request",D=e=>{let t=e;return e.startsWith("https://")||e.startsWith("http://")||(t=`${window.location.origin}${t}`),t.replace(/\/+$/,"")},F=(e,t,n,o)=>{e.sort(((e,t)=>e.responseEnd-t.responseEnd));const r=e.reduce(((e,t)=>{const o=D(t.name);return t.initiatorType===n?e[n][o]=[...e[n][o]||[],t]:e.others[o]=[...e.others[o]||[],t],e}),{xmlhttprequest:{},others:{},fetch:{}});let i={};i=t.reduce(((e,t)=>{const n=D(t.request.url);return e[n]=[...e[n]||[],t],e}),i);for(let l in r[n]){const e=r[n][l],t=i[l];if(!t)continue;const o=Math.max(e.length-t.length,0);for(let n=o;n<e.length;n++)e[n]&&(e[n].requestResponsePair=t[n-o])}let s=[];for(let l in r)for(let e in r[l])s=s.concat(r[l][e]);return s.sort(((e,t)=>e.fetchStart-t.fetchStart)).reduce(((e,t)=>{let n=t.requestResponsePair;return n&&(n=((e,{headersToRedact:t,headersToRecord:n,requestResponseSanitizer:o})=>{let r=e;if(o){try{r=o(r)}catch(c){}if(!r)return null}const i=r,{request:s,response:l}=i,a=__objRest(i,["request","response"]);return __spreadValues({request:x(s,t,n),response:x(l,t,n)},a)})(t.requestResponsePair,o),!n)||(t.toJSON=function(){return{initiatorType:this.initiatorType,startTime:this.startTime,responseEnd:this.responseEnd,startTimeAbs:window.performance.timeOrigin+this.startTime,responseEndAbs:window.performance.timeOrigin+this.responseEnd,name:this.name,transferSize:this.transferSize,encodedBodySize:this.encodedBodySize,requestResponsePairs:n}},e.push(t)),e}),[])},q=(e,t,n)=>{return r=t,!((o=e).toLocaleLowerCase().includes("https://pub.highlight.run")||o.toLocaleLowerCase().includes("highlight.run")||o.toLocaleLowerCase().includes(r))||B(e,n);var o,r},B=(e,t)=>{var n;let o=[];!0===t?(o=["localhost",/^\//],(null==(n=null==window?void 0:window.location)?void 0:n.host)&&o.push(window.location.host)):t instanceof Array&&(o=t);let r=!1;return o.forEach((t=>{e.match(t)&&(r=!0)})),r},A=()=>function(e){for(var t="",n=0;n<10;n++)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}(),U=(e,t)=>e+"/"+t,W=(e,t,n,o,r,i,s)=>{const l=XMLHttpRequest.prototype,a=l.open,c=l.send,d=l.setRequestHeader;return l.open=function(e,t){return this._method=e,this._url=t,this._requestHeaders={},this._shouldRecordHeaderAndBody=!o.some((e=>t.toLowerCase().includes(e))),a.apply(this,arguments)},l.setRequestHeader=function(e,t){return this._requestHeaders[e]=t,d.apply(this,arguments)},l.send=function(o){if(!q(this._url,t,n))return c.apply(this,arguments);const l=A();B(this._url,n)&&this.setRequestHeader(j,U(r,l));const a=this._shouldRecordHeaderAndBody,d={id:l,url:this._url,verb:this._method,headers:a?this._requestHeaders:{},body:void 0};if(a&&o){const e=K(o,d.url);e&&(d.body=M(e,i,s,d.headers))}return this.addEventListener("load",(function(){return __async(this,null,(function*(){const t={status:this.status,headers:{},body:void 0};if(a){const e=this.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};if(e.forEach((function(e){const t=e.split(": "),n=t.shift();r[n]=t.join(": ")})),t.headers=r,o){const e=K(o,d.url);e&&(d.body=M(e,i,s,t.headers))}if(""===this.responseType||"text"===this.responseType)t.body=M(this.responseText,i,s,t.headers),t.size=8*this.responseText.length;else if("blob"===this.responseType){if(this.response instanceof Blob)try{const e=yield this.response.text();t.body=M(e,i,s,t.headers),t.size=this.response.size}catch(n){}}else try{t.body=M(this.response,i,s,t.headers)}catch(n){}}e({request:d,response:t,urlBlocked:!a})}))})),this.addEventListener("error",(function(){return __async(this,null,(function*(){const t={status:this.status,headers:void 0,body:void 0};e({request:d,response:t,urlBlocked:!1})}))})),c.apply(this,arguments)},()=>{l.open=a,l.send=c,l.setRequestHeader=d}},K=(e,t)=>{if("string"==typeof e){if(!(null==t?void 0:t.includes("localhost"))&&!(null==t?void 0:t.includes("highlight.run"))||!e.includes("pushPayload"))return e}else if("object"==typeof e||"number"==typeof e||"boolean"==typeof e)return e.toString();return null},V={"application/json":67108864,"text/plain":67108864},M=(e,t,n,o)=>{var r,i,s;let l=65536;if(o){let e="";e="function"==typeof o.get?null!=(r=o.get("content-type"))?r:"":null!=(i=o["content-type"])?i:"";try{e=e.split(";")[0]}catch(a){}l=null!=(s=V[e])?s:65536}if(e){if(t)try{const n=JSON.parse(e);Object.keys(n).forEach((e=>{t.includes(e.toLocaleLowerCase())&&(n[e]="[REDACTED]")})),e=JSON.stringify(n)}catch(c){}if(n)try{const t=JSON.parse(e);Object.keys(t).forEach((e=>{n.includes(e.toLocaleLowerCase())||(t[e]="[REDACTED]")})),e=JSON.stringify(t)}catch(c){}}try{e=e.slice(0,l)}catch(c){}return e},z=(e,t,n,o,r,i,s)=>{const l=window._fetchProxy;return window._fetchProxy=function(a,c){const{method:d,url:u}=$(a,c);if(!q(u,t,n))return l.call(this,a,c);const p=A();if(B(u,n)){c=c||{};let e=new Headers(c.headers);a instanceof Request&&[...a.headers].forEach((([t,n])=>e.set(t,n))),e.set(j,U(r,p)),c.headers=Object.fromEntries(e.entries())}const h={id:p,headers:{},body:void 0,url:u,verb:d},g=!o.some((e=>u.toLowerCase().includes(e)));g&&(h.headers=Object.fromEntries(new Headers(null==c?void 0:c.headers).entries()),h.body=M(null==c?void 0:c.body,i,s,null==c?void 0:c.headers));let f=l.call(this,a,c);return J(f,h,e,g,i,s),f},()=>{window._fetchProxy=l}},$=(e,t)=>{const n=t&&t.method||"object"==typeof e&&"method"in e&&e.method||"GET";let o;return o="object"==typeof e?"url"in e&&e.url?e.url:e.toString():e,{method:n,url:o}},J=(e,t,n,o,r,i)=>{e.then((e=>__async(this,null,(function*(){let s={body:void 0,headers:void 0,status:0,size:0},l=!1;if("stack"in e||e instanceof Error)s=__spreadProps(__spreadValues({},s),{body:e.message,status:0,size:void 0}),l=!0;else if("status"in e){if(s=__spreadProps(__spreadValues({},s),{status:e.status}),o){let t;try{const n=e.clone().body;if(n){let o,s=n.getReader(),l=new TextDecoder,a="";for(;!(o=yield s.read()).done;){let e=o.value;a+=l.decode(e)}t=a,t=M(t,r,i,e.headers)}else t=""}catch(a){t=`Unable to clone response: ${a}`}s.body=t,s.headers=Object.fromEntries(e.headers.entries()),s.size=8*t.length}l=!0}l&&n({request:t,response:s,urlBlocked:!o})})))).catch((()=>{}))};class G{constructor(e){var t;__publicField(this,"disableConsoleRecording"),__publicField(this,"reportConsoleErrors"),__publicField(this,"consoleMethodsToRecord"),__publicField(this,"listeners"),__publicField(this,"errors"),__publicField(this,"messages"),__publicField(this,"options"),__publicField(this,"hasNetworkRecording",!0),__publicField(this,"_backendUrl"),__publicField(this,"disableNetworkRecording"),__publicField(this,"enableRecordingNetworkContents"),__publicField(this,"xhrNetworkContents"),__publicField(this,"fetchNetworkContents"),__publicField(this,"disableRecordingWebSocketContents"),__publicField(this,"webSocketNetworkContents"),__publicField(this,"webSocketEventContents"),__publicField(this,"tracingOrigins"),__publicField(this,"networkHeadersToRedact"),__publicField(this,"networkBodyKeysToRedact"),__publicField(this,"networkBodyKeysToRecord"),__publicField(this,"networkHeaderKeysToRecord"),__publicField(this,"urlBlocklist"),__publicField(this,"requestResponseSanitizer"),this.options=e,this.disableConsoleRecording=!!e.disableConsoleRecording,this.reportConsoleErrors=null!=(t=e.reportConsoleErrors)&&t,this.consoleMethodsToRecord=e.consoleMethodsToRecord||[...S],this.listeners=[],this.errors=[],this.messages=[]}isListening(){return this.listeners.length>0}startListening(){if(this.isListening())return;const e=this;this.disableConsoleRecording||this.listeners.push(function(e,t){const n=t.logger;if(!n)return()=>{};let o;o="string"==typeof n?window[n]:n;const r=[];if(t.level.includes("error")&&window){const n=n=>{const{message:o,error:r}=n;let i=[];r&&(i=v.parse(r));const s=[c(o,t.stringifyOptions)];e({type:"Error",trace:i,time:Date.now(),value:s})};window.addEventListener("error",n),r.push((()=>{window&&window.removeEventListener("error",n)}))}for(const s of t.level)r.push(i(o,s));return()=>{r.forEach((e=>e()))};function i(n,o){return n[o]?function(e,t,n){try{if(!(t in e))return()=>{};const o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,()=>{e[t]=o}}catch(o){return()=>{}}}(n,o,(n=>(...r)=>{n.apply(this,r);try{const n=v.parse(new Error),i=r.map((e=>c(e,t.stringifyOptions)));e({type:o,trace:n.slice(1),value:i,time:Date.now()})}catch(i){n("highlight logger error:",i,...r)}})):()=>{}}}((t=>{var n,o,r;if(this.reportConsoleErrors&&("Error"===t.type||"error"===t.type)&&t.value&&t.trace){const i=y(t.value);if(T.includes(i)||L.some((e=>i.includes(e))))return;e.errors.push({event:i,type:"console.error",url:window.location.href,source:(null==(n=t.trace[0])?void 0:n.fileName)?t.trace[0].fileName:"",lineNumber:(null==(o=t.trace[0])?void 0:o.lineNumber)?t.trace[0].lineNumber:0,columnNumber:(null==(r=t.trace[0])?void 0:r.columnNumber)?t.trace[0].columnNumber:0,stackTrace:t.trace,timestamp:(new Date).toISOString()})}e.messages.push(t)}),{level:this.consoleMethodsToRecord,logger:"console",stringifyOptions:{depthOfLimit:10,numOfKeysLimit:100,stringLengthLimit:1e3}})),this.listeners.push(k((t=>{T.includes(t.event)||L.some((e=>t.event.includes(e)))||e.errors.push(t)}))),G.setupNetworkListener(this,this.options)}stopListening(){this.listeners.forEach((e=>e())),this.listeners=[]}static setupNetworkListener(e,t){var n,o,r,i,s,l,a,c,d,u,p,h;e._backendUrl=(null==t?void 0:t.backendUrl)||"https://pub.highlight.run",e.xhrNetworkContents=[],e.fetchNetworkContents=[],e.webSocketNetworkContents=[],e.webSocketEventContents=[],e.networkHeadersToRedact=[],e.urlBlocklist=[],e.tracingOrigins=t.tracingOrigins||[],void 0!==(null==t?void 0:t.disableNetworkRecording)?(e.disableNetworkRecording=null==t?void 0:t.disableNetworkRecording,e.enableRecordingNetworkContents=!1,e.disableRecordingWebSocketContents=!0,e.networkHeadersToRedact=[],e.networkBodyKeysToRedact=[],e.urlBlocklist=[],e.networkBodyKeysToRecord=[],e.networkBodyKeysToRecord=[]):"boolean"==typeof(null==t?void 0:t.networkRecording)?(e.disableNetworkRecording=!t.networkRecording,e.enableRecordingNetworkContents=!1,e.disableRecordingWebSocketContents=!0,e.networkHeadersToRedact=[],e.networkBodyKeysToRedact=[],e.urlBlocklist=[]):(void 0!==(null==(n=t.networkRecording)?void 0:n.enabled)?e.disableNetworkRecording=!t.networkRecording.enabled:e.disableNetworkRecording=!1,e.enableRecordingNetworkContents=(null==(o=t.networkRecording)?void 0:o.recordHeadersAndBody)||!1,e.disableRecordingWebSocketContents=(null==(r=t.networkRecording)?void 0:r.disableWebSocketEventRecordings)||!1,e.networkHeadersToRedact=(null==(s=null==(i=t.networkRecording)?void 0:i.networkHeadersToRedact)?void 0:s.map((e=>e.toLowerCase())))||[],e.networkBodyKeysToRedact=(null==(a=null==(l=t.networkRecording)?void 0:l.networkBodyKeysToRedact)?void 0:a.map((e=>e.toLowerCase())))||[],e.urlBlocklist=(null==(d=null==(c=t.networkRecording)?void 0:c.urlBlocklist)?void 0:d.map((e=>e.toLowerCase())))||[],e.urlBlocklist=[...e.urlBlocklist,...H],e.requestResponseSanitizer=null==(u=t.networkRecording)?void 0:u.requestResponseSanitizer,e.networkHeaderKeysToRecord=null==(p=t.networkRecording)?void 0:p.headerKeysToRecord,e.networkHeaderKeysToRecord&&(e.networkHeadersToRedact=[],e.networkHeaderKeysToRecord=e.networkHeaderKeysToRecord.map((e=>e.toLocaleLowerCase()))),e.networkBodyKeysToRecord=null==(h=t.networkRecording)?void 0:h.bodyKeysToRecord,e.networkBodyKeysToRecord&&(e.networkBodyKeysToRedact=[],e.networkBodyKeysToRecord=e.networkBodyKeysToRecord.map((e=>e.toLocaleLowerCase())))),!e.disableNetworkRecording&&e.enableRecordingNetworkContents&&e.listeners.push((({xhrCallback:e,fetchCallback:t,webSocketRequestCallback:n,webSocketEventCallback:o,disableWebSocketRecording:r,bodyKeysToRedact:i,backendUrl:s,tracingOrigins:l,urlBlocklist:a,sessionSecureID:c,bodyKeysToRecord:d})=>{const u=W(e,s,l,a,c,i,d),p=z(t,s,l,a,c,i,d),h=r?()=>{}:((e,t,n)=>{const o=window._highlightWebSocketRequestCallback;window._highlightWebSocketRequestCallback=e;const r=window._highlightWebSocketEventCallback;return window._highlightWebSocketEventCallback=e=>{const o=e,{message:r,size:i}=o,s=__objRest(o,["message","size"]),l=n.some((t=>e.name.toLowerCase().includes(t)));t(l?s:e)},()=>{window._highlightWebSocketRequestCallback=o,window._highlightWebSocketEventCallback=r}})(n,o,a);return()=>{u(),p(),h()}})({xhrCallback:t=>{e.xhrNetworkContents.push(t)},fetchCallback:t=>{e.fetchNetworkContents.push(t)},webSocketRequestCallback:t=>{e.webSocketNetworkContents&&e.webSocketNetworkContents.push(t)},webSocketEventCallback:t=>{e.webSocketEventContents.push(t)},disableWebSocketRecording:e.disableRecordingWebSocketContents,bodyKeysToRedact:e.networkBodyKeysToRedact,backendUrl:e._backendUrl,tracingOrigins:e.tracingOrigins,urlBlocklist:e.urlBlocklist,sessionSecureID:t.sessionSecureID,bodyKeysToRecord:e.networkBodyKeysToRecord}))}static getRecordedNetworkResources(e,t){var n;let o=[],r=[];if(!e.disableNetworkRecording){const r=(null==(n=null==window?void 0:window.performance)?void 0:n.timeOrigin)||0;o=performance.getEntriesByType("resource");const i=2*(t-r);if(o=o.filter((t=>q(t.name,e._backendUrl,e.tracingOrigins))).map((e=>__spreadProps(__spreadValues({},e.toJSON()),{offsetStartTime:e.startTime-i,offsetResponseEnd:e.responseEnd-i,offsetFetchStart:e.fetchStart-i}))),e.enableRecordingNetworkContents){const t={headersToRedact:e.networkHeadersToRedact,headersToRecord:e.networkHeaderKeysToRecord,requestResponseSanitizer:e.requestResponseSanitizer};o=F(o,e.xhrNetworkContents,"xmlhttprequest",t),o=F(o,e.fetchNetworkContents,"fetch",t)}}return e.disableRecordingWebSocketContents||(r=e.webSocketNetworkContents||[]),[...o,...r]}static getRecordedWebSocketEvents(e){let t=[];return e.disableNetworkRecording||e.disableRecordingWebSocketContents||(t=e.webSocketEventContents),t}static clearRecordedNetworkResources(e){e.disableNetworkRecording||(e.xhrNetworkContents=[],e.fetchNetworkContents=[],e.webSocketNetworkContents=[],e.webSocketEventContents=[],performance.clearResourceTimings())}}const X="8.3.1";let Y=new class{constructor(){__publicField(this,"storage",{})}getItem(e){var t;return null!=(t=this.storage[e])?t:""}setItem(e,t){this.storage[e]=t}removeItem(e){delete this.storage[e]}};const Q=()=>{try{return window.localStorage}catch(e){return Y}},Z=()=>null;e.MetricCategory=void 0,function(e){e.Device="Device",e.WebVital="WebVital",e.Frontend="Frontend",e.Backend="Backend"}(e.MetricCategory||(e.MetricCategory={}));const ee=(e,t)=>{console.warn(`highlight.run warning: (${e}): `,t)};let te,ne,oe,re,ie=[],se=!1;const le={options:void 0,init:(e,t)=>{var n,i,s,l,a,c,d,u,p,h;try{if(le.options=t,"undefined"==typeof window||"undefined"==typeof document)return;if(!e)return void console.info("Highlight is not initializing because projectID was passed undefined.");let f=(()=>{let e=JSON.parse((t=r.SESSION_DATA,Q().getItem(t)||"{}"));var t;if(e&&e.lastPushTime&&Date.now()-e.lastPushTime<55e3)return e})(),w=(()=>{var e;var t="";const n="undefined"!=typeof window&&(null==(e=window.crypto)?void 0:e.getRandomValues),o=new Uint32Array(28);n&&window.crypto.getRandomValues(o);for(let r=0;r<28;r++)t+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(n?o[r]%62:Math.floor(62*Math.random()));return t})();if(null==f?void 0:f.sessionSecureID)w=f.sessionSecureID;else{const t=__spreadProps(__spreadValues({},f),{projectID:+e,sessionSecureID:w});p=r.SESSION_DATA,h=JSON.stringify(t),Q().setItem(p,h)}if(se)return{sessionSecureID:w};se=!0,ne=document.createElement("script");var g=(null==t?void 0:t.scriptUrl)?t.scriptUrl:`https://static.highlight.io/v${X}/index.js`;ne.setAttribute("src",g),ne.setAttribute("type","text/javascript"),document.getElementsByTagName("head")[0].appendChild(ne);const m={organizationID:e,debug:null==t?void 0:t.debug,backendUrl:null==t?void 0:t.backendUrl,tracingOrigins:null==t?void 0:t.tracingOrigins,disableNetworkRecording:null==t?void 0:t.disableNetworkRecording,networkRecording:null==t?void 0:t.networkRecording,disableBackgroundRecording:null==t?void 0:t.disableBackgroundRecording,disableConsoleRecording:null==t?void 0:t.disableConsoleRecording,disableSessionRecording:null==t?void 0:t.disableSessionRecording,reportConsoleErrors:null==t?void 0:t.reportConsoleErrors,consoleMethodsToRecord:null==t?void 0:t.consoleMethodsToRecord,enableSegmentIntegration:null==t?void 0:t.enableSegmentIntegration,privacySetting:null==t?void 0:t.privacySetting,enableCanvasRecording:null==t?void 0:t.enableCanvasRecording,enablePerformanceRecording:null==t?void 0:t.enablePerformanceRecording,samplingStrategy:null==t?void 0:t.samplingStrategy,inlineImages:null==t?void 0:t.inlineImages,inlineStylesheet:null==t?void 0:t.inlineStylesheet,recordCrossOriginIframe:null==t?void 0:t.recordCrossOriginIframe,firstloadVersion:X,environment:(null==t?void 0:t.environment)||"production",appVersion:null==t?void 0:t.version,serviceName:null==t?void 0:t.serviceName,sessionShortcut:null==t?void 0:t.sessionShortcut,sessionSecureID:w,storageMode:null==t?void 0:t.storageMode,sendMode:null==t?void 0:t.sendMode};return re=new G(m),(null==t?void 0:t.manualStart)||re.startListening(),ne.addEventListener("load",(()=>{const e=()=>{oe=new window.HighlightIO(m,re),(null==t?void 0:t.manualStart)||oe.initialize()};if("HighlightIO"in window)e();else{const t=setInterval((()=>{"HighlightIO"in window&&(e(),clearInterval(t))}),100)}})),!(null==(i=null==(n=null==t?void 0:t.integrations)?void 0:n.mixpanel)?void 0:i.disabled)&&(null==(l=null==(s=null==t?void 0:t.integrations)?void 0:s.mixpanel)?void 0:l.projectToken)&&(({projectToken:e})=>{if(window.mixpanel)return;var t,n,o;document,(t=window.mixpanel||[]).__SV||(window.mixpanel=t,t._i=[],t.init=function(e,r,i){function s(e,t){var n=t.split(".");2==n.length&&(e=e[n[0]],t=n[1]),e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}}var l=t;for(void 0!==i?l=t[i]=[]:i="mixpanel",l.people=l.people||[],l.toString=function(e){var t="mixpanel";return"mixpanel"!==i&&(t+="."+i),e||(t+=" (stub)"),t},l.people.toString=function(){return l.toString(1)+".people (stub)"},n="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" "),o=0;o<n.length;o++)s(l,n[o]);var a="set set_once union unset remove delete".split(" ");l.get_group=function(){function e(e){t[e]=function(){call2_args=arguments,call2=[e].concat(Array.prototype.slice.call(call2_args,0)),l.push([n,call2])}}for(var t={},n=["get_group"].concat(Array.prototype.slice.call(arguments,0)),o=0;o<a.length;o++)e(a[o]);return t},t._i.push([e,r,i])},t.__SV=1.2);const r=document.createElement("script");r.src="https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js",document.head.appendChild(r),r.addEventListener("load",(()=>{var t;null==(t=window.mixpanel)||t.init(e)}))})(t.integrations.mixpanel),!(null==(c=null==(a=null==t?void 0:t.integrations)?void 0:a.amplitude)?void 0:c.disabled)&&(null==(u=null==(d=null==t?void 0:t.integrations)?void 0:d.amplitude)?void 0:u.apiKey)&&o(t.integrations.amplitude),{sessionSecureID:w}}catch(f){ee("init",f)}},snapshot:e=>__async(this,null,(function*(){try{if(oe&&oe.ready)return yield oe.snapshot(e)}catch(t){ee("snapshot",t)}})),addSessionFeedback:({verbatim:e,userName:t,userEmail:n,timestampOverride:o})=>{try{le.onHighlightReady((()=>oe.addSessionFeedback({verbatim:e,timestamp:o||(new Date).toISOString(),user_email:n,user_name:t})))}catch(r){ee("error",r)}},consumeError:(e,t,n)=>{try{le.onHighlightReady((()=>oe.consumeCustomError(e,t,JSON.stringify(n))))}catch(o){ee("error",o)}},error:(e,t)=>{try{le.onHighlightReady((()=>oe.pushCustomError(e,JSON.stringify(t))))}catch(n){ee("error",n)}},track:(e,t={})=>{var n,o,r,i,s,l,a,c,d,u,p;try{le.onHighlightReady((()=>oe.addProperties(__spreadProps(__spreadValues({},t),{event:e}))));const h=null==oe?void 0:oe.getCurrentSessionURL();(null==(r=null==(o=null==(n=le.options)?void 0:n.integrations)?void 0:o.mixpanel)?void 0:r.disabled)||(null==(i=window.mixpanel)?void 0:i.track)&&window.mixpanel.track(e,__spreadProps(__spreadValues({},t),{highlightSessionURL:h})),(null==(a=null==(l=null==(s=le.options)?void 0:s.integrations)?void 0:l.amplitude)?void 0:a.disabled)||(null==(c=window.amplitude)?void 0:c.getInstance)&&window.amplitude.getInstance().logEvent(e,__spreadProps(__spreadValues({},t),{highlightSessionURL:h})),(null==(p=null==(u=null==(d=le.options)?void 0:d.integrations)?void 0:u.intercom)?void 0:p.disabled)||window.Intercom&&window.Intercom("trackEvent",e,t)}catch(h){ee("track",h)}},start:e=>{"Recording"===(null==oe?void 0:oe.state)?(null==e?void 0:e.silent)||console.warn("Highlight is already recording. Please `H.stop()` the current session before starting a new one."):(re.startListening(),le.onHighlightReady((()=>__async(this,null,(function*(){yield oe.initialize(e)}))),{waitForReady:!1}))},stop:e=>{"Recording"!==(null==oe?void 0:oe.state)?(null==e?void 0:e.silent)||console.warn("Highlight is already stopped. Please call `H.start()`."):le.onHighlightReady((()=>oe.stopRecording(!0)))},identify:(e,t={})=>{var n,o,r,i,s,l,a,c;try{le.onHighlightReady((()=>oe.identify(e,t)))}catch(d){ee("identify",d)}if((null==(r=null==(o=null==(n=le.options)?void 0:n.integrations)?void 0:o.mixpanel)?void 0:r.disabled)||(null==(i=window.mixpanel)?void 0:i.identify)&&(window.mixpanel.identify("string"==typeof(null==t?void 0:t.email)?null==t?void 0:t.email:e),t&&(window.mixpanel.track("identify",t),window.mixpanel.people.set(t))),!(null==(a=null==(l=null==(s=le.options)?void 0:s.integrations)?void 0:l.amplitude)?void 0:a.disabled)&&(null==(c=window.amplitude)?void 0:c.getInstance)&&(window.amplitude.getInstance().setUserId(e),Object.keys(t).length>0)){const e=Object.keys(t).reduce(((e,n)=>(e.set(n,t[n]),e)),new window.amplitude.Identify);window.amplitude.getInstance().identify(e)}},metrics:t=>{try{le.onHighlightReady((()=>oe.recordMetric(t.map((t=>__spreadProps(__spreadValues({},t),{category:e.MetricCategory.Frontend}))))))}catch(n){ee("metrics",n)}},getSessionURL:()=>new Promise(((e,t)=>{le.onHighlightReady((()=>{const n=oe.getCurrentSessionURL();n?e(n):t(new Error("Unable to get session URL"))}))})),getSessionDetails:()=>new Promise(((e,t)=>{le.onHighlightReady((()=>{const n=oe.getCurrentSessionURL();if(n){const t=oe.getCurrentSessionTimestamp(),o=(new Date).getTime(),r=new URL(n),i=new URL(n);i.searchParams.set("ts",((o-t)/1e3).toString()),e({url:r.toString(),urlWithTimestamp:i.toString()})}else t(new Error("Could not get session URL"))}))})),onHighlightReady:(e,t)=>__async(this,null,(function*(){try{oe&&(!1===(null==t?void 0:t.waitForReady)||oe.ready)?yield e():(ie.push({options:t,func:e}),void 0===te&&(te=setInterval((()=>__async(this,null,(function*(){var e;const t=[];for(const n of ie)oe&&(!1===(null==(e=n.options)?void 0:e.waitForReady)||oe.ready)?yield n.func():t.push(n);ie=t,0==ie.length&&(clearInterval(te),te=void 0)}))),100)))}catch(n){ee("onHighlightReady",n)}}))};"undefined"!=typeof window&&(window.H=le),"undefined"!=typeof chrome&&(null==(t=null==chrome?void 0:chrome.runtime)?void 0:t.onMessage)&&(null==(n=null==chrome?void 0:chrome.runtime)||n.onMessage.addListener(((e,t,n)=>{const o=e.action;switch(console.log(`[highlight] received '${o}' event from extension.`),o){case"init":{const e="http://localhost:8080/dist/index.js";console.log("url",e),le.init(1,{debug:!0,scriptUrl:e}),le.getSessionURL().then((e=>{n({url:e})}));break}case"stop":le.stop(),n({success:!0})}return!0}))),(()=>{if("undefined"!=typeof window){if(void 0!==window._highlightFetchPatch)return;window._originalFetch=window.fetch,window._fetchProxy=(e,t)=>window._originalFetch(e,t),window._highlightFetchPatch=(e,t)=>window._fetchProxy.call(window||global,e,t),window.fetch=window._highlightFetchPatch}})(),(()=>{if("undefined"!=typeof window){if(void 0!==window._highlightWebSocketRequestCallback)return;window._highlightWebSocketRequestCallback=Z,window._highlightWebSocketEventCallback=Z;const e=new Proxy(window.WebSocket,{construct(e,t){const n=A(),o=new e(...t),r=e=>{window._highlightWebSocketRequestCallback({socketId:n,initiatorType:"websocket",type:"open",name:o.url,startTime:e.timeStamp})},i=e=>{window._highlightWebSocketRequestCallback({socketId:n,initiatorType:"websocket",type:"close",name:o.url,requestEnd:e.timeStamp}),o.removeEventListener("open",r),o.removeEventListener("error",l),o.removeEventListener("message",s),o.removeEventListener("close",i)},s=e=>{const{data:t}=e,r="string"==typeof t?e.data:void 0;let i;i="string"==typeof t?t.length:t instanceof Blob?t.size:t.byteLength||0,window._highlightWebSocketEventCallback({socketId:n,type:"received",name:o.url,timeStamp:e.timeStamp,size:i,message:r})},l=e=>{window._highlightWebSocketEventCallback({socketId:n,type:"error",name:o.url,timeStamp:e.timeStamp,size:0})};o.addEventListener("open",r),o.addEventListener("error",l),o.addEventListener("message",s),o.addEventListener("close",i);const a=new Proxy(o.send,{apply:function(e,t,r){const i=r[0],s="string"==typeof i?i:void 0;let l;l="string"==typeof i?i.length:i instanceof Blob?i.size:i.byteLength||0,window._highlightWebSocketEventCallback({socketId:n,type:"sent",name:o.url,timeStamp:performance.now(),size:l,message:s}),e.apply(t,r)}});return o.send=a,o}});window.WebSocket=e}})(),e.H=le,e.HighlightSegmentMiddleware=({next:e,payload:t})=>{if("undefined"!=typeof window&&"undefined"!=typeof document&&"H"in window)if("track"===t.obj.type){const e=t.obj.event,n=t.obj.properties;window.H.track(e,n)}else if("identify"===t.obj.type){const e=t.obj.userId;if(null==e?void 0:e.length){const n=t.obj.traits;window.H.identify(e,n)}}e(t)},e.configureElectronHighlight=function(e){var t;e.on&&(null==(t=e.webContents)?void 0:t.send)&&(e.on("focus",(()=>{e.webContents.send("highlight.run",{visible:!0})})),e.on("blur",(()=>{e.webContents.send("highlight.run",{visible:!1})})),e.on("close",(()=>{e.webContents.send("highlight.run",{visible:!1})})))},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})); | ||
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__objRest=(e,t)=>{var n={};for(var o in e)__hasOwnProp.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&__getOwnPropSymbols)for(var o of __getOwnPropSymbols(e))t.indexOf(o)<0&&__propIsEnum.call(e,o)&&(n[o]=e[o]);return n},__publicField=(e,t,n)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,n),n),__async=(e,t,n)=>new Promise(((o,r)=>{var i=e=>{try{l(n.next(e))}catch(t){r(t)}},s=e=>{try{l(n.throw(e))}catch(t){r(t)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);l((n=n.apply(e,t)).next())}));!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).H={})}(this,(function(e){"use strict";var t,n;const o=({apiKey:e})=>{!function(t,n){var o=t.amplitude||{_q:[],_iq:{}},r=n.createElement("script");r.type="text/javascript",r.integrity="sha384-+EO59vL/X7v6VE2s6/F4HxfHlK0nDUVWKVg8K9oUlvffAeeaShVBmbORTC2D3UF+",r.crossOrigin="anonymous",r.async=!0,r.src="https://cdn.amplitude.com/libs/amplitude-8.17.0-min.gz.js",r.onload=function(){t.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK"),amplitude.getInstance().init(e)};var i=n.getElementsByTagName("script")[0];function s(e,t){e.prototype[t]=function(){return this._q.push([t].concat(Array.prototype.slice.call(arguments,0))),this}}i.parentNode.insertBefore(r,i);for(var l=function(){return this._q=[],this},a=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove"],c=0;c<a.length;c++)s(l,a[c]);o.Identify=l;for(var d=function(){return this._q=[],this},u=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"],p=0;p<u.length;p++)s(d,u[p]);o.Revenue=d;var h=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","enableTracking","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","groupIdentify","onInit","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"];function g(e){function t(t){e[t]=function(){e._q.push([t].concat(Array.prototype.slice.call(arguments,0)))}}for(var n=0;n<h.length;n++)t(h[n])}g(o),o.getInstance=function(e){return e=(e&&0!==e.length?e:"$default_instance").toLowerCase(),Object.prototype.hasOwnProperty.call(o._iq,e)||(o._iq[e]={_q:[]},g(o._iq[e])),o._iq[e]},t.amplitude=o}(window,document)};var r,i;(i=r||(r={})).RECORDING_START_TIME="highlightRecordingStartTime",i.SEGMENT_LAST_SENT_HASH_KEY="HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY",i.SESSION_DATA="sessionData",i.SESSION_SECURE_ID="sessionSecureID",i.USER_IDENTIFIER="highlightIdentifier",i.USER_OBJECT="highlightUserObject",i.PAYLOAD_ID="payloadId";function s(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();let o=e.parentElement,r=[];if(o.children&&o.children.length>0)for(let e=0;e<o.children.length;e++){let t=o.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&r.push(t)}r.length>1&&(n+=":eq("+r.indexOf(e)+")"),t=n+(t?">"+t:""),e=o}return t}function l(e){return"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){if(0===t)return!0;const n=Object.keys(e);for(const o of n)if(l(e[o])&&a(e[o],t-1))return!0;return!1}function c(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const o=[],r=[];return JSON.stringify(e,(function(e,t){if(o.length>0){const n=o.indexOf(this);~n?o.splice(n+1):o.push(this),~n?r.splice(n,1/0,e):r.push(e),~o.indexOf(t)&&(t=o[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,o.indexOf(t)).join(".")+"]")}else o.push(t);if(null==t)return t;if(l(i=t)&&Object.keys(i).length>n.numOfKeysLimit||"function"==typeof i||(i instanceof Event&&!1===i.isTrusted?1===Object.keys(i).length:l(i)&&a(i,n.depthOfLimit)))return function(e){let t=e.toString();return n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`),t}(t);var i;if(t instanceof Event){const e={};for(const n in t){const o=t[n];Array.isArray(o)?e[n]=s(o.length?o[0]:null):e[n]=o}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.name+": "+t.message:t}))}function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var u,p,h,g,f,w={exports:{}},m={exports:{}};w.exports=(u||(u=1,m.exports=function(){function e(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var n=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],r=["fileName","functionName","source"],i=n.concat(o,r,["args"],["evalOrigin"]);function s(t){if(t)for(var n=0;n<i.length;n++)void 0!==t[i[n]]&&this["set"+e(i[n])](t[i[n]])}s.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof s)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new s(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",o=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:o?o+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},s.fromString=function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),o=e.substring(0,t),r=e.substring(t+1,n).split(","),i=e.substring(n+1);if(0===i.indexOf("@"))var l=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i,""),a=l[1],c=l[2],d=l[3];return new s({functionName:o,args:r||void 0,fileName:a,lineNumber:c||void 0,columnNumber:d||void 0})};for(var l=0;l<n.length;l++)s.prototype["get"+e(n[l])]=t(n[l]),s.prototype["set"+e(n[l])]=function(e){return function(t){this[e]=Boolean(t)}}(n[l]);for(var a=0;a<o.length;a++)s.prototype["get"+e(o[a])]=t(o[a]),s.prototype["set"+e(o[a])]=function(e){return function(t){if(n=t,isNaN(parseFloat(n))||!isFinite(n))throw new TypeError(e+" must be a Number");var n;this[e]=Number(t)}}(o[a]);for(var c=0;c<r.length;c++)s.prototype["get"+e(r[c])]=t(r[c]),s.prototype["set"+e(r[c])]=function(e){return function(t){this[e]=String(t)}}(r[c]);return s}()),p=m.exports,h=/(^|@)\S+:\d+/,g=/^\s*at .*(\S+:\d+|\(native\))/m,f=/^(eval@)?(\[native code])?$/,{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(g))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(g)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),o=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:o.pop()),i=o.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new p({functionName:i,fileName:s,lineNumber:r[1],columnNumber:r[2],source:e})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(f)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new p({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),o=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new p({functionName:o,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),o=[],r=2,i=n.length;r<i;r+=2){var s=t.exec(n[r]);s&&o.push(new p({fileName:s[2],lineNumber:s[1],source:n[r]}))}return o},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),o=[],r=0,i=n.length;r<i;r+=2){var s=t.exec(n[r]);s&&o.push(new p({functionName:s[3]||void 0,fileName:s[2],lineNumber:s[1],source:n[r]}))}return o},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(h)&&!e.match(/^Error created at/)}),this).map((function(e){var t,n=e.split("@"),o=this.extractLocation(n.pop()),r=n.shift()||"",i=r.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;r.match(/\(([^)]*)\)/)&&(t=r.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===t||"[arguments not available]"===t?void 0:t.split(",");return new p({functionName:i,args:s,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e})}),this)}});const v=d(w.exports);var b={exports:{}};!function(e,t){function n(e,t){var n=[],o=[];return null==t&&(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]"}),function(r,i){if(n.length>0){var s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?o.splice(s,1/0,r):o.push(r),~n.indexOf(i)&&(i=t.call(this,r,i))}else n.push(i);return null==e?i:e.call(this,r,i)}}(e.exports=function(e,t,o,r){return JSON.stringify(e,n(t,r),o)}).getSerialize=n}(b);const y=d(b.exports);function _(e,t,n,o){var r,i,s,l;let a=[];try{a=v.parse(null!=o?o:t)}catch(d){a=v.parse(new Error)}t instanceof Error&&(t=t.message);const c=R(a);e({event:y(t),type:"window.onerror",url:window.location.href,source:null!=n?n:"",lineNumber:(null==(r=c[0])?void 0:r.lineNumber)?null==(i=c[0])?void 0:i.lineNumber:0,columnNumber:(null==(s=c[0])?void 0:s.columnNumber)?null==(l=c[0])?void 0:l.columnNumber:0,stackTrace:c,timestamp:(new Date).toISOString()})}const k=e=>{if("undefined"==typeof window)return()=>{};const t=window.onerror=(t,n,o,r,i)=>{_(e,t,n,i)},n=window.onunhandledrejection=t=>{if(t.reason){const n=t.promise;n.getStack?_(e,t.reason,t.type,n.getStack()):_(e,t.reason,t.type)}},o=window.Promise;return window.Promise=class extends o{constructor(e){super(e),__publicField(this,"promiseCreationError"),this.promiseCreationError=new Error}getStack(){return this.promiseCreationError}},()=>{window.Promise=o,window.onunhandledrejection=n,window.onerror=t}},R=e=>{var t,n;if(0===e.length)return e;const o=e[0];return(null==(t=o.fileName)?void 0:t.includes("highlight.run"))||(null==(n=o.fileName)?void 0:n.includes("highlight.io"))||"new HighlightPromise"===o.functionName?e.slice(1):e},S=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"];var E,O,N,C;(O=E||(E={})).DeviceMemory="DeviceMemory",O.ViewportHeight="ViewportHeight",O.ViewportWidth="ViewportWidth",O.ViewportArea="ViewportArea",(C=N||(N={})).Device="Device",C.WebVital="WebVital",C.Frontend="Frontend",C.Backend="Backend";const T=['["\\"Script error.\\""]','"Script error."','["\\"Load failed.\\""]','"Load failed."','["\\"Network request failed.\\""]','"Network request failed."','["\\"Document is not focused.\\""]','"Document is not focused."','["\\"Failed to fetch\\""]','"Failed to fetch"','[{"isTrusted":true}]','{"isTrusted":true}','["{}"]','"{}"','[""]','""','["\\"\\""]','""'],L=["websocket error",'\\"ResizeObserver loop'],x=(e,t,n)=>{const o=I(t,e.headers,n);return __spreadProps(__spreadValues({},e),{headers:o})},I=(e,t,n)=>{var o,r;const i=__spreadValues({},t);return n?(null==(o=Object.keys(i))||o.forEach((e=>{[...n].includes(null==e?void 0:e.toLowerCase())||(i[e]="[REDACTED]")})),i):(null==(r=Object.keys(i))||r.forEach((t=>{[...P,...e].includes(null==t?void 0:t.toLowerCase())&&(i[t]="[REDACTED]")})),i)},P=["authorization","cookie","proxy-authorization","token"],H=["https://www.googleapis.com/identitytoolkit","https://securetoken.googleapis.com"],j="X-Highlight-Request",D=e=>{let t=e;return e.startsWith("https://")||e.startsWith("http://")||(t=`${window.location.origin}${t}`),t.replace(/\/+$/,"")},F=(e,t,n,o)=>{e.sort(((e,t)=>e.responseEnd-t.responseEnd));const r=e.reduce(((e,t)=>{const o=D(t.name);return t.initiatorType===n?e[n][o]=[...e[n][o]||[],t]:e.others[o]=[...e.others[o]||[],t],e}),{xmlhttprequest:{},others:{},fetch:{}});let i={};i=t.reduce(((e,t)=>{const n=D(t.request.url);return e[n]=[...e[n]||[],t],e}),i);for(let l in r[n]){const e=r[n][l],t=i[l];if(!t)continue;const o=Math.max(e.length-t.length,0);for(let n=o;n<e.length;n++)e[n]&&(e[n].requestResponsePair=t[n-o])}let s=[];for(let l in r)for(let e in r[l])s=s.concat(r[l][e]);return s.sort(((e,t)=>e.fetchStart-t.fetchStart)).reduce(((e,t)=>{let n=t.requestResponsePair;return n&&(n=((e,{headersToRedact:t,headersToRecord:n,requestResponseSanitizer:o})=>{let r=e;if(o){try{r=o(r)}catch(c){}if(!r)return null}const i=r,{request:s,response:l}=i,a=__objRest(i,["request","response"]);return __spreadValues({request:x(s,t,n),response:x(l,t,n)},a)})(t.requestResponsePair,o),!n)||(t.toJSON=function(){return{initiatorType:this.initiatorType,startTime:this.startTime,responseEnd:this.responseEnd,startTimeAbs:window.performance.timeOrigin+this.startTime,responseEndAbs:window.performance.timeOrigin+this.responseEnd,name:this.name,transferSize:this.transferSize,encodedBodySize:this.encodedBodySize,requestResponsePairs:n}},e.push(t)),e}),[])},q=(e,t,n)=>{return r=t,!((o=e).toLocaleLowerCase().includes("https://pub.highlight.run")||o.toLocaleLowerCase().includes("highlight.run")||o.toLocaleLowerCase().includes(r))||B(e,n);var o,r},B=(e,t)=>{var n;let o=[];!0===t?(o=["localhost",/^\//],(null==(n=null==window?void 0:window.location)?void 0:n.host)&&o.push(window.location.host)):t instanceof Array&&(o=t);let r=!1;return o.forEach((t=>{e.match(t)&&(r=!0)})),r},A=()=>function(e){for(var t="",n=0;n<10;n++)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}(),U=(e,t)=>e+"/"+t,W=(e,t,n,o,r,i,s)=>{const l=XMLHttpRequest.prototype,a=l.open,c=l.send,d=l.setRequestHeader;return l.open=function(e,t){return this._method=e,this._url=t,this._requestHeaders={},this._shouldRecordHeaderAndBody=!o.some((e=>t.toLowerCase().includes(e))),a.apply(this,arguments)},l.setRequestHeader=function(e,t){return this._requestHeaders[e]=t,d.apply(this,arguments)},l.send=function(o){if(!q(this._url,t,n))return c.apply(this,arguments);const l=A();B(this._url,n)&&this.setRequestHeader(j,U(r,l));const a=this._shouldRecordHeaderAndBody,d={id:l,url:this._url,verb:this._method,headers:a?this._requestHeaders:{},body:void 0};if(a&&o){const e=K(o,d.url);e&&(d.body=M(e,i,s,d.headers))}return this.addEventListener("load",(function(){return __async(this,null,(function*(){const t={status:this.status,headers:{},body:void 0};if(a){const e=this.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};if(e.forEach((function(e){const t=e.split(": "),n=t.shift();r[n]=t.join(": ")})),t.headers=r,o){const e=K(o,d.url);e&&(d.body=M(e,i,s,t.headers))}if(""===this.responseType||"text"===this.responseType)t.body=M(this.responseText,i,s,t.headers),t.size=8*this.responseText.length;else if("blob"===this.responseType){if(this.response instanceof Blob)try{const e=yield this.response.text();t.body=M(e,i,s,t.headers),t.size=this.response.size}catch(n){}}else try{t.body=M(this.response,i,s,t.headers)}catch(n){}}e({request:d,response:t,urlBlocked:!a})}))})),this.addEventListener("error",(function(){return __async(this,null,(function*(){const t={status:this.status,headers:void 0,body:void 0};e({request:d,response:t,urlBlocked:!1})}))})),c.apply(this,arguments)},()=>{l.open=a,l.send=c,l.setRequestHeader=d}},K=(e,t)=>{if("string"==typeof e){if(!(null==t?void 0:t.includes("localhost"))&&!(null==t?void 0:t.includes("highlight.run"))||!e.includes("pushPayload"))return e}else if("object"==typeof e||"number"==typeof e||"boolean"==typeof e)return e.toString();return null},V={"application/json":67108864,"text/plain":67108864},M=(e,t,n,o)=>{var r,i,s;let l=65536;if(o){let e="";e="function"==typeof o.get?null!=(r=o.get("content-type"))?r:"":null!=(i=o["content-type"])?i:"";try{e=e.split(";")[0]}catch(a){}l=null!=(s=V[e])?s:65536}if(e){if(t)try{const n=JSON.parse(e);Object.keys(n).forEach((e=>{t.includes(e.toLocaleLowerCase())&&(n[e]="[REDACTED]")})),e=JSON.stringify(n)}catch(c){}if(n)try{const t=JSON.parse(e);Object.keys(t).forEach((e=>{n.includes(e.toLocaleLowerCase())||(t[e]="[REDACTED]")})),e=JSON.stringify(t)}catch(c){}}try{e=e.slice(0,l)}catch(c){}return e},z=(e,t,n,o,r,i,s)=>{const l=window._fetchProxy;return window._fetchProxy=function(a,c){const{method:d,url:u}=$(a,c);if(!q(u,t,n))return l.call(this,a,c);const p=A();if(B(u,n)){c=c||{};let e=new Headers(c.headers);a instanceof Request&&[...a.headers].forEach((([t,n])=>e.set(t,n))),e.set(j,U(r,p)),c.headers=Object.fromEntries(e.entries())}const h={id:p,headers:{},body:void 0,url:u,verb:d},g=!o.some((e=>u.toLowerCase().includes(e)));g&&(h.headers=Object.fromEntries(new Headers(null==c?void 0:c.headers).entries()),h.body=M(null==c?void 0:c.body,i,s,null==c?void 0:c.headers));let f=l.call(this,a,c);return J(f,h,e,g,i,s),f},()=>{window._fetchProxy=l}},$=(e,t)=>{const n=t&&t.method||"object"==typeof e&&"method"in e&&e.method||"GET";let o;return o="object"==typeof e?"url"in e&&e.url?e.url:e.toString():e,{method:n,url:o}},J=(e,t,n,o,r,i)=>{e.then((e=>__async(this,null,(function*(){let s={body:void 0,headers:void 0,status:0,size:0},l=!1;if("stack"in e||e instanceof Error)s=__spreadProps(__spreadValues({},s),{body:e.message,status:0,size:void 0}),l=!0;else if("status"in e){if(s=__spreadProps(__spreadValues({},s),{status:e.status}),o){let t;try{const n=e.clone().body;if(n){let o,s=n.getReader(),l=new TextDecoder,a="";for(;!(o=yield s.read()).done;){let e=o.value;a+=l.decode(e)}t=a,t=M(t,r,i,e.headers)}else t=""}catch(a){t=`Unable to clone response: ${a}`}s.body=t,s.headers=Object.fromEntries(e.headers.entries()),s.size=8*t.length}l=!0}l&&n({request:t,response:s,urlBlocked:!o})})))).catch((()=>{}))};class G{constructor(e){var t;__publicField(this,"disableConsoleRecording"),__publicField(this,"reportConsoleErrors"),__publicField(this,"consoleMethodsToRecord"),__publicField(this,"listeners"),__publicField(this,"errors"),__publicField(this,"messages"),__publicField(this,"options"),__publicField(this,"hasNetworkRecording",!0),__publicField(this,"_backendUrl"),__publicField(this,"disableNetworkRecording"),__publicField(this,"enableRecordingNetworkContents"),__publicField(this,"xhrNetworkContents"),__publicField(this,"fetchNetworkContents"),__publicField(this,"disableRecordingWebSocketContents"),__publicField(this,"webSocketNetworkContents"),__publicField(this,"webSocketEventContents"),__publicField(this,"tracingOrigins"),__publicField(this,"networkHeadersToRedact"),__publicField(this,"networkBodyKeysToRedact"),__publicField(this,"networkBodyKeysToRecord"),__publicField(this,"networkHeaderKeysToRecord"),__publicField(this,"urlBlocklist"),__publicField(this,"requestResponseSanitizer"),this.options=e,this.disableConsoleRecording=!!e.disableConsoleRecording,this.reportConsoleErrors=null!=(t=e.reportConsoleErrors)&&t,this.consoleMethodsToRecord=e.consoleMethodsToRecord||[...S],this.listeners=[],this.errors=[],this.messages=[]}isListening(){return this.listeners.length>0}startListening(){if(this.isListening())return;const e=this;this.disableConsoleRecording||this.listeners.push(function(e,t){const n=t.logger;if(!n)return()=>{};let o;o="string"==typeof n?window[n]:n;const r=[];if(t.level.includes("error")&&window){const n=n=>{const{message:o,error:r}=n;let i=[];r&&(i=v.parse(r));const s=[c(o,t.stringifyOptions)];e({type:"Error",trace:i,time:Date.now(),value:s})};window.addEventListener("error",n),r.push((()=>{window&&window.removeEventListener("error",n)}))}for(const s of t.level)r.push(i(o,s));return()=>{r.forEach((e=>e()))};function i(n,o){return n[o]?function(e,t,n){try{if(!(t in e))return()=>{};const o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,()=>{e[t]=o}}catch(o){return()=>{}}}(n,o,(n=>(...r)=>{n.apply(this,r);try{const n=v.parse(new Error),i=r.map((e=>c(e,t.stringifyOptions)));e({type:o,trace:n.slice(1),value:i,time:Date.now()})}catch(i){n("highlight logger error:",i,...r)}})):()=>{}}}((t=>{var n,o,r;if(this.reportConsoleErrors&&("Error"===t.type||"error"===t.type)&&t.value&&t.trace){const i=y(t.value);if(T.includes(i)||L.some((e=>i.includes(e))))return;e.errors.push({event:i,type:"console.error",url:window.location.href,source:(null==(n=t.trace[0])?void 0:n.fileName)?t.trace[0].fileName:"",lineNumber:(null==(o=t.trace[0])?void 0:o.lineNumber)?t.trace[0].lineNumber:0,columnNumber:(null==(r=t.trace[0])?void 0:r.columnNumber)?t.trace[0].columnNumber:0,stackTrace:t.trace,timestamp:(new Date).toISOString()})}e.messages.push(t)}),{level:this.consoleMethodsToRecord,logger:"console",stringifyOptions:{depthOfLimit:10,numOfKeysLimit:100,stringLengthLimit:1e3}})),this.listeners.push(k((t=>{T.includes(t.event)||L.some((e=>t.event.includes(e)))||e.errors.push(t)}))),G.setupNetworkListener(this,this.options)}stopListening(){this.listeners.forEach((e=>e())),this.listeners=[]}static setupNetworkListener(e,t){var n,o,r,i,s,l,a,c,d,u,p,h;e._backendUrl=(null==t?void 0:t.backendUrl)||"https://pub.highlight.run",e.xhrNetworkContents=[],e.fetchNetworkContents=[],e.webSocketNetworkContents=[],e.webSocketEventContents=[],e.networkHeadersToRedact=[],e.urlBlocklist=[],e.tracingOrigins=t.tracingOrigins||[],void 0!==(null==t?void 0:t.disableNetworkRecording)?(e.disableNetworkRecording=null==t?void 0:t.disableNetworkRecording,e.enableRecordingNetworkContents=!1,e.disableRecordingWebSocketContents=!0,e.networkHeadersToRedact=[],e.networkBodyKeysToRedact=[],e.urlBlocklist=[],e.networkBodyKeysToRecord=[],e.networkBodyKeysToRecord=[]):"boolean"==typeof(null==t?void 0:t.networkRecording)?(e.disableNetworkRecording=!t.networkRecording,e.enableRecordingNetworkContents=!1,e.disableRecordingWebSocketContents=!0,e.networkHeadersToRedact=[],e.networkBodyKeysToRedact=[],e.urlBlocklist=[]):(void 0!==(null==(n=t.networkRecording)?void 0:n.enabled)?e.disableNetworkRecording=!t.networkRecording.enabled:e.disableNetworkRecording=!1,e.enableRecordingNetworkContents=(null==(o=t.networkRecording)?void 0:o.recordHeadersAndBody)||!1,e.disableRecordingWebSocketContents=(null==(r=t.networkRecording)?void 0:r.disableWebSocketEventRecordings)||!1,e.networkHeadersToRedact=(null==(s=null==(i=t.networkRecording)?void 0:i.networkHeadersToRedact)?void 0:s.map((e=>e.toLowerCase())))||[],e.networkBodyKeysToRedact=(null==(a=null==(l=t.networkRecording)?void 0:l.networkBodyKeysToRedact)?void 0:a.map((e=>e.toLowerCase())))||[],e.urlBlocklist=(null==(d=null==(c=t.networkRecording)?void 0:c.urlBlocklist)?void 0:d.map((e=>e.toLowerCase())))||[],e.urlBlocklist=[...e.urlBlocklist,...H],e.requestResponseSanitizer=null==(u=t.networkRecording)?void 0:u.requestResponseSanitizer,e.networkHeaderKeysToRecord=null==(p=t.networkRecording)?void 0:p.headerKeysToRecord,e.networkHeaderKeysToRecord&&(e.networkHeadersToRedact=[],e.networkHeaderKeysToRecord=e.networkHeaderKeysToRecord.map((e=>e.toLocaleLowerCase()))),e.networkBodyKeysToRecord=null==(h=t.networkRecording)?void 0:h.bodyKeysToRecord,e.networkBodyKeysToRecord&&(e.networkBodyKeysToRedact=[],e.networkBodyKeysToRecord=e.networkBodyKeysToRecord.map((e=>e.toLocaleLowerCase())))),!e.disableNetworkRecording&&e.enableRecordingNetworkContents&&e.listeners.push((({xhrCallback:e,fetchCallback:t,webSocketRequestCallback:n,webSocketEventCallback:o,disableWebSocketRecording:r,bodyKeysToRedact:i,backendUrl:s,tracingOrigins:l,urlBlocklist:a,sessionSecureID:c,bodyKeysToRecord:d})=>{const u=W(e,s,l,a,c,i,d),p=z(t,s,l,a,c,i,d),h=r?()=>{}:((e,t,n)=>{const o=window._highlightWebSocketRequestCallback;window._highlightWebSocketRequestCallback=e;const r=window._highlightWebSocketEventCallback;return window._highlightWebSocketEventCallback=e=>{const o=e,{message:r,size:i}=o,s=__objRest(o,["message","size"]),l=n.some((t=>e.name.toLowerCase().includes(t)));t(l?s:e)},()=>{window._highlightWebSocketRequestCallback=o,window._highlightWebSocketEventCallback=r}})(n,o,a);return()=>{u(),p(),h()}})({xhrCallback:t=>{e.xhrNetworkContents.push(t)},fetchCallback:t=>{e.fetchNetworkContents.push(t)},webSocketRequestCallback:t=>{e.webSocketNetworkContents&&e.webSocketNetworkContents.push(t)},webSocketEventCallback:t=>{e.webSocketEventContents.push(t)},disableWebSocketRecording:e.disableRecordingWebSocketContents,bodyKeysToRedact:e.networkBodyKeysToRedact,backendUrl:e._backendUrl,tracingOrigins:e.tracingOrigins,urlBlocklist:e.urlBlocklist,sessionSecureID:t.sessionSecureID,bodyKeysToRecord:e.networkBodyKeysToRecord}))}static getRecordedNetworkResources(e,t){var n;let o=[],r=[];if(!e.disableNetworkRecording){const r=(null==(n=null==window?void 0:window.performance)?void 0:n.timeOrigin)||0;o=performance.getEntriesByType("resource");const i=2*(t-r);if(o=o.filter((t=>q(t.name,e._backendUrl,e.tracingOrigins))).map((e=>__spreadProps(__spreadValues({},e.toJSON()),{offsetStartTime:e.startTime-i,offsetResponseEnd:e.responseEnd-i,offsetFetchStart:e.fetchStart-i}))),e.enableRecordingNetworkContents){const t={headersToRedact:e.networkHeadersToRedact,headersToRecord:e.networkHeaderKeysToRecord,requestResponseSanitizer:e.requestResponseSanitizer};o=F(o,e.xhrNetworkContents,"xmlhttprequest",t),o=F(o,e.fetchNetworkContents,"fetch",t)}}return e.disableRecordingWebSocketContents||(r=e.webSocketNetworkContents||[]),[...o,...r]}static getRecordedWebSocketEvents(e){let t=[];return e.disableNetworkRecording||e.disableRecordingWebSocketContents||(t=e.webSocketEventContents),t}static clearRecordedNetworkResources(e){e.disableNetworkRecording||(e.xhrNetworkContents=[],e.fetchNetworkContents=[],e.webSocketNetworkContents=[],e.webSocketEventContents=[],performance.clearResourceTimings())}}const X="8.3.2";let Y=new class{constructor(){__publicField(this,"storage",{})}getItem(e){var t;return null!=(t=this.storage[e])?t:""}setItem(e,t){this.storage[e]=t}removeItem(e){delete this.storage[e]}};const Q=()=>{try{return window.localStorage}catch(e){return Y}},Z=()=>null;e.MetricCategory=void 0,function(e){e.Device="Device",e.WebVital="WebVital",e.Frontend="Frontend",e.Backend="Backend"}(e.MetricCategory||(e.MetricCategory={}));const ee=(e,t)=>{console.warn(`highlight.run warning: (${e}): `,t)};let te,ne,oe,re,ie=[],se=!1;const le={options:void 0,init:(e,t)=>{var n,i,s,l,a,c,d,u,p,h;try{if(le.options=t,"undefined"==typeof window||"undefined"==typeof document)return;if(!e)return void console.info("Highlight is not initializing because projectID was passed undefined.");let f=(()=>{let e=JSON.parse((t=r.SESSION_DATA,Q().getItem(t)||"{}"));var t;if(e&&e.lastPushTime&&Date.now()-e.lastPushTime<55e3)return e})(),w=(()=>{var e;var t="";const n="undefined"!=typeof window&&(null==(e=window.crypto)?void 0:e.getRandomValues),o=new Uint32Array(28);n&&window.crypto.getRandomValues(o);for(let r=0;r<28;r++)t+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(n?o[r]%62:Math.floor(62*Math.random()));return t})();if(null==f?void 0:f.sessionSecureID)w=f.sessionSecureID;else{const t=__spreadProps(__spreadValues({},f),{projectID:+e,sessionSecureID:w});p=r.SESSION_DATA,h=JSON.stringify(t),Q().setItem(p,h)}if(se)return{sessionSecureID:w};se=!0,ne=document.createElement("script");var g=(null==t?void 0:t.scriptUrl)?t.scriptUrl:`https://static.highlight.io/v${X}/index.js`;ne.setAttribute("src",g),ne.setAttribute("type","text/javascript"),document.getElementsByTagName("head")[0].appendChild(ne);const m={organizationID:e,debug:null==t?void 0:t.debug,backendUrl:null==t?void 0:t.backendUrl,tracingOrigins:null==t?void 0:t.tracingOrigins,disableNetworkRecording:null==t?void 0:t.disableNetworkRecording,networkRecording:null==t?void 0:t.networkRecording,disableBackgroundRecording:null==t?void 0:t.disableBackgroundRecording,disableConsoleRecording:null==t?void 0:t.disableConsoleRecording,disableSessionRecording:null==t?void 0:t.disableSessionRecording,reportConsoleErrors:null==t?void 0:t.reportConsoleErrors,consoleMethodsToRecord:null==t?void 0:t.consoleMethodsToRecord,enableSegmentIntegration:null==t?void 0:t.enableSegmentIntegration,privacySetting:null==t?void 0:t.privacySetting,enableCanvasRecording:null==t?void 0:t.enableCanvasRecording,enablePerformanceRecording:null==t?void 0:t.enablePerformanceRecording,samplingStrategy:null==t?void 0:t.samplingStrategy,inlineImages:null==t?void 0:t.inlineImages,inlineStylesheet:null==t?void 0:t.inlineStylesheet,recordCrossOriginIframe:null==t?void 0:t.recordCrossOriginIframe,firstloadVersion:X,environment:(null==t?void 0:t.environment)||"production",appVersion:null==t?void 0:t.version,serviceName:null==t?void 0:t.serviceName,sessionShortcut:null==t?void 0:t.sessionShortcut,sessionSecureID:w,storageMode:null==t?void 0:t.storageMode,sendMode:null==t?void 0:t.sendMode};return re=new G(m),(null==t?void 0:t.manualStart)||re.startListening(),ne.addEventListener("load",(()=>{const e=()=>{oe=new window.HighlightIO(m,re),(null==t?void 0:t.manualStart)||oe.initialize()};if("HighlightIO"in window)e();else{const t=()=>{"HighlightIO"in window?e():setTimeout(t,200)};t()}})),!(null==(i=null==(n=null==t?void 0:t.integrations)?void 0:n.mixpanel)?void 0:i.disabled)&&(null==(l=null==(s=null==t?void 0:t.integrations)?void 0:s.mixpanel)?void 0:l.projectToken)&&(({projectToken:e})=>{if(window.mixpanel)return;var t,n,o;document,(t=window.mixpanel||[]).__SV||(window.mixpanel=t,t._i=[],t.init=function(e,r,i){function s(e,t){var n=t.split(".");2==n.length&&(e=e[n[0]],t=n[1]),e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}}var l=t;for(void 0!==i?l=t[i]=[]:i="mixpanel",l.people=l.people||[],l.toString=function(e){var t="mixpanel";return"mixpanel"!==i&&(t+="."+i),e||(t+=" (stub)"),t},l.people.toString=function(){return l.toString(1)+".people (stub)"},n="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" "),o=0;o<n.length;o++)s(l,n[o]);var a="set set_once union unset remove delete".split(" ");l.get_group=function(){function e(e){t[e]=function(){call2_args=arguments,call2=[e].concat(Array.prototype.slice.call(call2_args,0)),l.push([n,call2])}}for(var t={},n=["get_group"].concat(Array.prototype.slice.call(arguments,0)),o=0;o<a.length;o++)e(a[o]);return t},t._i.push([e,r,i])},t.__SV=1.2);const r=document.createElement("script");r.src="https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js",document.head.appendChild(r),r.addEventListener("load",(()=>{var t;null==(t=window.mixpanel)||t.init(e)}))})(t.integrations.mixpanel),!(null==(c=null==(a=null==t?void 0:t.integrations)?void 0:a.amplitude)?void 0:c.disabled)&&(null==(u=null==(d=null==t?void 0:t.integrations)?void 0:d.amplitude)?void 0:u.apiKey)&&o(t.integrations.amplitude),{sessionSecureID:w}}catch(f){ee("init",f)}},snapshot:e=>__async(this,null,(function*(){try{if(oe&&oe.ready)return yield oe.snapshot(e)}catch(t){ee("snapshot",t)}})),addSessionFeedback:({verbatim:e,userName:t,userEmail:n,timestampOverride:o})=>{try{le.onHighlightReady((()=>oe.addSessionFeedback({verbatim:e,timestamp:o||(new Date).toISOString(),user_email:n,user_name:t})))}catch(r){ee("error",r)}},consumeError:(e,t,n)=>{try{le.onHighlightReady((()=>oe.consumeCustomError(e,t,JSON.stringify(n))))}catch(o){ee("error",o)}},error:(e,t)=>{try{le.onHighlightReady((()=>oe.pushCustomError(e,JSON.stringify(t))))}catch(n){ee("error",n)}},track:(e,t={})=>{var n,o,r,i,s,l,a,c,d,u,p;try{le.onHighlightReady((()=>oe.addProperties(__spreadProps(__spreadValues({},t),{event:e}))));const h=null==oe?void 0:oe.getCurrentSessionURL();(null==(r=null==(o=null==(n=le.options)?void 0:n.integrations)?void 0:o.mixpanel)?void 0:r.disabled)||(null==(i=window.mixpanel)?void 0:i.track)&&window.mixpanel.track(e,__spreadProps(__spreadValues({},t),{highlightSessionURL:h})),(null==(a=null==(l=null==(s=le.options)?void 0:s.integrations)?void 0:l.amplitude)?void 0:a.disabled)||(null==(c=window.amplitude)?void 0:c.getInstance)&&window.amplitude.getInstance().logEvent(e,__spreadProps(__spreadValues({},t),{highlightSessionURL:h})),(null==(p=null==(u=null==(d=le.options)?void 0:d.integrations)?void 0:u.intercom)?void 0:p.disabled)||window.Intercom&&window.Intercom("trackEvent",e,t)}catch(h){ee("track",h)}},start:e=>{"Recording"===(null==oe?void 0:oe.state)?(null==e?void 0:e.silent)||console.warn("Highlight is already recording. Please `H.stop()` the current session before starting a new one."):(re.startListening(),le.onHighlightReady((()=>__async(this,null,(function*(){yield oe.initialize(e)}))),{waitForReady:!1}))},stop:e=>{"Recording"!==(null==oe?void 0:oe.state)?(null==e?void 0:e.silent)||console.warn("Highlight is already stopped. Please call `H.start()`."):le.onHighlightReady((()=>oe.stopRecording(!0)))},identify:(e,t={})=>{var n,o,r,i,s,l,a,c;try{le.onHighlightReady((()=>oe.identify(e,t)))}catch(d){ee("identify",d)}if((null==(r=null==(o=null==(n=le.options)?void 0:n.integrations)?void 0:o.mixpanel)?void 0:r.disabled)||(null==(i=window.mixpanel)?void 0:i.identify)&&(window.mixpanel.identify("string"==typeof(null==t?void 0:t.email)?null==t?void 0:t.email:e),t&&(window.mixpanel.track("identify",t),window.mixpanel.people.set(t))),!(null==(a=null==(l=null==(s=le.options)?void 0:s.integrations)?void 0:l.amplitude)?void 0:a.disabled)&&(null==(c=window.amplitude)?void 0:c.getInstance)&&(window.amplitude.getInstance().setUserId(e),Object.keys(t).length>0)){const e=Object.keys(t).reduce(((e,n)=>(e.set(n,t[n]),e)),new window.amplitude.Identify);window.amplitude.getInstance().identify(e)}},metrics:t=>{try{le.onHighlightReady((()=>oe.recordMetric(t.map((t=>__spreadProps(__spreadValues({},t),{category:e.MetricCategory.Frontend}))))))}catch(n){ee("metrics",n)}},getSessionURL:()=>new Promise(((e,t)=>{le.onHighlightReady((()=>{const n=oe.getCurrentSessionURL();n?e(n):t(new Error("Unable to get session URL"))}))})),getSessionDetails:()=>new Promise(((e,t)=>{le.onHighlightReady((()=>{const n=oe.getCurrentSessionURL();if(n){const t=oe.getCurrentSessionTimestamp(),o=(new Date).getTime(),r=new URL(n),i=new URL(n);i.searchParams.set("ts",((o-t)/1e3).toString()),e({url:r.toString(),urlWithTimestamp:i.toString()})}else t(new Error("Could not get session URL"))}))})),onHighlightReady:(e,t)=>__async(this,null,(function*(){if(ie.push({options:t,func:e}),void 0===te){const e=()=>__async(this,null,(function*(){var t;const n=[];for(const e of ie)if(oe&&(!1===(null==(t=e.options)?void 0:t.waitForReady)||oe.ready))try{yield e.func()}catch(o){ee("onHighlightReady",o)}else n.push(e);te=void 0,ie=n,ie.length>0&&(te=setTimeout(e,200))}));yield e()}}))};"undefined"!=typeof window&&(window.H=le),"undefined"!=typeof chrome&&(null==(t=null==chrome?void 0:chrome.runtime)?void 0:t.onMessage)&&(null==(n=null==chrome?void 0:chrome.runtime)||n.onMessage.addListener(((e,t,n)=>{const o=e.action;switch(console.log(`[highlight] received '${o}' event from extension.`),o){case"init":{const e="http://localhost:8080/dist/index.js";console.log("url",e),le.init(1,{debug:!0,scriptUrl:e}),le.getSessionURL().then((e=>{n({url:e})}));break}case"stop":le.stop(),n({success:!0})}return!0}))),(()=>{if("undefined"!=typeof window){if(void 0!==window._highlightFetchPatch)return;window._originalFetch=window.fetch,window._fetchProxy=(e,t)=>window._originalFetch(e,t),window._highlightFetchPatch=(e,t)=>window._fetchProxy.call(window||global,e,t),window.fetch=window._highlightFetchPatch}})(),(()=>{if("undefined"!=typeof window){if(void 0!==window._highlightWebSocketRequestCallback)return;window._highlightWebSocketRequestCallback=Z,window._highlightWebSocketEventCallback=Z;const e=new Proxy(window.WebSocket,{construct(e,t){const n=A(),o=new e(...t),r=e=>{window._highlightWebSocketRequestCallback({socketId:n,initiatorType:"websocket",type:"open",name:o.url,startTime:e.timeStamp})},i=e=>{window._highlightWebSocketRequestCallback({socketId:n,initiatorType:"websocket",type:"close",name:o.url,requestEnd:e.timeStamp}),o.removeEventListener("open",r),o.removeEventListener("error",l),o.removeEventListener("message",s),o.removeEventListener("close",i)},s=e=>{const{data:t}=e,r="string"==typeof t?e.data:void 0;let i;i="string"==typeof t?t.length:t instanceof Blob?t.size:t.byteLength||0,window._highlightWebSocketEventCallback({socketId:n,type:"received",name:o.url,timeStamp:e.timeStamp,size:i,message:r})},l=e=>{window._highlightWebSocketEventCallback({socketId:n,type:"error",name:o.url,timeStamp:e.timeStamp,size:0})};o.addEventListener("open",r),o.addEventListener("error",l),o.addEventListener("message",s),o.addEventListener("close",i);const a=new Proxy(o.send,{apply:function(e,t,r){const i=r[0],s="string"==typeof i?i:void 0;let l;l="string"==typeof i?i.length:i instanceof Blob?i.size:i.byteLength||0,window._highlightWebSocketEventCallback({socketId:n,type:"sent",name:o.url,timeStamp:performance.now(),size:l,message:s}),e.apply(t,r)}});return o.send=a,o}});window.WebSocket=e}})(),e.H=le,e.HighlightSegmentMiddleware=({next:e,payload:t})=>{if("undefined"!=typeof window&&"undefined"!=typeof document&&"H"in window)if("track"===t.obj.type){const e=t.obj.event,n=t.obj.properties;window.H.track(e,n)}else if("identify"===t.obj.type){const e=t.obj.userId;if(null==e?void 0:e.length){const n=t.obj.traits;window.H.identify(e,n)}}e(t)},e.configureElectronHighlight=function(e){var t;e.on&&(null==(t=e.webContents)?void 0:t.send)&&(e.on("focus",(()=>{e.webContents.send("highlight.run",{visible:!0})})),e.on("blur",(()=>{e.webContents.send("highlight.run",{visible:!1})})),e.on("close",(()=>{e.webContents.send("highlight.run",{visible:!1})})))},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})); |
{ | ||
"name": "highlight.run", | ||
"version": "8.3.1", | ||
"version": "8.3.2", | ||
"description": "Open source, fullstack monitoring. Capture frontend errors, record server side logs, and visualize what broke with session replay.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
245330
3060