Socket
Socket
Sign inDemoInstall

highlight.run

Package Overview
Dependencies
Maintainers
1
Versions
277
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

highlight.run - npm Package Compare versions

Comparing version 7.5.0 to 7.5.1

6

CHANGELOG.md

@@ -381,1 +381,7 @@ # highlight.run

- Added support to specify `serviceName`.
## 7.5.1
### Patch Changes
- Remove canvas recording logging (not only enabled if the `debug` setting is provided).

2

dist/client/src/graph/generated/operations.d.ts

@@ -111,3 +111,3 @@ import { GraphQLClient } from 'graphql-request';

organization_verbose_id: Scalars['String'];
serviceName: Scalars['String'];
serviceName?: InputMaybe<Scalars['String']>;
session_secure_id: Scalars['String'];

@@ -114,0 +114,0 @@ };

@@ -109,3 +109,3 @@ export type Maybe<T> = T | null;

organization_verbose_id: Scalars['String'];
serviceName: Scalars['String'];
serviceName?: InputMaybe<Scalars['String']>;
session_secure_id: Scalars['String'];

@@ -112,0 +112,0 @@ };

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

declare const _default: "7.5.0";
declare const _default: "7.5.1";
export default _default;

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

!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=Object.defineProperty,n=Object.defineProperties,o=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,l=(e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,a=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&l(e,n,t[n]);if(r)for(var n of r(t))s.call(t,n)&&l(e,n,t[n]);return e},c=(e,t)=>n(e,o(t)),d=(e,t)=>{var n={};for(var o in e)i.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&r)for(var o of r(e))t.indexOf(o)<0&&s.call(e,o)&&(n[o]=e[o]);return n},u=(e,t,n)=>(l(e,"symbol"!=typeof t?t+"":t,n),n),h=(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())}));const p=({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"],h=0;h<u.length;h++)s(d,u[h]);o.Revenue=d;var p=["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<p.length;n++)t(p[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 g=(e=>(e.RECORDING_START_TIME="highlightRecordingStartTime",e.SEGMENT_LAST_SENT_HASH_KEY="HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY",e.SESSION_DATA="sessionData",e.SESSION_SECURE_ID="sessionSecureID",e.USER_IDENTIFIER="highlightIdentifier",e.USER_OBJECT="highlightUserObject",e.PAYLOAD_ID="payloadId",e))(g||{});const f="https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";function w(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 m(e){return"[object Object]"===Object.prototype.toString.call(e)}function v(e,t){if(0===t)return!0;const n=Object.keys(e);for(const o of n)if(m(e[o])&&v(e[o],t-1))return!0;return!1}function y(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(function(e){if(m(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(e instanceof Event&&!1===e.isTrusted){return 1===Object.keys(e).length}if(m(e)&&v(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if(t instanceof Event){const e={};for(const n in t){const o=t[n];Array.isArray(o)?e[n]=w(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}))}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k,R,S,E,N,O={exports:{}},C={exports:{}};function _(){return k||(k=1,C.exports=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function n(e){return function(){return this[e]}}var o=["isConstructor","isEval","isNative","isToplevel"],r=["columnNumber","lineNumber"],i=["fileName","functionName","source"],s=["args"],l=["evalOrigin"],a=o.concat(r,i,s,l);function c(e){if(e)for(var n=0;n<a.length;n++)void 0!==e[a[n]]&&this["set"+t(a[n])](e[a[n]])}c.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 c)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new c(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}},c.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 s=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i,""),l=s[1],a=s[2],d=s[3];return new c({functionName:o,args:r||void 0,fileName:l,lineNumber:a||void 0,columnNumber:d||void 0})};for(var d=0;d<o.length;d++)c.prototype["get"+t(o[d])]=n(o[d]),c.prototype["set"+t(o[d])]=function(e){return function(t){this[e]=Boolean(t)}}(o[d]);for(var u=0;u<r.length;u++)c.prototype["get"+t(r[u])]=n(r[u]),c.prototype["set"+t(r[u])]=function(t){return function(n){if(!e(n))throw new TypeError(t+" must be a Number");this[t]=Number(n)}}(r[u]);for(var h=0;h<i.length;h++)c.prototype["get"+t(i[h])]=n(i[h]),c.prototype["set"+t(i[h])]=function(e){return function(t){this[e]=String(t)}}(i[h]);return c}()),C.exports}O.exports=(R=_(),S=/(^|@)\S+:\d+/,E=/^\s*at .*(\S+:\d+|\(native\))/m,N=/^(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(E))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(E)}),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 R({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(N)}),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 R({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),o=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new R({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 R({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 R({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(S)&&!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 R({functionName:i,args:s,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e})}),this)}});const T=b(O.exports);function x(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=T.parse(r));const s=[y(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=T.parse(new Error),i=r.map((e=>y(e,t.stringifyOptions)));e({type:o,trace:n.slice(1),value:i,time:Date.now()})}catch(i){n("highlight logger error:",i,...r)}})):()=>{}}}var L={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}(L);const I=b(L.exports);function H(e,t,n,o){var r,i,s,l;const a=T.parse(o);t instanceof Error&&(t=t.message);const c=B(a);e({event:I(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 j=e=>{if("undefined"==typeof window)return()=>{};const t=window.onerror=(t,n,o,r,i)=>{H(e,t,n,null!=i?i:Error())},n=window.onunhandledrejection=t=>{var n;if(t.reason){const o=t.promise;o.getStack?H(e,t.reason,t.type,null!=(n=o.getStack())?n:Error()):H(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}},B=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},D=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],P=['["\\"Script error.\\""]','[{"isTrusted":true}]','["{}"]','[""]','["\\"\\""]'],q=["websocket error",'\\"ResizeObserver loop'],A=(e,t,n)=>{const o=U(t,e.headers,n);return c(a({},e),{headers:o})},K=(e,t,n)=>{const o=U(t,e.headers,n);return c(a({},e),{headers:o})},U=(e,t,n)=>{var o,r;const i=a({},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=>{[...W,...e].includes(null==t?void 0:t.toLowerCase())&&(i[t]="[REDACTED]")})),i)},W=["authorization","cookie","proxy-authorization","token"],M=["https://www.googleapis.com/identitytoolkit","https://securetoken.googleapis.com"],z="X-Highlight-Request",F=e=>{let t=e;return e.startsWith("https://")||e.startsWith("http://")||(t=`${window.location.origin}${t}`),t.replace(/\/+$/,"")},V=(e,t,n)=>{e.sort(((e,t)=>e.responseEnd-t.responseEnd));const o=e.reduce(((e,t)=>{const o=F(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 r={};r=t.reduce(((e,t)=>{const n=F(t.request.url);return e[n]=[...e[n]||[],t],e}),r);for(let s in o[n]){const e=o[n][s],t=r[s];if(!t)continue;const i=Math.max(e.length-t.length,0);for(let n=i;n<e.length;n++)e[n]&&(e[n].requestResponsePair=t[n-i])}let i=[];for(let s in o)for(let e in o[s])i=i.concat(o[s][e]);return i.sort(((e,t)=>e.fetchStart-t.fetchStart)).map((e=>(e.toJSON=function(){return{initiatorType:this.initiatorType,startTime:this.startTime,responseEnd:this.responseEnd,name:this.name,transferSize:this.transferSize,encodedBodySize:this.encodedBodySize,requestResponsePairs:this.requestResponsePair}},e)))},$=(e,t,n)=>{return r=t,!((o=e).toLocaleLowerCase().includes("https://pub.highlight.run")||o.toLocaleLowerCase().includes("highlight.run")||o.toLocaleLowerCase().includes(r))||J(e,n);var o,r},J=(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};const G=()=>function(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=n.length,r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*o));return t}(10),X=(e,t)=>e+"/"+t,Y=(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(!$(this._url,t,n))return c.apply(this,arguments);const l=G();J(this._url,n)&&this.setRequestHeader(z,X(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=Q(o,d.url);e&&(d.body=ee(e,i,s,d.headers))}return this.addEventListener("load",(function(){return h(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=Q(o,d.url);e&&(d.body=ee(e,i,s,t.headers))}if(""===this.responseType||"text"===this.responseType)t.body=ee(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=ee(e,i,s,t.headers),t.size=this.response.size}catch(n){}}else try{t.body=ee(this.response,i,s,t.headers)}catch(n){}}e({request:d,response:t,urlBlocked:!a})}))})),this.addEventListener("error",(function(){return h(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}},Q=(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},Z={"application/json":67108864,"text/plain":67108864},ee=(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=Z[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(a){}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(a){}}try{e=e.slice(0,l)}catch(a){}return e},te=(e,t,n,o,r,i,s)=>{const l=window._fetchProxy;return window._fetchProxy=function(a,c){const{method:d,url:u}=ne(a,c);if(!$(u,t,n))return l.call(this,a,c);const h=G();if(J(u,n)){c=c||{};let e=new Headers(c.headers);a instanceof Request&&[...a.headers].forEach((([t,n])=>e.set(t,n))),e.set(z,X(r,h)),c.headers=Object.fromEntries(e.entries())}const p={id:h,headers:{},body:void 0,url:u,verb:d},g=!o.some((e=>u.toLowerCase().includes(e)));g&&(p.headers=Object.fromEntries(new Headers(null==c?void 0:c.headers).entries()),p.body=ee(null==c?void 0:c.body,i,s,null==c?void 0:c.headers));let f=l.call(this,a,c);return oe(f,p,e,g,i,s),f},()=>{window._fetchProxy=l}},ne=(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}},oe=(e,t,n,o,r,i)=>{e.then((e=>h(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=c(a({},s),{body:e.message,status:0,size:void 0}),l=!0;else if("status"in e){if(s=c(a({},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=ee(t,r,i,e.headers)}else t=""}catch(d){t=`Unable to clone response: ${d}`}s.body=t,s.headers=Object.fromEntries(e.headers.entries()),s.size=8*t.length}l=!0}if(l){n({request:t,response:s,urlBlocked:!o})}})))).catch((()=>{}))},re=({xhrCallback:e,fetchCallback:t,webSocketRequestCallback:n,webSocketEventCallback:o,disableWebSocketRecording:r,headersToRedact:i,bodyKeysToRedact:s,backendUrl:l,tracingOrigins:a,urlBlocklist:c,sessionSecureID:u,bodyKeysToRecord:h,headerKeysToRecord:p})=>{const g=Y((t=>{e(ie(t,i,p))}),l,a,c,u,s,h),f=te((e=>{t(ie(e,i,p))}),l,a,c,u,s,h),w=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=d(o,["message","size"]),l=n.some((t=>e.name.toLowerCase().includes(t)));t(l?s:e)},()=>{window._highlightWebSocketRequestCallback=o,window._highlightWebSocketEventCallback=r}})(n,o,c);return()=>{g(),f(),w()}},ie=(e,t,n)=>{var o=e,{request:r,response:i}=o,s=d(o,["request","response"]);return a({request:A(r,t,n),response:K(i,t,n)},s)};class se{constructor(e){var t;u(this,"disableConsoleRecording"),u(this,"reportConsoleErrors"),u(this,"consoleMethodsToRecord"),u(this,"listeners"),u(this,"errors"),u(this,"messages"),u(this,"options"),u(this,"hasNetworkRecording",!0),u(this,"_backendUrl"),u(this,"disableNetworkRecording"),u(this,"enableRecordingNetworkContents"),u(this,"xhrNetworkContents"),u(this,"fetchNetworkContents"),u(this,"disableRecordingWebSocketContents"),u(this,"webSocketNetworkContents"),u(this,"webSocketEventContents"),u(this,"tracingOrigins"),u(this,"networkHeadersToRedact"),u(this,"networkBodyKeysToRedact"),u(this,"networkBodyKeysToRecord"),u(this,"networkHeaderKeysToRecord"),u(this,"urlBlocklist"),this.options=e,this.disableConsoleRecording=!!e.disableConsoleRecording,this.reportConsoleErrors=null!=(t=e.reportConsoleErrors)&&t,this.consoleMethodsToRecord=e.consoleMethodsToRecord||[...D],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(x((t=>{var n,o,r;if(this.reportConsoleErrors&&("Error"===t.type||"error"===t.type)&&t.value&&t.trace){const i=I(t.value);if(P.includes(i)||q.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(j((t=>e.errors.push(t)))),se.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,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,...M],e.networkHeaderKeysToRecord=null==(u=t.networkRecording)?void 0:u.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(re({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,headersToRedact:e.networkHeadersToRedact,bodyKeysToRedact:e.networkBodyKeysToRedact,backendUrl:e._backendUrl,tracingOrigins:e.tracingOrigins,urlBlocklist:e.urlBlocklist,sessionSecureID:t.sessionSecureID,headerKeysToRecord:e.networkHeaderKeysToRecord,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);o=o.filter((t=>$(t.name,e._backendUrl,e.tracingOrigins))).map((e=>c(a({},e.toJSON()),{offsetStartTime:e.startTime-i,offsetResponseEnd:e.responseEnd-i,offsetFetchStart:e.fetchStart-i}))),e.enableRecordingNetworkContents&&(o=V(o,e.xhrNetworkContents,"xmlhttprequest"),o=V(o,e.fetchNetworkContents,"fetch"))}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 le="7.5.0",ae=()=>null;var ce=(e=>(e.Device="Device",e.WebVital="WebVital",e.Frontend="Frontend",e.Backend="Backend",e))(ce||{});const de=(e,t)=>{console.warn(`Highlight Warning: (${e}): `,t)};let ue,he,pe,ge=!1;const fe={options:void 0,init:(e,t)=>{var n,o,r,i,s,l,d,u;try{if(fe.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 w=(()=>{let e=JSON.parse(window.sessionStorage.getItem(g.SESSION_DATA)||"{}");if(e&&e.lastPushTime&&Date.now()-e.lastPushTime<55e3)return e})(),m=(()=>{var e;const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var n="";const o="undefined"!=typeof window&&(null==(e=window.crypto)?void 0:e.getRandomValues),r=new Uint32Array(28);o&&window.crypto.getRandomValues(r);for(let i=0;i<28;i++)n+=t.charAt(o?r[i]%t.length:Math.floor(Math.random()*t.length));return n})();if(null==w?void 0:w.sessionSecureID)m=w.sessionSecureID;else{const t=c(a({},w),{projectID:+e,sessionSecureID:m});window.sessionStorage.setItem(g.SESSION_DATA,JSON.stringify(t))}if(ge)return{sessionSecureID:m};ge=!0,ue=document.createElement("script");var h=(null==t?void 0:t.scriptUrl)?t.scriptUrl:"https://static.highlight.io/v7.5.0/index.js";ue.setAttribute("src",h),ue.setAttribute("type","text/javascript"),document.getElementsByTagName("head")[0].appendChild(ue);const v={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,enableStrictPrivacy:null==t?void 0:t.enableStrictPrivacy,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:le,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:m,storageMode:null==t?void 0:t.storageMode};return pe=new se(v),(null==t?void 0:t.manualStart)||pe.startListening(),ue.addEventListener("load",(()=>{const e=()=>{he=new window.HighlightIO(v,pe),(null==t?void 0:t.manualStart)||he.initialize()};if("HighlightIO"in window)e();else{const t=setInterval((()=>{"HighlightIO"in window&&(e(),clearInterval(t))}),500)}})),!(null==(o=null==(n=null==t?void 0:t.integrations)?void 0:n.mixpanel)?void 0:o.disabled)&&(null==(i=null==(r=null==t?void 0:t.integrations)?void 0:r.mixpanel)?void 0:i.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=f,document.head.appendChild(r),r.addEventListener("load",(()=>{var t;null==(t=window.mixpanel)||t.init(e)}))})(t.integrations.mixpanel),!(null==(l=null==(s=null==t?void 0:t.integrations)?void 0:s.amplitude)?void 0:l.disabled)&&(null==(u=null==(d=null==t?void 0:t.integrations)?void 0:d.amplitude)?void 0:u.apiKey)&&p(t.integrations.amplitude),{sessionSecureID:m}}catch(w){de("init",w)}},snapshot:e=>h(this,null,(function*(){try{fe.onHighlightReady((()=>he.snapshot(e)))}catch(t){de("snapshot",t)}})),addSessionFeedback:({verbatim:e,userName:t,userEmail:n,timestampOverride:o})=>{try{fe.onHighlightReady((()=>he.addSessionFeedback({verbatim:e,timestamp:o||(new Date).toISOString(),user_email:n,user_name:t})))}catch(r){de("error",r)}},consumeError:(e,t,n)=>{try{fe.onHighlightReady((()=>he.consumeCustomError(e,t,JSON.stringify(n))))}catch(o){de("error",o)}},error:(e,t)=>{try{fe.onHighlightReady((()=>he.pushCustomError(e,JSON.stringify(t))))}catch(n){de("error",n)}},track:(e,t={})=>{var n,o,r,i,s,l,d,u,h,p,g;try{fe.onHighlightReady((()=>he.addProperties(c(a({},t),{event:e}))));const f=null==he?void 0:he.getCurrentSessionURL();(null==(r=null==(o=null==(n=fe.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,c(a({},t),{highlightSessionURL:f})),(null==(d=null==(l=null==(s=fe.options)?void 0:s.integrations)?void 0:l.amplitude)?void 0:d.disabled)||(null==(u=window.amplitude)?void 0:u.getInstance)&&window.amplitude.getInstance().logEvent(e,c(a({},t),{highlightSessionURL:f})),(null==(g=null==(p=null==(h=fe.options)?void 0:h.integrations)?void 0:p.intercom)?void 0:g.disabled)||window.Intercom&&window.Intercom("trackEvent",e,t)}catch(f){de("track",f)}},start:e=>{try{if("Recording"===(null==he?void 0:he.state))return void((null==e?void 0:e.silent)||console.warn("Highlight is already recording. Please `H.stop()` the current session before starting a new one."));pe.startListening();var t=setInterval((function(){he&&(clearInterval(t),he.initialize(e))}),200)}catch(n){de("start",n)}},stop:()=>{try{fe.onHighlightReady((()=>he.stopRecording(!0)))}catch(e){de("stop",e)}},identify:(e,t={})=>{var n,o,r,i,s,l,a,c;try{fe.onHighlightReady((()=>he.identify(e,t)))}catch(d){de("identify",d)}if((null==(r=null==(o=null==(n=fe.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=fe.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:e=>{try{fe.onHighlightReady((()=>he.recordMetric(e.map((e=>c(a({},e),{category:"Frontend"}))))))}catch(t){de("metrics",t)}},getSessionURL:()=>new Promise(((e,t)=>{fe.onHighlightReady((()=>{const n=he.getCurrentSessionURL();n?e(n):t(new Error("Unable to get session URL"))}))})),getSessionDetails:()=>new Promise(((e,t)=>{fe.onHighlightReady((()=>{const n=he.getCurrentSessionURL();if(n){const t=he.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=>{try{if(he&&he.ready)e();else var t=setInterval((function(){he&&he.ready&&(clearInterval(t),e())}),200)}catch(n){de("onHighlightReady",n)}}};var we,me;"undefined"!=typeof window&&(window.H=fe),"undefined"!=typeof chrome&&(null==(we=null==chrome?void 0:chrome.runtime)?void 0:we.onMessage)&&(null==(me=null==chrome?void 0:chrome.runtime)||me.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),fe.init(1,{debug:!0,scriptUrl:e}),fe.getSessionURL().then((e=>{n({url:e})}));break}case"stop":fe.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=ae,window._highlightWebSocketEventCallback=ae;const e=new Proxy(window.WebSocket,{construct(e,t){const n=G(),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=fe,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.MetricCategory=ce,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"})}));
!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=Object.defineProperty,n=Object.defineProperties,o=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,l=(e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,a=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&l(e,n,t[n]);if(r)for(var n of r(t))s.call(t,n)&&l(e,n,t[n]);return e},c=(e,t)=>n(e,o(t)),d=(e,t)=>{var n={};for(var o in e)i.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&r)for(var o of r(e))t.indexOf(o)<0&&s.call(e,o)&&(n[o]=e[o]);return n},u=(e,t,n)=>(l(e,"symbol"!=typeof t?t+"":t,n),n),h=(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())}));const p=({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"],h=0;h<u.length;h++)s(d,u[h]);o.Revenue=d;var p=["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<p.length;n++)t(p[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 g=(e=>(e.RECORDING_START_TIME="highlightRecordingStartTime",e.SEGMENT_LAST_SENT_HASH_KEY="HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY",e.SESSION_DATA="sessionData",e.SESSION_SECURE_ID="sessionSecureID",e.USER_IDENTIFIER="highlightIdentifier",e.USER_OBJECT="highlightUserObject",e.PAYLOAD_ID="payloadId",e))(g||{});const f="https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";function w(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 m(e){return"[object Object]"===Object.prototype.toString.call(e)}function v(e,t){if(0===t)return!0;const n=Object.keys(e);for(const o of n)if(m(e[o])&&v(e[o],t-1))return!0;return!1}function y(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(function(e){if(m(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(e instanceof Event&&!1===e.isTrusted){return 1===Object.keys(e).length}if(m(e)&&v(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if(t instanceof Event){const e={};for(const n in t){const o=t[n];Array.isArray(o)?e[n]=w(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}))}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k,R,S,E,N,O={exports:{}},C={exports:{}};function _(){return k||(k=1,C.exports=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function n(e){return function(){return this[e]}}var o=["isConstructor","isEval","isNative","isToplevel"],r=["columnNumber","lineNumber"],i=["fileName","functionName","source"],s=["args"],l=["evalOrigin"],a=o.concat(r,i,s,l);function c(e){if(e)for(var n=0;n<a.length;n++)void 0!==e[a[n]]&&this["set"+t(a[n])](e[a[n]])}c.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 c)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new c(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}},c.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 s=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i,""),l=s[1],a=s[2],d=s[3];return new c({functionName:o,args:r||void 0,fileName:l,lineNumber:a||void 0,columnNumber:d||void 0})};for(var d=0;d<o.length;d++)c.prototype["get"+t(o[d])]=n(o[d]),c.prototype["set"+t(o[d])]=function(e){return function(t){this[e]=Boolean(t)}}(o[d]);for(var u=0;u<r.length;u++)c.prototype["get"+t(r[u])]=n(r[u]),c.prototype["set"+t(r[u])]=function(t){return function(n){if(!e(n))throw new TypeError(t+" must be a Number");this[t]=Number(n)}}(r[u]);for(var h=0;h<i.length;h++)c.prototype["get"+t(i[h])]=n(i[h]),c.prototype["set"+t(i[h])]=function(e){return function(t){this[e]=String(t)}}(i[h]);return c}()),C.exports}O.exports=(R=_(),S=/(^|@)\S+:\d+/,E=/^\s*at .*(\S+:\d+|\(native\))/m,N=/^(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(E))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(E)}),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 R({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(N)}),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 R({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),o=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new R({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 R({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 R({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(S)&&!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 R({functionName:i,args:s,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e})}),this)}});const T=b(O.exports);function x(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=T.parse(r));const s=[y(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=T.parse(new Error),i=r.map((e=>y(e,t.stringifyOptions)));e({type:o,trace:n.slice(1),value:i,time:Date.now()})}catch(i){n("highlight logger error:",i,...r)}})):()=>{}}}var L={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}(L);const I=b(L.exports);function H(e,t,n,o){var r,i,s,l;const a=T.parse(o);t instanceof Error&&(t=t.message);const c=B(a);e({event:I(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 j=e=>{if("undefined"==typeof window)return()=>{};const t=window.onerror=(t,n,o,r,i)=>{H(e,t,n,null!=i?i:Error())},n=window.onunhandledrejection=t=>{var n;if(t.reason){const o=t.promise;o.getStack?H(e,t.reason,t.type,null!=(n=o.getStack())?n:Error()):H(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}},B=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},D=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],P=['["\\"Script error.\\""]','[{"isTrusted":true}]','["{}"]','[""]','["\\"\\""]'],q=["websocket error",'\\"ResizeObserver loop'],A=(e,t,n)=>{const o=U(t,e.headers,n);return c(a({},e),{headers:o})},K=(e,t,n)=>{const o=U(t,e.headers,n);return c(a({},e),{headers:o})},U=(e,t,n)=>{var o,r;const i=a({},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=>{[...W,...e].includes(null==t?void 0:t.toLowerCase())&&(i[t]="[REDACTED]")})),i)},W=["authorization","cookie","proxy-authorization","token"],M=["https://www.googleapis.com/identitytoolkit","https://securetoken.googleapis.com"],z="X-Highlight-Request",F=e=>{let t=e;return e.startsWith("https://")||e.startsWith("http://")||(t=`${window.location.origin}${t}`),t.replace(/\/+$/,"")},V=(e,t,n)=>{e.sort(((e,t)=>e.responseEnd-t.responseEnd));const o=e.reduce(((e,t)=>{const o=F(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 r={};r=t.reduce(((e,t)=>{const n=F(t.request.url);return e[n]=[...e[n]||[],t],e}),r);for(let s in o[n]){const e=o[n][s],t=r[s];if(!t)continue;const i=Math.max(e.length-t.length,0);for(let n=i;n<e.length;n++)e[n]&&(e[n].requestResponsePair=t[n-i])}let i=[];for(let s in o)for(let e in o[s])i=i.concat(o[s][e]);return i.sort(((e,t)=>e.fetchStart-t.fetchStart)).map((e=>(e.toJSON=function(){return{initiatorType:this.initiatorType,startTime:this.startTime,responseEnd:this.responseEnd,name:this.name,transferSize:this.transferSize,encodedBodySize:this.encodedBodySize,requestResponsePairs:this.requestResponsePair}},e)))},$=(e,t,n)=>{return r=t,!((o=e).toLocaleLowerCase().includes("https://pub.highlight.run")||o.toLocaleLowerCase().includes("highlight.run")||o.toLocaleLowerCase().includes(r))||J(e,n);var o,r},J=(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};const G=()=>function(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=n.length,r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*o));return t}(10),X=(e,t)=>e+"/"+t,Y=(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(!$(this._url,t,n))return c.apply(this,arguments);const l=G();J(this._url,n)&&this.setRequestHeader(z,X(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=Q(o,d.url);e&&(d.body=ee(e,i,s,d.headers))}return this.addEventListener("load",(function(){return h(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=Q(o,d.url);e&&(d.body=ee(e,i,s,t.headers))}if(""===this.responseType||"text"===this.responseType)t.body=ee(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=ee(e,i,s,t.headers),t.size=this.response.size}catch(n){}}else try{t.body=ee(this.response,i,s,t.headers)}catch(n){}}e({request:d,response:t,urlBlocked:!a})}))})),this.addEventListener("error",(function(){return h(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}},Q=(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},Z={"application/json":67108864,"text/plain":67108864},ee=(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=Z[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(a){}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(a){}}try{e=e.slice(0,l)}catch(a){}return e},te=(e,t,n,o,r,i,s)=>{const l=window._fetchProxy;return window._fetchProxy=function(a,c){const{method:d,url:u}=ne(a,c);if(!$(u,t,n))return l.call(this,a,c);const h=G();if(J(u,n)){c=c||{};let e=new Headers(c.headers);a instanceof Request&&[...a.headers].forEach((([t,n])=>e.set(t,n))),e.set(z,X(r,h)),c.headers=Object.fromEntries(e.entries())}const p={id:h,headers:{},body:void 0,url:u,verb:d},g=!o.some((e=>u.toLowerCase().includes(e)));g&&(p.headers=Object.fromEntries(new Headers(null==c?void 0:c.headers).entries()),p.body=ee(null==c?void 0:c.body,i,s,null==c?void 0:c.headers));let f=l.call(this,a,c);return oe(f,p,e,g,i,s),f},()=>{window._fetchProxy=l}},ne=(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}},oe=(e,t,n,o,r,i)=>{e.then((e=>h(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=c(a({},s),{body:e.message,status:0,size:void 0}),l=!0;else if("status"in e){if(s=c(a({},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=ee(t,r,i,e.headers)}else t=""}catch(d){t=`Unable to clone response: ${d}`}s.body=t,s.headers=Object.fromEntries(e.headers.entries()),s.size=8*t.length}l=!0}if(l){n({request:t,response:s,urlBlocked:!o})}})))).catch((()=>{}))},re=({xhrCallback:e,fetchCallback:t,webSocketRequestCallback:n,webSocketEventCallback:o,disableWebSocketRecording:r,headersToRedact:i,bodyKeysToRedact:s,backendUrl:l,tracingOrigins:a,urlBlocklist:c,sessionSecureID:u,bodyKeysToRecord:h,headerKeysToRecord:p})=>{const g=Y((t=>{e(ie(t,i,p))}),l,a,c,u,s,h),f=te((e=>{t(ie(e,i,p))}),l,a,c,u,s,h),w=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=d(o,["message","size"]),l=n.some((t=>e.name.toLowerCase().includes(t)));t(l?s:e)},()=>{window._highlightWebSocketRequestCallback=o,window._highlightWebSocketEventCallback=r}})(n,o,c);return()=>{g(),f(),w()}},ie=(e,t,n)=>{var o=e,{request:r,response:i}=o,s=d(o,["request","response"]);return a({request:A(r,t,n),response:K(i,t,n)},s)};class se{constructor(e){var t;u(this,"disableConsoleRecording"),u(this,"reportConsoleErrors"),u(this,"consoleMethodsToRecord"),u(this,"listeners"),u(this,"errors"),u(this,"messages"),u(this,"options"),u(this,"hasNetworkRecording",!0),u(this,"_backendUrl"),u(this,"disableNetworkRecording"),u(this,"enableRecordingNetworkContents"),u(this,"xhrNetworkContents"),u(this,"fetchNetworkContents"),u(this,"disableRecordingWebSocketContents"),u(this,"webSocketNetworkContents"),u(this,"webSocketEventContents"),u(this,"tracingOrigins"),u(this,"networkHeadersToRedact"),u(this,"networkBodyKeysToRedact"),u(this,"networkBodyKeysToRecord"),u(this,"networkHeaderKeysToRecord"),u(this,"urlBlocklist"),this.options=e,this.disableConsoleRecording=!!e.disableConsoleRecording,this.reportConsoleErrors=null!=(t=e.reportConsoleErrors)&&t,this.consoleMethodsToRecord=e.consoleMethodsToRecord||[...D],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(x((t=>{var n,o,r;if(this.reportConsoleErrors&&("Error"===t.type||"error"===t.type)&&t.value&&t.trace){const i=I(t.value);if(P.includes(i)||q.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(j((t=>e.errors.push(t)))),se.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,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,...M],e.networkHeaderKeysToRecord=null==(u=t.networkRecording)?void 0:u.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(re({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,headersToRedact:e.networkHeadersToRedact,bodyKeysToRedact:e.networkBodyKeysToRedact,backendUrl:e._backendUrl,tracingOrigins:e.tracingOrigins,urlBlocklist:e.urlBlocklist,sessionSecureID:t.sessionSecureID,headerKeysToRecord:e.networkHeaderKeysToRecord,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);o=o.filter((t=>$(t.name,e._backendUrl,e.tracingOrigins))).map((e=>c(a({},e.toJSON()),{offsetStartTime:e.startTime-i,offsetResponseEnd:e.responseEnd-i,offsetFetchStart:e.fetchStart-i}))),e.enableRecordingNetworkContents&&(o=V(o,e.xhrNetworkContents,"xmlhttprequest"),o=V(o,e.fetchNetworkContents,"fetch"))}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 le="7.5.1",ae=()=>null;var ce=(e=>(e.Device="Device",e.WebVital="WebVital",e.Frontend="Frontend",e.Backend="Backend",e))(ce||{});const de=(e,t)=>{console.warn(`Highlight Warning: (${e}): `,t)};let ue,he,pe,ge=!1;const fe={options:void 0,init:(e,t)=>{var n,o,r,i,s,l,d,u;try{if(fe.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 w=(()=>{let e=JSON.parse(window.sessionStorage.getItem(g.SESSION_DATA)||"{}");if(e&&e.lastPushTime&&Date.now()-e.lastPushTime<55e3)return e})(),m=(()=>{var e;const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var n="";const o="undefined"!=typeof window&&(null==(e=window.crypto)?void 0:e.getRandomValues),r=new Uint32Array(28);o&&window.crypto.getRandomValues(r);for(let i=0;i<28;i++)n+=t.charAt(o?r[i]%t.length:Math.floor(Math.random()*t.length));return n})();if(null==w?void 0:w.sessionSecureID)m=w.sessionSecureID;else{const t=c(a({},w),{projectID:+e,sessionSecureID:m});window.sessionStorage.setItem(g.SESSION_DATA,JSON.stringify(t))}if(ge)return{sessionSecureID:m};ge=!0,ue=document.createElement("script");var h=(null==t?void 0:t.scriptUrl)?t.scriptUrl:"https://static.highlight.io/v7.5.1/index.js";ue.setAttribute("src",h),ue.setAttribute("type","text/javascript"),document.getElementsByTagName("head")[0].appendChild(ue);const v={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,enableStrictPrivacy:null==t?void 0:t.enableStrictPrivacy,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:le,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:m,storageMode:null==t?void 0:t.storageMode};return pe=new se(v),(null==t?void 0:t.manualStart)||pe.startListening(),ue.addEventListener("load",(()=>{const e=()=>{he=new window.HighlightIO(v,pe),(null==t?void 0:t.manualStart)||he.initialize()};if("HighlightIO"in window)e();else{const t=setInterval((()=>{"HighlightIO"in window&&(e(),clearInterval(t))}),500)}})),!(null==(o=null==(n=null==t?void 0:t.integrations)?void 0:n.mixpanel)?void 0:o.disabled)&&(null==(i=null==(r=null==t?void 0:t.integrations)?void 0:r.mixpanel)?void 0:i.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=f,document.head.appendChild(r),r.addEventListener("load",(()=>{var t;null==(t=window.mixpanel)||t.init(e)}))})(t.integrations.mixpanel),!(null==(l=null==(s=null==t?void 0:t.integrations)?void 0:s.amplitude)?void 0:l.disabled)&&(null==(u=null==(d=null==t?void 0:t.integrations)?void 0:d.amplitude)?void 0:u.apiKey)&&p(t.integrations.amplitude),{sessionSecureID:m}}catch(w){de("init",w)}},snapshot:e=>h(this,null,(function*(){try{fe.onHighlightReady((()=>he.snapshot(e)))}catch(t){de("snapshot",t)}})),addSessionFeedback:({verbatim:e,userName:t,userEmail:n,timestampOverride:o})=>{try{fe.onHighlightReady((()=>he.addSessionFeedback({verbatim:e,timestamp:o||(new Date).toISOString(),user_email:n,user_name:t})))}catch(r){de("error",r)}},consumeError:(e,t,n)=>{try{fe.onHighlightReady((()=>he.consumeCustomError(e,t,JSON.stringify(n))))}catch(o){de("error",o)}},error:(e,t)=>{try{fe.onHighlightReady((()=>he.pushCustomError(e,JSON.stringify(t))))}catch(n){de("error",n)}},track:(e,t={})=>{var n,o,r,i,s,l,d,u,h,p,g;try{fe.onHighlightReady((()=>he.addProperties(c(a({},t),{event:e}))));const f=null==he?void 0:he.getCurrentSessionURL();(null==(r=null==(o=null==(n=fe.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,c(a({},t),{highlightSessionURL:f})),(null==(d=null==(l=null==(s=fe.options)?void 0:s.integrations)?void 0:l.amplitude)?void 0:d.disabled)||(null==(u=window.amplitude)?void 0:u.getInstance)&&window.amplitude.getInstance().logEvent(e,c(a({},t),{highlightSessionURL:f})),(null==(g=null==(p=null==(h=fe.options)?void 0:h.integrations)?void 0:p.intercom)?void 0:g.disabled)||window.Intercom&&window.Intercom("trackEvent",e,t)}catch(f){de("track",f)}},start:e=>{try{if("Recording"===(null==he?void 0:he.state))return void((null==e?void 0:e.silent)||console.warn("Highlight is already recording. Please `H.stop()` the current session before starting a new one."));pe.startListening();var t=setInterval((function(){he&&(clearInterval(t),he.initialize(e))}),200)}catch(n){de("start",n)}},stop:()=>{try{fe.onHighlightReady((()=>he.stopRecording(!0)))}catch(e){de("stop",e)}},identify:(e,t={})=>{var n,o,r,i,s,l,a,c;try{fe.onHighlightReady((()=>he.identify(e,t)))}catch(d){de("identify",d)}if((null==(r=null==(o=null==(n=fe.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=fe.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:e=>{try{fe.onHighlightReady((()=>he.recordMetric(e.map((e=>c(a({},e),{category:"Frontend"}))))))}catch(t){de("metrics",t)}},getSessionURL:()=>new Promise(((e,t)=>{fe.onHighlightReady((()=>{const n=he.getCurrentSessionURL();n?e(n):t(new Error("Unable to get session URL"))}))})),getSessionDetails:()=>new Promise(((e,t)=>{fe.onHighlightReady((()=>{const n=he.getCurrentSessionURL();if(n){const t=he.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=>{try{if(he&&he.ready)e();else var t=setInterval((function(){he&&he.ready&&(clearInterval(t),e())}),200)}catch(n){de("onHighlightReady",n)}}};var we,me;"undefined"!=typeof window&&(window.H=fe),"undefined"!=typeof chrome&&(null==(we=null==chrome?void 0:chrome.runtime)?void 0:we.onMessage)&&(null==(me=null==chrome?void 0:chrome.runtime)||me.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),fe.init(1,{debug:!0,scriptUrl:e}),fe.getSessionURL().then((e=>{n({url:e})}));break}case"stop":fe.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=ae,window._highlightWebSocketEventCallback=ae;const e=new Proxy(window.WebSocket,{construct(e,t){const n=G(),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=fe,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.MetricCategory=ce,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": "7.5.0",
"version": "7.5.1",
"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 too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc