diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 885c5f10..50664f7c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -5,7 +5,7 @@ on:
 jobs:
 
   build-test:
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-latest
     env:
       KEYMANHOSTS_TIER: TIER_TEST
 
diff --git a/.gitignore b/.gitignore
index 7da54e4a..2775cf5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ vendor*
 # Shared files are bootstrapped:
 resources/bootstrap.inc.sh
 resources/.bootstrap-version
+resources/.bootstrap-registry
 _common/
 
 # State files
diff --git a/_includes/2020/KeymanComSentry.php b/_includes/2020/KeymanComSentry.php
index 9b1a8f4b..2646adbe 100644
--- a/_includes/2020/KeymanComSentry.php
+++ b/_includes/2020/KeymanComSentry.php
@@ -5,10 +5,15 @@
 
   use Keyman\Site\Common\KeymanSentry;
 
+  require_once(__DIR__ . '/../../_common/KeymanSentry.php');
+
   const SENTRY_DSN = 'https://44d5544d7c45466ba1928b9196faf67e@o1005580.ingest.sentry.io/5983516';
 
   class KeymanComSentry {
     static function init() {
       KeymanSentry::Init(SENTRY_DSN);
     }
+    static function GetBrowserHTML() {
+      return KeymanSentry::GetBrowserHTML(SENTRY_DSN);
+    }
   }
\ No newline at end of file
diff --git a/_includes/2020/templates/Head.php b/_includes/2020/templates/Head.php
index 3acf0a36..53e0bd70 100644
--- a/_includes/2020/templates/Head.php
+++ b/_includes/2020/templates/Head.php
@@ -4,8 +4,14 @@
   namespace Keyman\Site\com\keyman\templates;
 
 use Keyman\Site\com\keyman\Util;
+use Keyman\Site\com\keyman\KeymanComSentry;
 use Keyman\Site\Common\KeymanHosts;
 
+// *Don't* use autoloader here because of potential side-effects in older pages
+require_once(__DIR__ . '/../Util.php');
+require_once(__DIR__ . '/../KeymanComSentry.php');
+require_once(__DIR__ . '/../../../_common/KeymanHosts.php');
+
 class Head {
     static function render($fields = []) {
       $fields = (object)$fields;
@@ -44,31 +50,7 @@ static function render($fields = []) {
   }
 ?>
   <title><?= $fields->title; ?></title>
-  <script
-    src="https://js.sentry-cdn.com/bba22972ad6b4c2ab03a056f549cc23d.min.js"
-    crossorigin="anonymous"
-  ></script>
-  <script
-    src="https://browser.sentry-cdn.com/9.1.0/bundle.tracing.min.js"
-    integrity="sha384-MCeGoX8VPkitB3OcF9YprViry6xHPhBleDzXdwCqUvHJdrf7g0DjOGvrhIzpsyKp"
-    crossorigin="anonymous"
-  ></script>
-  <script
-    src="https://browser.sentry-cdn.com/9.1.0/captureconsole.min.js"
-    integrity="sha384-gkHY/HxnL+vrTN/Dn6S9siimRwqogMXpX4AetFSsf6X2LMQFsuXQGvIw7h2qWCt+"
-    crossorigin="anonymous"
-  ></script>
-  <script
-    src="https://browser.sentry-cdn.com/9.1.0/httpclient.min.js"
-    integrity="sha384-ZsomH91NyAZy+YSYhJcpL3sSDFlkL310CJnpKNqL9KerB92RvfsH9tXRa2youKLM"
-    crossorigin="anonymous"
-  ></script>
-  <script>
-    const sentryEnvironment = {
-      tier: '<?=KeymanHosts::Instance()->TierName()?>',
-    }
-  </script>
-  <script src="<?= Util::cdn('js/sentry.js'); ?>"></script>
+  <?= KeymanComSentry::GetBrowserHtml(); ?>
   <meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" name="viewport">
   <link rel='shortcut icon' href="<?= $fields->favicon; ?>">
   <?php foreach($fields->css as $cssFile) { ?>
diff --git a/_includes/includes/servervars.php b/_includes/includes/servervars.php
index d1d4a80f..bf5e011b 100644
--- a/_includes/includes/servervars.php
+++ b/_includes/includes/servervars.php
@@ -17,7 +17,6 @@
 */
 
   require_once __DIR__ . '/../../vendor/autoload.php';
-  require_once __DIR__ . '/../../_common/KeymanSentry.php';
   require_once __DIR__ . '/../2020/KeymanComSentry.php';
   Keyman\Site\com\keyman\KeymanComSentry::init();
 
diff --git a/build.sh b/build.sh
index a262b5ff..7cd0acdc 100755
--- a/build.sh
+++ b/build.sh
@@ -2,8 +2,8 @@
 ## START STANDARD SITE BUILD SCRIPT INCLUDE
 readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
 readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh"
-readonly BOOTSTRAP_VERSION=v0.18
-[ -f "$BOOTSTRAP" ] && source "$BOOTSTRAP" || source <(curl -fs https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh)
+readonly BOOTSTRAP_VERSION=v0.20
+[ -f "$BOOTSTRAP" ] && source "$BOOTSTRAP" || source <(curl -H "Cache-Control: no-cache" -fs https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh)
 ## END STANDARD SITE BUILD SCRIPT INCLUDE
 
 readonly KEYMAN_CONTAINER_NAME=keyman-website
diff --git a/cdn/dev/img/android-kmp.png b/cdn/dev/img/android-kmp.png
index 7c9828d7..a4f32171 100644
Binary files a/cdn/dev/img/android-kmp.png and b/cdn/dev/img/android-kmp.png differ
diff --git a/cdn/dev/js/bundle.min.js.map b/cdn/dev/js/bundle.min.js.map
deleted file mode 100644
index 9aedca03..00000000
--- a/cdn/dev/js/bundle.min.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"bundle.min.js","sources":["../../types/src/loglevel.ts","../../types/src/session.ts","../../types/src/severity.ts","../../types/src/status.ts","../../utils/src/is.ts","../../utils/src/browser.ts","../../utils/src/polyfill.ts","../../utils/src/error.ts","../../utils/src/dsn.ts","../../utils/src/memo.ts","../../utils/src/stacktrace.ts","../../utils/src/string.ts","../../utils/src/object.ts","../../utils/src/node.ts","../../utils/src/misc.ts","../../utils/src/logger.ts","../../utils/src/supports.ts","../../utils/src/instrument.ts","../../utils/src/syncpromise.ts","../../utils/src/promisebuffer.ts","../../utils/src/time.ts","../../hub/src/scope.ts","../../hub/src/session.ts","../../hub/src/hub.ts","../../minimal/src/index.ts","../../core/src/api.ts","../../core/src/integration.ts","../../core/src/baseclient.ts","../../core/src/integrations/functiontostring.ts","../../core/src/transports/noop.ts","../../core/src/basebackend.ts","../../core/src/request.ts","../../core/src/integrations/inboundfilters.ts","../src/tracekit.ts","../src/parsers.ts","../src/eventbuilder.ts","../src/transports/base.ts","../src/transports/fetch.ts","../src/transports/xhr.ts","../src/backend.ts","../src/helpers.ts","../src/integrations/globalhandlers.ts","../src/integrations/trycatch.ts","../src/integrations/breadcrumbs.ts","../src/integrations/linkederrors.ts","../src/integrations/useragent.ts","../src/version.ts","../src/client.ts","../src/sdk.ts","../src/index.ts","../../core/src/sdk.ts"],"sourcesContent":["/** Console logging verbosity for the SDK. */\nexport enum LogLevel {\n  /** No logs will be generated. */\n  None = 0,\n  /** Only SDK internal errors will be logged. */\n  Error = 1,\n  /** Information useful for debugging the SDK will be logged. */\n  Debug = 2,\n  /** All SDK actions will be logged. */\n  Verbose = 3,\n}\n","import { User } from './user';\n\n/**\n * @inheritdoc\n */\nexport interface Session extends SessionContext {\n  /** JSDoc */\n  update(context?: SessionContext): void;\n\n  /** JSDoc */\n  close(status?: SessionStatus): void;\n\n  /** JSDoc */\n  toJSON(): {\n    init: boolean;\n    sid: string;\n    did?: string;\n    timestamp: string;\n    started: string;\n    duration: number;\n    status: SessionStatus;\n    errors: number;\n    attrs?: {\n      release?: string;\n      environment?: string;\n      user_agent?: string;\n      ip_address?: string;\n    };\n  };\n}\n\n/**\n * Session Context\n */\nexport interface SessionContext {\n  sid?: string;\n  did?: string;\n  timestamp?: number;\n  started?: number;\n  duration?: number;\n  status?: SessionStatus;\n  release?: string;\n  environment?: string;\n  userAgent?: string;\n  ipAddress?: string;\n  errors?: number;\n  user?: User | null;\n}\n\n/**\n * Session Status\n */\nexport enum SessionStatus {\n  /** JSDoc */\n  Ok = 'ok',\n  /** JSDoc */\n  Exited = 'exited',\n  /** JSDoc */\n  Crashed = 'crashed',\n  /** JSDoc */\n  Abnormal = 'abnormal',\n}\n","/** JSDoc */\n// eslint-disable-next-line import/export\nexport enum Severity {\n  /** JSDoc */\n  Fatal = 'fatal',\n  /** JSDoc */\n  Error = 'error',\n  /** JSDoc */\n  Warning = 'warning',\n  /** JSDoc */\n  Log = 'log',\n  /** JSDoc */\n  Info = 'info',\n  /** JSDoc */\n  Debug = 'debug',\n  /** JSDoc */\n  Critical = 'critical',\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace, import/export\nexport namespace Severity {\n  /**\n   * Converts a string-based level into a {@link Severity}.\n   *\n   * @param level string representation of Severity\n   * @returns Severity\n   */\n  export function fromString(level: string): Severity {\n    switch (level) {\n      case 'debug':\n        return Severity.Debug;\n      case 'info':\n        return Severity.Info;\n      case 'warn':\n      case 'warning':\n        return Severity.Warning;\n      case 'error':\n        return Severity.Error;\n      case 'fatal':\n        return Severity.Fatal;\n      case 'critical':\n        return Severity.Critical;\n      case 'log':\n      default:\n        return Severity.Log;\n    }\n  }\n}\n","/** The status of an event. */\n// eslint-disable-next-line import/export\nexport enum Status {\n  /** The status could not be determined. */\n  Unknown = 'unknown',\n  /** The event was skipped due to configuration or callbacks. */\n  Skipped = 'skipped',\n  /** The event was sent to Sentry successfully. */\n  Success = 'success',\n  /** The client is currently rate limited and will try again later. */\n  RateLimit = 'rate_limit',\n  /** The event could not be processed. */\n  Invalid = 'invalid',\n  /** A server-side error ocurred during submission. */\n  Failed = 'failed',\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace, import/export\nexport namespace Status {\n  /**\n   * Converts a HTTP status code into a {@link Status}.\n   *\n   * @param code The HTTP response status code.\n   * @returns The send status or {@link Status.Unknown}.\n   */\n  export function fromHttpCode(code: number): Status {\n    if (code >= 200 && code < 300) {\n      return Status.Success;\n    }\n\n    if (code === 429) {\n      return Status.RateLimit;\n    }\n\n    if (code >= 400 && code < 500) {\n      return Status.Invalid;\n    }\n\n    if (code >= 500) {\n      return Status.Failed;\n    }\n\n    return Status.Unknown;\n  }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: any): boolean {\n  switch (Object.prototype.toString.call(wat)) {\n    case '[object Error]':\n      return true;\n    case '[object Exception]':\n      return true;\n    case '[object DOMException]':\n      return true;\n    default:\n      return isInstanceOf(wat, Error);\n  }\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: any): boolean {\n  return Object.prototype.toString.call(wat) === '[object ErrorEvent]';\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: any): boolean {\n  return Object.prototype.toString.call(wat) === '[object DOMError]';\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: any): boolean {\n  return Object.prototype.toString.call(wat) === '[object DOMException]';\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: any): boolean {\n  return Object.prototype.toString.call(wat) === '[object String]';\n}\n\n/**\n * Checks whether given value's is a primitive (undefined, null, number, boolean, string)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: any): boolean {\n  return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: any): boolean {\n  return Object.prototype.toString.call(wat) === '[object Object]';\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: any): boolean {\n  return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: any): boolean {\n  return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: any): boolean {\n  return Object.prototype.toString.call(wat) === '[object RegExp]';\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): boolean {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: any): boolean {\n  return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n  try {\n    return wat instanceof base;\n  } catch (_e) {\n    return false;\n  }\n}\n","import { isString } from './is';\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(elem: unknown): string {\n  type SimpleNode = {\n    parentNode: SimpleNode;\n  } | null;\n\n  // try/catch both:\n  // - accessing event.target (see getsentry/raven-js#838, #768)\n  // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n  // - can throw an exception in some circumstances.\n  try {\n    let currentElem = elem as SimpleNode;\n    const MAX_TRAVERSE_HEIGHT = 5;\n    const MAX_OUTPUT_LEN = 80;\n    const out = [];\n    let height = 0;\n    let len = 0;\n    const separator = ' > ';\n    const sepLength = separator.length;\n    let nextStr;\n\n    // eslint-disable-next-line no-plusplus\n    while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n      nextStr = _htmlElementAsString(currentElem);\n      // bail out if\n      // - nextStr is the 'html' element\n      // - the length of the string that would be created exceeds MAX_OUTPUT_LEN\n      //   (ignore this limit if we are on the first iteration)\n      if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n        break;\n      }\n\n      out.push(nextStr);\n\n      len += nextStr.length;\n      currentElem = currentElem.parentNode;\n    }\n\n    return out.reverse().join(separator);\n  } catch (_oO) {\n    return '<unknown>';\n  }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown): string {\n  const elem = el as {\n    tagName?: string;\n    id?: string;\n    className?: string;\n    getAttribute(key: string): string;\n  };\n\n  const out = [];\n  let className;\n  let classes;\n  let key;\n  let attr;\n  let i;\n\n  if (!elem || !elem.tagName) {\n    return '';\n  }\n\n  out.push(elem.tagName.toLowerCase());\n  if (elem.id) {\n    out.push(`#${elem.id}`);\n  }\n\n  // eslint-disable-next-line prefer-const\n  className = elem.className;\n  if (className && isString(className)) {\n    classes = className.split(/\\s+/);\n    for (i = 0; i < classes.length; i++) {\n      out.push(`.${classes[i]}`);\n    }\n  }\n  const allowedAttrs = ['type', 'name', 'title', 'alt'];\n  for (i = 0; i < allowedAttrs.length; i++) {\n    key = allowedAttrs[i];\n    attr = elem.getAttribute(key);\n    if (attr) {\n      out.push(`[${key}=\"${attr}\"]`);\n    }\n  }\n  return out.join('');\n}\n","export const setPrototypeOf =\n  Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties);\n\n/**\n * setPrototypeOf polyfill using __proto__\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction setProtoOf<TTarget extends object, TProto>(obj: TTarget, proto: TProto): TTarget & TProto {\n  // @ts-ignore __proto__ does not exist on obj\n  obj.__proto__ = proto;\n  return obj as TTarget & TProto;\n}\n\n/**\n * setPrototypeOf polyfill using mixin\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction mixinProperties<TTarget extends object, TProto>(obj: TTarget, proto: TProto): TTarget & TProto {\n  for (const prop in proto) {\n    // eslint-disable-next-line no-prototype-builtins\n    if (!obj.hasOwnProperty(prop)) {\n      // @ts-ignore typescript complains about indexing so we remove\n      obj[prop] = proto[prop];\n    }\n  }\n\n  return obj as TTarget & TProto;\n}\n","import { setPrototypeOf } from './polyfill';\n\n/** An error emitted by Sentry SDKs and related utilities. */\nexport class SentryError extends Error {\n  /** Display name of this error instance. */\n  public name: string;\n\n  public constructor(public message: string) {\n    super(message);\n\n    this.name = new.target.prototype.constructor.name;\n    setPrototypeOf(this, new.target.prototype);\n  }\n}\n","import { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types';\n\nimport { SentryError } from './error';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+))?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\n/** Error message */\nconst ERROR_MESSAGE = 'Invalid Dsn';\n\n/** The Sentry Dsn, identifying a Sentry instance and project. */\nexport class Dsn implements DsnComponents {\n  /** Protocol used to connect to Sentry. */\n  public protocol!: DsnProtocol;\n  /** Public authorization key. */\n  public user!: string;\n  /** Private authorization key (deprecated, optional). */\n  public pass!: string;\n  /** Hostname of the Sentry instance. */\n  public host!: string;\n  /** Port of the Sentry instance. */\n  public port!: string;\n  /** Path */\n  public path!: string;\n  /** Project ID */\n  public projectId!: string;\n\n  /** Creates a new Dsn component */\n  public constructor(from: DsnLike) {\n    if (typeof from === 'string') {\n      this._fromString(from);\n    } else {\n      this._fromComponents(from);\n    }\n\n    this._validate();\n  }\n\n  /**\n   * Renders the string representation of this Dsn.\n   *\n   * By default, this will render the public representation without the password\n   * component. To get the deprecated private representation, set `withPassword`\n   * to true.\n   *\n   * @param withPassword When set to true, the password will be included.\n   */\n  public toString(withPassword: boolean = false): string {\n    const { host, path, pass, port, projectId, protocol, user } = this;\n    return (\n      `${protocol}://${user}${withPassword && pass ? `:${pass}` : ''}` +\n      `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n    );\n  }\n\n  /** Parses a string into this Dsn. */\n  private _fromString(str: string): void {\n    const match = DSN_REGEX.exec(str);\n\n    if (!match) {\n      throw new SentryError(ERROR_MESSAGE);\n    }\n\n    const [protocol, user, pass = '', host, port = '', lastPath] = match.slice(1);\n    let path = '';\n    let projectId = lastPath;\n\n    const split = projectId.split('/');\n    if (split.length > 1) {\n      path = split.slice(0, -1).join('/');\n      projectId = split.pop() as string;\n    }\n\n    if (projectId) {\n      const projectMatch = projectId.match(/^\\d+/);\n      if (projectMatch) {\n        projectId = projectMatch[0];\n      }\n    }\n\n    this._fromComponents({ host, pass, path, projectId, port, protocol: protocol as DsnProtocol, user });\n  }\n\n  /** Maps Dsn components into this instance. */\n  private _fromComponents(components: DsnComponents): void {\n    this.protocol = components.protocol;\n    this.user = components.user;\n    this.pass = components.pass || '';\n    this.host = components.host;\n    this.port = components.port || '';\n    this.path = components.path || '';\n    this.projectId = components.projectId;\n  }\n\n  /** Validates this Dsn and throws on error. */\n  private _validate(): void {\n    ['protocol', 'user', 'host', 'projectId'].forEach(component => {\n      if (!this[component as keyof DsnComponents]) {\n        throw new SentryError(`${ERROR_MESSAGE}: ${component} missing`);\n      }\n    });\n\n    if (!this.projectId.match(/^\\d+$/)) {\n      throw new SentryError(`${ERROR_MESSAGE}: Invalid projectId ${this.projectId}`);\n    }\n\n    if (this.protocol !== 'http' && this.protocol !== 'https') {\n      throw new SentryError(`${ERROR_MESSAGE}: Invalid protocol ${this.protocol}`);\n    }\n\n    if (this.port && isNaN(parseInt(this.port, 10))) {\n      throw new SentryError(`${ERROR_MESSAGE}: Invalid port ${this.port}`);\n    }\n  }\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/**\n * Memo class used for decycle json objects. Uses WeakSet if available otherwise array.\n */\nexport class Memo {\n  /** Determines if WeakSet is available */\n  private readonly _hasWeakSet: boolean;\n  /** Either WeakSet or Array */\n  private readonly _inner: any;\n\n  public constructor() {\n    this._hasWeakSet = typeof WeakSet === 'function';\n    this._inner = this._hasWeakSet ? new WeakSet() : [];\n  }\n\n  /**\n   * Sets obj to remember.\n   * @param obj Object to remember\n   */\n  public memoize(obj: any): boolean {\n    if (this._hasWeakSet) {\n      if (this._inner.has(obj)) {\n        return true;\n      }\n      this._inner.add(obj);\n      return false;\n    }\n    // eslint-disable-next-line @typescript-eslint/prefer-for-of\n    for (let i = 0; i < this._inner.length; i++) {\n      const value = this._inner[i];\n      if (value === obj) {\n        return true;\n      }\n    }\n    this._inner.push(obj);\n    return false;\n  }\n\n  /**\n   * Removes object from internal storage.\n   * @param obj Object to forget\n   */\n  public unmemoize(obj: any): void {\n    if (this._hasWeakSet) {\n      this._inner.delete(obj);\n    } else {\n      for (let i = 0; i < this._inner.length; i++) {\n        if (this._inner[i] === obj) {\n          this._inner.splice(i, 1);\n          break;\n        }\n      }\n    }\n  }\n}\n","const defaultFunctionName = '<anonymous>';\n\n/**\n * Safely extract function name from itself\n */\nexport function getFunctionName(fn: unknown): string {\n  try {\n    if (!fn || typeof fn !== 'function') {\n      return defaultFunctionName;\n    }\n    return fn.name || defaultFunctionName;\n  } catch (e) {\n    // Just accessing custom props in some Selenium environments\n    // can cause a \"Permission denied\" exception (see raven-js#495).\n    return defaultFunctionName;\n  }\n}\n","import { isRegExp, isString } from './is';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n  if (typeof str !== 'string' || max === 0) {\n    return str;\n  }\n  return str.length <= max ? str : `${str.substr(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function snipLine(line: string, colno: number): string {\n  let newLine = line;\n  const ll = newLine.length;\n  if (ll <= 150) {\n    return newLine;\n  }\n  if (colno > ll) {\n    // eslint-disable-next-line no-param-reassign\n    colno = ll;\n  }\n\n  let start = Math.max(colno - 60, 0);\n  if (start < 5) {\n    start = 0;\n  }\n\n  let end = Math.min(start + 140, ll);\n  if (end > ll - 5) {\n    end = ll;\n  }\n  if (end === ll) {\n    start = Math.max(end - 140, 0);\n  }\n\n  newLine = newLine.slice(start, end);\n  if (start > 0) {\n    newLine = `'{snip} ${newLine}`;\n  }\n  if (end < ll) {\n    newLine += ' {snip}';\n  }\n\n  return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function safeJoin(input: any[], delimiter?: string): string {\n  if (!Array.isArray(input)) {\n    return '';\n  }\n\n  const output = [];\n  // eslint-disable-next-line @typescript-eslint/prefer-for-of\n  for (let i = 0; i < input.length; i++) {\n    const value = input[i];\n    try {\n      output.push(String(value));\n    } catch (e) {\n      output.push('[value cannot be serialized]');\n    }\n  }\n\n  return output.join(delimiter);\n}\n\n/**\n * Checks if the value matches a regex or includes the string\n * @param value The string value to be checked against\n * @param pattern Either a regex or a string that must be contained in value\n */\nexport function isMatchingPattern(value: string, pattern: RegExp | string): boolean {\n  if (!isString(value)) {\n    return false;\n  }\n\n  if (isRegExp(pattern)) {\n    return (pattern as RegExp).test(value);\n  }\n  if (typeof pattern === 'string') {\n    return value.indexOf(pattern) !== -1;\n  }\n  return false;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExtendedError, WrappedFunction } from '@sentry/types';\n\nimport { htmlTreeAsString } from './browser';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive, isSyntheticEvent } from './is';\nimport { Memo } from './memo';\nimport { getFunctionName } from './stacktrace';\nimport { truncate } from './string';\n\n/**\n * Wrap a given object method with a higher-order function\n *\n * @param source An object that contains a method to be wrapped.\n * @param name A name of method to be wrapped.\n * @param replacement A function that should be used to wrap a given method.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacement: (...args: any[]) => any): void {\n  if (!(name in source)) {\n    return;\n  }\n\n  const original = source[name] as () => any;\n  const wrapped = replacement(original) as WrappedFunction;\n\n  // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n  // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n  if (typeof wrapped === 'function') {\n    try {\n      wrapped.prototype = wrapped.prototype || {};\n      Object.defineProperties(wrapped, {\n        __sentry_original__: {\n          enumerable: false,\n          value: original,\n        },\n      });\n    } catch (_Oo) {\n      // This can throw if multiple fill happens on a global object like XMLHttpRequest\n      // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n    }\n  }\n\n  source[name] = wrapped;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nexport function urlEncode(object: { [key: string]: any }): string {\n  return Object.keys(object)\n    .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n    .join('&');\n}\n\n/**\n * Transforms any object into an object literal with all it's attributes\n * attached to it.\n *\n * @param value Initial source that we have to transform in order to be usable by the serializer\n */\nfunction getWalkSource(\n  value: any,\n): {\n  [key: string]: any;\n} {\n  if (isError(value)) {\n    const error = value as ExtendedError;\n    const err: {\n      [key: string]: any;\n      stack: string | undefined;\n      message: string;\n      name: string;\n    } = {\n      message: error.message,\n      name: error.name,\n      stack: error.stack,\n    };\n\n    for (const i in error) {\n      if (Object.prototype.hasOwnProperty.call(error, i)) {\n        err[i] = error[i];\n      }\n    }\n\n    return err;\n  }\n\n  if (isEvent(value)) {\n    /**\n     * Event-like interface that's usable in browser and node\n     */\n    interface SimpleEvent {\n      [key: string]: unknown;\n      type: string;\n      target?: unknown;\n      currentTarget?: unknown;\n    }\n\n    const event = value as SimpleEvent;\n\n    const source: {\n      [key: string]: any;\n    } = {};\n\n    source.type = event.type;\n\n    // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n    try {\n      source.target = isElement(event.target)\n        ? htmlTreeAsString(event.target)\n        : Object.prototype.toString.call(event.target);\n    } catch (_oO) {\n      source.target = '<unknown>';\n    }\n\n    try {\n      source.currentTarget = isElement(event.currentTarget)\n        ? htmlTreeAsString(event.currentTarget)\n        : Object.prototype.toString.call(event.currentTarget);\n    } catch (_oO) {\n      source.currentTarget = '<unknown>';\n    }\n\n    if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n      source.detail = event.detail;\n    }\n\n    for (const i in event) {\n      if (Object.prototype.hasOwnProperty.call(event, i)) {\n        source[i] = event;\n      }\n    }\n\n    return source;\n  }\n\n  return value as {\n    [key: string]: any;\n  };\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value: string): number {\n  // eslint-disable-next-line no-bitwise\n  return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\nfunction jsonSize(value: any): number {\n  return utf8Length(JSON.stringify(value));\n}\n\n/** JSDoc */\nexport function normalizeToSize<T>(\n  object: { [key: string]: any },\n  // Default Node.js REPL depth\n  depth: number = 3,\n  // 100kB, as 200kB is max payload size, so half sounds reasonable\n  maxSize: number = 100 * 1024,\n): T {\n  const serialized = normalize(object, depth);\n\n  if (jsonSize(serialized) > maxSize) {\n    return normalizeToSize(object, depth - 1, maxSize);\n  }\n\n  return serialized as T;\n}\n\n/** Transforms any input value into a string form, either primitive value or a type of the input */\nfunction serializeValue(value: any): any {\n  const type = Object.prototype.toString.call(value);\n\n  // Node.js REPL notation\n  if (typeof value === 'string') {\n    return value;\n  }\n  if (type === '[object Object]') {\n    return '[Object]';\n  }\n  if (type === '[object Array]') {\n    return '[Array]';\n  }\n\n  const normalized = normalizeValue(value);\n  return isPrimitive(normalized) ? normalized : type;\n}\n\n/**\n * normalizeValue()\n *\n * Takes unserializable input and make it serializable friendly\n *\n * - translates undefined/NaN values to \"[undefined]\"/\"[NaN]\" respectively,\n * - serializes Error objects\n * - filter global objects\n */\nfunction normalizeValue<T>(value: T, key?: any): T | string {\n  if (key === 'domain' && value && typeof value === 'object' && ((value as unknown) as { _events: any })._events) {\n    return '[Domain]';\n  }\n\n  if (key === 'domainEmitter') {\n    return '[DomainEmitter]';\n  }\n\n  if (typeof (global as any) !== 'undefined' && (value as unknown) === global) {\n    return '[Global]';\n  }\n\n  if (typeof (window as any) !== 'undefined' && (value as unknown) === window) {\n    return '[Window]';\n  }\n\n  if (typeof (document as any) !== 'undefined' && (value as unknown) === document) {\n    return '[Document]';\n  }\n\n  // React's SyntheticEvent thingy\n  if (isSyntheticEvent(value)) {\n    return '[SyntheticEvent]';\n  }\n\n  if (typeof value === 'number' && value !== value) {\n    return '[NaN]';\n  }\n\n  if (value === void 0) {\n    return '[undefined]';\n  }\n\n  if (typeof value === 'function') {\n    return `[Function: ${getFunctionName(value)}]`;\n  }\n\n  return value;\n}\n\n/**\n * Walks an object to perform a normalization on it\n *\n * @param key of object that's walked in current iteration\n * @param value object to be walked\n * @param depth Optional number indicating how deep should walking be performed\n * @param memo Optional Memo class handling decycling\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function walk(key: string, value: any, depth: number = +Infinity, memo: Memo = new Memo()): any {\n  // If we reach the maximum depth, serialize whatever has left\n  if (depth === 0) {\n    return serializeValue(value);\n  }\n\n  /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n  // If value implements `toJSON` method, call it and return early\n  if (value !== null && value !== undefined && typeof value.toJSON === 'function') {\n    return value.toJSON();\n  }\n  /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n  // If normalized value is a primitive, there are no branches left to walk, so we can just bail out, as theres no point in going down that branch any further\n  const normalized = normalizeValue(value, key);\n  if (isPrimitive(normalized)) {\n    return normalized;\n  }\n\n  // Create source that we will use for next itterations, either objectified error object (Error type with extracted keys:value pairs) or the input itself\n  const source = getWalkSource(value);\n\n  // Create an accumulator that will act as a parent for all future itterations of that branch\n  const acc = Array.isArray(value) ? [] : {};\n\n  // If we already walked that branch, bail out, as it's circular reference\n  if (memo.memoize(value)) {\n    return '[Circular ~]';\n  }\n\n  // Walk all keys of the source\n  for (const innerKey in source) {\n    // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n    if (!Object.prototype.hasOwnProperty.call(source, innerKey)) {\n      continue;\n    }\n    // Recursively walk through all the child nodes\n    (acc as { [key: string]: any })[innerKey] = walk(innerKey, source[innerKey], depth - 1, memo);\n  }\n\n  // Once walked through all the branches, remove the parent from memo storage\n  memo.unmemoize(value);\n\n  // Return accumulated values\n  return acc;\n}\n\n/**\n * normalize()\n *\n * - Creates a copy to prevent original input mutation\n * - Skip non-enumerablers\n * - Calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializeable values (undefined/NaN/Functions) to serializable format\n * - Translates known global objects/Classes to a string representations\n * - Takes care of Error objects serialization\n * - Optionally limit depth of final output\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function normalize(input: any, depth?: number): any {\n  try {\n    return JSON.parse(JSON.stringify(input, (key: string, value: any) => walk(key, value, depth)));\n  } catch (_oO) {\n    return '**non-serializable**';\n  }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function extractExceptionKeysForMessage(exception: any, maxLength: number = 40): string {\n  const keys = Object.keys(getWalkSource(exception));\n  keys.sort();\n\n  if (!keys.length) {\n    return '[object has no keys]';\n  }\n\n  if (keys[0].length >= maxLength) {\n    return truncate(keys[0], maxLength);\n  }\n\n  for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n    const serialized = keys.slice(0, includedKeys).join(', ');\n    if (serialized.length > maxLength) {\n      continue;\n    }\n    if (includedKeys === keys.length) {\n      return serialized;\n    }\n    return truncate(serialized, maxLength);\n  }\n\n  return '';\n}\n\n/**\n * Given any object, return the new object with removed keys that value was `undefined`.\n * Works recursively on objects and arrays.\n */\nexport function dropUndefinedKeys<T>(val: T): T {\n  if (isPlainObject(val)) {\n    const obj = val as { [key: string]: any };\n    const rv: { [key: string]: any } = {};\n    for (const key of Object.keys(obj)) {\n      if (typeof obj[key] !== 'undefined') {\n        rv[key] = dropUndefinedKeys(obj[key]);\n      }\n    }\n    return rv as T;\n  }\n\n  if (Array.isArray(val)) {\n    return val.map(dropUndefinedKeys) as any;\n  }\n\n  return val;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExtractedNodeRequestData } from '@sentry/types';\n\nimport { isString } from './is';\nimport { normalize } from './object';\n\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nexport function isNodeEnv(): boolean {\n  return Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';\n}\n\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function dynamicRequire(mod: any, request: string): any {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return mod.require(request);\n}\n\n/** Default request keys that'll be used to extract data from the request */\nconst DEFAULT_REQUEST_KEYS = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];\n\n/**\n * Normalizes data from the request object, accounting for framework differences.\n *\n * @param req The request object from which to extract data\n * @param keys An optional array of keys to include in the normalized data. Defaults to DEFAULT_REQUEST_KEYS if not\n * provided.\n * @returns An object containing normalized request data\n */\nexport function extractNodeRequestData(\n  req: { [key: string]: any },\n  keys: string[] = DEFAULT_REQUEST_KEYS,\n): ExtractedNodeRequestData {\n  // make sure we can safely use dynamicRequire below\n  if (!isNodeEnv()) {\n    throw new Error(\"Can't get node request data outside of a node environment\");\n  }\n\n  const requestData: { [key: string]: any } = {};\n\n  // headers:\n  //   node, express: req.headers\n  //   koa: req.header\n  const headers = (req.headers || req.header || {}) as {\n    host?: string;\n    cookie?: string;\n  };\n  // method:\n  //   node, express, koa: req.method\n  const method = req.method;\n  // host:\n  //   express: req.hostname in > 4 and req.host in < 4\n  //   koa: req.host\n  //   node: req.headers.host\n  const host = req.hostname || req.host || headers.host || '<no host>';\n  // protocol:\n  //   node: <n/a>\n  //   express, koa: req.protocol\n  const protocol =\n    req.protocol === 'https' || req.secure || ((req.socket || {}) as { encrypted?: boolean }).encrypted\n      ? 'https'\n      : 'http';\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa: req.url\n  const originalUrl = (req.originalUrl || req.url || '') as string;\n  // absolute url\n  const absoluteUrl = `${protocol}://${host}${originalUrl}`;\n\n  keys.forEach(key => {\n    switch (key) {\n      case 'headers':\n        requestData.headers = headers;\n        break;\n      case 'method':\n        requestData.method = method;\n        break;\n      case 'url':\n        requestData.url = absoluteUrl;\n        break;\n      case 'cookies':\n        // cookies:\n        //   node, express, koa: req.headers.cookie\n        //   vercel, sails.js, express (w/ cookie middleware): req.cookies\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.cookies = req.cookies || dynamicRequire(module, 'cookie').parse(headers.cookie || '');\n        break;\n      case 'query_string':\n        // query string:\n        //   node: req.url (raw)\n        //   express, koa: req.query\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.query_string = dynamicRequire(module, 'url').parse(originalUrl || '', false).query;\n        break;\n      case 'data':\n        if (method === 'GET' || method === 'HEAD') {\n          break;\n        }\n        // body data:\n        //   node, express, koa: req.body\n        if (req.body !== undefined) {\n          requestData.data = isString(req.body) ? req.body : JSON.stringify(normalize(req.body));\n        }\n        break;\n      default:\n        if ({}.hasOwnProperty.call(req, key)) {\n          requestData[key] = (req as { [key: string]: any })[key];\n        }\n    }\n  });\n\n  return requestData;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Event, Integration, StackFrame, WrappedFunction } from '@sentry/types';\n\nimport { isNodeEnv } from './node';\nimport { snipLine } from './string';\n\n/** Internal */\ninterface SentryGlobal {\n  Sentry?: {\n    Integrations?: Integration[];\n  };\n  SENTRY_ENVIRONMENT?: string;\n  SENTRY_DSN?: string;\n  SENTRY_RELEASE?: {\n    id?: string;\n  };\n  __SENTRY__: {\n    globalEventProcessors: any;\n    hub: any;\n    logger: any;\n  };\n}\n\nconst fallbackGlobalObject = {};\n\n/**\n * Safely get global scope object\n *\n * @returns Global scope object\n */\nexport function getGlobalObject<T>(): T & SentryGlobal {\n  return (isNodeEnv()\n    ? global\n    : typeof window !== 'undefined'\n    ? window\n    : typeof self !== 'undefined'\n    ? self\n    : fallbackGlobalObject) as T & SentryGlobal;\n}\n\n/**\n * Extended Window interface that allows for Crypto API usage in IE browsers\n */\ninterface MsCryptoWindow extends Window {\n  msCrypto?: Crypto;\n}\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nexport function uuid4(): string {\n  const global = getGlobalObject() as MsCryptoWindow;\n  const crypto = global.crypto || global.msCrypto;\n\n  if (!(crypto === void 0) && crypto.getRandomValues) {\n    // Use window.crypto API if available\n    const arr = new Uint16Array(8);\n    crypto.getRandomValues(arr);\n\n    // set 4 in byte 7\n    // eslint-disable-next-line no-bitwise\n    arr[3] = (arr[3] & 0xfff) | 0x4000;\n    // set 2 most significant bits of byte 9 to '10'\n    // eslint-disable-next-line no-bitwise\n    arr[4] = (arr[4] & 0x3fff) | 0x8000;\n\n    const pad = (num: number): string => {\n      let v = num.toString(16);\n      while (v.length < 4) {\n        v = `0${v}`;\n      }\n      return v;\n    };\n\n    return (\n      pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7])\n    );\n  }\n  // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n  return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, c => {\n    // eslint-disable-next-line no-bitwise\n    const r = (Math.random() * 16) | 0;\n    // eslint-disable-next-line no-bitwise\n    const v = c === 'x' ? r : (r & 0x3) | 0x8;\n    return v.toString(16);\n  });\n}\n\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not <a/> href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nexport function parseUrl(\n  url: string,\n): {\n  host?: string;\n  path?: string;\n  protocol?: string;\n  relative?: string;\n} {\n  if (!url) {\n    return {};\n  }\n\n  const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n  if (!match) {\n    return {};\n  }\n\n  // coerce to undefined values to empty string so we don't get 'undefined'\n  const query = match[6] || '';\n  const fragment = match[8] || '';\n  return {\n    host: match[4],\n    path: match[5],\n    protocol: match[2],\n    relative: match[5] + query + fragment, // everything minus origin\n  };\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n  if (event.message) {\n    return event.message;\n  }\n  if (event.exception && event.exception.values && event.exception.values[0]) {\n    const exception = event.exception.values[0];\n\n    if (exception.type && exception.value) {\n      return `${exception.type}: ${exception.value}`;\n    }\n    return exception.type || exception.value || event.event_id || '<unknown>';\n  }\n  return event.event_id || '<unknown>';\n}\n\n/** JSDoc */\ninterface ExtensibleConsole extends Console {\n  [key: string]: any;\n}\n\n/** JSDoc */\nexport function consoleSandbox(callback: () => any): any {\n  const global = getGlobalObject<Window>();\n  const levels = ['debug', 'info', 'warn', 'error', 'log', 'assert'];\n\n  if (!('console' in global)) {\n    return callback();\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  const originalConsole = (global as any).console as ExtensibleConsole;\n  const wrappedLevels: { [key: string]: any } = {};\n\n  // Restore all wrapped console methods\n  levels.forEach(level => {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    if (level in (global as any).console && (originalConsole[level] as WrappedFunction).__sentry_original__) {\n      wrappedLevels[level] = originalConsole[level] as WrappedFunction;\n      originalConsole[level] = (originalConsole[level] as WrappedFunction).__sentry_original__;\n    }\n  });\n\n  // Perform callback manipulations\n  const result = callback();\n\n  // Revert restoration to wrapped state\n  Object.keys(wrappedLevels).forEach(level => {\n    originalConsole[level] = wrappedLevels[level];\n  });\n\n  return result;\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n  event.exception = event.exception || {};\n  event.exception.values = event.exception.values || [];\n  event.exception.values[0] = event.exception.values[0] || {};\n  event.exception.values[0].value = event.exception.values[0].value || value || '';\n  event.exception.values[0].type = event.exception.values[0].type || type || 'Error';\n}\n\n/**\n * Adds exception mechanism to a given event.\n * @param event The event to modify.\n * @param mechanism Mechanism of the mechanism.\n * @hidden\n */\nexport function addExceptionMechanism(\n  event: Event,\n  mechanism: {\n    [key: string]: any;\n  } = {},\n): void {\n  // TODO: Use real type with `keyof Mechanism` thingy and maybe make it better?\n  try {\n    // @ts-ignore Type 'Mechanism | {}' is not assignable to type 'Mechanism | undefined'\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    event.exception!.values![0].mechanism = event.exception!.values![0].mechanism || {};\n    Object.keys(mechanism).forEach(key => {\n      // @ts-ignore Mechanism has no index signature\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      event.exception!.values![0].mechanism[key] = mechanism[key];\n    });\n  } catch (_oO) {\n    // no-empty\n  }\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n  try {\n    return document.location.href;\n  } catch (oO) {\n    return '';\n  }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP = /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n  major?: number;\n  minor?: number;\n  patch?: number;\n  prerelease?: string;\n  buildmetadata?: string;\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n  const match = input.match(SEMVER_REGEXP) || [];\n  const major = parseInt(match[1], 10);\n  const minor = parseInt(match[2], 10);\n  const patch = parseInt(match[3], 10);\n  return {\n    buildmetadata: match[5],\n    major: isNaN(major) ? undefined : major,\n    minor: isNaN(minor) ? undefined : minor,\n    patch: isNaN(patch) ? undefined : patch,\n    prerelease: match[4],\n  };\n}\n\nconst defaultRetryAfter = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param now current unix timestamp\n * @param header string representation of 'Retry-After' header\n */\nexport function parseRetryAfterHeader(now: number, header?: string | number | null): number {\n  if (!header) {\n    return defaultRetryAfter;\n  }\n\n  const headerDelay = parseInt(`${header}`, 10);\n  if (!isNaN(headerDelay)) {\n    return headerDelay * 1000;\n  }\n\n  const headerDate = Date.parse(`${header}`);\n  if (!isNaN(headerDate)) {\n    return headerDate - now;\n  }\n\n  return defaultRetryAfter;\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n  const lineno = frame.lineno || 0;\n  const maxLines = lines.length;\n  const sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);\n\n  frame.pre_context = lines\n    .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n    .map((line: string) => snipLine(line, 0));\n\n  frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n  frame.post_context = lines\n    .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n    .map((line: string) => snipLine(line, 0));\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nexport function stripUrlQueryAndFragment(urlPath: string): string {\n  // eslint-disable-next-line no-useless-escape\n  return urlPath.split(/[\\?#]/, 1)[0];\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { consoleSandbox, getGlobalObject } from './misc';\n\n// TODO: Implement different loggers for different environments\nconst global = getGlobalObject<Window | NodeJS.Global>();\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\n/** JSDoc */\nclass Logger {\n  /** JSDoc */\n  private _enabled: boolean;\n\n  /** JSDoc */\n  public constructor() {\n    this._enabled = false;\n  }\n\n  /** JSDoc */\n  public disable(): void {\n    this._enabled = false;\n  }\n\n  /** JSDoc */\n  public enable(): void {\n    this._enabled = true;\n  }\n\n  /** JSDoc */\n  public log(...args: any[]): void {\n    if (!this._enabled) {\n      return;\n    }\n    consoleSandbox(() => {\n      global.console.log(`${PREFIX}[Log]: ${args.join(' ')}`);\n    });\n  }\n\n  /** JSDoc */\n  public warn(...args: any[]): void {\n    if (!this._enabled) {\n      return;\n    }\n    consoleSandbox(() => {\n      global.console.warn(`${PREFIX}[Warn]: ${args.join(' ')}`);\n    });\n  }\n\n  /** JSDoc */\n  public error(...args: any[]): void {\n    if (!this._enabled) {\n      return;\n    }\n    consoleSandbox(() => {\n      global.console.error(`${PREFIX}[Error]: ${args.join(' ')}`);\n    });\n  }\n}\n\n// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used\nglobal.__SENTRY__ = global.__SENTRY__ || {};\nconst logger = (global.__SENTRY__.logger as Logger) || (global.__SENTRY__.logger = new Logger());\n\nexport { logger };\n","import { logger } from './logger';\nimport { getGlobalObject } from './misc';\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsErrorEvent(): boolean {\n  try {\n    new ErrorEvent('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMError(): boolean {\n  try {\n    // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n    // 1 argument required, but only 0 present.\n    // @ts-ignore It really needs 1 argument, not 0.\n    new DOMError('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMException(): boolean {\n  try {\n    new DOMException('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsFetch(): boolean {\n  if (!('fetch' in getGlobalObject<Window>())) {\n    return false;\n  }\n\n  try {\n    new Headers();\n    new Request('');\n    new Response();\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isNativeFetch(func: Function): boolean {\n  return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nexport function supportsNativeFetch(): boolean {\n  if (!supportsFetch()) {\n    return false;\n  }\n\n  const global = getGlobalObject<Window>();\n\n  // Fast path to avoid DOM I/O\n  // eslint-disable-next-line @typescript-eslint/unbound-method\n  if (isNativeFetch(global.fetch)) {\n    return true;\n  }\n\n  // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n  // so create a \"pure\" iframe to see if that has native fetch\n  let result = false;\n  const doc = global.document;\n  // eslint-disable-next-line deprecation/deprecation\n  if (doc && typeof (doc.createElement as unknown) === `function`) {\n    try {\n      const sandbox = doc.createElement('iframe');\n      sandbox.hidden = true;\n      doc.head.appendChild(sandbox);\n      if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n        // eslint-disable-next-line @typescript-eslint/unbound-method\n        result = isNativeFetch(sandbox.contentWindow.fetch);\n      }\n      doc.head.removeChild(sandbox);\n    } catch (err) {\n      logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n    }\n  }\n\n  return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReportingObserver(): boolean {\n  return 'ReportingObserver' in getGlobalObject();\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReferrerPolicy(): boolean {\n  // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default\n  // https://caniuse.com/#feat=referrer-policy\n  // It doesn't. And it throw exception instead of ignoring this parameter...\n  // REF: https://github.com/getsentry/raven-js/issues/1233\n\n  if (!supportsFetch()) {\n    return false;\n  }\n\n  try {\n    new Request('_', {\n      referrerPolicy: 'origin' as ReferrerPolicy,\n    });\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsHistory(): boolean {\n  // NOTE: in Chrome App environment, touching history.pushState, *even inside\n  //       a try/catch block*, will cause Chrome to output an error to console.error\n  // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n  const global = getGlobalObject<Window>();\n  /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const chrome = (global as any).chrome;\n  const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n  /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n  const hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState;\n\n  return !isChromePackagedApp && hasHistoryApi;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport { WrappedFunction } from '@sentry/types';\n\nimport { isInstanceOf, isString } from './is';\nimport { logger } from './logger';\nimport { getGlobalObject } from './misc';\nimport { fill } from './object';\nimport { getFunctionName } from './stacktrace';\nimport { supportsHistory, supportsNativeFetch } from './supports';\n\nconst global = getGlobalObject<Window>();\n\n/** Object describing handler that will be triggered for a given `type` of instrumentation */\ninterface InstrumentHandler {\n  type: InstrumentHandlerType;\n  callback: InstrumentHandlerCallback;\n}\ntype InstrumentHandlerType =\n  | 'console'\n  | 'dom'\n  | 'fetch'\n  | 'history'\n  | 'sentry'\n  | 'xhr'\n  | 'error'\n  | 'unhandledrejection';\ntype InstrumentHandlerCallback = (data: any) => void;\n\n/**\n * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.\n *  - Console API\n *  - Fetch API\n *  - XHR API\n *  - History API\n *  - DOM API (click/typing)\n *  - Error API\n *  - UnhandledRejection API\n */\n\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\n/** Instruments given API */\nfunction instrument(type: InstrumentHandlerType): void {\n  if (instrumented[type]) {\n    return;\n  }\n\n  instrumented[type] = true;\n\n  switch (type) {\n    case 'console':\n      instrumentConsole();\n      break;\n    case 'dom':\n      instrumentDOM();\n      break;\n    case 'xhr':\n      instrumentXHR();\n      break;\n    case 'fetch':\n      instrumentFetch();\n      break;\n    case 'history':\n      instrumentHistory();\n      break;\n    case 'error':\n      instrumentError();\n      break;\n    case 'unhandledrejection':\n      instrumentUnhandledRejection();\n      break;\n    default:\n      logger.warn('unknown instrumentation type:', type);\n  }\n}\n\n/**\n * Add handler that will be called when given type of instrumentation triggers.\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addInstrumentationHandler(handler: InstrumentHandler): void {\n  if (!handler || typeof handler.type !== 'string' || typeof handler.callback !== 'function') {\n    return;\n  }\n  handlers[handler.type] = handlers[handler.type] || [];\n  (handlers[handler.type] as InstrumentHandlerCallback[]).push(handler.callback);\n  instrument(handler.type);\n}\n\n/** JSDoc */\nfunction triggerHandlers(type: InstrumentHandlerType, data: any): void {\n  if (!type || !handlers[type]) {\n    return;\n  }\n\n  for (const handler of handlers[type] || []) {\n    try {\n      handler(data);\n    } catch (e) {\n      logger.error(\n        `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(\n          handler,\n        )}\\nError: ${e}`,\n      );\n    }\n  }\n}\n\n/** JSDoc */\nfunction instrumentConsole(): void {\n  if (!('console' in global)) {\n    return;\n  }\n\n  ['debug', 'info', 'warn', 'error', 'log', 'assert'].forEach(function(level: string): void {\n    if (!(level in global.console)) {\n      return;\n    }\n\n    fill(global.console, level, function(originalConsoleLevel: () => any): Function {\n      return function(...args: any[]): void {\n        triggerHandlers('console', { args, level });\n\n        // this fails for some browsers. :(\n        if (originalConsoleLevel) {\n          Function.prototype.apply.call(originalConsoleLevel, global.console, args);\n        }\n      };\n    });\n  });\n}\n\n/** JSDoc */\nfunction instrumentFetch(): void {\n  if (!supportsNativeFetch()) {\n    return;\n  }\n\n  fill(global, 'fetch', function(originalFetch: () => void): () => void {\n    return function(...args: any[]): void {\n      const handlerData = {\n        args,\n        fetchData: {\n          method: getFetchMethod(args),\n          url: getFetchUrl(args),\n        },\n        startTimestamp: Date.now(),\n      };\n\n      triggerHandlers('fetch', {\n        ...handlerData,\n      });\n\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      return originalFetch.apply(global, args).then(\n        (response: Response) => {\n          triggerHandlers('fetch', {\n            ...handlerData,\n            endTimestamp: Date.now(),\n            response,\n          });\n          return response;\n        },\n        (error: Error) => {\n          triggerHandlers('fetch', {\n            ...handlerData,\n            endTimestamp: Date.now(),\n            error,\n          });\n          // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n          //       it means the sentry.javascript SDK caught an error invoking your application code.\n          //       This is expected behavior and NOT indicative of a bug with sentry.javascript.\n          throw error;\n        },\n      );\n    };\n  });\n}\n\ntype XHRSendInput = null | Blob | BufferSource | FormData | URLSearchParams | string;\n\n/** JSDoc */\ninterface SentryWrappedXMLHttpRequest extends XMLHttpRequest {\n  [key: string]: any;\n  __sentry_xhr__?: {\n    method?: string;\n    url?: string;\n    status_code?: number;\n    body?: XHRSendInput;\n  };\n}\n\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/** Extract `method` from fetch call arguments */\nfunction getFetchMethod(fetchArgs: any[] = []): string {\n  if ('Request' in global && isInstanceOf(fetchArgs[0], Request) && fetchArgs[0].method) {\n    return String(fetchArgs[0].method).toUpperCase();\n  }\n  if (fetchArgs[1] && fetchArgs[1].method) {\n    return String(fetchArgs[1].method).toUpperCase();\n  }\n  return 'GET';\n}\n\n/** Extract `url` from fetch call arguments */\nfunction getFetchUrl(fetchArgs: any[] = []): string {\n  if (typeof fetchArgs[0] === 'string') {\n    return fetchArgs[0];\n  }\n  if ('Request' in global && isInstanceOf(fetchArgs[0], Request)) {\n    return fetchArgs[0].url;\n  }\n  return String(fetchArgs[0]);\n}\n/* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n/** JSDoc */\nfunction instrumentXHR(): void {\n  if (!('XMLHttpRequest' in global)) {\n    return;\n  }\n\n  // Poor man's implementation of ES6 `Map`, tracking and keeping in sync key and value separately.\n  const requestKeys: XMLHttpRequest[] = [];\n  const requestValues: Array<any>[] = [];\n  const xhrproto = XMLHttpRequest.prototype;\n\n  fill(xhrproto, 'open', function(originalOpen: () => void): () => void {\n    return function(this: SentryWrappedXMLHttpRequest, ...args: any[]): void {\n      // eslint-disable-next-line @typescript-eslint/no-this-alias\n      const xhr = this;\n      const url = args[1];\n      xhr.__sentry_xhr__ = {\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        method: isString(args[0]) ? args[0].toUpperCase() : args[0],\n        url: args[1],\n      };\n\n      // if Sentry key appears in URL, don't capture it as a request\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      if (isString(url) && xhr.__sentry_xhr__.method === 'POST' && url.match(/sentry_key/)) {\n        xhr.__sentry_own_request__ = true;\n      }\n\n      const onreadystatechangeHandler = function(): void {\n        if (xhr.readyState === 4) {\n          try {\n            // touching statusCode in some platforms throws\n            // an exception\n            if (xhr.__sentry_xhr__) {\n              xhr.__sentry_xhr__.status_code = xhr.status;\n            }\n          } catch (e) {\n            /* do nothing */\n          }\n\n          try {\n            const requestPos = requestKeys.indexOf(xhr);\n            if (requestPos !== -1) {\n              // Make sure to pop both key and value to keep it in sync.\n              requestKeys.splice(requestPos);\n              const args = requestValues.splice(requestPos)[0];\n              if (xhr.__sentry_xhr__ && args[0] !== undefined) {\n                xhr.__sentry_xhr__.body = args[0] as XHRSendInput;\n              }\n            }\n          } catch (e) {\n            /* do nothing */\n          }\n\n          triggerHandlers('xhr', {\n            args,\n            endTimestamp: Date.now(),\n            startTimestamp: Date.now(),\n            xhr,\n          });\n        }\n      };\n\n      if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') {\n        fill(xhr, 'onreadystatechange', function(original: WrappedFunction): Function {\n          return function(...readyStateArgs: any[]): void {\n            onreadystatechangeHandler();\n            return original.apply(xhr, readyStateArgs);\n          };\n        });\n      } else {\n        xhr.addEventListener('readystatechange', onreadystatechangeHandler);\n      }\n\n      return originalOpen.apply(xhr, args);\n    };\n  });\n\n  fill(xhrproto, 'send', function(originalSend: () => void): () => void {\n    return function(this: SentryWrappedXMLHttpRequest, ...args: any[]): void {\n      requestKeys.push(this);\n      requestValues.push(args);\n\n      triggerHandlers('xhr', {\n        args,\n        startTimestamp: Date.now(),\n        xhr: this,\n      });\n\n      return originalSend.apply(this, args);\n    };\n  });\n}\n\nlet lastHref: string;\n\n/** JSDoc */\nfunction instrumentHistory(): void {\n  if (!supportsHistory()) {\n    return;\n  }\n\n  const oldOnPopState = global.onpopstate;\n  global.onpopstate = function(this: WindowEventHandlers, ...args: any[]): any {\n    const to = global.location.href;\n    // keep track of the current URL state, as we always receive only the updated state\n    const from = lastHref;\n    lastHref = to;\n    triggerHandlers('history', {\n      from,\n      to,\n    });\n    if (oldOnPopState) {\n      return oldOnPopState.apply(this, args);\n    }\n  };\n\n  /** @hidden */\n  function historyReplacementFunction(originalHistoryFunction: () => void): () => void {\n    return function(this: History, ...args: any[]): void {\n      const url = args.length > 2 ? args[2] : undefined;\n      if (url) {\n        // coerce to string (this is what pushState does)\n        const from = lastHref;\n        const to = String(url);\n        // keep track of the current URL state, as we always receive only the updated state\n        lastHref = to;\n        triggerHandlers('history', {\n          from,\n          to,\n        });\n      }\n      return originalHistoryFunction.apply(this, args);\n    };\n  }\n\n  fill(global.history, 'pushState', historyReplacementFunction);\n  fill(global.history, 'replaceState', historyReplacementFunction);\n}\n\n/** JSDoc */\nfunction instrumentDOM(): void {\n  if (!('document' in global)) {\n    return;\n  }\n\n  // Capture breadcrumbs from any click that is unhandled / bubbled up all the way\n  // to the document. Do this before we instrument addEventListener.\n  global.document.addEventListener('click', domEventHandler('click', triggerHandlers.bind(null, 'dom')), false);\n  global.document.addEventListener('keypress', keypressEventHandler(triggerHandlers.bind(null, 'dom')), false);\n\n  // After hooking into document bubbled up click and keypresses events, we also hook into user handled click & keypresses.\n  ['EventTarget', 'Node'].forEach((target: string) => {\n    /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n    const proto = (global as any)[target] && (global as any)[target].prototype;\n\n    // eslint-disable-next-line no-prototype-builtins\n    if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n      return;\n    }\n    /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n    fill(proto, 'addEventListener', function(\n      original: () => void,\n    ): (\n      eventName: string,\n      fn: EventListenerOrEventListenerObject,\n      options?: boolean | AddEventListenerOptions,\n    ) => void {\n      return function(\n        this: any,\n        eventName: string,\n        fn: EventListenerOrEventListenerObject,\n        options?: boolean | AddEventListenerOptions,\n      ): (eventName: string, fn: EventListenerOrEventListenerObject, capture?: boolean, secure?: boolean) => void {\n        if (fn && (fn as EventListenerObject).handleEvent) {\n          if (eventName === 'click') {\n            fill(fn, 'handleEvent', function(innerOriginal: () => void): (caughtEvent: Event) => void {\n              return function(this: any, event: Event): (event: Event) => void {\n                domEventHandler('click', triggerHandlers.bind(null, 'dom'))(event);\n                return innerOriginal.call(this, event);\n              };\n            });\n          }\n          if (eventName === 'keypress') {\n            fill(fn, 'handleEvent', function(innerOriginal: () => void): (caughtEvent: Event) => void {\n              return function(this: any, event: Event): (event: Event) => void {\n                keypressEventHandler(triggerHandlers.bind(null, 'dom'))(event);\n                return innerOriginal.call(this, event);\n              };\n            });\n          }\n        } else {\n          if (eventName === 'click') {\n            domEventHandler('click', triggerHandlers.bind(null, 'dom'), true)(this);\n          }\n          if (eventName === 'keypress') {\n            keypressEventHandler(triggerHandlers.bind(null, 'dom'))(this);\n          }\n        }\n\n        return original.call(this, eventName, fn, options);\n      };\n    });\n\n    fill(proto, 'removeEventListener', function(\n      original: () => void,\n    ): (\n      this: any,\n      eventName: string,\n      fn: EventListenerOrEventListenerObject,\n      options?: boolean | EventListenerOptions,\n    ) => () => void {\n      return function(\n        this: any,\n        eventName: string,\n        fn: EventListenerOrEventListenerObject,\n        options?: boolean | EventListenerOptions,\n      ): () => void {\n        try {\n          original.call(this, eventName, ((fn as unknown) as WrappedFunction).__sentry_wrapped__, options);\n        } catch (e) {\n          // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n        }\n        return original.call(this, eventName, fn, options);\n      };\n    });\n  });\n}\n\nconst debounceDuration: number = 1000;\nlet debounceTimer: number = 0;\nlet keypressTimeout: number | undefined;\nlet lastCapturedEvent: Event | undefined;\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n * @param name the event name (e.g. \"click\")\n * @param handler function that will be triggered\n * @param debounce decides whether it should wait till another event loop\n * @returns wrapped breadcrumb events handler\n * @hidden\n */\nfunction domEventHandler(name: string, handler: Function, debounce: boolean = false): (event: Event) => void {\n  return (event: Event): void => {\n    // reset keypress timeout; e.g. triggering a 'click' after\n    // a 'keypress' will reset the keypress debounce so that a new\n    // set of keypresses can be recorded\n    keypressTimeout = undefined;\n    // It's possible this handler might trigger multiple times for the same\n    // event (e.g. event propagation through node ancestors). Ignore if we've\n    // already captured the event.\n    if (!event || lastCapturedEvent === event) {\n      return;\n    }\n\n    lastCapturedEvent = event;\n\n    if (debounceTimer) {\n      clearTimeout(debounceTimer);\n    }\n\n    if (debounce) {\n      debounceTimer = setTimeout(() => {\n        handler({ event, name });\n      });\n    } else {\n      handler({ event, name });\n    }\n  };\n}\n\n/**\n * Wraps addEventListener to capture keypress UI events\n * @param handler function that will be triggered\n * @returns wrapped keypress events handler\n * @hidden\n */\nfunction keypressEventHandler(handler: Function): (event: Event) => void {\n  // TODO: if somehow user switches keypress target before\n  //       debounce timeout is triggered, we will only capture\n  //       a single breadcrumb from the FIRST target (acceptable?)\n  return (event: Event): void => {\n    let target;\n\n    try {\n      target = event.target;\n    } catch (e) {\n      // just accessing event properties can throw an exception in some rare circumstances\n      // see: https://github.com/getsentry/raven-js/issues/838\n      return;\n    }\n\n    const tagName = target && (target as HTMLElement).tagName;\n\n    // only consider keypress events on actual input elements\n    // this will disregard keypresses targeting body (e.g. tabbing\n    // through elements, hotkeys, etc)\n    if (!tagName || (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !(target as HTMLElement).isContentEditable)) {\n      return;\n    }\n\n    // record first keypress in a series, but ignore subsequent\n    // keypresses until debounce clears\n    if (!keypressTimeout) {\n      domEventHandler('input', handler)(event);\n    }\n    clearTimeout(keypressTimeout);\n\n    keypressTimeout = (setTimeout(() => {\n      keypressTimeout = undefined;\n    }, debounceDuration) as any) as number;\n  };\n}\n\nlet _oldOnErrorHandler: OnErrorEventHandler = null;\n/** JSDoc */\nfunction instrumentError(): void {\n  _oldOnErrorHandler = global.onerror;\n\n  global.onerror = function(msg: any, url: any, line: any, column: any, error: any): boolean {\n    triggerHandlers('error', {\n      column,\n      error,\n      line,\n      msg,\n      url,\n    });\n\n    if (_oldOnErrorHandler) {\n      // eslint-disable-next-line prefer-rest-params\n      return _oldOnErrorHandler.apply(this, arguments);\n    }\n\n    return false;\n  };\n}\n\nlet _oldOnUnhandledRejectionHandler: ((e: any) => void) | null = null;\n/** JSDoc */\nfunction instrumentUnhandledRejection(): void {\n  _oldOnUnhandledRejectionHandler = global.onunhandledrejection;\n\n  global.onunhandledrejection = function(e: any): boolean {\n    triggerHandlers('unhandledrejection', e);\n\n    if (_oldOnUnhandledRejectionHandler) {\n      // eslint-disable-next-line prefer-rest-params\n      return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n    }\n\n    return true;\n  };\n}\n","/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/typedef */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n\n/** SyncPromise internal states */\nenum States {\n  /** Pending */\n  PENDING = 'PENDING',\n  /** Resolved / OK */\n  RESOLVED = 'RESOLVED',\n  /** Rejected / Error */\n  REJECTED = 'REJECTED',\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise<T> implements PromiseLike<T> {\n  private _state: States = States.PENDING;\n  private _handlers: Array<{\n    done: boolean;\n    onfulfilled?: ((value: T) => T | PromiseLike<T>) | null;\n    onrejected?: ((reason: any) => any) | null;\n  }> = [];\n  private _value: any;\n\n  public constructor(\n    executor: (resolve: (value?: T | PromiseLike<T> | null) => void, reject: (reason?: any) => void) => void,\n  ) {\n    try {\n      executor(this._resolve, this._reject);\n    } catch (e) {\n      this._reject(e);\n    }\n  }\n\n  /** JSDoc */\n  public static resolve<T>(value: T | PromiseLike<T>): PromiseLike<T> {\n    return new SyncPromise(resolve => {\n      resolve(value);\n    });\n  }\n\n  /** JSDoc */\n  public static reject<T = never>(reason?: any): PromiseLike<T> {\n    return new SyncPromise((_, reject) => {\n      reject(reason);\n    });\n  }\n\n  /** JSDoc */\n  public static all<U = any>(collection: Array<U | PromiseLike<U>>): PromiseLike<U[]> {\n    return new SyncPromise<U[]>((resolve, reject) => {\n      if (!Array.isArray(collection)) {\n        reject(new TypeError(`Promise.all requires an array as input.`));\n        return;\n      }\n\n      if (collection.length === 0) {\n        resolve([]);\n        return;\n      }\n\n      let counter = collection.length;\n      const resolvedCollection: U[] = [];\n\n      collection.forEach((item, index) => {\n        SyncPromise.resolve(item)\n          .then(value => {\n            resolvedCollection[index] = value;\n            counter -= 1;\n\n            if (counter !== 0) {\n              return;\n            }\n            resolve(resolvedCollection);\n          })\n          .then(null, reject);\n      });\n    });\n  }\n\n  /** JSDoc */\n  public then<TResult1 = T, TResult2 = never>(\n    onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,\n    onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,\n  ): PromiseLike<TResult1 | TResult2> {\n    return new SyncPromise((resolve, reject) => {\n      this._attachHandler({\n        done: false,\n        onfulfilled: result => {\n          if (!onfulfilled) {\n            // TODO: ¯\\_(ツ)_/¯\n            // TODO: FIXME\n            resolve(result as any);\n            return;\n          }\n          try {\n            resolve(onfulfilled(result));\n            return;\n          } catch (e) {\n            reject(e);\n            return;\n          }\n        },\n        onrejected: reason => {\n          if (!onrejected) {\n            reject(reason);\n            return;\n          }\n          try {\n            resolve(onrejected(reason));\n            return;\n          } catch (e) {\n            reject(e);\n            return;\n          }\n        },\n      });\n    });\n  }\n\n  /** JSDoc */\n  public catch<TResult = never>(\n    onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,\n  ): PromiseLike<T | TResult> {\n    return this.then(val => val, onrejected);\n  }\n\n  /** JSDoc */\n  public finally<TResult>(onfinally?: (() => void) | null): PromiseLike<TResult> {\n    return new SyncPromise<TResult>((resolve, reject) => {\n      let val: TResult | any;\n      let isRejected: boolean;\n\n      return this.then(\n        value => {\n          isRejected = false;\n          val = value;\n          if (onfinally) {\n            onfinally();\n          }\n        },\n        reason => {\n          isRejected = true;\n          val = reason;\n          if (onfinally) {\n            onfinally();\n          }\n        },\n      ).then(() => {\n        if (isRejected) {\n          reject(val);\n          return;\n        }\n\n        resolve((val as unknown) as any);\n      });\n    });\n  }\n\n  /** JSDoc */\n  public toString(): string {\n    return '[object SyncPromise]';\n  }\n\n  /** JSDoc */\n  private readonly _resolve = (value?: T | PromiseLike<T> | null) => {\n    this._setResult(States.RESOLVED, value);\n  };\n\n  /** JSDoc */\n  private readonly _reject = (reason?: any) => {\n    this._setResult(States.REJECTED, reason);\n  };\n\n  /** JSDoc */\n  private readonly _setResult = (state: States, value?: T | PromiseLike<T> | any) => {\n    if (this._state !== States.PENDING) {\n      return;\n    }\n\n    if (isThenable(value)) {\n      (value as PromiseLike<T>).then(this._resolve, this._reject);\n      return;\n    }\n\n    this._state = state;\n    this._value = value;\n\n    this._executeHandlers();\n  };\n\n  // TODO: FIXME\n  /** JSDoc */\n  private readonly _attachHandler = (handler: {\n    /** JSDoc */\n    done: boolean;\n    /** JSDoc */\n    onfulfilled?(value: T): any;\n    /** JSDoc */\n    onrejected?(reason: any): any;\n  }) => {\n    this._handlers = this._handlers.concat(handler);\n    this._executeHandlers();\n  };\n\n  /** JSDoc */\n  private readonly _executeHandlers = () => {\n    if (this._state === States.PENDING) {\n      return;\n    }\n\n    const cachedHandlers = this._handlers.slice();\n    this._handlers = [];\n\n    cachedHandlers.forEach(handler => {\n      if (handler.done) {\n        return;\n      }\n\n      if (this._state === States.RESOLVED) {\n        if (handler.onfulfilled) {\n          // eslint-disable-next-line @typescript-eslint/no-floating-promises\n          handler.onfulfilled((this._value as unknown) as any);\n        }\n      }\n\n      if (this._state === States.REJECTED) {\n        if (handler.onrejected) {\n          handler.onrejected(this._value);\n        }\n      }\n\n      handler.done = true;\n    });\n  };\n}\n\nexport { SyncPromise };\n","import { SentryError } from './error';\nimport { SyncPromise } from './syncpromise';\n\n/** A simple queue that holds promises. */\nexport class PromiseBuffer<T> {\n  /** Internal set of queued Promises */\n  private readonly _buffer: Array<PromiseLike<T>> = [];\n\n  public constructor(protected _limit?: number) {}\n\n  /**\n   * Says if the buffer is ready to take more requests\n   */\n  public isReady(): boolean {\n    return this._limit === undefined || this.length() < this._limit;\n  }\n\n  /**\n   * Add a promise to the queue.\n   *\n   * @param task Can be any PromiseLike<T>\n   * @returns The original promise.\n   */\n  public add(task: PromiseLike<T>): PromiseLike<T> {\n    if (!this.isReady()) {\n      return SyncPromise.reject(new SentryError('Not adding Promise due to buffer limit reached.'));\n    }\n    if (this._buffer.indexOf(task) === -1) {\n      this._buffer.push(task);\n    }\n    task\n      .then(() => this.remove(task))\n      .then(null, () =>\n        this.remove(task).then(null, () => {\n          // We have to add this catch here otherwise we have an unhandledPromiseRejection\n          // because it's a new Promise chain.\n        }),\n      );\n    return task;\n  }\n\n  /**\n   * Remove a promise to the queue.\n   *\n   * @param task Can be any PromiseLike<T>\n   * @returns Removed promise.\n   */\n  public remove(task: PromiseLike<T>): PromiseLike<T> {\n    const removedTask = this._buffer.splice(this._buffer.indexOf(task), 1)[0];\n    return removedTask;\n  }\n\n  /**\n   * This function returns the number of unresolved promises in the queue.\n   */\n  public length(): number {\n    return this._buffer.length;\n  }\n\n  /**\n   * This will drain the whole queue, returns true if queue is empty or drained.\n   * If timeout is provided and the queue takes longer to drain, the promise still resolves but with false.\n   *\n   * @param timeout Number in ms to wait until it resolves with false.\n   */\n  public drain(timeout?: number): PromiseLike<boolean> {\n    return new SyncPromise<boolean>(resolve => {\n      const capturedSetTimeout = setTimeout(() => {\n        if (timeout && timeout > 0) {\n          resolve(false);\n        }\n      }, timeout);\n      SyncPromise.all(this._buffer)\n        .then(() => {\n          clearTimeout(capturedSetTimeout);\n          resolve(true);\n        })\n        .then(null, () => {\n          resolve(true);\n        });\n    });\n  }\n}\n","import { getGlobalObject } from './misc';\nimport { dynamicRequire, isNodeEnv } from './node';\n\n/**\n * An object that can return the current timestamp in seconds since the UNIX epoch.\n */\ninterface TimestampSource {\n  nowSeconds(): number;\n}\n\n/**\n * A TimestampSource implementation for environments that do not support the Performance Web API natively.\n *\n * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier\n * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It\n * is more obvious to explain \"why does my span have negative duration\" than \"why my spans have zero duration\".\n */\nconst dateTimestampSource: TimestampSource = {\n  nowSeconds: () => Date.now() / 1000,\n};\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high resolution monotonic clock.\n */\ninterface Performance {\n  /**\n   * The millisecond timestamp at which measurement began, measured in Unix time.\n   */\n  timeOrigin: number;\n  /**\n   * Returns the current millisecond timestamp, where 0 represents the start of measurement.\n   */\n  now(): number;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction getBrowserPerformance(): Performance | undefined {\n  const { performance } = getGlobalObject<Window>();\n  if (!performance || !performance.now) {\n    return undefined;\n  }\n\n  // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n  //\n  // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n  // performance.now() gives a date arbitrarily in the past.\n  //\n  // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n  // undefined.\n  //\n  // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n  // interact with data coming out of performance entries.\n  //\n  // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n  // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n  // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n  // observed skews that can be as long as days, weeks or months.\n  //\n  // See https://github.com/getsentry/sentry-javascript/issues/2590.\n  //\n  // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n  // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n  // transactions of long-lived web pages.\n  const timeOrigin = Date.now() - performance.now();\n\n  return {\n    now: () => performance.now(),\n    timeOrigin,\n  };\n}\n\n/**\n * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't\n * implement the API.\n */\nfunction getNodePerformance(): Performance | undefined {\n  try {\n    const perfHooks = dynamicRequire(module, 'perf_hooks') as { performance: Performance };\n    return perfHooks.performance;\n  } catch (_) {\n    return undefined;\n  }\n}\n\n/**\n * The Performance API implementation for the current platform, if available.\n */\nconst platformPerformance: Performance | undefined = isNodeEnv() ? getNodePerformance() : getBrowserPerformance();\n\nconst timestampSource: TimestampSource =\n  platformPerformance === undefined\n    ? dateTimestampSource\n    : {\n        nowSeconds: () => (platformPerformance.timeOrigin + platformPerformance.now()) / 1000,\n      };\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n */\nexport const dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource);\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * See `usingPerformanceAPI` to test whether the Performance API is used.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nexport const timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource);\n\n// Re-exported with an old name for backwards-compatibility.\nexport const timestampWithMs = timestampInSeconds;\n\n/**\n * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.\n */\nexport const usingPerformanceAPI = platformPerformance !== undefined;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nexport const browserPerformanceTimeOrigin = ((): number | undefined => {\n  const { performance } = getGlobalObject<Window>();\n  if (!performance) {\n    return undefined;\n  }\n  if (performance.timeOrigin) {\n    return performance.timeOrigin;\n  }\n  // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n  // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n  // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n  // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n  // Date API.\n  // eslint-disable-next-line deprecation/deprecation\n  return (performance.timing && performance.timing.navigationStart) || Date.now();\n})();\n","/* eslint-disable max-lines */\nimport {\n  Breadcrumb,\n  CaptureContext,\n  Context,\n  Contexts,\n  Event,\n  EventHint,\n  EventProcessor,\n  Extra,\n  Extras,\n  Scope as ScopeInterface,\n  ScopeContext,\n  Severity,\n  Span,\n  Transaction,\n  User,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, getGlobalObject, isPlainObject, isThenable, SyncPromise } from '@sentry/utils';\n\nimport { Session } from './session';\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nexport class Scope implements ScopeInterface {\n  /** Flag if notifiying is happening. */\n  protected _notifyingListeners: boolean = false;\n\n  /** Callback for client to receive scope changes. */\n  protected _scopeListeners: Array<(scope: Scope) => void> = [];\n\n  /** Callback list that will be called after {@link applyToEvent}. */\n  protected _eventProcessors: EventProcessor[] = [];\n\n  /** Array of breadcrumbs. */\n  protected _breadcrumbs: Breadcrumb[] = [];\n\n  /** User */\n  protected _user: User = {};\n\n  /** Tags */\n  protected _tags: { [key: string]: string } = {};\n\n  /** Extra */\n  protected _extra: Extras = {};\n\n  /** Contexts */\n  protected _contexts: Contexts = {};\n\n  /** Fingerprint */\n  protected _fingerprint?: string[];\n\n  /** Severity */\n  protected _level?: Severity;\n\n  /** Transaction Name */\n  protected _transactionName?: string;\n\n  /** Span */\n  protected _span?: Span;\n\n  /** Session */\n  protected _session?: Session;\n\n  /**\n   * Inherit values from the parent scope.\n   * @param scope to clone.\n   */\n  public static clone(scope?: Scope): Scope {\n    const newScope = new Scope();\n    if (scope) {\n      newScope._breadcrumbs = [...scope._breadcrumbs];\n      newScope._tags = { ...scope._tags };\n      newScope._extra = { ...scope._extra };\n      newScope._contexts = { ...scope._contexts };\n      newScope._user = scope._user;\n      newScope._level = scope._level;\n      newScope._span = scope._span;\n      newScope._session = scope._session;\n      newScope._transactionName = scope._transactionName;\n      newScope._fingerprint = scope._fingerprint;\n      newScope._eventProcessors = [...scope._eventProcessors];\n    }\n    return newScope;\n  }\n\n  /**\n   * Add internal on change listener. Used for sub SDKs that need to store the scope.\n   * @hidden\n   */\n  public addScopeListener(callback: (scope: Scope) => void): void {\n    this._scopeListeners.push(callback);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addEventProcessor(callback: EventProcessor): this {\n    this._eventProcessors.push(callback);\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setUser(user: User | null): this {\n    this._user = user || {};\n    if (this._session) {\n      this._session.update({ user });\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getUser(): User | undefined {\n    return this._user;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTags(tags: { [key: string]: string }): this {\n    this._tags = {\n      ...this._tags,\n      ...tags,\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: string): this {\n    this._tags = { ...this._tags, [key]: value };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtras(extras: Extras): this {\n    this._extra = {\n      ...this._extra,\n      ...extras,\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtra(key: string, extra: Extra): this {\n    this._extra = { ...this._extra, [key]: extra };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setFingerprint(fingerprint: string[]): this {\n    this._fingerprint = fingerprint;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setLevel(level: Severity): this {\n    this._level = level;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTransactionName(name?: string): this {\n    this._transactionName = name;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * Can be removed in major version.\n   * @deprecated in favor of {@link this.setTransactionName}\n   */\n  public setTransaction(name?: string): this {\n    return this.setTransactionName(name);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setContext(key: string, context: Context | null): this {\n    if (context === null) {\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete this._contexts[key];\n    } else {\n      this._contexts = { ...this._contexts, [key]: context };\n    }\n\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setSpan(span?: Span): this {\n    this._span = span;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getSpan(): Span | undefined {\n    return this._span;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTransaction(): Transaction | undefined {\n    // often, this span will be a transaction, but it's not guaranteed to be\n    const span = this.getSpan() as undefined | (Span & { spanRecorder: { spans: Span[] } });\n\n    // try it the new way first\n    if (span?.transaction) {\n      return span?.transaction;\n    }\n\n    // fallback to the old way (known bug: this only finds transactions with sampled = true)\n    if (span?.spanRecorder?.spans[0]) {\n      return span.spanRecorder.spans[0] as Transaction;\n    }\n\n    // neither way found a transaction\n    return undefined;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setSession(session?: Session): this {\n    if (!session) {\n      delete this._session;\n    } else {\n      this._session = session;\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getSession(): Session | undefined {\n    return this._session;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public update(captureContext?: CaptureContext): this {\n    if (!captureContext) {\n      return this;\n    }\n\n    if (typeof captureContext === 'function') {\n      const updatedScope = (captureContext as <T>(scope: T) => T)(this);\n      return updatedScope instanceof Scope ? updatedScope : this;\n    }\n\n    if (captureContext instanceof Scope) {\n      this._tags = { ...this._tags, ...captureContext._tags };\n      this._extra = { ...this._extra, ...captureContext._extra };\n      this._contexts = { ...this._contexts, ...captureContext._contexts };\n      if (captureContext._user && Object.keys(captureContext._user).length) {\n        this._user = captureContext._user;\n      }\n      if (captureContext._level) {\n        this._level = captureContext._level;\n      }\n      if (captureContext._fingerprint) {\n        this._fingerprint = captureContext._fingerprint;\n      }\n    } else if (isPlainObject(captureContext)) {\n      // eslint-disable-next-line no-param-reassign\n      captureContext = captureContext as ScopeContext;\n      this._tags = { ...this._tags, ...captureContext.tags };\n      this._extra = { ...this._extra, ...captureContext.extra };\n      this._contexts = { ...this._contexts, ...captureContext.contexts };\n      if (captureContext.user) {\n        this._user = captureContext.user;\n      }\n      if (captureContext.level) {\n        this._level = captureContext.level;\n      }\n      if (captureContext.fingerprint) {\n        this._fingerprint = captureContext.fingerprint;\n      }\n    }\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clear(): this {\n    this._breadcrumbs = [];\n    this._tags = {};\n    this._extra = {};\n    this._user = {};\n    this._contexts = {};\n    this._level = undefined;\n    this._transactionName = undefined;\n    this._fingerprint = undefined;\n    this._span = undefined;\n    this._session = undefined;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n    const mergedBreadcrumb = {\n      timestamp: dateTimestampInSeconds(),\n      ...breadcrumb,\n    };\n\n    this._breadcrumbs =\n      maxBreadcrumbs !== undefined && maxBreadcrumbs >= 0\n        ? [...this._breadcrumbs, mergedBreadcrumb].slice(-maxBreadcrumbs)\n        : [...this._breadcrumbs, mergedBreadcrumb];\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clearBreadcrumbs(): this {\n    this._breadcrumbs = [];\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * Applies the current context and fingerprint to the event.\n   * Note that breadcrumbs will be added by the client.\n   * Also if the event has already breadcrumbs on it, we do not merge them.\n   * @param event Event\n   * @param hint May contain additional informartion about the original exception.\n   * @hidden\n   */\n  public applyToEvent(event: Event, hint?: EventHint): PromiseLike<Event | null> {\n    if (this._extra && Object.keys(this._extra).length) {\n      event.extra = { ...this._extra, ...event.extra };\n    }\n    if (this._tags && Object.keys(this._tags).length) {\n      event.tags = { ...this._tags, ...event.tags };\n    }\n    if (this._user && Object.keys(this._user).length) {\n      event.user = { ...this._user, ...event.user };\n    }\n    if (this._contexts && Object.keys(this._contexts).length) {\n      event.contexts = { ...this._contexts, ...event.contexts };\n    }\n    if (this._level) {\n      event.level = this._level;\n    }\n    if (this._transactionName) {\n      event.transaction = this._transactionName;\n    }\n    // We want to set the trace context for normal events only if there isn't already\n    // a trace context on the event. There is a product feature in place where we link\n    // errors with transaction and it relys on that.\n    if (this._span) {\n      event.contexts = { trace: this._span.getTraceContext(), ...event.contexts };\n      const transactionName = this._span.transaction?.name;\n      if (transactionName) {\n        event.tags = { transaction: transactionName, ...event.tags };\n      }\n    }\n\n    this._applyFingerprint(event);\n\n    event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs];\n    event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;\n\n    return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint);\n  }\n\n  /**\n   * This will be called after {@link applyToEvent} is finished.\n   */\n  protected _notifyEventProcessors(\n    processors: EventProcessor[],\n    event: Event | null,\n    hint?: EventHint,\n    index: number = 0,\n  ): PromiseLike<Event | null> {\n    return new SyncPromise<Event | null>((resolve, reject) => {\n      const processor = processors[index];\n      if (event === null || typeof processor !== 'function') {\n        resolve(event);\n      } else {\n        const result = processor({ ...event }, hint) as Event | null;\n        if (isThenable(result)) {\n          (result as PromiseLike<Event | null>)\n            .then(final => this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n            .then(null, reject);\n        } else {\n          this._notifyEventProcessors(processors, result, hint, index + 1)\n            .then(resolve)\n            .then(null, reject);\n        }\n      }\n    });\n  }\n\n  /**\n   * This will be called on every set call.\n   */\n  protected _notifyScopeListeners(): void {\n    // We need this check for this._notifyingListeners to be able to work on scope during updates\n    // If this check is not here we'll produce endless recursion when something is done with the scope\n    // during the callback.\n    if (!this._notifyingListeners) {\n      this._notifyingListeners = true;\n      this._scopeListeners.forEach(callback => {\n        callback(this);\n      });\n      this._notifyingListeners = false;\n    }\n  }\n\n  /**\n   * Applies fingerprint from the scope to the event if there's one,\n   * uses message if there's one instead or get rid of empty fingerprint\n   */\n  private _applyFingerprint(event: Event): void {\n    // Make sure it's an array first and we actually have something in place\n    event.fingerprint = event.fingerprint\n      ? Array.isArray(event.fingerprint)\n        ? event.fingerprint\n        : [event.fingerprint]\n      : [];\n\n    // If we have something on the scope, then merge it with event\n    if (this._fingerprint) {\n      event.fingerprint = event.fingerprint.concat(this._fingerprint);\n    }\n\n    // If we have no data at all, remove empty array default\n    if (event.fingerprint && !event.fingerprint.length) {\n      delete event.fingerprint;\n    }\n  }\n}\n\n/**\n * Retruns the global event processors.\n */\nfunction getGlobalEventProcessors(): EventProcessor[] {\n  /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access  */\n  const global = getGlobalObject<any>();\n  global.__SENTRY__ = global.__SENTRY__ || {};\n  global.__SENTRY__.globalEventProcessors = global.__SENTRY__.globalEventProcessors || [];\n  return global.__SENTRY__.globalEventProcessors;\n  /* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @param callback EventProcessor to add\n */\nexport function addGlobalEventProcessor(callback: EventProcessor): void {\n  getGlobalEventProcessors().push(callback);\n}\n","import { Session as SessionInterface, SessionContext, SessionStatus } from '@sentry/types';\nimport { dropUndefinedKeys, uuid4 } from '@sentry/utils';\n\n/**\n * @inheritdoc\n */\nexport class Session implements SessionInterface {\n  public userAgent?: string;\n  public errors: number = 0;\n  public release?: string;\n  public sid: string = uuid4();\n  public did?: string;\n  public timestamp: number = Date.now();\n  public started: number = Date.now();\n  public duration: number = 0;\n  public status: SessionStatus = SessionStatus.Ok;\n  public environment?: string;\n  public ipAddress?: string;\n\n  constructor(context?: Omit<SessionContext, 'started' | 'status'>) {\n    if (context) {\n      this.update(context);\n    }\n  }\n\n  /** JSDoc */\n  // eslint-disable-next-line complexity\n  update(context: SessionContext = {}): void {\n    if (context.user) {\n      if (context.user.ip_address) {\n        this.ipAddress = context.user.ip_address;\n      }\n\n      if (!context.did) {\n        this.did = context.user.id || context.user.email || context.user.username;\n      }\n    }\n\n    this.timestamp = context.timestamp || Date.now();\n\n    if (context.sid) {\n      // Good enough uuid validation. — Kamil\n      this.sid = context.sid.length === 32 ? context.sid : uuid4();\n    }\n    if (context.did) {\n      this.did = `${context.did}`;\n    }\n    if (typeof context.started === 'number') {\n      this.started = context.started;\n    }\n    if (typeof context.duration === 'number') {\n      this.duration = context.duration;\n    } else {\n      this.duration = this.timestamp - this.started;\n    }\n    if (context.release) {\n      this.release = context.release;\n    }\n    if (context.environment) {\n      this.environment = context.environment;\n    }\n    if (context.ipAddress) {\n      this.ipAddress = context.ipAddress;\n    }\n    if (context.userAgent) {\n      this.userAgent = context.userAgent;\n    }\n    if (typeof context.errors === 'number') {\n      this.errors = context.errors;\n    }\n    if (context.status) {\n      this.status = context.status;\n    }\n  }\n\n  /** JSDoc */\n  close(status?: Exclude<SessionStatus, SessionStatus.Ok>): void {\n    if (status) {\n      this.update({ status });\n    } else if (this.status === SessionStatus.Ok) {\n      this.update({ status: SessionStatus.Exited });\n    } else {\n      this.update();\n    }\n  }\n\n  /** JSDoc */\n  toJSON(): {\n    init: boolean;\n    sid: string;\n    did?: string;\n    timestamp: string;\n    started: string;\n    duration: number;\n    status: SessionStatus;\n    errors: number;\n    attrs?: {\n      release?: string;\n      environment?: string;\n      user_agent?: string;\n      ip_address?: string;\n    };\n  } {\n    return dropUndefinedKeys({\n      sid: `${this.sid}`,\n      init: true,\n      started: new Date(this.started).toISOString(),\n      timestamp: new Date(this.timestamp).toISOString(),\n      status: this.status,\n      errors: this.errors,\n      did: typeof this.did === 'number' || typeof this.did === 'string' ? `${this.did}` : undefined,\n      duration: this.duration,\n      attrs: dropUndefinedKeys({\n        release: this.release,\n        environment: this.environment,\n        ip_address: this.ipAddress,\n        user_agent: this.userAgent,\n      }),\n    });\n  }\n}\n","/* eslint-disable max-lines */\nimport {\n  Breadcrumb,\n  BreadcrumbHint,\n  Client,\n  CustomSamplingContext,\n  Event,\n  EventHint,\n  Extra,\n  Extras,\n  Hub as HubInterface,\n  Integration,\n  IntegrationClass,\n  SessionContext,\n  Severity,\n  Span,\n  SpanContext,\n  Transaction,\n  TransactionContext,\n  User,\n} from '@sentry/types';\nimport { consoleSandbox, dateTimestampInSeconds, getGlobalObject, isNodeEnv, logger, uuid4 } from '@sentry/utils';\n\nimport { Carrier, DomainAsCarrier, Layer } from './interfaces';\nimport { Scope } from './scope';\nimport { Session } from './session';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nexport const API_VERSION = 3;\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\n/**\n * Absolute maximum number of breadcrumbs added to an event. The\n * `maxBreadcrumbs` option cannot be higher than this value.\n */\nconst MAX_BREADCRUMBS = 100;\n\n/**\n * @inheritDoc\n */\nexport class Hub implements HubInterface {\n  /** Is a {@link Layer}[] containing the client and scope */\n  private readonly _stack: Layer[] = [{}];\n\n  /** Contains the last event id of a captured event.  */\n  private _lastEventId?: string;\n\n  /**\n   * Creates a new instance of the hub, will push one {@link Layer} into the\n   * internal stack on creation.\n   *\n   * @param client bound to the hub.\n   * @param scope bound to the hub.\n   * @param version number, higher number means higher priority.\n   */\n  public constructor(client?: Client, scope: Scope = new Scope(), private readonly _version: number = API_VERSION) {\n    this.getStackTop().scope = scope;\n    this.bindClient(client);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public isOlderThan(version: number): boolean {\n    return this._version < version;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public bindClient(client?: Client): void {\n    const top = this.getStackTop();\n    top.client = client;\n    if (client && client.setupIntegrations) {\n      client.setupIntegrations();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public pushScope(): Scope {\n    // We want to clone the content of prev scope\n    const scope = Scope.clone(this.getScope());\n    this.getStack().push({\n      client: this.getClient(),\n      scope,\n    });\n    return scope;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public popScope(): boolean {\n    if (this.getStack().length <= 1) return false;\n    return !!this.getStack().pop();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public withScope(callback: (scope: Scope) => void): void {\n    const scope = this.pushScope();\n    try {\n      callback(scope);\n    } finally {\n      this.popScope();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getClient<C extends Client>(): C | undefined {\n    return this.getStackTop().client as C;\n  }\n\n  /** Returns the scope of the top stack. */\n  public getScope(): Scope | undefined {\n    return this.getStackTop().scope;\n  }\n\n  /** Returns the scope stack for domains or the process. */\n  public getStack(): Layer[] {\n    return this._stack;\n  }\n\n  /** Returns the topmost scope layer in the order domain > local > process. */\n  public getStackTop(): Layer {\n    return this._stack[this._stack.length - 1];\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public captureException(exception: any, hint?: EventHint): string {\n    const eventId = (this._lastEventId = uuid4());\n    let finalHint = hint;\n\n    // If there's no explicit hint provided, mimick the same thing that would happen\n    // in the minimal itself to create a consistent behavior.\n    // We don't do this in the client, as it's the lowest level API, and doing this,\n    // would prevent user from having full control over direct calls.\n    if (!hint) {\n      let syntheticException: Error;\n      try {\n        throw new Error('Sentry syntheticException');\n      } catch (exception) {\n        syntheticException = exception as Error;\n      }\n      finalHint = {\n        originalException: exception,\n        syntheticException,\n      };\n    }\n\n    this._invokeClient('captureException', exception, {\n      ...finalHint,\n      event_id: eventId,\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureMessage(message: string, level?: Severity, hint?: EventHint): string {\n    const eventId = (this._lastEventId = uuid4());\n    let finalHint = hint;\n\n    // If there's no explicit hint provided, mimick the same thing that would happen\n    // in the minimal itself to create a consistent behavior.\n    // We don't do this in the client, as it's the lowest level API, and doing this,\n    // would prevent user from having full control over direct calls.\n    if (!hint) {\n      let syntheticException: Error;\n      try {\n        throw new Error(message);\n      } catch (exception) {\n        syntheticException = exception as Error;\n      }\n      finalHint = {\n        originalException: message,\n        syntheticException,\n      };\n    }\n\n    this._invokeClient('captureMessage', message, level, {\n      ...finalHint,\n      event_id: eventId,\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureEvent(event: Event, hint?: EventHint): string {\n    const eventId = (this._lastEventId = uuid4());\n    this._invokeClient('captureEvent', event, {\n      ...hint,\n      event_id: eventId,\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public lastEventId(): string | undefined {\n    return this._lastEventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void {\n    const { scope, client } = this.getStackTop();\n\n    if (!scope || !client) return;\n\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n      (client.getOptions && client.getOptions()) || {};\n\n    if (maxBreadcrumbs <= 0) return;\n\n    const timestamp = dateTimestampInSeconds();\n    const mergedBreadcrumb = { timestamp, ...breadcrumb };\n    const finalBreadcrumb = beforeBreadcrumb\n      ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) as Breadcrumb | null)\n      : mergedBreadcrumb;\n\n    if (finalBreadcrumb === null) return;\n\n    scope.addBreadcrumb(finalBreadcrumb, Math.min(maxBreadcrumbs, MAX_BREADCRUMBS));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setUser(user: User | null): void {\n    const scope = this.getScope();\n    if (scope) scope.setUser(user);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTags(tags: { [key: string]: string }): void {\n    const scope = this.getScope();\n    if (scope) scope.setTags(tags);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtras(extras: Extras): void {\n    const scope = this.getScope();\n    if (scope) scope.setExtras(extras);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: string): void {\n    const scope = this.getScope();\n    if (scope) scope.setTag(key, value);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtra(key: string, extra: Extra): void {\n    const scope = this.getScope();\n    if (scope) scope.setExtra(key, extra);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  public setContext(name: string, context: { [key: string]: any } | null): void {\n    const scope = this.getScope();\n    if (scope) scope.setContext(name, context);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public configureScope(callback: (scope: Scope) => void): void {\n    const { scope, client } = this.getStackTop();\n    if (scope && client) {\n      callback(scope);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public run(callback: (hub: Hub) => void): void {\n    const oldHub = makeMain(this);\n    try {\n      callback(this);\n    } finally {\n      makeMain(oldHub);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {\n    const client = this.getClient();\n    if (!client) return null;\n    try {\n      return client.getIntegration(integration);\n    } catch (_oO) {\n      logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n      return null;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startSpan(context: SpanContext): Span {\n    return this._callExtensionMethod('startSpan', context);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction {\n    return this._callExtensionMethod('startTransaction', context, customSamplingContext);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public traceHeaders(): { [key: string]: string } {\n    return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startSession(context?: SessionContext): Session {\n    // End existing session if there's one\n    this.endSession();\n\n    const { scope, client } = this.getStackTop();\n    const { release, environment } = (client && client.getOptions()) || {};\n    const session = new Session({\n      release,\n      environment,\n      ...(scope && { user: scope.getUser() }),\n      ...context,\n    });\n    if (scope) {\n      scope.setSession(session);\n    }\n    return session;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public endSession(): void {\n    const { scope, client } = this.getStackTop();\n    if (!scope) return;\n\n    const session = scope.getSession && scope.getSession();\n    if (session) {\n      session.close();\n      if (client && client.captureSession) {\n        client.captureSession(session);\n      }\n      scope.setSession();\n    }\n  }\n\n  /**\n   * Internal helper function to call a method on the top client if it exists.\n   *\n   * @param method The method to call on the client.\n   * @param args Arguments to pass to the client function.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _invokeClient<M extends keyof Client>(method: M, ...args: any[]): void {\n    const { scope, client } = this.getStackTop();\n    if (client && client[method]) {\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n      (client as any)[method](...args, scope);\n    }\n  }\n\n  /**\n   * Calls global extension method and binding current instance to the function call\n   */\n  // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _callExtensionMethod<T>(method: string, ...args: any[]): T {\n    const carrier = getMainCarrier();\n    const sentry = carrier.__SENTRY__;\n    if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n      return sentry.extensions[method].apply(this, args);\n    }\n    logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n  }\n}\n\n/** Returns the global shim registry. */\nexport function getMainCarrier(): Carrier {\n  const carrier = getGlobalObject();\n  carrier.__SENTRY__ = carrier.__SENTRY__ || {\n    extensions: {},\n    hub: undefined,\n  };\n  return carrier;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n */\nexport function makeMain(hub: Hub): Hub {\n  const registry = getMainCarrier();\n  const oldHub = getHubFromCarrier(registry);\n  setHubOnCarrier(registry, hub);\n  return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n */\nexport function getCurrentHub(): Hub {\n  // Get main carrier (global for every environment)\n  const registry = getMainCarrier();\n\n  // If there's no hub, or its an old API, assign a new one\n  if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {\n    setHubOnCarrier(registry, new Hub());\n  }\n\n  // Prefer domains over global if they are there (applicable only to Node environment)\n  if (isNodeEnv()) {\n    return getHubFromActiveDomain(registry);\n  }\n  // Return hub that lives on a global object\n  return getHubFromCarrier(registry);\n}\n\n/**\n * Returns the active domain, if one exists\n *\n * @returns The domain, or undefined if there is no active domain\n */\nexport function getActiveDomain(): DomainAsCarrier | undefined {\n  const sentry = getMainCarrier().__SENTRY__;\n\n  return sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active;\n}\n\n/**\n * Try to read the hub from an active domain, and fallback to the registry if one doesn't exist\n * @returns discovered hub\n */\nfunction getHubFromActiveDomain(registry: Carrier): Hub {\n  try {\n    const activeDomain = getActiveDomain();\n\n    // If there's no active domain, just return global hub\n    if (!activeDomain) {\n      return getHubFromCarrier(registry);\n    }\n\n    // If there's no hub on current domain, or it's an old API, assign a new one\n    if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) {\n      const registryHubTopStack = getHubFromCarrier(registry).getStackTop();\n      setHubOnCarrier(activeDomain, new Hub(registryHubTopStack.client, Scope.clone(registryHubTopStack.scope)));\n    }\n\n    // Return hub that lives on a domain\n    return getHubFromCarrier(activeDomain);\n  } catch (_Oo) {\n    // Return hub that lives on a global object\n    return getHubFromCarrier(registry);\n  }\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier: Carrier): boolean {\n  return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\nexport function getHubFromCarrier(carrier: Carrier): Hub {\n  if (carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub) return carrier.__SENTRY__.hub;\n  carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n  carrier.__SENTRY__.hub = new Hub();\n  return carrier.__SENTRY__.hub;\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n */\nexport function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean {\n  if (!carrier) return false;\n  carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n  carrier.__SENTRY__.hub = hub;\n  return true;\n}\n","import { getCurrentHub, Hub, Scope } from '@sentry/hub';\nimport {\n  Breadcrumb,\n  CaptureContext,\n  CustomSamplingContext,\n  Event,\n  Extra,\n  Extras,\n  Severity,\n  Transaction,\n  TransactionContext,\n  User,\n} from '@sentry/types';\n\n/**\n * This calls a function on the current hub.\n * @param method function to call on hub.\n * @param args to pass to function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction callOnHub<T>(method: string, ...args: any[]): T {\n  const hub = getCurrentHub();\n  if (hub && hub[method as keyof Hub]) {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return (hub[method as keyof Hub] as any)(...args);\n  }\n  throw new Error(`No hub defined or ${method} was not found on the hub, please open a bug report.`);\n}\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception An exception-like object.\n * @returns The generated eventId.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nexport function captureException(exception: any, captureContext?: CaptureContext): string {\n  let syntheticException: Error;\n  try {\n    throw new Error('Sentry syntheticException');\n  } catch (exception) {\n    syntheticException = exception as Error;\n  }\n  return callOnHub('captureException', exception, {\n    captureContext,\n    originalException: exception,\n    syntheticException,\n  });\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param level Define the level of the message.\n * @returns The generated eventId.\n */\nexport function captureMessage(message: string, captureContext?: CaptureContext | Severity): string {\n  let syntheticException: Error;\n  try {\n    throw new Error(message);\n  } catch (exception) {\n    syntheticException = exception as Error;\n  }\n\n  // This is necessary to provide explicit scopes upgrade, without changing the original\n  // arity of the `captureMessage(message, level)` method.\n  const level = typeof captureContext === 'string' ? captureContext : undefined;\n  const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n\n  return callOnHub('captureMessage', message, level, {\n    originalException: message,\n    syntheticException,\n    ...context,\n  });\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @returns The generated eventId.\n */\nexport function captureEvent(event: Event): string {\n  return callOnHub('captureEvent', event);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\nexport function configureScope(callback: (scope: Scope) => void): void {\n  callOnHub<void>('configureScope', callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\nexport function addBreadcrumb(breadcrumb: Breadcrumb): void {\n  callOnHub<void>('addBreadcrumb', breadcrumb);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setContext(name: string, context: { [key: string]: any } | null): void {\n  callOnHub<void>('setContext', name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nexport function setExtras(extras: Extras): void {\n  callOnHub<void>('setExtras', extras);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nexport function setTags(tags: { [key: string]: string }): void {\n  callOnHub<void>('setTags', tags);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\nexport function setExtra(key: string, extra: Extra): void {\n  callOnHub<void>('setExtra', key, extra);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n * @param key String key of tag\n * @param value String value of tag\n */\nexport function setTag(key: string, value: string): void {\n  callOnHub<void>('setTag', key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nexport function setUser(user: User | null): void {\n  callOnHub<void>('setUser', user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n *     pushScope();\n *     callback();\n *     popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope(callback: (scope: Scope) => void): void {\n  callOnHub<void>('withScope', callback);\n}\n\n/**\n * Calls a function on the latest client. Use this with caution, it's meant as\n * in \"internal\" helper so we don't need to expose every possible function in\n * the shim. It is not guaranteed that the client actually implements the\n * function.\n *\n * @param method The method to call on the client/client.\n * @param args Arguments to pass to the client/fontend.\n * @hidden\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function _callOnClient(method: string, ...args: any[]): void {\n  callOnHub<void>('_invokeClient', method, ...args);\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n */\nexport function startTransaction(\n  context: TransactionContext,\n  customSamplingContext?: CustomSamplingContext,\n): Transaction {\n  return callOnHub('startTransaction', { ...context }, customSamplingContext);\n}\n","import { DsnLike } from '@sentry/types';\nimport { Dsn, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Helper class to provide urls to different Sentry endpoints. */\nexport class API {\n  /** The internally used Dsn object. */\n  private readonly _dsnObject: Dsn;\n  /** Create a new instance of API */\n  public constructor(public dsn: DsnLike) {\n    this._dsnObject = new Dsn(dsn);\n  }\n\n  /** Returns the Dsn object. */\n  public getDsn(): Dsn {\n    return this._dsnObject;\n  }\n\n  /** Returns the prefix to construct Sentry ingestion API endpoints. */\n  public getBaseApiEndpoint(): string {\n    const dsn = this._dsnObject;\n    const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n    const port = dsn.port ? `:${dsn.port}` : '';\n    return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n  }\n\n  /** Returns the store endpoint URL. */\n  public getStoreEndpoint(): string {\n    return this._getIngestEndpoint('store');\n  }\n\n  /**\n   * Returns the store endpoint URL with auth in the query string.\n   *\n   * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n   */\n  public getStoreEndpointWithUrlEncodedAuth(): string {\n    return `${this.getStoreEndpoint()}?${this._encodedAuth()}`;\n  }\n\n  /**\n   * Returns the envelope endpoint URL with auth in the query string.\n   *\n   * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n   */\n  public getEnvelopeEndpointWithUrlEncodedAuth(): string {\n    return `${this._getEnvelopeEndpoint()}?${this._encodedAuth()}`;\n  }\n\n  /** Returns only the path component for the store endpoint. */\n  public getStoreEndpointPath(): string {\n    const dsn = this._dsnObject;\n    return `${dsn.path ? `/${dsn.path}` : ''}/api/${dsn.projectId}/store/`;\n  }\n\n  /**\n   * Returns an object that can be used in request headers.\n   * This is needed for node and the old /store endpoint in sentry\n   */\n  public getRequestHeaders(clientName: string, clientVersion: string): { [key: string]: string } {\n    const dsn = this._dsnObject;\n    const header = [`Sentry sentry_version=${SENTRY_API_VERSION}`];\n    header.push(`sentry_client=${clientName}/${clientVersion}`);\n    header.push(`sentry_key=${dsn.user}`);\n    if (dsn.pass) {\n      header.push(`sentry_secret=${dsn.pass}`);\n    }\n    return {\n      'Content-Type': 'application/json',\n      'X-Sentry-Auth': header.join(', '),\n    };\n  }\n\n  /** Returns the url to the report dialog endpoint. */\n  public getReportDialogEndpoint(\n    dialogOptions: {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      [key: string]: any;\n      user?: { name?: string; email?: string };\n    } = {},\n  ): string {\n    const dsn = this._dsnObject;\n    const endpoint = `${this.getBaseApiEndpoint()}embed/error-page/`;\n\n    const encodedOptions = [];\n    encodedOptions.push(`dsn=${dsn.toString()}`);\n    for (const key in dialogOptions) {\n      if (key === 'dsn') {\n        continue;\n      }\n\n      if (key === 'user') {\n        if (!dialogOptions.user) {\n          continue;\n        }\n        if (dialogOptions.user.name) {\n          encodedOptions.push(`name=${encodeURIComponent(dialogOptions.user.name)}`);\n        }\n        if (dialogOptions.user.email) {\n          encodedOptions.push(`email=${encodeURIComponent(dialogOptions.user.email)}`);\n        }\n      } else {\n        encodedOptions.push(`${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] as string)}`);\n      }\n    }\n    if (encodedOptions.length) {\n      return `${endpoint}?${encodedOptions.join('&')}`;\n    }\n\n    return endpoint;\n  }\n\n  /** Returns the envelope endpoint URL. */\n  private _getEnvelopeEndpoint(): string {\n    return this._getIngestEndpoint('envelope');\n  }\n\n  /** Returns the ingest API endpoint for target. */\n  private _getIngestEndpoint(target: 'store' | 'envelope'): string {\n    const base = this.getBaseApiEndpoint();\n    const dsn = this._dsnObject;\n    return `${base}${dsn.projectId}/${target}/`;\n  }\n\n  /** Returns a URL-encoded string with auth config suitable for a query string. */\n  private _encodedAuth(): string {\n    const dsn = this._dsnObject;\n    const auth = {\n      // We send only the minimum set of required information. See\n      // https://github.com/getsentry/sentry-javascript/issues/2572.\n      sentry_key: dsn.user,\n      sentry_version: SENTRY_API_VERSION,\n    };\n    return urlEncode(auth);\n  }\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { Integration, Options } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nexport const installedIntegrations: string[] = [];\n\n/** Map of integrations assigned to a client */\nexport interface IntegrationIndex {\n  [key: string]: Integration;\n}\n\n/** Gets integration to install */\nexport function getIntegrationsToSetup(options: Options): Integration[] {\n  const defaultIntegrations = (options.defaultIntegrations && [...options.defaultIntegrations]) || [];\n  const userIntegrations = options.integrations;\n  let integrations: Integration[] = [];\n  if (Array.isArray(userIntegrations)) {\n    const userIntegrationsNames = userIntegrations.map(i => i.name);\n    const pickedIntegrationsNames: string[] = [];\n\n    // Leave only unique default integrations, that were not overridden with provided user integrations\n    defaultIntegrations.forEach(defaultIntegration => {\n      if (\n        userIntegrationsNames.indexOf(defaultIntegration.name) === -1 &&\n        pickedIntegrationsNames.indexOf(defaultIntegration.name) === -1\n      ) {\n        integrations.push(defaultIntegration);\n        pickedIntegrationsNames.push(defaultIntegration.name);\n      }\n    });\n\n    // Don't add same user integration twice\n    userIntegrations.forEach(userIntegration => {\n      if (pickedIntegrationsNames.indexOf(userIntegration.name) === -1) {\n        integrations.push(userIntegration);\n        pickedIntegrationsNames.push(userIntegration.name);\n      }\n    });\n  } else if (typeof userIntegrations === 'function') {\n    integrations = userIntegrations(defaultIntegrations);\n    integrations = Array.isArray(integrations) ? integrations : [integrations];\n  } else {\n    integrations = [...defaultIntegrations];\n  }\n\n  // Make sure that if present, `Debug` integration will always run last\n  const integrationsNames = integrations.map(i => i.name);\n  const alwaysLastToRun = 'Debug';\n  if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {\n    integrations.push(...integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1));\n  }\n\n  return integrations;\n}\n\n/** Setup given integration */\nexport function setupIntegration(integration: Integration): void {\n  if (installedIntegrations.indexOf(integration.name) !== -1) {\n    return;\n  }\n  integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n  installedIntegrations.push(integration.name);\n  logger.log(`Integration installed: ${integration.name}`);\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nexport function setupIntegrations<O extends Options>(options: O): IntegrationIndex {\n  const integrations: IntegrationIndex = {};\n  getIntegrationsToSetup(options).forEach(integration => {\n    integrations[integration.name] = integration;\n    setupIntegration(integration);\n  });\n  return integrations;\n}\n","/* eslint-disable max-lines */\nimport { Scope, Session } from '@sentry/hub';\nimport {\n  Client,\n  Event,\n  EventHint,\n  Integration,\n  IntegrationClass,\n  Options,\n  SessionStatus,\n  Severity,\n} from '@sentry/types';\nimport {\n  dateTimestampInSeconds,\n  Dsn,\n  isPrimitive,\n  isThenable,\n  logger,\n  normalize,\n  SentryError,\n  SyncPromise,\n  truncate,\n  uuid4,\n} from '@sentry/utils';\n\nimport { Backend, BackendClass } from './basebackend';\nimport { IntegrationIndex, setupIntegrations } from './integration';\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding backend constructor and options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}. Also, the Backend instance is available via\n * {@link Client.getBackend}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event via the backend, it is passed through\n * {@link BaseClient.prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient<NodeBackend, NodeOptions> {\n *   public constructor(options: NodeOptions) {\n *     super(NodeBackend, options);\n *   }\n *\n *   // ...\n * }\n */\nexport abstract class BaseClient<B extends Backend, O extends Options> implements Client<O> {\n  /**\n   * The backend used to physically interact in the environment. Usually, this\n   * will correspond to the client. When composing SDKs, however, the Backend\n   * from the root SDK will be used.\n   */\n  protected readonly _backend: B;\n\n  /** Options passed to the SDK. */\n  protected readonly _options: O;\n\n  /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n  protected readonly _dsn?: Dsn;\n\n  /** Array of used integrations. */\n  protected _integrations: IntegrationIndex = {};\n\n  /** Number of call being processed */\n  protected _processing: number = 0;\n\n  /**\n   * Initializes this client instance.\n   *\n   * @param backendClass A constructor function to create the backend.\n   * @param options Options for the client.\n   */\n  protected constructor(backendClass: BackendClass<B, O>, options: O) {\n    this._backend = new backendClass(options);\n    this._options = options;\n\n    if (options.dsn) {\n      this._dsn = new Dsn(options.dsn);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n    let eventId: string | undefined = hint && hint.event_id;\n\n    this._process(\n      this._getBackend()\n        .eventFromException(exception, hint)\n        .then(event => this._captureEvent(event, hint, scope))\n        .then(result => {\n          eventId = result;\n        }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureMessage(message: string, level?: Severity, hint?: EventHint, scope?: Scope): string | undefined {\n    let eventId: string | undefined = hint && hint.event_id;\n\n    const promisedEvent = isPrimitive(message)\n      ? this._getBackend().eventFromMessage(`${message}`, level, hint)\n      : this._getBackend().eventFromException(message, hint);\n\n    this._process(\n      promisedEvent\n        .then(event => this._captureEvent(event, hint, scope))\n        .then(result => {\n          eventId = result;\n        }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n    let eventId: string | undefined = hint && hint.event_id;\n\n    this._process(\n      this._captureEvent(event, hint, scope).then(result => {\n        eventId = result;\n      }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureSession(session: Session): void {\n    if (!session.release) {\n      logger.warn('Discarded session because of missing release');\n    } else {\n      this._sendSession(session);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getDsn(): Dsn | undefined {\n    return this._dsn;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getOptions(): O {\n    return this._options;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public flush(timeout?: number): PromiseLike<boolean> {\n    return this._isClientProcessing(timeout).then(ready => {\n      return this._getBackend()\n        .getTransport()\n        .close(timeout)\n        .then(transportFlushed => ready && transportFlushed);\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public close(timeout?: number): PromiseLike<boolean> {\n    return this.flush(timeout).then(result => {\n      this.getOptions().enabled = false;\n      return result;\n    });\n  }\n\n  /**\n   * Sets up the integrations\n   */\n  public setupIntegrations(): void {\n    if (this._isEnabled()) {\n      this._integrations = setupIntegrations(this._options);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {\n    try {\n      return (this._integrations[integration.id] as T) || null;\n    } catch (_oO) {\n      logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n      return null;\n    }\n  }\n\n  /** Updates existing session based on the provided event */\n  protected _updateSessionFromEvent(session: Session, event: Event): void {\n    let crashed = false;\n    let errored = false;\n    let userAgent;\n    const exceptions = event.exception && event.exception.values;\n\n    if (exceptions) {\n      errored = true;\n\n      for (const ex of exceptions) {\n        const mechanism = ex.mechanism;\n        if (mechanism && mechanism.handled === false) {\n          crashed = true;\n          break;\n        }\n      }\n    }\n\n    const user = event.user;\n    if (!session.userAgent) {\n      const headers = event.request ? event.request.headers : {};\n      for (const key in headers) {\n        if (key.toLowerCase() === 'user-agent') {\n          userAgent = headers[key];\n          break;\n        }\n      }\n    }\n\n    session.update({\n      ...(crashed && { status: SessionStatus.Crashed }),\n      user,\n      userAgent,\n      errors: session.errors + Number(errored || crashed),\n    });\n  }\n\n  /** Deliver captured session to Sentry */\n  protected _sendSession(session: Session): void {\n    this._getBackend().sendSession(session);\n  }\n\n  /** Waits for the client to be done with processing. */\n  protected _isClientProcessing(timeout?: number): PromiseLike<boolean> {\n    return new SyncPromise(resolve => {\n      let ticked: number = 0;\n      const tick: number = 1;\n\n      const interval = setInterval(() => {\n        if (this._processing == 0) {\n          clearInterval(interval);\n          resolve(true);\n        } else {\n          ticked += tick;\n          if (timeout && ticked >= timeout) {\n            clearInterval(interval);\n            resolve(false);\n          }\n        }\n      }, tick);\n    });\n  }\n\n  /** Returns the current backend. */\n  protected _getBackend(): B {\n    return this._backend;\n  }\n\n  /** Determines whether this SDK is enabled and a valid Dsn is present. */\n  protected _isEnabled(): boolean {\n    return this.getOptions().enabled !== false && this._dsn !== undefined;\n  }\n\n  /**\n   * Adds common information to events.\n   *\n   * The information includes release and environment from `options`,\n   * breadcrumbs and context (extra, tags and user) from the scope.\n   *\n   * Information that is already present in the event is never overwritten. For\n   * nested objects, such as the context, keys are merged.\n   *\n   * @param event The original event.\n   * @param hint May contain additional information about the original exception.\n   * @param scope A scope containing event metadata.\n   * @returns A new event with more information.\n   */\n  protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike<Event | null> {\n    const { normalizeDepth = 3 } = this.getOptions();\n    const prepared: Event = {\n      ...event,\n      event_id: event.event_id || (hint && hint.event_id ? hint.event_id : uuid4()),\n      timestamp: event.timestamp || dateTimestampInSeconds(),\n    };\n\n    this._applyClientOptions(prepared);\n    this._applyIntegrationsMetadata(prepared);\n\n    // If we have scope given to us, use it as the base for further modifications.\n    // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n    let finalScope = scope;\n    if (hint && hint.captureContext) {\n      finalScope = Scope.clone(finalScope).update(hint.captureContext);\n    }\n\n    // We prepare the result here with a resolved Event.\n    let result = SyncPromise.resolve<Event | null>(prepared);\n\n    // This should be the last thing called, since we want that\n    // {@link Hub.addEventProcessor} gets the finished prepared event.\n    if (finalScope) {\n      // In case we have a hub we reassign it.\n      result = finalScope.applyToEvent(prepared, hint);\n    }\n\n    return result.then(evt => {\n      if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n        return this._normalizeEvent(evt, normalizeDepth);\n      }\n      return evt;\n    });\n  }\n\n  /**\n   * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n   * Normalized keys:\n   * - `breadcrumbs.data`\n   * - `user`\n   * - `contexts`\n   * - `extra`\n   * @param event Event\n   * @returns Normalized event\n   */\n  protected _normalizeEvent(event: Event | null, depth: number): Event | null {\n    if (!event) {\n      return null;\n    }\n\n    const normalized = {\n      ...event,\n      ...(event.breadcrumbs && {\n        breadcrumbs: event.breadcrumbs.map(b => ({\n          ...b,\n          ...(b.data && {\n            data: normalize(b.data, depth),\n          }),\n        })),\n      }),\n      ...(event.user && {\n        user: normalize(event.user, depth),\n      }),\n      ...(event.contexts && {\n        contexts: normalize(event.contexts, depth),\n      }),\n      ...(event.extra && {\n        extra: normalize(event.extra, depth),\n      }),\n    };\n    // event.contexts.trace stores information about a Transaction. Similarly,\n    // event.spans[] stores information about child Spans. Given that a\n    // Transaction is conceptually a Span, normalization should apply to both\n    // Transactions and Spans consistently.\n    // For now the decision is to skip normalization of Transactions and Spans,\n    // so this block overwrites the normalized event to add back the original\n    // Transaction information prior to normalization.\n    if (event.contexts && event.contexts.trace) {\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      normalized.contexts.trace = event.contexts.trace;\n    }\n    return normalized;\n  }\n\n  /**\n   *  Enhances event using the client configuration.\n   *  It takes care of all \"static\" values like environment, release and `dist`,\n   *  as well as truncating overly long values.\n   * @param event event instance to be enhanced\n   */\n  protected _applyClientOptions(event: Event): void {\n    const options = this.getOptions();\n    const { environment, release, dist, maxValueLength = 250 } = options;\n\n    if (!('environment' in event)) {\n      event.environment = 'environment' in options ? environment : 'production';\n    }\n\n    if (event.release === undefined && release !== undefined) {\n      event.release = release;\n    }\n\n    if (event.dist === undefined && dist !== undefined) {\n      event.dist = dist;\n    }\n\n    if (event.message) {\n      event.message = truncate(event.message, maxValueLength);\n    }\n\n    const exception = event.exception && event.exception.values && event.exception.values[0];\n    if (exception && exception.value) {\n      exception.value = truncate(exception.value, maxValueLength);\n    }\n\n    const request = event.request;\n    if (request && request.url) {\n      request.url = truncate(request.url, maxValueLength);\n    }\n  }\n\n  /**\n   * This function adds all used integrations to the SDK info in the event.\n   * @param sdkInfo The sdkInfo of the event that will be filled with all integrations.\n   */\n  protected _applyIntegrationsMetadata(event: Event): void {\n    const sdkInfo = event.sdk;\n    const integrationsArray = Object.keys(this._integrations);\n    if (sdkInfo && integrationsArray.length > 0) {\n      sdkInfo.integrations = integrationsArray;\n    }\n  }\n\n  /**\n   * Tells the backend to send this event\n   * @param event The Sentry event to send\n   */\n  protected _sendEvent(event: Event): void {\n    this._getBackend().sendEvent(event);\n  }\n\n  /**\n   * Processes the event and logs an error in case of rejection\n   * @param event\n   * @param hint\n   * @param scope\n   */\n  protected _captureEvent(event: Event, hint?: EventHint, scope?: Scope): PromiseLike<string | undefined> {\n    return this._processEvent(event, hint, scope).then(\n      finalEvent => {\n        return finalEvent.event_id;\n      },\n      reason => {\n        logger.error(reason);\n        return undefined;\n      },\n    );\n  }\n\n  /**\n   * Processes an event (either error or message) and sends it to Sentry.\n   *\n   * This also adds breadcrumbs and context information to the event. However,\n   * platform specific meta data (such as the User's IP address) must be added\n   * by the SDK implementor.\n   *\n   *\n   * @param event The event to send to Sentry.\n   * @param hint May contain additional information about the original exception.\n   * @param scope A scope containing event metadata.\n   * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n   */\n  protected _processEvent(event: Event, hint?: EventHint, scope?: Scope): PromiseLike<Event> {\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    const { beforeSend, sampleRate } = this.getOptions();\n\n    if (!this._isEnabled()) {\n      return SyncPromise.reject(new SentryError('SDK not enabled, will not send event.'));\n    }\n\n    const isTransaction = event.type === 'transaction';\n    // 1.0 === 100% events are sent\n    // 0.0 === 0% events are sent\n    // Sampling for transaction happens somewhere else\n    if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n      return SyncPromise.reject(new SentryError('This event has been sampled, will not send event.'));\n    }\n\n    return this._prepareEvent(event, scope, hint)\n      .then(prepared => {\n        if (prepared === null) {\n          throw new SentryError('An event processor returned null, will not send event.');\n        }\n\n        const isInternalException = hint && hint.data && (hint.data as { __sentry__: boolean }).__sentry__ === true;\n        if (isInternalException || isTransaction || !beforeSend) {\n          return prepared;\n        }\n\n        const beforeSendResult = beforeSend(prepared, hint);\n        if (typeof beforeSendResult === 'undefined') {\n          throw new SentryError('`beforeSend` method has to return `null` or a valid event.');\n        } else if (isThenable(beforeSendResult)) {\n          return (beforeSendResult as PromiseLike<Event | null>).then(\n            event => event,\n            e => {\n              throw new SentryError(`beforeSend rejected with ${e}`);\n            },\n          );\n        }\n        return beforeSendResult;\n      })\n      .then(processedEvent => {\n        if (processedEvent === null) {\n          throw new SentryError('`beforeSend` returned `null`, will not send event.');\n        }\n\n        const session = scope && scope.getSession && scope.getSession();\n        if (!isTransaction && session) {\n          this._updateSessionFromEvent(session, processedEvent);\n        }\n\n        this._sendEvent(processedEvent);\n        return processedEvent;\n      })\n      .then(null, reason => {\n        if (reason instanceof SentryError) {\n          throw reason;\n        }\n\n        this.captureException(reason, {\n          data: {\n            __sentry__: true,\n          },\n          originalException: reason as Error,\n        });\n        throw new SentryError(\n          `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n        );\n      });\n  }\n\n  /**\n   * Occupies the client with processing and event\n   */\n  protected _process<T>(promise: PromiseLike<T>): void {\n    this._processing += 1;\n    promise.then(\n      value => {\n        this._processing -= 1;\n        return value;\n      },\n      reason => {\n        this._processing -= 1;\n        return reason;\n      },\n    );\n  }\n}\n","import { Integration, WrappedFunction } from '@sentry/types';\n\nlet originalFunctionToString: () => void;\n\n/** Patch toString calls to return proper name for wrapped functions */\nexport class FunctionToString implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'FunctionToString';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = FunctionToString.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    originalFunctionToString = Function.prototype.toString;\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    Function.prototype.toString = function(this: WrappedFunction, ...args: any[]): string {\n      const context = this.__sentry_original__ || this;\n      return originalFunctionToString.apply(context, args);\n    };\n  }\n}\n","import { Event, Response, Status, Transport } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\n/** Noop transport */\nexport class NoopTransport implements Transport {\n  /**\n   * @inheritDoc\n   */\n  public sendEvent(_: Event): PromiseLike<Response> {\n    return SyncPromise.resolve({\n      reason: `NoopTransport: Event has been skipped because no Dsn is configured.`,\n      status: Status.Skipped,\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public close(_?: number): PromiseLike<boolean> {\n    return SyncPromise.resolve(true);\n  }\n}\n","import { Event, EventHint, Options, Session, Severity, Transport } from '@sentry/types';\nimport { logger, SentryError } from '@sentry/utils';\n\nimport { NoopTransport } from './transports/noop';\n\n/**\n * Internal platform-dependent Sentry SDK Backend.\n *\n * While {@link Client} contains business logic specific to an SDK, the\n * Backend offers platform specific implementations for low-level operations.\n * These are persisting and loading information, sending events, and hooking\n * into the environment.\n *\n * Backends receive a handle to the Client in their constructor. When a\n * Backend automatically generates events, it must pass them to\n * the Client for validation and processing first.\n *\n * Usually, the Client will be of corresponding type, e.g. NodeBackend\n * receives NodeClient. However, higher-level SDKs can choose to instantiate\n * multiple Backends and delegate tasks between them. In this case, an event\n * generated by one backend might very well be sent by another one.\n *\n * The client also provides access to options via {@link Client.getOptions}.\n * @hidden\n */\nexport interface Backend {\n  /** Creates a {@link Event} from an exception. */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;\n\n  /** Creates a {@link Event} from a plain message. */\n  eventFromMessage(message: string, level?: Severity, hint?: EventHint): PromiseLike<Event>;\n\n  /** Submits the event to Sentry */\n  sendEvent(event: Event): void;\n\n  /** Submits the session to Sentry */\n  sendSession(session: Session): void;\n\n  /**\n   * Returns the transport that is used by the backend.\n   * Please note that the transport gets lazy initialized so it will only be there once the first event has been sent.\n   *\n   * @returns The transport.\n   */\n  getTransport(): Transport;\n}\n\n/**\n * A class object that can instantiate Backend objects.\n * @hidden\n */\nexport type BackendClass<B extends Backend, O extends Options> = new (options: O) => B;\n\n/**\n * This is the base implemention of a Backend.\n * @hidden\n */\nexport abstract class BaseBackend<O extends Options> implements Backend {\n  /** Options passed to the SDK. */\n  protected readonly _options: O;\n\n  /** Cached transport used internally. */\n  protected _transport: Transport;\n\n  /** Creates a new backend instance. */\n  public constructor(options: O) {\n    this._options = options;\n    if (!this._options.dsn) {\n      logger.warn('No DSN provided, backend will not do anything.');\n    }\n    this._transport = this._setupTransport();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public eventFromException(_exception: any, _hint?: EventHint): PromiseLike<Event> {\n    throw new SentryError('Backend has to implement `eventFromException` method');\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public eventFromMessage(_message: string, _level?: Severity, _hint?: EventHint): PromiseLike<Event> {\n    throw new SentryError('Backend has to implement `eventFromMessage` method');\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendEvent(event: Event): void {\n    this._transport.sendEvent(event).then(null, reason => {\n      logger.error(`Error while sending event: ${reason}`);\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendSession(session: Session): void {\n    if (!this._transport.sendSession) {\n      logger.warn(\"Dropping session because custom transport doesn't implement sendSession\");\n      return;\n    }\n\n    this._transport.sendSession(session).then(null, reason => {\n      logger.error(`Error while sending session: ${reason}`);\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTransport(): Transport {\n    return this._transport;\n  }\n\n  /**\n   * Sets up the transport so it can be used later to send requests.\n   */\n  protected _setupTransport(): Transport {\n    return new NoopTransport();\n  }\n}\n","import { Event, SentryRequest, Session } from '@sentry/types';\n\nimport { API } from './api';\n\n/** Creates a SentryRequest from an event. */\nexport function sessionToSentryRequest(session: Session, api: API): SentryRequest {\n  const envelopeHeaders = JSON.stringify({\n    sent_at: new Date().toISOString(),\n  });\n  const itemHeaders = JSON.stringify({\n    type: 'session',\n  });\n\n  return {\n    body: `${envelopeHeaders}\\n${itemHeaders}\\n${JSON.stringify(session)}`,\n    type: 'session',\n    url: api.getEnvelopeEndpointWithUrlEncodedAuth(),\n  };\n}\n\n/** Creates a SentryRequest from an event. */\nexport function eventToSentryRequest(event: Event, api: API): SentryRequest {\n  const useEnvelope = event.type === 'transaction';\n\n  const req: SentryRequest = {\n    body: JSON.stringify(event),\n    type: event.type || 'event',\n    url: useEnvelope ? api.getEnvelopeEndpointWithUrlEncodedAuth() : api.getStoreEndpointWithUrlEncodedAuth(),\n  };\n\n  // https://develop.sentry.dev/sdk/envelopes/\n\n  // Since we don't need to manipulate envelopes nor store them, there is no\n  // exported concept of an Envelope with operations including serialization and\n  // deserialization. Instead, we only implement a minimal subset of the spec to\n  // serialize events inline here.\n  if (useEnvelope) {\n    const envelopeHeaders = JSON.stringify({\n      event_id: event.event_id,\n      sent_at: new Date().toISOString(),\n    });\n    const itemHeaders = JSON.stringify({\n      type: event.type,\n      // The content-type is assumed to be 'application/json' and not part of\n      // the current spec for transaction items, so we don't bloat the request\n      // body with it.\n      //\n      // content_type: 'application/json',\n      //\n      // The length is optional. It must be the number of bytes in req.Body\n      // encoded as UTF-8. Since the server can figure this out and would\n      // otherwise refuse events that report the length incorrectly, we decided\n      // not to send the length to avoid problems related to reporting the wrong\n      // size and to reduce request body size.\n      //\n      // length: new TextEncoder().encode(req.body).length,\n    });\n    // The trailing newline is optional. We intentionally don't send it to avoid\n    // sending unnecessary bytes.\n    //\n    // const envelope = `${envelopeHeaders}\\n${itemHeaders}\\n${req.body}\\n`;\n    const envelope = `${envelopeHeaders}\\n${itemHeaders}\\n${req.body}`;\n    req.body = envelope;\n  }\n\n  return req;\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { Event, Integration } from '@sentry/types';\nimport { getEventDescription, isMatchingPattern, logger } from '@sentry/utils';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [/^Script error\\.?$/, /^Javascript error: Script error\\.? on line 0$/];\n\n/** JSDoc */\ninterface InboundFiltersOptions {\n  allowUrls: Array<string | RegExp>;\n  denyUrls: Array<string | RegExp>;\n  ignoreErrors: Array<string | RegExp>;\n  ignoreInternal: boolean;\n\n  /** @deprecated use {@link InboundFiltersOptions.allowUrls} instead. */\n  whitelistUrls: Array<string | RegExp>;\n  /** @deprecated use {@link InboundFiltersOptions.denyUrls} instead. */\n  blacklistUrls: Array<string | RegExp>;\n}\n\n/** Inbound filters configurable by the user */\nexport class InboundFilters implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'InboundFilters';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = InboundFilters.id;\n\n  public constructor(private readonly _options: Partial<InboundFiltersOptions> = {}) {}\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    addGlobalEventProcessor((event: Event) => {\n      const hub = getCurrentHub();\n      if (!hub) {\n        return event;\n      }\n      const self = hub.getIntegration(InboundFilters);\n      if (self) {\n        const client = hub.getClient();\n        const clientOptions = client ? client.getOptions() : {};\n        const options = self._mergeOptions(clientOptions);\n        if (self._shouldDropEvent(event, options)) {\n          return null;\n        }\n      }\n      return event;\n    });\n  }\n\n  /** JSDoc */\n  private _shouldDropEvent(event: Event, options: Partial<InboundFiltersOptions>): boolean {\n    if (this._isSentryError(event, options)) {\n      logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n      return true;\n    }\n    if (this._isIgnoredError(event, options)) {\n      logger.warn(\n        `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n      );\n      return true;\n    }\n    if (this._isDeniedUrl(event, options)) {\n      logger.warn(\n        `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n          event,\n        )}.\\nUrl: ${this._getEventFilterUrl(event)}`,\n      );\n      return true;\n    }\n    if (!this._isAllowedUrl(event, options)) {\n      logger.warn(\n        `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n          event,\n        )}.\\nUrl: ${this._getEventFilterUrl(event)}`,\n      );\n      return true;\n    }\n    return false;\n  }\n\n  /** JSDoc */\n  private _isSentryError(event: Event, options: Partial<InboundFiltersOptions>): boolean {\n    if (!options.ignoreInternal) {\n      return false;\n    }\n\n    try {\n      return (\n        (event &&\n          event.exception &&\n          event.exception.values &&\n          event.exception.values[0] &&\n          event.exception.values[0].type === 'SentryError') ||\n        false\n      );\n    } catch (_oO) {\n      return false;\n    }\n  }\n\n  /** JSDoc */\n  private _isIgnoredError(event: Event, options: Partial<InboundFiltersOptions>): boolean {\n    if (!options.ignoreErrors || !options.ignoreErrors.length) {\n      return false;\n    }\n\n    return this._getPossibleEventMessages(event).some(message =>\n      // Not sure why TypeScript complains here...\n      (options.ignoreErrors as Array<RegExp | string>).some(pattern => isMatchingPattern(message, pattern)),\n    );\n  }\n\n  /** JSDoc */\n  private _isDeniedUrl(event: Event, options: Partial<InboundFiltersOptions>): boolean {\n    // TODO: Use Glob instead?\n    if (!options.denyUrls || !options.denyUrls.length) {\n      return false;\n    }\n    const url = this._getEventFilterUrl(event);\n    return !url ? false : options.denyUrls.some(pattern => isMatchingPattern(url, pattern));\n  }\n\n  /** JSDoc */\n  private _isAllowedUrl(event: Event, options: Partial<InboundFiltersOptions>): boolean {\n    // TODO: Use Glob instead?\n    if (!options.allowUrls || !options.allowUrls.length) {\n      return true;\n    }\n    const url = this._getEventFilterUrl(event);\n    return !url ? true : options.allowUrls.some(pattern => isMatchingPattern(url, pattern));\n  }\n\n  /** JSDoc */\n  private _mergeOptions(clientOptions: Partial<InboundFiltersOptions> = {}): Partial<InboundFiltersOptions> {\n    return {\n      allowUrls: [\n        // eslint-disable-next-line deprecation/deprecation\n        ...(this._options.whitelistUrls || []),\n        ...(this._options.allowUrls || []),\n        // eslint-disable-next-line deprecation/deprecation\n        ...(clientOptions.whitelistUrls || []),\n        ...(clientOptions.allowUrls || []),\n      ],\n      denyUrls: [\n        // eslint-disable-next-line deprecation/deprecation\n        ...(this._options.blacklistUrls || []),\n        ...(this._options.denyUrls || []),\n        // eslint-disable-next-line deprecation/deprecation\n        ...(clientOptions.blacklistUrls || []),\n        ...(clientOptions.denyUrls || []),\n      ],\n      ignoreErrors: [\n        ...(this._options.ignoreErrors || []),\n        ...(clientOptions.ignoreErrors || []),\n        ...DEFAULT_IGNORE_ERRORS,\n      ],\n      ignoreInternal: typeof this._options.ignoreInternal !== 'undefined' ? this._options.ignoreInternal : true,\n    };\n  }\n\n  /** JSDoc */\n  private _getPossibleEventMessages(event: Event): string[] {\n    if (event.message) {\n      return [event.message];\n    }\n    if (event.exception) {\n      try {\n        const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {};\n        return [`${value}`, `${type}: ${value}`];\n      } catch (oO) {\n        logger.error(`Cannot extract message for event ${getEventDescription(event)}`);\n        return [];\n      }\n    }\n    return [];\n  }\n\n  /** JSDoc */\n  private _getEventFilterUrl(event: Event): string | null {\n    try {\n      if (event.stacktrace) {\n        const frames = event.stacktrace.frames;\n        return (frames && frames[frames.length - 1].filename) || null;\n      }\n      if (event.exception) {\n        const frames =\n          event.exception.values && event.exception.values[0].stacktrace && event.exception.values[0].stacktrace.frames;\n        return (frames && frames[frames.length - 1].filename) || null;\n      }\n      return null;\n    } catch (oO) {\n      logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n      return null;\n    }\n  }\n}\n","/**\n * This was originally forked from https://github.com/occ/TraceKit, but has since been\n * largely modified and is now maintained as part of Sentry JS SDK.\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/**\n * An object representing a single stack frame.\n * {Object} StackFrame\n * {string} url The JavaScript or HTML file URL.\n * {string} func The function name, or empty for anonymous functions (if guessing did not work).\n * {string[]?} args The arguments passed to the function, if known.\n * {number=} line The line number, if known.\n * {number=} column The column number, if known.\n * {string[]} context An array of source code lines; the middle element corresponds to the correct line#.\n */\nexport interface StackFrame {\n  url: string;\n  func: string;\n  args: string[];\n  line: number | null;\n  column: number | null;\n}\n\n/**\n * An object representing a JavaScript stack trace.\n * {Object} StackTrace\n * {string} name The name of the thrown exception.\n * {string} message The exception error message.\n * {TraceKit.StackFrame[]} stack An array of stack frames.\n */\nexport interface StackTrace {\n  name: string;\n  message: string;\n  mechanism?: string;\n  stack: StackFrame[];\n  failed?: boolean;\n}\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chrome = /^\\s*at (?:(.*?) ?\\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\\/).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst gecko = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst winjs = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\nconst geckoEval = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\nconst chromeEval = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nexport function computeStackTrace(ex: any): StackTrace {\n  let stack = null;\n  let popSize = 0;\n\n  if (ex) {\n    if (typeof ex.framesToPop === 'number') {\n      popSize = ex.framesToPop;\n    } else if (reactMinifiedRegexp.test(ex.message)) {\n      popSize = 1;\n    }\n  }\n\n  try {\n    // This must be tried first because Opera 10 *destroys*\n    // its stacktrace property if you try to access the stack\n    // property first!!\n    stack = computeStackTraceFromStacktraceProp(ex);\n    if (stack) {\n      return popFrames(stack, popSize);\n    }\n  } catch (e) {\n    // no-empty\n  }\n\n  try {\n    stack = computeStackTraceFromStackProp(ex);\n    if (stack) {\n      return popFrames(stack, popSize);\n    }\n  } catch (e) {\n    // no-empty\n  }\n\n  return {\n    message: extractMessage(ex),\n    name: ex && ex.name,\n    stack: [],\n    failed: true,\n  };\n}\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, complexity\nfunction computeStackTraceFromStackProp(ex: any): StackTrace | null {\n  if (!ex || !ex.stack) {\n    return null;\n  }\n\n  const stack = [];\n  const lines = ex.stack.split('\\n');\n  let isEval;\n  let submatch;\n  let parts;\n  let element;\n\n  for (let i = 0; i < lines.length; ++i) {\n    if ((parts = chrome.exec(lines[i]))) {\n      const isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n      isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n      if (isEval && (submatch = chromeEval.exec(parts[2]))) {\n        // throw out eval line/column and use top-most line/column number\n        parts[2] = submatch[1]; // url\n        parts[3] = submatch[2]; // line\n        parts[4] = submatch[3]; // column\n      }\n      element = {\n        // working with the regexp above is super painful. it is quite a hack, but just stripping the `address at `\n        // prefix here seems like the quickest solution for now.\n        url: parts[2] && parts[2].indexOf('address at ') === 0 ? parts[2].substr('address at '.length) : parts[2],\n        func: parts[1] || UNKNOWN_FUNCTION,\n        args: isNative ? [parts[2]] : [],\n        line: parts[3] ? +parts[3] : null,\n        column: parts[4] ? +parts[4] : null,\n      };\n    } else if ((parts = winjs.exec(lines[i]))) {\n      element = {\n        url: parts[2],\n        func: parts[1] || UNKNOWN_FUNCTION,\n        args: [],\n        line: +parts[3],\n        column: parts[4] ? +parts[4] : null,\n      };\n    } else if ((parts = gecko.exec(lines[i]))) {\n      isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n      if (isEval && (submatch = geckoEval.exec(parts[3]))) {\n        // throw out eval line/column and use top-most line number\n        parts[1] = parts[1] || `eval`;\n        parts[3] = submatch[1];\n        parts[4] = submatch[2];\n        parts[5] = ''; // no column when eval\n      } else if (i === 0 && !parts[5] && ex.columnNumber !== void 0) {\n        // FireFox uses this awesome columnNumber property for its top frame\n        // Also note, Firefox's column number is 0-based and everything else expects 1-based,\n        // so adding 1\n        // NOTE: this hack doesn't work if top-most frame is eval\n        stack[0].column = (ex.columnNumber as number) + 1;\n      }\n      element = {\n        url: parts[3],\n        func: parts[1] || UNKNOWN_FUNCTION,\n        args: parts[2] ? parts[2].split(',') : [],\n        line: parts[4] ? +parts[4] : null,\n        column: parts[5] ? +parts[5] : null,\n      };\n    } else {\n      continue;\n    }\n\n    if (!element.func && element.line) {\n      element.func = UNKNOWN_FUNCTION;\n    }\n\n    stack.push(element);\n  }\n\n  if (!stack.length) {\n    return null;\n  }\n\n  return {\n    message: extractMessage(ex),\n    name: ex.name,\n    stack,\n  };\n}\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction computeStackTraceFromStacktraceProp(ex: any): StackTrace | null {\n  if (!ex || !ex.stacktrace) {\n    return null;\n  }\n  // Access and store the stacktrace property before doing ANYTHING\n  // else to it because Opera is not very good at providing it\n  // reliably in other circumstances.\n  const stacktrace = ex.stacktrace;\n  const opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n  const opera11Regex = / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\\((.*)\\))? in (.*):\\s*$/i;\n  const lines = stacktrace.split('\\n');\n  const stack = [];\n  let parts;\n\n  for (let line = 0; line < lines.length; line += 2) {\n    let element = null;\n    if ((parts = opera10Regex.exec(lines[line]))) {\n      element = {\n        url: parts[2],\n        func: parts[3],\n        args: [],\n        line: +parts[1],\n        column: null,\n      };\n    } else if ((parts = opera11Regex.exec(lines[line]))) {\n      element = {\n        url: parts[6],\n        func: parts[3] || parts[4],\n        args: parts[5] ? parts[5].split(',') : [],\n        line: +parts[1],\n        column: +parts[2],\n      };\n    }\n\n    if (element) {\n      if (!element.func && element.line) {\n        element.func = UNKNOWN_FUNCTION;\n      }\n      stack.push(element);\n    }\n  }\n\n  if (!stack.length) {\n    return null;\n  }\n\n  return {\n    message: extractMessage(ex),\n    name: ex.name,\n    stack,\n  };\n}\n\n/** Remove N number of frames from the stack */\nfunction popFrames(stacktrace: StackTrace, popSize: number): StackTrace {\n  try {\n    return {\n      ...stacktrace,\n      stack: stacktrace.stack.slice(popSize),\n    };\n  } catch (e) {\n    return stacktrace;\n  }\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction extractMessage(ex: any): string {\n  const message = ex && ex.message;\n  if (!message) {\n    return 'No error message';\n  }\n  if (message.error && typeof message.error.message === 'string') {\n    return message.error.message;\n  }\n  return message;\n}\n","import { Event, Exception, StackFrame } from '@sentry/types';\nimport { extractExceptionKeysForMessage, isEvent, normalizeToSize } from '@sentry/utils';\n\nimport { computeStackTrace, StackFrame as TraceKitStackFrame, StackTrace as TraceKitStackTrace } from './tracekit';\n\nconst STACKTRACE_LIMIT = 50;\n\n/**\n * This function creates an exception from an TraceKitStackTrace\n * @param stacktrace TraceKitStackTrace that will be converted to an exception\n * @hidden\n */\nexport function exceptionFromStacktrace(stacktrace: TraceKitStackTrace): Exception {\n  const frames = prepareFramesForEvent(stacktrace.stack);\n\n  const exception: Exception = {\n    type: stacktrace.name,\n    value: stacktrace.message,\n  };\n\n  if (frames && frames.length) {\n    exception.stacktrace = { frames };\n  }\n\n  if (exception.type === undefined && exception.value === '') {\n    exception.value = 'Unrecoverable error caught';\n  }\n\n  return exception;\n}\n\n/**\n * @hidden\n */\nexport function eventFromPlainObject(\n  exception: Record<string, unknown>,\n  syntheticException?: Error,\n  rejection?: boolean,\n): Event {\n  const event: Event = {\n    exception: {\n      values: [\n        {\n          type: isEvent(exception) ? exception.constructor.name : rejection ? 'UnhandledRejection' : 'Error',\n          value: `Non-Error ${\n            rejection ? 'promise rejection' : 'exception'\n          } captured with keys: ${extractExceptionKeysForMessage(exception)}`,\n        },\n      ],\n    },\n    extra: {\n      __serialized__: normalizeToSize(exception),\n    },\n  };\n\n  if (syntheticException) {\n    const stacktrace = computeStackTrace(syntheticException);\n    const frames = prepareFramesForEvent(stacktrace.stack);\n    event.stacktrace = {\n      frames,\n    };\n  }\n\n  return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromStacktrace(stacktrace: TraceKitStackTrace): Event {\n  const exception = exceptionFromStacktrace(stacktrace);\n\n  return {\n    exception: {\n      values: [exception],\n    },\n  };\n}\n\n/**\n * @hidden\n */\nexport function prepareFramesForEvent(stack: TraceKitStackFrame[]): StackFrame[] {\n  if (!stack || !stack.length) {\n    return [];\n  }\n\n  let localStack = stack;\n\n  const firstFrameFunction = localStack[0].func || '';\n  const lastFrameFunction = localStack[localStack.length - 1].func || '';\n\n  // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n  if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {\n    localStack = localStack.slice(1);\n  }\n\n  // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n  if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {\n    localStack = localStack.slice(0, -1);\n  }\n\n  // The frame where the crash happened, should be the last entry in the array\n  return localStack\n    .slice(0, STACKTRACE_LIMIT)\n    .map(\n      (frame: TraceKitStackFrame): StackFrame => ({\n        colno: frame.column === null ? undefined : frame.column,\n        filename: frame.url || localStack[0].url,\n        function: frame.func || '?',\n        in_app: true,\n        lineno: frame.line === null ? undefined : frame.line,\n      }),\n    )\n    .reverse();\n}\n","import { Event, EventHint, Options, Severity } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addExceptionTypeValue,\n  isDOMError,\n  isDOMException,\n  isError,\n  isErrorEvent,\n  isEvent,\n  isPlainObject,\n  SyncPromise,\n} from '@sentry/utils';\n\nimport { eventFromPlainObject, eventFromStacktrace, prepareFramesForEvent } from './parsers';\nimport { computeStackTrace } from './tracekit';\n\n/**\n * Builds and Event from a Exception\n * @hidden\n */\nexport function eventFromException(options: Options, exception: unknown, hint?: EventHint): PromiseLike<Event> {\n  const syntheticException = (hint && hint.syntheticException) || undefined;\n  const event = eventFromUnknownInput(exception, syntheticException, {\n    attachStacktrace: options.attachStacktrace,\n  });\n  addExceptionMechanism(event, {\n    handled: true,\n    type: 'generic',\n  });\n  event.level = Severity.Error;\n  if (hint && hint.event_id) {\n    event.event_id = hint.event_id;\n  }\n  return SyncPromise.resolve(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n  options: Options,\n  message: string,\n  level: Severity = Severity.Info,\n  hint?: EventHint,\n): PromiseLike<Event> {\n  const syntheticException = (hint && hint.syntheticException) || undefined;\n  const event = eventFromString(message, syntheticException, {\n    attachStacktrace: options.attachStacktrace,\n  });\n  event.level = level;\n  if (hint && hint.event_id) {\n    event.event_id = hint.event_id;\n  }\n  return SyncPromise.resolve(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n  exception: unknown,\n  syntheticException?: Error,\n  options: {\n    rejection?: boolean;\n    attachStacktrace?: boolean;\n  } = {},\n): Event {\n  let event: Event;\n\n  if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n    // If it is an ErrorEvent with `error` property, extract it to get actual Error\n    const errorEvent = exception as ErrorEvent;\n    // eslint-disable-next-line no-param-reassign\n    exception = errorEvent.error;\n    event = eventFromStacktrace(computeStackTrace(exception as Error));\n    return event;\n  }\n  if (isDOMError(exception as DOMError) || isDOMException(exception as DOMException)) {\n    // If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)\n    // then we just extract the name, code, and message, as they don't provide anything else\n    // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n    // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n    const domException = exception as DOMException;\n    const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n    const message = domException.message ? `${name}: ${domException.message}` : name;\n\n    event = eventFromString(message, syntheticException, options);\n    addExceptionTypeValue(event, message);\n    if ('code' in domException) {\n      event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n    }\n\n    return event;\n  }\n  if (isError(exception as Error)) {\n    // we have a real Error object, do nothing\n    event = eventFromStacktrace(computeStackTrace(exception as Error));\n    return event;\n  }\n  if (isPlainObject(exception) || isEvent(exception)) {\n    // If it is plain Object or Event, serialize it manually and extract options\n    // This will allow us to group events based on top-level keys\n    // which is much better than creating new group when any key/value change\n    const objectException = exception as Record<string, unknown>;\n    event = eventFromPlainObject(objectException, syntheticException, options.rejection);\n    addExceptionMechanism(event, {\n      synthetic: true,\n    });\n    return event;\n  }\n\n  // If none of previous checks were valid, then it means that it's not:\n  // - an instance of DOMError\n  // - an instance of DOMException\n  // - an instance of Event\n  // - an instance of Error\n  // - a valid ErrorEvent (one with an error property)\n  // - a plain Object\n  //\n  // So bail out and capture it as a simple message:\n  event = eventFromString(exception as string, syntheticException, options);\n  addExceptionTypeValue(event, `${exception}`, undefined);\n  addExceptionMechanism(event, {\n    synthetic: true,\n  });\n\n  return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromString(\n  input: string,\n  syntheticException?: Error,\n  options: {\n    attachStacktrace?: boolean;\n  } = {},\n): Event {\n  const event: Event = {\n    message: input,\n  };\n\n  if (options.attachStacktrace && syntheticException) {\n    const stacktrace = computeStackTrace(syntheticException);\n    const frames = prepareFramesForEvent(stacktrace.stack);\n    event.stacktrace = {\n      frames,\n    };\n  }\n\n  return event;\n}\n","import { API } from '@sentry/core';\nimport {\n  Event,\n  Response as SentryResponse,\n  SentryRequestType,\n  Status,\n  Transport,\n  TransportOptions,\n} from '@sentry/types';\nimport { logger, parseRetryAfterHeader, PromiseBuffer, SentryError } from '@sentry/utils';\n\n/** Base Transport class implementation */\nexport abstract class BaseTransport implements Transport {\n  /**\n   * @deprecated\n   */\n  public url: string;\n\n  /** Helper to get Sentry API endpoints. */\n  protected readonly _api: API;\n\n  /** A simple buffer holding all requests. */\n  protected readonly _buffer: PromiseBuffer<SentryResponse> = new PromiseBuffer(30);\n\n  /** Locks transport after receiving rate limits in a response */\n  protected readonly _rateLimits: Record<string, Date> = {};\n\n  public constructor(public options: TransportOptions) {\n    this._api = new API(this.options.dsn);\n    // eslint-disable-next-line deprecation/deprecation\n    this.url = this._api.getStoreEndpointWithUrlEncodedAuth();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendEvent(_: Event): PromiseLike<SentryResponse> {\n    throw new SentryError('Transport Class has to implement `sendEvent` method');\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public close(timeout?: number): PromiseLike<boolean> {\n    return this._buffer.drain(timeout);\n  }\n\n  /**\n   * Handle Sentry repsonse for promise-based transports.\n   */\n  protected _handleResponse({\n    requestType,\n    response,\n    headers,\n    resolve,\n    reject,\n  }: {\n    requestType: SentryRequestType;\n    response: Response | XMLHttpRequest;\n    headers: Record<string, string | null>;\n    resolve: (value?: SentryResponse | PromiseLike<SentryResponse> | null | undefined) => void;\n    reject: (reason?: unknown) => void;\n  }): void {\n    const status = Status.fromHttpCode(response.status);\n    /**\n     * \"The name is case-insensitive.\"\n     * https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n     */\n    const limited = this._handleRateLimit(headers);\n    if (limited) logger.warn(`Too many requests, backing off till: ${this._disabledUntil(requestType)}`);\n\n    if (status === Status.Success) {\n      resolve({ status });\n      return;\n    }\n\n    reject(response);\n  }\n\n  /**\n   * Gets the time that given category is disabled until for rate limiting\n   */\n  protected _disabledUntil(category: string): Date {\n    return this._rateLimits[category] || this._rateLimits.all;\n  }\n\n  /**\n   * Checks if a category is rate limited\n   */\n  protected _isRateLimited(category: string): boolean {\n    return this._disabledUntil(category) > new Date(Date.now());\n  }\n\n  /**\n   * Sets internal _rateLimits from incoming headers. Returns true if headers contains a non-empty rate limiting header.\n   */\n  protected _handleRateLimit(headers: Record<string, string | null>): boolean {\n    const now = Date.now();\n    const rlHeader = headers['x-sentry-rate-limits'];\n    const raHeader = headers['retry-after'];\n\n    if (rlHeader) {\n      for (const limit of rlHeader.trim().split(',')) {\n        const parameters = limit.split(':', 2);\n        const headerDelay = parseInt(parameters[0], 10);\n        const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n        for (const category of parameters[1].split(';')) {\n          this._rateLimits[category || 'all'] = new Date(now + delay);\n        }\n      }\n      return true;\n    } else if (raHeader) {\n      this._rateLimits.all = new Date(now + parseRetryAfterHeader(now, raHeader));\n      return true;\n    }\n    return false;\n  }\n}\n","import { eventToSentryRequest, sessionToSentryRequest } from '@sentry/core';\nimport { Event, Response, SentryRequest, Session } from '@sentry/types';\nimport { getGlobalObject, supportsReferrerPolicy, SyncPromise } from '@sentry/utils';\n\nimport { BaseTransport } from './base';\n\nconst global = getGlobalObject<Window>();\n\n/** `fetch` based transport */\nexport class FetchTransport extends BaseTransport {\n  /**\n   * @inheritDoc\n   */\n  public sendEvent(event: Event): PromiseLike<Response> {\n    return this._sendRequest(eventToSentryRequest(event, this._api), event);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendSession(session: Session): PromiseLike<Response> {\n    return this._sendRequest(sessionToSentryRequest(session, this._api), session);\n  }\n\n  /**\n   * @param sentryRequest Prepared SentryRequest to be delivered\n   * @param originalPayload Original payload used to create SentryRequest\n   */\n  private _sendRequest(sentryRequest: SentryRequest, originalPayload: Event | Session): PromiseLike<Response> {\n    if (this._isRateLimited(sentryRequest.type)) {\n      return Promise.reject({\n        event: originalPayload,\n        type: sentryRequest.type,\n        reason: `Transport locked till ${this._disabledUntil(sentryRequest.type)} due to too many requests.`,\n        status: 429,\n      });\n    }\n\n    const options: RequestInit = {\n      body: sentryRequest.body,\n      method: 'POST',\n      // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default\n      // https://caniuse.com/#feat=referrer-policy\n      // It doesn't. And it throw exception instead of ignoring this parameter...\n      // REF: https://github.com/getsentry/raven-js/issues/1233\n      referrerPolicy: (supportsReferrerPolicy() ? 'origin' : '') as ReferrerPolicy,\n    };\n    if (this.options.fetchParameters !== undefined) {\n      Object.assign(options, this.options.fetchParameters);\n    }\n    if (this.options.headers !== undefined) {\n      options.headers = this.options.headers;\n    }\n\n    return this._buffer.add(\n      new SyncPromise<Response>((resolve, reject) => {\n        global\n          .fetch(sentryRequest.url, options)\n          .then(response => {\n            const headers = {\n              'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n              'retry-after': response.headers.get('Retry-After'),\n            };\n            this._handleResponse({ requestType: sentryRequest.type, response, headers, resolve, reject });\n          })\n          .catch(reject);\n      }),\n    );\n  }\n}\n","import { eventToSentryRequest, sessionToSentryRequest } from '@sentry/core';\nimport { Event, Response, SentryRequest, Session } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\nimport { BaseTransport } from './base';\n\n/** `XHR` based transport */\nexport class XHRTransport extends BaseTransport {\n  /**\n   * @inheritDoc\n   */\n  public sendEvent(event: Event): PromiseLike<Response> {\n    return this._sendRequest(eventToSentryRequest(event, this._api), event);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendSession(session: Session): PromiseLike<Response> {\n    return this._sendRequest(sessionToSentryRequest(session, this._api), session);\n  }\n\n  /**\n   * @param sentryRequest Prepared SentryRequest to be delivered\n   * @param originalPayload Original payload used to create SentryRequest\n   */\n  private _sendRequest(sentryRequest: SentryRequest, originalPayload: Event | Session): PromiseLike<Response> {\n    if (this._isRateLimited(sentryRequest.type)) {\n      return Promise.reject({\n        event: originalPayload,\n        type: sentryRequest.type,\n        reason: `Transport locked till ${this._disabledUntil(sentryRequest.type)} due to too many requests.`,\n        status: 429,\n      });\n    }\n\n    return this._buffer.add(\n      new SyncPromise<Response>((resolve, reject) => {\n        const request = new XMLHttpRequest();\n\n        request.onreadystatechange = (): void => {\n          if (request.readyState === 4) {\n            const headers = {\n              'x-sentry-rate-limits': request.getResponseHeader('X-Sentry-Rate-Limits'),\n              'retry-after': request.getResponseHeader('Retry-After'),\n            };\n            this._handleResponse({ requestType: sentryRequest.type, response: request, headers, resolve, reject });\n          }\n        };\n\n        request.open('POST', sentryRequest.url);\n        for (const header in this.options.headers) {\n          if (this.options.headers.hasOwnProperty(header)) {\n            request.setRequestHeader(header, this.options.headers[header]);\n          }\n        }\n        request.send(sentryRequest.body);\n      }),\n    );\n  }\n}\n","import { BaseBackend } from '@sentry/core';\nimport { Event, EventHint, Options, Severity, Transport } from '@sentry/types';\nimport { supportsFetch } from '@sentry/utils';\n\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { FetchTransport, XHRTransport } from './transports';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see BrowserClient for more information.\n */\nexport interface BrowserOptions extends Options {\n  /**\n   * A pattern for error URLs which should exclusively be sent to Sentry.\n   * This is the opposite of {@link Options.denyUrls}.\n   * By default, all errors will be sent.\n   */\n  allowUrls?: Array<string | RegExp>;\n\n  /**\n   * A pattern for error URLs which should not be sent to Sentry.\n   * To allow certain errors instead, use {@link Options.allowUrls}.\n   * By default, all errors will be sent.\n   */\n  denyUrls?: Array<string | RegExp>;\n\n  /** @deprecated use {@link Options.allowUrls} instead. */\n  whitelistUrls?: Array<string | RegExp>;\n\n  /** @deprecated use {@link Options.denyUrls} instead. */\n  blacklistUrls?: Array<string | RegExp>;\n\n  /**\n   * A flag enabling Sessions Tracking feature.\n   * By default Sessions Tracking is disabled.\n   */\n  autoSessionTracking?: boolean;\n}\n\n/**\n * The Sentry Browser SDK Backend.\n * @hidden\n */\nexport class BrowserBackend extends BaseBackend<BrowserOptions> {\n  /**\n   * @inheritDoc\n   */\n  public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n    return eventFromException(this._options, exception, hint);\n  }\n  /**\n   * @inheritDoc\n   */\n  public eventFromMessage(message: string, level: Severity = Severity.Info, hint?: EventHint): PromiseLike<Event> {\n    return eventFromMessage(this._options, message, level, hint);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  protected _setupTransport(): Transport {\n    if (!this._options.dsn) {\n      // We return the noop transport here in case there is no Dsn.\n      return super._setupTransport();\n    }\n\n    const transportOptions = {\n      ...this._options.transportOptions,\n      dsn: this._options.dsn,\n    };\n\n    if (this._options.transport) {\n      return new this._options.transport(transportOptions);\n    }\n    if (supportsFetch()) {\n      return new FetchTransport(transportOptions);\n    }\n    return new XHRTransport(transportOptions);\n  }\n}\n","import { API, captureException, withScope } from '@sentry/core';\nimport { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';\nimport { addExceptionMechanism, addExceptionTypeValue, logger } from '@sentry/utils';\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n  return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n  // onerror should trigger before setTimeout\n  ignoreOnError += 1;\n  setTimeout(() => {\n    ignoreOnError -= 1;\n  });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n  fn: WrappedFunction,\n  options: {\n    mechanism?: Mechanism;\n  } = {},\n  before?: WrappedFunction,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n  if (typeof fn !== 'function') {\n    return fn;\n  }\n\n  try {\n    // We don't wanna wrap it twice\n    if (fn.__sentry__) {\n      return fn;\n    }\n\n    // If this has already been wrapped in the past, return that wrapped function\n    if (fn.__sentry_wrapped__) {\n      return fn.__sentry_wrapped__;\n    }\n  } catch (e) {\n    // Just accessing custom props in some Selenium environments\n    // can cause a \"Permission denied\" exception (see raven-js#495).\n    // Bail on wrapping and return the function as-is (defers to window.onerror).\n    return fn;\n  }\n\n  /* eslint-disable prefer-rest-params */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const sentryWrapped: WrappedFunction = function(this: any): void {\n    const args = Array.prototype.slice.call(arguments);\n\n    try {\n      if (before && typeof before === 'function') {\n        before.apply(this, arguments);\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n      const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n      if (fn.handleEvent) {\n        // Attempt to invoke user-land function\n        // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n        //       means the sentry.javascript SDK caught an error invoking your application code. This\n        //       is expected behavior and NOT indicative of a bug with sentry.javascript.\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        return fn.handleEvent.apply(this, wrappedArguments);\n      }\n      // Attempt to invoke user-land function\n      // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n      //       means the sentry.javascript SDK caught an error invoking your application code. This\n      //       is expected behavior and NOT indicative of a bug with sentry.javascript.\n      return fn.apply(this, wrappedArguments);\n    } catch (ex) {\n      ignoreNextOnError();\n\n      withScope((scope: Scope) => {\n        scope.addEventProcessor((event: SentryEvent) => {\n          const processedEvent = { ...event };\n\n          if (options.mechanism) {\n            addExceptionTypeValue(processedEvent, undefined, undefined);\n            addExceptionMechanism(processedEvent, options.mechanism);\n          }\n\n          processedEvent.extra = {\n            ...processedEvent.extra,\n            arguments: args,\n          };\n\n          return processedEvent;\n        });\n\n        captureException(ex);\n      });\n\n      throw ex;\n    }\n  };\n  /* eslint-enable prefer-rest-params */\n\n  // Accessing some objects may throw\n  // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n  try {\n    for (const property in fn) {\n      if (Object.prototype.hasOwnProperty.call(fn, property)) {\n        sentryWrapped[property] = fn[property];\n      }\n    }\n  } catch (_oO) {} // eslint-disable-line no-empty\n\n  fn.prototype = fn.prototype || {};\n  sentryWrapped.prototype = fn.prototype;\n\n  Object.defineProperty(fn, '__sentry_wrapped__', {\n    enumerable: false,\n    value: sentryWrapped,\n  });\n\n  // Signal that this function has been wrapped/filled already\n  // for both debugging and to prevent it to being wrapped/filled twice\n  Object.defineProperties(sentryWrapped, {\n    __sentry__: {\n      enumerable: false,\n      value: true,\n    },\n    __sentry_original__: {\n      enumerable: false,\n      value: fn,\n    },\n  });\n\n  // Restore original function name (not all browsers allow that)\n  try {\n    const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n    if (descriptor.configurable) {\n      Object.defineProperty(sentryWrapped, 'name', {\n        get(): string {\n          return fn.name;\n        },\n      });\n    }\n    // eslint-disable-next-line no-empty\n  } catch (_oO) {}\n\n  return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n */\nexport interface ReportDialogOptions {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  [key: string]: any;\n  eventId?: string;\n  dsn?: DsnLike;\n  user?: {\n    email?: string;\n    name?: string;\n  };\n  lang?: string;\n  title?: string;\n  subtitle?: string;\n  subtitle2?: string;\n  labelName?: string;\n  labelEmail?: string;\n  labelComments?: string;\n  labelClose?: string;\n  labelSubmit?: string;\n  errorGeneric?: string;\n  errorFormEntry?: string;\n  successMessage?: string;\n  /** Callback after reportDialog showed up */\n  onLoad?(): void;\n}\n\n/**\n * Injects the Report Dialog script\n * @hidden\n */\nexport function injectReportDialog(options: ReportDialogOptions = {}): void {\n  if (!options.eventId) {\n    logger.error(`Missing eventId option in showReportDialog call`);\n    return;\n  }\n  if (!options.dsn) {\n    logger.error(`Missing dsn option in showReportDialog call`);\n    return;\n  }\n\n  const script = document.createElement('script');\n  script.async = true;\n  script.src = new API(options.dsn).getReportDialogEndpoint(options);\n\n  if (options.onLoad) {\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    script.onload = options.onLoad;\n  }\n\n  (document.head || document.body).appendChild(script);\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { getCurrentHub } from '@sentry/core';\nimport { Event, Integration, Severity } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addInstrumentationHandler,\n  getLocationHref,\n  isErrorEvent,\n  isPrimitive,\n  isString,\n  logger,\n} from '@sentry/utils';\n\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\n/** JSDoc */\ninterface GlobalHandlersIntegrations {\n  onerror: boolean;\n  onunhandledrejection: boolean;\n}\n\n/** Global handlers */\nexport class GlobalHandlers implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'GlobalHandlers';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = GlobalHandlers.id;\n\n  /** JSDoc */\n  private readonly _options: GlobalHandlersIntegrations;\n\n  /** JSDoc */\n  private _onErrorHandlerInstalled: boolean = false;\n\n  /** JSDoc */\n  private _onUnhandledRejectionHandlerInstalled: boolean = false;\n\n  /** JSDoc */\n  public constructor(options?: GlobalHandlersIntegrations) {\n    this._options = {\n      onerror: true,\n      onunhandledrejection: true,\n      ...options,\n    };\n  }\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    Error.stackTraceLimit = 50;\n\n    if (this._options.onerror) {\n      logger.log('Global Handler attached: onerror');\n      this._installGlobalOnErrorHandler();\n    }\n\n    if (this._options.onunhandledrejection) {\n      logger.log('Global Handler attached: onunhandledrejection');\n      this._installGlobalOnUnhandledRejectionHandler();\n    }\n  }\n\n  /** JSDoc */\n  private _installGlobalOnErrorHandler(): void {\n    if (this._onErrorHandlerInstalled) {\n      return;\n    }\n\n    addInstrumentationHandler({\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      callback: (data: { msg: any; url: any; line: any; column: any; error: any }) => {\n        const error = data.error;\n        const currentHub = getCurrentHub();\n        const hasIntegration = currentHub.getIntegration(GlobalHandlers);\n        const isFailedOwnDelivery = error && error.__sentry_own_request__ === true;\n\n        if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {\n          return;\n        }\n\n        const client = currentHub.getClient();\n        const event = isPrimitive(error)\n          ? this._eventFromIncompleteOnError(data.msg, data.url, data.line, data.column)\n          : this._enhanceEventWithInitialFrame(\n              eventFromUnknownInput(error, undefined, {\n                attachStacktrace: client && client.getOptions().attachStacktrace,\n                rejection: false,\n              }),\n              data.url,\n              data.line,\n              data.column,\n            );\n\n        addExceptionMechanism(event, {\n          handled: false,\n          type: 'onerror',\n        });\n\n        currentHub.captureEvent(event, {\n          originalException: error,\n        });\n      },\n      type: 'error',\n    });\n\n    this._onErrorHandlerInstalled = true;\n  }\n\n  /** JSDoc */\n  private _installGlobalOnUnhandledRejectionHandler(): void {\n    if (this._onUnhandledRejectionHandlerInstalled) {\n      return;\n    }\n\n    addInstrumentationHandler({\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      callback: (e: any) => {\n        let error = e;\n\n        // dig the object of the rejection out of known event types\n        try {\n          // PromiseRejectionEvents store the object of the rejection under 'reason'\n          // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n          if ('reason' in e) {\n            error = e.reason;\n          }\n          // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n          // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n          // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n          // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n          // https://github.com/getsentry/sentry-javascript/issues/2380\n          else if ('detail' in e && 'reason' in e.detail) {\n            error = e.detail.reason;\n          }\n        } catch (_oO) {\n          // no-empty\n        }\n\n        const currentHub = getCurrentHub();\n        const hasIntegration = currentHub.getIntegration(GlobalHandlers);\n        const isFailedOwnDelivery = error && error.__sentry_own_request__ === true;\n\n        if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {\n          return true;\n        }\n\n        const client = currentHub.getClient();\n        const event = isPrimitive(error)\n          ? this._eventFromIncompleteRejection(error)\n          : eventFromUnknownInput(error, undefined, {\n              attachStacktrace: client && client.getOptions().attachStacktrace,\n              rejection: true,\n            });\n\n        event.level = Severity.Error;\n\n        addExceptionMechanism(event, {\n          handled: false,\n          type: 'onunhandledrejection',\n        });\n\n        currentHub.captureEvent(event, {\n          originalException: error,\n        });\n\n        return;\n      },\n      type: 'unhandledrejection',\n    });\n\n    this._onUnhandledRejectionHandlerInstalled = true;\n  }\n\n  /**\n   * This function creates a stack from an old, error-less onerror handler.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _eventFromIncompleteOnError(msg: any, url: any, line: any, column: any): Event {\n    const ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n    // If 'message' is ErrorEvent, get real message from inside\n    let message = isErrorEvent(msg) ? msg.message : msg;\n    let name;\n\n    if (isString(message)) {\n      const groups = message.match(ERROR_TYPES_RE);\n      if (groups) {\n        name = groups[1];\n        message = groups[2];\n      }\n    }\n\n    const event = {\n      exception: {\n        values: [\n          {\n            type: name || 'Error',\n            value: message,\n          },\n        ],\n      },\n    };\n\n    return this._enhanceEventWithInitialFrame(event, url, line, column);\n  }\n\n  /**\n   * This function creates an Event from an TraceKitStackTrace that has part of it missing.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _eventFromIncompleteRejection(error: any): Event {\n    return {\n      exception: {\n        values: [\n          {\n            type: 'UnhandledRejection',\n            value: `Non-Error promise rejection captured with value: ${error}`,\n          },\n        ],\n      },\n    };\n  }\n\n  /** JSDoc */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _enhanceEventWithInitialFrame(event: Event, url: any, line: any, column: any): Event {\n    event.exception = event.exception || {};\n    event.exception.values = event.exception.values || [];\n    event.exception.values[0] = event.exception.values[0] || {};\n    event.exception.values[0].stacktrace = event.exception.values[0].stacktrace || {};\n    event.exception.values[0].stacktrace.frames = event.exception.values[0].stacktrace.frames || [];\n\n    const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n    const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n    const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n    if (event.exception.values[0].stacktrace.frames.length === 0) {\n      event.exception.values[0].stacktrace.frames.push({\n        colno,\n        filename,\n        function: '?',\n        in_app: true,\n        lineno,\n      });\n    }\n\n    return event;\n  }\n}\n","import { Integration, WrappedFunction } from '@sentry/types';\nimport { fill, getFunctionName, getGlobalObject } from '@sentry/utils';\n\nimport { wrap } from '../helpers';\n\nconst DEFAULT_EVENT_TARGET = [\n  'EventTarget',\n  'Window',\n  'Node',\n  'ApplicationCache',\n  'AudioTrackList',\n  'ChannelMergerNode',\n  'CryptoOperation',\n  'EventSource',\n  'FileReader',\n  'HTMLUnknownElement',\n  'IDBDatabase',\n  'IDBRequest',\n  'IDBTransaction',\n  'KeyOperation',\n  'MediaController',\n  'MessagePort',\n  'ModalWindow',\n  'Notification',\n  'SVGElementInstance',\n  'Screen',\n  'TextTrack',\n  'TextTrackCue',\n  'TextTrackList',\n  'WebSocket',\n  'WebSocketWorker',\n  'Worker',\n  'XMLHttpRequest',\n  'XMLHttpRequestEventTarget',\n  'XMLHttpRequestUpload',\n];\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\n/** JSDoc */\ninterface TryCatchOptions {\n  setTimeout: boolean;\n  setInterval: boolean;\n  requestAnimationFrame: boolean;\n  XMLHttpRequest: boolean;\n  eventTarget: boolean | string[];\n}\n\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\nexport class TryCatch implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'TryCatch';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = TryCatch.id;\n\n  /** JSDoc */\n  private readonly _options: TryCatchOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options?: Partial<TryCatchOptions>) {\n    this._options = {\n      XMLHttpRequest: true,\n      eventTarget: true,\n      requestAnimationFrame: true,\n      setInterval: true,\n      setTimeout: true,\n      ...options,\n    };\n  }\n\n  /**\n   * Wrap timer functions and event targets to catch errors\n   * and provide better metadata.\n   */\n  public setupOnce(): void {\n    const global = getGlobalObject();\n\n    if (this._options.setTimeout) {\n      fill(global, 'setTimeout', this._wrapTimeFunction.bind(this));\n    }\n\n    if (this._options.setInterval) {\n      fill(global, 'setInterval', this._wrapTimeFunction.bind(this));\n    }\n\n    if (this._options.requestAnimationFrame) {\n      fill(global, 'requestAnimationFrame', this._wrapRAF.bind(this));\n    }\n\n    if (this._options.XMLHttpRequest && 'XMLHttpRequest' in global) {\n      fill(XMLHttpRequest.prototype, 'send', this._wrapXHR.bind(this));\n    }\n\n    if (this._options.eventTarget) {\n      const eventTarget = Array.isArray(this._options.eventTarget) ? this._options.eventTarget : DEFAULT_EVENT_TARGET;\n      eventTarget.forEach(this._wrapEventTarget.bind(this));\n    }\n  }\n\n  /** JSDoc */\n  private _wrapTimeFunction(original: () => void): () => number {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return function(this: any, ...args: any[]): number {\n      const originalCallback = args[0];\n      args[0] = wrap(originalCallback, {\n        mechanism: {\n          data: { function: getFunctionName(original) },\n          handled: true,\n          type: 'instrument',\n        },\n      });\n      return original.apply(this, args);\n    };\n  }\n\n  /** JSDoc */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _wrapRAF(original: any): (callback: () => void) => any {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return function(this: any, callback: () => void): () => void {\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      return original.call(\n        this,\n        wrap(callback, {\n          mechanism: {\n            data: {\n              function: 'requestAnimationFrame',\n              handler: getFunctionName(original),\n            },\n            handled: true,\n            type: 'instrument',\n          },\n        }),\n      );\n    };\n  }\n\n  /** JSDoc */\n  private _wrapEventTarget(target: string): void {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const global = getGlobalObject() as { [key: string]: any };\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    const proto = global[target] && global[target].prototype;\n\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n      return;\n    }\n\n    fill(proto, 'addEventListener', function(\n      original: () => void,\n    ): (eventName: string, fn: EventListenerObject, options?: boolean | AddEventListenerOptions) => void {\n      return function(\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        this: any,\n        eventName: string,\n        fn: EventListenerObject,\n        options?: boolean | AddEventListenerOptions,\n      ): (eventName: string, fn: EventListenerObject, capture?: boolean, secure?: boolean) => void {\n        try {\n          if (typeof fn.handleEvent === 'function') {\n            fn.handleEvent = wrap(fn.handleEvent.bind(fn), {\n              mechanism: {\n                data: {\n                  function: 'handleEvent',\n                  handler: getFunctionName(fn),\n                  target,\n                },\n                handled: true,\n                type: 'instrument',\n              },\n            });\n          }\n        } catch (err) {\n          // can sometimes get 'Permission denied to access property \"handle Event'\n        }\n\n        return original.call(\n          this,\n          eventName,\n          // eslint-disable-next-line @typescript-eslint/no-explicit-any\n          wrap((fn as any) as WrappedFunction, {\n            mechanism: {\n              data: {\n                function: 'addEventListener',\n                handler: getFunctionName(fn),\n                target,\n              },\n              handled: true,\n              type: 'instrument',\n            },\n          }),\n          options,\n        );\n      };\n    });\n\n    fill(proto, 'removeEventListener', function(\n      originalRemoveEventListener: () => void,\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    ): (this: any, eventName: string, fn: EventListenerObject, options?: boolean | EventListenerOptions) => () => void {\n      return function(\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        this: any,\n        eventName: string,\n        fn: EventListenerObject,\n        options?: boolean | EventListenerOptions,\n      ): () => void {\n        /**\n         * There are 2 possible scenarios here:\n         *\n         * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n         * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n         * as a pass-through, and call original `removeEventListener` with it.\n         *\n         * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n         * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n         * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n         * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n         * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n         *\n         * When someone adds a handler prior to initialization, and then do it again, but after,\n         * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n         * to get rid of the initial handler and it'd stick there forever.\n         */\n        const wrappedEventHandler = (fn as unknown) as WrappedFunction;\n        try {\n          const originalEventHandler = wrappedEventHandler?.__sentry_wrapped__;\n          if (originalEventHandler) {\n            originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n          }\n        } catch (e) {\n          // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n        }\n        return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n      };\n    });\n  }\n\n  /** JSDoc */\n  private _wrapXHR(originalSend: () => void): () => void {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return function(this: XMLHttpRequest, ...args: any[]): void {\n      // eslint-disable-next-line @typescript-eslint/no-this-alias\n      const xhr = this;\n      const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n      xmlHttpRequestProps.forEach(prop => {\n        if (prop in xhr && typeof xhr[prop] === 'function') {\n          // eslint-disable-next-line @typescript-eslint/no-explicit-any\n          fill(xhr, prop, function(original: WrappedFunction): () => any {\n            const wrapOptions = {\n              mechanism: {\n                data: {\n                  function: prop,\n                  handler: getFunctionName(original),\n                },\n                handled: true,\n                type: 'instrument',\n              },\n            };\n\n            // If Instrument integration has been called before TryCatch, get the name of original function\n            if (original.__sentry_original__) {\n              wrapOptions.mechanism.data.handler = getFunctionName(original.__sentry_original__);\n            }\n\n            // Otherwise wrap directly\n            return wrap(original, wrapOptions);\n          });\n        }\n      });\n\n      return originalSend.apply(this, args);\n    };\n  }\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable max-lines */\nimport { getCurrentHub } from '@sentry/core';\nimport { Event, Integration, Severity } from '@sentry/types';\nimport {\n  addInstrumentationHandler,\n  getEventDescription,\n  getGlobalObject,\n  htmlTreeAsString,\n  parseUrl,\n  safeJoin,\n} from '@sentry/utils';\n\n/** JSDoc */\ninterface BreadcrumbsOptions {\n  console: boolean;\n  dom: boolean;\n  fetch: boolean;\n  history: boolean;\n  sentry: boolean;\n  xhr: boolean;\n}\n\n/**\n * Default Breadcrumbs instrumentations\n * TODO: Deprecated - with v6, this will be renamed to `Instrument`\n */\nexport class Breadcrumbs implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Breadcrumbs';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Breadcrumbs.id;\n\n  /** JSDoc */\n  private readonly _options: BreadcrumbsOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options?: Partial<BreadcrumbsOptions>) {\n    this._options = {\n      console: true,\n      dom: true,\n      fetch: true,\n      history: true,\n      sentry: true,\n      xhr: true,\n      ...options,\n    };\n  }\n\n  /**\n   * Create a breadcrumb of `sentry` from the events themselves\n   */\n  public addSentryBreadcrumb(event: Event): void {\n    if (!this._options.sentry) {\n      return;\n    }\n    getCurrentHub().addBreadcrumb(\n      {\n        category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n        event_id: event.event_id,\n        level: event.level,\n        message: getEventDescription(event),\n      },\n      {\n        event,\n      },\n    );\n  }\n\n  /**\n   * Instrument browser built-ins w/ breadcrumb capturing\n   *  - Console API\n   *  - DOM API (click/typing)\n   *  - XMLHttpRequest API\n   *  - Fetch API\n   *  - History API\n   */\n  public setupOnce(): void {\n    if (this._options.console) {\n      addInstrumentationHandler({\n        callback: (...args) => {\n          this._consoleBreadcrumb(...args);\n        },\n        type: 'console',\n      });\n    }\n    if (this._options.dom) {\n      addInstrumentationHandler({\n        callback: (...args) => {\n          this._domBreadcrumb(...args);\n        },\n        type: 'dom',\n      });\n    }\n    if (this._options.xhr) {\n      addInstrumentationHandler({\n        callback: (...args) => {\n          this._xhrBreadcrumb(...args);\n        },\n        type: 'xhr',\n      });\n    }\n    if (this._options.fetch) {\n      addInstrumentationHandler({\n        callback: (...args) => {\n          this._fetchBreadcrumb(...args);\n        },\n        type: 'fetch',\n      });\n    }\n    if (this._options.history) {\n      addInstrumentationHandler({\n        callback: (...args) => {\n          this._historyBreadcrumb(...args);\n        },\n        type: 'history',\n      });\n    }\n  }\n\n  /**\n   * Creates breadcrumbs from console API calls\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _consoleBreadcrumb(handlerData: { [key: string]: any }): void {\n    const breadcrumb = {\n      category: 'console',\n      data: {\n        arguments: handlerData.args,\n        logger: 'console',\n      },\n      level: Severity.fromString(handlerData.level),\n      message: safeJoin(handlerData.args, ' '),\n    };\n\n    if (handlerData.level === 'assert') {\n      if (handlerData.args[0] === false) {\n        breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n        breadcrumb.data.arguments = handlerData.args.slice(1);\n      } else {\n        // Don't capture a breadcrumb for passed assertions\n        return;\n      }\n    }\n\n    getCurrentHub().addBreadcrumb(breadcrumb, {\n      input: handlerData.args,\n      level: handlerData.level,\n    });\n  }\n\n  /**\n   * Creates breadcrumbs from DOM API calls\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _domBreadcrumb(handlerData: { [key: string]: any }): void {\n    let target;\n\n    // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n    try {\n      target = handlerData.event.target\n        ? htmlTreeAsString(handlerData.event.target as Node)\n        : htmlTreeAsString((handlerData.event as unknown) as Node);\n    } catch (e) {\n      target = '<unknown>';\n    }\n\n    if (target.length === 0) {\n      return;\n    }\n\n    getCurrentHub().addBreadcrumb(\n      {\n        category: `ui.${handlerData.name}`,\n        message: target,\n      },\n      {\n        event: handlerData.event,\n        name: handlerData.name,\n      },\n    );\n  }\n\n  /**\n   * Creates breadcrumbs from XHR API calls\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _xhrBreadcrumb(handlerData: { [key: string]: any }): void {\n    if (handlerData.endTimestamp) {\n      // We only capture complete, non-sentry requests\n      if (handlerData.xhr.__sentry_own_request__) {\n        return;\n      }\n\n      const { method, url, status_code, body } = handlerData.xhr.__sentry_xhr__ || {};\n\n      getCurrentHub().addBreadcrumb(\n        {\n          category: 'xhr',\n          data: {\n            method,\n            url,\n            status_code,\n          },\n          type: 'http',\n        },\n        {\n          xhr: handlerData.xhr,\n          input: body,\n        },\n      );\n\n      return;\n    }\n  }\n\n  /**\n   * Creates breadcrumbs from fetch API calls\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _fetchBreadcrumb(handlerData: { [key: string]: any }): void {\n    // We only capture complete fetch requests\n    if (!handlerData.endTimestamp) {\n      return;\n    }\n\n    if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n      // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n      return;\n    }\n\n    if (handlerData.error) {\n      getCurrentHub().addBreadcrumb(\n        {\n          category: 'fetch',\n          data: handlerData.fetchData,\n          level: Severity.Error,\n          type: 'http',\n        },\n        {\n          data: handlerData.error,\n          input: handlerData.args,\n        },\n      );\n    } else {\n      getCurrentHub().addBreadcrumb(\n        {\n          category: 'fetch',\n          data: {\n            ...handlerData.fetchData,\n            status_code: handlerData.response.status,\n          },\n          type: 'http',\n        },\n        {\n          input: handlerData.args,\n          response: handlerData.response,\n        },\n      );\n    }\n  }\n\n  /**\n   * Creates breadcrumbs from history API calls\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _historyBreadcrumb(handlerData: { [key: string]: any }): void {\n    const global = getGlobalObject<Window>();\n    let from = handlerData.from;\n    let to = handlerData.to;\n    const parsedLoc = parseUrl(global.location.href);\n    let parsedFrom = parseUrl(from);\n    const parsedTo = parseUrl(to);\n\n    // Initial pushState doesn't provide `from` information\n    if (!parsedFrom.path) {\n      parsedFrom = parsedLoc;\n    }\n\n    // Use only the path component of the URL if the URL matches the current\n    // document (almost all the time when using pushState)\n    if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n      to = parsedTo.relative;\n    }\n    if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n      from = parsedFrom.relative;\n    }\n\n    getCurrentHub().addBreadcrumb({\n      category: 'navigation',\n      data: {\n        from,\n        to,\n      },\n    });\n  }\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { Event, EventHint, Exception, ExtendedError, Integration } from '@sentry/types';\nimport { isInstanceOf } from '@sentry/utils';\n\nimport { exceptionFromStacktrace } from '../parsers';\nimport { computeStackTrace } from '../tracekit';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\n/** Adds SDK info to an event. */\nexport class LinkedErrors implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'LinkedErrors';\n\n  /**\n   * @inheritDoc\n   */\n  public readonly name: string = LinkedErrors.id;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _key: string;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _limit: number;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: { key?: string; limit?: number } = {}) {\n    this._key = options.key || DEFAULT_KEY;\n    this._limit = options.limit || DEFAULT_LIMIT;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    addGlobalEventProcessor((event: Event, hint?: EventHint) => {\n      const self = getCurrentHub().getIntegration(LinkedErrors);\n      if (self) {\n        return self._handler(event, hint);\n      }\n      return event;\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  private _handler(event: Event, hint?: EventHint): Event | null {\n    if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n      return event;\n    }\n    const linkedErrors = this._walkErrorTree(hint.originalException as ExtendedError, this._key);\n    event.exception.values = [...linkedErrors, ...event.exception.values];\n    return event;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  private _walkErrorTree(error: ExtendedError, key: string, stack: Exception[] = []): Exception[] {\n    if (!isInstanceOf(error[key], Error) || stack.length + 1 >= this._limit) {\n      return stack;\n    }\n    const stacktrace = computeStackTrace(error[key]);\n    const exception = exceptionFromStacktrace(stacktrace);\n    return this._walkErrorTree(error[key], key, [exception, ...stack]);\n  }\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { Event, Integration } from '@sentry/types';\nimport { getGlobalObject } from '@sentry/utils';\n\nconst global = getGlobalObject<Window>();\n\n/** UserAgent */\nexport class UserAgent implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'UserAgent';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = UserAgent.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    addGlobalEventProcessor((event: Event) => {\n      if (getCurrentHub().getIntegration(UserAgent)) {\n        // if none of the information we want exists, don't bother\n        if (!global.navigator && !global.location && !global.document) {\n          return event;\n        }\n\n        // grab as much info as exists and add it to the event\n        const url = event.request?.url || global.location?.href;\n        const { referrer } = global.document || {};\n        const { userAgent } = global.navigator || {};\n\n        const headers = {\n          ...event.request?.headers,\n          ...(referrer && { Referer: referrer }),\n          ...(userAgent && { 'User-Agent': userAgent }),\n        };\n        const request = { ...(url && { url }), headers };\n\n        return { ...event, request };\n      }\n      return event;\n    });\n  }\n}\n","export const SDK_NAME = 'sentry.javascript.browser';\nexport const SDK_VERSION = '5.28.0';\n","import { BaseClient, Scope } from '@sentry/core';\nimport { Event, EventHint } from '@sentry/types';\nimport { getGlobalObject, logger } from '@sentry/utils';\n\nimport { BrowserBackend, BrowserOptions } from './backend';\nimport { injectReportDialog, ReportDialogOptions } from './helpers';\nimport { Breadcrumbs } from './integrations';\nimport { SDK_NAME, SDK_VERSION } from './version';\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends BaseClient<BrowserBackend, BrowserOptions> {\n  /**\n   * Creates a new Browser SDK instance.\n   *\n   * @param options Configuration options for this SDK.\n   */\n  public constructor(options: BrowserOptions = {}) {\n    super(BrowserBackend, options);\n  }\n\n  /**\n   * Show a report dialog to the user to send feedback to a specific event.\n   *\n   * @param options Set individual options for the dialog\n   */\n  public showReportDialog(options: ReportDialogOptions = {}): void {\n    // doesn't work without a document (React Native)\n    const document = getGlobalObject<Window>().document;\n    if (!document) {\n      return;\n    }\n\n    if (!this._isEnabled()) {\n      logger.error('Trying to call showReportDialog with Sentry Client disabled');\n      return;\n    }\n\n    injectReportDialog({\n      ...options,\n      dsn: options.dsn || this.getDsn(),\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike<Event | null> {\n    event.platform = event.platform || 'javascript';\n    event.sdk = {\n      ...event.sdk,\n      name: SDK_NAME,\n      packages: [\n        ...((event.sdk && event.sdk.packages) || []),\n        {\n          name: 'npm:@sentry/browser',\n          version: SDK_VERSION,\n        },\n      ],\n      version: SDK_VERSION,\n    };\n\n    return super._prepareEvent(event, scope, hint);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  protected _sendEvent(event: Event): void {\n    const integration = this.getIntegration(Breadcrumbs);\n    if (integration) {\n      integration.addSentryBreadcrumb(event);\n    }\n    super._sendEvent(event);\n  }\n}\n","import { getCurrentHub, initAndBind, Integrations as CoreIntegrations } from '@sentry/core';\nimport { getGlobalObject, SyncPromise } from '@sentry/utils';\n\nimport { BrowserOptions } from './backend';\nimport { BrowserClient } from './client';\nimport { ReportDialogOptions, wrap as internalWrap } from './helpers';\nimport { Breadcrumbs, GlobalHandlers, LinkedErrors, TryCatch, UserAgent } from './integrations';\n\nexport const defaultIntegrations = [\n  new CoreIntegrations.InboundFilters(),\n  new CoreIntegrations.FunctionToString(),\n  new TryCatch(),\n  new Breadcrumbs(),\n  new GlobalHandlers(),\n  new LinkedErrors(),\n  new UserAgent(),\n];\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n *   dsn: '__DSN__',\n *   // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n *   scope.setExtra({ battery: 0.7 });\n *   scope.setTag({ user_mode: 'admin' });\n *   scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n *   message: 'My Breadcrumb',\n *   // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n *   message: 'Manual',\n *   stacktrace: [\n *     // ...\n *   ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): void {\n  if (options.defaultIntegrations === undefined) {\n    options.defaultIntegrations = defaultIntegrations;\n  }\n  if (options.release === undefined) {\n    const window = getGlobalObject<Window>();\n    // This supports the variable that sentry-webpack-plugin injects\n    if (window.SENTRY_RELEASE && window.SENTRY_RELEASE.id) {\n      options.release = window.SENTRY_RELEASE.id;\n    }\n  }\n  if (options.autoSessionTracking === undefined) {\n    options.autoSessionTracking = false;\n  }\n\n  initAndBind(BrowserClient, options);\n\n  if (options.autoSessionTracking) {\n    startSessionTracking();\n  }\n}\n\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\nexport function showReportDialog(options: ReportDialogOptions = {}): void {\n  if (!options.eventId) {\n    options.eventId = getCurrentHub().lastEventId();\n  }\n  const client = getCurrentHub().getClient<BrowserClient>();\n  if (client) {\n    client.showReportDialog(options);\n  }\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n  return getCurrentHub().lastEventId();\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n  // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n  callback();\n}\n\n/**\n * A promise that resolves when all current events have been sent.\n * If you provide a timeout and the queue takes longer to drain the promise returns false.\n *\n * @param timeout Maximum time in ms the client should wait.\n */\nexport function flush(timeout?: number): PromiseLike<boolean> {\n  const client = getCurrentHub().getClient<BrowserClient>();\n  if (client) {\n    return client.flush(timeout);\n  }\n  return SyncPromise.reject(false);\n}\n\n/**\n * A promise that resolves when all current events have been sent.\n * If you provide a timeout and the queue takes longer to drain the promise returns false.\n *\n * @param timeout Maximum time in ms the client should wait.\n */\nexport function close(timeout?: number): PromiseLike<boolean> {\n  const client = getCurrentHub().getClient<BrowserClient>();\n  if (client) {\n    return client.close(timeout);\n  }\n  return SyncPromise.reject(false);\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrap(fn: (...args: any) => any): any {\n  return internalWrap(fn)();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking(): void {\n  const window = getGlobalObject<Window>();\n  const hub = getCurrentHub();\n\n  /**\n   * We should be using `Promise.all([windowLoaded, firstContentfulPaint])` here,\n   * but, as always, it's not available in the IE10-11. Thanks IE.\n   */\n  let loadResolved = document.readyState === 'complete';\n  let fcpResolved = false;\n  const possiblyEndSession = (): void => {\n    if (fcpResolved && loadResolved) {\n      hub.endSession();\n    }\n  };\n  const resolveWindowLoaded = (): void => {\n    loadResolved = true;\n    possiblyEndSession();\n    window.removeEventListener('load', resolveWindowLoaded);\n  };\n\n  hub.startSession();\n\n  if (!loadResolved) {\n    // IE doesn't support `{ once: true }` for event listeners, so we have to manually\n    // attach and then detach it once completed.\n    window.addEventListener('load', resolveWindowLoaded);\n  }\n\n  try {\n    const po = new PerformanceObserver((entryList, po) => {\n      entryList.getEntries().forEach(entry => {\n        if (entry.name === 'first-contentful-paint' && entry.startTime < firstHiddenTime) {\n          po.disconnect();\n          fcpResolved = true;\n          possiblyEndSession();\n        }\n      });\n    });\n\n    // There's no need to even attach this listener if `PerformanceObserver` constructor will fail,\n    // so we do it below here.\n    let firstHiddenTime = document.visibilityState === 'hidden' ? 0 : Infinity;\n    document.addEventListener(\n      'visibilitychange',\n      event => {\n        firstHiddenTime = Math.min(firstHiddenTime, event.timeStamp);\n      },\n      { once: true },\n    );\n\n    po.observe({\n      type: 'paint',\n      buffered: true,\n    });\n  } catch (e) {\n    fcpResolved = true;\n    possiblyEndSession();\n  }\n}\n","export * from './exports';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\nimport { getGlobalObject } from '@sentry/utils';\n\nimport * as BrowserIntegrations from './integrations';\nimport * as Transports from './transports';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\nconst _window = getGlobalObject<Window>();\nif (_window.Sentry && _window.Sentry.Integrations) {\n  windowIntegrations = _window.Sentry.Integrations;\n}\n\nconst INTEGRATIONS = {\n  ...windowIntegrations,\n  ...CoreIntegrations,\n  ...BrowserIntegrations,\n};\n\nexport { INTEGRATIONS as Integrations, Transports };\n","import { getCurrentHub } from '@sentry/hub';\nimport { Client, Options } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\n/** A class object that can instantiate Client objects. */\nexport type ClientClass<F extends Client, O extends Options> = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind<F extends Client, O extends Options>(clientClass: ClientClass<F, O>, options: O): void {\n  if (options.debug === true) {\n    logger.enable();\n  }\n  const hub = getCurrentHub();\n  const client = new clientClass(options);\n  hub.bindClient(client);\n}\n"],"names":["LogLevel","SessionStatus","Severity","Status","isError","wat","Object","prototype","toString","call","isInstanceOf","Error","isErrorEvent","isDOMError","isString","isPrimitive","isPlainObject","isEvent","Event","isElement","Element","isThenable","Boolean","then","base","_e","htmlTreeAsString","elem","currentElem","out","height","len","sepLength","length","nextStr","_htmlElementAsString","push","parentNode","reverse","join","_oO","el","className","classes","key","attr","i","tagName","toLowerCase","id","split","allowedAttrs","getAttribute","level","Debug","Info","Warning","Fatal","Critical","Log","code","Success","RateLimit","Invalid","Failed","Unknown","setPrototypeOf","__proto__","Array","obj","proto","prop","hasOwnProperty","message","_super","_this","name","_newTarget","constructor","__extends","DSN_REGEX","from","this","_fromString","_fromComponents","_validate","Dsn","withPassword","_a","host","path","pass","port","projectId","str","match","exec","SentryError","protocol","user","_b","_c","slice","pop","projectMatch","components","forEach","component","ERROR_MESSAGE","isNaN","parseInt","_hasWeakSet","WeakSet","_inner","Memo","has","add","delete","splice","defaultFunctionName","getFunctionName","fn","e","truncate","max","substr","safeJoin","input","delimiter","isArray","output","value","String","isMatchingPattern","pattern","test","indexOf","fill","source","replacement","original","wrapped","defineProperties","__sentry_original__","enumerable","_Oo","getWalkSource","error","err","stack","event_1","type","target","currentTarget","CustomEvent","detail","jsonSize","encodeURI","utf8Length","JSON","stringify","normalizeToSize","object","depth","maxSize","serialized","normalize","normalizeValue","_events","global","window","document","walk","memo","Infinity","normalized","serializeValue","toJSON","acc","memoize","innerKey","unmemoize","parse","extractExceptionKeysForMessage","exception","maxLength","keys","sort","includedKeys","dropUndefinedKeys","val","rv","__values","map","isNodeEnv","process","fallbackGlobalObject","getGlobalObject","self","uuid4","crypto","msCrypto","getRandomValues","arr","Uint16Array","pad","num","v","replace","c","r","Math","random","parseUrl","url","query","fragment","relative","getEventDescription","event","values","event_id","consoleSandbox","callback","originalConsole","console","wrappedLevels","result","addExceptionTypeValue","addExceptionMechanism","mechanism","defaultRetryAfter","PREFIX","_enabled","Logger","_i","args","log","warn","__SENTRY__","logger","supportsFetch","Headers","Request","Response","isNativeFetch","func","supportsReferrerPolicy","referrerPolicy","lastHref","handlers","instrumented","instrument","originalConsoleLevel","triggerHandlers","Function","apply","instrumentConsole","addEventListener","domEventHandler","bind","keypressEventHandler","eventName","options","handleEvent","innerOriginal","__sentry_wrapped__","instrumentDOM","requestKeys","requestValues","xhrproto","XMLHttpRequest","originalOpen","xhr","__sentry_xhr__","method","toUpperCase","__sentry_own_request__","onreadystatechangeHandler","readyState","status_code","status","requestPos","args_1","undefined","body","endTimestamp","Date","now","startTimestamp","onreadystatechange","readyStateArgs","originalSend","instrumentXHR","fetch","doc","createElement","sandbox","hidden","head","appendChild","contentWindow","removeChild","supportsNativeFetch","originalFetch","handlerData","fetchData","getFetchMethod","getFetchUrl","response","instrumentFetch","chrome","isChromePackagedApp","app","runtime","hasHistoryApi","history","pushState","replaceState","oldOnPopState","onpopstate","historyReplacementFunction","originalHistoryFunction","to","location","href","instrumentHistory","_oldOnErrorHandler","onerror","msg","line","column","arguments","_oldOnUnhandledRejectionHandler","onunhandledrejection","addInstrumentationHandler","handler","data","fetchArgs","keypressTimeout","lastCapturedEvent","debounceDuration","debounceTimer","debounce","clearTimeout","setTimeout","isContentEditable","States","executor","PENDING","_setResult","RESOLVED","reason","REJECTED","state","_state","_resolve","_reject","_value","_executeHandlers","_handlers","concat","cachedHandlers","done","onfulfilled","onrejected","SyncPromise","resolve","_","reject","collection","counter","resolvedCollection","item","index","TypeError","_attachHandler","onfinally","isRejected","_limit","PromiseBuffer","task","isReady","_buffer","remove","timeout","capturedSetTimeout","all","dateTimestampSource","nowSeconds","platformPerformance","mod","module","request","require","performance","getNodePerformance","timeOrigin","getBrowserPerformance","timestampSource","dateTimestampInSeconds","timing","navigationStart","Scope","scope","newScope","_breadcrumbs","_tags","_extra","_contexts","_user","_level","_span","_session","_transactionName","_fingerprint","_eventProcessors","_scopeListeners","update","_notifyScopeListeners","tags","extras","extra","fingerprint","setTransactionName","context","span","getSpan","transaction","spanRecorder","spans","session","captureContext","updatedScope","contexts","breadcrumb","maxBreadcrumbs","mergedBreadcrumb","timestamp","__spread","hint","trace","getTraceContext","transactionName","_applyFingerprint","breadcrumbs","_notifyEventProcessors","getGlobalEventProcessors","processors","processor","final","_notifyingListeners","globalEventProcessors","addGlobalEventProcessor","Ok","Session","ip_address","ipAddress","did","email","username","sid","started","duration","release","environment","userAgent","errors","Exited","init","toISOString","attrs","user_agent","API_VERSION","client","_version","getStackTop","bindClient","Hub","version","setupIntegrations","clone","getScope","getStack","getClient","pushScope","popScope","_stack","eventId","_lastEventId","finalHint","syntheticException","originalException","_invokeClient","beforeBreadcrumb","_d","finalBreadcrumb","addBreadcrumb","min","setUser","setTags","setExtras","setTag","setExtra","setContext","oldHub","makeMain","integration","getIntegration","_callExtensionMethod","customSamplingContext","endSession","getUser","setSession","getSession","close","captureSession","sentry","getMainCarrier","extensions","carrier","hub","registry","getHubFromCarrier","setHubOnCarrier","getCurrentHub","hasHubOnCarrier","isOlderThan","activeDomain","domain","active","registryHubTopStack","getHubFromActiveDomain","callOnHub","captureException","withScope","dsn","_dsnObject","API","_getIngestEndpoint","getStoreEndpoint","_encodedAuth","_getEnvelopeEndpoint","clientName","clientVersion","header","Content-Type","X-Sentry-Auth","dialogOptions","endpoint","getBaseApiEndpoint","encodedOptions","encodeURIComponent","auth","sentry_key","sentry_version","installedIntegrations","integrations","defaultIntegrations","userIntegrations","userIntegrationsNames_1","pickedIntegrationsNames_1","defaultIntegration","userIntegration","integrationsNames","getIntegrationsToSetup","setupOnce","setupIntegration","originalFunctionToString","backendClass","_backend","_options","_dsn","BaseClient","_process","_getBackend","eventFromException","_captureEvent","promisedEvent","eventFromMessage","_sendSession","_isClientProcessing","ready","getTransport","transportFlushed","flush","getOptions","enabled","_isEnabled","_integrations","crashed","errored","exceptions","exceptions_1","handled","headers","Crashed","Number","sendSession","ticked","interval","setInterval","_processing","clearInterval","normalizeDepth","prepared","_applyClientOptions","_applyIntegrationsMetadata","finalScope","applyToEvent","evt","_normalizeEvent","b","dist","maxValueLength","sdkInfo","sdk","integrationsArray","sendEvent","_processEvent","finalEvent","beforeSend","sampleRate","isTransaction","_prepareEvent","__sentry__","beforeSendResult","processedEvent","_updateSessionFromEvent","_sendEvent","promise","NoopTransport","Skipped","_transport","_setupTransport","BaseBackend","_exception","_hint","_message","sessionToSentryRequest","api","sent_at","getEnvelopeEndpointWithUrlEncodedAuth","eventToSentryRequest","useEnvelope","req","getStoreEndpointWithUrlEncodedAuth","envelope","FunctionToString","DEFAULT_IGNORE_ERRORS","InboundFilters","clientOptions","_mergeOptions","_shouldDropEvent","_isSentryError","_isIgnoredError","_isDeniedUrl","_getEventFilterUrl","_isAllowedUrl","ignoreInternal","ignoreErrors","_getPossibleEventMessages","some","denyUrls","allowUrls","whitelistUrls","blacklistUrls","oO","stacktrace","frames_1","frames","filename","frames_2","UNKNOWN_FUNCTION","gecko","winjs","geckoEval","chromeEval","reactMinifiedRegexp","computeStackTrace","ex","popSize","framesToPop","parts","opera10Regex","opera11Regex","lines","element","extractMessage","computeStackTraceFromStacktraceProp","popFrames","submatch","isNative","columnNumber","computeStackTraceFromStackProp","failed","STACKTRACE_LIMIT","exceptionFromStacktrace","prepareFramesForEvent","eventFromStacktrace","localStack","firstFrameFunction","lastFrameFunction","frame","colno","function","in_app","lineno","eventFromUnknownInput","attachStacktrace","eventFromString","domException","name_1","DOMException.code","rejection","__serialized__","eventFromPlainObject","synthetic","_api","BaseTransport","drain","requestType","fromHttpCode","_handleRateLimit","_disabledUntil","category","_rateLimits","rlHeader","raHeader","trim","parameters","headerDelay","delay","headerDate","parseRetryAfterHeader","FetchTransport","_sendRequest","sentryRequest","originalPayload","_isRateLimited","Promise","fetchParameters","assign","x-sentry-rate-limits","get","retry-after","_handleResponse","catch","XHRTransport","getResponseHeader","open","setRequestHeader","send","BrowserBackend","transportOptions","transport","ignoreOnError","shouldIgnoreOnError","wrap","before","sentryWrapped","wrappedArguments","arg","addEventProcessor","property","defineProperty","getOwnPropertyDescriptor","configurable","injectReportDialog","script","async","src","getReportDialogEndpoint","onLoad","onload","GlobalHandlers","stackTraceLimit","_installGlobalOnErrorHandler","_installGlobalOnUnhandledRejectionHandler","_onErrorHandlerInstalled","currentHub","hasIntegration","isFailedOwnDelivery","_eventFromIncompleteOnError","_enhanceEventWithInitialFrame","captureEvent","_onUnhandledRejectionHandlerInstalled","_eventFromIncompleteRejection","groups","getLocationHref","DEFAULT_EVENT_TARGET","TryCatch","eventTarget","requestAnimationFrame","_wrapTimeFunction","_wrapRAF","_wrapXHR","_wrapEventTarget","originalCallback","originalRemoveEventListener","wrappedEventHandler","originalEventHandler","wrapOptions","Breadcrumbs","dom","_consoleBreadcrumb","_domBreadcrumb","_xhrBreadcrumb","_fetchBreadcrumb","_historyBreadcrumb","fromString","parsedLoc","parsedFrom","parsedTo","DEFAULT_KEY","DEFAULT_LIMIT","LinkedErrors","_key","limit","_handler","linkedErrors","_walkErrorTree","UserAgent","navigator","referrer","Referer","User-Agent","SDK_NAME","BrowserClient","getDsn","platform","packages","addSentryBreadcrumb","CoreIntegrations.InboundFilters","CoreIntegrations.FunctionToString","windowIntegrations","_window","Sentry","Integrations","INTEGRATIONS","CoreIntegrations","BrowserIntegrations","window_1","SENTRY_RELEASE","autoSessionTracking","clientClass","debug","enable","initAndBind","loadResolved","fcpResolved","possiblyEndSession","resolveWindowLoaded","removeEventListener","startSession","po","PerformanceObserver","entryList","getEntries","entry","startTime","firstHiddenTime_1","disconnect","visibilityState","timeStamp","once","observe","buffered","startSessionTracking","lastEventId","showReportDialog","internalWrap"],"mappings":";gVACYA,ECmDAC,EClDAC,ECAAC,qvBCOIC,EAAQC,GACtB,OAAQC,OAAOC,UAAUC,SAASC,KAAKJ,IACrC,IAAK,iBAEL,IAAK,qBAEL,IAAK,wBACH,OAAO,EACT,QACE,OAAOK,EAAaL,EAAKM,iBAWfC,EAAaP,GAC3B,MAA+C,wBAAxCC,OAAOC,UAAUC,SAASC,KAAKJ,YAUxBQ,EAAWR,GACzB,MAA+C,sBAAxCC,OAAOC,UAAUC,SAASC,KAAKJ,YAqBxBS,EAAST,GACvB,MAA+C,oBAAxCC,OAAOC,UAAUC,SAASC,KAAKJ,YAUxBU,EAAYV,GAC1B,OAAe,OAARA,GAAgC,iBAARA,GAAmC,mBAARA,WAU5CW,EAAcX,GAC5B,MAA+C,oBAAxCC,OAAOC,UAAUC,SAASC,KAAKJ,YAUxBY,EAAQZ,GACtB,MAAwB,oBAAVa,OAAyBR,EAAaL,EAAKa,gBAU3CC,EAAUd,GACxB,MAA0B,oBAAZe,SAA2BV,EAAaL,EAAKe,kBAkB7CC,EAAWhB,GAEzB,OAAOiB,QAAQjB,GAAOA,EAAIkB,MAA4B,mBAAblB,EAAIkB,eAqB/Bb,EAAaL,EAAUmB,G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AAUqC,KAAgBwV,eAEpC,IAAM3Y,EAASmD,KAAgBzC,YAC3BV,GACFA,EAAO4Y,iBAAiB/lB,gCxBsG1BkK,EACAqF,GAEA,OAAOuB,GAAU,wBAAyB5G,GAAWqF,mCwBxClCrY,GACnB,OAAO8uB,GAAa9uB,EAAb8uB"}
\ No newline at end of file
diff --git a/cdn/dev/js/sentry.js b/cdn/dev/js/sentry.js
deleted file mode 100644
index b5d36bcc..00000000
--- a/cdn/dev/js/sentry.js
+++ /dev/null
@@ -1,53 +0,0 @@
-(function initializeSentry() {
-  if(!window.Sentry) {
-    // Sentry scripts may have been blocked by client browser;
-    // we won't be reporting errors to Sentry, but we don't
-    // want to throw other errors
-    return;
-  }
-
-  //
-  // Initialize Sentry for this site
-  //
-
-  Sentry.init({
-    dsn: "https://44d5544d7c45466ba1928b9196faf67e@o1005580.ingest.us.sentry.io/5983516",
-    integrations: [
-      Sentry.httpClientIntegration(),
-      Sentry.captureConsoleIntegration({
-        levels: ['error', 'warning']
-      })
-    ],
-    environment: sentryEnvironment.tier,
-  });
-
-  //
-  // Capture resource load errors
-  // per https://docs.sentry.io/platforms/javascript/troubleshooting/#capturing-resource-404s
-  //
-
-  window.addEventListener(
-    "error",
-    (event) => {
-      if (!event.target) return;
-
-      console.log('img fail');
-
-      if (event.target.tagName === "IMG") {
-        Sentry.captureException(
-          new Error(`Failed to load image: ${event.target.src}`),
-        );
-      } else if (event.target.tagName === "LINK" && event.target.rel === "stylesheet") {
-        Sentry.captureException(
-          new Error(`Failed to load external stylesheet: ${event.target.href}`),
-        );
-      } else if (event.target.tagName === "SCRIPT") {
-        Sentry.captureException(
-          new Error(`Failed to load external script: ${event.target.src}`),
-        );
-      }
-    },
-    true, // useCapture - necessary for resource loading errors
-  );
-  console.log(`Sentry initialization complete: tier=${sentryEnvironment.tier}`);
-})();
diff --git a/contact/index.php b/contact/index.php
index 31b499c3..8bd2f11d 100644
--- a/contact/index.php
+++ b/contact/index.php
@@ -39,5 +39,7 @@
   <br/>
   7500 W Camp Wisdom Rd
   <br/>
-  Texas USA 75236
+  Dallas, TX 75236-5629
+  <br/>
+  USA
 </p>
diff --git a/prog/download-log.php b/prog/download-log.php
deleted file mode 100644
index f92e6d23..00000000
--- a/prog/download-log.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-  $keyboard = $_POST['Keyboard'];
-  $email = $_POST['Email'];
-  $token = '_keyman_com_internal_12_06_2014';
-  $params = array('Keyboard' => $keyboard, 'Email' => $email, 'Token' => $token);
-  $query = http_build_query($params);
-  $contextData = array (
-    'method' => 'POST',
-    'header' => "Connection: close\r\n"."Content-Length: ".strlen($query)."\r\n",
-    'content'=> $query
-  );
-  $context = stream_context_create (array ( 'http' => $contextData ));
-  $result =  file_get_contents (
-    'http://testsite.tavultesoft.local/prog/logdownload.php',
-    false,
-    $context
-  );
-  echo $result;
-?>
\ No newline at end of file
diff --git a/prog/purchase-now.php b/prog/purchase-now.php
deleted file mode 100644
index cff7a21f..00000000
--- a/prog/purchase-now.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-  $promotion = 'InstantBuy';
-  $productID = '12';
-  $seatCount = '1';
-  $link = 'http://testsite.tavultesoft.local/buy/addtocart.php?OnlineProductId='.$productID.'&SeatCount='.$seatCount.'&Promotion='.$promotion;
-  header('Location: '.$link);
-?>
\ No newline at end of file
diff --git a/resources/init-container.sh b/resources/init-container.sh
index 033c7bcd..f1cb5c18 100755
--- a/resources/init-container.sh
+++ b/resources/init-container.sh
@@ -1,12 +1,15 @@
 #!/usr/bin/env bash
 
+THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
+THIS_SCRIPT_PATH="$(dirname "$THIS_SCRIPT")"
+
 if [[ ! $1 =~ "debug" ]]; then
   echo "---- Generating CDN ---"
-  rm -rf cdn/deploy
-  cd cdn
+  rm -rf "$THIS_SCRIPT_PATH/../cdn/deploy"
+  cd "$THIS_SCRIPT_PATH/../cdn"
   php -d include_path=/var/www/html/_includes:. cdnrefresh.php
   cd ..
 else
   echo "Skip Generating CDN and clean CDN cache"
-  rm -rf cdn/deploy
+  rm -rf "$THIS_SCRIPT_PATH/../cdn/deploy"
 fi