{"version":3,"file":"sentry-miniapp.mjs","names":["SDK_VERSION","SDK_VERSION","isEnabled","warn","error","debug","getFunctionName","isInstanceOf","isErrorEvent","debug","getFunctionName","debug","withScope","debug","spanWithMaybeDsc","debug","debug","debug","debug","debug","debug","debug","_getBufferMap","debug","debug","debug","this","debug","INTEGRATION_NAME","INTEGRATION_NAME","_shouldDropEvent","debug","isErrorEvent","DEFAULT_KEY","DEFAULT_LIMIT","INTEGRATION_NAME","linkedErrorsIntegration","INTEGRATION_NAME","debug","dedupeIntegration","rewriteFramesIntegration","captureFeedback"],"sources":["../src/polyfills.ts","../src/polyfills-bootstrap.ts","../node_modules/@sentry/core/build/esm/debug-build.js","../node_modules/@sentry/core/build/esm/utils/worldwide.js","../node_modules/@sentry/core/build/esm/utils/version.js","../node_modules/@sentry/core/build/esm/carrier.js","../node_modules/@sentry/core/build/esm/utils/debug-logger.js","../node_modules/@sentry/core/build/esm/utils/stacktrace.js","../node_modules/@sentry/core/build/esm/utils/is.js","../node_modules/@sentry/core/build/esm/utils/object.js","../node_modules/@sentry/core/build/esm/utils/randomSafeContext.js","../node_modules/@sentry/core/build/esm/utils/normalizationHints.js","../node_modules/@sentry/core/build/esm/utils/normalize.js","../node_modules/@sentry/core/build/esm/utils/string.js","../node_modules/@sentry/core/build/esm/utils/misc.js","../node_modules/@sentry/core/build/esm/utils/time.js","../node_modules/@sentry/core/build/esm/session.js","../node_modules/@sentry/core/build/esm/utils/merge.js","../node_modules/@sentry/core/build/esm/utils/propagationContext.js","../node_modules/@sentry/core/build/esm/utils/weakRef.js","../node_modules/@sentry/core/build/esm/utils/spanOnScope.js","../node_modules/@sentry/core/build/esm/scope.js","../node_modules/@sentry/core/build/esm/defaultScopes.js","../node_modules/@sentry/core/build/esm/utils/chain-and-copy-promiselike.js","../node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js","../node_modules/@sentry/core/build/esm/asyncContext/index.js","../node_modules/@sentry/core/build/esm/attributes.js","../node_modules/@sentry/core/build/esm/currentScopes.js","../node_modules/@sentry/core/build/esm/semanticAttributes.js","../node_modules/@sentry/core/build/esm/tracing/spanstatus.js","../node_modules/@sentry/core/build/esm/tracing/utils.js","../node_modules/@sentry/core/build/esm/utils/baggage.js","../node_modules/@sentry/core/build/esm/utils/dsn.js","../node_modules/@sentry/core/build/esm/utils/parseSampleRate.js","../node_modules/@sentry/core/build/esm/utils/tracing.js","../node_modules/@sentry/core/build/esm/utils/spanUtils.js","../node_modules/@sentry/core/build/esm/utils/hasSpansEnabled.js","../node_modules/@sentry/core/build/esm/utils/should-ignore-span.js","../node_modules/@sentry/core/build/esm/tracing/sentryNonRecordingSpan.js","../node_modules/@sentry/core/build/esm/constants.js","../node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js","../node_modules/@sentry/core/build/esm/tracing/spans/beforeSendSpan.js","../node_modules/@sentry/core/build/esm/utils/envelope.js","../node_modules/@sentry/core/build/esm/envelope.js","../node_modules/@sentry/core/build/esm/tracing/logSpans.js","../node_modules/@sentry/core/build/esm/tracing/measurement.js","../node_modules/@sentry/core/build/esm/tracing/segmentSpanCaptureStrategy.js","../node_modules/@sentry/core/build/esm/tracing/spans/hasSpanStreamingEnabled.js","../node_modules/@sentry/core/build/esm/tracing/sentrySpan.js","../node_modules/@sentry/core/build/esm/utils/handleCallbackErrors.js","../node_modules/@sentry/core/build/esm/tracing/sampling.js","../node_modules/@sentry/core/build/esm/tracing/trace.js","../node_modules/@sentry/core/build/esm/utils/scopeData.js","../node_modules/@sentry/core/build/esm/utils/syncpromise.js","../node_modules/@sentry/core/build/esm/eventProcessors.js","../node_modules/@sentry/core/build/esm/utils/debug-ids.js","../node_modules/@sentry/core/build/esm/utils/prepareEvent.js","../node_modules/@sentry/core/build/esm/exports.js","../node_modules/@sentry/core/build/esm/utils/timer.js","../node_modules/@sentry/core/build/esm/api.js","../node_modules/@sentry/core/build/esm/integration.js","../node_modules/@sentry/core/build/esm/utils/timestampSequence.js","../node_modules/@sentry/core/build/esm/utils/trace-info.js","../node_modules/@sentry/core/build/esm/logs/constants.js","../node_modules/@sentry/core/build/esm/utils/env.js","../node_modules/@sentry/core/build/esm/utils/node.js","../node_modules/@sentry/core/build/esm/utils/isBrowser.js","../node_modules/@sentry/core/build/esm/logs/envelope.js","../node_modules/@sentry/core/build/esm/logs/internal.js","../node_modules/@sentry/core/build/esm/metrics/envelope.js","../node_modules/@sentry/core/build/esm/metrics/internal.js","../node_modules/@sentry/core/build/esm/tracing/spans/spanJsonToStreamedSpan.js","../node_modules/@sentry/core/build/esm/tracing/spans/extractGenAiSpans.js","../node_modules/@sentry/core/build/esm/utils/promisebuffer.js","../node_modules/@sentry/core/build/esm/utils/ratelimit.js","../node_modules/@sentry/core/build/esm/transports/base.js","../node_modules/@sentry/core/build/esm/utils/clientreport.js","../node_modules/@sentry/core/build/esm/utils/eventUtils.js","../node_modules/@sentry/core/build/esm/utils/transactionEvent.js","../node_modules/@sentry/core/build/esm/utils/data-collection/filtering-snippets.js","../node_modules/@sentry/core/build/esm/utils/data-collection/defaultPiiToCollectionOptions.js","../node_modules/@sentry/core/build/esm/utils/data-collection/resolveDataCollectionOptions.js","../node_modules/@sentry/core/build/esm/client.js","../node_modules/@sentry/core/build/esm/sdk.js","../node_modules/@sentry/core/build/esm/transports/offline.js","../node_modules/@sentry/core/build/esm/utils/url.js","../node_modules/@sentry/core/build/esm/utils/isSentryRequestUrl.js","../node_modules/@sentry/core/build/esm/utils/parameterize.js","../node_modules/@sentry/core/build/esm/utils/traceData.js","../node_modules/@sentry/core/build/esm/breadcrumbs.js","../node_modules/@sentry/core/build/esm/integrations/functiontostring.js","../node_modules/@sentry/core/build/esm/integrations/eventFilters.js","../node_modules/@sentry/core/build/esm/utils/aggregate-errors.js","../node_modules/@sentry/core/build/esm/utils/eventbuilder.js","../node_modules/@sentry/core/build/esm/integrations/linkederrors.js","../node_modules/@sentry/core/build/esm/integrations/dedupe.js","../node_modules/@sentry/core/build/esm/utils/path.js","../node_modules/@sentry/core/build/esm/integrations/rewriteframes.js","../node_modules/@sentry/core/build/esm/feedback.js","../node_modules/@sentry/core/build/esm/logs/public-api.js","../src/version.ts","../src/stacktrace.ts","../src/consent.ts","../src/crossPlatform.ts","../src/transports/requestMarker.ts","../src/transports/xhr.ts","../src/transports/offlineStore.ts","../src/transports/index.ts","../src/transports/consent.ts","../src/debugIds.ts","../src/client.ts","../src/diagnostics.ts","../src/helpers.ts","../src/integrations/globalhandlers.ts","../src/integrations/trycatch.ts","../src/integrations/linkederrors.ts","../src/integrations/httpcontext.ts","../src/integrations/dedupe.ts","../src/integrations/system.ts","../src/instrumentation.ts","../src/integrations/router.ts","../src/integrations/performance.ts","../src/integrations/rewriteframes.ts","../src/integrations/networkbreadcrumbs.ts","../src/appLifecycle.ts","../src/integrations/pagebreadcrumbs.ts","../src/integrations/console.ts","../src/integrations/session.ts","../src/integrations/networkstatus.ts","../src/integrations/minigame.ts","../src/integrations/minigame-framerate.ts","../src/integrations/index.ts","../src/sdk.ts"],"sourcesContent":["/**\n * Polyfills for miniapp environment\n * 小程序环境的 polyfill 实现\n */\n\n/**\n * URLSearchParams polyfill for miniapp environment\n * 小程序环境的 URLSearchParams polyfill\n */\nclass URLSearchParamsPolyfill {\n  private _entries: Array<[string, string]> = [];\n\n  constructor(init?: string | Record<string, string> | URLSearchParamsPolyfill | string[][]) {\n    if (typeof init === 'string') {\n      this._parseString(init);\n    } else if (Array.isArray(init)) {\n      for (const pair of init) {\n        if (Array.isArray(pair) && pair.length >= 2) {\n          this._entries.push([pair[0] || '', pair[1] || '']);\n        }\n      }\n    } else if (init && typeof init === 'object') {\n      if (init instanceof URLSearchParamsPolyfill) {\n        this._entries = init._entries.map(([k, v]) => [k, v]);\n      } else {\n        for (const [key, value] of Object.entries(init)) {\n          this._entries.push([key, value]);\n        }\n      }\n    }\n  }\n\n  get size(): number {\n    return this._entries.length;\n  }\n\n  private _parseString(str: string): void {\n    if (str.startsWith('?')) {\n      str = str.slice(1);\n    }\n\n    if (!str) {\n      return;\n    }\n\n    const pairs = str.split('&');\n    for (const pair of pairs) {\n      const eqIndex = pair.indexOf('=');\n      if (eqIndex === -1) {\n        if (pair) {\n          this._entries.push([decodeURIComponent(pair), '']);\n        }\n      } else {\n        const key = pair.slice(0, eqIndex);\n        const value = pair.slice(eqIndex + 1);\n        if (key) {\n          this._entries.push([decodeURIComponent(key), decodeURIComponent(value)]);\n        }\n      }\n    }\n  }\n\n  append(name: string, value: string): void {\n    this._entries.push([name, String(value)]);\n  }\n\n  delete(name: string): void {\n    this._entries = this._entries.filter(([key]) => key !== name);\n  }\n\n  get(name: string): string | null {\n    const entry = this._entries.find(([key]) => key === name);\n    return entry ? entry[1] : null;\n  }\n\n  getAll(name: string): string[] {\n    return this._entries.filter(([key]) => key === name).map(([, value]) => value);\n  }\n\n  has(name: string): boolean {\n    return this._entries.some(([key]) => key === name);\n  }\n\n  set(name: string, value: string): void {\n    const strValue = String(value);\n    let found = false;\n    this._entries = this._entries.filter(([key]) => {\n      if (key === name) {\n        if (!found) {\n          found = true;\n          return true;\n        }\n        return false;\n      }\n      return true;\n    });\n    if (found) {\n      const idx = this._entries.findIndex(([key]) => key === name);\n      if (idx !== -1) {\n        this._entries[idx] = [name, strValue];\n      }\n    } else {\n      this._entries.push([name, strValue]);\n    }\n  }\n\n  sort(): void {\n    this._entries.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));\n  }\n\n  toString(): string {\n    return this._entries\n      .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n      .join('&');\n  }\n\n  forEach(callback: (value: string, key: string, parent: URLSearchParamsPolyfill) => void): void {\n    for (const [key, value] of this._entries) {\n      callback(value, key, this);\n    }\n  }\n\n  private *_createIterator<T>(getValue: (entry: [string, string]) => T): IterableIterator<T> {\n    const entries = this._entries;\n    for (let index = 0; index < entries.length; index += 1) {\n      yield getValue(entries[index]!);\n    }\n  }\n\n  keys(): IterableIterator<string> {\n    return this._createIterator(([key]) => key);\n  }\n\n  values(): IterableIterator<string> {\n    return this._createIterator(([, value]) => value);\n  }\n\n  entries(): IterableIterator<[string, string]> {\n    return this._createIterator((entry) => entry);\n  }\n\n  [Symbol.iterator](): IterableIterator<[string, string]> {\n    return this.entries();\n  }\n}\n\n/**\n * Get the JS global scope for the current environment.\n * 获取当前环境的 JS 全局作用域。\n *\n * URLSearchParams 是全局构造器，不属于某个平台 SDK 对象（wx/my/…），因此这里只解析\n * 全局作用域，不再枚举平台全局——平台检测的唯一来源是 crossPlatform 的 PLATFORMS 表。\n */\nfunction getGlobalObject(): any {\n  if (typeof globalThis !== 'undefined') {\n    return globalThis;\n  }\n  if (typeof window !== 'undefined') return window;\n  if (typeof global !== 'undefined') return global;\n  if (typeof self !== 'undefined') return self;\n\n  try {\n    return Function('return this')();\n  } catch (_e) {\n    // 某些严格 CSP 环境下 Function 构造器不可用\n    return undefined;\n  }\n}\n\n/**\n * Install polyfills for miniapp environment\n * 为小程序环境安装 polyfill\n */\nexport function installPolyfills(): void {\n  try {\n    const globalObj = getGlobalObject();\n\n    if (!globalObj) {\n      console.warn(\n        '[sentry-miniapp] Unable to detect global object, polyfills may not work correctly',\n      );\n      return;\n    }\n\n    // Install URLSearchParams polyfill if not available\n    if (typeof globalObj.URLSearchParams === 'undefined') {\n      globalObj.URLSearchParams = URLSearchParamsPolyfill;\n    }\n  } catch (error) {\n    console.warn('[sentry-miniapp] Failed to install polyfills:', error);\n  }\n}\n\n/**\n * Check if we're in a miniapp environment and install polyfills\n * 检查是否在小程序环境中并安装 polyfill\n */\nexport function ensurePolyfills(): void {\n  // Always install polyfills regardless of environment to ensure compatibility\n  // This ensures URLSearchParams is always available when needed\n  installPolyfills();\n}\n\n// 不在工具模块导入时隐式修改全局；SDK 入口通过 polyfills-bootstrap.ts 显式调用一次。\n","/**\n * SDK 入口专用的 polyfill 启动模块。\n *\n * 作为 index.ts 的首个 side-effect import，它会在其余静态依赖求值前安装运行时缺失能力；\n * polyfills.ts 本身仍保持无导入副作用，便于工具函数单测和按需复用。\n */\nimport { ensurePolyfills } from './polyfills';\n\nensurePolyfills();\n","const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","const GLOBAL_OBJ = globalThis;\n\nexport { GLOBAL_OBJ };\n//# sourceMappingURL=worldwide.js.map\n","const SDK_VERSION = \"10.74.0\" ;\n\nexport { SDK_VERSION };\n//# sourceMappingURL=version.js.map\n","import { SDK_VERSION } from './utils/version.js';\nimport { GLOBAL_OBJ } from './utils/worldwide.js';\n\nfunction getMainCarrier() {\n  getSentryCarrier(GLOBAL_OBJ);\n  return GLOBAL_OBJ;\n}\nfunction getSentryCarrier(carrier) {\n  const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n  __SENTRY__.version = __SENTRY__.version || SDK_VERSION;\n  return __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {};\n}\nfunction getGlobalSingleton(name, creator, obj = GLOBAL_OBJ) {\n  const __SENTRY__ = obj.__SENTRY__ = obj.__SENTRY__ || {};\n  const carrier = __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {};\n  return carrier[name] || (carrier[name] = creator());\n}\n\nexport { getGlobalSingleton, getMainCarrier, getSentryCarrier };\n//# sourceMappingURL=carrier.js.map\n","import { getGlobalSingleton } from '../carrier.js';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nconst CONSOLE_LEVELS = [\n  \"debug\",\n  \"info\",\n  \"warn\",\n  \"error\",\n  \"log\",\n  \"assert\",\n  \"trace\"\n];\nconst PREFIX = \"Sentry Logger \";\nconst originalConsoleMethods = {};\nfunction consoleSandbox(callback) {\n  if (!(\"console\" in GLOBAL_OBJ)) {\n    return callback();\n  }\n  const console = GLOBAL_OBJ.console;\n  const wrappedFuncs = {};\n  const wrappedLevels = Object.keys(originalConsoleMethods);\n  wrappedLevels.forEach((level) => {\n    const originalConsoleMethod = originalConsoleMethods[level];\n    wrappedFuncs[level] = console[level];\n    console[level] = originalConsoleMethod;\n  });\n  try {\n    return callback();\n  } finally {\n    wrappedLevels.forEach((level) => {\n      console[level] = wrappedFuncs[level];\n    });\n  }\n}\nfunction enable() {\n  _getLoggerSettings().enabled = true;\n}\nfunction disable() {\n  _getLoggerSettings().enabled = false;\n}\nfunction isEnabled() {\n  return _getLoggerSettings().enabled;\n}\nfunction log(...args) {\n  _maybeLog(\"log\", ...args);\n}\nfunction warn(...args) {\n  _maybeLog(\"warn\", ...args);\n}\nfunction error(...args) {\n  _maybeLog(\"error\", ...args);\n}\nfunction _maybeLog(level, ...args) {\n  if (!DEBUG_BUILD) {\n    return;\n  }\n  if (isEnabled()) {\n    consoleSandbox(() => {\n      GLOBAL_OBJ.console[level](`${PREFIX}[${level}]:`, ...args);\n    });\n  }\n}\nfunction _getLoggerSettings() {\n  if (!DEBUG_BUILD) {\n    return { enabled: false };\n  }\n  return getGlobalSingleton(\"loggerSettings\", () => ({ enabled: false }));\n}\nconst debug = {\n  /** Enable logging. */\n  enable,\n  /** Disable logging. */\n  disable,\n  /** Check if logging is enabled. */\n  isEnabled,\n  /** Log a message. */\n  log,\n  /** Log a warning. */\n  warn,\n  /** Log an error. */\n  error\n};\n\nexport { CONSOLE_LEVELS, consoleSandbox, debug, originalConsoleMethods };\n//# sourceMappingURL=debug-logger.js.map\n","const STACKTRACE_FRAME_LIMIT = 50;\nconst UNKNOWN_FUNCTION = \"?\";\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\nconst STRIP_FRAME_REGEXP = /captureMessage|captureException/;\nfunction createStackParser(...parsers) {\n  const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map((p) => p[1]);\n  return (stack, skipFirstLines = 0, framesToPop = 0) => {\n    const frames = [];\n    const lines = stack.split(\"\\n\");\n    for (let i = skipFirstLines; i < lines.length; i++) {\n      let line = lines[i];\n      if (line.length > 1024) {\n        line = line.slice(0, 1024);\n      }\n      const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, \"$1\") : line;\n      if (cleanedLine.includes(\"Error: \")) {\n        continue;\n      }\n      for (const parser of sortedParsers) {\n        const frame = parser(cleanedLine);\n        if (frame) {\n          frames.push(frame);\n          break;\n        }\n      }\n      if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) {\n        break;\n      }\n    }\n    return stripSentryFramesAndReverse(frames.slice(framesToPop));\n  };\n}\nfunction stackParserFromStackParserOptions(stackParser) {\n  if (Array.isArray(stackParser)) {\n    return createStackParser(...stackParser);\n  }\n  return stackParser;\n}\nfunction stripSentryFramesAndReverse(stack) {\n  if (!stack.length) {\n    return [];\n  }\n  const localStack = Array.from(stack);\n  if (/sentryWrapped/.test(getLastStackFrame(localStack).function || \"\")) {\n    localStack.pop();\n  }\n  localStack.reverse();\n  if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || \"\")) {\n    localStack.pop();\n    if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || \"\")) {\n      localStack.pop();\n    }\n  }\n  return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame) => ({\n    ...frame,\n    filename: frame.filename || getLastStackFrame(localStack).filename,\n    function: frame.function || UNKNOWN_FUNCTION\n  }));\n}\nfunction getLastStackFrame(arr) {\n  return arr[arr.length - 1] || {};\n}\nconst defaultFunctionName = \"<anonymous>\";\nfunction getFunctionName(fn) {\n  try {\n    if (!fn || typeof fn !== \"function\") {\n      return defaultFunctionName;\n    }\n    return fn.name || defaultFunctionName;\n  } catch {\n    return defaultFunctionName;\n  }\n}\nfunction getFramesFromEvent(event) {\n  const exception = event.exception;\n  if (exception) {\n    const frames = [];\n    try {\n      exception.values.forEach((value) => {\n        if (value.stacktrace.frames) {\n          frames.push(...value.stacktrace.frames);\n        }\n      });\n      return frames;\n    } catch {\n      return void 0;\n    }\n  }\n  return void 0;\n}\nfunction normalizeStackTracePath(path) {\n  let filename = path?.startsWith(\"file://\") ? path.slice(7) : path;\n  if (filename?.match(/\\/[A-Z]:/)) {\n    filename = filename.slice(1);\n  }\n  return filename;\n}\n\nexport { UNKNOWN_FUNCTION, createStackParser, getFramesFromEvent, getFunctionName, normalizeStackTracePath, stackParserFromStackParserOptions, stripSentryFramesAndReverse };\n//# sourceMappingURL=stacktrace.js.map\n","const objectToString = Object.prototype.toString;\nfunction isError(wat) {\n  switch (objectToString.call(wat)) {\n    case \"[object Error]\":\n    case \"[object Exception]\":\n    case \"[object DOMException]\":\n    case \"[object WebAssembly.Exception]\":\n      return true;\n    default:\n      return isInstanceOf(wat, Error);\n  }\n}\nfunction isBuiltin(wat, className) {\n  return objectToString.call(wat) === `[object ${className}]`;\n}\nfunction isErrorEvent(wat) {\n  return isBuiltin(wat, \"ErrorEvent\");\n}\nfunction isDOMError(wat) {\n  return isBuiltin(wat, \"DOMError\");\n}\nfunction isDOMException(wat) {\n  return isBuiltin(wat, \"DOMException\");\n}\nfunction isString(wat) {\n  return isBuiltin(wat, \"String\");\n}\nfunction isParameterizedString(wat) {\n  return typeof wat === \"object\" && wat !== null && \"__sentry_template_string__\" in wat && \"__sentry_template_values__\" in wat;\n}\nfunction isPrimitive(wat) {\n  return wat === null || isParameterizedString(wat) || typeof wat !== \"object\" && typeof wat !== \"function\";\n}\nfunction isPlainObject(wat) {\n  return isBuiltin(wat, \"Object\");\n}\nfunction isObjectLike(wat) {\n  return typeof wat === \"object\" && wat !== null;\n}\nfunction isEvent(wat) {\n  return typeof Event !== \"undefined\" && isInstanceOf(wat, Event);\n}\nfunction isElement(wat) {\n  return typeof Element !== \"undefined\" && isInstanceOf(wat, Element);\n}\nfunction isRegExp(wat) {\n  return isBuiltin(wat, \"RegExp\");\n}\nfunction isThenable(wat) {\n  return Boolean(wat?.then && typeof wat.then === \"function\");\n}\nfunction isSyntheticEvent(wat) {\n  return isPlainObject(wat) && \"nativeEvent\" in wat && \"preventDefault\" in wat && \"stopPropagation\" in wat;\n}\nfunction isInstanceOf(wat, base) {\n  try {\n    return wat instanceof base;\n  } catch {\n    return false;\n  }\n}\nfunction isVueViewModel(wat) {\n  return !!(typeof wat === \"object\" && wat !== null && (wat.__isVue || wat._isVue || wat.__v_isVNode));\n}\nfunction isRequest(request) {\n  return typeof Request !== \"undefined\" && isInstanceOf(request, Request);\n}\n\nexport { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isObjectLike, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isRequest, isString, isSyntheticEvent, isThenable, isVueViewModel };\n//# sourceMappingURL=is.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { debug } from './debug-logger.js';\nimport { isError, isEvent, isPrimitive, isObjectLike } from './is.js';\n\nfunction fill(source, name, replacementFactory) {\n  if (!(name in source)) {\n    return;\n  }\n  const original = source[name];\n  if (typeof original !== \"function\") {\n    return;\n  }\n  const wrapped = replacementFactory(original);\n  if (typeof wrapped === \"function\") {\n    markFunctionWrapped(wrapped, original);\n  }\n  try {\n    source[name] = wrapped;\n  } catch {\n    DEBUG_BUILD && debug.log(`Failed to replace method \"${name}\" in object`, source);\n  }\n}\nfunction addNonEnumerableProperty(obj, name, value) {\n  try {\n    Object.defineProperty(obj, name, {\n      // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n      value,\n      writable: true,\n      configurable: true\n    });\n  } catch {\n    DEBUG_BUILD && debug.log(`Failed to add non-enumerable property \"${String(name)}\" to object`, obj);\n  }\n}\nfunction markFunctionWrapped(wrapped, original) {\n  try {\n    const proto = original.prototype || {};\n    wrapped.prototype = original.prototype = proto;\n    addNonEnumerableProperty(wrapped, \"__sentry_original__\", original);\n  } catch {\n  }\n}\nfunction wrapMethod(obj, field, wrapped, enumerable = true) {\n  const original = obj[field];\n  if (typeof original !== \"function\") {\n    throw new Error(`Cannot wrap method: ${field} is not a function`);\n  }\n  if (getOriginalFunction(original)) {\n    throw new Error(`Attempting to wrap method ${field} multiple times`);\n  }\n  markFunctionWrapped(wrapped, original);\n  Object.defineProperty(obj, field, {\n    writable: true,\n    configurable: true,\n    enumerable,\n    value: wrapped\n  });\n}\nfunction getOriginalFunction(func) {\n  return func.__sentry_original__;\n}\nfunction convertToPlainObject(value) {\n  if (isError(value)) {\n    return {\n      message: value.message,\n      name: value.name,\n      stack: value.stack,\n      ...getOwnProperties(value)\n    };\n  }\n  if (isEvent(value)) {\n    const { type, target, currentTarget, detail } = value;\n    return {\n      type,\n      target,\n      currentTarget,\n      ...detail ? { detail } : {},\n      ...getOwnProperties(value)\n    };\n  }\n  return value;\n}\nfunction getOwnProperties(obj) {\n  if (isObjectLike(obj)) {\n    return Object.fromEntries(Object.entries(obj));\n  }\n  return {};\n}\nfunction extractExceptionKeysForMessage(exception) {\n  const keys = Object.keys(convertToPlainObject(exception));\n  keys.sort();\n  return !keys[0] ? \"[object has no keys]\" : keys.join(\", \");\n}\nfunction dropUndefinedKeys(inputValue) {\n  const memoizationMap = /* @__PURE__ */ new Map();\n  return _dropUndefinedKeys(inputValue, memoizationMap);\n}\nfunction _dropUndefinedKeys(inputValue, memoizationMap) {\n  if (inputValue === null || typeof inputValue !== \"object\") {\n    return inputValue;\n  }\n  const memoVal = memoizationMap.get(inputValue);\n  if (memoVal !== void 0) {\n    return memoVal;\n  }\n  if (Array.isArray(inputValue)) {\n    const returnValue = [];\n    memoizationMap.set(inputValue, returnValue);\n    inputValue.forEach((value) => {\n      returnValue.push(_dropUndefinedKeys(value, memoizationMap));\n    });\n    return returnValue;\n  }\n  if (isPojo(inputValue)) {\n    const returnValue = {};\n    memoizationMap.set(inputValue, returnValue);\n    const keys = Object.keys(inputValue);\n    keys.forEach((key) => {\n      const val = inputValue[key];\n      if (val !== void 0) {\n        returnValue[key] = _dropUndefinedKeys(val, memoizationMap);\n      }\n    });\n    return returnValue;\n  }\n  return inputValue;\n}\nfunction isPojo(input) {\n  const constructor = input.constructor;\n  return constructor === Object || constructor === void 0;\n}\nfunction objectify(wat) {\n  let objectified;\n  switch (true) {\n    // this will catch both undefined and null\n    case wat == void 0:\n      objectified = new String(wat);\n      break;\n    // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n    // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n    // an object in order to wrap it.\n    case (typeof wat === \"symbol\" || typeof wat === \"bigint\"):\n      objectified = Object(wat);\n      break;\n    // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n    case isPrimitive(wat):\n      objectified = new wat.constructor(wat);\n      break;\n    // by process of elimination, at this point we know that `wat` must already be an object\n    default:\n      objectified = wat;\n      break;\n  }\n  return objectified;\n}\n\nexport { addNonEnumerableProperty, convertToPlainObject, dropUndefinedKeys, extractExceptionKeysForMessage, fill, getOriginalFunction, markFunctionWrapped, objectify, wrapMethod };\n//# sourceMappingURL=object.js.map\n","import { GLOBAL_OBJ } from './worldwide.js';\n\nlet RESOLVED_RUNNER;\nfunction withRandomSafeContext(cb) {\n  if (RESOLVED_RUNNER !== void 0) {\n    return RESOLVED_RUNNER ? RESOLVED_RUNNER(cb) : cb();\n  }\n  const sym = /* @__PURE__ */ Symbol.for(\"__SENTRY_SAFE_RANDOM_ID_WRAPPER__\");\n  const globalWithSymbol = GLOBAL_OBJ;\n  if (sym in globalWithSymbol && typeof globalWithSymbol[sym] === \"function\") {\n    RESOLVED_RUNNER = globalWithSymbol[sym];\n    return RESOLVED_RUNNER(cb);\n  }\n  RESOLVED_RUNNER = null;\n  return cb();\n}\nfunction safeMathRandom() {\n  return withRandomSafeContext(() => Math.random());\n}\nfunction safeDateNow() {\n  return withRandomSafeContext(() => Date.now());\n}\n\nexport { safeDateNow, safeMathRandom, withRandomSafeContext };\n//# sourceMappingURL=randomSafeContext.js.map\n","import { addNonEnumerableProperty } from './object.js';\n\nconst SENTRY_SKIP_NORMALIZATION = /* @__PURE__ */ Symbol.for(\"sentry.skipNormalization\");\nconst SENTRY_OVERRIDE_NORMALIZATION_DEPTH = /* @__PURE__ */ Symbol.for(\"sentry.overrideNormalizationDepth\");\nfunction setSkipNormalizationHint(obj) {\n  addNonEnumerableProperty(obj, SENTRY_SKIP_NORMALIZATION, true);\n}\nfunction setNormalizationDepthOverrideHint(obj, depth) {\n  addNonEnumerableProperty(obj, SENTRY_OVERRIDE_NORMALIZATION_DEPTH, depth);\n}\nfunction hasSkipNormalizationHint(value) {\n  return Boolean(value[SENTRY_SKIP_NORMALIZATION]);\n}\nfunction getNormalizationDepthOverrideHint(value) {\n  const v = value[SENTRY_OVERRIDE_NORMALIZATION_DEPTH];\n  return typeof v === \"number\" ? v : void 0;\n}\n\nexport { getNormalizationDepthOverrideHint, hasSkipNormalizationHint, setNormalizationDepthOverrideHint, setSkipNormalizationHint };\n//# sourceMappingURL=normalizationHints.js.map\n","import { hasSkipNormalizationHint, getNormalizationDepthOverrideHint } from './normalizationHints.js';\nimport { convertToPlainObject } from './object.js';\nimport { getFunctionName } from './stacktrace.js';\n\nlet stringifier;\nfunction setNormalizeStringifier(newStringifier) {\n  stringifier = newStringifier;\n}\nfunction normalize(input, depth = 100, maxProperties = Infinity) {\n  try {\n    return visit(\"\", input, depth, maxProperties);\n  } catch (err) {\n    return { ERROR: `**non-serializable** (${err})` };\n  }\n}\nfunction normalizeToSize(object, depth = 3, maxSize = 100 * 1024) {\n  const normalized = normalize(object, depth);\n  if (jsonSize(normalized) > maxSize) {\n    return normalizeToSize(object, depth - 1, maxSize);\n  }\n  return normalized;\n}\nfunction visit(key, value, depth = Infinity, maxProperties = Infinity, memo = memoBuilder()) {\n  const [memoize, unmemoize] = memo;\n  if (value == null || // this matches null and undefined -> eqeq not eqeqeq\n  [\"boolean\", \"string\"].includes(typeof value) || typeof value === \"number\" && Number.isFinite(value)) {\n    return value;\n  }\n  const stringified = stringifyValue(key, value);\n  if (!stringified.startsWith(\"[object \")) {\n    return stringified;\n  }\n  if (hasSkipNormalizationHint(value)) {\n    return value;\n  }\n  const overrideDepth = getNormalizationDepthOverrideHint(value);\n  const remainingDepth = overrideDepth !== void 0 ? overrideDepth : depth;\n  if (remainingDepth === 0) {\n    return stringified.replace(\"object \", \"\");\n  }\n  if (memoize(value)) {\n    return \"[Circular ~]\";\n  }\n  const valueWithToJSON = value;\n  if (valueWithToJSON && typeof valueWithToJSON.toJSON === \"function\") {\n    try {\n      const jsonValue = valueWithToJSON.toJSON();\n      return visit(\"\", jsonValue, remainingDepth - 1, maxProperties, memo);\n    } catch {\n    }\n  }\n  const normalized = Array.isArray(value) ? [] : {};\n  let numAdded = 0;\n  const visitable = convertToPlainObject(value);\n  for (const visitKey in visitable) {\n    if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n      continue;\n    }\n    if (numAdded >= maxProperties) {\n      normalized[visitKey] = \"[MaxProperties ~]\";\n      break;\n    }\n    const visitValue = visitable[visitKey];\n    normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);\n    numAdded++;\n  }\n  unmemoize(value);\n  return normalized;\n}\nfunction stringifyValue(key, value) {\n  try {\n    if (stringifier) {\n      const stringified = stringifier(value);\n      if (stringified) {\n        return stringified;\n      }\n    }\n    if (typeof global !== \"undefined\" && value === global) {\n      return \"[Global]\";\n    }\n    if (typeof value === \"number\" && !Number.isFinite(value)) {\n      return `[${value}]`;\n    }\n    if (typeof value === \"function\") {\n      return `[Function: ${getFunctionName(value)}]`;\n    }\n    if (typeof value === \"symbol\") {\n      return `[${String(value)}]`;\n    }\n    if (typeof value === \"bigint\") {\n      return `[BigInt: ${String(value)}]`;\n    }\n    const objName = getConstructorName(value);\n    return `[object ${objName}]`;\n  } catch (err) {\n    return `**non-serializable** (${err})`;\n  }\n}\nfunction getConstructorName(value) {\n  const prototype = Object.getPrototypeOf(value);\n  return prototype?.constructor ? prototype.constructor.name : \"null prototype\";\n}\nfunction utf8Length(value) {\n  return ~-encodeURI(value).split(/%..|./).length;\n}\nfunction jsonSize(value) {\n  return utf8Length(JSON.stringify(value));\n}\nfunction normalizeUrlToBase(url, basePath) {\n  const escapedBase = basePath.replace(/\\\\/g, \"/\").replace(/[|\\\\{}()[\\]^$+*?.]/g, \"\\\\$&\");\n  let newUrl = url;\n  try {\n    newUrl = decodeURI(url);\n  } catch {\n  }\n  return newUrl.replace(/\\\\/g, \"/\").replace(/webpack:\\/?/g, \"\").replace(new RegExp(`(file://)?/*${escapedBase}/*`, \"ig\"), \"app:///\");\n}\nfunction memoBuilder() {\n  const inner = /* @__PURE__ */ new WeakSet();\n  function memoize(obj) {\n    if (inner.has(obj)) {\n      return true;\n    }\n    inner.add(obj);\n    return false;\n  }\n  function unmemoize(obj) {\n    inner.delete(obj);\n  }\n  return [memoize, unmemoize];\n}\n\nexport { normalize, normalizeToSize, normalizeUrlToBase, setNormalizeStringifier, stringifyValue };\n//# sourceMappingURL=normalize.js.map\n","import { isString, isRegExp, isPrimitive } from './is.js';\nimport { stringifyValue } from './normalize.js';\n\nfunction stringify(value, fallback = \"[unserializable]\") {\n  if (typeof value === \"string\") {\n    return value;\n  }\n  try {\n    return JSON.stringify(value);\n  } catch {\n    return typeof fallback === \"function\" ? fallback(value) : fallback;\n  }\n}\nfunction truncate(str, max = 0) {\n  if (typeof str !== \"string\" || max === 0) {\n    return str;\n  }\n  return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\nfunction snipLine(line, colno) {\n  let newLine = line;\n  const lineLength = newLine.length;\n  if (lineLength <= 150) {\n    return newLine;\n  }\n  if (colno > lineLength) {\n    colno = lineLength;\n  }\n  let start = Math.max(colno - 60, 0);\n  if (start < 5) {\n    start = 0;\n  }\n  let end = Math.min(start + 140, lineLength);\n  if (end > lineLength - 5) {\n    end = lineLength;\n  }\n  if (end === lineLength) {\n    start = Math.max(end - 140, 0);\n  }\n  newLine = newLine.slice(start, end);\n  if (start > 0) {\n    newLine = `'{snip} ${newLine}`;\n  }\n  if (end < lineLength) {\n    newLine += \" {snip}\";\n  }\n  return newLine;\n}\nfunction safeJoin(input, delimiter) {\n  if (!Array.isArray(input)) {\n    return \"\";\n  }\n  const output = [];\n  for (let i = 0; i < input.length; i++) {\n    const value = input[i];\n    if (isPrimitive(value)) {\n      output.push(String(value));\n    } else if (value instanceof Error) {\n      output.push(value.message ? `${value.name}: ${value.message}` : value.name);\n    } else {\n      output.push(stringifyValue(void 0, value));\n    }\n  }\n  return output.join(delimiter);\n}\nfunction isMatchingPattern(value, pattern, requireExactStringMatch = false) {\n  if (!isString(value)) {\n    return false;\n  }\n  if (isRegExp(pattern)) {\n    return pattern.test(value);\n  }\n  if (isString(pattern)) {\n    return requireExactStringMatch ? value === pattern : value.includes(pattern);\n  }\n  if (typeof pattern === \"function\") {\n    return pattern(value);\n  }\n  return false;\n}\nfunction stringMatchesSomePattern(testString, patterns = [], requireExactStringMatch = false) {\n  for (const pattern of patterns) {\n    if (isMatchingPattern(testString, pattern, requireExactStringMatch)) {\n      return true;\n    }\n  }\n  return false;\n}\n\nexport { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, stringify, truncate };\n//# sourceMappingURL=string.js.map\n","import { addNonEnumerableProperty } from './object.js';\nimport { withRandomSafeContext, safeMathRandom } from './randomSafeContext.js';\nimport { snipLine } from './string.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nfunction getCrypto() {\n  const gbl = GLOBAL_OBJ;\n  return gbl.crypto || gbl.msCrypto;\n}\nlet emptyUuid;\nfunction getRandomByte() {\n  return safeMathRandom() * 16;\n}\nfunction uuid4(crypto = getCrypto()) {\n  try {\n    if (crypto?.randomUUID) {\n      return withRandomSafeContext(() => crypto.randomUUID()).replace(/-/g, \"\");\n    }\n  } catch {\n  }\n  if (!emptyUuid) {\n    emptyUuid = \"10000000100040008000\" + 1e11;\n  }\n  return emptyUuid.replace(\n    /[018]/g,\n    (c) => (\n      // eslint-disable-next-line no-bitwise\n      (c ^ (getRandomByte() & 15) >> c / 4).toString(16)\n    )\n  );\n}\nfunction getFirstException(event) {\n  return event.exception?.values?.[0];\n}\nfunction getEventDescription(event) {\n  const { message, event_id: eventId } = event;\n  if (message) {\n    return message;\n  }\n  const firstException = getFirstException(event);\n  if (firstException) {\n    if (firstException.type && firstException.value) {\n      return `${firstException.type}: ${firstException.value}`;\n    }\n    return firstException.type || firstException.value || eventId || \"<unknown>\";\n  }\n  return eventId || \"<unknown>\";\n}\nfunction addExceptionTypeValue(event, value, type) {\n  const exception = event.exception = event.exception || {};\n  const values = exception.values = exception.values || [];\n  const firstException = values[0] = values[0] || {};\n  if (!firstException.value) {\n    firstException.value = value || \"\";\n  }\n  if (!firstException.type) {\n    firstException.type = type || \"Error\";\n  }\n}\nfunction addExceptionMechanism(event, newMechanism) {\n  const firstException = getFirstException(event);\n  if (!firstException) {\n    return;\n  }\n  const defaultMechanism = { type: \"generic\", handled: true };\n  const currentMechanism = firstException.mechanism;\n  firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n  if (newMechanism && \"data\" in newMechanism) {\n    const mergedData = { ...currentMechanism?.data, ...newMechanism.data };\n    firstException.mechanism.data = mergedData;\n  }\n}\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-]+)*))?$/;\nfunction _parseInt(input) {\n  return parseInt(input || \"\", 10);\n}\nfunction parseSemver(input) {\n  const match = input.match(SEMVER_REGEXP) || [];\n  const major = _parseInt(match[1]);\n  const minor = _parseInt(match[2]);\n  const patch = _parseInt(match[3]);\n  return {\n    buildmetadata: match[5],\n    major: isNaN(major) ? void 0 : major,\n    minor: isNaN(minor) ? void 0 : minor,\n    patch: isNaN(patch) ? void 0 : patch,\n    prerelease: match[4]\n  };\n}\nfunction addContextToFrame(lines, frame, linesOfContext = 5) {\n  if (frame.lineno === void 0) {\n    return;\n  }\n  const maxLines = lines.length;\n  const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n  frame.pre_context = lines.slice(Math.max(0, sourceLine - linesOfContext), sourceLine).map((line) => snipLine(line, 0));\n  const lineIndex = Math.min(maxLines - 1, sourceLine);\n  frame.context_line = snipLine(lines[lineIndex], frame.colno || 0);\n  frame.post_context = lines.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext).map((line) => snipLine(line, 0));\n}\nfunction checkOrSetAlreadyCaught(exception) {\n  if (isAlreadyCaptured(exception)) {\n    return true;\n  }\n  try {\n    addNonEnumerableProperty(exception, \"__sentry_captured__\", true);\n  } catch {\n  }\n  return false;\n}\nfunction isAlreadyCaptured(exception) {\n  try {\n    return exception.__sentry_captured__;\n  } catch {\n  }\n}\n\nexport { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, checkOrSetAlreadyCaught, getEventDescription, isAlreadyCaptured, parseSemver, uuid4 };\n//# sourceMappingURL=misc.js.map\n","import { safeDateNow, withRandomSafeContext } from './randomSafeContext.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nconst ONE_SECOND_IN_MS = 1e3;\nfunction dateTimestampInSeconds() {\n  return safeDateNow() / ONE_SECOND_IN_MS;\n}\nfunction createUnixTimestampInSecondsFunc() {\n  const { performance } = GLOBAL_OBJ;\n  if (!performance?.now || !performance.timeOrigin) {\n    return dateTimestampInSeconds;\n  }\n  const timeOrigin = performance.timeOrigin;\n  return () => {\n    return (timeOrigin + withRandomSafeContext(() => performance.now())) / ONE_SECOND_IN_MS;\n  };\n}\nlet _cachedTimestampInSeconds;\nfunction timestampInSeconds() {\n  const func = _cachedTimestampInSeconds ?? (_cachedTimestampInSeconds = createUnixTimestampInSecondsFunc());\n  return func();\n}\nlet cachedTimeOrigin = null;\nfunction getBrowserTimeOrigin() {\n  const { performance } = GLOBAL_OBJ;\n  if (!performance?.now) {\n    return void 0;\n  }\n  const threshold = 3e5;\n  const performanceNow = withRandomSafeContext(() => performance.now());\n  const dateNow = safeDateNow();\n  const timeOrigin = performance.timeOrigin;\n  if (typeof timeOrigin === \"number\") {\n    const timeOriginDelta = Math.abs(timeOrigin + performanceNow - dateNow);\n    if (timeOriginDelta < threshold) {\n      return timeOrigin;\n    }\n  }\n  const navigationStart = performance.timing?.navigationStart;\n  if (typeof navigationStart === \"number\") {\n    const navigationStartDelta = Math.abs(navigationStart + performanceNow - dateNow);\n    if (navigationStartDelta < threshold) {\n      return navigationStart;\n    }\n  }\n  return dateNow - performanceNow;\n}\nfunction browserPerformanceTimeOrigin() {\n  if (cachedTimeOrigin === null) {\n    cachedTimeOrigin = getBrowserTimeOrigin();\n  }\n  return cachedTimeOrigin;\n}\n\nexport { browserPerformanceTimeOrigin, dateTimestampInSeconds, timestampInSeconds };\n//# sourceMappingURL=time.js.map\n","import { uuid4 } from './utils/misc.js';\nimport { timestampInSeconds } from './utils/time.js';\n\nfunction makeSession(context) {\n  const startingTime = timestampInSeconds();\n  const session = {\n    sid: uuid4(),\n    init: true,\n    timestamp: startingTime,\n    started: startingTime,\n    duration: 0,\n    status: \"ok\",\n    errors: 0,\n    ignoreDuration: false,\n    toJSON: () => sessionToJSON(session)\n  };\n  if (context) {\n    updateSession(session, context);\n  }\n  return session;\n}\nfunction updateSession(session, context = {}) {\n  if (context.user) {\n    if (!session.ipAddress && context.user.ip_address) {\n      session.ipAddress = context.user.ip_address;\n    }\n    if (!session.did && !context.did) {\n      session.did = context.user.id || context.user.email || context.user.username;\n    }\n  }\n  session.timestamp = context.timestamp || timestampInSeconds();\n  if (context.abnormal_mechanism) {\n    session.abnormal_mechanism = context.abnormal_mechanism;\n  }\n  if (context.ignoreDuration) {\n    session.ignoreDuration = context.ignoreDuration;\n  }\n  if (context.sid) {\n    session.sid = context.sid.length === 32 ? context.sid : uuid4();\n  }\n  if (context.init !== void 0) {\n    session.init = context.init;\n  }\n  if (!session.did && context.did) {\n    session.did = `${context.did}`;\n  }\n  if (typeof context.started === \"number\") {\n    session.started = context.started;\n  }\n  if (session.ignoreDuration) {\n    session.duration = void 0;\n  } else if (typeof context.duration === \"number\") {\n    session.duration = context.duration;\n  } else {\n    const duration = session.timestamp - session.started;\n    session.duration = duration >= 0 ? duration : 0;\n  }\n  if (context.release) {\n    session.release = context.release;\n  }\n  if (context.environment) {\n    session.environment = context.environment;\n  }\n  if (!session.ipAddress && context.ipAddress) {\n    session.ipAddress = context.ipAddress;\n  }\n  if (!session.userAgent && context.userAgent) {\n    session.userAgent = context.userAgent;\n  }\n  if (typeof context.errors === \"number\") {\n    session.errors = context.errors;\n  }\n  if (context.status) {\n    session.status = context.status;\n  }\n}\nfunction closeSession(session, status) {\n  let context = {};\n  if (status) {\n    context = { status };\n  } else if (session.status === \"ok\") {\n    context = { status: \"exited\" };\n  }\n  updateSession(session, context);\n}\nfunction sessionToJSON(session) {\n  return {\n    sid: `${session.sid}`,\n    init: session.init,\n    // Make sure that sec is converted to ms for date constructor\n    started: new Date(session.started * 1e3).toISOString(),\n    timestamp: new Date(session.timestamp * 1e3).toISOString(),\n    status: session.status,\n    errors: session.errors,\n    did: typeof session.did === \"number\" || typeof session.did === \"string\" ? `${session.did}` : void 0,\n    duration: session.duration,\n    abnormal_mechanism: session.abnormal_mechanism,\n    attrs: {\n      release: session.release,\n      environment: session.environment,\n      ip_address: session.ipAddress,\n      user_agent: session.userAgent\n    }\n  };\n}\n\nexport { closeSession, makeSession, updateSession };\n//# sourceMappingURL=session.js.map\n","function merge(initialObj, mergeObj, levels = 2) {\n  if (!mergeObj || typeof mergeObj !== \"object\" || levels <= 0) {\n    return mergeObj;\n  }\n  if (initialObj && Object.keys(mergeObj).length === 0) {\n    return initialObj;\n  }\n  const output = { ...initialObj };\n  for (const key in mergeObj) {\n    if (Object.prototype.hasOwnProperty.call(mergeObj, key)) {\n      output[key] = merge(output[key], mergeObj[key], levels - 1);\n    }\n  }\n  return output;\n}\n\nexport { merge };\n//# sourceMappingURL=merge.js.map\n","import { uuid4 } from './misc.js';\n\nfunction generateTraceId() {\n  return uuid4();\n}\nfunction generateSpanId() {\n  return uuid4().substring(16);\n}\n\nexport { generateSpanId, generateTraceId };\n//# sourceMappingURL=propagationContext.js.map\n","import { GLOBAL_OBJ } from './worldwide.js';\n\nfunction makeWeakRef(value) {\n  try {\n    const WeakRefImpl = GLOBAL_OBJ.WeakRef;\n    if (typeof WeakRefImpl === \"function\") {\n      return new WeakRefImpl(value);\n    }\n  } catch {\n  }\n  return value;\n}\nfunction derefWeakRef(ref) {\n  if (!ref) {\n    return void 0;\n  }\n  if (typeof ref === \"object\" && \"deref\" in ref && typeof ref.deref === \"function\") {\n    try {\n      return ref.deref();\n    } catch {\n      return void 0;\n    }\n  }\n  return ref;\n}\n\nexport { derefWeakRef, makeWeakRef };\n//# sourceMappingURL=weakRef.js.map\n","import { addNonEnumerableProperty } from './object.js';\nimport { makeWeakRef, derefWeakRef } from './weakRef.js';\n\nconst SCOPE_SPAN_FIELD = \"_sentrySpan\";\nfunction _setSpanForScope(scope, span) {\n  if (span) {\n    addNonEnumerableProperty(scope, SCOPE_SPAN_FIELD, makeWeakRef(span));\n  } else {\n    delete scope[SCOPE_SPAN_FIELD];\n  }\n}\nfunction _getSpanForScope(scope) {\n  return derefWeakRef(scope[SCOPE_SPAN_FIELD]);\n}\n\nexport { _getSpanForScope, _setSpanForScope };\n//# sourceMappingURL=spanOnScope.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { updateSession } from './session.js';\nimport { debug } from './utils/debug-logger.js';\nimport { isPlainObject } from './utils/is.js';\nimport { merge } from './utils/merge.js';\nimport { uuid4 } from './utils/misc.js';\nimport { generateTraceId } from './utils/propagationContext.js';\nimport { safeMathRandom } from './utils/randomSafeContext.js';\nimport { _setSpanForScope, _getSpanForScope } from './utils/spanOnScope.js';\nimport { truncate } from './utils/string.js';\nimport { dateTimestampInSeconds } from './utils/time.js';\n\nconst DEFAULT_MAX_BREADCRUMBS = 100;\nclass Scope {\n  // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n  constructor() {\n    this._notifyingListeners = false;\n    this._scopeListeners = [];\n    this._eventProcessors = [];\n    this._breadcrumbs = [];\n    this._attachments = [];\n    this._user = {};\n    this._tags = {};\n    this._attributes = {};\n    this._extra = {};\n    this._contexts = {};\n    this._sdkProcessingMetadata = {};\n    this._propagationContext = {\n      traceId: generateTraceId(),\n      sampleRand: safeMathRandom()\n    };\n  }\n  /**\n   * Clone all data from this scope into a new scope.\n   */\n  clone() {\n    const newScope = new Scope();\n    newScope._breadcrumbs = [...this._breadcrumbs];\n    newScope._tags = { ...this._tags };\n    newScope._attributes = { ...this._attributes };\n    newScope._extra = { ...this._extra };\n    newScope._contexts = { ...this._contexts };\n    if (this._contexts.flags) {\n      newScope._contexts.flags = {\n        values: [...this._contexts.flags.values]\n      };\n    }\n    newScope._user = this._user;\n    newScope._level = this._level;\n    newScope._session = this._session;\n    newScope._transactionName = this._transactionName;\n    newScope._fingerprint = this._fingerprint;\n    newScope._eventProcessors = [...this._eventProcessors];\n    newScope._attachments = [...this._attachments];\n    newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };\n    newScope._propagationContext = { ...this._propagationContext };\n    newScope._client = this._client;\n    newScope._lastEventId = this._lastEventId;\n    newScope._conversationId = this._conversationId;\n    _setSpanForScope(newScope, _getSpanForScope(this));\n    return newScope;\n  }\n  /**\n   * Update the client assigned to this scope.\n   * Note that not every scope will have a client assigned - isolation scopes & the global scope will generally not have a client,\n   * as well as manually created scopes.\n   */\n  setClient(client) {\n    this._client = client;\n  }\n  /**\n   * Set the ID of the last captured error event.\n   * This is generally only captured on the isolation scope.\n   */\n  setLastEventId(lastEventId) {\n    this._lastEventId = lastEventId;\n  }\n  /**\n   * Get the client assigned to this scope.\n   */\n  getClient() {\n    return this._client;\n  }\n  /**\n   * Get the ID of the last captured error event.\n   * This is generally only available on the isolation scope.\n   */\n  lastEventId() {\n    return this._lastEventId;\n  }\n  /**\n   * @inheritDoc\n   */\n  addScopeListener(callback) {\n    this._scopeListeners.push(callback);\n  }\n  /**\n   * Add an event processor that will be called before an event is sent.\n   */\n  addEventProcessor(callback) {\n    this._eventProcessors.push(callback);\n    return this;\n  }\n  /**\n   * Set the user for this scope.\n   * Set to `null` to unset the user.\n   */\n  setUser(user) {\n    this._user = user || {\n      email: void 0,\n      id: void 0,\n      ip_address: void 0,\n      username: void 0\n    };\n    if (this._session) {\n      updateSession(this._session, { user });\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Get the user from this scope.\n   */\n  getUser() {\n    return this._user;\n  }\n  /**\n   * Set the conversation ID for this scope.\n   * Set to `null` to unset the conversation ID.\n   */\n  setConversationId(conversationId) {\n    this._conversationId = conversationId || void 0;\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Set an object that will be merged into existing tags on the scope,\n   * and will be sent as tags data with the event.\n   */\n  setTags(tags) {\n    this._tags = {\n      ...this._tags,\n      ...tags\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Set a single tag that will be sent as tags data with the event.\n   */\n  setTag(key, value) {\n    return this.setTags({ [key]: value });\n  }\n  /**\n   * Sets attributes onto the scope.\n   *\n   * These attributes are applied to logs, metrics and streamed spans.\n   *\n   * Supported attribute value types are `string`, `number`, `boolean`, `string[]`, `number[]` and `boolean[]`.\n   *\n   * @param newAttributes - The attributes to set on the scope, as key-value pairs.\n   *\n   * @example\n   * ```typescript\n   * scope.setAttributes({\n   *   is_admin: true,\n   *   payment_selection: 'credit_card',\n   *   render_duration: 150,\n   * });\n   * ```\n   */\n  setAttributes(newAttributes) {\n    this._attributes = {\n      ...this._attributes,\n      ...newAttributes\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Sets an attribute onto the scope.\n   *\n   * These attributes are applied to logs, metrics and streamed spans.\n   *\n   * Supported attribute value types are `string`, `number`, `boolean`, `string[]`, `number[]` and `boolean[]`.\n   *\n   * @param key - The attribute key.\n   * @param value - The attribute value.\n   *\n   * @example\n   * ```typescript\n   * scope.setAttribute('is_admin', true);\n   * scope.setAttribute('render_duration', 150);\n   * ```\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  setAttribute(key, value) {\n    return this.setAttributes({ [key]: value });\n  }\n  /**\n   * Removes the attribute with the given key from the scope.\n   *\n   * @param key - The attribute key.\n   *\n   * @example\n   * ```typescript\n   * scope.removeAttribute('is_admin');\n   * ```\n   */\n  removeAttribute(key) {\n    if (key in this._attributes) {\n      delete this._attributes[key];\n      this._notifyScopeListeners();\n    }\n    return this;\n  }\n  /**\n   * Set an object that will be merged into existing extra on the scope,\n   * and will be sent as extra data with the event.\n   */\n  setExtras(extras) {\n    this._extra = {\n      ...this._extra,\n      ...extras\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Set a single key:value extra entry that will be sent as extra data with the event.\n   */\n  setExtra(key, extra) {\n    this._extra = { ...this._extra, [key]: extra };\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Sets the fingerprint on the scope to send with the events.\n   * @param {string[]} fingerprint Fingerprint to group events in Sentry.\n   */\n  setFingerprint(fingerprint) {\n    this._fingerprint = fingerprint;\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Sets the level on the scope for future events.\n   */\n  setLevel(level) {\n    this._level = level;\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Sets the transaction name on the scope so that the name of e.g. taken server route or\n   * the page location is attached to future events.\n   *\n   * IMPORTANT: Calling this function does NOT change the name of the currently active\n   * root span. If you want to change the name of the active root span, use\n   * `Sentry.updateSpanName(rootSpan, 'new name')` instead.\n   *\n   * By default, the SDK updates the scope's transaction name automatically on sensible\n   * occasions, such as a page navigation or when handling a new request on the server.\n   */\n  setTransactionName(name) {\n    this._transactionName = name;\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Sets context data with the given name.\n   * Data passed as context will be normalized. You can also pass `null` to unset the context.\n   * Note that context data will not be merged - calling `setContext` will overwrite an existing context with the same key.\n   */\n  setContext(key, context) {\n    if (context === null) {\n      delete this._contexts[key];\n    } else {\n      this._contexts[key] = context;\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Set the session for the scope.\n   */\n  setSession(session) {\n    if (!session) {\n      delete this._session;\n    } else {\n      this._session = session;\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Get the session from the scope.\n   */\n  getSession() {\n    return this._session;\n  }\n  /**\n   * Updates the scope with provided data. Can work in three variations:\n   * - plain object containing updatable attributes\n   * - Scope instance that'll extract the attributes from\n   * - callback function that'll receive the current scope as an argument and allow for modifications\n   */\n  update(captureContext) {\n    if (!captureContext) {\n      return this;\n    }\n    const scopeToMerge = typeof captureContext === \"function\" ? captureContext(this) : captureContext;\n    const scopeInstance = scopeToMerge instanceof Scope ? scopeToMerge.getScopeData() : isPlainObject(scopeToMerge) ? captureContext : void 0;\n    const {\n      tags,\n      attributes,\n      extra,\n      user,\n      contexts,\n      level,\n      fingerprint = [],\n      propagationContext,\n      conversationId\n    } = scopeInstance || {};\n    this._tags = { ...this._tags, ...tags };\n    this._attributes = { ...this._attributes, ...attributes };\n    this._extra = { ...this._extra, ...extra };\n    this._contexts = { ...this._contexts, ...contexts };\n    if (user && Object.keys(user).length) {\n      this._user = user;\n    }\n    if (level) {\n      this._level = level;\n    }\n    if (fingerprint.length) {\n      this._fingerprint = fingerprint;\n    }\n    if (propagationContext) {\n      this._propagationContext = propagationContext;\n    }\n    if (conversationId) {\n      this._conversationId = conversationId;\n    }\n    return this;\n  }\n  /**\n   * Clears the current scope and resets its properties.\n   * Note: The client will not be cleared.\n   *\n   * @deprecated This method will be removed in v11. To reset scope state, re-initialize the SDK or run\n   * your code in a fresh scope via `withScope` instead.\n   */\n  clear() {\n    this._breadcrumbs = [];\n    this._tags = {};\n    this._attributes = {};\n    this._extra = {};\n    this._user = {};\n    this._contexts = {};\n    this._level = void 0;\n    this._transactionName = void 0;\n    this._fingerprint = void 0;\n    this._session = void 0;\n    this._conversationId = void 0;\n    _setSpanForScope(this, void 0);\n    this._attachments = [];\n    this.setPropagationContext({\n      traceId: generateTraceId(),\n      sampleRand: safeMathRandom()\n    });\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Adds a breadcrumb to the scope.\n   * By default, the last 100 breadcrumbs are kept.\n   */\n  addBreadcrumb(breadcrumb, maxBreadcrumbs) {\n    const maxCrumbs = typeof maxBreadcrumbs === \"number\" ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n    if (maxCrumbs <= 0) {\n      return this;\n    }\n    const mergedBreadcrumb = {\n      timestamp: dateTimestampInSeconds(),\n      ...breadcrumb,\n      // Breadcrumb messages can theoretically be infinitely large and they're held in memory so we truncate them not to leak (too much) memory\n      message: breadcrumb.message ? truncate(breadcrumb.message, 2048) : breadcrumb.message\n    };\n    this._breadcrumbs.push(mergedBreadcrumb);\n    if (this._breadcrumbs.length > maxCrumbs) {\n      this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs);\n      this._client?.recordDroppedEvent(\"buffer_overflow\", \"log_item\");\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Get the last breadcrumb of the scope.\n   */\n  getLastBreadcrumb() {\n    return this._breadcrumbs[this._breadcrumbs.length - 1];\n  }\n  /**\n   * Clear all breadcrumbs from the scope.\n   */\n  clearBreadcrumbs() {\n    this._breadcrumbs = [];\n    this._notifyScopeListeners();\n    return this;\n  }\n  /**\n   * Add an attachment to the scope.\n   */\n  addAttachment(attachment) {\n    this._attachments.push(attachment);\n    return this;\n  }\n  /**\n   * Clear all attachments from the scope.\n   */\n  clearAttachments() {\n    this._attachments = [];\n    return this;\n  }\n  /**\n   * Get the data of this scope, which should be applied to an event during processing.\n   */\n  getScopeData() {\n    return {\n      breadcrumbs: this._breadcrumbs,\n      attachments: this._attachments,\n      contexts: this._contexts,\n      tags: this._tags,\n      attributes: this._attributes,\n      extra: this._extra,\n      user: this._user,\n      level: this._level,\n      fingerprint: this._fingerprint || [],\n      eventProcessors: this._eventProcessors,\n      propagationContext: this._propagationContext,\n      sdkProcessingMetadata: this._sdkProcessingMetadata,\n      transactionName: this._transactionName,\n      span: _getSpanForScope(this),\n      conversationId: this._conversationId\n    };\n  }\n  /**\n   * Add data which will be accessible during event processing but won't get sent to Sentry.\n   */\n  setSDKProcessingMetadata(newData) {\n    this._sdkProcessingMetadata = merge(this._sdkProcessingMetadata, newData, 2);\n    return this;\n  }\n  /**\n   * Add propagation context to the scope, used for distributed tracing\n   */\n  setPropagationContext(context) {\n    this._propagationContext = context;\n    return this;\n  }\n  /**\n   * Get propagation context from the scope, used for distributed tracing\n   */\n  getPropagationContext() {\n    return this._propagationContext;\n  }\n  /**\n   * Capture an exception for this scope.\n   *\n   * @returns {string} The id of the captured Sentry event.\n   */\n  captureException(exception, hint) {\n    const eventId = hint?.event_id || uuid4();\n    if (!this._client) {\n      DEBUG_BUILD && debug.warn(\"No client configured on scope - will not capture exception!\");\n      return eventId;\n    }\n    const syntheticException = new Error(\"Sentry syntheticException\");\n    this._client.captureException(\n      exception,\n      {\n        originalException: exception,\n        syntheticException,\n        ...hint,\n        event_id: eventId\n      },\n      this\n    );\n    return eventId;\n  }\n  /**\n   * Capture a message for this scope.\n   *\n   * @returns {string} The id of the captured message.\n   */\n  captureMessage(message, level, hint) {\n    const eventId = hint?.event_id || uuid4();\n    if (!this._client) {\n      DEBUG_BUILD && debug.warn(\"No client configured on scope - will not capture message!\");\n      return eventId;\n    }\n    const syntheticException = hint?.syntheticException ?? new Error(message);\n    this._client.captureMessage(\n      message,\n      level,\n      {\n        originalException: message,\n        syntheticException,\n        ...hint,\n        event_id: eventId\n      },\n      this\n    );\n    return eventId;\n  }\n  /**\n   * Capture a Sentry event for this scope.\n   *\n   * @returns {string} The id of the captured event.\n   */\n  captureEvent(event, hint) {\n    const eventId = event.event_id || hint?.event_id || uuid4();\n    if (!this._client) {\n      DEBUG_BUILD && debug.warn(\"No client configured on scope - will not capture event!\");\n      return eventId;\n    }\n    this._client.captureEvent(event, { ...hint, event_id: eventId }, this);\n    return eventId;\n  }\n  /**\n   * This will be called on every set call.\n   */\n  _notifyScopeListeners() {\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\nexport { Scope };\n//# sourceMappingURL=scope.js.map\n","import { getGlobalSingleton } from './carrier.js';\nimport { Scope } from './scope.js';\n\nfunction getDefaultCurrentScope() {\n  return getGlobalSingleton(\"defaultCurrentScope\", () => new Scope());\n}\nfunction getDefaultIsolationScope() {\n  return getGlobalSingleton(\"defaultIsolationScope\", () => new Scope());\n}\n\nexport { getDefaultCurrentScope, getDefaultIsolationScope };\n//# sourceMappingURL=defaultScopes.js.map\n","const isActualPromise = (p) => p instanceof Promise && !p[kChainedCopy];\nconst kChainedCopy = /* @__PURE__ */ Symbol(\"chained PromiseLike\");\nconst chainAndCopyPromiseLike = (original, onSuccess, onError) => {\n  const chained = original.then(\n    (value) => {\n      onSuccess(value);\n      return value;\n    },\n    (err) => {\n      onError(err);\n      throw err;\n    }\n  );\n  return isActualPromise(chained) && isActualPromise(original) ? chained : copyProps(original, chained);\n};\nconst copyProps = (original, chained) => {\n  if (!chained) return original;\n  let mutated = false;\n  for (const key in original) {\n    if (key in chained) continue;\n    mutated = true;\n    const value = original[key];\n    if (typeof value === \"function\") {\n      Object.defineProperty(chained, key, {\n        value: (...args) => value.apply(original, args),\n        enumerable: true,\n        configurable: true,\n        writable: true\n      });\n    } else {\n      chained[key] = value;\n    }\n  }\n  if (mutated) Object.assign(chained, { [kChainedCopy]: true });\n  return chained;\n};\n\nexport { chainAndCopyPromiseLike };\n//# sourceMappingURL=chain-and-copy-promiselike.js.map\n","import { getDefaultCurrentScope, getDefaultIsolationScope } from '../defaultScopes.js';\nimport { Scope } from '../scope.js';\nimport { chainAndCopyPromiseLike } from '../utils/chain-and-copy-promiselike.js';\nimport { isThenable } from '../utils/is.js';\nimport { getMainCarrier, getSentryCarrier } from '../carrier.js';\n\nclass AsyncContextStack {\n  constructor(scope, isolationScope) {\n    let assignedScope;\n    if (!scope) {\n      assignedScope = new Scope();\n    } else {\n      assignedScope = scope;\n    }\n    let assignedIsolationScope;\n    if (!isolationScope) {\n      assignedIsolationScope = new Scope();\n    } else {\n      assignedIsolationScope = isolationScope;\n    }\n    this._stack = [{ scope: assignedScope }];\n    this._isolationScope = assignedIsolationScope;\n  }\n  /**\n   * Fork a scope for the stack.\n   */\n  withScope(callback) {\n    const scope = this._pushScope();\n    let maybePromiseResult;\n    try {\n      maybePromiseResult = callback(scope);\n    } catch (e) {\n      this._popScope();\n      throw e;\n    }\n    if (isThenable(maybePromiseResult)) {\n      return chainAndCopyPromiseLike(\n        maybePromiseResult,\n        () => this._popScope(),\n        () => this._popScope()\n      );\n    }\n    this._popScope();\n    return maybePromiseResult;\n  }\n  /**\n   * Get the client of the stack.\n   */\n  getClient() {\n    return this.getStackTop().client;\n  }\n  /**\n   * Returns the scope of the top stack.\n   */\n  getScope() {\n    return this.getStackTop().scope;\n  }\n  /**\n   * Get the isolation scope for the stack.\n   */\n  getIsolationScope() {\n    return this._isolationScope;\n  }\n  /**\n   * Returns the topmost scope layer in the order domain > local > process.\n   */\n  getStackTop() {\n    return this._stack[this._stack.length - 1];\n  }\n  /**\n   * Push a scope to the stack.\n   */\n  _pushScope() {\n    const scope = this.getScope().clone();\n    this._stack.push({\n      client: this.getClient(),\n      scope\n    });\n    return scope;\n  }\n  /**\n   * Pop a scope from the stack.\n   */\n  _popScope() {\n    if (this._stack.length <= 1) return false;\n    return !!this._stack.pop();\n  }\n}\nfunction getAsyncContextStack() {\n  const registry = getMainCarrier();\n  const sentry = getSentryCarrier(registry);\n  return sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope());\n}\nfunction withScope(callback) {\n  return getAsyncContextStack().withScope(callback);\n}\nfunction withSetScope(scope, callback) {\n  const stack = getAsyncContextStack();\n  return stack.withScope(() => {\n    stack.getStackTop().scope = scope;\n    return callback(scope);\n  });\n}\nfunction withIsolationScope(callback) {\n  return getAsyncContextStack().withScope(() => {\n    return callback(getAsyncContextStack().getIsolationScope());\n  });\n}\nfunction getStackAsyncContextStrategy() {\n  return {\n    withIsolationScope,\n    withScope,\n    withSetScope,\n    withSetIsolationScope: (_isolationScope, callback) => {\n      return withIsolationScope(callback);\n    },\n    getCurrentScope: () => getAsyncContextStack().getScope(),\n    getIsolationScope: () => getAsyncContextStack().getIsolationScope()\n  };\n}\n\nexport { AsyncContextStack, getStackAsyncContextStrategy };\n//# sourceMappingURL=stackStrategy.js.map\n","import { getSentryCarrier, getMainCarrier } from '../carrier.js';\nimport { getStackAsyncContextStrategy } from './stackStrategy.js';\n\nfunction setAsyncContextStrategy(strategy) {\n  const registry = getMainCarrier();\n  const sentry = getSentryCarrier(registry);\n  sentry.acs = strategy;\n}\nfunction getAsyncContextStrategy(carrier) {\n  const sentry = getSentryCarrier(carrier);\n  if (sentry.acs) {\n    return sentry.acs;\n  }\n  return getStackAsyncContextStrategy();\n}\n\nexport { getAsyncContextStrategy, setAsyncContextStrategy };\n//# sourceMappingURL=index.js.map\n","import { isPrimitive } from './utils/is.js';\n\nfunction isAttributeObject(maybeObj) {\n  return typeof maybeObj === \"object\" && maybeObj != null && !Array.isArray(maybeObj) && Object.keys(maybeObj).includes(\"value\");\n}\nfunction attributeValueToTypedAttributeValue(rawValue, useFallback) {\n  const { value, unit } = isAttributeObject(rawValue) ? rawValue : { value: rawValue, unit: void 0 };\n  const attributeValue = getTypedAttributeValue(value);\n  const checkedUnit = unit && typeof unit === \"string\" ? { unit } : {};\n  if (attributeValue) {\n    return { ...attributeValue, ...checkedUnit };\n  }\n  if (!useFallback || useFallback === \"skip-undefined\" && value === void 0) {\n    return;\n  }\n  let stringValue = \"\";\n  try {\n    stringValue = JSON.stringify(value) ?? \"\";\n  } catch {\n  }\n  return {\n    value: stringValue,\n    type: \"string\",\n    ...checkedUnit\n  };\n}\nfunction serializeAttributes(attributes, fallback = false) {\n  const serializedAttributes = {};\n  for (const [key, value] of Object.entries(attributes ?? {})) {\n    const typedValue = attributeValueToTypedAttributeValue(value, fallback);\n    if (typedValue) {\n      serializedAttributes[key] = typedValue;\n    }\n  }\n  return serializedAttributes;\n}\nfunction estimateTypedAttributesSizeInBytes(attributes) {\n  if (!attributes) {\n    return 0;\n  }\n  let weight = 0;\n  for (const [key, attr] of Object.entries(attributes)) {\n    weight += key.length * 2;\n    weight += attr.type.length * 2;\n    weight += (attr.unit?.length ?? 0) * 2;\n    const val = attr.value;\n    if (Array.isArray(val)) {\n      weight += estimatePrimitiveSizeInBytes(val[0]) * val.length;\n    } else if (isPrimitive(val)) {\n      weight += estimatePrimitiveSizeInBytes(val);\n    } else {\n      weight += 100;\n    }\n  }\n  return weight;\n}\nfunction estimatePrimitiveSizeInBytes(value) {\n  if (typeof value === \"string\") {\n    return value.length * 2;\n  } else if (typeof value === \"boolean\") {\n    return 4;\n  } else if (typeof value === \"number\") {\n    return 8;\n  }\n  return 0;\n}\nfunction getTypedAttributeValue(value) {\n  if (Array.isArray(value)) {\n    return { value, type: \"array\" };\n  }\n  const primitiveType = typeof value === \"string\" ? \"string\" : typeof value === \"boolean\" ? \"boolean\" : typeof value === \"number\" && !Number.isNaN(value) ? Number.isInteger(value) ? \"integer\" : \"double\" : null;\n  if (primitiveType) {\n    return { value, type: primitiveType };\n  }\n}\n\nexport { attributeValueToTypedAttributeValue, estimateTypedAttributesSizeInBytes, isAttributeObject, serializeAttributes };\n//# sourceMappingURL=attributes.js.map\n","import { getAsyncContextStrategy } from './asyncContext/index.js';\nimport { getMainCarrier, getGlobalSingleton } from './carrier.js';\nimport { Scope } from './scope.js';\nimport { generateSpanId } from './utils/propagationContext.js';\n\nlet _externalPropagationContextProvider;\nfunction registerExternalPropagationContext(fn) {\n  _externalPropagationContextProvider = fn;\n}\nfunction getExternalPropagationContext() {\n  return _externalPropagationContextProvider?.();\n}\nfunction hasExternalPropagationContext() {\n  return _externalPropagationContextProvider !== void 0;\n}\nfunction getCurrentScope() {\n  const carrier = getMainCarrier();\n  const acs = getAsyncContextStrategy(carrier);\n  return acs.getCurrentScope();\n}\nfunction getIsolationScope() {\n  const carrier = getMainCarrier();\n  const acs = getAsyncContextStrategy(carrier);\n  return acs.getIsolationScope();\n}\nfunction getGlobalScope() {\n  return getGlobalSingleton(\"globalScope\", () => new Scope());\n}\nfunction withScope(...rest) {\n  const carrier = getMainCarrier();\n  const acs = getAsyncContextStrategy(carrier);\n  if (rest.length === 2) {\n    const [scope, callback] = rest;\n    if (!scope) {\n      return acs.withScope(callback);\n    }\n    return acs.withSetScope(scope, callback);\n  }\n  return acs.withScope(rest[0]);\n}\nfunction withIsolationScope(...rest) {\n  const carrier = getMainCarrier();\n  const acs = getAsyncContextStrategy(carrier);\n  if (rest.length === 2) {\n    const [isolationScope, callback] = rest;\n    if (!isolationScope) {\n      return acs.withIsolationScope(callback);\n    }\n    return acs.withSetIsolationScope(isolationScope, callback);\n  }\n  return acs.withIsolationScope(rest[0]);\n}\nfunction getClient() {\n  return getCurrentScope().getClient();\n}\nfunction getTraceContextFromScope(scope) {\n  const externalContext = getExternalPropagationContext();\n  if (externalContext) {\n    return { trace_id: externalContext.traceId, span_id: externalContext.spanId };\n  }\n  const propagationContext = scope.getPropagationContext();\n  const { traceId, parentSpanId, propagationSpanId } = propagationContext;\n  const traceContext = {\n    trace_id: traceId,\n    span_id: propagationSpanId || generateSpanId()\n  };\n  if (parentSpanId) {\n    traceContext.parent_span_id = parentSpanId;\n  }\n  return traceContext;\n}\n\nexport { getClient, getCurrentScope, getExternalPropagationContext, getGlobalScope, getIsolationScope, getTraceContextFromScope, hasExternalPropagationContext, registerExternalPropagationContext, withIsolationScope, withScope };\n//# sourceMappingURL=currentScopes.js.map\n","const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = \"sentry.source\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = \"sentry.sample_rate\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE = \"sentry.previous_trace_sample_rate\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_OP = \"sentry.op\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = \"sentry.origin\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE = \"sentry.status.message\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = \"sentry.idle_span_finish_reason\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = \"sentry.measurement_unit\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = \"sentry.measurement_value\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_RELEASE = \"sentry.release\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT = \"sentry.environment\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME = \"sentry.segment.name\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID = \"sentry.segment.id\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = \"sentry.sdk.name\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = \"sentry.sdk.version\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS = \"sentry.sdk.integrations\";\nconst SEMANTIC_ATTRIBUTE_USER_ID = \"user.id\";\nconst SEMANTIC_ATTRIBUTE_USER_EMAIL = \"user.email\";\nconst SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = \"user.ip_address\";\nconst SEMANTIC_ATTRIBUTE_USER_USERNAME = \"user.name\";\nconst SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = \"sentry.custom_span_name\";\nconst SEMANTIC_ATTRIBUTE_PROFILE_ID = \"sentry.profile_id\";\nconst SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = \"sentry.exclusive_time\";\nconst SEMANTIC_ATTRIBUTE_CACHE_HIT = \"cache.hit\";\nconst SEMANTIC_ATTRIBUTE_CACHE_KEY = \"cache.key\";\nconst SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = \"cache.item_size\";\nconst SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = \"http.request.method\";\nconst SEMANTIC_ATTRIBUTE_URL_FULL = \"url.full\";\nconst SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = \"sentry.link.type\";\nconst GEN_AI_CONVERSATION_ID_ATTRIBUTE = \"gen_ai.conversation.id\";\n\nexport { GEN_AI_CONVERSATION_ID_ATTRIBUTE, SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT, SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_RELEASE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS, SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME, SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID, SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE, SEMANTIC_ATTRIBUTE_URL_FULL, SEMANTIC_ATTRIBUTE_USER_EMAIL, SEMANTIC_ATTRIBUTE_USER_ID, SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS, SEMANTIC_ATTRIBUTE_USER_USERNAME, SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE };\n//# sourceMappingURL=semanticAttributes.js.map\n","const SPAN_STATUS_UNSET = 0;\nconst SPAN_STATUS_OK = 1;\nconst SPAN_STATUS_ERROR = 2;\nfunction getSpanStatusFromHttpCode(httpStatus) {\n  if (httpStatus < 400 && httpStatus >= 100) {\n    return { code: SPAN_STATUS_OK };\n  }\n  if (httpStatus >= 400 && httpStatus < 500) {\n    switch (httpStatus) {\n      case 401:\n        return { code: SPAN_STATUS_ERROR, message: \"unauthenticated\" };\n      case 403:\n        return { code: SPAN_STATUS_ERROR, message: \"permission_denied\" };\n      case 404:\n        return { code: SPAN_STATUS_ERROR, message: \"not_found\" };\n      case 409:\n        return { code: SPAN_STATUS_ERROR, message: \"already_exists\" };\n      case 413:\n        return { code: SPAN_STATUS_ERROR, message: \"failed_precondition\" };\n      case 429:\n        return { code: SPAN_STATUS_ERROR, message: \"resource_exhausted\" };\n      case 499:\n        return { code: SPAN_STATUS_ERROR, message: \"cancelled\" };\n      default:\n        return { code: SPAN_STATUS_ERROR, message: \"invalid_argument\" };\n    }\n  }\n  if (httpStatus >= 500 && httpStatus < 600) {\n    switch (httpStatus) {\n      case 501:\n        return { code: SPAN_STATUS_ERROR, message: \"unimplemented\" };\n      case 503:\n        return { code: SPAN_STATUS_ERROR, message: \"unavailable\" };\n      case 504:\n        return { code: SPAN_STATUS_ERROR, message: \"deadline_exceeded\" };\n      default:\n        return { code: SPAN_STATUS_ERROR, message: \"internal_error\" };\n    }\n  }\n  return { code: SPAN_STATUS_ERROR, message: \"internal_error\" };\n}\nfunction setHttpStatus(span, httpStatus) {\n  span.setAttribute(\"http.response.status_code\", httpStatus);\n  const spanStatus = getSpanStatusFromHttpCode(httpStatus);\n  if (spanStatus.message !== \"unknown_error\") {\n    span.setStatus(spanStatus);\n  }\n}\n\nexport { SPAN_STATUS_ERROR, SPAN_STATUS_OK, SPAN_STATUS_UNSET, getSpanStatusFromHttpCode, setHttpStatus };\n//# sourceMappingURL=spanstatus.js.map\n","import { addNonEnumerableProperty } from '../utils/object.js';\nimport { derefWeakRef, makeWeakRef } from '../utils/weakRef.js';\n\nconst SCOPE_ON_START_SPAN_FIELD = \"_sentryScope\";\nconst ISOLATION_SCOPE_ON_START_SPAN_FIELD = \"_sentryIsolationScope\";\nconst OTEL_SOURCE_INFERENCE_SPAN_FIELD = /* @__PURE__ */ Symbol.for(\"sentry.otelSourceInference\");\nconst OTEL_SOURCE_EXPLICITLY_SET_SPAN_FIELD = /* @__PURE__ */ Symbol.for(\"sentry.otelSourceExplicitlySet\");\nconst TRACER_PROVIDER_SPAN_FIELD = /* @__PURE__ */ Symbol.for(\"sentry.tracerProviderSpan\");\nfunction setCapturedScopesOnSpan(span, scope, isolationScope) {\n  if (span) {\n    addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, makeWeakRef(isolationScope));\n    addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope);\n  }\n}\nfunction getCapturedScopesOnSpan(span) {\n  const spanWithScopes = span;\n  return {\n    scope: spanWithScopes[SCOPE_ON_START_SPAN_FIELD],\n    isolationScope: derefWeakRef(spanWithScopes[ISOLATION_SCOPE_ON_START_SPAN_FIELD])\n  };\n}\nfunction markSpanForOtelSourceInference(span) {\n  addNonEnumerableProperty(span, OTEL_SOURCE_INFERENCE_SPAN_FIELD, true);\n}\nfunction spanShouldInferOtelSource(span) {\n  return span[OTEL_SOURCE_INFERENCE_SPAN_FIELD] === true;\n}\nfunction markSpanSourceAsExplicit(span) {\n  addNonEnumerableProperty(span, OTEL_SOURCE_EXPLICITLY_SET_SPAN_FIELD, true);\n}\nfunction spanSourceWasExplicitlySet(span) {\n  return span[OTEL_SOURCE_EXPLICITLY_SET_SPAN_FIELD] === true;\n}\nfunction markSpanAsTracerProviderSpan(span) {\n  addNonEnumerableProperty(span, TRACER_PROVIDER_SPAN_FIELD, true);\n}\nfunction spanIsTracerProviderSpan(span) {\n  return span[TRACER_PROVIDER_SPAN_FIELD] === true;\n}\n\nexport { getCapturedScopesOnSpan, markSpanAsTracerProviderSpan, markSpanForOtelSourceInference, markSpanSourceAsExplicit, setCapturedScopesOnSpan, spanIsTracerProviderSpan, spanShouldInferOtelSource, spanSourceWasExplicitlySet };\n//# sourceMappingURL=utils.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { debug } from './debug-logger.js';\nimport { isString } from './is.js';\n\nconst SENTRY_BAGGAGE_KEY_PREFIX = \"sentry-\";\nconst SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\nconst MAX_BAGGAGE_STRING_LENGTH = 8192;\nfunction baggageHeaderToDynamicSamplingContext(baggageHeader) {\n  const baggageObject = parseBaggageHeader(baggageHeader);\n  if (!baggageObject) {\n    return void 0;\n  }\n  const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => {\n    if (key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {\n      const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n      acc[nonPrefixedKey] = value;\n    }\n    return acc;\n  }, {});\n  if (Object.keys(dynamicSamplingContext).length > 0) {\n    return dynamicSamplingContext;\n  } else {\n    return void 0;\n  }\n}\nfunction dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext) {\n  if (!dynamicSamplingContext) {\n    return void 0;\n  }\n  const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce(\n    (acc, [dscKey, dscValue]) => {\n      if (dscValue) {\n        acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n      }\n      return acc;\n    },\n    {}\n  );\n  return objectToBaggageHeader(sentryPrefixedDSC);\n}\nfunction parseBaggageHeader(baggageHeader) {\n  if (!baggageHeader || !isString(baggageHeader) && !Array.isArray(baggageHeader)) {\n    return void 0;\n  }\n  if (Array.isArray(baggageHeader)) {\n    return baggageHeader.reduce((acc, curr) => {\n      const currBaggageObject = baggageHeaderToObject(curr);\n      Object.entries(currBaggageObject).forEach(([key, value]) => {\n        acc[key] = value;\n      });\n      return acc;\n    }, {});\n  }\n  return baggageHeaderToObject(baggageHeader);\n}\nfunction baggageHeaderToObject(baggageHeader) {\n  return baggageHeader.split(\",\").map((baggageEntry) => {\n    const eqIdx = baggageEntry.indexOf(\"=\");\n    if (eqIdx === -1) {\n      return [];\n    }\n    const key = baggageEntry.slice(0, eqIdx);\n    const value = baggageEntry.slice(eqIdx + 1);\n    return [key, value].map((keyOrValue) => {\n      try {\n        return decodeURIComponent(keyOrValue.trim());\n      } catch {\n        return;\n      }\n    });\n  }).reduce((acc, [key, value]) => {\n    if (key && value) {\n      acc[key] = value;\n    }\n    return acc;\n  }, {});\n}\nfunction objectToBaggageHeader(object) {\n  if (Object.keys(object).length === 0) {\n    return void 0;\n  }\n  return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n    const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n    const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n    if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n      DEBUG_BUILD && debug.warn(\n        `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`\n      );\n      return baggageHeader;\n    } else {\n      return newBaggageHeader;\n    }\n  }, \"\");\n}\nfunction mergeBaggageHeaders(existing, incoming) {\n  if (!existing) {\n    return incoming;\n  }\n  const existingEntries = parseBaggageHeader(existing);\n  const incomingEntries = parseBaggageHeader(incoming);\n  if (!incomingEntries) {\n    return existing;\n  }\n  const merged = {};\n  let hasNewSentryEntries = false;\n  const newSentryEntries = {};\n  const newNonSentryEntries = {};\n  for (const [key, value] of Object.entries(incomingEntries)) {\n    if (key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {\n      newSentryEntries[key] = value;\n      hasNewSentryEntries = true;\n    } else {\n      newNonSentryEntries[key] = value;\n    }\n  }\n  if (existingEntries) {\n    for (const [key, value] of Object.entries(existingEntries)) {\n      if (!hasNewSentryEntries || !key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {\n        merged[key] = value;\n      }\n    }\n  }\n  if (hasNewSentryEntries) {\n    Object.assign(merged, newSentryEntries);\n  }\n  for (const [key, value] of Object.entries(newNonSentryEntries)) {\n    merged[key] ?? (merged[key] = value);\n  }\n  return objectToBaggageHeader(merged);\n}\n\nexport { MAX_BAGGAGE_STRING_LENGTH, SENTRY_BAGGAGE_KEY_PREFIX, SENTRY_BAGGAGE_KEY_PREFIX_REGEX, baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader, mergeBaggageHeaders, objectToBaggageHeader, parseBaggageHeader };\n//# sourceMappingURL=baggage.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { consoleSandbox, debug } from './debug-logger.js';\n\nconst ORG_ID_REGEX = /^o(\\d+)\\./;\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)((?:\\[[:.%\\w]+\\]|[\\w.-]+))(?::(\\d+))?\\/(.+)/;\nfunction isValidProtocol(protocol) {\n  return protocol === \"http\" || protocol === \"https\";\n}\nfunction dsnToString(dsn, withPassword = false) {\n  const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n  return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : \"\"}@${host}${port ? `:${port}` : \"\"}/${path ? `${path}/` : path}${projectId}`;\n}\nfunction dsnFromString(str) {\n  const match = DSN_REGEX.exec(str);\n  if (!match) {\n    consoleSandbox(() => {\n      console.error(`Invalid Sentry Dsn: ${str}`);\n    });\n    return void 0;\n  }\n  const [protocol, publicKey, pass = \"\", host = \"\", port = \"\", lastPath = \"\"] = match.slice(1);\n  let path = \"\";\n  let projectId = lastPath;\n  const split = projectId.split(\"/\");\n  if (split.length > 1) {\n    path = split.slice(0, -1).join(\"/\");\n    projectId = split.pop();\n  }\n  if (projectId) {\n    const projectMatch = projectId.match(/^\\d+/);\n    if (projectMatch) {\n      projectId = projectMatch[0];\n    }\n  }\n  return dsnFromComponents({ host, pass, path, projectId, port, protocol, publicKey });\n}\nfunction dsnFromComponents(components) {\n  return {\n    protocol: components.protocol,\n    publicKey: components.publicKey || \"\",\n    pass: components.pass || \"\",\n    host: components.host,\n    port: components.port || \"\",\n    path: components.path || \"\",\n    projectId: components.projectId\n  };\n}\nfunction validateDsn(dsn) {\n  if (!DEBUG_BUILD) {\n    return true;\n  }\n  const { port, projectId, protocol } = dsn;\n  const requiredComponents = [\"protocol\", \"publicKey\", \"host\", \"projectId\"];\n  const hasMissingRequiredComponent = requiredComponents.find((component) => {\n    if (!dsn[component]) {\n      debug.error(`Invalid Sentry Dsn: ${component} missing`);\n      return true;\n    }\n    return false;\n  });\n  if (hasMissingRequiredComponent) {\n    return false;\n  }\n  if (!projectId.match(/^\\d+$/)) {\n    debug.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n    return false;\n  }\n  if (!isValidProtocol(protocol)) {\n    debug.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n    return false;\n  }\n  if (port && isNaN(parseInt(port, 10))) {\n    debug.error(`Invalid Sentry Dsn: Invalid port ${port}`);\n    return false;\n  }\n  return true;\n}\nfunction extractOrgIdFromDsnHost(host) {\n  const match = host.match(ORG_ID_REGEX);\n  return match?.[1];\n}\nfunction extractOrgIdFromClient(client) {\n  const options = client.getOptions();\n  const { host } = client.getDsn() || {};\n  let org_id;\n  if (options.orgId) {\n    org_id = String(options.orgId);\n  } else if (host) {\n    org_id = extractOrgIdFromDsnHost(host);\n  }\n  return org_id;\n}\nfunction makeDsn(from) {\n  const components = typeof from === \"string\" ? dsnFromString(from) : dsnFromComponents(from);\n  if (!components || !validateDsn(components)) {\n    return void 0;\n  }\n  return components;\n}\n\nexport { dsnFromString, dsnToString, extractOrgIdFromClient, extractOrgIdFromDsnHost, makeDsn };\n//# sourceMappingURL=dsn.js.map\n","function parseSampleRate(sampleRate) {\n  if (typeof sampleRate === \"boolean\") {\n    return Number(sampleRate);\n  }\n  const rate = typeof sampleRate === \"string\" ? parseFloat(sampleRate) : sampleRate;\n  if (typeof rate !== \"number\" || isNaN(rate) || rate < 0 || rate > 1) {\n    return void 0;\n  }\n  return rate;\n}\n\nexport { parseSampleRate };\n//# sourceMappingURL=parseSampleRate.js.map\n","import { debug } from './debug-logger.js';\nimport { baggageHeaderToDynamicSamplingContext } from './baggage.js';\nimport { extractOrgIdFromClient } from './dsn.js';\nimport { parseSampleRate } from './parseSampleRate.js';\nimport { generateTraceId, generateSpanId } from './propagationContext.js';\nimport { safeMathRandom } from './randomSafeContext.js';\n\nconst TRACEPARENT_REGEXP = new RegExp(\n  \"^[ \\\\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\\\t]*$\"\n  // whitespace\n);\nfunction extractTraceparentData(traceparent) {\n  if (!traceparent) {\n    return void 0;\n  }\n  const matches = traceparent.match(TRACEPARENT_REGEXP);\n  if (!matches) {\n    return void 0;\n  }\n  let parentSampled;\n  if (matches[3] === \"1\") {\n    parentSampled = true;\n  } else if (matches[3] === \"0\") {\n    parentSampled = false;\n  }\n  return {\n    traceId: matches[1],\n    parentSampled,\n    parentSpanId: matches[2]\n  };\n}\nfunction isContinuingTrace(propagationContext) {\n  return !!propagationContext.parentSpanId || !!propagationContext.dsc;\n}\nfunction propagationContextFromHeaders(sentryTrace, baggage) {\n  const traceparentData = extractTraceparentData(sentryTrace);\n  const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);\n  if (!traceparentData?.traceId) {\n    return {\n      traceId: generateTraceId(),\n      sampleRand: safeMathRandom()\n    };\n  }\n  const sampleRand = getSampleRandFromTraceparentAndDsc(traceparentData, dynamicSamplingContext);\n  if (dynamicSamplingContext) {\n    dynamicSamplingContext.sample_rand = sampleRand.toString();\n  }\n  const { traceId, parentSpanId, parentSampled } = traceparentData;\n  return {\n    traceId,\n    parentSpanId,\n    sampled: parentSampled,\n    dsc: dynamicSamplingContext || {},\n    // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it\n    sampleRand\n  };\n}\nfunction generateSentryTraceHeader(traceId = generateTraceId(), spanId = generateSpanId(), sampled) {\n  let sampledString = \"\";\n  if (sampled !== void 0) {\n    sampledString = sampled ? \"-1\" : \"-0\";\n  }\n  return `${traceId}-${spanId}${sampledString}`;\n}\nfunction generateTraceparentHeader(traceId = generateTraceId(), spanId = generateSpanId(), sampled) {\n  return `00-${traceId}-${spanId}-${sampled ? \"01\" : \"00\"}`;\n}\nfunction getSampleRandFromTraceparentAndDsc(traceparentData, dsc) {\n  const parsedSampleRand = parseSampleRate(dsc?.sample_rand);\n  if (parsedSampleRand !== void 0) {\n    return parsedSampleRand;\n  }\n  const parsedSampleRate = parseSampleRate(dsc?.sample_rate);\n  if (parsedSampleRate && traceparentData?.parentSampled !== void 0) {\n    return traceparentData.parentSampled ? (\n      // Returns a sample rand with positive sampling decision [0, sampleRate)\n      safeMathRandom() * parsedSampleRate\n    ) : (\n      // Returns a sample rand with negative sampling decision [sampleRate, 1)\n      parsedSampleRate + safeMathRandom() * (1 - parsedSampleRate)\n    );\n  } else {\n    return safeMathRandom();\n  }\n}\nfunction shouldContinueTrace(client, baggageOrgId) {\n  const clientOrgId = extractOrgIdFromClient(client);\n  if (baggageOrgId && clientOrgId && baggageOrgId !== clientOrgId) {\n    debug.log(\n      `Won't continue trace because org IDs don't match (incoming baggage: ${baggageOrgId}, SDK options: ${clientOrgId})`\n    );\n    return false;\n  }\n  const strictTraceContinuation = client.getOptions().strictTraceContinuation || false;\n  if (strictTraceContinuation) {\n    if (baggageOrgId && !clientOrgId || !baggageOrgId && clientOrgId) {\n      debug.log(\n        `Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${baggageOrgId}, Sentry client: ${clientOrgId})`\n      );\n      return false;\n    }\n  }\n  return true;\n}\n\nexport { TRACEPARENT_REGEXP, extractTraceparentData, generateSentryTraceHeader, generateTraceparentHeader, isContinuingTrace, propagationContextFromHeaders, shouldContinueTrace };\n//# sourceMappingURL=tracing.js.map\n","import { getAsyncContextStrategy } from '../asyncContext/index.js';\nimport { serializeAttributes } from '../attributes.js';\nimport { getMainCarrier } from '../carrier.js';\nimport { getCurrentScope } from '../currentScopes.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE } from '../semanticAttributes.js';\nimport { SPAN_STATUS_UNSET, SPAN_STATUS_OK } from '../tracing/spanstatus.js';\nimport { getCapturedScopesOnSpan } from '../tracing/utils.js';\nimport { addNonEnumerableProperty } from './object.js';\nimport { generateSpanId } from './propagationContext.js';\nimport { timestampInSeconds } from './time.js';\nimport { generateSentryTraceHeader, generateTraceparentHeader } from './tracing.js';\nimport { consoleSandbox } from './debug-logger.js';\nimport { _getSpanForScope } from './spanOnScope.js';\n\nconst TRACE_FLAG_NONE = 0;\nconst TRACE_FLAG_SAMPLED = 1;\nlet hasShownSpanDropWarning = false;\nfunction spanToTransactionTraceContext(span) {\n  const { spanId: span_id, traceId: trace_id } = span.spanContext();\n  const { data, op, parent_span_id, status, origin, links } = spanToJSON(span);\n  return {\n    parent_span_id,\n    span_id,\n    trace_id,\n    data,\n    op,\n    status,\n    origin,\n    links\n  };\n}\nfunction spanToTraceContext(span) {\n  const { spanId, traceId: trace_id, isRemote } = span.spanContext();\n  const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id;\n  const scope = getCapturedScopesOnSpan(span).scope;\n  const span_id = isRemote ? scope?.getPropagationContext().propagationSpanId || generateSpanId() : spanId;\n  return {\n    parent_span_id,\n    span_id,\n    trace_id\n  };\n}\nfunction spanToTraceHeader(span) {\n  const { traceId, spanId } = span.spanContext();\n  const sampled = spanIsSampled(span);\n  return generateSentryTraceHeader(traceId, spanId, sampled);\n}\nfunction spanToTraceparentHeader(span) {\n  const { traceId, spanId } = span.spanContext();\n  const sampled = spanIsSampled(span);\n  return generateTraceparentHeader(traceId, spanId, sampled);\n}\nfunction convertSpanLinksForEnvelope(links) {\n  if (links && links.length > 0) {\n    return links.map(({ context: { spanId, traceId, traceFlags, ...restContext }, attributes }) => ({\n      span_id: spanId,\n      trace_id: traceId,\n      sampled: traceFlags === TRACE_FLAG_SAMPLED,\n      attributes,\n      ...restContext\n    }));\n  } else {\n    return void 0;\n  }\n}\nfunction getStreamedSpanLinks(links) {\n  if (links?.length) {\n    return links.map(({ context: { spanId, traceId, traceFlags }, attributes }) => ({\n      span_id: spanId,\n      trace_id: traceId,\n      sampled: traceFlags === TRACE_FLAG_SAMPLED,\n      attributes\n    }));\n  } else {\n    return void 0;\n  }\n}\nfunction spanTimeInputToSeconds(input) {\n  if (typeof input === \"number\") {\n    return ensureTimestampInSeconds(input);\n  }\n  if (Array.isArray(input)) {\n    return input[0] + input[1] / 1e9;\n  }\n  if (input instanceof Date) {\n    return ensureTimestampInSeconds(input.getTime());\n  }\n  return timestampInSeconds();\n}\nfunction ensureTimestampInSeconds(timestamp) {\n  const isMs = timestamp > 9999999999;\n  return isMs ? timestamp / 1e3 : timestamp;\n}\nfunction spanToJSON(span) {\n  if (spanIsSentrySpan(span)) {\n    return span.getSpanJSON();\n  }\n  const { spanId: span_id, traceId: trace_id } = span.spanContext();\n  if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) {\n    const { attributes, startTime, name, endTime, status, links } = span;\n    return {\n      span_id,\n      trace_id,\n      data: attributes,\n      description: name,\n      parent_span_id: getOtelParentSpanId(span),\n      start_timestamp: spanTimeInputToSeconds(startTime),\n      // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time\n      timestamp: spanTimeInputToSeconds(endTime) || void 0,\n      status: getStatusMessage(status),\n      op: attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP],\n      origin: attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN],\n      links: convertSpanLinksForEnvelope(links)\n    };\n  }\n  return {\n    span_id,\n    trace_id,\n    start_timestamp: 0,\n    data: {}\n  };\n}\nfunction spanToStreamedSpanJSON(span) {\n  if (spanIsSentrySpan(span)) {\n    return span.getStreamedSpanJSON();\n  }\n  const { spanId: span_id, traceId: trace_id } = span.spanContext();\n  if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) {\n    const { attributes, startTime, name, endTime, status, links } = span;\n    return {\n      name,\n      span_id,\n      trace_id,\n      parent_span_id: getOtelParentSpanId(span),\n      start_timestamp: spanTimeInputToSeconds(startTime),\n      end_timestamp: spanTimeInputToSeconds(endTime),\n      is_segment: span === INTERNAL_getSegmentSpan(span),\n      status: getSimpleStatus(status),\n      attributes: addStatusMessageAttribute(attributes, status),\n      links: getStreamedSpanLinks(links)\n    };\n  }\n  return {\n    span_id,\n    trace_id,\n    start_timestamp: 0,\n    name: \"\",\n    end_timestamp: 0,\n    status: \"ok\",\n    is_segment: span === INTERNAL_getSegmentSpan(span)\n  };\n}\nfunction getOtelParentSpanId(span) {\n  return \"parentSpanId\" in span ? span.parentSpanId : \"parentSpanContext\" in span ? span.parentSpanContext?.spanId : void 0;\n}\nfunction streamedSpanJsonToSerializedSpan(spanJson) {\n  return {\n    ...spanJson,\n    attributes: serializeAttributes(spanJson.attributes),\n    links: spanJson.links?.map((link) => ({\n      ...link,\n      attributes: serializeAttributes(link.attributes)\n    }))\n  };\n}\nfunction spanIsOpenTelemetrySdkTraceBaseSpan(span) {\n  const castSpan = span;\n  return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status;\n}\nfunction spanIsSentrySpan(span) {\n  return typeof span.getSpanJSON === \"function\";\n}\nfunction spanIsSampled(span) {\n  const { traceFlags } = span.spanContext();\n  return traceFlags === TRACE_FLAG_SAMPLED;\n}\nfunction getStatusMessage(status) {\n  if (!status || status.code === SPAN_STATUS_UNSET) {\n    return void 0;\n  }\n  if (status.code === SPAN_STATUS_OK) {\n    return \"ok\";\n  }\n  return status.message || \"internal_error\";\n}\nfunction getSimpleStatus(status) {\n  return !status || status.code === SPAN_STATUS_OK || status.code === SPAN_STATUS_UNSET || status.message === \"cancelled\" ? \"ok\" : \"error\";\n}\nfunction addStatusMessageAttribute(attributes, status) {\n  const statusMessage = getSimpleStatus(status) === \"error\" ? status?.message : void 0;\n  return {\n    ...statusMessage && { [SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE]: statusMessage },\n    ...attributes\n  };\n}\nconst CHILD_SPANS_FIELD = \"_sentryChildSpans\";\nconst ROOT_SPAN_FIELD = \"_sentryRootSpan\";\nfunction addChildSpanToSpan(span, childSpan) {\n  const rootSpan = span[ROOT_SPAN_FIELD] || span;\n  addNonEnumerableProperty(childSpan, ROOT_SPAN_FIELD, rootSpan);\n  if (!spanIsSampled(span)) {\n    return;\n  }\n  if (!span.isRecording() && !rootSpan.isRecording()) {\n    return;\n  }\n  if (span[CHILD_SPANS_FIELD]) {\n    span[CHILD_SPANS_FIELD].add(childSpan);\n  } else {\n    addNonEnumerableProperty(span, CHILD_SPANS_FIELD, /* @__PURE__ */ new Set([childSpan]));\n  }\n}\nfunction removeChildSpanFromSpan(span, childSpan) {\n  if (span[CHILD_SPANS_FIELD]) {\n    span[CHILD_SPANS_FIELD].delete(childSpan);\n  }\n}\nfunction getSpanDescendants(span) {\n  const resultSet = /* @__PURE__ */ new Set();\n  function addSpanChildren(span2) {\n    if (resultSet.has(span2)) {\n      return;\n    } else if (spanIsSampled(span2)) {\n      resultSet.add(span2);\n      const childSpans = span2[CHILD_SPANS_FIELD] ? Array.from(span2[CHILD_SPANS_FIELD]) : [];\n      for (const childSpan of childSpans) {\n        addSpanChildren(childSpan);\n      }\n    }\n  }\n  addSpanChildren(span);\n  return Array.from(resultSet);\n}\nconst getRootSpan = INTERNAL_getSegmentSpan;\nfunction INTERNAL_getSegmentSpan(span) {\n  return span[ROOT_SPAN_FIELD] || span;\n}\nfunction getActiveSpan() {\n  const carrier = getMainCarrier();\n  const acs = getAsyncContextStrategy(carrier);\n  if (acs.getActiveSpan) {\n    return acs.getActiveSpan();\n  }\n  return _getSpanForScope(getCurrentScope());\n}\nfunction showSpanDropWarning() {\n  if (!hasShownSpanDropWarning) {\n    consoleSandbox(() => {\n      console.warn(\n        \"[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.\"\n      );\n    });\n    hasShownSpanDropWarning = true;\n  }\n}\nfunction updateSpanName(span, name) {\n  span.updateName(name);\n  span.setAttributes({\n    [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: \"custom\",\n    [SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]: name\n  });\n}\n\nexport { INTERNAL_getSegmentSpan, TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED, addChildSpanToSpan, addStatusMessageAttribute, convertSpanLinksForEnvelope, getActiveSpan, getRootSpan, getSimpleStatus, getSpanDescendants, getStatusMessage, getStreamedSpanLinks, removeChildSpanFromSpan, showSpanDropWarning, spanIsSampled, spanIsSentrySpan, spanTimeInputToSeconds, spanToJSON, spanToStreamedSpanJSON, spanToTraceContext, spanToTraceHeader, spanToTraceparentHeader, spanToTransactionTraceContext, streamedSpanJsonToSerializedSpan, updateSpanName };\n//# sourceMappingURL=spanUtils.js.map\n","import { getClient } from '../currentScopes.js';\n\nfunction hasSpansEnabled(maybeOptions) {\n  if (typeof __SENTRY_TRACING__ === \"boolean\" && !__SENTRY_TRACING__) {\n    return false;\n  }\n  const options = maybeOptions || getClient()?.getOptions();\n  return !!options && // Note: This check is `!= null`, meaning \"nullish\". `0` is not \"nullish\", `undefined` and `null` are. (This comment was brought to you by 15 minutes of questioning life)\n  (options.tracesSampleRate != null || !!options.tracesSampler);\n}\n\nexport { hasSpansEnabled };\n//# sourceMappingURL=hasSpansEnabled.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { debug } from './debug-logger.js';\nimport { isMatchingPattern } from './string.js';\n\nfunction logIgnoredSpan(droppedSpan) {\n  debug.log(`Ignoring span ${droppedSpan.op} - ${droppedSpan.description} because it matches \\`ignoreSpans\\`.`);\n}\nfunction shouldIgnoreSpan(span, ignoreSpans) {\n  if (!ignoreSpans?.length) {\n    return false;\n  }\n  for (const pattern of ignoreSpans) {\n    if (isStringOrRegExp(pattern)) {\n      if (span.description && isMatchingPattern(span.description, pattern)) {\n        DEBUG_BUILD && logIgnoredSpan(span);\n        return true;\n      }\n      continue;\n    }\n    const hasAttributes = !!pattern.attributes && Object.keys(pattern.attributes).length > 0;\n    if (!pattern.name && !pattern.op && !hasAttributes) {\n      continue;\n    }\n    const nameMatches = pattern.name ? span.description && isMatchingPattern(span.description, pattern.name) : true;\n    const opMatches = pattern.op ? span.op && isMatchingPattern(span.op, pattern.op) : true;\n    const attrsMatch = pattern.attributes ? Object.entries(pattern.attributes).every(\n      ([key, valuePattern]) => _matchesAttributeValue(span.attributes?.[key], valuePattern)\n    ) : true;\n    if (nameMatches && opMatches && attrsMatch) {\n      DEBUG_BUILD && logIgnoredSpan(span);\n      return true;\n    }\n  }\n  return false;\n}\nfunction _matchesAttributeValue(actual, pat) {\n  if (typeof actual === \"string\" && (typeof pat === \"string\" || pat instanceof RegExp)) {\n    return isMatchingPattern(actual, pat);\n  }\n  if (Array.isArray(actual) && Array.isArray(pat)) {\n    return actual.length === pat.length && actual.every((v, i) => v === pat[i]);\n  }\n  return actual === pat;\n}\nfunction reparentChildSpans(spans, dropSpan) {\n  const droppedSpanParentId = dropSpan.parent_span_id;\n  const droppedSpanId = dropSpan.span_id;\n  if (!droppedSpanParentId) {\n    return;\n  }\n  for (const span of spans) {\n    if (span.parent_span_id === droppedSpanId) {\n      span.parent_span_id = droppedSpanParentId;\n    }\n  }\n}\nfunction isStringOrRegExp(value) {\n  return typeof value === \"string\" || value instanceof RegExp;\n}\n\nexport { reparentChildSpans, shouldIgnoreSpan };\n//# sourceMappingURL=should-ignore-span.js.map\n","import { addNonEnumerableProperty } from '../utils/object.js';\nimport { generateTraceId, generateSpanId } from '../utils/propagationContext.js';\nimport { TRACE_FLAG_NONE } from '../utils/spanUtils.js';\n\nconst NON_RECORDING_SPAN_FIELD = /* @__PURE__ */ Symbol.for(\"sentry.nonRecordingSpan\");\nclass SentryNonRecordingSpan {\n  constructor(spanContext = {}) {\n    this._traceId = spanContext.traceId || generateTraceId();\n    this._spanId = spanContext.spanId || generateSpanId();\n    this.dropReason = spanContext.dropReason;\n    addNonEnumerableProperty(this, NON_RECORDING_SPAN_FIELD, true);\n  }\n  /** @inheritdoc */\n  spanContext() {\n    return {\n      spanId: this._spanId,\n      traceId: this._traceId,\n      traceFlags: TRACE_FLAG_NONE\n    };\n  }\n  /** @inheritdoc */\n  end(_timestamp) {\n  }\n  /** @inheritdoc */\n  setAttribute(_key, _value) {\n    return this;\n  }\n  /** @inheritdoc */\n  setAttributes(_values) {\n    return this;\n  }\n  /** @inheritdoc */\n  setStatus(_status) {\n    return this;\n  }\n  /** @inheritdoc */\n  updateName(_name) {\n    return this;\n  }\n  /** @inheritdoc */\n  isRecording() {\n    return false;\n  }\n  /** @inheritdoc */\n  addEvent(_name, _attributesOrStartTime, _startTime) {\n    return this;\n  }\n  /** @inheritDoc */\n  addLink(_link) {\n    return this;\n  }\n  /** @inheritDoc */\n  addLinks(_links) {\n    return this;\n  }\n  /**\n   * This should generally not be used,\n   * but we need it for being compliant with the OTEL Span interface.\n   *\n   * @hidden\n   * @internal\n   */\n  recordException(_exception, _time) {\n  }\n}\nfunction spanIsNonRecordingSpan(span) {\n  return !!span && span[NON_RECORDING_SPAN_FIELD] === true;\n}\n\nexport { SentryNonRecordingSpan, spanIsNonRecordingSpan };\n//# sourceMappingURL=sentryNonRecordingSpan.js.map\n","const DEFAULT_ENVIRONMENT = \"production\";\nconst DEV_ENVIRONMENT = \"development\";\n\nexport { DEFAULT_ENVIRONMENT, DEV_ENVIRONMENT };\n//# sourceMappingURL=constants.js.map\n","import { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getClient } from '../currentScopes.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes.js';\nimport { baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader } from '../utils/baggage.js';\nimport { extractOrgIdFromClient } from '../utils/dsn.js';\nimport { hasSpansEnabled } from '../utils/hasSpansEnabled.js';\nimport { addNonEnumerableProperty } from '../utils/object.js';\nimport { getRootSpan, spanToJSON, spanIsSampled } from '../utils/spanUtils.js';\nimport { spanIsNonRecordingSpan } from './sentryNonRecordingSpan.js';\nimport { getCapturedScopesOnSpan } from './utils.js';\n\nconst FROZEN_DSC_FIELD = \"_frozenDsc\";\nfunction freezeDscOnSpan(span, dsc) {\n  const spanWithMaybeDsc = span;\n  addNonEnumerableProperty(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc);\n}\nfunction getDynamicSamplingContextFromClient(trace_id, client) {\n  const options = client.getOptions();\n  const { publicKey: public_key } = client.getDsn() || {};\n  const dsc = {\n    environment: options.environment || DEFAULT_ENVIRONMENT,\n    release: options.release,\n    public_key,\n    trace_id,\n    org_id: extractOrgIdFromClient(client)\n  };\n  client.emit(\"createDsc\", dsc);\n  return dsc;\n}\nfunction getDynamicSamplingContextFromScope(client, scope) {\n  const propagationContext = scope.getPropagationContext();\n  return propagationContext.dsc || getDynamicSamplingContextFromClient(propagationContext.traceId, client);\n}\nfunction getDynamicSamplingContextFromSpan(span) {\n  const client = getClient();\n  if (!client) {\n    return {};\n  }\n  const rootSpan = getRootSpan(span);\n  const rootSpanJson = spanToJSON(rootSpan);\n  const rootSpanAttributes = rootSpanJson.data;\n  const traceState = rootSpan.spanContext().traceState;\n  const rootSpanSampleRate = traceState?.get(\"sentry.sample_rate\") ?? rootSpanAttributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] ?? rootSpanAttributes[SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE];\n  function applyLocalSampleRateToDsc(dsc2) {\n    if (typeof rootSpanSampleRate === \"number\" || typeof rootSpanSampleRate === \"string\") {\n      dsc2.sample_rate = `${rootSpanSampleRate}`;\n    }\n    return dsc2;\n  }\n  const frozenDsc = rootSpan[FROZEN_DSC_FIELD];\n  if (frozenDsc) {\n    return applyLocalSampleRateToDsc(frozenDsc);\n  }\n  const isNonRecordingRoot = spanIsNonRecordingSpan(rootSpan);\n  const isIgnoredRoot = isNonRecordingRoot && rootSpan.dropReason === \"ignored\";\n  if (isNonRecordingRoot && (!hasSpansEnabled(client.getOptions()) || isIgnoredRoot)) {\n    const capturedScope = getCapturedScopesOnSpan(rootSpan).scope;\n    if (capturedScope) {\n      const dsc2 = { ...getDynamicSamplingContextFromScope(client, capturedScope) };\n      if (isIgnoredRoot) {\n        dsc2.sampled = \"false\";\n      }\n      return applyLocalSampleRateToDsc(dsc2);\n    }\n  }\n  const traceStateDsc = traceState?.get(\"sentry.dsc\");\n  const dscOnTraceState = traceStateDsc && baggageHeaderToDynamicSamplingContext(traceStateDsc);\n  if (dscOnTraceState) {\n    return applyLocalSampleRateToDsc(dscOnTraceState);\n  }\n  const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client);\n  const source = rootSpanAttributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ?? rootSpanAttributes[\"sentry.segment.name.source\"];\n  const name = rootSpanJson.description;\n  if (source !== \"url\" && name) {\n    dsc.transaction = name;\n  }\n  if (hasSpansEnabled()) {\n    dsc.sampled = String(spanIsSampled(rootSpan));\n    dsc.sample_rand = // In OTEL we store the sample rand on the trace state because we cannot access scopes for NonRecordingSpans\n    // The Sentry OTEL SpanSampler takes care of writing the sample rand on the root span\n    traceState?.get(\"sentry.sample_rand\") ?? // On all other platforms we can actually get the scopes from a root span (we use this as a fallback)\n    getCapturedScopesOnSpan(rootSpan).scope?.getPropagationContext().sampleRand.toString();\n  }\n  applyLocalSampleRateToDsc(dsc);\n  client.emit(\"createDsc\", dsc, rootSpan);\n  return dsc;\n}\nfunction spanToBaggageHeader(span) {\n  const dsc = getDynamicSamplingContextFromSpan(span);\n  return dynamicSamplingContextToSentryBaggageHeader(dsc);\n}\n\nexport { freezeDscOnSpan, getDynamicSamplingContextFromClient, getDynamicSamplingContextFromScope, getDynamicSamplingContextFromSpan, spanToBaggageHeader };\n//# sourceMappingURL=dynamicSamplingContext.js.map\n","import { addNonEnumerableProperty } from '../../utils/object.js';\n\nfunction withStreamedSpan(callback) {\n  addNonEnumerableProperty(callback, \"_streamed\", true);\n  return callback;\n}\nfunction isStreamedBeforeSendSpanCallback(callback) {\n  return !!callback && typeof callback === \"function\" && \"_streamed\" in callback && !!callback._streamed;\n}\n\nexport { isStreamedBeforeSendSpanCallback, withStreamedSpan };\n//# sourceMappingURL=beforeSendSpan.js.map\n","import { getSentryCarrier } from '../carrier.js';\nimport { dsnToString } from './dsn.js';\nimport { normalize } from './normalize.js';\nimport { safeDateNow } from './randomSafeContext.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nfunction createEnvelope(headers, items = []) {\n  return [headers, items];\n}\nfunction addItemToEnvelope(envelope, newItem) {\n  const [headers, items] = envelope;\n  return [headers, [...items, newItem]];\n}\nfunction forEachEnvelopeItem(envelope, callback) {\n  const envelopeItems = envelope[1];\n  for (const envelopeItem of envelopeItems) {\n    const envelopeItemType = envelopeItem[0].type;\n    const result = callback(envelopeItem, envelopeItemType);\n    if (result) {\n      return true;\n    }\n  }\n  return false;\n}\nfunction envelopeContainsItemType(envelope, types) {\n  return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));\n}\nfunction encodeUTF8(input) {\n  const carrier = getSentryCarrier(GLOBAL_OBJ);\n  return carrier.encodePolyfill ? carrier.encodePolyfill(input) : new TextEncoder().encode(input);\n}\nfunction decodeUTF8(input) {\n  const carrier = getSentryCarrier(GLOBAL_OBJ);\n  return carrier.decodePolyfill ? carrier.decodePolyfill(input) : new TextDecoder().decode(input);\n}\nfunction serializeEnvelope(envelope) {\n  const [envHeaders, items] = envelope;\n  let parts = JSON.stringify(envHeaders);\n  function append(next) {\n    if (typeof parts === \"string\") {\n      parts = typeof next === \"string\" ? parts + next : [encodeUTF8(parts), next];\n    } else {\n      parts.push(typeof next === \"string\" ? encodeUTF8(next) : next);\n    }\n  }\n  for (const item of items) {\n    const [itemHeaders, payload] = item;\n    append(`\n${JSON.stringify(itemHeaders)}\n`);\n    if (typeof payload === \"string\" || payload instanceof Uint8Array) {\n      append(payload);\n    } else {\n      let stringifiedPayload;\n      try {\n        stringifiedPayload = JSON.stringify(payload);\n      } catch {\n        stringifiedPayload = JSON.stringify(normalize(payload));\n      }\n      append(stringifiedPayload);\n    }\n  }\n  return typeof parts === \"string\" ? parts : concatBuffers(parts);\n}\nfunction concatBuffers(buffers) {\n  const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);\n  const merged = new Uint8Array(totalLength);\n  let offset = 0;\n  for (const buffer of buffers) {\n    merged.set(buffer, offset);\n    offset += buffer.length;\n  }\n  return merged;\n}\nfunction parseEnvelope(env) {\n  let buffer = typeof env === \"string\" ? encodeUTF8(env) : env;\n  function readBinary(length) {\n    const bin = buffer.subarray(0, length);\n    buffer = buffer.subarray(length + 1);\n    return bin;\n  }\n  function readJson() {\n    let i = buffer.indexOf(10);\n    if (i < 0) {\n      i = buffer.length;\n    }\n    return JSON.parse(decodeUTF8(readBinary(i)));\n  }\n  const envelopeHeader = readJson();\n  const items = [];\n  while (buffer.length) {\n    const itemHeader = readJson();\n    const binaryLength = typeof itemHeader.length === \"number\" ? itemHeader.length : void 0;\n    items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);\n  }\n  return [envelopeHeader, items];\n}\nfunction createSpanEnvelopeItem(spanJson) {\n  const spanHeaders = {\n    type: \"span\"\n  };\n  return [spanHeaders, spanJson];\n}\nfunction createAttachmentEnvelopeItem(attachment) {\n  const buffer = typeof attachment.data === \"string\" ? encodeUTF8(attachment.data) : attachment.data;\n  return [\n    {\n      type: \"attachment\",\n      length: buffer.length,\n      filename: attachment.filename,\n      content_type: attachment.contentType,\n      attachment_type: attachment.attachmentType\n    },\n    buffer\n  ];\n}\nconst DATA_CATEGORY_OVERRIDES = {\n  sessions: \"session\",\n  event: \"error\",\n  client_report: \"internal\",\n  user_report: \"default\",\n  profile_chunk: \"profile\",\n  replay_event: \"replay\",\n  replay_recording: \"replay\",\n  check_in: \"monitor\",\n  raw_security: \"security\",\n  log: \"log_item\",\n  trace_metric: \"metric\"\n};\nfunction _isOverriddenType(type) {\n  return type in DATA_CATEGORY_OVERRIDES;\n}\nfunction envelopeItemTypeToDataCategory(type) {\n  return _isOverriddenType(type) ? DATA_CATEGORY_OVERRIDES[type] : type;\n}\nfunction getSdkMetadataForEnvelopeHeader(metadataOrEvent) {\n  if (!metadataOrEvent?.sdk) {\n    return;\n  }\n  const { name, version } = metadataOrEvent.sdk;\n  return { name, version };\n}\nfunction createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn) {\n  const dynamicSamplingContext = event.sdkProcessingMetadata?.dynamicSamplingContext;\n  return {\n    event_id: event.event_id,\n    sent_at: new Date(safeDateNow()).toISOString(),\n    ...sdkInfo && { sdk: sdkInfo },\n    ...!!tunnel && dsn && { dsn: dsnToString(dsn) },\n    ...dynamicSamplingContext && {\n      trace: dynamicSamplingContext\n    }\n  };\n}\n\nexport { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, createEventEnvelopeHeaders, createSpanEnvelopeItem, envelopeContainsItemType, envelopeItemTypeToDataCategory, forEachEnvelopeItem, getSdkMetadataForEnvelopeHeader, parseEnvelope, serializeEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { getDynamicSamplingContextFromSpan } from './tracing/dynamicSamplingContext.js';\nimport { isStreamedBeforeSendSpanCallback } from './tracing/spans/beforeSendSpan.js';\nimport { dsnToString } from './utils/dsn.js';\nimport { getSdkMetadataForEnvelopeHeader, createEventEnvelopeHeaders, createEnvelope, createSpanEnvelopeItem } from './utils/envelope.js';\nimport { safeDateNow } from './utils/randomSafeContext.js';\nimport { shouldIgnoreSpan } from './utils/should-ignore-span.js';\nimport { spanToJSON, showSpanDropWarning } from './utils/spanUtils.js';\n\nfunction _enhanceEventWithSdkInfo(event, newSdkInfo) {\n  if (!newSdkInfo) {\n    return event;\n  }\n  const eventSdkInfo = event.sdk || {};\n  event.sdk = {\n    ...eventSdkInfo,\n    name: eventSdkInfo.name || newSdkInfo.name,\n    version: eventSdkInfo.version || newSdkInfo.version,\n    integrations: [...event.sdk?.integrations || [], ...newSdkInfo.integrations || []],\n    packages: [...event.sdk?.packages || [], ...newSdkInfo.packages || []],\n    settings: event.sdk?.settings || newSdkInfo.settings ? {\n      ...event.sdk?.settings,\n      ...newSdkInfo.settings\n    } : void 0\n  };\n  return event;\n}\nfunction createSessionEnvelope(session, dsn, metadata, tunnel) {\n  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n  const envelopeHeaders = {\n    sent_at: new Date(safeDateNow()).toISOString(),\n    ...sdkInfo && { sdk: sdkInfo },\n    ...!!tunnel && dsn && { dsn: dsnToString(dsn) }\n  };\n  const envelopeItem = \"aggregates\" in session ? [{ type: \"sessions\" }, session] : [{ type: \"session\" }, session.toJSON()];\n  return createEnvelope(envelopeHeaders, [envelopeItem]);\n}\nfunction createEventEnvelope(event, dsn, metadata, tunnel) {\n  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n  const eventType = event.type && event.type !== \"replay_event\" ? event.type : \"event\";\n  _enhanceEventWithSdkInfo(event, metadata?.sdk);\n  const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n  delete event.sdkProcessingMetadata;\n  const eventItem = [{ type: eventType }, event];\n  return createEnvelope(envelopeHeaders, [eventItem]);\n}\nfunction createSpanEnvelope(spans, client) {\n  function dscHasRequiredProps(dsc2) {\n    return !!dsc2.trace_id && !!dsc2.public_key;\n  }\n  const dsc = getDynamicSamplingContextFromSpan(spans[0]);\n  const dsn = client?.getDsn();\n  const tunnel = client?.getOptions().tunnel;\n  const headers = {\n    sent_at: new Date(safeDateNow()).toISOString(),\n    ...dscHasRequiredProps(dsc) && { trace: dsc },\n    ...!!tunnel && dsn && { dsn: dsnToString(dsn) }\n  };\n  const { beforeSendSpan, ignoreSpans } = client?.getOptions() || {};\n  const filteredSpans = ignoreSpans?.length ? spans.filter((span) => {\n    const json = spanToJSON(span);\n    return !shouldIgnoreSpan({ description: json.description, op: json.op, attributes: json.data }, ignoreSpans);\n  }) : spans;\n  const droppedSpans = spans.length - filteredSpans.length;\n  if (droppedSpans) {\n    client?.recordDroppedEvent(\"before_send\", \"span\", droppedSpans);\n  }\n  const convertToSpanJSON = beforeSendSpan ? (span) => {\n    const spanJson = spanToJSON(span);\n    const processedSpan = !isStreamedBeforeSendSpanCallback(beforeSendSpan) ? beforeSendSpan(spanJson) : spanJson;\n    if (!processedSpan) {\n      showSpanDropWarning();\n      return spanJson;\n    }\n    return processedSpan;\n  } : spanToJSON;\n  const items = [];\n  for (const span of filteredSpans) {\n    const spanJson = convertToSpanJSON(span);\n    if (spanJson) {\n      items.push(createSpanEnvelopeItem(spanJson));\n    }\n  }\n  return createEnvelope(headers, items);\n}\n\nexport { _enhanceEventWithSdkInfo, createEventEnvelope, createSessionEnvelope, createSpanEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { debug } from '../utils/debug-logger.js';\nimport { spanToJSON, getRootSpan, spanIsSampled } from '../utils/spanUtils.js';\n\nfunction logSpanStart(span) {\n  if (!DEBUG_BUILD) return;\n  const { description = \"< unknown name >\", op = \"< unknown op >\", parent_span_id: parentSpanId } = spanToJSON(span);\n  const { spanId } = span.spanContext();\n  const sampled = spanIsSampled(span);\n  const rootSpan = getRootSpan(span);\n  const isRootSpan = rootSpan === span;\n  const header = `[Tracing] Starting ${sampled ? \"sampled\" : \"unsampled\"} ${isRootSpan ? \"root \" : \"\"}span`;\n  const infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`];\n  if (parentSpanId) {\n    infoParts.push(`parent ID: ${parentSpanId}`);\n  }\n  if (!isRootSpan) {\n    const { op: op2, description: description2 } = spanToJSON(rootSpan);\n    infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`);\n    if (op2) {\n      infoParts.push(`root op: ${op2}`);\n    }\n    if (description2) {\n      infoParts.push(`root description: ${description2}`);\n    }\n  }\n  debug.log(`${header}\n  ${infoParts.join(\"\\n  \")}`);\n}\nfunction logSpanEnd(span) {\n  if (!DEBUG_BUILD) return;\n  const { description = \"< unknown name >\", op = \"< unknown op >\" } = spanToJSON(span);\n  const { spanId } = span.spanContext();\n  const rootSpan = getRootSpan(span);\n  const isRootSpan = rootSpan === span;\n  const msg = `[Tracing] Finishing \"${op}\" ${isRootSpan ? \"root \" : \"\"}span \"${description}\" with ID ${spanId}`;\n  debug.log(msg);\n}\n\nexport { logSpanEnd, logSpanStart };\n//# sourceMappingURL=logSpans.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE } from '../semanticAttributes.js';\nimport { debug } from '../utils/debug-logger.js';\nimport { getRootSpan, getActiveSpan } from '../utils/spanUtils.js';\n\nfunction setMeasurement(name, value, unit, activeSpan = getActiveSpan()) {\n  const rootSpan = activeSpan && getRootSpan(activeSpan);\n  if (rootSpan) {\n    DEBUG_BUILD && debug.log(`[Measurement] Setting measurement on root span: ${name} = ${value} ${unit}`);\n    rootSpan.addEvent(name, {\n      [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value,\n      [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit\n    });\n  }\n}\nfunction timedEventsToMeasurements(events) {\n  if (!events || events.length === 0) {\n    return void 0;\n  }\n  const measurements = {};\n  events.forEach((event) => {\n    const attributes = event.attributes || {};\n    const unit = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT];\n    const value = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE];\n    if (typeof unit === \"string\" && typeof value === \"number\") {\n      measurements[event.name] = { value, unit };\n    }\n  });\n  return measurements;\n}\n\nexport { setMeasurement, timedEventsToMeasurements };\n//# sourceMappingURL=measurement.js.map\n","import { getSentryCarrier, getMainCarrier } from '../carrier.js';\n\nfunction setSegmentSpanCaptureStrategy(strategy) {\n  getSentryCarrier(getMainCarrier()).segmentSpanCaptureStrategy = strategy;\n}\nfunction getSegmentSpanCaptureStrategy() {\n  return getSentryCarrier(getMainCarrier()).segmentSpanCaptureStrategy;\n}\n\nexport { getSegmentSpanCaptureStrategy, setSegmentSpanCaptureStrategy };\n//# sourceMappingURL=segmentSpanCaptureStrategy.js.map\n","function hasSpanStreamingEnabled(client) {\n  return client.getOptions().traceLifecycle === \"stream\";\n}\n\nexport { hasSpanStreamingEnabled };\n//# sourceMappingURL=hasSpanStreamingEnabled.js.map\n","import { getClient, getCurrentScope } from '../currentScopes.js';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { createSpanEnvelope } from '../envelope.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME } from '../semanticAttributes.js';\nimport { debug } from '../utils/debug-logger.js';\nimport { generateTraceId, generateSpanId } from '../utils/propagationContext.js';\nimport { TRACE_FLAG_SAMPLED, TRACE_FLAG_NONE, spanTimeInputToSeconds, convertSpanLinksForEnvelope, getRootSpan, getStatusMessage, getStreamedSpanLinks, addStatusMessageAttribute, getSimpleStatus, spanToJSON, getSpanDescendants, spanToTransactionTraceContext } from '../utils/spanUtils.js';\nimport { timestampInSeconds } from '../utils/time.js';\nimport { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext.js';\nimport { logSpanEnd } from './logSpans.js';\nimport { timedEventsToMeasurements } from './measurement.js';\nimport { getSegmentSpanCaptureStrategy } from './segmentSpanCaptureStrategy.js';\nimport { hasSpanStreamingEnabled } from './spans/hasSpanStreamingEnabled.js';\nimport { spanShouldInferOtelSource, markSpanSourceAsExplicit, spanIsTracerProviderSpan, getCapturedScopesOnSpan } from './utils.js';\n\nconst MAX_SPAN_COUNT = 1e3;\nclass SentrySpan {\n  /**\n   * You should never call the constructor manually, always use `Sentry.startSpan()`\n   * or other span methods.\n   * @internal\n   * @hideconstructor\n   * @hidden\n   */\n  constructor(spanContext = {}) {\n    this._traceId = spanContext.traceId || generateTraceId();\n    this._spanId = spanContext.spanId || generateSpanId();\n    this._startTime = spanContext.startTimestamp || timestampInSeconds();\n    this._links = spanContext.links;\n    this._attributes = {};\n    this.setAttributes({\n      [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: \"manual\",\n      [SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op,\n      ...spanContext.attributes\n    });\n    this._name = spanContext.name;\n    if (spanContext.parentSpanId) {\n      this._parentSpanId = spanContext.parentSpanId;\n    }\n    if (\"sampled\" in spanContext) {\n      this._sampled = spanContext.sampled;\n    }\n    if (spanContext.endTimestamp) {\n      this._endTime = spanContext.endTimestamp;\n    }\n    this._events = [];\n    this._isStandaloneSpan = spanContext.isStandalone;\n    if (this._endTime) {\n      this._onSpanEnded();\n    }\n  }\n  /** @inheritDoc */\n  addLink(link) {\n    if (this._frozen) {\n      return this;\n    }\n    if (this._links) {\n      this._links.push(link);\n    } else {\n      this._links = [link];\n    }\n    return this;\n  }\n  /** @inheritDoc */\n  addLinks(links) {\n    if (this._frozen) {\n      return this;\n    }\n    if (this._links) {\n      this._links.push(...links);\n    } else {\n      this._links = links;\n    }\n    return this;\n  }\n  /**\n   * This should generally not be used,\n   * but it is needed for being compliant with the OTEL Span interface.\n   *\n   * @hidden\n   * @internal\n   */\n  recordException(_exception, _time) {\n  }\n  /** @inheritdoc */\n  spanContext() {\n    const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this;\n    return {\n      spanId,\n      traceId,\n      traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE\n    };\n  }\n  /** @inheritdoc */\n  setAttribute(key, value) {\n    if (this._frozen) {\n      return this;\n    }\n    if (value === void 0) {\n      delete this._attributes[key];\n    } else {\n      this._attributes[key] = value;\n    }\n    if (key === SEMANTIC_ATTRIBUTE_SENTRY_SOURCE && value !== void 0 && spanShouldInferOtelSource(this)) {\n      markSpanSourceAsExplicit(this);\n    }\n    return this;\n  }\n  /** @inheritdoc */\n  setAttributes(attributes) {\n    Object.keys(attributes).forEach((key) => this.setAttribute(key, attributes[key]));\n    return this;\n  }\n  /**\n   * This should generally not be used,\n   * but we need it for browser tracing where we want to adjust the start time afterwards.\n   * USE THIS WITH CAUTION!\n   *\n   * @hidden\n   * @internal\n   */\n  updateStartTime(timeInput) {\n    if (this._frozen) {\n      return;\n    }\n    this._startTime = spanTimeInputToSeconds(timeInput);\n  }\n  /**\n   * @inheritDoc\n   */\n  setStatus(value) {\n    if (this._frozen) {\n      return this;\n    }\n    this._status = value;\n    return this;\n  }\n  /**\n   * @inheritDoc\n   */\n  updateName(name) {\n    if (this._frozen) {\n      return this;\n    }\n    this._name = name;\n    if (!spanShouldInferOtelSource(this)) {\n      this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, \"custom\");\n    }\n    return this;\n  }\n  /** @inheritdoc */\n  end(endTimestamp) {\n    if (this._endTime) {\n      this._frozen = spanIsTracerProviderSpan(this);\n      return;\n    }\n    this._endTime = spanTimeInputToSeconds(endTimestamp);\n    logSpanEnd(this);\n    this._onSpanEnded();\n    this._frozen = spanIsTracerProviderSpan(this);\n  }\n  /**\n   * Get JSON representation of this span.\n   *\n   * @hidden\n   * @internal This method is purely for internal purposes and should not be used outside\n   * of SDK code. If you need to get a JSON representation of a span,\n   * use `spanToJSON(span)` instead.\n   */\n  getSpanJSON() {\n    return {\n      data: this._attributes,\n      description: this._name,\n      op: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP],\n      parent_span_id: this._parentSpanId,\n      span_id: this._spanId,\n      start_timestamp: this._startTime,\n      status: getStatusMessage(this._status),\n      timestamp: this._endTime,\n      trace_id: this._traceId,\n      origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN],\n      profile_id: this._attributes[SEMANTIC_ATTRIBUTE_PROFILE_ID],\n      exclusive_time: this._attributes[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME],\n      measurements: timedEventsToMeasurements(this._events),\n      is_segment: this._isStandaloneSpan && getRootSpan(this) === this || void 0,\n      segment_id: this._isStandaloneSpan ? getRootSpan(this).spanContext().spanId : void 0,\n      links: convertSpanLinksForEnvelope(this._links)\n    };\n  }\n  /**\n   * Get {@link StreamedSpanJSON} representation of this span.\n   *\n   * @hidden\n   * @internal This method is purely for internal purposes and should not be used outside\n   * of SDK code. If you need to get a JSON representation of a span,\n   * use `spanToStreamedSpanJSON(span)` instead.\n   */\n  getStreamedSpanJSON() {\n    return {\n      name: this._name ?? \"\",\n      span_id: this._spanId,\n      trace_id: this._traceId,\n      parent_span_id: this._parentSpanId,\n      start_timestamp: this._startTime,\n      // just in case _endTime is not set, we use the start time (i.e. duration 0)\n      end_timestamp: this._endTime ?? this._startTime,\n      is_segment: this._isStandaloneSpan || this === getRootSpan(this),\n      status: getSimpleStatus(this._status),\n      attributes: addStatusMessageAttribute(this._attributes, this._status),\n      links: getStreamedSpanLinks(this._links)\n    };\n  }\n  /** @inheritdoc */\n  isRecording() {\n    return !this._endTime && !!this._sampled;\n  }\n  /**\n   * @inheritdoc\n   */\n  addEvent(name, attributesOrStartTime, startTime) {\n    if (this._frozen) {\n      return this;\n    }\n    DEBUG_BUILD && debug.log(\"[Tracing] Adding an event to span:\", name);\n    const time = isSpanTimeInput(attributesOrStartTime) ? attributesOrStartTime : startTime || timestampInSeconds();\n    const attributes = isSpanTimeInput(attributesOrStartTime) ? {} : attributesOrStartTime || {};\n    const event = {\n      name,\n      time: spanTimeInputToSeconds(time),\n      attributes\n    };\n    this._events.push(event);\n    return this;\n  }\n  /**\n   * This method should generally not be used,\n   * but for now we need a way to publicly check if the `_isStandaloneSpan` flag is set.\n   * USE THIS WITH CAUTION!\n   * @internal\n   * @hidden\n   * @experimental\n   */\n  isStandaloneSpan() {\n    return !!this._isStandaloneSpan;\n  }\n  /** Emit `spanEnd` when the span is ended. */\n  _onSpanEnded() {\n    const client = getClient();\n    if (client) {\n      client.emit(\"spanEnd\", this);\n      if (!this._isStandaloneSpan) {\n        client.emit(\"afterSpanEnd\", this);\n      }\n    }\n    const rootSpan = getRootSpan(this);\n    const isSegmentSpan = this._isStandaloneSpan || this === rootSpan;\n    if (this._isStandaloneSpan) {\n      if (this._sampled) {\n        sendSpanEnvelope(createSpanEnvelope([this], client));\n      } else {\n        DEBUG_BUILD && debug.log(\"[Tracing] Discarding standalone span because its trace was not chosen to be sampled.\");\n        if (client) {\n          client.recordDroppedEvent(\"sample_rate\", \"span\");\n        }\n      }\n      return;\n    }\n    if (!isSegmentSpan) {\n      const strategy2 = getSegmentSpanCaptureStrategy();\n      if (strategy2) {\n        const scope2 = getCapturedScopesOnSpan(this).scope || getCurrentScope();\n        strategy2.onChildSpanEnded(this, rootSpan, (options) => this._convertSpanToTransaction(options), scope2);\n      }\n      return;\n    }\n    if (client && hasSpanStreamingEnabled(client)) {\n      client.emit(\"afterSegmentSpanEnd\", this);\n      return;\n    }\n    const scope = getCapturedScopesOnSpan(this).scope || getCurrentScope();\n    const strategy = getSegmentSpanCaptureStrategy();\n    if (strategy) {\n      strategy.onSegmentSpanEnded((options) => this._convertSpanToTransaction(options), scope);\n    } else {\n      const transactionEvent = this._convertSpanToTransaction();\n      if (transactionEvent) {\n        scope.captureEvent(transactionEvent);\n      }\n    }\n  }\n  /**\n   * Finish the transaction & prepare the event to send to Sentry.\n   */\n  _convertSpanToTransaction(options = {}) {\n    if (!isFullFinishedSpan(spanToJSON(this))) {\n      return void 0;\n    }\n    if (!this._name) {\n      DEBUG_BUILD && debug.warn(\"Transaction has no name, falling back to `<unlabeled transaction>`.\");\n      this._name = \"<unlabeled transaction>\";\n    }\n    const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = getCapturedScopesOnSpan(this);\n    const normalizedRequest = capturedSpanScope?.getScopeData().sdkProcessingMetadata?.normalizedRequest;\n    if (this._sampled !== true) {\n      return void 0;\n    }\n    options.onSpanCaptured?.(this);\n    const spans = [];\n    for (const descendant of getSpanDescendants(this)) {\n      if (descendant === this || isStandaloneSpan(descendant) || options.isSpanAlreadyCaptured?.(descendant)) {\n        continue;\n      }\n      const spanJSON = spanToJSON(descendant);\n      if (!isFullFinishedSpan(spanJSON)) {\n        continue;\n      }\n      options.onSpanCaptured?.(descendant);\n      spans.push(spanJSON);\n    }\n    const source = this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n    delete this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n    let hasGenAiSpans = false;\n    spans.forEach((span) => {\n      delete span.data[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n      if (span.op?.startsWith(\"gen_ai.\")) {\n        hasGenAiSpans = true;\n      }\n    });\n    const transaction = {\n      contexts: {\n        trace: spanToTransactionTraceContext(this)\n      },\n      spans: (\n        // spans.sort() mutates the array, but `spans` is already a copy so we can safely do this here\n        // we do not use spans anymore after this point\n        spans.length > MAX_SPAN_COUNT ? spans.sort((a, b) => a.start_timestamp - b.start_timestamp).slice(0, MAX_SPAN_COUNT) : spans\n      ),\n      start_timestamp: this._startTime,\n      timestamp: this._endTime,\n      transaction: this._name,\n      type: \"transaction\",\n      sdkProcessingMetadata: {\n        capturedSpanScope,\n        capturedSpanIsolationScope,\n        dynamicSamplingContext: getDynamicSamplingContextFromSpan(this),\n        hasGenAiSpans\n      },\n      request: normalizedRequest,\n      ...source && {\n        transaction_info: {\n          source\n        }\n      }\n    };\n    const measurements = timedEventsToMeasurements(this._events);\n    const hasMeasurements = measurements && Object.keys(measurements).length;\n    if (hasMeasurements) {\n      DEBUG_BUILD && debug.log(\n        \"[Measurements] Adding measurements to transaction event\",\n        JSON.stringify(measurements, void 0, 2)\n      );\n      transaction.measurements = measurements;\n    }\n    return transaction;\n  }\n}\nfunction isSpanTimeInput(value) {\n  return value && typeof value === \"number\" || value instanceof Date || Array.isArray(value);\n}\nfunction isFullFinishedSpan(input) {\n  return !!input.start_timestamp && !!input.timestamp && !!input.span_id && !!input.trace_id;\n}\nfunction isStandaloneSpan(span) {\n  return span instanceof SentrySpan && span.isStandaloneSpan();\n}\nfunction sendSpanEnvelope(envelope) {\n  const client = getClient();\n  if (!client) {\n    return;\n  }\n  const spanItems = envelope[1];\n  if (!spanItems || spanItems.length === 0) {\n    client.recordDroppedEvent(\"before_send\", \"span\");\n    return;\n  }\n  client.sendEnvelope(envelope);\n}\n\nexport { SentrySpan };\n//# sourceMappingURL=sentrySpan.js.map\n","import { chainAndCopyPromiseLike } from './chain-and-copy-promiselike.js';\nimport { isThenable } from './is.js';\n\nfunction handleCallbackErrors(fn, onError, onFinally = () => {\n}, onSuccess = () => {\n}) {\n  let maybePromiseResult;\n  try {\n    maybePromiseResult = fn();\n  } catch (e) {\n    onError(e);\n    onFinally();\n    throw e;\n  }\n  return maybeHandlePromiseRejection(maybePromiseResult, onError, onFinally, onSuccess);\n}\nfunction maybeHandlePromiseRejection(value, onError, onFinally, onSuccess) {\n  if (isThenable(value)) {\n    return chainAndCopyPromiseLike(\n      value,\n      (result) => {\n        onFinally();\n        onSuccess(result);\n      },\n      (err) => {\n        onError(err);\n        onFinally();\n      }\n    );\n  }\n  onFinally();\n  onSuccess(value);\n  return value;\n}\n\nexport { handleCallbackErrors };\n//# sourceMappingURL=handleCallbackErrors.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { debug } from '../utils/debug-logger.js';\nimport { hasSpansEnabled } from '../utils/hasSpansEnabled.js';\nimport { parseSampleRate } from '../utils/parseSampleRate.js';\n\nfunction sampleSpan(options, samplingContext, sampleRand) {\n  if (!hasSpansEnabled(options)) {\n    return [false];\n  }\n  let localSampleRateWasApplied = void 0;\n  let sampleRate;\n  if (typeof options.tracesSampler === \"function\") {\n    sampleRate = options.tracesSampler({\n      ...samplingContext,\n      inheritOrSampleWith: (fallbackSampleRate) => {\n        if (typeof samplingContext.parentSampleRate === \"number\") {\n          return samplingContext.parentSampleRate;\n        }\n        if (typeof samplingContext.parentSampled === \"boolean\") {\n          return Number(samplingContext.parentSampled);\n        }\n        return fallbackSampleRate;\n      }\n    });\n    localSampleRateWasApplied = true;\n  } else if (samplingContext.parentSampled !== void 0) {\n    sampleRate = samplingContext.parentSampled;\n  } else if (typeof options.tracesSampleRate !== \"undefined\") {\n    sampleRate = options.tracesSampleRate;\n    localSampleRateWasApplied = true;\n  }\n  const parsedSampleRate = parseSampleRate(sampleRate);\n  if (parsedSampleRate === void 0) {\n    DEBUG_BUILD && debug.warn(\n      `[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n        sampleRate\n      )} of type ${JSON.stringify(typeof sampleRate)}.`\n    );\n    return [false];\n  }\n  if (!parsedSampleRate) {\n    DEBUG_BUILD && debug.log(\n      `[Tracing] Discarding transaction because ${typeof options.tracesSampler === \"function\" ? \"tracesSampler returned 0 or false\" : \"a negative sampling decision was inherited or tracesSampleRate is set to 0\"}`\n    );\n    return [false, parsedSampleRate, localSampleRateWasApplied];\n  }\n  const shouldSample = sampleRand < parsedSampleRate;\n  if (!shouldSample) {\n    DEBUG_BUILD && debug.log(\n      `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n        sampleRate\n      )})`\n    );\n  }\n  return [shouldSample, parsedSampleRate, localSampleRateWasApplied];\n}\n\nexport { sampleSpan };\n//# sourceMappingURL=sampling.js.map\n","import { getAsyncContextStrategy } from '../asyncContext/index.js';\nimport { getMainCarrier } from '../carrier.js';\nimport { getClient, withScope, getCurrentScope, getIsolationScope } from '../currentScopes.js';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes.js';\nimport { baggageHeaderToDynamicSamplingContext } from '../utils/baggage.js';\nimport { debug } from '../utils/debug-logger.js';\nimport { handleCallbackErrors } from '../utils/handleCallbackErrors.js';\nimport { hasSpansEnabled } from '../utils/hasSpansEnabled.js';\nimport { shouldIgnoreSpan } from '../utils/should-ignore-span.js';\nimport { hasSpanStreamingEnabled } from './spans/hasSpanStreamingEnabled.js';\nimport { parseSampleRate } from '../utils/parseSampleRate.js';\nimport { generateTraceId } from '../utils/propagationContext.js';\nimport { safeMathRandom } from '../utils/randomSafeContext.js';\nimport { _getSpanForScope, _setSpanForScope } from '../utils/spanOnScope.js';\nimport { spanTimeInputToSeconds, getRootSpan, addChildSpanToSpan, spanIsSampled, spanToJSON } from '../utils/spanUtils.js';\nimport { shouldContinueTrace, propagationContextFromHeaders } from '../utils/tracing.js';\nimport { getDynamicSamplingContextFromSpan, freezeDscOnSpan } from './dynamicSamplingContext.js';\nimport { logSpanStart } from './logSpans.js';\nimport { sampleSpan } from './sampling.js';\nimport { spanIsNonRecordingSpan, SentryNonRecordingSpan } from './sentryNonRecordingSpan.js';\nimport { SentrySpan } from './sentrySpan.js';\nimport { SPAN_STATUS_ERROR } from './spanstatus.js';\nimport { setCapturedScopesOnSpan } from './utils.js';\n\nconst SUPPRESS_TRACING_KEY = \"__SENTRY_SUPPRESS_TRACING__\";\nfunction startSpan(options, callback) {\n  const acs = getAcs();\n  if (acs.startSpan) {\n    return acs.startSpan(options, callback);\n  }\n  const spanArguments = parseSentrySpanArguments(options);\n  const { forceTransaction, parentSpan: customParentSpan, scope: customScope } = options;\n  const customForkedScope = customScope?.clone();\n  return withScope(customForkedScope, () => {\n    const wrapper = getActiveSpanWrapper(customParentSpan);\n    return wrapper(() => {\n      const scope = getCurrentScope();\n      const parentSpan = getParentSpan(scope, customParentSpan);\n      const client = getClient();\n      const missingRequiredParent = options.onlyIfParent && !parentSpan;\n      const activeSpan = missingRequiredParent ? startMissingRequiredParentSpan(scope, client) : createChildOrRootSpan({\n        parentSpan,\n        spanArguments,\n        forceTransaction,\n        scope\n      });\n      if (!spanIsIgnored(activeSpan) || !parentSpan) {\n        _setSpanForScope(scope, activeSpan);\n      }\n      return handleCallbackErrors(\n        () => callback(activeSpan),\n        () => {\n          const { status } = spanToJSON(activeSpan);\n          if (activeSpan.isRecording() && (!status || status === \"ok\")) {\n            activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: \"internal_error\" });\n          }\n        },\n        () => {\n          activeSpan.end();\n        }\n      );\n    });\n  });\n}\nfunction startSpanManual(options, callback) {\n  const acs = getAcs();\n  if (acs.startSpanManual) {\n    return acs.startSpanManual(options, callback);\n  }\n  const spanArguments = parseSentrySpanArguments(options);\n  const { forceTransaction, parentSpan: customParentSpan, scope: customScope } = options;\n  const customForkedScope = customScope?.clone();\n  return withScope(customForkedScope, () => {\n    const wrapper = getActiveSpanWrapper(customParentSpan);\n    return wrapper(() => {\n      const scope = getCurrentScope();\n      const parentSpan = getParentSpan(scope, customParentSpan);\n      const missingRequiredParent = options.onlyIfParent && !parentSpan;\n      const activeSpan = missingRequiredParent ? startMissingRequiredParentSpan(scope, getClient()) : createChildOrRootSpan({\n        parentSpan,\n        spanArguments,\n        forceTransaction,\n        scope\n      });\n      if (!spanIsIgnored(activeSpan) || !parentSpan) {\n        _setSpanForScope(scope, activeSpan);\n      }\n      return handleCallbackErrors(\n        // We pass the `finish` function to the callback, so the user can finish the span manually\n        // this is mainly here for historic purposes because previously, we instructed users to call\n        // `finish` instead of `span.end()` to also clean up the scope. Nowadays, calling `span.end()`\n        // or `finish` has the same effect and we simply leave it here to avoid breaking user code.\n        () => callback(activeSpan, () => activeSpan.end()),\n        () => {\n          const { status } = spanToJSON(activeSpan);\n          if (activeSpan.isRecording() && (!status || status === \"ok\")) {\n            activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: \"internal_error\" });\n          }\n        }\n      );\n    });\n  });\n}\nfunction startInactiveSpan(options) {\n  const acs = getAcs();\n  if (acs.startInactiveSpan) {\n    return acs.startInactiveSpan(options);\n  }\n  return _startInactiveSpanImpl(options);\n}\nfunction _INTERNAL_startInactiveSpan(options) {\n  return _startInactiveSpanImpl(options);\n}\nfunction _startInactiveSpanImpl(options) {\n  const spanArguments = parseSentrySpanArguments(options);\n  const { forceTransaction, parentSpan: customParentSpan } = options;\n  const wrapper = options.scope ? (callback) => withScope(options.scope, callback) : customParentSpan !== void 0 ? (callback) => withActiveSpan(customParentSpan, callback) : (callback) => callback();\n  return wrapper(() => {\n    const scope = getCurrentScope();\n    const parentSpan = getParentSpan(scope, customParentSpan);\n    const client = getClient();\n    const missingRequiredParent = options.onlyIfParent && !parentSpan;\n    if (missingRequiredParent) {\n      return startMissingRequiredParentSpan(scope, client);\n    }\n    return createChildOrRootSpan({\n      parentSpan,\n      spanArguments,\n      forceTransaction,\n      scope\n    });\n  });\n}\nconst continueTrace = (options, callback) => {\n  const carrier = getMainCarrier();\n  const acs = getAsyncContextStrategy(carrier);\n  if (acs.continueTrace) {\n    return acs.continueTrace(options, callback);\n  }\n  const { sentryTrace, baggage } = options;\n  const client = getClient();\n  const incomingDsc = baggageHeaderToDynamicSamplingContext(baggage);\n  if (client && !shouldContinueTrace(client, incomingDsc?.org_id)) {\n    return startNewTrace(callback);\n  }\n  return withScope((scope) => {\n    const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);\n    scope.setPropagationContext(propagationContext);\n    _setSpanForScope(scope, void 0);\n    return callback();\n  });\n};\nfunction withActiveSpan(span, callback) {\n  const acs = getAcs();\n  if (acs.withActiveSpan) {\n    return acs.withActiveSpan(span, callback);\n  }\n  return withScope((scope) => {\n    _setSpanForScope(scope, span || void 0);\n    return callback(scope);\n  });\n}\nfunction suppressTracing(callback) {\n  const acs = getAcs();\n  if (acs.suppressTracing) {\n    return acs.suppressTracing(callback);\n  }\n  return withScope((scope) => {\n    scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: true });\n    const res = callback();\n    scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: void 0 });\n    return res;\n  });\n}\nfunction isTracingSuppressed(scope = getCurrentScope()) {\n  const acs = getAcs();\n  if (acs.isTracingSuppressed) {\n    return acs.isTracingSuppressed(scope);\n  }\n  return scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] === true;\n}\nfunction startNewTrace(callback) {\n  const acs = getAcs();\n  if (acs.startNewTrace) {\n    return acs.startNewTrace(callback);\n  }\n  return withScope((scope) => {\n    scope.setPropagationContext({\n      traceId: generateTraceId(),\n      sampleRand: safeMathRandom()\n    });\n    DEBUG_BUILD && debug.log(`Starting a new trace with id ${scope.getPropagationContext().traceId}`);\n    return withActiveSpan(null, callback);\n  });\n}\nfunction startMissingRequiredParentSpan(scope, client) {\n  client?.recordDroppedEvent(\"no_parent_span\", \"span\");\n  const span = new SentryNonRecordingSpan({ traceId: scope.getPropagationContext().traceId });\n  setCapturedScopesOnSpan(span, scope, getIsolationScope());\n  return span;\n}\nfunction createChildOrRootSpan({\n  parentSpan,\n  spanArguments,\n  forceTransaction,\n  scope\n}) {\n  const isolationScope = getIsolationScope();\n  if (!hasSpansEnabled()) {\n    const scopePropagationContext = scope.getPropagationContext();\n    const traceId = parentSpan ? parentSpan.spanContext().traceId : scopePropagationContext.traceId;\n    const span2 = new SentryNonRecordingSpan({ traceId });\n    if (parentSpan && !forceTransaction) {\n      addChildSpanToSpan(parentSpan, span2);\n    }\n    setCapturedScopesOnSpan(span2, scope, isolationScope);\n    return span2;\n  }\n  const client = getClient();\n  if (_shouldIgnoreStreamedSpan(client, spanArguments)) {\n    if (!isTracingSuppressed(scope)) {\n      client?.recordDroppedEvent(\"ignored\", \"span\");\n    }\n    const ignoredSpan = new SentryNonRecordingSpan({\n      dropReason: \"ignored\",\n      traceId: parentSpan?.spanContext().traceId ?? scope.getPropagationContext().traceId\n    });\n    if (parentSpan && !forceTransaction) {\n      addChildSpanToSpan(parentSpan, ignoredSpan);\n    }\n    setCapturedScopesOnSpan(ignoredSpan, scope, isolationScope);\n    return ignoredSpan;\n  }\n  let span;\n  if (parentSpan && !forceTransaction) {\n    span = _startChildSpan(parentSpan, scope, spanArguments, isolationScope);\n    addChildSpanToSpan(parentSpan, span);\n  } else if (parentSpan) {\n    const dsc = getDynamicSamplingContextFromSpan(parentSpan);\n    const { traceId, spanId: parentSpanId } = parentSpan.spanContext();\n    const parentSampled = spanIsSampled(parentSpan);\n    span = _startRootSpan(\n      {\n        traceId,\n        parentSpanId,\n        ...spanArguments\n      },\n      scope,\n      isolationScope,\n      parentSampled\n    );\n    freezeDscOnSpan(span, dsc);\n  } else {\n    const { traceId, dsc, parentSpanId, sampled: parentSampled } = scope.getPropagationContext();\n    span = _startRootSpan(\n      {\n        traceId,\n        parentSpanId,\n        ...spanArguments\n      },\n      scope,\n      isolationScope,\n      parentSampled\n    );\n    if (dsc) {\n      freezeDscOnSpan(span, dsc);\n    }\n  }\n  logSpanStart(span);\n  return span;\n}\nfunction parseSentrySpanArguments(options) {\n  const exp = options.experimental || {};\n  const initialCtx = {\n    isStandalone: exp.standalone,\n    ...options\n  };\n  if (options.startTime) {\n    const ctx = { ...initialCtx };\n    ctx.startTimestamp = spanTimeInputToSeconds(options.startTime);\n    delete ctx.startTime;\n    return ctx;\n  }\n  return initialCtx;\n}\nfunction getAcs() {\n  const carrier = getMainCarrier();\n  return getAsyncContextStrategy(carrier);\n}\nfunction _startRootSpan(spanArguments, scope, isolationScope, parentSampled) {\n  const client = getClient();\n  const options = client?.getOptions() || {};\n  const { name = \"\" } = spanArguments;\n  const mutableSpanSamplingData = { spanAttributes: { ...spanArguments.attributes }, spanName: name, parentSampled };\n  client?.emit(\"beforeSampling\", mutableSpanSamplingData, { decision: false });\n  const finalParentSampled = mutableSpanSamplingData.parentSampled ?? parentSampled;\n  const finalAttributes = mutableSpanSamplingData.spanAttributes;\n  const currentPropagationContext = scope.getPropagationContext();\n  const _isTracingSuppressed = isTracingSuppressed(scope);\n  const [sampled, sampleRate, localSampleRateWasApplied] = _isTracingSuppressed ? [false] : sampleSpan(\n    options,\n    {\n      name,\n      parentSampled: finalParentSampled,\n      attributes: finalAttributes,\n      normalizedRequest: isolationScope.getScopeData().sdkProcessingMetadata.normalizedRequest,\n      parentSampleRate: parseSampleRate(currentPropagationContext.dsc?.sample_rate)\n    },\n    currentPropagationContext.sampleRand\n  );\n  const rootSpan = new SentrySpan({\n    ...spanArguments,\n    attributes: {\n      [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: \"custom\",\n      [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: sampleRate !== void 0 && localSampleRateWasApplied ? sampleRate : void 0,\n      ...finalAttributes\n    },\n    sampled\n  });\n  if (!sampled && client && !_isTracingSuppressed) {\n    DEBUG_BUILD && debug.log(\"[Tracing] Discarding root span because its trace was not chosen to be sampled.\");\n    client.recordDroppedEvent(\"sample_rate\", hasSpanStreamingEnabled(client) ? \"span\" : \"transaction\");\n  }\n  setCapturedScopesOnSpan(rootSpan, scope, isolationScope);\n  if (client) {\n    client.emit(\"spanStart\", rootSpan);\n  }\n  return rootSpan;\n}\nfunction _startChildSpan(parentSpan, scope, spanArguments, isolationScope) {\n  const { spanId, traceId } = parentSpan.spanContext();\n  const _isTracingSuppressed = isTracingSuppressed(scope);\n  const sampled = _isTracingSuppressed ? false : spanIsSampled(parentSpan);\n  const childSpan = sampled ? new SentrySpan({\n    ...spanArguments,\n    parentSpanId: spanId,\n    traceId,\n    sampled\n  }) : new SentryNonRecordingSpan({ traceId });\n  addChildSpanToSpan(parentSpan, childSpan);\n  setCapturedScopesOnSpan(childSpan, scope, isolationScope);\n  const client = getClient();\n  if (!client) {\n    return childSpan;\n  }\n  if (hasSpanStreamingEnabled(client) && spanIsNonRecordingSpan(childSpan)) {\n    if (spanIsNonRecordingSpan(parentSpan) && parentSpan.dropReason) {\n      childSpan.dropReason = parentSpan.dropReason;\n      client.recordDroppedEvent(parentSpan.dropReason, \"span\");\n    } else if (!_isTracingSuppressed) {\n      childSpan.dropReason = \"sample_rate\";\n      client.recordDroppedEvent(\"sample_rate\", \"span\");\n    }\n  }\n  client.emit(\"spanStart\", childSpan);\n  if (spanArguments.endTimestamp) {\n    client.emit(\"spanEnd\", childSpan);\n    client.emit(\"afterSpanEnd\", childSpan);\n  }\n  return childSpan;\n}\nfunction getParentSpan(scope, customParentSpan) {\n  if (customParentSpan) {\n    return customParentSpan;\n  }\n  if (customParentSpan === null) {\n    return void 0;\n  }\n  const span = _getSpanForScope(scope);\n  if (!span) {\n    return void 0;\n  }\n  const client = getClient();\n  const options = client ? client.getOptions() : {};\n  if (options.parentSpanIsAlwaysRootSpan) {\n    return getRootSpan(span);\n  }\n  return span;\n}\nfunction getActiveSpanWrapper(parentSpan) {\n  return parentSpan !== void 0 ? (callback) => {\n    return withActiveSpan(parentSpan, callback);\n  } : (callback) => callback();\n}\nfunction _shouldIgnoreStreamedSpan(client, spanArguments) {\n  const ignoreSpans = client?.getOptions().ignoreSpans;\n  if (!client || !hasSpanStreamingEnabled(client) || !ignoreSpans?.length) {\n    return false;\n  }\n  return shouldIgnoreSpan(\n    {\n      description: spanArguments.name || \"\",\n      op: spanArguments.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] || spanArguments.op,\n      attributes: spanArguments.attributes\n    },\n    ignoreSpans\n  );\n}\nfunction spanIsIgnored(span) {\n  return spanIsNonRecordingSpan(span) && span.dropReason === \"ignored\";\n}\n\nexport { SUPPRESS_TRACING_KEY, _INTERNAL_startInactiveSpan, continueTrace, isTracingSuppressed, spanIsIgnored, startInactiveSpan, startNewTrace, startSpan, startSpanManual, suppressTracing, withActiveSpan };\n//# sourceMappingURL=trace.js.map\n","import { getGlobalScope } from '../currentScopes.js';\nimport { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext.js';\nimport { merge } from './merge.js';\nimport { spanToTraceContext, getRootSpan, spanToJSON } from './spanUtils.js';\n\nfunction applyScopeDataToEvent(event, data) {\n  const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data;\n  applyDataToEvent(event, data);\n  if (span) {\n    applySpanToEvent(event, span);\n  }\n  applyFingerprintToEvent(event, fingerprint);\n  applyBreadcrumbsToEvent(event, breadcrumbs);\n  applySdkMetadataToEvent(event, sdkProcessingMetadata);\n}\nfunction mergeScopeData(data, mergeData) {\n  const {\n    extra,\n    tags,\n    attributes,\n    user,\n    contexts,\n    level,\n    sdkProcessingMetadata,\n    breadcrumbs,\n    fingerprint,\n    eventProcessors,\n    attachments,\n    propagationContext,\n    transactionName,\n    span\n  } = mergeData;\n  mergeAndOverwriteScopeData(data, \"extra\", extra);\n  mergeAndOverwriteScopeData(data, \"tags\", tags);\n  mergeAndOverwriteScopeData(data, \"attributes\", attributes);\n  mergeAndOverwriteScopeData(data, \"user\", user);\n  mergeAndOverwriteScopeData(data, \"contexts\", contexts);\n  data.sdkProcessingMetadata = merge(data.sdkProcessingMetadata, sdkProcessingMetadata, 2);\n  if (level) {\n    data.level = level;\n  }\n  if (transactionName) {\n    data.transactionName = transactionName;\n  }\n  if (span) {\n    data.span = span;\n  }\n  if (breadcrumbs.length) {\n    data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs];\n  }\n  if (fingerprint.length) {\n    data.fingerprint = [...data.fingerprint, ...fingerprint];\n  }\n  if (eventProcessors.length) {\n    data.eventProcessors = [...data.eventProcessors, ...eventProcessors];\n  }\n  if (attachments.length) {\n    data.attachments = [...data.attachments, ...attachments];\n  }\n  data.propagationContext = { ...data.propagationContext, ...propagationContext };\n}\nfunction mergeAndOverwriteScopeData(data, prop, mergeVal) {\n  data[prop] = merge(data[prop], mergeVal, 1);\n}\nfunction getCombinedScopeData(isolationScope, currentScope) {\n  const scopeData = getGlobalScope().getScopeData();\n  isolationScope && mergeScopeData(scopeData, isolationScope.getScopeData());\n  currentScope && mergeScopeData(scopeData, currentScope.getScopeData());\n  return scopeData;\n}\nfunction applyDataToEvent(event, data) {\n  const { extra, tags, user, contexts, level, transactionName } = data;\n  if (Object.keys(extra).length) {\n    event.extra = { ...extra, ...event.extra };\n  }\n  if (Object.keys(tags).length) {\n    event.tags = { ...tags, ...event.tags };\n  }\n  if (Object.keys(user).length) {\n    event.user = { ...user, ...event.user };\n  }\n  if (Object.keys(contexts).length) {\n    event.contexts = { ...contexts, ...event.contexts };\n  }\n  if (level) {\n    event.level = level;\n  }\n  if (transactionName && event.type !== \"transaction\") {\n    event.transaction = transactionName;\n  }\n}\nfunction applyBreadcrumbsToEvent(event, breadcrumbs) {\n  const mergedBreadcrumbs = [...event.breadcrumbs || [], ...breadcrumbs];\n  event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : void 0;\n}\nfunction applySdkMetadataToEvent(event, sdkProcessingMetadata) {\n  event.sdkProcessingMetadata = {\n    ...event.sdkProcessingMetadata,\n    ...sdkProcessingMetadata\n  };\n}\nfunction applySpanToEvent(event, span) {\n  event.contexts = {\n    trace: spanToTraceContext(span),\n    ...event.contexts\n  };\n  event.sdkProcessingMetadata = {\n    dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),\n    ...event.sdkProcessingMetadata\n  };\n  const rootSpan = getRootSpan(span);\n  const transactionName = spanToJSON(rootSpan).description;\n  if (transactionName && !event.transaction && event.type === \"transaction\") {\n    event.transaction = transactionName;\n  }\n}\nfunction applyFingerprintToEvent(event, fingerprint) {\n  event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint] : [];\n  if (fingerprint) {\n    event.fingerprint = event.fingerprint.concat(fingerprint);\n  }\n  if (!event.fingerprint.length) {\n    delete event.fingerprint;\n  }\n}\n\nexport { applyScopeDataToEvent, getCombinedScopeData, mergeAndOverwriteScopeData, mergeScopeData };\n//# sourceMappingURL=scopeData.js.map\n","import { isThenable } from './is.js';\n\nconst STATE_PENDING = 0;\nconst STATE_RESOLVED = 1;\nconst STATE_REJECTED = 2;\nfunction resolvedSyncPromise(value) {\n  return new SyncPromise((resolve) => {\n    resolve(value);\n  });\n}\nfunction rejectedSyncPromise(reason) {\n  return new SyncPromise((_, reject) => {\n    reject(reason);\n  });\n}\nclass SyncPromise {\n  constructor(executor) {\n    this._state = STATE_PENDING;\n    this._handlers = [];\n    this._runExecutor(executor);\n  }\n  /** @inheritdoc */\n  then(onfulfilled, onrejected) {\n    return new SyncPromise((resolve, reject) => {\n      this._handlers.push([\n        false,\n        (result) => {\n          if (!onfulfilled) {\n            resolve(result);\n          } else {\n            try {\n              resolve(onfulfilled(result));\n            } catch (e) {\n              reject(e);\n            }\n          }\n        },\n        (reason) => {\n          if (!onrejected) {\n            reject(reason);\n          } else {\n            try {\n              resolve(onrejected(reason));\n            } catch (e) {\n              reject(e);\n            }\n          }\n        }\n      ]);\n      this._executeHandlers();\n    });\n  }\n  /** @inheritdoc */\n  catch(onrejected) {\n    return this.then((val) => val, onrejected);\n  }\n  /** @inheritdoc */\n  finally(onfinally) {\n    return new SyncPromise((resolve, reject) => {\n      let val;\n      let isRejected;\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        resolve(val);\n      });\n    });\n  }\n  /** Excute the resolve/reject handlers. */\n  _executeHandlers() {\n    if (this._state === STATE_PENDING) {\n      return;\n    }\n    const cachedHandlers = this._handlers.slice();\n    this._handlers = [];\n    cachedHandlers.forEach((handler) => {\n      if (handler[0]) {\n        return;\n      }\n      if (this._state === STATE_RESOLVED) {\n        handler[1](this._value);\n      }\n      if (this._state === STATE_REJECTED) {\n        handler[2](this._value);\n      }\n      handler[0] = true;\n    });\n  }\n  /** Run the executor for the SyncPromise. */\n  _runExecutor(executor) {\n    const setResult = (state, value) => {\n      if (this._state !== STATE_PENDING) {\n        return;\n      }\n      if (isThenable(value)) {\n        void value.then(resolve, reject);\n        return;\n      }\n      this._state = state;\n      this._value = value;\n      this._executeHandlers();\n    };\n    const resolve = (value) => {\n      setResult(STATE_RESOLVED, value);\n    };\n    const reject = (reason) => {\n      setResult(STATE_REJECTED, reason);\n    };\n    try {\n      executor(resolve, reject);\n    } catch (e) {\n      reject(e);\n    }\n  }\n}\n\nexport { SyncPromise, rejectedSyncPromise, resolvedSyncPromise };\n//# sourceMappingURL=syncpromise.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { debug } from './utils/debug-logger.js';\nimport { isThenable } from './utils/is.js';\nimport { resolvedSyncPromise, rejectedSyncPromise } from './utils/syncpromise.js';\n\nfunction notifyEventProcessors(processors, event, hint, index = 0) {\n  try {\n    const result = _notifyEventProcessors(event, hint, processors, index);\n    return isThenable(result) ? result : resolvedSyncPromise(result);\n  } catch (error) {\n    return rejectedSyncPromise(error);\n  }\n}\nfunction _notifyEventProcessors(event, hint, processors, index) {\n  const processor = processors[index];\n  if (!event || !processor) {\n    return event;\n  }\n  const result = processor({ ...event }, hint);\n  DEBUG_BUILD && result === null && debug.log(`Event processor \"${processor.id || \"?\"}\" dropped event`);\n  if (isThenable(result)) {\n    return result.then((final) => _notifyEventProcessors(final, hint, processors, index + 1));\n  }\n  return _notifyEventProcessors(result, hint, processors, index + 1);\n}\n\nexport { notifyEventProcessors };\n//# sourceMappingURL=eventProcessors.js.map\n","import { normalizeStackTracePath } from './stacktrace.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nlet parsedStackResults;\nlet lastSentryKeysCount;\nlet lastNativeKeysCount;\nlet cachedFilenameDebugIds;\nfunction getFilenameToDebugIdMap(stackParser) {\n  const sentryDebugIdMap = GLOBAL_OBJ._sentryDebugIds;\n  const nativeDebugIdMap = GLOBAL_OBJ._debugIds;\n  if (!sentryDebugIdMap && !nativeDebugIdMap) {\n    return {};\n  }\n  const sentryDebugIdKeys = sentryDebugIdMap ? Object.keys(sentryDebugIdMap) : [];\n  const nativeDebugIdKeys = nativeDebugIdMap ? Object.keys(nativeDebugIdMap) : [];\n  if (cachedFilenameDebugIds && sentryDebugIdKeys.length === lastSentryKeysCount && nativeDebugIdKeys.length === lastNativeKeysCount) {\n    return cachedFilenameDebugIds;\n  }\n  lastSentryKeysCount = sentryDebugIdKeys.length;\n  lastNativeKeysCount = nativeDebugIdKeys.length;\n  cachedFilenameDebugIds = {};\n  if (!parsedStackResults) {\n    parsedStackResults = {};\n  }\n  const processDebugIds = (debugIdKeys, debugIdMap) => {\n    for (const key of debugIdKeys) {\n      const debugId = debugIdMap[key];\n      const result = parsedStackResults?.[key];\n      if (result && cachedFilenameDebugIds && debugId) {\n        cachedFilenameDebugIds[result[0]] = debugId;\n        if (parsedStackResults) {\n          parsedStackResults[key] = [result[0], debugId];\n        }\n      } else if (debugId) {\n        const parsedStack = stackParser(key);\n        for (let i = parsedStack.length - 1; i >= 0; i--) {\n          const stackFrame = parsedStack[i];\n          const filename = stackFrame?.filename;\n          if (filename && cachedFilenameDebugIds && parsedStackResults) {\n            cachedFilenameDebugIds[filename] = debugId;\n            parsedStackResults[key] = [filename, debugId];\n            break;\n          }\n        }\n      }\n    }\n  };\n  if (sentryDebugIdMap) {\n    processDebugIds(sentryDebugIdKeys, sentryDebugIdMap);\n  }\n  if (nativeDebugIdMap) {\n    processDebugIds(nativeDebugIdKeys, nativeDebugIdMap);\n  }\n  return cachedFilenameDebugIds;\n}\nfunction getDebugImagesForResources(stackParser, resource_paths) {\n  const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser);\n  if (!filenameDebugIdMap) {\n    return [];\n  }\n  const images = [];\n  for (const path of resource_paths) {\n    const normalizedPath = normalizeStackTracePath(path);\n    if (normalizedPath && filenameDebugIdMap[normalizedPath]) {\n      images.push({\n        type: \"sourcemap\",\n        code_file: path,\n        debug_id: filenameDebugIdMap[normalizedPath]\n      });\n    }\n  }\n  return images;\n}\n\nexport { getDebugImagesForResources, getFilenameToDebugIdMap };\n//# sourceMappingURL=debug-ids.js.map\n","import { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { notifyEventProcessors } from '../eventProcessors.js';\nimport { Scope } from '../scope.js';\nimport { getFilenameToDebugIdMap } from './debug-ids.js';\nimport { uuid4, addExceptionMechanism } from './misc.js';\nimport { normalize } from './normalize.js';\nimport { getCombinedScopeData, applyScopeDataToEvent } from './scopeData.js';\nimport { truncate } from './string.js';\nimport { resolvedSyncPromise } from './syncpromise.js';\nimport { dateTimestampInSeconds } from './time.js';\n\nfunction prepareEvent(options, event, hint, scope, client, isolationScope) {\n  const { normalizeDepth = 3, normalizeMaxBreadth = 1e3 } = options;\n  const prepared = {\n    ...event,\n    event_id: event.event_id || hint.event_id || uuid4(),\n    timestamp: event.timestamp || dateTimestampInSeconds()\n  };\n  const integrations = hint.integrations || options.integrations.map((i) => i.name);\n  applyClientOptions(prepared, options);\n  applyIntegrationsMetadata(prepared, integrations);\n  if (client) {\n    client.emit(\"applyFrameMetadata\", event);\n  }\n  if (event.type === void 0) {\n    applyDebugIds(prepared, options.stackParser);\n  }\n  const finalScope = getFinalScope(scope, hint.captureContext);\n  if (hint.mechanism) {\n    addExceptionMechanism(prepared, hint.mechanism);\n  }\n  const clientEventProcessors = client ? client.getEventProcessors() : [];\n  const data = getCombinedScopeData(isolationScope, finalScope);\n  const attachments = [...hint.attachments || [], ...data.attachments];\n  if (attachments.length) {\n    hint.attachments = attachments;\n  }\n  applyScopeDataToEvent(prepared, data);\n  const eventProcessors = [\n    ...clientEventProcessors,\n    // Run scope event processors _after_ all other processors\n    ...data.eventProcessors\n  ];\n  const isInternalException = hint.data && hint.data.__sentry__ === true;\n  const result = isInternalException ? resolvedSyncPromise(prepared) : notifyEventProcessors(eventProcessors, prepared, hint);\n  return result.then((evt) => {\n    if (evt) {\n      applyDebugMeta(evt);\n    }\n    if (typeof normalizeDepth === \"number\" && normalizeDepth > 0) {\n      return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n    }\n    return evt;\n  });\n}\nfunction applyClientOptions(event, options) {\n  const { environment, release, dist, maxValueLength } = options;\n  event.environment = event.environment || environment || DEFAULT_ENVIRONMENT;\n  if (!event.release && release) {\n    event.release = release;\n  }\n  if (!event.dist && dist) {\n    event.dist = dist;\n  }\n  const request = event.request;\n  if (request?.url && maxValueLength) {\n    request.url = truncate(request.url, maxValueLength);\n  }\n  if (maxValueLength) {\n    event.exception?.values?.forEach((exception) => {\n      if (exception.value) {\n        exception.value = truncate(exception.value, maxValueLength);\n      }\n    });\n  }\n}\nfunction applyDebugIds(event, stackParser) {\n  const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser);\n  event.exception?.values?.forEach((exception) => {\n    exception.stacktrace?.frames?.forEach((frame) => {\n      if (frame.filename) {\n        frame.debug_id = filenameDebugIdMap[frame.filename];\n      }\n    });\n  });\n}\nfunction applyDebugMeta(event) {\n  const filenameDebugIdMap = {};\n  event.exception?.values?.forEach((exception) => {\n    exception.stacktrace?.frames?.forEach((frame) => {\n      if (frame.debug_id) {\n        if (frame.abs_path) {\n          filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n        } else if (frame.filename) {\n          filenameDebugIdMap[frame.filename] = frame.debug_id;\n        }\n        delete frame.debug_id;\n      }\n    });\n  });\n  if (Object.keys(filenameDebugIdMap).length === 0) {\n    return;\n  }\n  event.debug_meta = event.debug_meta || {};\n  event.debug_meta.images = event.debug_meta.images || [];\n  const images = event.debug_meta.images;\n  Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => {\n    images.push({\n      type: \"sourcemap\",\n      code_file: filename,\n      debug_id\n    });\n  });\n}\nfunction applyIntegrationsMetadata(event, integrationNames) {\n  if (integrationNames.length > 0) {\n    event.sdk = event.sdk || {};\n    event.sdk.integrations = [...event.sdk.integrations || [], ...integrationNames];\n  }\n}\nfunction normalizeEvent(event, depth, maxBreadth) {\n  if (!event) {\n    return null;\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, maxBreadth)\n        }\n      }))\n    },\n    ...event.user && {\n      user: normalize(event.user, depth, maxBreadth)\n    },\n    ...event.contexts && {\n      contexts: normalize(event.contexts, depth, maxBreadth)\n    },\n    ...event.extra && {\n      extra: normalize(event.extra, depth, maxBreadth)\n    }\n  };\n  if (event.contexts?.trace && normalized.contexts) {\n    normalized.contexts.trace = event.contexts.trace;\n    if (event.contexts.trace.data) {\n      normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n    }\n  }\n  if (event.spans) {\n    normalized.spans = event.spans.map((span) => {\n      return {\n        ...span,\n        ...span.data && {\n          data: normalize(span.data, depth, maxBreadth)\n        }\n      };\n    });\n  }\n  if (event.contexts?.flags && normalized.contexts) {\n    normalized.contexts.flags = normalize(event.contexts.flags, 3, maxBreadth);\n  }\n  return normalized;\n}\nfunction getFinalScope(scope, captureContext) {\n  if (!captureContext) {\n    return scope;\n  }\n  const finalScope = scope ? scope.clone() : new Scope();\n  finalScope.update(captureContext);\n  return finalScope;\n}\nfunction parseEventHintOrCaptureContext(hint) {\n  if (!hint) {\n    return void 0;\n  }\n  if (hintIsScopeOrFunction(hint)) {\n    return { captureContext: hint };\n  }\n  if (hintIsScopeContext(hint)) {\n    return {\n      captureContext: hint\n    };\n  }\n  return hint;\n}\nfunction hintIsScopeOrFunction(hint) {\n  return hint instanceof Scope || typeof hint === \"function\";\n}\nconst captureContextKeys = [\n  \"user\",\n  \"level\",\n  \"extra\",\n  \"contexts\",\n  \"tags\",\n  \"fingerprint\",\n  \"propagationContext\"\n];\nfunction hintIsScopeContext(hint) {\n  return Object.keys(hint).some((key) => captureContextKeys.includes(key));\n}\n\nexport { applyClientOptions, applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext, prepareEvent };\n//# sourceMappingURL=prepareEvent.js.map\n","import { getIsolationScope, getCurrentScope, getClient } from './currentScopes.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { closeSession, makeSession, updateSession } from './session.js';\nimport { debug } from './utils/debug-logger.js';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent.js';\nimport { getCombinedScopeData } from './utils/scopeData.js';\nimport { GLOBAL_OBJ } from './utils/worldwide.js';\n\nfunction captureException(exception, hint) {\n  return getCurrentScope().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\nfunction captureMessage(message, captureContext) {\n  const level = typeof captureContext === \"string\" ? captureContext : void 0;\n  const hint = typeof captureContext !== \"string\" ? { captureContext } : void 0;\n  return getCurrentScope().captureMessage(message, level, hint);\n}\nfunction captureEvent(event, hint) {\n  return getCurrentScope().captureEvent(event, hint);\n}\nfunction setContext(name, context) {\n  getIsolationScope().setContext(name, context);\n}\nfunction setExtras(extras) {\n  getIsolationScope().setExtras(extras);\n}\nfunction setExtra(key, extra) {\n  getIsolationScope().setExtra(key, extra);\n}\nfunction setTags(tags) {\n  getIsolationScope().setTags(tags);\n}\nfunction setTag(key, value) {\n  getIsolationScope().setTag(key, value);\n}\nfunction setAttributes(attributes) {\n  getIsolationScope().setAttributes(attributes);\n}\nfunction setAttribute(key, value) {\n  getIsolationScope().setAttribute(key, value);\n}\nfunction setUser(user) {\n  getIsolationScope().setUser(user);\n}\nfunction setConversationId(conversationId) {\n  getIsolationScope().setConversationId(conversationId);\n}\nfunction lastEventId() {\n  return getIsolationScope().lastEventId();\n}\nasync function flush(timeout) {\n  const client = getClient();\n  if (client) {\n    return client.flush(timeout);\n  }\n  DEBUG_BUILD && debug.warn(\"Cannot flush events. No client defined.\");\n  return Promise.resolve(false);\n}\nasync function close(timeout) {\n  const client = getClient();\n  if (client) {\n    return client.close(timeout);\n  }\n  DEBUG_BUILD && debug.warn(\"Cannot flush events and disable SDK. No client defined.\");\n  return Promise.resolve(false);\n}\nfunction isInitialized() {\n  return !!getClient();\n}\nfunction isEnabled() {\n  const client = getClient();\n  return client?.getOptions().enabled !== false && !!client?.getTransport();\n}\nfunction addEventProcessor(callback) {\n  getIsolationScope().addEventProcessor(callback);\n}\nfunction startSession(context) {\n  const isolationScope = getIsolationScope();\n  const { user } = getCombinedScopeData(isolationScope, getCurrentScope());\n  const { userAgent } = GLOBAL_OBJ.navigator || {};\n  const session = makeSession({\n    user,\n    ...userAgent && { userAgent },\n    ...context\n  });\n  const currentSession = isolationScope.getSession();\n  if (currentSession?.status === \"ok\") {\n    updateSession(currentSession, { status: \"exited\" });\n  }\n  endSession();\n  isolationScope.setSession(session);\n  return session;\n}\nfunction endSession() {\n  const isolationScope = getIsolationScope();\n  const currentScope = getCurrentScope();\n  const session = currentScope.getSession() || isolationScope.getSession();\n  if (session) {\n    closeSession(session);\n  }\n  _sendSessionUpdate();\n  isolationScope.setSession();\n}\nfunction _sendSessionUpdate() {\n  const isolationScope = getIsolationScope();\n  const client = getClient();\n  const session = isolationScope.getSession();\n  if (session && client) {\n    client.captureSession(session);\n  }\n}\nfunction captureSession(end = false) {\n  if (end) {\n    endSession();\n    return;\n  }\n  _sendSessionUpdate();\n}\n\nexport { addEventProcessor, captureEvent, captureException, captureMessage, captureSession, close, endSession, flush, isEnabled, isInitialized, lastEventId, setAttribute, setAttributes, setContext, setConversationId, setExtra, setExtras, setTag, setTags, setUser, startSession };\n//# sourceMappingURL=exports.js.map\n","function safeUnref(timer) {\n  if (typeof timer === \"object\" && typeof timer.unref === \"function\") {\n    timer.unref();\n  }\n  return timer;\n}\n\nexport { safeUnref };\n//# sourceMappingURL=timer.js.map\n","import { makeDsn, dsnToString } from './utils/dsn.js';\n\nconst SENTRY_API_VERSION = \"7\";\nfunction getBaseApiEndpoint(dsn) {\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}\nfunction _getIngestEndpoint(dsn) {\n  return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\nfunction _encodedAuth(dsn, sdkInfo) {\n  const params = {\n    sentry_version: SENTRY_API_VERSION\n  };\n  if (dsn.publicKey) {\n    params.sentry_key = dsn.publicKey;\n  }\n  if (sdkInfo) {\n    params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`;\n  }\n  return new URLSearchParams(params).toString();\n}\nfunction getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) {\n  return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\nfunction getReportDialogEndpoint(dsnLike, dialogOptions) {\n  const dsn = makeDsn(dsnLike);\n  if (!dsn) {\n    return \"\";\n  }\n  const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n  let encodedOptions = `dsn=${dsnToString(dsn)}`;\n  for (const key in dialogOptions) {\n    if (key === \"dsn\") {\n      continue;\n    }\n    if (key === \"onClose\") {\n      continue;\n    }\n    if (key === \"user\") {\n      const user = dialogOptions.user;\n      if (!user) {\n        continue;\n      }\n      if (user.name) {\n        encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n      }\n      if (user.email) {\n        encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n      }\n    } else {\n      encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key])}`;\n    }\n  }\n  return `${endpoint}?${encodedOptions}`;\n}\n\nexport { SENTRY_API_VERSION, getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint };\n//# sourceMappingURL=api.js.map\n","import { getClient } from './currentScopes.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { debug } from './utils/debug-logger.js';\n\nconst installedIntegrations = [];\nfunction filterDuplicates(integrations) {\n  const integrationsByName = {};\n  integrations.forEach((currentInstance) => {\n    const { name } = currentInstance;\n    const existingInstance = integrationsByName[name];\n    if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n      return;\n    }\n    integrationsByName[name] = currentInstance;\n  });\n  return Object.values(integrationsByName);\n}\nfunction getIntegrationsToSetup(options) {\n  const defaultIntegrations = options.defaultIntegrations || [];\n  const userIntegrations = options.integrations;\n  defaultIntegrations.forEach((integration) => {\n    integration.isDefaultInstance = true;\n  });\n  let integrations;\n  if (Array.isArray(userIntegrations)) {\n    integrations = [...defaultIntegrations, ...userIntegrations];\n  } else if (typeof userIntegrations === \"function\") {\n    const resolvedUserIntegrations = userIntegrations(defaultIntegrations);\n    integrations = Array.isArray(resolvedUserIntegrations) ? resolvedUserIntegrations : [resolvedUserIntegrations];\n  } else {\n    integrations = defaultIntegrations;\n  }\n  return filterDuplicates(integrations);\n}\nfunction setupIntegrations(client, integrations) {\n  const integrationIndex = {};\n  integrations.forEach((integration) => {\n    if (integration?.beforeSetup) {\n      integration.beforeSetup(client);\n    }\n  });\n  integrations.forEach((integration) => {\n    if (integration) {\n      setupIntegration(client, integration, integrationIndex);\n    }\n  });\n  return integrationIndex;\n}\nfunction afterSetupIntegrations(client, integrations) {\n  for (const integration of integrations) {\n    if (integration?.afterAllSetup) {\n      integration.afterAllSetup(client);\n    }\n  }\n}\nfunction setupIntegration(client, integration, integrationIndex) {\n  if (integrationIndex[integration.name]) {\n    DEBUG_BUILD && debug.log(`Integration skipped because it was already installed: ${integration.name}`);\n    return;\n  }\n  integrationIndex[integration.name] = integration;\n  if (!installedIntegrations.includes(integration.name) && typeof integration.setupOnce === \"function\") {\n    integration.setupOnce();\n    installedIntegrations.push(integration.name);\n  }\n  if (integration.setup && typeof integration.setup === \"function\") {\n    integration.setup(client);\n  }\n  if (typeof integration.preprocessEvent === \"function\") {\n    const callback = integration.preprocessEvent.bind(integration);\n    client.on(\"preprocessEvent\", (event, hint) => callback(event, hint, client));\n  }\n  if (typeof integration.processEvent === \"function\") {\n    const callback = integration.processEvent.bind(integration);\n    const processor = Object.assign((event, hint) => callback(event, hint, client), {\n      id: integration.name\n    });\n    client.addEventProcessor(processor);\n  }\n  [\"processSpan\", \"processSegmentSpan\"].forEach((hook) => {\n    const callback = integration[hook];\n    if (typeof callback === \"function\") {\n      client.on(hook, (span) => callback.call(integration, span, client));\n    }\n  });\n  DEBUG_BUILD && debug.log(`Integration installed: ${integration.name}`);\n}\nfunction addIntegration(integration) {\n  const client = getClient();\n  if (!client) {\n    DEBUG_BUILD && debug.warn(`Cannot add integration \"${integration.name}\" because no SDK Client is available.`);\n    return;\n  }\n  client.addIntegration(integration);\n}\nfunction defineIntegration(fn) {\n  return fn;\n}\nfunction extendIntegration(integration, extendedIntegration) {\n  const wrappedIntegration = {\n    ...integration,\n    ...extendedIntegration\n  };\n  for (const key in extendedIntegration) {\n    const baseValue = integration[key];\n    const extendedValue = extendedIntegration[key];\n    if (typeof baseValue === \"function\" && typeof extendedValue === \"function\") {\n      const wrappedFunction = new Proxy(baseValue, {\n        apply: (target, thisArg, args) => {\n          Reflect.apply(target, thisArg, args);\n          return Reflect.apply(extendedValue, thisArg, args);\n        }\n      });\n      wrappedIntegration[key] = wrappedFunction;\n    }\n  }\n  return wrappedIntegration;\n}\n\nexport { addIntegration, afterSetupIntegrations, defineIntegration, extendIntegration, getIntegrationsToSetup, installedIntegrations, setupIntegration, setupIntegrations };\n//# sourceMappingURL=integration.js.map\n","const SEQUENCE_ATTR_KEY = \"sentry.timestamp.sequence\";\nlet _sequenceNumber = 0;\nlet _previousTimestampMs;\nfunction getSequenceAttribute(timestampInSeconds) {\n  const nowMs = Math.floor(timestampInSeconds * 1e3);\n  if (_previousTimestampMs !== void 0 && nowMs !== _previousTimestampMs) {\n    _sequenceNumber = 0;\n  }\n  const value = _sequenceNumber;\n  _sequenceNumber++;\n  _previousTimestampMs = nowMs;\n  return {\n    key: SEQUENCE_ATTR_KEY,\n    value: { value, type: \"integer\" }\n  };\n}\n\nexport { getSequenceAttribute };\n//# sourceMappingURL=timestampSequence.js.map\n","import { withScope, getTraceContextFromScope } from '../currentScopes.js';\nimport { getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromScope } from '../tracing/dynamicSamplingContext.js';\nimport { getActiveSpan, spanToTraceContext } from './spanUtils.js';\n\nfunction _getTraceInfoFromScope(client, scope) {\n  if (!scope) {\n    return [void 0, void 0];\n  }\n  return withScope(scope, () => {\n    const span = getActiveSpan();\n    const traceContext = span ? spanToTraceContext(span) : getTraceContextFromScope(scope);\n    const dynamicSamplingContext = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(client, scope);\n    return [dynamicSamplingContext, traceContext];\n  });\n}\n\nexport { _getTraceInfoFromScope };\n//# sourceMappingURL=trace-info.js.map\n","const SEVERITY_TEXT_TO_SEVERITY_NUMBER = {\n  trace: 1,\n  debug: 5,\n  info: 9,\n  warn: 13,\n  error: 17,\n  fatal: 21\n};\n\nexport { SEVERITY_TEXT_TO_SEVERITY_NUMBER };\n//# sourceMappingURL=constants.js.map\n","function isBrowserBundle() {\n  return typeof __SENTRY_BROWSER_BUNDLE__ !== \"undefined\" && !!__SENTRY_BROWSER_BUNDLE__;\n}\nfunction getSDKSource() {\n  /*! __SENTRY_SDK_SOURCE__ */\n  return \"npm\";\n}\n\nexport { getSDKSource, isBrowserBundle };\n//# sourceMappingURL=env.js.map\n","import { isBrowserBundle } from './env.js';\n\nfunction isNodeEnv() {\n  return !isBrowserBundle() && Object.prototype.toString.call(typeof process !== \"undefined\" ? process : 0) === \"[object process]\";\n}\nfunction dynamicRequire(mod, request) {\n  return mod.require(request);\n}\nfunction loadModule(moduleName, existingModule = typeof module !== \"undefined\" ? module : void 0) {\n  let mod;\n  try {\n    mod = dynamicRequire(existingModule, moduleName);\n  } catch {\n  }\n  if (!mod) {\n    try {\n      const { cwd } = dynamicRequire(existingModule, \"process\");\n      mod = dynamicRequire(existingModule, `${cwd()}/node_modules/${moduleName}`);\n    } catch {\n    }\n  }\n  return mod;\n}\n\nexport { isNodeEnv, loadModule };\n//# sourceMappingURL=node.js.map\n","import { isNodeEnv } from './node.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nfunction isBrowser() {\n  return typeof window !== \"undefined\" && (!isNodeEnv() || isElectronNodeRenderer());\n}\nfunction isElectronNodeRenderer() {\n  const process = GLOBAL_OBJ.process;\n  return process?.type === \"renderer\";\n}\n\nexport { isBrowser };\n//# sourceMappingURL=isBrowser.js.map\n","import { dsnToString } from '../utils/dsn.js';\nimport { createEnvelope } from '../utils/envelope.js';\nimport { isBrowser } from '../utils/isBrowser.js';\n\nfunction createLogContainerEnvelopeItem(items, inferUserData) {\n  const inferSetting = inferUserData ? \"auto\" : \"never\";\n  return [\n    {\n      type: \"log\",\n      item_count: items.length,\n      content_type: \"application/vnd.sentry.items.log+json\"\n    },\n    {\n      version: 2,\n      ...isBrowser() && {\n        ingest_settings: { infer_ip: inferSetting, infer_user_agent: inferSetting }\n      },\n      items\n    }\n  ];\n}\nfunction createLogEnvelope(logs, metadata, tunnel, dsn, inferUserData) {\n  const headers = {};\n  if (metadata?.sdk) {\n    headers.sdk = {\n      name: metadata.sdk.name,\n      version: metadata.sdk.version\n    };\n  }\n  if (!!tunnel && !!dsn) {\n    headers.dsn = dsnToString(dsn);\n  }\n  return createEnvelope(headers, [createLogContainerEnvelopeItem(logs, inferUserData)]);\n}\n\nexport { createLogContainerEnvelopeItem, createLogEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { serializeAttributes } from '../attributes.js';\nimport { getGlobalSingleton } from '../carrier.js';\nimport { getClient, getIsolationScope, getCurrentScope } from '../currentScopes.js';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { debug, consoleSandbox } from '../utils/debug-logger.js';\nimport { isParameterizedString } from '../utils/is.js';\nimport { getCombinedScopeData } from '../utils/scopeData.js';\nimport { _getSpanForScope } from '../utils/spanOnScope.js';\nimport { timestampInSeconds } from '../utils/time.js';\nimport { getSequenceAttribute } from '../utils/timestampSequence.js';\nimport { _getTraceInfoFromScope } from '../utils/trace-info.js';\nimport { SEVERITY_TEXT_TO_SEVERITY_NUMBER } from './constants.js';\nimport { createLogEnvelope } from './envelope.js';\n\nconst MAX_LOG_BUFFER_SIZE = 100;\nfunction setLogAttribute(logAttributes, key, value, setEvenIfPresent = true) {\n  if (value && (!logAttributes[key] || setEvenIfPresent)) {\n    logAttributes[key] = value;\n  }\n}\nfunction _INTERNAL_captureSerializedLog(client, serializedLog) {\n  const bufferMap = _getBufferMap();\n  const logBuffer = _INTERNAL_getLogBuffer(client);\n  if (logBuffer === void 0) {\n    bufferMap.set(client, [serializedLog]);\n  } else {\n    if (logBuffer.length >= MAX_LOG_BUFFER_SIZE) {\n      _INTERNAL_flushLogsBuffer(client, logBuffer);\n      bufferMap.set(client, [serializedLog]);\n    } else {\n      bufferMap.set(client, [...logBuffer, serializedLog]);\n    }\n  }\n}\nfunction _INTERNAL_captureLog(beforeLog, currentScope = getCurrentScope(), captureSerializedLog = _INTERNAL_captureSerializedLog) {\n  const client = currentScope?.getClient() ?? getClient();\n  if (!client) {\n    DEBUG_BUILD && debug.warn(\"No client available to capture log.\");\n    return;\n  }\n  const { release, environment, enableLogs = true, beforeSendLog } = client.getOptions();\n  if (!enableLogs) {\n    DEBUG_BUILD && debug.warn(\"logging option not enabled, log will not be captured.\");\n    return;\n  }\n  const [, traceContext] = _getTraceInfoFromScope(client, currentScope);\n  const processedLogAttributes = {\n    ...beforeLog.attributes\n  };\n  const {\n    user: { id, email, username },\n    attributes: scopeAttributes = {}\n  } = getCombinedScopeData(getIsolationScope(), currentScope);\n  setLogAttribute(processedLogAttributes, \"user.id\", id, false);\n  setLogAttribute(processedLogAttributes, \"user.email\", email, false);\n  setLogAttribute(processedLogAttributes, \"user.name\", username, false);\n  setLogAttribute(processedLogAttributes, \"sentry.release\", release);\n  setLogAttribute(processedLogAttributes, \"sentry.environment\", environment);\n  const { name, version } = client.getSdkMetadata()?.sdk ?? {};\n  setLogAttribute(processedLogAttributes, \"sentry.sdk.name\", name);\n  setLogAttribute(processedLogAttributes, \"sentry.sdk.version\", version);\n  const replay = client.getIntegrationByName(\"Replay\");\n  const replayId = replay?.getReplayId(true);\n  setLogAttribute(processedLogAttributes, \"sentry.replay_id\", replayId);\n  if (replayId && replay?.getRecordingMode() === \"buffer\") {\n    setLogAttribute(processedLogAttributes, \"sentry._internal.replay_is_buffering\", true);\n  }\n  const beforeLogMessage = beforeLog.message;\n  if (isParameterizedString(beforeLogMessage)) {\n    const { __sentry_template_string__, __sentry_template_values__ = [] } = beforeLogMessage;\n    if (__sentry_template_values__?.length) {\n      processedLogAttributes[\"sentry.message.template\"] = __sentry_template_string__;\n    }\n    __sentry_template_values__.forEach((param, index) => {\n      processedLogAttributes[`sentry.message.parameter.${index}`] = param;\n    });\n  }\n  const span = _getSpanForScope(currentScope);\n  setLogAttribute(processedLogAttributes, \"sentry.trace.parent_span_id\", span?.spanContext().spanId);\n  const processedLog = { ...beforeLog, attributes: processedLogAttributes };\n  client.emit(\"beforeCaptureLog\", processedLog);\n  const log = beforeSendLog ? consoleSandbox(() => beforeSendLog(processedLog)) : processedLog;\n  if (!log) {\n    client.recordDroppedEvent(\"before_send\", \"log_item\", 1);\n    DEBUG_BUILD && debug.warn(\"beforeSendLog returned null, log will not be captured.\");\n    return;\n  }\n  const { level, message, attributes: logAttributes = {}, severityNumber } = log;\n  const timestamp = timestampInSeconds();\n  const sequenceAttr = getSequenceAttribute(timestamp);\n  const serializedLog = {\n    timestamp,\n    level,\n    body: _removeLoneSurrogates(String(message)),\n    trace_id: traceContext?.trace_id,\n    severity_number: severityNumber ?? SEVERITY_TEXT_TO_SEVERITY_NUMBER[level],\n    attributes: sanitizeLogAttributes({\n      ...serializeAttributes(scopeAttributes),\n      ...serializeAttributes(logAttributes, true),\n      [sequenceAttr.key]: sequenceAttr.value\n    })\n  };\n  captureSerializedLog(client, serializedLog);\n  client.emit(\"afterCaptureLog\", log);\n}\nfunction _INTERNAL_flushLogsBuffer(client, maybeLogBuffer) {\n  const logBuffer = maybeLogBuffer ?? _INTERNAL_getLogBuffer(client) ?? [];\n  if (logBuffer.length === 0) {\n    return;\n  }\n  const clientOptions = client.getOptions();\n  const envelope = createLogEnvelope(\n    logBuffer,\n    clientOptions._metadata,\n    clientOptions.tunnel,\n    client.getDsn(),\n    client.getDataCollectionOptions().userInfo\n  );\n  _getBufferMap().set(client, []);\n  client.emit(\"flushLogs\");\n  client.sendEnvelope(envelope);\n}\nfunction _INTERNAL_getLogBuffer(client) {\n  return _getBufferMap().get(client);\n}\nfunction _getBufferMap() {\n  return getGlobalSingleton(\"clientToLogBufferMap\", () => /* @__PURE__ */ new WeakMap());\n}\nfunction sanitizeLogAttributes(attributes) {\n  const sanitized = {};\n  for (const [key, attr] of Object.entries(attributes)) {\n    const sanitizedKey = _removeLoneSurrogates(key);\n    if (attr.type === \"string\") {\n      sanitized[sanitizedKey] = { ...attr, value: _removeLoneSurrogates(attr.value) };\n    } else {\n      sanitized[sanitizedKey] = attr;\n    }\n  }\n  return sanitized;\n}\nfunction _removeLoneSurrogates(str) {\n  const strObj = Object(str);\n  const isWellFormed = strObj[\"isWellFormed\"];\n  const toWellFormed = strObj[\"toWellFormed\"];\n  if (typeof isWellFormed === \"function\" && typeof toWellFormed === \"function\") {\n    return isWellFormed.call(str) ? str : toWellFormed.call(str);\n  }\n  return str;\n}\n\nexport { _INTERNAL_captureLog, _INTERNAL_captureSerializedLog, _INTERNAL_flushLogsBuffer, _INTERNAL_getLogBuffer, _removeLoneSurrogates };\n//# sourceMappingURL=internal.js.map\n","import { dsnToString } from '../utils/dsn.js';\nimport { createEnvelope } from '../utils/envelope.js';\nimport { isBrowser } from '../utils/isBrowser.js';\n\nfunction createMetricContainerEnvelopeItem(items, inferUserData) {\n  const inferSetting = inferUserData ? \"auto\" : \"never\";\n  return [\n    {\n      type: \"trace_metric\",\n      item_count: items.length,\n      content_type: \"application/vnd.sentry.items.trace-metric+json\"\n    },\n    {\n      version: 2,\n      ...isBrowser() && {\n        ingest_settings: { infer_ip: inferSetting, infer_user_agent: inferSetting }\n      },\n      items\n    }\n  ];\n}\nfunction createMetricEnvelope(metrics, metadata, tunnel, dsn, inferUserData) {\n  const headers = {};\n  if (metadata?.sdk) {\n    headers.sdk = {\n      name: metadata.sdk.name,\n      version: metadata.sdk.version\n    };\n  }\n  if (!!tunnel && !!dsn) {\n    headers.dsn = dsnToString(dsn);\n  }\n  return createEnvelope(headers, [createMetricContainerEnvelopeItem(metrics, inferUserData)]);\n}\n\nexport { createMetricContainerEnvelopeItem, createMetricEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { serializeAttributes } from '../attributes.js';\nimport { getGlobalSingleton } from '../carrier.js';\nimport { getCurrentScope, getClient, getIsolationScope } from '../currentScopes.js';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { debug } from '../utils/debug-logger.js';\nimport { getCombinedScopeData } from '../utils/scopeData.js';\nimport { _getSpanForScope } from '../utils/spanOnScope.js';\nimport { timestampInSeconds } from '../utils/time.js';\nimport { getSequenceAttribute } from '../utils/timestampSequence.js';\nimport { _getTraceInfoFromScope } from '../utils/trace-info.js';\nimport { createMetricEnvelope } from './envelope.js';\n\nconst MAX_METRIC_BUFFER_SIZE = 1e3;\nfunction setMetricAttribute(metricAttributes, key, value, setEvenIfPresent = true) {\n  if (value && (setEvenIfPresent || !(key in metricAttributes))) {\n    metricAttributes[key] = value;\n  }\n}\nfunction _INTERNAL_captureSerializedMetric(client, serializedMetric) {\n  const bufferMap = _getBufferMap();\n  const metricBuffer = _INTERNAL_getMetricBuffer(client);\n  if (metricBuffer === void 0) {\n    bufferMap.set(client, [serializedMetric]);\n  } else {\n    if (metricBuffer.length >= MAX_METRIC_BUFFER_SIZE) {\n      _INTERNAL_flushMetricsBuffer(client, metricBuffer);\n      bufferMap.set(client, [serializedMetric]);\n    } else {\n      bufferMap.set(client, [...metricBuffer, serializedMetric]);\n    }\n  }\n}\nfunction _enrichMetricAttributes(beforeMetric, client, user) {\n  const { release, environment } = client.getOptions();\n  const processedMetricAttributes = {\n    ...beforeMetric.attributes\n  };\n  setMetricAttribute(processedMetricAttributes, \"user.id\", user.id, false);\n  setMetricAttribute(processedMetricAttributes, \"user.email\", user.email, false);\n  setMetricAttribute(processedMetricAttributes, \"user.name\", user.username, false);\n  setMetricAttribute(processedMetricAttributes, \"sentry.release\", release);\n  setMetricAttribute(processedMetricAttributes, \"sentry.environment\", environment);\n  const { name, version } = client.getSdkMetadata()?.sdk ?? {};\n  setMetricAttribute(processedMetricAttributes, \"sentry.sdk.name\", name);\n  setMetricAttribute(processedMetricAttributes, \"sentry.sdk.version\", version);\n  const replay = client.getIntegrationByName(\"Replay\");\n  const replayId = replay?.getReplayId(true);\n  setMetricAttribute(processedMetricAttributes, \"sentry.replay_id\", replayId);\n  if (replayId && replay?.getRecordingMode() === \"buffer\") {\n    setMetricAttribute(processedMetricAttributes, \"sentry._internal.replay_is_buffering\", true);\n  }\n  return {\n    ...beforeMetric,\n    attributes: processedMetricAttributes\n  };\n}\nfunction _buildSerializedMetric(metric, client, currentScope, scopeAttributes) {\n  const [, traceContext] = _getTraceInfoFromScope(client, currentScope);\n  const span = _getSpanForScope(currentScope);\n  const traceId = span ? span.spanContext().traceId : traceContext?.trace_id;\n  const spanId = span ? span.spanContext().spanId : void 0;\n  const timestamp = timestampInSeconds();\n  const sequenceAttr = getSequenceAttribute(timestamp);\n  return {\n    timestamp,\n    trace_id: traceId ?? \"\",\n    span_id: spanId,\n    name: metric.name,\n    type: metric.type,\n    unit: metric.unit,\n    value: metric.value,\n    attributes: {\n      ...serializeAttributes(scopeAttributes),\n      ...serializeAttributes(metric.attributes, \"skip-undefined\"),\n      [sequenceAttr.key]: sequenceAttr.value\n    }\n  };\n}\nfunction _INTERNAL_captureMetric(beforeMetric, options) {\n  const currentScope = options?.scope ?? getCurrentScope();\n  const captureSerializedMetric = options?.captureSerializedMetric ?? _INTERNAL_captureSerializedMetric;\n  const client = currentScope?.getClient() ?? getClient();\n  if (!client) {\n    DEBUG_BUILD && debug.warn(\"No client available to capture metric.\");\n    return;\n  }\n  const { _experiments, enableMetrics, beforeSendMetric } = client.getOptions();\n  const metricsEnabled = enableMetrics ?? _experiments?.enableMetrics ?? true;\n  if (!metricsEnabled) {\n    DEBUG_BUILD && debug.warn(\"metrics option not enabled, metric will not be captured.\");\n    return;\n  }\n  const { user, attributes: scopeAttributes } = getCombinedScopeData(getIsolationScope(), currentScope);\n  const enrichedMetric = _enrichMetricAttributes(beforeMetric, client, user);\n  client.emit(\"processMetric\", enrichedMetric);\n  const beforeSendCallback = beforeSendMetric || _experiments?.beforeSendMetric;\n  const processedMetric = beforeSendCallback ? beforeSendCallback(enrichedMetric) : enrichedMetric;\n  if (!processedMetric) {\n    DEBUG_BUILD && debug.log(\"`beforeSendMetric` returned `null`, will not send metric.\");\n    return;\n  }\n  const serializedMetric = _buildSerializedMetric(processedMetric, client, currentScope, scopeAttributes);\n  DEBUG_BUILD && debug.log(\"[Metric]\", serializedMetric);\n  captureSerializedMetric(client, serializedMetric);\n  client.emit(\"afterCaptureMetric\", processedMetric);\n}\nfunction _INTERNAL_flushMetricsBuffer(client, maybeMetricBuffer) {\n  const metricBuffer = maybeMetricBuffer ?? _INTERNAL_getMetricBuffer(client) ?? [];\n  if (metricBuffer.length === 0) {\n    return;\n  }\n  const clientOptions = client.getOptions();\n  const envelope = createMetricEnvelope(\n    metricBuffer,\n    clientOptions._metadata,\n    clientOptions.tunnel,\n    client.getDsn(),\n    client.getDataCollectionOptions().userInfo\n  );\n  _getBufferMap().set(client, []);\n  client.emit(\"flushMetrics\");\n  client.sendEnvelope(envelope);\n}\nfunction _INTERNAL_getMetricBuffer(client) {\n  return _getBufferMap().get(client);\n}\nfunction _getBufferMap() {\n  return getGlobalSingleton(\"clientToMetricBufferMap\", () => /* @__PURE__ */ new WeakMap());\n}\n\nexport { _INTERNAL_captureMetric, _INTERNAL_captureSerializedMetric, _INTERNAL_flushMetricsBuffer, _INTERNAL_getMetricBuffer };\n//# sourceMappingURL=internal.js.map\n","import { streamedSpanJsonToSerializedSpan } from '../../utils/spanUtils.js';\n\nfunction spanJsonToSerializedStreamedSpan(span) {\n  const streamedSpan = {\n    trace_id: span.trace_id,\n    span_id: span.span_id,\n    parent_span_id: span.parent_span_id,\n    name: span.description || \"\",\n    start_timestamp: span.start_timestamp,\n    end_timestamp: span.timestamp || span.start_timestamp,\n    status: !span.status || span.status === \"ok\" || span.status === \"cancelled\" ? \"ok\" : \"error\",\n    is_segment: false,\n    attributes: { ...span.data },\n    links: span.links\n  };\n  return streamedSpanJsonToSerializedSpan(streamedSpan);\n}\n\nexport { spanJsonToSerializedStreamedSpan };\n//# sourceMappingURL=spanJsonToStreamedSpan.js.map\n","import { isBrowser } from '../../utils/isBrowser.js';\nimport { hasSpanStreamingEnabled } from './hasSpanStreamingEnabled.js';\nimport { spanJsonToSerializedStreamedSpan } from './spanJsonToStreamedSpan.js';\n\nfunction extractGenAiSpansFromEvent(event, client) {\n  if (event.type !== \"transaction\" || !event.spans?.length || !event.sdkProcessingMetadata?.hasGenAiSpans || client.getOptions().streamGenAiSpans === false || hasSpanStreamingEnabled(client)) {\n    return void 0;\n  }\n  const genAiSpans = [];\n  const remainingSpans = [];\n  for (const span of event.spans) {\n    if (span.op?.startsWith(\"gen_ai.\")) {\n      genAiSpans.push(spanJsonToSerializedStreamedSpan(span));\n    } else {\n      remainingSpans.push(span);\n    }\n  }\n  if (genAiSpans.length === 0) {\n    return void 0;\n  }\n  event.spans = remainingSpans;\n  const inferSetting = client.getDataCollectionOptions().userInfo ? \"auto\" : \"never\";\n  return [\n    { type: \"span\", item_count: genAiSpans.length, content_type: \"application/vnd.sentry.items.span.v2+json\" },\n    {\n      version: 2,\n      ...isBrowser() && {\n        ingest_settings: { infer_ip: inferSetting, infer_user_agent: inferSetting }\n      },\n      items: genAiSpans\n    }\n  ];\n}\n\nexport { extractGenAiSpansFromEvent };\n//# sourceMappingURL=extractGenAiSpans.js.map\n","import { resolvedSyncPromise, rejectedSyncPromise } from './syncpromise.js';\nimport { safeUnref } from './timer.js';\n\nconst SENTRY_BUFFER_FULL_ERROR = /* @__PURE__ */ Symbol.for(\"SentryBufferFullError\");\nfunction makePromiseBuffer(limit = 100) {\n  const buffer = /* @__PURE__ */ new Set();\n  function isReady() {\n    return buffer.size < limit;\n  }\n  function remove(task) {\n    buffer.delete(task);\n  }\n  function add(taskProducer) {\n    if (!isReady()) {\n      return rejectedSyncPromise(SENTRY_BUFFER_FULL_ERROR);\n    }\n    const task = taskProducer();\n    buffer.add(task);\n    void task.then(\n      () => remove(task),\n      () => remove(task)\n    );\n    return task;\n  }\n  function drain(timeout) {\n    if (!buffer.size) {\n      return resolvedSyncPromise(true);\n    }\n    const drainPromise = Promise.allSettled(Array.from(buffer)).then(() => true);\n    if (!timeout) {\n      return drainPromise;\n    }\n    const promises = [\n      drainPromise,\n      new Promise((resolve) => safeUnref(setTimeout(() => resolve(false), timeout)))\n    ];\n    return Promise.race(promises);\n  }\n  return {\n    get $() {\n      return Array.from(buffer);\n    },\n    add,\n    drain\n  };\n}\n\nexport { SENTRY_BUFFER_FULL_ERROR, makePromiseBuffer };\n//# sourceMappingURL=promisebuffer.js.map\n","import { safeDateNow } from './randomSafeContext.js';\n\nconst DEFAULT_RETRY_AFTER = 60 * 1e3;\nfunction parseRetryAfterHeader(header, now = safeDateNow()) {\n  const headerDelay = parseInt(`${header}`, 10);\n  if (!isNaN(headerDelay)) {\n    return headerDelay * 1e3;\n  }\n  const headerDate = Date.parse(`${header}`);\n  if (!isNaN(headerDate)) {\n    return headerDate - now;\n  }\n  return DEFAULT_RETRY_AFTER;\n}\nfunction disabledUntil(limits, dataCategory) {\n  return limits[dataCategory] || limits.all || 0;\n}\nfunction isRateLimited(limits, dataCategory, now = safeDateNow()) {\n  return disabledUntil(limits, dataCategory) > now;\n}\nfunction updateRateLimits(limits, { statusCode, headers }, now = safeDateNow()) {\n  const updatedRateLimits = {\n    ...limits\n  };\n  const rateLimitHeader = headers?.[\"x-sentry-rate-limits\"];\n  const retryAfterHeader = headers?.[\"retry-after\"];\n  if (rateLimitHeader) {\n    for (const limit of rateLimitHeader.trim().split(\",\")) {\n      const [retryAfter, categories, , , namespaces] = limit.split(\":\", 5);\n      const headerDelay = parseInt(retryAfter, 10);\n      const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1e3;\n      if (!categories) {\n        updatedRateLimits.all = now + delay;\n      } else {\n        for (const category of categories.split(\";\")) {\n          if (category === \"metric_bucket\") {\n            if (!namespaces || namespaces.split(\";\").includes(\"custom\")) {\n              updatedRateLimits[category] = now + delay;\n            }\n          } else {\n            updatedRateLimits[category] = now + delay;\n          }\n        }\n      }\n    }\n  } else if (retryAfterHeader) {\n    updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n  } else if (statusCode === 429) {\n    updatedRateLimits.all = now + 60 * 1e3;\n  }\n  return updatedRateLimits;\n}\n\nexport { DEFAULT_RETRY_AFTER, disabledUntil, isRateLimited, parseRetryAfterHeader, updateRateLimits };\n//# sourceMappingURL=ratelimit.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { debug } from '../utils/debug-logger.js';\nimport { forEachEnvelopeItem, envelopeItemTypeToDataCategory, createEnvelope, serializeEnvelope, envelopeContainsItemType } from '../utils/envelope.js';\nimport { makePromiseBuffer, SENTRY_BUFFER_FULL_ERROR } from '../utils/promisebuffer.js';\nimport { isRateLimited, updateRateLimits } from '../utils/ratelimit.js';\n\nconst DEFAULT_TRANSPORT_BUFFER_SIZE = 64;\nfunction createTransport(options, makeRequest, buffer = makePromiseBuffer(\n  options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE\n)) {\n  let rateLimits = {};\n  const flush = (timeout) => buffer.drain(timeout);\n  function send(envelope) {\n    const filteredEnvelopeItems = [];\n    forEachEnvelopeItem(envelope, (item, type) => {\n      const dataCategory = envelopeItemTypeToDataCategory(type);\n      if (isRateLimited(rateLimits, dataCategory)) {\n        options.recordDroppedEvent(\"ratelimit_backoff\", dataCategory);\n      } else {\n        filteredEnvelopeItems.push(item);\n      }\n    });\n    if (filteredEnvelopeItems.length === 0) {\n      return Promise.resolve({});\n    }\n    const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems);\n    const recordEnvelopeLoss = (reason) => {\n      if (envelopeContainsItemType(filteredEnvelope, [\"client_report\"])) {\n        DEBUG_BUILD && debug.warn(`Dropping client report. Will not send outcomes (reason: ${reason}).`);\n        return;\n      }\n      forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n        options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type));\n      });\n    };\n    const requestTask = () => makeRequest({ body: serializeEnvelope(filteredEnvelope) }).then(\n      (response) => {\n        if (response.statusCode === 413) {\n          DEBUG_BUILD && debug.error(\n            \"Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.\"\n          );\n          recordEnvelopeLoss(\"send_error\");\n          return response;\n        }\n        if (DEBUG_BUILD && response.statusCode !== void 0 && (response.statusCode < 200 || response.statusCode >= 300)) {\n          debug.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n        }\n        rateLimits = updateRateLimits(rateLimits, response);\n        return response;\n      },\n      (error) => {\n        recordEnvelopeLoss(\"network_error\");\n        DEBUG_BUILD && debug.error(\"Encountered error running transport request:\", error);\n        throw error;\n      }\n    );\n    return buffer.add(requestTask).then(\n      (result) => result,\n      (error) => {\n        if (error === SENTRY_BUFFER_FULL_ERROR) {\n          DEBUG_BUILD && debug.error(\"Skipped sending event because buffer is full.\");\n          recordEnvelopeLoss(\"queue_overflow\");\n          return Promise.resolve({});\n        } else {\n          throw error;\n        }\n      }\n    );\n  }\n  return {\n    send,\n    flush\n  };\n}\n\nexport { DEFAULT_TRANSPORT_BUFFER_SIZE, createTransport };\n//# sourceMappingURL=base.js.map\n","import { createEnvelope } from './envelope.js';\nimport { dateTimestampInSeconds } from './time.js';\n\nfunction createClientReportEnvelope(discarded_events, dsn, timestamp) {\n  const clientReportItem = [\n    { type: \"client_report\" },\n    {\n      timestamp: timestamp || dateTimestampInSeconds(),\n      discarded_events\n    }\n  ];\n  return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);\n}\n\nexport { createClientReportEnvelope };\n//# sourceMappingURL=clientreport.js.map\n","function getPossibleEventMessages(event) {\n  const possibleMessages = [];\n  if (event.message) {\n    possibleMessages.push(event.message);\n  }\n  try {\n    const lastException = event.exception.values[event.exception.values.length - 1];\n    if (lastException?.value) {\n      possibleMessages.push(lastException.value);\n      if (lastException.type) {\n        possibleMessages.push(`${lastException.type}: ${lastException.value}`);\n      }\n    }\n  } catch {\n  }\n  return possibleMessages;\n}\n\nexport { getPossibleEventMessages };\n//# sourceMappingURL=eventUtils.js.map\n","import { SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_PROFILE_ID } from '../semanticAttributes.js';\n\nfunction convertTransactionEventToSpanJson(event) {\n  const { trace_id, parent_span_id, span_id, status, origin, data, op } = event.contexts?.trace ?? {};\n  return {\n    data: data ?? {},\n    description: event.transaction,\n    op,\n    parent_span_id,\n    span_id: span_id ?? \"\",\n    start_timestamp: event.start_timestamp ?? 0,\n    status,\n    timestamp: event.timestamp,\n    trace_id: trace_id ?? \"\",\n    origin,\n    profile_id: data?.[SEMANTIC_ATTRIBUTE_PROFILE_ID],\n    exclusive_time: data?.[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME],\n    measurements: event.measurements,\n    is_segment: true\n  };\n}\nfunction convertSpanJsonToTransactionEvent(span) {\n  return {\n    type: \"transaction\",\n    timestamp: span.timestamp,\n    start_timestamp: span.start_timestamp,\n    transaction: span.description,\n    contexts: {\n      trace: {\n        trace_id: span.trace_id,\n        span_id: span.span_id,\n        parent_span_id: span.parent_span_id,\n        op: span.op,\n        status: span.status,\n        origin: span.origin,\n        data: {\n          ...span.data,\n          ...span.profile_id && { [SEMANTIC_ATTRIBUTE_PROFILE_ID]: span.profile_id },\n          ...span.exclusive_time && { [SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: span.exclusive_time }\n        }\n      }\n    },\n    measurements: span.measurements\n  };\n}\n\nexport { convertSpanJsonToTransactionEvent, convertTransactionEventToSpanJson };\n//# sourceMappingURL=transactionEvent.js.map\n","const FILTERED_VALUE = \"[Filtered]\";\nconst PII_HEADER_SNIPPETS = [\"forwarded\", \"-ip\", \"remote-\", \"via\", \"-user\"];\nconst SENSITIVE_KEY_SNIPPETS = [\n  \"auth\",\n  \"token\",\n  \"secret\",\n  \"session\",\n  // for the user_session cookie\n  \"password\",\n  \"passwd\",\n  \"pwd\",\n  \"key\",\n  \"jwt\",\n  \"bearer\",\n  \"sso\",\n  \"saml\",\n  \"csrf\",\n  \"xsrf\",\n  \"credentials\",\n  \"sid\",\n  \"identity\",\n  // Always treat cookie headers as sensitive in case individual key-value cookie pairs cannot properly be extracted\n  \"set-cookie\",\n  \"cookie\"\n];\nconst SENSITIVE_COOKIE_NAME_SNIPPETS = [\n  // Express / Connect default session cookie\n  \".sid\",\n  // Opaque session ids (PHPSESSID, ASPSESSIONID*, BIGipServer*, *sessid*, …)\n  \"sessid\",\n  // Laravel etc. \"remember me\" tokens\n  \"remember\",\n  // OIDC / OAuth auxiliary (`oauth*` covered by header snippet `auth`)\n  \"oidc\",\n  \"pkce\",\n  \"nonce\",\n  // RFC 6265bis high-security cookie name prefixes\n  \"__secure-\",\n  \"__host-\",\n  // Load balancer / CDN sticky-session cookies (opaque routing tokens)\n  \"awsalb\",\n  \"awselb\",\n  \"akamai\",\n  // BaaS / IdP session cookies (names often omit \"session\")\n  \"__stripe\",\n  \"cognito\",\n  \"firebase\",\n  \"supabase\",\n  \"sb-\",\n  // Step-up / MFA cookies\n  \"mfa\",\n  \"2fa\"\n];\n\nexport { FILTERED_VALUE, PII_HEADER_SNIPPETS, SENSITIVE_COOKIE_NAME_SNIPPETS, SENSITIVE_KEY_SNIPPETS };\n//# sourceMappingURL=filtering-snippets.js.map\n","import { PII_HEADER_SNIPPETS } from './filtering-snippets.js';\n\nfunction defaultPiiToCollectionOptions(sendDefaultPii) {\n  return sendDefaultPii === true ? {\n    userInfo: true,\n    cookies: true,\n    httpHeaders: { request: true, response: true },\n    httpBodies: [\"incomingRequest\", \"outgoingRequest\", \"incomingResponse\", \"outgoingResponse\"],\n    urlQueryParams: true,\n    graphQL: { document: true, variables: true },\n    genAI: { inputs: true, outputs: true },\n    databaseQueryData: true,\n    stackFrameVariables: true,\n    frameContextLines: 7\n    // default should be 5, but ContextLines integration uses 7\n  } : {\n    userInfo: false,\n    cookies: { deny: PII_HEADER_SNIPPETS },\n    httpHeaders: { request: { deny: PII_HEADER_SNIPPETS }, response: { deny: PII_HEADER_SNIPPETS } },\n    httpBodies: [],\n    urlQueryParams: { deny: PII_HEADER_SNIPPETS },\n    // The GraphQL document has literal values redacted at collection time, so it was historically\n    // always attached regardless of `sendDefaultPii`; keep it on to preserve that behavior.\n    graphQL: { document: true, variables: true },\n    genAI: { inputs: false, outputs: false },\n    // Database query values were only sent with `sendDefaultPii: true` (e.g. Supabase gated on it),\n    // so map the legacy \"off\" state to `false`.\n    databaseQueryData: false,\n    stackFrameVariables: true,\n    frameContextLines: 7\n    // default should be 5, but ContextLines integration uses 7\n  };\n}\n\nexport { defaultPiiToCollectionOptions };\n//# sourceMappingURL=defaultPiiToCollectionOptions.js.map\n","import { defaultPiiToCollectionOptions } from './defaultPiiToCollectionOptions.js';\n\nconst DEFAULTS = {\n  userInfo: true,\n  cookies: true,\n  httpHeaders: { request: true, response: true },\n  httpBodies: [\"incomingRequest\", \"outgoingRequest\", \"incomingResponse\", \"outgoingResponse\"],\n  urlQueryParams: true,\n  graphQL: { document: true, variables: true },\n  genAI: { inputs: true, outputs: true },\n  databaseQueryData: true,\n  stackFrameVariables: true,\n  frameContextLines: 5\n};\nfunction resolveDataCollectionOptions(options) {\n  const base = options.dataCollection != null ? DEFAULTS : defaultPiiToCollectionOptions(options.sendDefaultPii);\n  const dc = options.dataCollection ?? {};\n  return {\n    userInfo: dc.userInfo ?? base.userInfo,\n    cookies: dc.cookies ?? base.cookies,\n    httpHeaders: {\n      request: dc.httpHeaders?.request ?? base.httpHeaders.request,\n      response: dc.httpHeaders?.response ?? base.httpHeaders.response\n    },\n    httpBodies: dc.httpBodies ?? base.httpBodies,\n    // oxlint-disable-next-line typescript/no-deprecated\n    urlQueryParams: dc.urlQueryParams ?? dc.queryParams ?? base.urlQueryParams,\n    graphQL: {\n      document: dc.graphQL?.document ?? base.graphQL.document,\n      variables: dc.graphQL?.variables ?? base.graphQL.variables\n    },\n    genAI: {\n      inputs: dc.genAI?.inputs ?? base.genAI.inputs,\n      outputs: dc.genAI?.outputs ?? base.genAI.outputs\n    },\n    databaseQueryData: dc.databaseQueryData ?? base.databaseQueryData,\n    stackFrameVariables: dc.stackFrameVariables ?? base.stackFrameVariables,\n    frameContextLines: dc.frameContextLines ?? base.frameContextLines\n  };\n}\n\nexport { resolveDataCollectionOptions };\n//# sourceMappingURL=resolveDataCollectionOptions.js.map\n","import { getEnvelopeEndpointWithUrlEncodedAuth } from './api.js';\nimport { DEFAULT_ENVIRONMENT } from './constants.js';\nimport { getTraceContextFromScope, getCurrentScope, getIsolationScope } from './currentScopes.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope.js';\nimport { setupIntegration, afterSetupIntegrations, setupIntegrations } from './integration.js';\nimport { _INTERNAL_flushLogsBuffer } from './logs/internal.js';\nimport { _INTERNAL_flushMetricsBuffer } from './metrics/internal.js';\nimport { updateSession } from './session.js';\nimport { getDynamicSamplingContextFromScope } from './tracing/dynamicSamplingContext.js';\nimport { isStreamedBeforeSendSpanCallback } from './tracing/spans/beforeSendSpan.js';\nimport { extractGenAiSpansFromEvent } from './tracing/spans/extractGenAiSpans.js';\nimport { DEFAULT_TRANSPORT_BUFFER_SIZE } from './transports/base.js';\nimport { createClientReportEnvelope } from './utils/clientreport.js';\nimport { debug } from './utils/debug-logger.js';\nimport { makeDsn, dsnToString } from './utils/dsn.js';\nimport { addItemToEnvelope, createAttachmentEnvelopeItem } from './utils/envelope.js';\nimport { getPossibleEventMessages } from './utils/eventUtils.js';\nimport { isParameterizedString, isPrimitive, isObjectLike, isThenable, isPlainObject } from './utils/is.js';\nimport { merge } from './utils/merge.js';\nimport { uuid4, checkOrSetAlreadyCaught } from './utils/misc.js';\nimport { parseSampleRate } from './utils/parseSampleRate.js';\nimport { prepareEvent } from './utils/prepareEvent.js';\nimport { makePromiseBuffer, SENTRY_BUFFER_FULL_ERROR } from './utils/promisebuffer.js';\nimport { safeMathRandom } from './utils/randomSafeContext.js';\nimport { shouldIgnoreSpan, reparentChildSpans } from './utils/should-ignore-span.js';\nimport { showSpanDropWarning } from './utils/spanUtils.js';\nimport { safeUnref } from './utils/timer.js';\nimport { convertTransactionEventToSpanJson, convertSpanJsonToTransactionEvent } from './utils/transactionEvent.js';\nimport { resolveDataCollectionOptions } from './utils/data-collection/resolveDataCollectionOptions.js';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\nconst MISSING_RELEASE_FOR_SESSION_ERROR = \"Discarded session because of missing or non-string release\";\nconst INTERNAL_ERROR_SYMBOL = /* @__PURE__ */ Symbol.for(\"SentryInternalError\");\nconst DO_NOT_SEND_EVENT_SYMBOL = /* @__PURE__ */ Symbol.for(\"SentryDoNotSendEventError\");\nconst DEFAULT_FLUSH_INTERVAL = 5e3;\nfunction _makeInternalError(message) {\n  return {\n    message,\n    [INTERNAL_ERROR_SYMBOL]: true\n  };\n}\nfunction _makeDoNotSendEventError(message) {\n  return {\n    message,\n    [DO_NOT_SEND_EVENT_SYMBOL]: true\n  };\n}\nfunction _isInternalError(error) {\n  return isObjectLike(error) && INTERNAL_ERROR_SYMBOL in error;\n}\nfunction _isDoNotSendEventError(error) {\n  return isObjectLike(error) && DO_NOT_SEND_EVENT_SYMBOL in error;\n}\nfunction setupWeightBasedFlushing(client, afterCaptureHook, flushHook, estimateSizeFn, flushFn) {\n  let weight = 0;\n  let flushTimeout;\n  let isTimerActive = false;\n  client.on(flushHook, () => {\n    weight = 0;\n    clearTimeout(flushTimeout);\n    isTimerActive = false;\n  });\n  client.on(afterCaptureHook, (item) => {\n    weight += estimateSizeFn(item);\n    if (weight >= 8e5) {\n      flushFn(client);\n    } else if (!isTimerActive) {\n      const flushInterval = client.getOptions()._flushInterval ?? DEFAULT_FLUSH_INTERVAL;\n      if (flushInterval > 0) {\n        isTimerActive = true;\n        flushTimeout = safeUnref(\n          setTimeout(() => {\n            flushFn(client);\n          }, flushInterval)\n        );\n      }\n    }\n  });\n  client.on(\"flush\", () => {\n    flushFn(client);\n  });\n}\nclass Client {\n  /**\n   * Initializes this client instance.\n   *\n   * @param options Options for the client.\n   */\n  constructor(options) {\n    this._options = options;\n    this._integrations = {};\n    this._numProcessing = 0;\n    this._outcomes = {};\n    this._hooks = {};\n    this._eventProcessors = [];\n    this._promiseBuffer = makePromiseBuffer(options.transportOptions?.bufferSize ?? DEFAULT_TRANSPORT_BUFFER_SIZE);\n    this._dataCollection = resolveDataCollectionOptions(options);\n    if (options.dsn) {\n      this._dsn = makeDsn(options.dsn);\n    } else {\n      DEBUG_BUILD && debug.warn(\"No DSN provided, client will not send events.\");\n    }\n    if (this._dsn) {\n      const url = getEnvelopeEndpointWithUrlEncodedAuth(\n        this._dsn,\n        options.tunnel,\n        options._metadata ? options._metadata.sdk : void 0\n      );\n      this._transport = options.transport({\n        tunnel: this._options.tunnel,\n        recordDroppedEvent: this.recordDroppedEvent.bind(this),\n        ...options.transportOptions,\n        url\n      });\n    }\n    this._options.enableLogs = this._options.enableLogs ?? this._options._experiments?.enableLogs ?? true;\n    if (this._options.enableLogs) {\n      setupWeightBasedFlushing(this, \"afterCaptureLog\", \"flushLogs\", estimateLogSizeInBytes, _INTERNAL_flushLogsBuffer);\n    }\n    const enableMetrics = this._options.enableMetrics ?? this._options._experiments?.enableMetrics ?? true;\n    if (enableMetrics) {\n      setupWeightBasedFlushing(\n        this,\n        \"afterCaptureMetric\",\n        \"flushMetrics\",\n        estimateMetricSizeInBytes,\n        _INTERNAL_flushMetricsBuffer\n      );\n    }\n  }\n  /**\n   * Captures an exception event and sends it to Sentry.\n   *\n   * Unlike `captureException` exported from every SDK, this method requires that you pass it the current scope.\n   */\n  captureException(exception, hint, scope) {\n    const eventId = uuid4();\n    if (checkOrSetAlreadyCaught(exception)) {\n      DEBUG_BUILD && debug.log(ALREADY_SEEN_ERROR);\n      return eventId;\n    }\n    const hintWithEventId = {\n      event_id: eventId,\n      ...hint\n    };\n    this._process(\n      () => this.eventFromException(exception, hintWithEventId).then((event) => this._captureEvent(event, hintWithEventId, scope)).then((res) => res),\n      \"error\"\n    );\n    return hintWithEventId.event_id;\n  }\n  /**\n   * Captures a message event and sends it to Sentry.\n   *\n   * Unlike `captureMessage` exported from every SDK, this method requires that you pass it the current scope.\n   */\n  captureMessage(message, level, hint, currentScope) {\n    const hintWithEventId = {\n      event_id: uuid4(),\n      ...hint\n    };\n    const eventMessage = isParameterizedString(message) ? message : String(message);\n    const isMessage = isPrimitive(message);\n    const promisedEvent = isMessage ? this.eventFromMessage(eventMessage, level, hintWithEventId) : this.eventFromException(message, hintWithEventId);\n    this._process(\n      () => promisedEvent.then((event) => this._captureEvent(event, hintWithEventId, currentScope)),\n      isMessage ? \"unknown\" : \"error\"\n    );\n    return hintWithEventId.event_id;\n  }\n  /**\n   * Captures a manually created event and sends it to Sentry.\n   *\n   * Unlike `captureEvent` exported from every SDK, this method requires that you pass it the current scope.\n   */\n  captureEvent(event, hint, currentScope) {\n    const eventId = uuid4();\n    if (hint?.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n      DEBUG_BUILD && debug.log(ALREADY_SEEN_ERROR);\n      return eventId;\n    }\n    const hintWithEventId = {\n      event_id: eventId,\n      ...hint\n    };\n    const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n    const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope;\n    const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope;\n    const dataCategory = getDataCategoryByType(event.type);\n    this._process(\n      () => this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope, capturedSpanIsolationScope),\n      dataCategory\n    );\n    return hintWithEventId.event_id;\n  }\n  /**\n   * Captures a session.\n   */\n  captureSession(session) {\n    this.sendSession(session);\n    updateSession(session, { init: false });\n  }\n  /**\n   * Get the current Dsn.\n   */\n  getDsn() {\n    return this._dsn;\n  }\n  /**\n   * Get the current options.\n   */\n  getOptions() {\n    return this._options;\n  }\n  /**\n   * Get the resolved data collection configuration.\n   */\n  getDataCollectionOptions() {\n    return this._dataCollection;\n  }\n  /**\n   * Get the SDK metadata.\n   * @see SdkMetadata\n   */\n  getSdkMetadata() {\n    return this._options._metadata;\n  }\n  /**\n   * Returns the transport that is used by the client.\n   * Please note that the transport gets lazy initialized so it will only be there once the first event has been sent.\n   */\n  getTransport() {\n    return this._transport;\n  }\n  /**\n   * Wait for all events to be sent or the timeout to expire, whichever comes first.\n   *\n   * @param timeout Maximum time in ms the client should wait for events to be flushed. Omitting this parameter will\n   *   cause the client to wait until all events are sent before resolving the promise.\n   * @returns A promise that will resolve with `true` if all events are sent before the timeout, or `false` if there are\n   * still events in the queue when the timeout is reached.\n   */\n  // @ts-expect-error - PromiseLike is a subset of Promise\n  async flush(timeout) {\n    const transport = this._transport;\n    this.emit(\"flush\");\n    if (!transport) {\n      return true;\n    }\n    const clientFinished = await this._isClientDoneProcessing(timeout);\n    const transportFlushed = await transport.flush(timeout);\n    return clientFinished && transportFlushed;\n  }\n  /**\n   * Flush the event queue and set the client to `enabled = false`. See {@link Client.flush}.\n   *\n   * @param {number} timeout Maximum time in ms the client should wait before shutting down. Omitting this parameter will cause\n   *   the client to wait until all events are sent before disabling itself.\n   * @returns {Promise<boolean>} A promise which resolves to `true` if the flush completes successfully before the timeout, or `false` if\n   * it doesn't.\n   */\n  // @ts-expect-error - PromiseLike is a subset of Promise\n  async close(timeout) {\n    const result = await this.flush(timeout);\n    this.getOptions().enabled = false;\n    this.emit(\"close\");\n    return result;\n  }\n  /**\n   * Get all installed event processors.\n   */\n  getEventProcessors() {\n    return this._eventProcessors;\n  }\n  /**\n   * Adds an event processor that applies to any event processed by this client.\n   */\n  addEventProcessor(eventProcessor) {\n    this._eventProcessors.push(eventProcessor);\n  }\n  /**\n   * Initialize this client.\n   * Call this after the client was set on a scope.\n   */\n  init() {\n    if (this._isEnabled() || // Force integrations to be setup even if no DSN was set when we have\n    // Spotlight enabled. This is particularly important for browser as we\n    // don't support the `spotlight` option there and rely on the users\n    // adding the `spotlightBrowserIntegration()` to their integrations which\n    // wouldn't get initialized with the check below when there's no DSN set.\n    this._options.integrations.some(({ name }) => name.startsWith(\"Spotlight\"))) {\n      this._setupIntegrations();\n    }\n  }\n  /**\n   * Gets an installed integration by its name.\n   *\n   * @returns {Integration|undefined} The installed integration or `undefined` if no integration with that `name` was installed.\n   */\n  getIntegrationByName(integrationName) {\n    return this._integrations[integrationName];\n  }\n  /**\n   * Returns the names of all installed integrations.\n   */\n  getIntegrationNames() {\n    return Object.keys(this._integrations);\n  }\n  /**\n   * Add an integration to the client.\n   * This can be used to e.g. lazy load integrations.\n   * In most cases, this should not be necessary,\n   * and you're better off just passing the integrations via `integrations: []` at initialization time.\n   * However, if you find the need to conditionally load & add an integration, you can use `addIntegration` to do so.\n   */\n  addIntegration(integration) {\n    const isAlreadyInstalled = this._integrations[integration.name];\n    if (!isAlreadyInstalled && integration.beforeSetup) {\n      integration.beforeSetup(this);\n    }\n    setupIntegration(this, integration, this._integrations);\n    if (!isAlreadyInstalled) {\n      afterSetupIntegrations(this, [integration]);\n    }\n  }\n  /**\n   * Send a fully prepared event to Sentry.\n   */\n  sendEvent(event, hint = {}) {\n    this.emit(\"beforeSendEvent\", event, hint);\n    const genAiSpanItem = extractGenAiSpansFromEvent(event, this);\n    let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n    for (const attachment of hint.attachments || []) {\n      env = addItemToEnvelope(env, createAttachmentEnvelopeItem(attachment));\n    }\n    if (genAiSpanItem) {\n      env = addItemToEnvelope(env, genAiSpanItem);\n    }\n    this.sendEnvelope(env).then((sendResponse) => this.emit(\"afterSendEvent\", event, sendResponse));\n  }\n  /**\n   * Send a session or session aggregrates to Sentry.\n   */\n  sendSession(session) {\n    const { release: clientReleaseOption, environment: clientEnvironmentOption = DEFAULT_ENVIRONMENT } = this._options;\n    if (\"aggregates\" in session) {\n      const sessionAttrs = session.attrs || {};\n      if (!sessionAttrs.release && !clientReleaseOption) {\n        DEBUG_BUILD && debug.warn(MISSING_RELEASE_FOR_SESSION_ERROR);\n        return;\n      }\n      sessionAttrs.release = sessionAttrs.release || clientReleaseOption;\n      sessionAttrs.environment = sessionAttrs.environment || clientEnvironmentOption;\n      session.attrs = sessionAttrs;\n    } else {\n      if (!session.release && !clientReleaseOption) {\n        DEBUG_BUILD && debug.warn(MISSING_RELEASE_FOR_SESSION_ERROR);\n        return;\n      }\n      session.release = session.release || clientReleaseOption;\n      session.environment = session.environment || clientEnvironmentOption;\n    }\n    this.emit(\"beforeSendSession\", session);\n    const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n    this.sendEnvelope(env);\n  }\n  /**\n   * Record on the client that an event got dropped (ie, an event that will not be sent to Sentry).\n   */\n  recordDroppedEvent(reason, category, count = 1) {\n    if (this._options.sendClientReports) {\n      const key = `${reason}:${category}`;\n      DEBUG_BUILD && debug.log(`Recording outcome: \"${key}\"${count > 1 ? ` (${count} times)` : \"\"}`);\n      this._outcomes[key] = (this._outcomes[key] || 0) + count;\n    }\n  }\n  /**\n   * Register a hook on this client.\n   */\n  on(hook, callback) {\n    const hookCallbacks = this._hooks[hook] = this._hooks[hook] || /* @__PURE__ */ new Set();\n    const uniqueCallback = (...args) => callback(...args);\n    hookCallbacks.add(uniqueCallback);\n    return () => {\n      hookCallbacks.delete(uniqueCallback);\n    };\n  }\n  /**\n   * Emit a hook that was previously registered via `on()`.\n   */\n  emit(hook, ...rest) {\n    const callbacks = this._hooks[hook];\n    if (callbacks) {\n      callbacks.forEach((callback) => callback(...rest));\n    }\n  }\n  /**\n   * Send an envelope to Sentry.\n   */\n  // @ts-expect-error - PromiseLike is a subset of Promise\n  async sendEnvelope(envelope) {\n    this.emit(\"beforeEnvelope\", envelope);\n    if (this._isEnabled() && this._transport) {\n      try {\n        return await this._transport.send(envelope);\n      } catch (reason) {\n        DEBUG_BUILD && debug.error(\"Error while sending envelope:\", reason);\n        return {};\n      }\n    }\n    DEBUG_BUILD && debug.error(\"Transport disabled\");\n    return {};\n  }\n  /**\n   * Register a cleanup function to be called when the client is disposed.\n   * This is useful for integrations that need to clean up global state.\n   *\n   * NOTE: This is a no-op in the base `Client` class. Subclasses like `ServerRuntimeClient`\n   * override this method to actually register and execute cleanup callbacks.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  registerCleanup(callback) {\n  }\n  /**\n   * Disposes of the client and releases all resources.\n   *\n   * Subclasses should override this method to clean up their own resources, including invoking\n   * any callbacks registered via {@link Client.registerCleanup}. The base implementation is a\n   * no-op and does NOT execute registered cleanup callbacks.\n   *\n   * After calling dispose(), the client should not be used anymore.\n   */\n  dispose() {\n  }\n  /* eslint-enable @typescript-eslint/unified-signatures */\n  /** Setup integrations for this client. */\n  _setupIntegrations() {\n    const { integrations } = this._options;\n    this._integrations = setupIntegrations(this, integrations);\n    afterSetupIntegrations(this, integrations);\n  }\n  /** Updates existing session based on the provided event */\n  _updateSessionFromEvent(session, event) {\n    let crashed = event.level === \"fatal\";\n    let errored = false;\n    const exceptions = event.exception?.values;\n    if (exceptions) {\n      errored = true;\n      crashed = false;\n      for (const ex of exceptions) {\n        if (ex.mechanism?.handled === false) {\n          crashed = true;\n          break;\n        }\n      }\n    }\n    const sessionNonTerminal = session.status === \"ok\";\n    const shouldUpdateAndSend = sessionNonTerminal && session.errors === 0 || sessionNonTerminal && crashed;\n    if (shouldUpdateAndSend) {\n      updateSession(session, {\n        ...crashed && { status: \"crashed\" },\n        errors: session.errors || Number(errored || crashed)\n      });\n      this.captureSession(session);\n    }\n  }\n  /**\n   * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n   * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n   *\n   * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n   * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n   * `true`.\n   * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n   * `false` otherwise\n   */\n  async _isClientDoneProcessing(timeout) {\n    let ticked = 0;\n    while (!timeout || ticked < timeout) {\n      await new Promise((resolve) => setTimeout(resolve, 1));\n      if (!this._numProcessing) {\n        return true;\n      }\n      ticked++;\n    }\n    return false;\n  }\n  /** Determines whether this SDK is enabled and a transport is present. */\n  _isEnabled() {\n    return this.getOptions().enabled !== false && this._transport !== void 0;\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 currentScope A scope containing event metadata.\n   * @returns A new event with more information.\n   */\n  _prepareEvent(event, hint, currentScope, isolationScope) {\n    const options = this.getOptions();\n    const integrations = this.getIntegrationNames();\n    if (!hint.integrations && integrations.length) {\n      hint.integrations = integrations;\n    }\n    this.emit(\"preprocessEvent\", event, hint);\n    if (!event.type) {\n      isolationScope.setLastEventId(event.event_id || hint.event_id);\n    }\n    return prepareEvent(options, event, hint, currentScope, this, isolationScope).then((evt) => {\n      if (evt === null) {\n        return evt;\n      }\n      this.emit(\"postprocessEvent\", evt, hint);\n      evt.contexts = {\n        trace: { ...evt.contexts?.trace, ...getTraceContextFromScope(currentScope) },\n        ...evt.contexts\n      };\n      const dynamicSamplingContext = getDynamicSamplingContextFromScope(this, currentScope);\n      evt.sdkProcessingMetadata = {\n        dynamicSamplingContext,\n        ...evt.sdkProcessingMetadata\n      };\n      return evt;\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  _captureEvent(event, hint = {}, currentScope = getCurrentScope(), isolationScope = getIsolationScope()) {\n    if (DEBUG_BUILD && isErrorEvent(event)) {\n      debug.log(`Captured error event \\`${getPossibleEventMessages(event)[0] || \"<unknown>\"}\\``);\n    }\n    return this._processEvent(event, hint, currentScope, isolationScope).then(\n      (finalEvent) => {\n        return finalEvent.event_id;\n      },\n      (reason) => {\n        if (DEBUG_BUILD) {\n          if (_isDoNotSendEventError(reason)) {\n            debug.log(reason.message);\n          } else if (_isInternalError(reason)) {\n            debug.warn(reason.message);\n          } else {\n            debug.warn(reason);\n          }\n        }\n        return void 0;\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 currentScope 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  _processEvent(event, hint, currentScope, isolationScope) {\n    const options = this.getOptions();\n    const { sampleRate } = options;\n    const isTransaction = isTransactionEvent(event);\n    const isError = isErrorEvent(event);\n    const eventType = event.type || \"error\";\n    const beforeSendLabel = `before send for type \\`${eventType}\\``;\n    const parsedSampleRate = typeof sampleRate === \"undefined\" ? void 0 : parseSampleRate(sampleRate);\n    const dataCategory = getDataCategoryByType(event.type);\n    return this._prepareEvent(event, hint, currentScope, isolationScope).then((prepared) => {\n      if (prepared === null) {\n        this.recordDroppedEvent(\"event_processor\", dataCategory);\n        throw _makeDoNotSendEventError(\"An event processor returned `null`, will not send event.\");\n      }\n      const isInternalException = hint.data?.__sentry__ === true;\n      if (isInternalException) {\n        return prepared;\n      }\n      const result = processBeforeSend(this, options, prepared, hint);\n      return _validateBeforeSendResult(result, beforeSendLabel);\n    }).then((processedEvent) => {\n      if (processedEvent === null) {\n        this.recordDroppedEvent(\"before_send\", dataCategory);\n        if (isTransaction) {\n          const spans = event.spans || [];\n          const spanCount = 1 + spans.length;\n          this.recordDroppedEvent(\"before_send\", \"span\", spanCount);\n        }\n        throw _makeDoNotSendEventError(`${beforeSendLabel} returned \\`null\\`, will not send event.`);\n      }\n      const session = currentScope.getSession() || isolationScope.getSession();\n      if (isError && session) {\n        this._updateSessionFromEvent(session, processedEvent);\n      }\n      if (isError && typeof parsedSampleRate === \"number\" && safeMathRandom() > parsedSampleRate) {\n        this.recordDroppedEvent(\"sample_rate\", \"error\");\n        throw _makeDoNotSendEventError(\n          `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`\n        );\n      }\n      if (isTransaction) {\n        const spanCountBefore = processedEvent.sdkProcessingMetadata?.spanCountBeforeProcessing || 0;\n        const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0;\n        const droppedSpanCount = spanCountBefore - spanCountAfter;\n        if (droppedSpanCount > 0) {\n          this.recordDroppedEvent(\"before_send\", \"span\", droppedSpanCount);\n        }\n      }\n      const transactionInfo = processedEvent.transaction_info;\n      if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n        const source = \"custom\";\n        processedEvent.transaction_info = {\n          ...transactionInfo,\n          source\n        };\n      }\n      this.sendEvent(processedEvent, hint);\n      return processedEvent;\n    }).then(null, (reason) => {\n      if (_isDoNotSendEventError(reason) || _isInternalError(reason)) {\n        throw reason;\n      }\n      this.captureException(reason, {\n        mechanism: {\n          handled: false,\n          type: \"internal\"\n        },\n        data: {\n          __sentry__: true\n        },\n        originalException: reason\n      });\n      throw _makeInternalError(\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   * Occupies the client with processing and event\n   */\n  _process(taskProducer, dataCategory) {\n    this._numProcessing++;\n    void this._promiseBuffer.add(taskProducer).then(\n      (value) => {\n        this._numProcessing--;\n        return value;\n      },\n      (reason) => {\n        this._numProcessing--;\n        if (reason === SENTRY_BUFFER_FULL_ERROR) {\n          this.recordDroppedEvent(\"queue_overflow\", dataCategory);\n        }\n        return reason;\n      }\n    );\n  }\n  /**\n   * Clears outcomes on this client and returns them.\n   */\n  _clearOutcomes() {\n    const outcomes = this._outcomes;\n    this._outcomes = {};\n    return Object.entries(outcomes).map(([key, quantity]) => {\n      const [reason, category] = key.split(\":\");\n      return {\n        reason,\n        category,\n        quantity\n      };\n    });\n  }\n  /**\n   * Sends client reports as an envelope.\n   */\n  _flushOutcomes() {\n    DEBUG_BUILD && debug.log(\"Flushing outcomes...\");\n    const outcomes = this._clearOutcomes();\n    if (outcomes.length === 0) {\n      DEBUG_BUILD && debug.log(\"No outcomes to send\");\n      return;\n    }\n    if (!this._dsn) {\n      DEBUG_BUILD && debug.log(\"No dsn provided, will not send outcomes\");\n      return;\n    }\n    DEBUG_BUILD && debug.log(\"Sending outcomes:\", outcomes);\n    const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));\n    this.sendEnvelope(envelope);\n  }\n}\nfunction getDataCategoryByType(type) {\n  return type === \"replay_event\" ? \"replay\" : type || \"error\";\n}\nfunction _validateBeforeSendResult(beforeSendResult, beforeSendLabel) {\n  const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n  if (isThenable(beforeSendResult)) {\n    return beforeSendResult.then(\n      (event) => {\n        if (!isPlainObject(event) && event !== null) {\n          throw _makeInternalError(invalidValueError);\n        }\n        return event;\n      },\n      (e) => {\n        throw _makeInternalError(`${beforeSendLabel} rejected with ${e}`);\n      }\n    );\n  } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n    throw _makeInternalError(invalidValueError);\n  }\n  return beforeSendResult;\n}\nfunction processBeforeSend(client, options, event, hint) {\n  const { beforeSend, beforeSendTransaction, ignoreSpans } = options;\n  const beforeSendSpan = !isStreamedBeforeSendSpanCallback(options.beforeSendSpan) && options.beforeSendSpan;\n  let processedEvent = event;\n  if (isErrorEvent(processedEvent) && beforeSend) {\n    return beforeSend(processedEvent, hint);\n  }\n  if (isTransactionEvent(processedEvent)) {\n    if (beforeSendSpan || ignoreSpans) {\n      const rootSpanJson = convertTransactionEventToSpanJson(processedEvent);\n      if (ignoreSpans?.length && shouldIgnoreSpan(\n        { description: rootSpanJson.description, op: rootSpanJson.op, attributes: rootSpanJson.data },\n        ignoreSpans\n      )) {\n        return null;\n      }\n      if (beforeSendSpan) {\n        const processedRootSpanJson = beforeSendSpan(rootSpanJson);\n        if (!processedRootSpanJson) {\n          showSpanDropWarning();\n        } else {\n          processedEvent = merge(event, convertSpanJsonToTransactionEvent(processedRootSpanJson));\n        }\n      }\n      if (processedEvent.spans) {\n        const processedSpans = [];\n        const initialSpans = processedEvent.spans;\n        for (const span of initialSpans) {\n          if (ignoreSpans?.length && shouldIgnoreSpan({ description: span.description, op: span.op, attributes: span.data }, ignoreSpans)) {\n            reparentChildSpans(initialSpans, span);\n            continue;\n          }\n          if (beforeSendSpan) {\n            const processedSpan = beforeSendSpan(span);\n            if (!processedSpan) {\n              showSpanDropWarning();\n              processedSpans.push(span);\n            } else {\n              processedSpans.push(processedSpan);\n            }\n          } else {\n            processedSpans.push(span);\n          }\n        }\n        const droppedSpans = processedEvent.spans.length - processedSpans.length;\n        if (droppedSpans) {\n          client.recordDroppedEvent(\"before_send\", \"span\", droppedSpans);\n        }\n        processedEvent.spans = processedSpans;\n      }\n    }\n    if (beforeSendTransaction) {\n      if (processedEvent.spans) {\n        const spanCountBefore = processedEvent.spans.length;\n        processedEvent.sdkProcessingMetadata = {\n          ...event.sdkProcessingMetadata,\n          spanCountBeforeProcessing: spanCountBefore\n        };\n      }\n      return beforeSendTransaction(processedEvent, hint);\n    }\n  }\n  return processedEvent;\n}\nfunction isErrorEvent(event) {\n  return event.type === void 0;\n}\nfunction isTransactionEvent(event) {\n  return event.type === \"transaction\";\n}\nfunction estimateMetricSizeInBytes(metric) {\n  let weight = 0;\n  if (metric.name) {\n    weight += metric.name.length * 2;\n  }\n  weight += 8;\n  return weight + estimateAttributesSizeInBytes(metric.attributes);\n}\nfunction estimateLogSizeInBytes(log) {\n  let weight = 0;\n  if (log.message) {\n    weight += log.message.length * 2;\n  }\n  return weight + estimateAttributesSizeInBytes(log.attributes);\n}\nfunction estimateAttributesSizeInBytes(attributes) {\n  if (!attributes) {\n    return 0;\n  }\n  let weight = 0;\n  Object.values(attributes).forEach((value) => {\n    if (Array.isArray(value)) {\n      weight += value.length * estimatePrimitiveSizeInBytes(value[0]);\n    } else if (isPrimitive(value)) {\n      weight += estimatePrimitiveSizeInBytes(value);\n    } else {\n      weight += 100;\n    }\n  });\n  return weight;\n}\nfunction estimatePrimitiveSizeInBytes(value) {\n  if (typeof value === \"string\") {\n    return value.length * 2;\n  } else if (typeof value === \"number\") {\n    return 8;\n  } else if (typeof value === \"boolean\") {\n    return 4;\n  }\n  return 0;\n}\n\nexport { Client };\n//# sourceMappingURL=client.js.map\n","import { getCurrentScope } from './currentScopes.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { debug, consoleSandbox } from './utils/debug-logger.js';\n\nfunction initAndBind(clientClass, options) {\n  if (options.debug === true) {\n    if (DEBUG_BUILD) {\n      debug.enable();\n    } else {\n      consoleSandbox(() => {\n        console.warn(\"[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.\");\n      });\n    }\n  }\n  const scope = getCurrentScope();\n  scope.update(options.initialScope);\n  const client = new clientClass(options);\n  setCurrentClient(client);\n  client.init();\n  return client;\n}\nfunction setCurrentClient(client) {\n  getCurrentScope().setClient(client);\n}\n\nexport { initAndBind, setCurrentClient };\n//# sourceMappingURL=sdk.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { debug } from '../utils/debug-logger.js';\nimport { envelopeContainsItemType } from '../utils/envelope.js';\nimport { safeDateNow } from '../utils/randomSafeContext.js';\nimport { parseRetryAfterHeader } from '../utils/ratelimit.js';\nimport { safeUnref } from '../utils/timer.js';\n\nconst MIN_DELAY = 100;\nconst START_DELAY = 5e3;\nconst MAX_DELAY = 36e5;\nfunction makeOfflineTransport(createTransport) {\n  function log(...args) {\n    DEBUG_BUILD && debug.log(\"[Offline]:\", ...args);\n  }\n  return (options) => {\n    const transport = createTransport(options);\n    if (!options.createStore) {\n      throw new Error(\"No `createStore` function was provided\");\n    }\n    const store = options.createStore(options);\n    let retryDelay = START_DELAY;\n    let flushTimer;\n    function shouldQueue(env, error, retryDelay2) {\n      if (envelopeContainsItemType(env, [\"client_report\"])) {\n        return false;\n      }\n      if (options.shouldStore) {\n        return options.shouldStore(env, error, retryDelay2);\n      }\n      return true;\n    }\n    function flushIn(delay) {\n      if (flushTimer) {\n        clearTimeout(flushTimer);\n      }\n      flushTimer = safeUnref(\n        setTimeout(async () => {\n          flushTimer = void 0;\n          const found = await store.shift();\n          if (found) {\n            log(\"Attempting to send previously queued event\");\n            found[0].sent_at = new Date(safeDateNow()).toISOString();\n            void send(found, true).catch((e) => {\n              log(\"Failed to retry sending\", e);\n            });\n          }\n        }, delay)\n      );\n    }\n    function flushWithBackOff() {\n      if (flushTimer) {\n        return;\n      }\n      flushIn(retryDelay);\n      retryDelay = Math.min(retryDelay * 2, MAX_DELAY);\n    }\n    async function send(envelope, isRetry = false) {\n      if (!isRetry && envelopeContainsItemType(envelope, [\"replay_event\", \"replay_recording\"])) {\n        await store.push(envelope);\n        flushIn(MIN_DELAY);\n        return {};\n      }\n      try {\n        if (options.shouldSend && await options.shouldSend(envelope) === false) {\n          throw new Error(\"Envelope not sent because `shouldSend` callback returned false\");\n        }\n        const result = await transport.send(envelope);\n        let delay = MIN_DELAY;\n        if (result) {\n          if (result.headers?.[\"retry-after\"]) {\n            delay = parseRetryAfterHeader(result.headers[\"retry-after\"]);\n          } else if (result.headers?.[\"x-sentry-rate-limits\"]) {\n            delay = 6e4;\n          } else if ((result.statusCode || 0) >= 400) {\n            return result;\n          }\n        }\n        flushIn(delay);\n        retryDelay = START_DELAY;\n        return result;\n      } catch (e) {\n        if (await shouldQueue(envelope, e, retryDelay)) {\n          if (isRetry) {\n            await store.unshift(envelope);\n          } else {\n            await store.push(envelope);\n          }\n          flushWithBackOff();\n          log(\"Error sending. Event queued.\", e);\n          return {};\n        } else {\n          throw e;\n        }\n      }\n    }\n    if (options.flushAtStartup) {\n      flushWithBackOff();\n    }\n    return {\n      send,\n      flush: (timeout) => {\n        if (timeout === void 0) {\n          retryDelay = START_DELAY;\n          flushIn(MIN_DELAY);\n        }\n        return transport.flush(timeout);\n      }\n    };\n  };\n}\n\nexport { MIN_DELAY, START_DELAY, makeOfflineTransport };\n//# sourceMappingURL=offline.js.map\n","import { URL_FULL } from '@sentry/conventions/attributes';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../semanticAttributes.js';\n\nconst DEFAULT_BASE_URL = \"thismessage:/\";\nfunction isURLObjectRelative(url) {\n  return \"isRelative\" in url;\n}\nfunction parseStringToURLObject(url, urlBase) {\n  const isRelative = url.indexOf(\"://\") <= 0 && url.indexOf(\"//\") !== 0;\n  const base = urlBase ?? (isRelative ? DEFAULT_BASE_URL : void 0);\n  try {\n    if (\"canParse\" in URL && !URL.canParse(url, base)) {\n      return void 0;\n    }\n    const fullUrlObject = new URL(url, base);\n    if (isRelative) {\n      return {\n        isRelative,\n        pathname: fullUrlObject.pathname,\n        search: fullUrlObject.search,\n        hash: fullUrlObject.hash\n      };\n    }\n    return fullUrlObject;\n  } catch {\n  }\n  return void 0;\n}\nfunction getSanitizedUrlStringFromUrlObject(url) {\n  if (isURLObjectRelative(url)) {\n    return url.pathname;\n  }\n  const newUrl = new URL(url);\n  newUrl.search = \"\";\n  newUrl.hash = \"\";\n  if ([\"80\", \"443\"].includes(newUrl.port)) {\n    newUrl.port = \"\";\n  }\n  if (newUrl.password) {\n    newUrl.password = \"%filtered%\";\n  }\n  if (newUrl.username) {\n    newUrl.username = \"%filtered%\";\n  }\n  return newUrl.toString();\n}\nfunction getHttpSpanNameFromUrlObject(urlObject, kind, request, routeName) {\n  const method = request?.method?.toUpperCase() ?? \"GET\";\n  const route = routeName ? routeName : urlObject ? kind === \"client\" ? getSanitizedUrlStringFromUrlObject(urlObject) : urlObject.pathname : \"/\";\n  return `${method} ${route}`;\n}\nfunction getHttpSpanDetailsFromUrlObject(urlObject, kind, spanOrigin, request, routeName) {\n  const attributes = {\n    [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,\n    [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: \"url\"\n  };\n  if (routeName) {\n    attributes[kind === \"server\" ? \"http.route\" : \"url.template\"] = routeName;\n    attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = \"route\";\n  }\n  if (request?.method) {\n    attributes[SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD] = request.method.toUpperCase();\n  }\n  if (urlObject) {\n    if (urlObject.search) {\n      attributes[\"url.query\"] = urlObject.search;\n    }\n    if (urlObject.hash) {\n      attributes[\"url.fragment\"] = urlObject.hash;\n    }\n    if (urlObject.pathname) {\n      attributes[\"url.path\"] = urlObject.pathname;\n      if (urlObject.pathname === \"/\") {\n        attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = \"route\";\n      }\n    }\n    if (!isURLObjectRelative(urlObject)) {\n      attributes[URL_FULL] = urlObject.href;\n      if (urlObject.port) {\n        attributes[\"url.port\"] = urlObject.port;\n      }\n      if (urlObject.protocol) {\n        attributes[\"url.scheme\"] = urlObject.protocol;\n      }\n      if (urlObject.hostname) {\n        attributes[kind === \"server\" ? \"server.address\" : \"url.domain\"] = urlObject.hostname;\n      }\n    }\n  }\n  return [getHttpSpanNameFromUrlObject(urlObject, kind, request, routeName), attributes];\n}\nfunction parseUrl(url) {\n  if (!url) {\n    return {};\n  }\n  const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n  if (!match) {\n    return {};\n  }\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    search: query,\n    hash: fragment,\n    relative: match[5] + query + fragment\n    // everything minus origin\n  };\n}\nfunction stripUrlQueryAndFragment(urlPath) {\n  return urlPath.split(/[?#]/, 1)[0];\n}\nfunction getSanitizedUrlString(url) {\n  const { protocol, host, path } = url;\n  const filteredHost = host?.replace(/^.*@/, \"[filtered]:[filtered]@\").replace(/(:80)$/, \"\").replace(/(:443)$/, \"\") || \"\";\n  return `${protocol ? `${protocol}://` : \"\"}${filteredHost}${path}`;\n}\nfunction stripDataUrlContent(url, includeDataPrefix = true) {\n  if (url.startsWith(\"data:\")) {\n    const match = url.match(/^data:([^;,]+)/);\n    const mimeType = match ? match[1] : \"text/plain\";\n    const isBase64 = url.includes(\";base64,\");\n    const dataStart = url.indexOf(\",\");\n    let dataPrefix = \"\";\n    if (includeDataPrefix && dataStart !== -1) {\n      const data = url.slice(dataStart + 1);\n      dataPrefix = data.length > 10 ? `${data.slice(0, 10)}... [truncated]` : data;\n    }\n    return `data:${mimeType}${isBase64 ? \",base64\" : \"\"}${dataPrefix ? `,${dataPrefix}` : \"\"}`;\n  }\n  return url;\n}\n\nexport { getHttpSpanDetailsFromUrlObject, getSanitizedUrlString, getSanitizedUrlStringFromUrlObject, isURLObjectRelative, parseStringToURLObject, parseUrl, stripDataUrlContent, stripUrlQueryAndFragment };\n//# sourceMappingURL=url.js.map\n","import { parseStringToURLObject, isURLObjectRelative } from './url.js';\n\nfunction isSentryRequestUrl(url, client) {\n  const dsn = client?.getDsn();\n  const tunnel = client?.getOptions().tunnel;\n  return checkDsn(url, dsn) || checkTunnel(url, tunnel);\n}\nfunction checkTunnel(url, tunnel) {\n  if (!tunnel) {\n    return false;\n  }\n  return removeTrailingSlash(url) === removeTrailingSlash(tunnel);\n}\nfunction checkDsn(url, dsn) {\n  const urlParts = parseStringToURLObject(url);\n  if (!urlParts || isURLObjectRelative(urlParts)) {\n    return false;\n  }\n  if (!dsn) {\n    return false;\n  }\n  return hostnameMatchesDsnHost(urlParts.hostname, dsn.host) && /(^|&|\\?)sentry_key=/.test(urlParts.search);\n}\nfunction hostnameMatchesDsnHost(hostname, dsnHost) {\n  return hostname === dsnHost || dsnHost.length > 0 && hostname.endsWith(`.${dsnHost}`);\n}\nfunction removeTrailingSlash(str) {\n  return str[str.length - 1] === \"/\" ? str.slice(0, -1) : str;\n}\n\nexport { isSentryRequestUrl };\n//# sourceMappingURL=isSentryRequestUrl.js.map\n","function parameterize(strings, ...values) {\n  const formatted = new String(String.raw(strings, ...values));\n  formatted.__sentry_template_string__ = strings.join(\"\\0\").replace(/%/g, \"%%\").replace(/\\0/g, \"%s\");\n  formatted.__sentry_template_values__ = values;\n  return formatted;\n}\nconst fmt = parameterize;\n\nexport { fmt, parameterize };\n//# sourceMappingURL=parameterize.js.map\n","import { getAsyncContextStrategy } from '../asyncContext/index.js';\nimport { getMainCarrier } from '../carrier.js';\nimport { getClient, getCurrentScope, hasExternalPropagationContext } from '../currentScopes.js';\nimport { isEnabled } from '../exports.js';\nimport { debug } from './debug-logger.js';\nimport { getActiveSpan, spanToTraceHeader, spanToTraceparentHeader } from './spanUtils.js';\nimport { hasSpansEnabled } from './hasSpansEnabled.js';\nimport { spanIsNonRecordingSpan } from '../tracing/sentryNonRecordingSpan.js';\nimport { getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromScope } from '../tracing/dynamicSamplingContext.js';\nimport { dynamicSamplingContextToSentryBaggageHeader } from './baggage.js';\nimport { TRACEPARENT_REGEXP, generateSentryTraceHeader, generateTraceparentHeader } from './tracing.js';\n\nfunction getTraceData(options = {}) {\n  const client = options.client || getClient();\n  if (!isEnabled() || !client) {\n    return {};\n  }\n  const carrier = getMainCarrier();\n  const acs = getAsyncContextStrategy(carrier);\n  if (acs.getTraceData) {\n    return acs.getTraceData(options);\n  }\n  const scope = options.scope || getCurrentScope();\n  const span = options.span || getActiveSpan();\n  const isTwpPlaceholder = spanIsNonRecordingSpan(span) && !hasSpansEnabled(client.getOptions());\n  if (!span && hasExternalPropagationContext()) {\n    return {};\n  }\n  const sentryTrace = span && !isTwpPlaceholder ? spanToTraceHeader(span) : scopeToTraceHeader(scope);\n  const dsc = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(client, scope);\n  const baggage = dynamicSamplingContextToSentryBaggageHeader(dsc);\n  const isValidSentryTraceHeader = TRACEPARENT_REGEXP.test(sentryTrace);\n  if (!isValidSentryTraceHeader) {\n    debug.warn(\"Invalid sentry-trace data. Cannot generate trace data\");\n    return {};\n  }\n  const traceData = {\n    \"sentry-trace\": sentryTrace,\n    baggage\n  };\n  if (options.propagateTraceparent) {\n    traceData.traceparent = span && !isTwpPlaceholder ? spanToTraceparentHeader(span) : scopeToTraceparentHeader(scope);\n  }\n  return traceData;\n}\nfunction scopeToTraceHeader(scope) {\n  const { traceId, sampled, propagationSpanId } = scope.getPropagationContext();\n  return generateSentryTraceHeader(traceId, propagationSpanId, sampled);\n}\nfunction scopeToTraceparentHeader(scope) {\n  const { traceId, sampled, propagationSpanId } = scope.getPropagationContext();\n  return generateTraceparentHeader(traceId, propagationSpanId, sampled);\n}\n\nexport { getTraceData };\n//# sourceMappingURL=traceData.js.map\n","import { getClient, getIsolationScope } from './currentScopes.js';\nimport { consoleSandbox } from './utils/debug-logger.js';\nimport { dateTimestampInSeconds } from './utils/time.js';\n\nconst DEFAULT_BREADCRUMBS = 100;\nfunction addBreadcrumb(breadcrumb, hint) {\n  const client = getClient();\n  const isolationScope = getIsolationScope();\n  if (!client) return;\n  const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client.getOptions();\n  if (maxBreadcrumbs <= 0) return;\n  const timestamp = dateTimestampInSeconds();\n  const mergedBreadcrumb = { timestamp, ...breadcrumb };\n  const finalBreadcrumb = beforeBreadcrumb ? consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) : mergedBreadcrumb;\n  if (finalBreadcrumb === null) return;\n  if (client.emit) {\n    client.emit(\"beforeAddBreadcrumb\", finalBreadcrumb, hint);\n  }\n  isolationScope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n}\n\nexport { addBreadcrumb };\n//# sourceMappingURL=breadcrumbs.js.map\n","import { getClient } from '../currentScopes.js';\nimport { defineIntegration } from '../integration.js';\nimport { getOriginalFunction } from '../utils/object.js';\n\nconst INTEGRATION_NAME = \"FunctionToString\";\nconst SETUP_CLIENTS = /* @__PURE__ */ new WeakMap();\nconst _functionToStringIntegration = (() => {\n  return {\n    name: INTEGRATION_NAME,\n    setupOnce() {\n      const originalFunctionToString = Function.prototype.toString;\n      try {\n        Function.prototype.toString = function(...args) {\n          const originalFunction = getOriginalFunction(this);\n          let unwrappedFunction;\n          try {\n            if (SETUP_CLIENTS.has(getClient()) && originalFunction !== void 0) {\n              unwrappedFunction = originalFunction;\n            }\n          } catch {\n          }\n          return originalFunctionToString.apply(unwrappedFunction ?? this, args);\n        };\n      } catch {\n      }\n    },\n    setup(client) {\n      SETUP_CLIENTS.set(client, true);\n    }\n  };\n});\nconst functionToStringIntegration = defineIntegration(_functionToStringIntegration);\n\nexport { functionToStringIntegration };\n//# sourceMappingURL=functiontostring.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { defineIntegration } from '../integration.js';\nimport { debug } from '../utils/debug-logger.js';\nimport { getPossibleEventMessages } from '../utils/eventUtils.js';\nimport { getEventDescription } from '../utils/misc.js';\nimport { stringMatchesSomePattern } from '../utils/string.js';\n\nconst DEFAULT_IGNORE_ERRORS = [\n  /^Script error\\.?$/,\n  /^Javascript error: Script error\\.? on line 0$/,\n  /^ResizeObserver loop completed with undelivered notifications.$/,\n  // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness.\n  /^Cannot redefine property: googletag$/,\n  // This is thrown when google tag manager is used in combination with an ad blocker\n  /^Can't find variable: gmo$/,\n  // Error from Google Search App https://issuetracker.google.com/issues/396043331\n  /^undefined is not an object \\(evaluating 'a\\.[A-Z]'\\)$/,\n  // Random error that happens but not actionable or noticeable to end-users.\n  /can't redefine non-configurable property \"solana\"/,\n  // Probably a browser extension or custom browser (Brave) throwing this error\n  /vv\\(\\)\\.getRestrictions is not a function/,\n  // Error thrown by GTM, seemingly not affecting end-users\n  /Can't find variable: _AutofillCallbackHandler/,\n  // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/\n  /Object Not Found Matching Id:\\d+, MethodName:simulateEvent/,\n  // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps\n  /Java exception was raised during method invocation$/,\n  // error from Facebook Mobile browser (https://github.com/getsentry/sentry-javascript/issues/15065, https://github.com/getsentry/sentry-javascript/issues/23733)\n  /Java object is gone$/\n  // error from Facebook Mobile browser (https://github.com/getsentry/sentry-javascript/issues/15065, https://github.com/getsentry/sentry-javascript/issues/23733)\n];\nconst INTEGRATION_NAME = \"EventFilters\";\nconst eventFiltersIntegration = defineIntegration((options = {}) => {\n  let mergedOptions;\n  return {\n    name: INTEGRATION_NAME,\n    setup(client) {\n      const clientOptions = client.getOptions();\n      mergedOptions = _mergeOptions(options, clientOptions);\n    },\n    processEvent(event, _hint, client) {\n      if (!mergedOptions) {\n        const clientOptions = client.getOptions();\n        mergedOptions = _mergeOptions(options, clientOptions);\n      }\n      return _shouldDropEvent(event, mergedOptions) ? null : event;\n    }\n  };\n});\nconst inboundFiltersIntegration = defineIntegration(((options = {}) => {\n  return {\n    ...eventFiltersIntegration(options),\n    name: \"InboundFilters\"\n  };\n}));\nfunction _mergeOptions(internalOptions = {}, clientOptions = {}) {\n  return {\n    allowUrls: [...internalOptions.allowUrls || [], ...clientOptions.allowUrls || []],\n    denyUrls: [...internalOptions.denyUrls || [], ...clientOptions.denyUrls || []],\n    ignoreErrors: [\n      ...internalOptions.ignoreErrors || [],\n      ...clientOptions.ignoreErrors || [],\n      ...internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS\n    ],\n    ignoreTransactions: [...internalOptions.ignoreTransactions || [], ...clientOptions.ignoreTransactions || []]\n  };\n}\nfunction _shouldDropEvent(event, options) {\n  if (!event.type) {\n    if (_isIgnoredError(event, options.ignoreErrors)) {\n      DEBUG_BUILD && debug.warn(\n        `Event dropped due to being matched by \\`ignoreErrors\\` option.\nEvent: ${getEventDescription(event)}`\n      );\n      return true;\n    }\n    if (_isUselessError(event)) {\n      DEBUG_BUILD && debug.warn(\n        `Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${getEventDescription(\n          event\n        )}`\n      );\n      return true;\n    }\n    if (_isDeniedUrl(event, options.denyUrls)) {\n      DEBUG_BUILD && debug.warn(\n        `Event dropped due to being matched by \\`denyUrls\\` option.\nEvent: ${getEventDescription(\n          event\n        )}.\nUrl: ${_getEventFilterUrl(event)}`\n      );\n      return true;\n    }\n    if (!_isAllowedUrl(event, options.allowUrls)) {\n      DEBUG_BUILD && debug.warn(\n        `Event dropped due to not being matched by \\`allowUrls\\` option.\nEvent: ${getEventDescription(\n          event\n        )}.\nUrl: ${_getEventFilterUrl(event)}`\n      );\n      return true;\n    }\n  } else if (event.type === \"transaction\") {\n    if (_isIgnoredTransaction(event, options.ignoreTransactions)) {\n      DEBUG_BUILD && debug.warn(\n        `Event dropped due to being matched by \\`ignoreTransactions\\` option.\nEvent: ${getEventDescription(event)}`\n      );\n      return true;\n    }\n  }\n  return false;\n}\nfunction _isIgnoredError(event, ignoreErrors) {\n  if (!ignoreErrors?.length) {\n    return false;\n  }\n  return getPossibleEventMessages(event).some((message) => stringMatchesSomePattern(message, ignoreErrors));\n}\nfunction _isIgnoredTransaction(event, ignoreTransactions) {\n  if (!ignoreTransactions?.length) {\n    return false;\n  }\n  const name = event.transaction;\n  return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;\n}\nfunction _isDeniedUrl(event, denyUrls) {\n  if (!denyUrls?.length) {\n    return false;\n  }\n  const url = _getEventFilterUrl(event);\n  return !url ? false : stringMatchesSomePattern(url, denyUrls);\n}\nfunction _isAllowedUrl(event, allowUrls) {\n  if (!allowUrls?.length) {\n    return true;\n  }\n  const url = _getEventFilterUrl(event);\n  return !url ? true : stringMatchesSomePattern(url, allowUrls);\n}\nfunction _getLastValidUrl(frames = []) {\n  for (let i = frames.length - 1; i >= 0; i--) {\n    const frame = frames[i];\n    if (frame && frame.filename !== \"<anonymous>\" && frame.filename !== \"[native code]\") {\n      return frame.filename || null;\n    }\n  }\n  return null;\n}\nfunction _getEventFilterUrl(event) {\n  try {\n    const rootException = [...event.exception?.values ?? []].reverse().find((value) => value.mechanism?.parent_id === void 0 && value.stacktrace?.frames?.length);\n    const frames = rootException?.stacktrace?.frames;\n    return frames ? _getLastValidUrl(frames) : null;\n  } catch {\n    DEBUG_BUILD && debug.error(`Cannot extract url for event ${getEventDescription(event)}`);\n    return null;\n  }\n}\nfunction _isUselessError(event) {\n  if (!event.exception?.values?.length) {\n    return false;\n  }\n  return (\n    // No top-level message\n    !event.message && // There are no exception values that have a stacktrace, a non-generic-Error type or value\n    !event.exception.values.some((value) => value.stacktrace || value.type && value.type !== \"Error\" || value.value)\n  );\n}\n\nexport { eventFiltersIntegration, inboundFiltersIntegration };\n//# sourceMappingURL=eventFilters.js.map\n","import { isError } from './is.js';\n\nfunction applyAggregateErrorsToEvent(exceptionFromErrorImplementation, parser, key, limit, event, hint) {\n  if (!event.exception?.values || !hint || !isError(hint.originalException)) {\n    return;\n  }\n  const originalException = event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : void 0;\n  if (originalException) {\n    event.exception.values = aggregateExceptionsFromError(\n      exceptionFromErrorImplementation,\n      parser,\n      limit,\n      hint.originalException,\n      key,\n      event.exception.values,\n      originalException,\n      0\n    );\n  }\n}\nfunction aggregateExceptionsFromError(exceptionFromErrorImplementation, parser, limit, error, key, prevExceptions, exception, exceptionId) {\n  if (prevExceptions.length >= limit + 1) {\n    return prevExceptions;\n  }\n  let newExceptions = [...prevExceptions];\n  if (isError(error[key])) {\n    applyExceptionGroupFieldsForParentException(exception, exceptionId, error);\n    const newException = exceptionFromErrorImplementation(parser, error[key]);\n    const newExceptionId = newExceptions.length;\n    applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);\n    newExceptions = aggregateExceptionsFromError(\n      exceptionFromErrorImplementation,\n      parser,\n      limit,\n      error[key],\n      key,\n      [newException, ...newExceptions],\n      newException,\n      newExceptionId\n    );\n  }\n  if (isExceptionGroup(error)) {\n    error.errors.forEach((childError, i) => {\n      if (isError(childError)) {\n        applyExceptionGroupFieldsForParentException(exception, exceptionId, error);\n        const newException = exceptionFromErrorImplementation(parser, childError);\n        const newExceptionId = newExceptions.length;\n        applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);\n        newExceptions = aggregateExceptionsFromError(\n          exceptionFromErrorImplementation,\n          parser,\n          limit,\n          childError,\n          key,\n          [newException, ...newExceptions],\n          newException,\n          newExceptionId\n        );\n      }\n    });\n  }\n  return newExceptions;\n}\nfunction isExceptionGroup(error) {\n  return Array.isArray(error.errors);\n}\nfunction applyExceptionGroupFieldsForParentException(exception, exceptionId, error) {\n  exception.mechanism = {\n    handled: true,\n    type: \"auto.core.linked_errors\",\n    ...isExceptionGroup(error) && { is_exception_group: true },\n    ...exception.mechanism,\n    exception_id: exceptionId\n  };\n}\nfunction applyExceptionGroupFieldsForChildException(exception, source, exceptionId, parentId) {\n  exception.mechanism = {\n    handled: true,\n    ...exception.mechanism,\n    type: \"chained\",\n    source,\n    exception_id: exceptionId,\n    parent_id: parentId\n  };\n}\n\nexport { applyAggregateErrorsToEvent };\n//# sourceMappingURL=aggregate-errors.js.map\n","import { isParameterizedString, isError, isPlainObject, isErrorEvent } from './is.js';\nimport { addExceptionMechanism, addExceptionTypeValue } from './misc.js';\nimport { normalizeToSize } from './normalize.js';\nimport { extractExceptionKeysForMessage } from './object.js';\n\nfunction parseStackFrames(stackParser, error) {\n  return stackParser(error.stack || \"\", 1);\n}\nfunction hasSentryFetchUrlHost(error) {\n  return isError(error) && \"__sentry_fetch_url_host__\" in error && typeof error.__sentry_fetch_url_host__ === \"string\";\n}\nfunction _enhanceErrorWithSentryInfo(error) {\n  if (hasSentryFetchUrlHost(error)) {\n    return `${error.message} (${error.__sentry_fetch_url_host__})`;\n  }\n  return error.message;\n}\nfunction exceptionFromError(stackParser, error) {\n  const exception = {\n    type: error.name || error.constructor.name,\n    value: _enhanceErrorWithSentryInfo(error)\n  };\n  const frames = parseStackFrames(stackParser, error);\n  if (frames.length) {\n    exception.stacktrace = { frames };\n  }\n  return exception;\n}\nfunction getErrorPropertyFromObject(obj) {\n  for (const prop in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n      const value = obj[prop];\n      if (isError(value)) {\n        return value;\n      }\n    }\n  }\n  return void 0;\n}\nfunction getMessageForObject(exception) {\n  if (\"name\" in exception && typeof exception.name === \"string\") {\n    let message = `'${exception.name}' captured as exception`;\n    if (\"message\" in exception && typeof exception.message === \"string\") {\n      message += ` with message '${exception.message}'`;\n    }\n    return message;\n  } else if (\"message\" in exception && typeof exception.message === \"string\") {\n    return exception.message;\n  }\n  const keys = extractExceptionKeysForMessage(exception);\n  if (isErrorEvent(exception)) {\n    return `Event \\`ErrorEvent\\` captured as exception with message \\`${exception.message}\\``;\n  }\n  const className = getObjectClassName(exception);\n  return `${className && className !== \"Object\" ? `'${className}'` : \"Object\"} captured as exception with keys: ${keys}`;\n}\nfunction getObjectClassName(obj) {\n  try {\n    const prototype = Object.getPrototypeOf(obj);\n    return prototype ? prototype.constructor.name : void 0;\n  } catch {\n  }\n}\nfunction getException(client, mechanism, exception, hint) {\n  if (isError(exception)) {\n    return [exception, void 0];\n  }\n  mechanism.synthetic = true;\n  if (isPlainObject(exception)) {\n    const normalizeDepth = client?.getOptions().normalizeDepth;\n    const extras = { [\"__serialized__\"]: normalizeToSize(exception, normalizeDepth) };\n    const errorFromProp = getErrorPropertyFromObject(exception);\n    if (errorFromProp) {\n      return [errorFromProp, extras];\n    }\n    const message = getMessageForObject(exception);\n    const ex2 = hint?.syntheticException || new Error(message);\n    ex2.message = message;\n    return [ex2, extras];\n  }\n  const ex = hint?.syntheticException || new Error(exception);\n  ex.message = `${exception}`;\n  return [ex, void 0];\n}\nfunction eventFromUnknownInput(client, stackParser, exception, hint) {\n  const providedMechanism = hint?.data && hint.data.mechanism;\n  const mechanism = providedMechanism || {\n    handled: true,\n    type: \"generic\"\n  };\n  const [ex, extras] = getException(client, mechanism, exception, hint);\n  const event = {\n    exception: {\n      values: [exceptionFromError(stackParser, ex)]\n    }\n  };\n  if (extras) {\n    event.extra = extras;\n  }\n  addExceptionTypeValue(event, void 0, void 0);\n  addExceptionMechanism(event, mechanism);\n  return {\n    ...event,\n    event_id: hint?.event_id\n  };\n}\nfunction eventFromMessage(stackParser, message, level = \"info\", hint, attachStacktrace) {\n  const event = {\n    event_id: hint?.event_id,\n    level\n  };\n  if (attachStacktrace && hint?.syntheticException) {\n    const frames = parseStackFrames(stackParser, hint.syntheticException);\n    if (frames.length) {\n      event.exception = {\n        values: [\n          {\n            value: message,\n            stacktrace: { frames }\n          }\n        ]\n      };\n      addExceptionMechanism(event, { synthetic: true });\n    }\n  }\n  if (isParameterizedString(message)) {\n    const { __sentry_template_string__, __sentry_template_values__ } = message;\n    event.logentry = {\n      message: __sentry_template_string__,\n      params: __sentry_template_values__\n    };\n    return event;\n  }\n  event.message = message;\n  return event;\n}\n\nexport { _enhanceErrorWithSentryInfo, eventFromMessage, eventFromUnknownInput, exceptionFromError, parseStackFrames };\n//# sourceMappingURL=eventbuilder.js.map\n","import { defineIntegration } from '../integration.js';\nimport { applyAggregateErrorsToEvent } from '../utils/aggregate-errors.js';\nimport { exceptionFromError } from '../utils/eventbuilder.js';\n\nconst DEFAULT_KEY = \"cause\";\nconst DEFAULT_LIMIT = 5;\nconst INTEGRATION_NAME = \"LinkedErrors\";\nconst _linkedErrorsIntegration = ((options = {}) => {\n  const limit = options.limit || DEFAULT_LIMIT;\n  const key = options.key || DEFAULT_KEY;\n  return {\n    name: INTEGRATION_NAME,\n    preprocessEvent(event, hint, client) {\n      const options2 = client.getOptions();\n      applyAggregateErrorsToEvent(exceptionFromError, options2.stackParser, key, limit, event, hint);\n    }\n  };\n});\nconst linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration);\n\nexport { linkedErrorsIntegration };\n//# sourceMappingURL=linkederrors.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { defineIntegration } from '../integration.js';\nimport { debug } from '../utils/debug-logger.js';\nimport { getFramesFromEvent } from '../utils/stacktrace.js';\n\nconst INTEGRATION_NAME = \"Dedupe\";\nconst _dedupeIntegration = (() => {\n  let previousEvent;\n  return {\n    name: INTEGRATION_NAME,\n    processEvent(currentEvent) {\n      if (currentEvent.type) {\n        return currentEvent;\n      }\n      try {\n        if (_shouldDropEvent(currentEvent, previousEvent)) {\n          DEBUG_BUILD && debug.warn(\"Event dropped due to being a duplicate of previously captured event.\");\n          return null;\n        }\n      } catch {\n      }\n      return previousEvent = currentEvent;\n    }\n  };\n});\nconst dedupeIntegration = defineIntegration(_dedupeIntegration);\nfunction _shouldDropEvent(currentEvent, previousEvent) {\n  if (!previousEvent) {\n    return false;\n  }\n  if (_isSameMessageEvent(currentEvent, previousEvent)) {\n    return true;\n  }\n  if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n    return true;\n  }\n  return false;\n}\nfunction _isSameMessageEvent(currentEvent, previousEvent) {\n  const currentMessage = currentEvent.message;\n  const previousMessage = previousEvent.message;\n  if (!currentMessage && !previousMessage) {\n    return false;\n  }\n  if (currentMessage && !previousMessage || !currentMessage && previousMessage) {\n    return false;\n  }\n  if (currentMessage !== previousMessage) {\n    return false;\n  }\n  if (!_isSameFingerprint(currentEvent, previousEvent)) {\n    return false;\n  }\n  if (!_isSameStacktrace(currentEvent, previousEvent)) {\n    return false;\n  }\n  return true;\n}\nfunction _isSameExceptionEvent(currentEvent, previousEvent) {\n  const previousException = _getExceptionFromEvent(previousEvent);\n  const currentException = _getExceptionFromEvent(currentEvent);\n  if (!previousException || !currentException) {\n    return false;\n  }\n  if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n    return false;\n  }\n  if (!_isSameFingerprint(currentEvent, previousEvent)) {\n    return false;\n  }\n  if (!_isSameStacktrace(currentEvent, previousEvent)) {\n    return false;\n  }\n  return true;\n}\nfunction _isSameStacktrace(currentEvent, previousEvent) {\n  let currentFrames = getFramesFromEvent(currentEvent);\n  let previousFrames = getFramesFromEvent(previousEvent);\n  if (!currentFrames && !previousFrames) {\n    return true;\n  }\n  if (currentFrames && !previousFrames || !currentFrames && previousFrames) {\n    return false;\n  }\n  currentFrames = currentFrames;\n  previousFrames = previousFrames;\n  if (previousFrames.length !== currentFrames.length) {\n    return false;\n  }\n  for (let i = 0; i < previousFrames.length; i++) {\n    const frameA = previousFrames[i];\n    const frameB = currentFrames[i];\n    if (frameA.filename !== frameB.filename || frameA.lineno !== frameB.lineno || frameA.colno !== frameB.colno || frameA.function !== frameB.function) {\n      return false;\n    }\n  }\n  return true;\n}\nfunction _isSameFingerprint(currentEvent, previousEvent) {\n  let currentFingerprint = currentEvent.fingerprint;\n  let previousFingerprint = previousEvent.fingerprint;\n  if (!currentFingerprint && !previousFingerprint) {\n    return true;\n  }\n  if (currentFingerprint && !previousFingerprint || !currentFingerprint && previousFingerprint) {\n    return false;\n  }\n  currentFingerprint = currentFingerprint;\n  previousFingerprint = previousFingerprint;\n  try {\n    return !!(currentFingerprint.join(\"\") === previousFingerprint.join(\"\"));\n  } catch {\n    return false;\n  }\n}\nfunction _getExceptionFromEvent(event) {\n  return event.exception?.values?.[0];\n}\n\nexport { _shouldDropEvent, dedupeIntegration };\n//# sourceMappingURL=dedupe.js.map\n","function normalizeArray(parts, allowAboveRoot) {\n  let up = 0;\n  for (let i = parts.length - 1; i >= 0; i--) {\n    const last = parts[i];\n    if (last === \".\") {\n      parts.splice(i, 1);\n    } else if (last === \"..\") {\n      parts.splice(i, 1);\n      up++;\n    } else if (up) {\n      parts.splice(i, 1);\n      up--;\n    }\n  }\n  if (allowAboveRoot) {\n    for (; up--; up) {\n      parts.unshift(\"..\");\n    }\n  }\n  return parts;\n}\nconst splitPathRe = /^(\\S+:\\\\|\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^/\\\\]+?|)(\\.[^./\\\\]*|))(?:[/\\\\]*)$/;\nfunction splitPath(filename) {\n  const truncated = filename.length > 1024 ? `<truncated>${filename.slice(-1024)}` : filename;\n  const parts = splitPathRe.exec(truncated);\n  return parts ? parts.slice(1) : [];\n}\nfunction resolve(...args) {\n  let resolvedPath = \"\";\n  let resolvedAbsolute = false;\n  for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n    const path = i >= 0 ? args[i] : \"/\";\n    if (!path) {\n      continue;\n    }\n    resolvedPath = `${path}/${resolvedPath}`;\n    resolvedAbsolute = path.charAt(0) === \"/\";\n  }\n  resolvedPath = normalizeArray(\n    resolvedPath.split(\"/\").filter((p) => !!p),\n    !resolvedAbsolute\n  ).join(\"/\");\n  return (resolvedAbsolute ? \"/\" : \"\") + resolvedPath || \".\";\n}\nfunction trim(arr) {\n  let start = 0;\n  for (; start < arr.length; start++) {\n    if (arr[start] !== \"\") {\n      break;\n    }\n  }\n  let end = arr.length - 1;\n  for (; end >= 0; end--) {\n    if (arr[end] !== \"\") {\n      break;\n    }\n  }\n  if (start > end) {\n    return [];\n  }\n  return arr.slice(start, end - start + 1);\n}\nfunction relative(from, to) {\n  from = resolve(from).slice(1);\n  to = resolve(to).slice(1);\n  const fromParts = trim(from.split(\"/\"));\n  const toParts = trim(to.split(\"/\"));\n  const length = Math.min(fromParts.length, toParts.length);\n  let samePartsLength = length;\n  for (let i = 0; i < length; i++) {\n    if (fromParts[i] !== toParts[i]) {\n      samePartsLength = i;\n      break;\n    }\n  }\n  let outputParts = [];\n  for (let i = samePartsLength; i < fromParts.length; i++) {\n    outputParts.push(\"..\");\n  }\n  outputParts = outputParts.concat(toParts.slice(samePartsLength));\n  return outputParts.join(\"/\");\n}\nfunction normalizePath(path) {\n  const isPathAbsolute = isAbsolute(path);\n  const trailingSlash = path.slice(-1) === \"/\";\n  let normalizedPath = normalizeArray(\n    path.split(\"/\").filter((p) => !!p),\n    !isPathAbsolute\n  ).join(\"/\");\n  if (!normalizedPath && !isPathAbsolute) {\n    normalizedPath = \".\";\n  }\n  if (normalizedPath && trailingSlash) {\n    normalizedPath += \"/\";\n  }\n  return (isPathAbsolute ? \"/\" : \"\") + normalizedPath;\n}\nfunction isAbsolute(path) {\n  return path.charAt(0) === \"/\";\n}\nfunction join(...args) {\n  return normalizePath(args.join(\"/\"));\n}\nfunction dirname(path) {\n  const result = splitPath(path);\n  const root = result[0] || \"\";\n  let dir = result[1];\n  if (!root && !dir) {\n    return \".\";\n  }\n  if (dir) {\n    dir = dir.slice(0, dir.length - 1);\n  }\n  return root + dir;\n}\nfunction basename(path, ext) {\n  let f = splitPath(path)[2] || \"\";\n  if (ext && f.slice(ext.length * -1) === ext) {\n    f = f.slice(0, f.length - ext.length);\n  }\n  return f;\n}\n\nexport { basename, dirname, isAbsolute, join, normalizePath, relative, resolve };\n//# sourceMappingURL=path.js.map\n","import { defineIntegration } from '../integration.js';\nimport { relative, basename } from '../utils/path.js';\nimport { GLOBAL_OBJ } from '../utils/worldwide.js';\n\nconst INTEGRATION_NAME = \"RewriteFrames\";\nconst rewriteFramesIntegration = defineIntegration((options = {}) => {\n  const root = options.root;\n  const prefix = options.prefix || \"app:///\";\n  const isBrowser = \"window\" in GLOBAL_OBJ && !!GLOBAL_OBJ.window;\n  const iteratee = options.iteratee || generateIteratee({ isBrowser, root, prefix });\n  function _processExceptionsEvent(event) {\n    try {\n      return {\n        ...event,\n        exception: {\n          ...event.exception,\n          // The check for this is performed inside `process` call itself, safe to skip here\n          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n          values: event.exception.values.map((value) => ({\n            ...value,\n            ...value.stacktrace && { stacktrace: _processStacktrace(value.stacktrace) }\n          }))\n        }\n      };\n    } catch {\n      return event;\n    }\n  }\n  function _processStacktrace(stacktrace) {\n    return {\n      ...stacktrace,\n      frames: stacktrace?.frames?.map((f) => iteratee(f))\n    };\n  }\n  return {\n    name: INTEGRATION_NAME,\n    processEvent(originalEvent) {\n      let processedEvent = originalEvent;\n      if (originalEvent.exception && Array.isArray(originalEvent.exception.values)) {\n        processedEvent = _processExceptionsEvent(processedEvent);\n      }\n      return processedEvent;\n    }\n  };\n});\nfunction generateIteratee({\n  isBrowser,\n  root,\n  prefix\n}) {\n  return (frame) => {\n    if (!frame.filename) {\n      return frame;\n    }\n    const isWindowsFrame = /^[a-zA-Z]:\\\\/.test(frame.filename) || // or the presence of a backslash without a forward slash (which are not allowed on Windows)\n    frame.filename.includes(\"\\\\\") && !frame.filename.includes(\"/\");\n    const startsWithSlash = /^\\//.test(frame.filename);\n    if (isBrowser) {\n      if (root) {\n        const oldFilename = frame.filename;\n        if (oldFilename.indexOf(root) === 0) {\n          frame.filename = oldFilename.replace(root, prefix);\n        }\n      }\n    } else {\n      if (isWindowsFrame || startsWithSlash) {\n        const filename = isWindowsFrame ? frame.filename.replace(/^[a-zA-Z]:/, \"\").replace(/\\\\/g, \"/\") : frame.filename;\n        const base = root ? relative(root, filename) : basename(filename);\n        frame.filename = `${prefix}${base}`;\n      }\n    }\n    return frame;\n  };\n}\n\nexport { generateIteratee, rewriteFramesIntegration };\n//# sourceMappingURL=rewriteframes.js.map\n","import { getClient, getCurrentScope } from './currentScopes.js';\n\nfunction captureFeedback(params, hint = {}, scope = getCurrentScope()) {\n  const { message, name, email, url, source, associatedEventId, tags } = params;\n  const feedbackEvent = {\n    contexts: {\n      feedback: {\n        contact_email: email,\n        name,\n        message,\n        url,\n        source,\n        associated_event_id: associatedEventId\n      }\n    },\n    type: \"feedback\",\n    level: \"info\",\n    tags\n  };\n  const client = scope?.getClient() || getClient();\n  if (client) {\n    client.emit(\"beforeSendFeedback\", feedbackEvent, hint);\n  }\n  const eventId = scope.captureEvent(feedbackEvent, hint);\n  return eventId;\n}\n\nexport { captureFeedback };\n//# sourceMappingURL=feedback.js.map\n","import { _INTERNAL_captureLog } from './internal.js';\nexport { fmt } from '../utils/parameterize.js';\n\nfunction captureLog(level, message, attributes, scope, severityNumber) {\n  _INTERNAL_captureLog({ level, message, attributes, severityNumber }, scope);\n}\nfunction trace(message, attributes, { scope } = {}) {\n  captureLog(\"trace\", message, attributes, scope);\n}\nfunction debug(message, attributes, { scope } = {}) {\n  captureLog(\"debug\", message, attributes, scope);\n}\nfunction info(message, attributes, { scope } = {}) {\n  captureLog(\"info\", message, attributes, scope);\n}\nfunction warn(message, attributes, { scope } = {}) {\n  captureLog(\"warn\", message, attributes, scope);\n}\nfunction error(message, attributes, { scope } = {}) {\n  captureLog(\"error\", message, attributes, scope);\n}\nfunction fatal(message, attributes, { scope } = {}) {\n  captureLog(\"fatal\", message, attributes, scope);\n}\n\nexport { debug, error, fatal, info, trace, warn };\n//# sourceMappingURL=public-api.js.map\n","// 版本号应该与 package.json 中的版本保持同步\nexport const SDK_VERSION = '1.20.4';\nexport const SDK_NAME = 'sentry.javascript.miniapp';\n","import { createStackParser, UNKNOWN_FUNCTION } from '@sentry/core';\nimport type { StackFrame } from '@sentry/core';\n\n/**\n * 匹配 V8 风格的堆栈帧（微信/支付宝/字节等大部分小程序平台）\n * 格式示例：\n *   at functionName (filename:line:col)\n *   at filename:line:col\n *   at (filename:line:col)\n *   at functionName (app-service.js:123:45)\n *   at Object.handleTap (pages/index/index.js:42:13)\n */\nconst V8_STACK_LINE_REGEX = /^\\s*at\\s+(?:(.*?)\\s*\\((.+):(\\d+):(\\d+)\\)|(.+):(\\d+):(\\d+))\\s*$/;\n\n/**\n * 匹配 Safari/JavaScriptCore 风格的堆栈帧（iOS WebView 环境）\n * 格式示例：\n *   functionName@filename:line:col\n *   @filename:line:col\n */\nconst SAFARI_STACK_LINE_REGEX = /^\\s*([^@]*)@(?:(.+):(\\d+):(\\d+)|(.+):(\\d+))\\s*$/;\n\n/**\n * 匹配简化格式的堆栈帧（部分平台的简化输出）\n * 格式示例：\n *   filename:line:col\n *   pages/index/index.js:42:13\n */\nconst SIMPLE_STACK_LINE_REGEX = /^\\s*(.+):(\\d+):(\\d+)\\s*$/;\n\nfunction parseIntSafe(value: string | undefined): number {\n  if (!value) return 0;\n  const parsed = parseInt(value, 10);\n  return isNaN(parsed) ? 0 : parsed;\n}\n\nfunction isLikelySourceFilename(filename: string | undefined): boolean {\n  if (!filename) {\n    return false;\n  }\n  return (\n    /^[a-z][a-z0-9+.-]*:\\/\\//i.test(filename) ||\n    filename.startsWith('/') ||\n    filename.includes('/') ||\n    /\\.(?:cjs|js|jsx|mjs|ts|tsx|vue|json|wxml|axml|swan|ttml)$/i.test(filename)\n  );\n}\n\n/**\n * V8 风格堆栈解析器\n */\nfunction v8StackLineParser(line: string): StackFrame | undefined {\n  const match = V8_STACK_LINE_REGEX.exec(line);\n  if (!match) {\n    return undefined;\n  }\n\n  const [\n    ,\n    functionName,\n    wrappedFilename,\n    wrappedLinenoStr,\n    wrappedColnoStr,\n    bareFilename,\n    bareLinenoStr,\n    bareColnoStr,\n  ] = match;\n  const filename = wrappedFilename || bareFilename;\n  const frame: StackFrame = {\n    filename: filename || '<anonymous>',\n    function: wrappedFilename ? functionName || UNKNOWN_FUNCTION : UNKNOWN_FUNCTION,\n    in_app: isInApp(filename),\n  };\n  const linenoStr = wrappedLinenoStr || bareLinenoStr;\n  const colnoStr = wrappedColnoStr || bareColnoStr;\n  const lineno = parseIntSafe(linenoStr);\n  const colno = parseIntSafe(colnoStr);\n  if (lineno) frame.lineno = lineno;\n  if (colno) frame.colno = colno;\n  return frame;\n}\n\n/**\n * Safari/JavaScriptCore 风格堆栈解析器\n */\nfunction safariStackLineParser(line: string): StackFrame | undefined {\n  const match = SAFARI_STACK_LINE_REGEX.exec(line);\n  if (!match) {\n    return undefined;\n  }\n\n  const [\n    ,\n    functionName,\n    filenameWithColumn,\n    linenoWithColumnStr,\n    colnoStr,\n    filenameWithoutColumn,\n    linenoWithoutColumnStr,\n  ] = match;\n  const filename = filenameWithColumn || filenameWithoutColumn;\n  if (!isLikelySourceFilename(filename)) {\n    return undefined;\n  }\n\n  const linenoStr = linenoWithColumnStr || linenoWithoutColumnStr;\n  const frame: StackFrame = {\n    filename: filename || '<anonymous>',\n    function: functionName || UNKNOWN_FUNCTION,\n    in_app: isInApp(filename),\n  };\n  const lineno = parseIntSafe(linenoStr);\n  const colno = parseIntSafe(colnoStr);\n  if (lineno) frame.lineno = lineno;\n  if (colno) frame.colno = colno;\n  return frame;\n}\n\n/**\n * 简化格式堆栈解析器\n */\nfunction simpleStackLineParser(line: string): StackFrame | undefined {\n  const trimmedLine = line.trim();\n  if (trimmedLine.startsWith('at ') || trimmedLine.includes('@')) {\n    return undefined;\n  }\n\n  const match = SIMPLE_STACK_LINE_REGEX.exec(line);\n  if (!match) {\n    return undefined;\n  }\n\n  const [, filename, linenoStr, colnoStr] = match;\n  if (!isLikelySourceFilename(filename)) {\n    return undefined;\n  }\n\n  const frame: StackFrame = {\n    filename: filename || '<anonymous>',\n    function: UNKNOWN_FUNCTION,\n    in_app: isInApp(filename),\n  };\n  const lineno = parseIntSafe(linenoStr);\n  const colno = parseIntSafe(colnoStr);\n  if (lineno) frame.lineno = lineno;\n  if (colno) frame.colno = colno;\n  return frame;\n}\n\n/**\n * 判断堆栈帧是否为应用代码（非框架/SDK 代码）\n */\nfunction isInApp(filename: string | undefined): boolean {\n  if (!filename) {\n    return true;\n  }\n  if (\n    filename.includes('sentry-miniapp') ||\n    filename.includes('@sentry') ||\n    filename.includes('WAService') ||\n    filename.includes('WASubContext') ||\n    filename.includes('aframeworkx') ||\n    filename.includes('__dev__')\n  ) {\n    return false;\n  }\n  return true;\n}\n\n/**\n * 小程序堆栈解析器\n *\n * 支持多平台堆栈格式：\n * - V8 风格（微信/支付宝/字节跳动/百度/QQ/快手/钉钉）\n * - Safari/JavaScriptCore 风格（iOS WebView）\n * - 简化格式（部分平台的精简输出）\n */\nexport const miniappStackParser = createStackParser(\n  [90, v8StackLineParser],\n  [80, safariStackLineParser],\n  [70, simpleStackLineParser],\n);\n","/**\n * 隐私合规「同意门禁」的状态单一来源。\n *\n * `requireConsent` 模式下，事件在用户同意隐私协议前先入本地缓冲、**不发网络**，\n * `setConsent(true)` 后补发并恢复正常上报。\n *\n * 采用模块级单例（对齐 `crossPlatform.ts` 的缓存 + `resetPlatformCache` 范式）：门禁状态\n * 要同时被 transport（在 `MiniappClient` 构造时建立）读取、被公开的 `setConsent` API 写入，\n * 二者跨文件，需共享同一处状态。这也是它放在 `src/` 顶层而非 `integrations/` 的原因——\n * 门禁挂在 transport 上、早于集成 setupOnce，集成来不及提供状态。\n */\n\n/** `onConsentCacheDrop` 回调的丢弃原因。 */\nexport type ConsentDropReason = 'count' | 'bytes' | 'age';\n\n/**\n * 同意前缓存的上限与可观测配置。\n * 可选字段显式带 `| undefined`：本配置常由 `MiniappOptions` 的同名选项**透传**，调用方会直接\n * 把 `number | undefined` 塞进来，故在 `exactOptionalPropertyTypes` 下需允许 undefined 值。\n */\nexport interface ConsentConfig {\n  /** 是否启用同意门禁。false 时整套 consent 逻辑空转（行为与未引入本特性一致）。 */\n  required: boolean;\n  /** 同意前缓存的最大事件数。 */\n  cacheLimit?: number | undefined;\n  /** 同意前缓存的最大字节数（受平台单 key Storage 上限约束，微信约 900KB）。 */\n  cacheMaxBytes?: number | undefined;\n  /** 同意前缓存的过期时间（ms）。 */\n  cacheMaxAge?: number | undefined;\n  /** 缓存因超限/过期丢弃「同意前」事件时的回调，便于接入方评估上限是否合理。 */\n  onDrop?: ((info: { reason: ConsentDropReason; dropped: number }) => void) | undefined;\n}\n\nlet _config: ConsentConfig = { required: false };\nlet _granted = false;\n\n/**\n * 配置同意门禁。在 `init` / `MiniappClient` 构造阶段调用。\n * `required` 为 true 时初始视为「未同意」（闸断），直到 `setConsentGranted(true)`。\n */\nexport function configureConsent(config: ConsentConfig): void {\n  _config = { ...config };\n  // required 开启 → 初始未同意；未开启 → 视为已同意（不闸断任何上报）。\n  _granted = !config.required;\n}\n\n/** 设置同意状态。 */\nexport function setConsentGranted(granted: boolean): void {\n  _granted = granted;\n}\n\n/**\n * 当前是否允许上报。\n * 未启用门禁（`required=false`）时恒为 true；启用时取决于用户是否已同意。\n */\nexport function isConsentGranted(): boolean {\n  return !_config.required || _granted;\n}\n\n/** 是否启用了同意门禁。 */\nexport function isConsentRequired(): boolean {\n  return _config.required;\n}\n\n/**\n * 通知一次缓存丢弃，转发给接入方的 `onConsentCacheDrop` 回调。\n * 仅在门禁开启时上报。requireConsent 模式下 consent 缓冲与后续重试复用同一个 store，\n * 所以即使用户同意后 flush 才发现过期 / 超限，也仍属于这条 consent 缓冲通道的可观测范围。\n */\nexport function notifyConsentDrop(reason: ConsentDropReason, dropped: number): void {\n  if (dropped > 0 && _config.required && typeof _config.onDrop === 'function') {\n    try {\n      _config.onDrop({ reason, dropped });\n    } catch (_e) {\n      // 接入方回调里抛错不应影响 SDK 主流程。\n    }\n  }\n}\n\n/** 测试钩子：重置门禁状态与配置。对齐 `resetPlatformCache`。 */\nexport function resetConsentState(): void {\n  _config = { required: false };\n  _granted = false;\n}\n","// 各平台全局对象（wx/my/tt/dd/qq/swan/ks）通过下方 PLATFORMS 表 + globalThis 动态检测，\n// 不再使用 ambient declare，平台清单集中在 PLATFORMS 单一来源。\n\n/**\n * 小程序平台 SDK 接口\n */\ninterface SDK {\n  request: Function;\n  httpRequest?: Function; // 针对钉钉小程序\n  getSystemInfoSync?: Function; // 已弃用，保留兼容性\n  canIUse?: Function; // 检查API是否可用\n  getSystemSetting?: Function; // 新 API\n  getAppAuthorizeSetting?: Function; // 新 API\n  getDeviceInfo?: Function; // 新 API\n  getWindowInfo?: Function; // 新 API\n  getAppBaseInfo?: Function; // 新 API\n  onError?: Function;\n  onUnhandledRejection?: Function;\n  onPageNotFound?: Function;\n  onMemoryWarning?: Function;\n  // App / 小游戏全局生命周期（小游戏没有 App()，用全局 onShow/onHide）\n  onShow?: Function;\n  onHide?: Function;\n  offShow?: Function;\n  offHide?: Function;\n  getLaunchOptionsSync?: Function;\n  getEnvInfoSync?: Function;\n  getAccountInfoSync?: Function;\n  getUpdateManager?: Function;\n  showModal?: Function;\n  URLSearchParams?: Function;\n  // Performance API\n  getPerformance?: Function; // 获取性能管理器\n  // Storage API\n  setStorageSync?: Function;\n  getStorageSync?: Function;\n  getStorageInfoSync?: Function;\n  removeStorageSync?: Function;\n  // Network Status API\n  getNetworkType?: Function;\n  onNetworkStatusChange?: Function;\n  offNetworkStatusChange?: Function;\n  // Off handlers for cleanup\n  offError?: Function;\n  offUnhandledRejection?: Function;\n  offPageNotFound?: Function;\n  offMemoryWarning?: Function;\n}\n\n/**\n * 小程序平台类型\n */\nexport type AppName =\n  | 'wechat'\n  | 'alipay'\n  | 'bytedance'\n  | 'dingtalk'\n  | 'qq'\n  | 'swan'\n  | 'kuaishou'\n  | 'unknown';\n\n/** 可显式配置的小程序宿主平台。`unknown` 仅供自动检测结果使用。 */\nexport type MiniappPlatform = Exclude<AppName, 'unknown'>;\n\n/**\n * 系统信息接口\n */\nexport interface SystemInfo {\n  brand: string;\n  model: string;\n  pixelRatio: number;\n  screenWidth: number;\n  screenHeight: number;\n  windowWidth: number;\n  windowHeight: number;\n  statusBarHeight: number;\n  language: string;\n  version: string;\n  system: string;\n  platform: string;\n  fontSizeSetting: number;\n  SDKVersion: string;\n  benchmarkLevel?: number;\n  albumAuthorized?: boolean;\n  cameraAuthorized?: boolean;\n  locationAuthorized?: boolean;\n  microphoneAuthorized?: boolean;\n  notificationAuthorized?: boolean;\n  bluetoothEnabled?: boolean;\n  locationEnabled?: boolean;\n  wifiEnabled?: boolean;\n  safeArea?: {\n    left: number;\n    right: number;\n    top: number;\n    bottom: number;\n    width: number;\n    height: number;\n  };\n}\n\nfunction addGlobalObjectCandidate(candidates: unknown[], seen: Set<unknown>, value: unknown): void {\n  if (\n    value === null ||\n    (typeof value !== 'object' && typeof value !== 'function') ||\n    seen.has(value)\n  ) {\n    return;\n  }\n  seen.add(value);\n  candidates.push(value);\n}\n\n/**\n * 获取当前运行时可见的 JS 全局对象候选。\n *\n * 小游戏等宿主里可能出现 `global !== globalThis`，且三方注入器可能写入不同全局对象；\n * 因此需要返回全部候选而不是只返回一个“主全局”。顺序保留常见注入器的探测顺序。\n */\nexport const getGlobalObjectCandidates = (): unknown[] => {\n  const candidates: unknown[] = [];\n  const seen = new Set<unknown>();\n\n  if (typeof window !== 'undefined') addGlobalObjectCandidate(candidates, seen, window);\n  if (typeof global !== 'undefined') addGlobalObjectCandidate(candidates, seen, global);\n  if (typeof globalThis !== 'undefined') addGlobalObjectCandidate(candidates, seen, globalThis);\n  if (typeof self !== 'undefined') addGlobalObjectCandidate(candidates, seen, self);\n\n  return candidates;\n};\n\n/**\n * 判断当前运行时是否为标准浏览器环境（含 uni-app H5、Taro H5、纯 Web 等）。\n * 仅在所有小程序全局对象都未命中时作为兜底分支调用。\n */\nconst isBrowserRuntime = (): boolean => {\n  return (\n    typeof window !== 'undefined' &&\n    window !== null &&\n    typeof document !== 'undefined' &&\n    document !== null\n  );\n};\n\n/**\n * 获取跨平台的 SDK\n */\n/**\n * 平台描述表：全局对象名 → 平台标识。平台检测的唯一来源，getSDK() / getAppName() /\n * isMiniappEnvironment() 均基于此。数组顺序只作为宿主信号无法消除多对象歧义时的兼容回退，\n * 新增平台只需改这一处。\n */\nconst PLATFORMS: ReadonlyArray<{ global: string; name: MiniappPlatform }> = [\n  { global: 'wx', name: 'wechat' },\n  { global: 'my', name: 'alipay' },\n  { global: 'tt', name: 'bytedance' },\n  { global: 'dd', name: 'dingtalk' },\n  { global: 'qq', name: 'qq' },\n  { global: 'swan', name: 'swan' },\n  { global: 'ks', name: 'kuaishou' },\n];\n\ntype DetectedPlatform = { sdk: SDK; name: AppName };\n\nconst BYTEDANCE_HOST_NAMES = new Set([\n  'toutiao',\n  'douyin',\n  'douyin_lite',\n  'news_article_lite',\n  'aweme_hotsoon',\n  'xigua',\n  'douyin_web',\n]);\n\nconst callPlatformInfo = (platformSdk: SDK, method: keyof SDK): Record<string, any> | null => {\n  try {\n    const fn = platformSdk[method];\n    if (typeof fn !== 'function') return null;\n\n    const result = fn.call(platformSdk);\n    return result && typeof result === 'object' ? result : null;\n  } catch (_error) {\n    return null;\n  }\n};\n\nconst inferPlatformFromAppId = (appId: unknown): AppName | null => {\n  if (typeof appId !== 'string') return null;\n  if (appId.startsWith('tt')) return 'bytedance';\n  if (appId.startsWith('wx')) return 'wechat';\n  return null;\n};\n\n/**\n * 从宿主 API 返回值推断真实平台，仅识别有稳定、平台专属格式的信号。\n * 该推断只在多个平台全局对象共存时使用，失败时由 detectPlatform 保留历史 first-match。\n */\nconst inferPlatformFromRuntime = (platformSdk: SDK): AppName | null => {\n  const envInfo = callPlatformInfo(platformSdk, 'getEnvInfoSync');\n  const envPlatform = inferPlatformFromAppId(envInfo?.['microapp']?.['appId']);\n  if (envPlatform) return envPlatform;\n\n  const userDataPath = envInfo?.['common']?.['USER_DATA_PATH'];\n  if (typeof userDataPath === 'string') {\n    if (userDataPath.startsWith('ttfile://')) return 'bytedance';\n    if (userDataPath.startsWith('wxfile://')) return 'wechat';\n  }\n\n  const systemInfo = callPlatformInfo(platformSdk, 'getSystemInfoSync');\n  const hostName = systemInfo?.['appName'] ?? systemInfo?.['hostName'];\n  if (typeof hostName === 'string' && BYTEDANCE_HOST_NAMES.has(hostName.toLowerCase())) {\n    return 'bytedance';\n  }\n\n  const accountInfo = callPlatformInfo(platformSdk, 'getAccountInfoSync');\n  const accountPlatform = inferPlatformFromAppId(accountInfo?.['miniProgram']?.['appId']);\n  if (accountPlatform) return accountPlatform;\n\n  const launchOptions = callPlatformInfo(platformSdk, 'getLaunchOptionsSync');\n  const launchPlatform = inferPlatformFromAppId(launchOptions?.['extra']?.['appId']);\n  if (launchPlatform) return launchPlatform;\n\n  return null;\n};\n\n/**\n * 检测当前平台。单一命中直接返回；多个平台对象共存时优先采用宿主 API 的明确证据，\n * 无法判定才回退历史 first-match 顺序，未命中返回 null。\n */\nexport const detectPlatform = (): DetectedPlatform | null => {\n  const g = globalThis as Record<string, unknown>;\n  const candidates: DetectedPlatform[] = [];\n  for (const platform of PLATFORMS) {\n    const platformSdk = g[platform.global];\n    if (typeof platformSdk === 'object' && platformSdk !== null) {\n      candidates.push({ sdk: platformSdk as SDK, name: platform.name });\n    }\n  }\n\n  if (candidates.length <= 1) {\n    return candidates[0] ?? null;\n  }\n\n  const inferredPlatforms = new Set<AppName>();\n  for (const candidate of candidates) {\n    const inferredPlatform = inferPlatformFromRuntime(candidate.sdk);\n    if (inferredPlatform && candidates.some((item) => item.name === inferredPlatform)) {\n      inferredPlatforms.add(inferredPlatform);\n    }\n  }\n\n  if (inferredPlatforms.size === 1) {\n    const [inferredPlatform] = inferredPlatforms;\n    // 宿主证据只用于选择同名候选对象，不能把 A 平台 SDK 与 B 平台名称拼在一起；\n    // getSDK() 后续会按 name 执行支付宝/钉钉等平台适配，二者错配会破坏请求和 Storage。\n    return candidates.find((item) => item.name === inferredPlatform) ?? candidates[0] ?? null;\n  }\n\n  return candidates[0] ?? null;\n};\n\nlet _detectedPlatform: DetectedPlatform | null | undefined;\n\nconst resolvePlatform = (): DetectedPlatform | null => {\n  if (_detectedPlatform === undefined) {\n    _detectedPlatform = detectPlatform();\n  }\n  return _detectedPlatform;\n};\n\nconst getSDK = (): SDK => {\n  const detected = resolvePlatform();\n\n  if (!detected) {\n    if (isBrowserRuntime()) {\n      console.warn(\n        '[sentry-miniapp] 检测到当前运行在浏览器/H5 环境（如 uni-app H5、Taro H5）。\\n' +\n          '本 SDK 仅适配各小程序平台，不支持浏览器原生信号（window.onerror、fetch/XHR 拦截、PerformanceObserver 等）。\\n' +\n          '建议改用 Sentry 官方浏览器 SDK：@sentry/browser。\\n' +\n          '若使用 uni-app/Taro，可结合条件编译按端引入：H5 用 @sentry/browser，小程序端用 sentry-miniapp。\\n' +\n          '详情参考：https://docs.sentry.io/platforms/javascript/',\n      );\n    } else {\n      console.warn('[sentry-miniapp] 未检测到已支持的小程序平台，SDK 将以降级模式运行');\n    }\n    // 返回带有空操作方法的默认 SDK，而非抛出异常\n    return {\n      request: () => {},\n      httpRequest: () => {},\n      getSystemInfoSync: () => ({}),\n      URLSearchParams: () => {},\n    };\n  }\n\n  const currentSdk = detected.sdk;\n\n  // 支付宝小程序的网络请求 API 是 my.httpRequest\n  if (detected.name === 'alipay' && !currentSdk.request && currentSdk.httpRequest) {\n    currentSdk.request = currentSdk.httpRequest;\n  }\n\n  // 支付宝和钉钉的 Storage API 参数是对象形式，这里做一层抹平包装。\n  // 必须幂等：getSDK() 会被 sdk()（缓存）与 computeSystemInfo()（每次重算时）分别调用，\n  // 二者作用在同一个全局 SDK 对象上。若重复包装，内层会收到嵌套的 { key: { key } }，\n  // 读写全部失效——直接表现为离线缓存读不出、断网事件永不补发。用标记守卫只包一次。\n  const adaptable = currentSdk as SDK & { __sentryStorageAdapted?: boolean };\n  if (\n    (detected.name === 'alipay' || detected.name === 'dingtalk') &&\n    !adaptable.__sentryStorageAdapted\n  ) {\n    if (currentSdk.getStorageSync) {\n      const originalGet = currentSdk.getStorageSync;\n      currentSdk.getStorageSync = (key: string) => {\n        const res = originalGet.call(currentSdk, { key });\n        return res ? res.data : null;\n      };\n    }\n    if (currentSdk.setStorageSync) {\n      const originalSet = currentSdk.setStorageSync;\n      currentSdk.setStorageSync = (key: string, data: any) => {\n        originalSet.call(currentSdk, { key, data });\n      };\n    }\n    if (currentSdk.removeStorageSync) {\n      const originalRemove = currentSdk.removeStorageSync;\n      currentSdk.removeStorageSync = (key: string) => {\n        originalRemove.call(currentSdk, { key });\n      };\n    }\n    adaptable.__sentryStorageAdapted = true;\n  }\n\n  return currentSdk;\n};\n\n/**\n * 获取平台名称\n */\nconst getAppName = (): AppName => {\n  return resolvePlatform()?.name ?? 'unknown';\n};\n\n/**\n * 计算系统信息（优先新 API，回退旧 API）。一次会话内系统信息是静态的，\n * 故由 getSystemInfo() 记忆化包裹，避免被多处 context（client/httpcontext 等）反复重算。\n */\nconst computeSystemInfo = (): SystemInfo | null => {\n  try {\n    const currentSdk = getSDK();\n    const result: any = {};\n    let hasNewApi = false;\n\n    // 1. 基础信息\n    if (currentSdk.getAppBaseInfo) {\n      const baseInfo = currentSdk.getAppBaseInfo();\n      Object.assign(result, baseInfo);\n      hasNewApi = true;\n    }\n\n    // 2. 窗口信息\n    if (currentSdk.getWindowInfo) {\n      const windowInfo = currentSdk.getWindowInfo();\n      Object.assign(result, windowInfo);\n      hasNewApi = true;\n    }\n\n    // 3. 设备信息\n    if (currentSdk.getDeviceInfo) {\n      const deviceInfo = currentSdk.getDeviceInfo();\n      Object.assign(result, deviceInfo);\n      hasNewApi = true;\n    }\n\n    // 4. 授权设置 (需要转换类型)\n    if (currentSdk.getAppAuthorizeSetting) {\n      const authSetting = currentSdk.getAppAuthorizeSetting();\n      result.albumAuthorized = authSetting.albumAuthorized === 'authorized';\n      result.cameraAuthorized = authSetting.cameraAuthorized === 'authorized';\n      result.locationAuthorized = authSetting.locationAuthorized === 'authorized';\n      result.microphoneAuthorized = authSetting.microphoneAuthorized === 'authorized';\n      result.notificationAuthorized = authSetting.notificationAuthorized === 'authorized';\n    }\n\n    // 5. 系统设置\n    if (currentSdk.getSystemSetting) {\n      const sysSetting = currentSdk.getSystemSetting();\n      Object.assign(result, sysSetting);\n    }\n\n    // 新 API 须至少返回一个核心设备身份字段（brand/model/system）才采纳。部分非微信端\n    //「方法存在却返回空壳 {}」，此时三者皆空 → 回退旧 getSystemInfoSync 取真实数据，\n    // 避免产出全 unknown 的设备信息。\n    const newApiUsable = hasNewApi && !!(result.brand || result.model || result.system);\n    if (newApiUsable) {\n      return result as SystemInfo;\n    }\n\n    // 兜底使用旧的 API（已弃用但保持兼容性）\n    if (currentSdk.getSystemInfoSync) {\n      const syncInfo = currentSdk.getSystemInfoSync();\n      // 支付宝小程序等平台，版本信息可能叫 version 而不是 SDKVersion\n      if (!syncInfo.SDKVersion && syncInfo.version) {\n        syncInfo.SDKVersion = syncInfo.version;\n      }\n      return syncInfo as SystemInfo;\n    }\n\n    // 新 API 仅拿到部分信息、又无旧 API 兜底：部分结果仍好过 null。\n    if (hasNewApi) {\n      return result as SystemInfo;\n    }\n\n    return null;\n  } catch (error) {\n    console.warn('[sentry-miniapp] Failed to get system info:', error);\n    return null;\n  }\n};\n\n// 系统信息记忆化：成功结果在一次会话内静态，故缓存避免每事件重算。\n// 但结果为 null（平台 API 未就绪 / 偶发异常）时**不缓存**，下次调用重试——否则一次瞬时\n// 失败会把整个会话的 device/os/app context 永久毒化为 unknown（生产无 resetPlatformCache）。\nlet _systemInfo: SystemInfo | null = null;\nconst getSystemInfo = (): SystemInfo | null => {\n  if (_systemInfo === null) {\n    _systemInfo = computeSystemInfo();\n  }\n  return _systemInfo;\n};\n\n/** 小程序账号信息（appId / 版本），一次会话内静态。 */\nexport interface MiniProgramAccountInfo {\n  appId: string;\n  version: string;\n}\n\nconst computeAccountInfo = (): MiniProgramAccountInfo => {\n  try {\n    const currentSdk = getSDK();\n    if (currentSdk.getAccountInfoSync) {\n      const info: any = currentSdk.getAccountInfoSync();\n      return {\n        appId: info?.miniProgram?.appId || 'unknown',\n        version: info?.miniProgram?.version || 'unknown',\n      };\n    }\n  } catch (_e) {\n    // 忽略：账号信息缺失不应阻断事件上报\n  }\n  return { appId: 'unknown', version: 'unknown' };\n};\n\n// 账号信息记忆化：appId / 版本一次会话内静态，缓存避免 HttpContext 每事件重复\n// getAccountInfoSync（此前每事件取两次：appName + appVersion 各调一次）。\n// 与 getSystemInfo 同策略：全 unknown（API 未就绪/偶发异常）时不缓存，下次重试避免毒化整会话。\nlet _accountInfo: MiniProgramAccountInfo | null = null;\nconst getAccountInfo = (): MiniProgramAccountInfo => {\n  if (_accountInfo === null) {\n    const computed = computeAccountInfo();\n    if (computed.appId !== 'unknown' || computed.version !== 'unknown') {\n      _accountInfo = computed;\n    }\n    return computed;\n  }\n  return _accountInfo;\n};\n\n/**\n * 检查是否在小程序环境中\n */\nconst isMiniappEnvironment = (): boolean => {\n  return getAppName() !== 'unknown';\n};\n\n// 懒加载 SDK 和 appName，避免在模块导入时就执行平台检测\nexport let _sdk: SDK | null = null;\nlet _appName: AppName | null = null;\n\nexport const sdk = (): SDK => {\n  if (_sdk === null) {\n    _sdk = getSDK();\n  }\n  return _sdk;\n};\n\nexport const appName = (): AppName => {\n  if (_appName === null) {\n    _appName = getAppName();\n  }\n  return _appName;\n};\n\nconst MINIAPP_PLATFORMS = new Set<MiniappPlatform>(PLATFORMS.map((platform) => platform.name));\n\n/**\n * 解析事件使用的小程序宿主标记。`miniappPlatform` 是公开主选项，旧 `platform`\n * 仅作兼容别名；非法 JavaScript 入参不会污染 Sentry 顶层平台语义。\n */\nexport const resolveMiniappPlatform = (options: {\n  miniappPlatform?: unknown;\n  platform?: unknown;\n}): AppName => {\n  const optionName = options.miniappPlatform !== undefined ? 'miniappPlatform' : 'platform';\n  const configured = options[optionName];\n\n  if (configured === undefined) {\n    return appName();\n  }\n  if (typeof configured === 'string' && MINIAPP_PLATFORMS.has(configured as MiniappPlatform)) {\n    return configured as MiniappPlatform;\n  }\n\n  console.warn(\n    `[sentry-miniapp] 忽略无效的 ${optionName}=${String(configured)}；` +\n      '请使用 wechat、alipay、bytedance、qq、swan、dingtalk 或 kuaishou，SDK 将改用自动识别结果。',\n  );\n  return appName();\n};\n\n// 小游戏环境检测缓存\nlet _isMinigame: boolean | null = null;\n\n/**\n * 判断当前是否运行在「小游戏」环境（微信小游戏 / 抖音小游戏 / QQ 小游戏等）。\n *\n * 小游戏与小程序的运行时差异：小游戏没有 App()/Page()/getCurrentPages() 等\n * 页面与路由构造函数，但同样存在平台 sdk（wx/tt/qq…）。因此判定规则为：\n * 检测到平台 sdk，且不存在 App/Page/getCurrentPages，或存在全局 GameGlobal。\n */\nexport const isMinigame = (): boolean => {\n  if (_isMinigame === null) {\n    const g = globalThis as any;\n    const hasGameGlobal = typeof g.GameGlobal !== 'undefined';\n    const lacksMiniprogramHost =\n      typeof g.App !== 'function' &&\n      typeof g.Page !== 'function' &&\n      typeof g.getCurrentPages !== 'function';\n    _isMinigame = isMiniappEnvironment() && (hasGameGlobal || lacksMiniprogramHost);\n  }\n  return _isMinigame;\n};\n\n/** 统一重置平台解析及其派生缓存，仅供测试使用。 */\nexport const resetPlatformCache = (): void => {\n  _detectedPlatform = undefined;\n  _sdk = null;\n  _appName = null;\n  _isMinigame = null;\n  _systemInfo = null;\n  _accountInfo = null;\n};\n\n/**\n * 性能指标类型\n */\nexport interface PerformanceEntry {\n  name: string;\n  entryType: string;\n  startTime: number;\n  duration: number;\n}\n\n/**\n * 导航性能指标\n */\nexport interface NavigationPerformanceEntry extends PerformanceEntry {\n  entryType: 'navigation';\n  // 小程序启动相关\n  appLaunchTime?: number;\n  pageReadyTime?: number;\n  firstRenderTime?: number;\n  // 页面导航相关\n  navigationStart?: number;\n  navigationEnd?: number;\n  loadEventStart?: number;\n  loadEventEnd?: number;\n}\n\n/**\n * 渲染性能指标\n */\nexport interface RenderPerformanceEntry extends PerformanceEntry {\n  entryType: 'render';\n  // 渲染相关\n  renderStart?: number;\n  renderEnd?: number;\n  // 脚本执行\n  scriptStart?: number;\n  scriptEnd?: number;\n}\n\n/**\n * 资源加载性能指标\n */\nexport interface ResourcePerformanceEntry extends PerformanceEntry {\n  entryType: 'resource';\n  // 资源类型\n  initiatorType?: string;\n  // 网络时序\n  fetchStart?: number;\n  domainLookupStart?: number;\n  domainLookupEnd?: number;\n  connectStart?: number;\n  connectEnd?: number;\n  requestStart?: number;\n  responseStart?: number;\n  responseEnd?: number;\n  // 资源大小\n  transferSize?: number;\n  encodedBodySize?: number;\n  decodedBodySize?: number;\n}\n\n/**\n * 用户交互性能指标\n */\nexport interface UserTimingPerformanceEntry extends PerformanceEntry {\n  entryType: 'measure' | 'mark';\n  detail?: any;\n}\n\n/**\n * Performance Observer 回调\n */\nexport interface PerformanceObserverCallback {\n  (entries: PerformanceEntry[]): void;\n}\n\n/**\n * Performance API 管理器接口\n */\nexport interface PerformanceManager {\n  // 当前时间。微信小游戏文档返回微秒，SDK 内部统一归一为毫秒后使用。\n  now?: () => number;\n\n  // 获取性能条目\n  getEntries(): PerformanceEntry[];\n  getEntriesByType(type: string): PerformanceEntry[];\n  getEntriesByName(name: string, type?: string): PerformanceEntry[];\n\n  // 标记和测量\n  mark(name: string): void;\n  measure(name: string, startMark?: string, endMark?: string): void;\n\n  // 清除\n  clearMarks(name?: string): void;\n  clearMeasures(name?: string): void;\n\n  /** 创建性能观察者；小游戏等宿主可能只提供 `now()`，因此该能力可选。 */\n  createObserver?(callback: PerformanceObserverCallback): PerformanceObserver;\n}\n\n/**\n * Performance Observer 接口\n */\nexport interface PerformanceObserver {\n  observe(options: { entryTypes: string[] }): void;\n  disconnect(): void;\n}\n\n/**\n * 获取性能管理器\n */\nexport const getPerformanceManager = (): PerformanceManager | null => {\n  try {\n    const currentSdk = sdk();\n    if (currentSdk.getPerformance && typeof currentSdk.getPerformance === 'function') {\n      return currentSdk.getPerformance();\n    }\n  } catch (error) {\n    console.warn('Failed to get performance manager:', error);\n  }\n  return null;\n};\n\n/**\n * 时长时钟：用于**测量时长 / 间隔**（帧间隔、冷启动 delta 等），返回毫秒。\n *\n * 刻意用 Date.now() 而非平台 Performance.now()：后者在小游戏里单位不可靠——同一份代码在\n * 微信开发者工具返回毫秒、真机返回微秒（见 issue #167），且官方文档并未明确单位，按平台写死\n * 会在某个环境下整体偏差 1000 倍。Date.now() 在所有平台都是无歧义毫秒；这些指标粒度（≥16ms）\n * 也用不上亚毫秒精度，时钟回拨 / 改表由各采样点自身的「超大 delta 视为断点」兜底。\n *\n * 与 epochNow() 实现相同（均为墙钟 epoch 毫秒），但刻意分成两个函数以区分语义：now() 仅用于\n * 差值（时长），epochNow() 用于需要绝对时间点的场景（如 Sentry span 时间戳）。\n */\nexport const now = (): number => Date.now();\n\n/**\n * 墙钟时间戳（Unix epoch 毫秒）。用于需要**绝对时间点**的场景，如 Sentry span 的\n * startTime / endTimestamp。与 now() 刻意区分调用语义，避免把时长采样点直接当业务时间点使用。\n */\nexport const epochNow = (): number => Date.now();\n\nexport { getSDK, getSystemInfo, getAccountInfo, isMiniappEnvironment };\n","const sentryRequestOptions = new WeakSet<object>();\n\nexport function markSentryRequest(options: object): void {\n  markObject(options);\n\n  const requestOptions = options as Record<string, unknown>;\n  markObject(requestOptions['header']);\n  markObject(requestOptions['headers']);\n}\n\nexport function isMarkedSentryRequest(options: unknown): boolean {\n  if (!isObject(options)) return false;\n  if (sentryRequestOptions.has(options)) return true;\n\n  const requestOptions = options as Record<string, unknown>;\n  return isMarkedObject(requestOptions['header']) || isMarkedObject(requestOptions['headers']);\n}\n\nfunction markObject(value: unknown): void {\n  if (isObject(value)) sentryRequestOptions.add(value);\n}\n\nfunction isMarkedObject(value: unknown): boolean {\n  return isObject(value) && sentryRequestOptions.has(value);\n}\n\nfunction isObject(value: unknown): value is object {\n  return typeof value === 'object' && value !== null;\n}\n","import type { BaseTransportOptions, Transport, TransportMakeRequestResponse } from '@sentry/core';\nimport { createTransport } from '@sentry/core';\n\nimport { sdk } from '../crossPlatform';\nimport { markSentryRequest } from './requestMarker';\n\nconst SENTRY_ENVELOPE_CONTENT_TYPE = 'application/x-sentry-envelope';\nexport const DEFAULT_TRANSPORT_REQUEST_TIMEOUT = 3000;\nexport const DEFAULT_TRANSPORT_MAX_CONCURRENT_REQUESTS = 2;\n\nexport interface MiniappTransportOptions extends BaseTransportOptions {\n  /** Custom headers for the request */\n  headers?: Record<string, string>;\n  /** Sentry envelope request timeout in milliseconds. Defaults to 3000. */\n  requestTimeout?: number;\n  /** Maximum number of Sentry requests using host network slots at once. Defaults to 2. */\n  maxConcurrentRequests?: number;\n}\n\ninterface MiniappTransportRequest {\n  body: string | Uint8Array;\n  headers?: Record<string, string>;\n}\n\ninterface MiniappRequestTask {\n  abort?: () => void;\n}\n\nexport function normalizeRequestTimeout(timeout: number | undefined): number {\n  return typeof timeout === 'number' && isFinite(timeout) && timeout > 0\n    ? Math.max(1, Math.floor(timeout))\n    : DEFAULT_TRANSPORT_REQUEST_TIMEOUT;\n}\n\nexport function normalizeMaxConcurrentRequests(maxConcurrentRequests: number | undefined): number {\n  return typeof maxConcurrentRequests === 'number' &&\n    isFinite(maxConcurrentRequests) &&\n    maxConcurrentRequests > 0\n    ? Math.max(1, Math.floor(maxConcurrentRequests))\n    : DEFAULT_TRANSPORT_MAX_CONCURRENT_REQUESTS;\n}\n\nfunction networkError(error: any): Error {\n  const message =\n    typeof error === 'string'\n      ? error\n      : error?.errMsg || error?.errorMessage || error?.message || 'Unknown error';\n  return new Error(`Network request failed: ${message}`);\n}\n\n/**\n * Creates a Transport that uses the miniapp request API to send events to Sentry.\n */\nexport function createMiniappTransport(options: MiniappTransportOptions): Transport {\n  // 保存 URL 到局部变量\n  const transportUrl = options.url;\n  const transportHeaders = options.headers || {};\n  const requestTimeout = normalizeRequestTimeout(options.requestTimeout);\n  const maxConcurrentRequests = normalizeMaxConcurrentRequests(options.maxConcurrentRequests);\n  const requestQueue: Array<{\n    request: MiniappTransportRequest;\n    resolve: (response: TransportMakeRequestResponse) => void;\n    reject: (error: unknown) => void;\n  }> = [];\n  let activeRequests = 0;\n\n  /**\n   * Execute a request using the miniapp request API.\n   */\n  function executeRequest(request: MiniappTransportRequest): Promise<TransportMakeRequestResponse> {\n    return new Promise((resolve, reject) => {\n      let settled = false;\n      let requestTask: MiniappRequestTask | undefined;\n\n      const settle = (callback: () => void): void => {\n        if (settled) return;\n        settled = true;\n        clearTimeout(timeoutTimer);\n        callback();\n      };\n\n      const timeoutTimer = setTimeout(() => {\n        if (settled) return;\n        settled = true;\n        try {\n          requestTask?.abort?.();\n        } catch (_error) {\n          // 某些宿主的 RequestTask.abort 可能抛错；超时仍需立即释放 SDK Promise。\n        }\n        reject(new Error(`Sentry request timed out after ${requestTimeout}ms`));\n      }, requestTimeout);\n\n      const requestOptions = {\n        url: transportUrl,\n        method: 'POST' as const,\n        data: request.body,\n        header: {\n          'Content-Type': SENTRY_ENVELOPE_CONTENT_TYPE,\n          ...transportHeaders,\n          ...request.headers,\n        },\n        // Alipay uses `headers` instead of `header`\n        headers: {\n          'Content-Type': SENTRY_ENVELOPE_CONTENT_TYPE,\n          ...transportHeaders,\n          ...request.headers,\n        },\n        timeout: requestTimeout,\n        success: (res: any) => {\n          settle(() => {\n            // Alipay uses `status` instead of `statusCode`, and `headers` instead of `header`\n            const status = res.statusCode ?? res.status;\n            const resHeaders = {\n              ...(res.headers || {}),\n              ...(res.header || {}),\n            };\n\n            resolve({\n              statusCode: status,\n              headers: {\n                'x-sentry-rate-limits': getHeaderValue(resHeaders, 'x-sentry-rate-limits'),\n                'retry-after': getHeaderValue(resHeaders, 'retry-after'),\n              },\n            });\n          });\n        },\n        fail: (error: any) => {\n          settle(() => reject(networkError(error)));\n        },\n      };\n\n      markSentryRequest(requestOptions);\n\n      // Use the appropriate request method based on the platform\n      try {\n        const currentSdk = sdk();\n        if (currentSdk.request) {\n          requestTask = currentSdk.request(requestOptions) as MiniappRequestTask | undefined;\n        } else if (currentSdk.httpRequest) {\n          requestTask = currentSdk.httpRequest(requestOptions) as MiniappRequestTask | undefined;\n        } else {\n          settle(() =>\n            reject(new Error('No request method available in current miniapp environment')),\n          );\n        }\n      } catch (error) {\n        settle(() => reject(networkError(error)));\n      }\n    });\n  }\n\n  function drainRequestQueue(): void {\n    while (activeRequests < maxConcurrentRequests && requestQueue.length > 0) {\n      const pending = requestQueue.shift();\n      if (!pending) return;\n\n      activeRequests += 1;\n      void executeRequest(pending.request).then(\n        (response) => {\n          activeRequests -= 1;\n          drainRequestQueue();\n          pending.resolve(response);\n        },\n        (error) => {\n          activeRequests -= 1;\n          drainRequestQueue();\n          pending.reject(error);\n        },\n      );\n    }\n  }\n\n  /**\n   * @sentry/core keeps a bounded envelope buffer, while this queue separately limits how many\n   * requests can occupy scarce miniapp network slots at the same time.\n   */\n  function makeRequest(request: MiniappTransportRequest): Promise<TransportMakeRequestResponse> {\n    return new Promise((resolve, reject) => {\n      requestQueue.push({ request, resolve, reject });\n      drainRequestQueue();\n    });\n  }\n\n  return createTransport(options, makeRequest);\n}\n\nfunction getHeaderValue(headers: Record<string, unknown>, name: string): string | null {\n  const normalizedName = name.toLowerCase();\n  const key = Object.keys(headers).find((candidate) => candidate.toLowerCase() === normalizedName);\n  const value = key === undefined ? undefined : headers[key];\n  return typeof value === 'string' ? value : null;\n}\n","import type { Envelope, OfflineStore, OfflineTransportOptions } from '@sentry/core';\nimport { sdk } from '../crossPlatform';\n\nconst DEFAULT_OFFLINE_CACHE_SIZE = 30;\nconst DEFAULT_MAX_AGE = 86400000; // 24 小时\nconst OFFLINE_STORE_KEY = 'sentry_offline_store';\n// 微信等平台单 key storage 上限约 1MB；留余量到 900KB，超出则按淘汰策略丢弃再写，\n// 避免 setStorageSync 因超限抛错导致整批离线缓存写入静默失败。\nconst DEFAULT_MAX_STORE_BYTES = 900 * 1024;\n\ninterface CachedEnvelope {\n  envelope: Envelope;\n  timestamp: number;\n}\n\n/** 因超限 / 过期丢弃事件的原因。 */\nexport type DropReason = 'count' | 'bytes' | 'age';\n\n/**\n * 缓存淘汰策略：\n * - `'error-priority'`（默认，弱网重试场景）：满则优先丢弃最旧的非 error 事件，保留异常。\n * - `'preserve-oldest'`（同意门禁场景）：满则从**最新**端丢弃，保留最旧的冷启动数据。\n */\nexport type EvictionMode = 'error-priority' | 'preserve-oldest';\n\nexport interface MiniappOfflineStoreOptions extends OfflineTransportOptions {\n  offlineCacheLimit?: number;\n  /** 离线缓存过期时间（ms），默认 86400000 (24h) */\n  offlineCacheMaxAge?: number;\n  /** 单 key 字节上限（默认约 900KB，受平台 Storage 限制） */\n  maxBytes?: number;\n  /** 淘汰策略，默认 `'error-priority'` */\n  evictionMode?: EvictionMode;\n  /** 因超限 / 过期丢弃事件时回调（用于可观测，如同意前缓存丢弃统计） */\n  onDrop?: (reason: DropReason, dropped: number) => void;\n}\n\n/**\n * Creates an offline store using miniapp storage API.\n * 支持事件过期淘汰、按条数 / 体积上限淘汰，以及两种淘汰策略（见 {@link EvictionMode}）。\n */\nexport function createMiniappOfflineStore(options: MiniappOfflineStoreOptions): OfflineStore {\n  // 用 ?? 而非 ||：尊重显式的 0（|| 会把 0 当成未设置而回退默认值）。\n  const maxCacheSize = options.offlineCacheLimit ?? DEFAULT_OFFLINE_CACHE_SIZE;\n  const maxAge = options.offlineCacheMaxAge ?? DEFAULT_MAX_AGE;\n  const maxBytes = options.maxBytes ?? DEFAULT_MAX_STORE_BYTES;\n  const evictionMode = options.evictionMode ?? 'error-priority';\n  const onDrop = options.onDrop;\n\n  function report(reason: DropReason, dropped: number): void {\n    if (dropped > 0 && typeof onDrop === 'function') {\n      try {\n        onDrop(reason, dropped);\n      } catch (_e) {\n        // 回调里抛错不应影响 store 主流程\n      }\n    }\n  }\n\n  /** 淘汰过期事件，返回保留下来的子集并上报丢弃数。 */\n  function evictExpired(store: CachedEnvelope[]): CachedEnvelope[] {\n    const now = Date.now();\n    const kept = store.filter((item) => now - item.timestamp < maxAge);\n    report('age', store.length - kept.length);\n    return kept;\n  }\n\n  /**\n   * 按条数上限就地淘汰，返回丢弃条数。\n   * context 区分 push（新事件在尾部）与 unshift（重试事件回插到头部）：error-priority 下分别\n   * 丢最旧 / 最新的非 error，避免 unshift 立刻把刚回插的事件淘汰掉。preserve-oldest 一律丢最新。\n   */\n  function evictByCount(store: CachedEnvelope[], context: 'push' | 'unshift'): number {\n    let dropped = 0;\n    while (store.length > maxCacheSize) {\n      if (evictionMode === 'preserve-oldest') {\n        store.pop(); // 丢最新，保留最旧（冷启动）\n      } else if (context === 'push') {\n        const nonErrorIdx = store.findIndex((item) => !isErrorEnvelope(item.envelope));\n        if (nonErrorIdx >= 0) {\n          store.splice(nonErrorIdx, 1);\n        } else {\n          store.shift(); // 全是错误事件则丢弃最早的\n        }\n      } else {\n        const nonErrorIdx = findLastIndex(store, (item) => !isErrorEnvelope(item.envelope));\n        if (nonErrorIdx >= 0) {\n          store.splice(nonErrorIdx, 1);\n        } else {\n          store.pop();\n        }\n      }\n      dropped++;\n    }\n    return dropped;\n  }\n\n  /** 写回 storage：超出字节上限时按策略丢弃再写，避免 setStorageSync 因超限整批失败。 */\n  function persist(store: CachedEnvelope[]): void {\n    const storageApi = sdk().setStorageSync;\n    if (!storageApi) {\n      return;\n    }\n    let working = store;\n    let serialized = JSON.stringify(working);\n    let dropped = 0;\n    while (working.length > 0 && utf8ByteLength(serialized) > maxBytes) {\n      if (evictionMode === 'preserve-oldest') {\n        working = working.slice(0, working.length - 1); // 丢最新（末尾）\n      } else {\n        const nonErrorIdx = working.findIndex((item) => !isErrorEnvelope(item.envelope));\n        const dropIdx = nonErrorIdx >= 0 ? nonErrorIdx : 0;\n        working = working.slice(0, dropIdx).concat(working.slice(dropIdx + 1));\n      }\n      dropped++;\n      serialized = JSON.stringify(working);\n    }\n    report('bytes', dropped);\n    try {\n      storageApi(OFFLINE_STORE_KEY, serialized);\n    } catch (_e) {\n      // ignore（已尽力压到上限内；极端单条仍超限则吞掉，不阻断主流程）\n    }\n  }\n\n  return {\n    push: async (env: Envelope): Promise<void> => {\n      try {\n        const store = evictExpired(getStore());\n        store.push({ envelope: env, timestamp: Date.now() });\n        report('count', evictByCount(store, 'push'));\n        persist(store);\n      } catch (e) {\n        console.warn('[sentry-miniapp] Failed to push to offline store', e);\n      }\n    },\n    unshift: async (env: Envelope): Promise<void> => {\n      try {\n        const store = evictExpired(getStore());\n        store.unshift({ envelope: env, timestamp: Date.now() });\n        report('count', evictByCount(store, 'unshift'));\n        persist(store);\n      } catch (e) {\n        console.warn('[sentry-miniapp] Failed to unshift to offline store', e);\n      }\n    },\n    shift: async (): Promise<Envelope | undefined> => {\n      try {\n        const before = getStore();\n        const store = evictExpired(before);\n        if (store.length === 0) {\n          if (before.length > 0) {\n            persist(store);\n          }\n          return undefined;\n        }\n        const item = store.shift();\n        persist(store);\n        return item?.envelope;\n      } catch (e) {\n        console.warn('[sentry-miniapp] Failed to shift from offline store', e);\n        return undefined;\n      }\n    },\n  };\n}\n\n/**\n * 判断 envelope 是否包含错误事件\n */\nfunction isErrorEnvelope(envelope: Envelope): boolean {\n  try {\n    const items = envelope[1] || [];\n    return items.some((item: any) => {\n      const itemType = item[0]?.type;\n      return itemType === 'event' || itemType === 'error';\n    });\n  } catch (_e) {\n    return true; // 无法判断时当作错误事件保留\n  }\n}\n\n/**\n * 从后往前查找匹配项的索引\n */\nfunction findLastIndex<T>(arr: T[], predicate: (item: T) => boolean): number {\n  for (let i = arr.length - 1; i >= 0; i--) {\n    if (predicate(arr[i]!)) return i;\n  }\n  return -1;\n}\n\nfunction getStore(): CachedEnvelope[] {\n  const storageApi = sdk().getStorageSync;\n  if (!storageApi) {\n    return [];\n  }\n  let storedStr: any;\n  try {\n    storedStr = storageApi(OFFLINE_STORE_KEY);\n  } catch (_e) {\n    return [];\n  }\n  if (!storedStr) {\n    return [];\n  }\n  try {\n    const parsed = typeof storedStr === 'string' ? JSON.parse(storedStr) : storedStr;\n    // 兼容旧版本格式（直接存储 Envelope[]）\n    if (Array.isArray(parsed) && parsed.length > 0) {\n      if (parsed[0] && 'envelope' in parsed[0] && 'timestamp' in parsed[0]) {\n        return parsed;\n      }\n      // 旧格式：直接是 Envelope 数组，迁移为新格式\n      return parsed.map((env: Envelope) => ({\n        envelope: env,\n        timestamp: Date.now(),\n      }));\n    }\n    return [];\n  } catch (_e) {\n    // 解析失败 = 存储被写坏（部分写入 / 配额截断等）。主动清键自愈，避免坏数据常驻、\n    // 让后续 flush 永远读到空，且坏 blob 一直占着这个 key 的空间。\n    removeStore();\n    return [];\n  }\n}\n\nfunction removeStore(): void {\n  try {\n    const removeApi = sdk().removeStorageSync;\n    if (removeApi) {\n      removeApi(OFFLINE_STORE_KEY);\n    }\n  } catch (_e) {\n    // ignore\n  }\n}\n\n/** 估算字符串的 UTF-8 字节数（小程序运行时不保证有 TextEncoder），用于体积上限判断。 */\nfunction utf8ByteLength(str: string): number {\n  let bytes = 0;\n  for (let i = 0; i < str.length; i++) {\n    const code = str.charCodeAt(i);\n    if (code < 0x80) {\n      bytes += 1;\n    } else if (code < 0x800) {\n      bytes += 2;\n    } else if (code >= 0xd800 && code <= 0xdbff) {\n      // 代理对：一个 4 字节字符，跳过低位代理\n      bytes += 4;\n      i++;\n    } else {\n      bytes += 3;\n    }\n  }\n  return bytes;\n}\n","export {\n  createMiniappTransport,\n  DEFAULT_TRANSPORT_MAX_CONCURRENT_REQUESTS,\n  DEFAULT_TRANSPORT_REQUEST_TIMEOUT,\n} from './xhr';\nexport type { MiniappTransportOptions } from './xhr';\nexport { createMiniappOfflineStore } from './offlineStore';\nexport type { MiniappOfflineStoreOptions, EvictionMode, DropReason } from './offlineStore';\n","import { envelopeContainsItemType, makeOfflineTransport, resolvedSyncPromise } from '@sentry/core';\nimport type { BaseTransportOptions, Envelope, OfflineStore, Transport } from '@sentry/core';\n\ntype ConsentStateReader = () => boolean;\n\n/**\n * 在 miniapp 生命周期同步段内执行同意判断，同时复用 core 的离线重试能力。\n *\n * core offline transport 的 `shouldSend` 会被 `await`，即使返回 boolean 也会产生微任务。\n * 抖音小游戏在 onHide 返回后可能冻结 JS，因此门禁必须在调用 core transport 前同步完成。\n */\nexport function createConsentAwareOfflineTransport(\n  baseTransport: Transport,\n  options: BaseTransportOptions,\n  store: OfflineStore,\n  hasConsent: ConsentStateReader,\n): Transport {\n  const isClientReport = (envelope: Envelope): boolean =>\n    envelopeContainsItemType(envelope, ['client_report']);\n\n  const consentGuardedTransport: Transport = {\n    send: (envelope) => {\n      if (hasConsent()) {\n        return baseTransport.send(envelope);\n      }\n\n      // 已安排的离线重试可能遇到中途撤回同意。同步放回队首，并用 4xx 阻止 core\n      // 继续安排重试；下次 setConsent(true) 会显式触发 flush。\n      if (!isClientReport(envelope)) {\n        void store.unshift(envelope);\n      }\n      return resolvedSyncPromise({ statusCode: 403 });\n    },\n    flush: (timeout) => baseTransport.flush(timeout),\n  };\n\n  const offlineTransport = makeOfflineTransport(() => consentGuardedTransport)({\n    ...options,\n    createStore: () => store,\n    // requireConsent 初始化时默认未同意，必须等 setConsent(true) 后才能排空历史缓存。\n    flushAtStartup: false,\n  });\n\n  return {\n    send: (envelope) => {\n      if (hasConsent()) {\n        return offlineTransport.send(envelope);\n      }\n      if (isClientReport(envelope)) {\n        return resolvedSyncPromise({});\n      }\n\n      // createMiniappOfflineStore 在返回 Promise 前已同步完成 Storage 写入。\n      return resolvedSyncPromise(store.push(envelope)).then(() => ({}));\n    },\n    flush: (timeout) =>\n      hasConsent() ? offlineTransport.flush(timeout) : baseTransport.flush(timeout),\n  };\n}\n","import { getGlobalObjectCandidates } from './crossPlatform';\n\ntype DebugIdMap = Record<string, string>;\ntype DebugIdGlobal = {\n  _sentryDebugIds?: Record<string, unknown>;\n  _debugIds?: Record<string, unknown>;\n};\n\nfunction isDebugIdGlobal(value: unknown): value is DebugIdGlobal {\n  return value !== null && (typeof value === 'object' || typeof value === 'function');\n}\n\nfunction syncDebugIdMapToCoreGlobal(\n  target: DebugIdGlobal,\n  candidates: DebugIdGlobal[],\n  key: '_sentryDebugIds' | '_debugIds',\n): void {\n  const merged: DebugIdMap = {};\n  let hasEntries = false;\n\n  for (const candidate of candidates) {\n    const candidateMap = candidate[key];\n    if (!candidateMap) {\n      continue;\n    }\n    for (const [stack, debugId] of Object.entries(candidateMap)) {\n      if (merged[stack] === undefined && typeof debugId === 'string' && debugId) {\n        merged[stack] = debugId;\n        hasEntries = true;\n      }\n    }\n  }\n\n  if (hasEntries) {\n    target[key] = merged;\n  }\n}\n\n/**\n * @sentry/core 当前只从 globalThis 读取 Debug ID maps。微信小游戏等运行时可能由\n * sentry-cli 注入到 global / window / self，因此进入 core 事件准备流程前做一次同步。\n */\nexport function syncDebugIdsToCoreGlobal(): void {\n  if (typeof globalThis === 'undefined') {\n    return;\n  }\n\n  const target = globalThis as DebugIdGlobal;\n  const candidates = getGlobalObjectCandidates().filter(isDebugIdGlobal);\n  syncDebugIdMapToCoreGlobal(target, candidates, '_sentryDebugIds');\n  syncDebugIdMapToCoreGlobal(target, candidates, '_debugIds');\n}\n","import {\n  Client,\n  Scope,\n  captureFeedback as captureFeedbackCore,\n  eventFromMessage as eventFromMessageCore,\n  eventFromUnknownInput,\n  getIsolationScope,\n  getCurrentScope,\n  makeOfflineTransport,\n  resolvedSyncPromise,\n  stackParserFromStackParserOptions,\n} from '@sentry/core';\nimport type {\n  BaseTransportOptions,\n  ClientOptions,\n  Event,\n  EventHint,\n  ParameterizedString,\n  SeverityLevel,\n} from '@sentry/core';\n\nimport { getAccountInfo, getSystemInfo, resolveMiniappPlatform } from './crossPlatform';\nimport type { AppName } from './crossPlatform';\nimport { configureConsent, isConsentGranted, notifyConsentDrop } from './consent';\nimport type { MiniappOptions, ReportDialogOptions, SendFeedbackParams } from './types';\nimport { createMiniappTransport, createMiniappOfflineStore } from './transports';\nimport type { MiniappTransportOptions } from './transports';\nimport { createConsentAwareOfflineTransport } from './transports/consent';\nimport { SDK_NAME, SDK_VERSION } from './version';\nimport { syncDebugIdsToCoreGlobal } from './debugIds';\nimport { miniappStackParser } from './stacktrace';\n\nexport type MiniappClientOptions = Omit<\n  MiniappOptions,\n  'integrations' | 'miniappPlatform' | 'platform' | 'stackParser' | 'transport'\n> &\n  ClientOptions<MiniappTransportOptions> & {\n    platform: string;\n    /** 小程序宿主标识；与 Sentry 顶层 event.platform 分离。 */\n    miniappPlatform?: AppName | undefined;\n  };\n\nconst clientsWithCustomTransport = new WeakSet<MiniappClient>();\ntype DefaultIntegrationsMode = 'enabled' | 'disabled' | 'custom';\nconst clientDefaultIntegrationsModes = new WeakMap<MiniappClient, DefaultIntegrationsMode>();\n\nfunction resolveDefaultIntegrationsMode(\n  configured: MiniappOptions['defaultIntegrations'],\n): DefaultIntegrationsMode {\n  if (configured === false) {\n    return 'disabled';\n  }\n  if (Array.isArray(configured)) {\n    return 'custom';\n  }\n  return 'enabled';\n}\n\nexport function usesCustomTransport(client: MiniappClient): boolean {\n  return clientsWithCustomTransport.has(client);\n}\n\n/** 读取用户传入的 defaultIntegrations 模式，而不是 core 归一化后的空数组。 */\nexport function getConfiguredDefaultIntegrationsMode(\n  client: MiniappClient,\n): DefaultIntegrationsMode {\n  return (\n    clientDefaultIntegrationsModes.get(client) ??\n    resolveDefaultIntegrationsMode(client.getOptions().defaultIntegrations)\n  );\n}\n\n/** init() 会把 defaultIntegrations 归一化为空数组；在绑定后恢复诊断所需的原始语义。 */\nexport function setConfiguredDefaultIntegrationsMode(\n  client: MiniappClient,\n  configured: MiniappOptions['defaultIntegrations'],\n): void {\n  clientDefaultIntegrationsModes.set(client, resolveDefaultIntegrationsMode(configured));\n}\n\n/**\n * The Sentry Miniapp SDK Client.\n *\n * @see MiniappOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class MiniappClient extends Client<MiniappClientOptions> {\n  private readonly _disposeCallbacks: Array<() => void> = [];\n\n  /**\n   * Creates a new Miniapp SDK instance.\n   *\n   * @param options Configuration options for this SDK.\n   */\n  public constructor(options: MiniappOptions | MiniappClientOptions = {}) {\n    const usesCustomTransport = typeof options.transport === 'function';\n    const defaultIntegrationsMode = resolveDefaultIntegrationsMode(options.defaultIntegrations);\n    const hasConfiguredMiniappPlatform =\n      options.miniappPlatform !== undefined || options.platform !== undefined;\n    const miniappPlatform = hasConfiguredMiniappPlatform\n      ? resolveMiniappPlatform(options)\n      : undefined;\n\n    // 配置隐私合规「同意门禁」。必须在 super() 之前——transport 工厂在 super() 执行期间被 core\n    // 调用建立，其同意门禁 / store 需读到已就绪的 consent 状态。configureConsent 是模块函数、\n    // 不触碰 this，故在 super 前调用合法。requireConsent=false 时它把门禁置为「恒放行」，行为不变。\n    configureConsent({\n      required: options.requireConsent === true,\n      cacheLimit: options.consentCacheLimit,\n      cacheMaxBytes: options.consentCacheMaxBytes,\n      cacheMaxAge: options.consentCacheMaxAge,\n      onDrop: options.onConsentCacheDrop,\n    });\n\n    const clientOptions: MiniappClientOptions = {\n      ...options,\n      // Sentry 后端按顶层 platform 选择 JavaScript 栈解析与聚合逻辑。\n      // 小程序宿主类型单独放在 contexts.miniapp.platform。\n      platform: 'javascript',\n      miniappPlatform,\n      // @sentry/core 10.71 起默认开启 Logs；保留 sentry-miniapp 的显式 opt-in 契约。\n      enableLogs: options.enableLogs ?? false,\n      integrations: Array.isArray(options.integrations) ? options.integrations : [],\n      stackParser: stackParserFromStackParserOptions(options.stackParser ?? miniappStackParser),\n      transport: (transportOptions: BaseTransportOptions) => {\n        const miniappTransportOptions = transportOptions as MiniappTransportOptions;\n        const baseTransport = options.transport\n          ? options.transport(miniappTransportOptions)\n          : createMiniappTransport({\n              ...miniappTransportOptions,\n              headers: miniappTransportOptions.headers ?? {},\n            });\n\n        // 同意门禁：在调用 core offline transport 前同步闸断网络（同意前 envelope 不发、\n        // 直接转入本地缓冲），setConsent(true) 后由 transport.flush() 补发。即便用户关了\n        // enableOfflineCache，requireConsent 仍需缓冲，故强制走 offline 路径；若用户传了自定义\n        // transport，也要包住它，避免合规开关被高级用法绕过。\n        if (options.requireConsent === true) {\n          const store = createMiniappOfflineStore({\n            ...transportOptions,\n            // 同意前缓存用独立上限 + 冷启动优先（保留最旧）淘汰，区别于弱网那套默认值。\n            offlineCacheLimit: options.consentCacheLimit ?? 100,\n            ...(options.consentCacheMaxAge !== undefined && {\n              offlineCacheMaxAge: options.consentCacheMaxAge,\n            }),\n            ...(options.consentCacheMaxBytes !== undefined && {\n              maxBytes: options.consentCacheMaxBytes,\n            }),\n            evictionMode: 'preserve-oldest',\n            onDrop: notifyConsentDrop,\n          });\n          return createConsentAwareOfflineTransport(\n            baseTransport,\n            miniappTransportOptions,\n            store,\n            isConsentGranted,\n          );\n        }\n\n        if (!options.transport && options.enableOfflineCache !== false) {\n          return makeOfflineTransport(() => baseTransport)({\n            ...transportOptions,\n            createStore: (storeOptions: any) =>\n              createMiniappOfflineStore({\n                ...storeOptions,\n                offlineCacheLimit: options.offlineCacheLimit,\n                offlineCacheMaxAge: options.offlineCacheMaxAge,\n              }),\n            flushAtStartup: true, // 启动时自动重试发送\n          } as any);\n        }\n\n        return baseTransport;\n      },\n    };\n\n    super(clientOptions);\n\n    if (usesCustomTransport) {\n      clientsWithCustomTransport.add(this);\n    }\n    clientDefaultIntegrationsModes.set(this, defaultIntegrationsMode);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n    const event = eventFromUnknownInput(this, this.getOptions().stackParser, exception, hint);\n    event.level = 'error';\n    return resolvedSyncPromise(event);\n  }\n\n  public eventFromMessage(\n    message: ParameterizedString,\n    level: SeverityLevel = 'info',\n    hint?: EventHint,\n  ): PromiseLike<Event> {\n    return resolvedSyncPromise(\n      eventFromMessageCore(\n        this.getOptions().stackParser,\n        message,\n        level,\n        hint,\n        this.getOptions().attachStacktrace,\n      ),\n    );\n  }\n\n  protected override _prepareEvent(\n    event: Event,\n    hint?: EventHint,\n    scope?: Scope,\n  ): PromiseLike<Event | null> {\n    event.platform = event.platform || 'javascript';\n\n    // Add SDK information\n    event.sdk = {\n      ...event.sdk,\n      name: SDK_NAME,\n      packages: [\n        ...((event.sdk && event.sdk.packages) || []).filter(\n          (pkg) => pkg.name !== 'npm:sentry-miniapp',\n        ),\n        { name: 'npm:sentry-miniapp', version: SDK_VERSION },\n      ],\n      version: SDK_VERSION,\n    };\n\n    try {\n      // @sentry/core 只读取 globalThis 上的 Debug ID maps。微信小游戏可能由 sentry-cli\n      // 注入到 global / window / self，因此在 core 准备事件前合并一次候选全局。\n      try {\n        syncDebugIdsToCoreGlobal();\n      } catch (error) {\n        if (this.getOptions().debug) {\n          console.warn('[sentry-miniapp] Debug ID 全局同步失败:', error);\n        }\n      }\n\n      const currentScope = scope || getCurrentScope();\n      const isolationScope = getIsolationScope();\n      // 保留 core SyncPromise 的同步完成语义：抖音小游戏 onHide 返回后可能立即冻结 JS，\n      // 若用原生 Promise 包裹，底层 request 会被推迟到下次 onShow，甚至因进程回收而丢失。\n      return super\n        ._prepareEvent(event, hint || {}, currentScope, isolationScope)\n        .then((prepared) => this._fillDefaultContexts(prepared));\n    } catch (error) {\n      // Fallback if scopes are not properly initialized\n      if (this.getOptions().debug) {\n        console.warn('[sentry-miniapp] _prepareEvent 兜底（scope 未就绪）:', error);\n      }\n      return resolvedSyncPromise(this._fillDefaultContexts(event));\n    }\n  }\n\n  /**\n   * 用 SDK 采集的 device/os/app 填充事件上下文——**仅填充缺失的键**，不覆盖用户经\n   * setContext / per-event hint / 其它集成（如 HttpContext 写的 app.name）已提供的值。\n   *\n   * 必须在 super._prepareEvent **之后**调用：core 以「event 优先」合并 scope contexts\n   * （scopeData.js：`event.contexts = {...scope, ...event}`），若在 super 之前写，SDK 的\n   * 自动值会盖掉用户的 setContext('device'/'os'/'app')。放到 super 之后按缺失填充即可两头兼顾。\n   */\n  private _fillDefaultContexts(event: Event | null): Event | null {\n    if (!event) {\n      return event;\n    }\n    if (!event.contexts) {\n      event.contexts = {};\n    }\n    const contexts = event.contexts;\n    contexts['miniapp'] = {\n      environment: 'miniapp',\n      ...contexts['miniapp'],\n      platform: this.getOptions().miniappPlatform ?? resolveMiniappPlatform({}),\n      sdk_version: SDK_VERSION,\n    };\n\n    if (this.getOptions().enableSystemInfo === false) {\n      return event;\n    }\n\n    const info = getSystemInfo();\n    const account = getAccountInfo();\n    contexts['miniapp'] = {\n      ...contexts['miniapp'],\n      host_version: info?.version || 'unknown',\n      host_sdk_version: info?.SDKVersion || 'unknown',\n    };\n    contexts.device = {\n      brand: info?.brand || 'unknown',\n      model: info?.model || 'unknown',\n      screen_resolution: `${info?.screenWidth || 0}x${info?.screenHeight || 0}`,\n      language: info?.language || 'unknown',\n      version: info?.version || 'unknown',\n      system: info?.system || 'unknown',\n      platform: info?.platform || 'unknown',\n      ...contexts.device,\n    };\n    contexts.os = {\n      name: info?.system || 'unknown',\n      version: info?.version || 'unknown',\n      ...contexts.os,\n    };\n    contexts.app = {\n      app_identifier: account.appId,\n      app_version: account.version,\n      ...contexts.app,\n    };\n    return event;\n  }\n\n  /** @inheritDoc */\n  public override registerCleanup(callback: () => void): void {\n    this._disposeCallbacks.push(callback);\n  }\n\n  /** @inheritDoc */\n  public override dispose(): void {\n    for (const callback of this._disposeCallbacks.splice(0)) {\n      try {\n        callback();\n      } catch (error) {\n        if (this.getOptions().debug) {\n          console.warn('[sentry-miniapp] 集成资源清理失败:', error);\n        }\n      }\n    }\n    super.dispose();\n  }\n\n  /**\n   * 关闭客户端并执行集成通过 `setup(client)` 注册的清理回调。\n   */\n  public override async close(timeout?: number): Promise<boolean> {\n    try {\n      return await super.close(timeout);\n    } finally {\n      this.dispose();\n    }\n  }\n\n  /**\n   * @deprecated Miniapp environment does not support Sentry's default HTML report dialog.\n   * Please implement your own UI form to collect user feedback (name, email, comments)\n   * and use `Sentry.captureFeedback()` to submit it to Sentry.\n   */\n  public showReportDialog(_options: ReportDialogOptions = {}): void {\n    console.warn(\n      '[sentry-miniapp] showReportDialog is deprecated and does nothing. ' +\n        'Please build your own UI and use `Sentry.captureFeedback()` instead.',\n    );\n  }\n\n  /**\n   * Capture feedback using the new feedback API.\n   * 使用新的反馈 API 捕获反馈\n   *\n   * @param params Feedback parameters\n   * @returns Event ID\n   */\n  public captureFeedback(params: SendFeedbackParams): string {\n    return captureFeedbackCore(params, {}, getCurrentScope());\n  }\n}\n","import { getClient, isEnabled, makeDsn } from '@sentry/core';\nimport { isConsentGranted, isConsentRequired } from './consent';\nimport { appName, isMiniappEnvironment, isMinigame } from './crossPlatform';\nimport { getConfiguredDefaultIntegrationsMode, MiniappClient, usesCustomTransport } from './client';\nimport { miniappStackParser } from './stacktrace';\nimport { normalizeMaxConcurrentRequests, normalizeRequestTimeout } from './transports/xhr';\nimport type {\n  MiniappDiagnostics,\n  MiniappDiagnosticsOptions,\n  MiniappDiagnosticsTransport,\n  MiniappDiagnosticsWarning,\n  MiniappOptions,\n} from './types';\nimport { SDK_NAME, SDK_VERSION } from './version';\n\n/** 读取当前 SDK 运行时诊断信息。不会发送事件，也不会触发缓存 flush。 */\nexport function getDiagnostics(): MiniappDiagnostics {\n  const client = getClient();\n  const isMiniappClient = client instanceof MiniappClient;\n  const options = isMiniappClient ? (client.getOptions() as MiniappOptions) : null;\n  const customTransport = isMiniappClient ? usesCustomTransport(client) : false;\n  const transport = options ? buildTransportDiagnostics(options, customTransport) : null;\n  const diagnosticsOptions =\n    options && isMiniappClient\n      ? buildOptionsDiagnostics(\n          options,\n          customTransport,\n          getConfiguredDefaultIntegrationsMode(client),\n        )\n      : null;\n  const diagnostics: MiniappDiagnostics = {\n    sdk: {\n      name: SDK_NAME,\n      version: SDK_VERSION,\n    },\n    platform: {\n      name: appName() as MiniappDiagnostics['platform']['name'],\n      isMiniappEnvironment: isMiniappEnvironment(),\n      isMinigame: isMinigame(),\n    },\n    client: {\n      initialized: !!client,\n      miniappClient: isMiniappClient,\n      enabled: isEnabled(),\n    },\n    options: diagnosticsOptions,\n    transport,\n    integrations: Array.isArray(options?.integrations)\n      ? options.integrations.map((integration) => integration.name)\n      : [],\n    warnings: [],\n    timestamp: Date.now(),\n  };\n\n  diagnostics.warnings = buildWarnings(diagnostics);\n  return diagnostics;\n}\n\nfunction buildOptionsDiagnostics(\n  options: MiniappOptions,\n  customTransport: boolean,\n  defaultIntegrations: MiniappDiagnosticsOptions['defaultIntegrations'],\n): MiniappDiagnosticsOptions {\n  const dsn = normalizeDsn(options.dsn);\n  return {\n    dsn,\n    release: options.release ?? null,\n    environment: options.environment ?? null,\n    debug: options.debug === true,\n    sampleRate: options.sampleRate ?? 1,\n    tracesSampleRate: options.tracesSampleRate ?? null,\n    tracesSamplerConfigured: typeof options.tracesSampler === 'function',\n    enableLogs: options.enableLogs === true,\n    enableSourceMap: options.enableSourceMap !== false,\n    enableOfflineCache:\n      options.requireConsent === true || (!customTransport && options.enableOfflineCache !== false),\n    requireConsent: options.requireConsent === true,\n    consentGranted: isConsentGranted(),\n    enableTracePropagation: options.enableTracePropagation !== false,\n    enableStandaloneHttpSpans: options.enableStandaloneHttpSpans !== false,\n    tracePropagationTargetsCount: options.tracePropagationTargets?.length ?? 0,\n    propagateTraceparent: options.propagateTraceparent === true,\n    enableAutoSessionTracking: options.enableAutoSessionTracking !== false,\n    enableNetworkStatusMonitoring: options.enableNetworkStatusMonitoring !== false,\n    enableConsoleBreadcrumbs: options.enableConsoleBreadcrumbs === true,\n    enableNavigationBreadcrumbs: options.enableNavigationBreadcrumbs !== false,\n    enableUserInteractionBreadcrumbs: options.enableUserInteractionBreadcrumbs !== false,\n    enableMinigameLifecycle: isMinigame()\n      ? options.enableMinigameLifecycle !== false\n      : options.enableMinigameLifecycle === true,\n    enableMinigameFrameRate: isMinigame()\n      ? options.enableMinigameFrameRate !== false\n      : options.enableMinigameFrameRate === true,\n    customTransport,\n    customStackParser:\n      typeof options.stackParser === 'function' && options.stackParser !== miniappStackParser,\n    defaultIntegrations,\n  };\n}\n\nfunction buildTransportDiagnostics(\n  options: MiniappOptions,\n  customTransport: boolean,\n): MiniappDiagnosticsTransport {\n  return {\n    custom: customTransport,\n    offlineCache:\n      options.requireConsent === true || (!customTransport && options.enableOfflineCache !== false),\n    consentGate: options.requireConsent === true,\n    requestTimeout: customTransport\n      ? null\n      : normalizeRequestTimeout(options.transportOptions?.requestTimeout),\n    maxConcurrentRequests: customTransport\n      ? null\n      : normalizeMaxConcurrentRequests(options.transportOptions?.maxConcurrentRequests),\n  };\n}\n\nfunction normalizeDsn(dsn: string | undefined): MiniappDiagnosticsOptions['dsn'] {\n  if (!dsn) {\n    return {\n      configured: false,\n      valid: false,\n      host: null,\n    };\n  }\n\n  const parsed = makeDsn(dsn);\n  return {\n    configured: true,\n    valid: !!parsed,\n    host: parsed?.host || null,\n  };\n}\n\nfunction buildWarnings(diagnostics: MiniappDiagnostics): MiniappDiagnosticsWarning[] {\n  const warnings: MiniappDiagnosticsWarning[] = [];\n\n  if (!diagnostics.platform.isMiniappEnvironment) {\n    warnings.push({\n      code: 'not_miniapp_environment',\n      message: '当前运行时未检测到已支持的小程序平台全局对象。',\n    });\n  }\n\n  if (!diagnostics.client.initialized) {\n    warnings.push({\n      code: 'client_not_initialized',\n      message: '当前还没有绑定 Sentry client，请确认已在 App() 之前调用 Sentry.init()。',\n    });\n  }\n\n  if (diagnostics.client.initialized && !diagnostics.client.miniappClient) {\n    warnings.push({\n      code: 'non_miniapp_client',\n      message: '当前绑定的 Sentry client 不是 sentry-miniapp 的 MiniappClient。',\n    });\n  }\n\n  const options = diagnostics.options;\n  if (!options) {\n    return warnings;\n  }\n\n  if (!options.dsn.configured) {\n    warnings.push({\n      code: 'missing_dsn',\n      message: '未配置 dsn，SDK 不会上报事件到 Sentry。',\n    });\n  } else if (!options.dsn.valid) {\n    warnings.push({\n      code: 'invalid_dsn',\n      message: 'dsn 不是有效 URL，请检查 Sentry 项目 DSN 配置。',\n    });\n  }\n\n  if (!options.release) {\n    warnings.push({\n      code: 'missing_release',\n      message: '未配置 release，生产环境 Source Map 解析通常无法稳定匹配。',\n    });\n  }\n\n  if (!options.tracesSamplerConfigured && options.tracesSampleRate === null) {\n    warnings.push({\n      code: 'tracing_disabled',\n      message: '未配置 tracesSampleRate 或 tracesSampler，性能 tracing 不会采样上报。',\n    });\n  }\n\n  if (!options.enableSourceMap) {\n    warnings.push({\n      code: 'source_map_disabled',\n      message: 'enableSourceMap=false，SDK 不会自动归一化小程序堆栈路径。',\n    });\n  }\n\n  if (isConsentRequired() && !options.consentGranted) {\n    warnings.push({\n      code: 'consent_blocking',\n      message: 'requireConsent 已开启且当前未同意，事件会进入本地缓冲，不会发送网络请求。',\n    });\n  }\n\n  return warnings;\n}\n","import { captureException, withScope } from '@sentry/core';\nimport type { WrappedFunction } from '@sentry/core';\n\n/**\n * 包装函数以捕获异常\n */\nexport function wrap(\n  fn: WrappedFunction,\n  options: {\n    mechanism?: {\n      data?: Record<string, any>;\n      handled?: boolean;\n      type?: string;\n    };\n  } = {},\n  before?: WrappedFunction,\n): any {\n  // tslint:disable-next-line:strict-type-predicates\n  if (typeof fn !== 'function') {\n    return fn;\n  }\n\n  try {\n    // We don't wanna wrap it twice\n    if ((fn as any).__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 environments\n    // can cause a \"Permission denied\" exception.\n    // Bail on wrapping and return the function as-is.\n    return fn;\n  }\n\n  const sentryWrapped: WrappedFunction = function (this: any, ...args: any[]): any {\n    // tslint:disable-next-line:strict-type-predicates\n    if (before && typeof before === 'function') {\n      before.apply(this, args);\n    }\n\n    try {\n      return fn.apply(this, args);\n    } catch (ex) {\n      // 用 withScope 临时 fork 一个 scope：事件处理器只作用于本次 captureException，用完即弃。\n      // 绝不能用 getCurrentScope().addEventProcessor——那会把处理器永久挂在当前 scope 上，给之后\n      // 每个 unrelated 事件都盖上本次的 mechanism/arguments（尤其把未处理错误误标成 handled:true，\n      // 进而虚高 crash-free 率）。\n      withScope((scope) => {\n        scope.addEventProcessor((event) => ({\n          ...event,\n          extra: {\n            ...event.extra,\n            arguments: args,\n          },\n        }));\n\n        // mechanism 交给 core 的 EventHint 处理：prepareEvent 会在 LinkedErrors 等 client\n        // processors 前把 mechanism 标到原始异常上；否则带 Error.cause 时，scope processor\n        // 阶段 values[0] 已经可能是 prepend 进来的 cause，落点会错。\n        captureException(ex, options.mechanism ? { mechanism: options.mechanism } : undefined);\n      });\n      throw ex;\n    }\n  };\n\n  // Accessing some objects may throw\n  try {\n    // tslint:disable-next-line: no-for-in\n    for (const property in fn) {\n      if (Object.prototype.hasOwnProperty.call(fn, property)) {\n        (sentryWrapped as any)[property] = (fn as any)[property];\n      }\n    }\n  } catch (_oO) {\n    // no-empty\n  }\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  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\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  } catch (_oO) {\n    // no-empty\n  }\n\n  return sentryWrapped;\n}\n\nconst ERROR_TYPE_PREFIX =\n  /^(?:Uncaught\\s+)?(Error|Exception|[A-Za-z_$][\\w.$]*(?:Error|Exception)):\\s*/i;\n\nfunction normalizeErrorMessage(message: string): string {\n  return message.trim().replace(ERROR_TYPE_PREFIX, '').replace(/\\s+/g, ' ');\n}\n\nfunction getPlatformErrorMessage(stack: string): string {\n  const lines = stack\n    .split('\\n')\n    .map((line) => line.trim())\n    .filter(Boolean);\n  const markerIndex = lines.indexOf('MiniProgramError');\n  const markerMessage = markerIndex >= 0 ? lines[markerIndex + 1] : undefined;\n  if (\n    markerMessage &&\n    !markerMessage.startsWith('at ') &&\n    !/^\\s*[^@]*@.+:\\d+(?::\\d+)?\\s*$/.test(markerMessage)\n  ) {\n    return normalizeErrorMessage(markerMessage);\n  }\n\n  const typedMessage = lines.find(\n    (line) => ERROR_TYPE_PREFIX.test(line) && normalizeErrorMessage(line).length > 0,\n  );\n\n  if (typedMessage) {\n    return normalizeErrorMessage(typedMessage);\n  }\n\n  const message = lines.find(\n    (line) =>\n      line !== 'MiniProgramError' &&\n      !line.startsWith('at ') &&\n      !/^\\s*[^@]*@.+:\\d+(?::\\d+)?\\s*$/.test(line),\n  );\n  return message ? normalizeErrorMessage(message) : '';\n}\n\nfunction getPlatformErrorType(stack: string): string | undefined {\n  for (const line of stack.split('\\n')) {\n    const match = ERROR_TYPE_PREFIX.exec(line.trim());\n    if (match?.[1]) {\n      return match[1];\n    }\n  }\n\n  return undefined;\n}\n\nfunction getObjectErrorType(error: { name?: unknown; constructor?: unknown }): string | undefined {\n  try {\n    if (typeof error.name === 'string' && error.name) {\n      return error.name;\n    }\n  } catch (_error) {\n    // 某些宿主对象不允许读取 name，继续尝试构造器名称。\n  }\n\n  try {\n    const constructorName =\n      typeof error.constructor === 'function' ? error.constructor.name : undefined;\n    // 与 core 的 error.name || error.constructor.name 语义对齐，但不把普通 Object\n    // 等构造器误当成异常类型。\n    return constructorName && ERROR_TYPE_PREFIX.test(`${constructorName}: `)\n      ? constructorName\n      : undefined;\n  } catch (_error) {\n    return undefined;\n  }\n}\n\nexport interface ErrorDetails {\n  message: string;\n  stack: string;\n  type?: string;\n}\n\nexport function getErrorDetails(value: unknown): ErrorDetails | undefined {\n  try {\n    if (typeof value === 'string') {\n      const type = getPlatformErrorType(value);\n      return type\n        ? { message: getPlatformErrorMessage(value), stack: value, type }\n        : { message: getPlatformErrorMessage(value), stack: value };\n    }\n    if (!value || typeof value !== 'object') {\n      return undefined;\n    }\n\n    const error = value as { message?: unknown; name?: unknown; stack?: unknown };\n    const rawMessage = typeof error.message === 'string' ? error.message : '';\n    const rawStack = typeof error.stack === 'string' ? error.stack : '';\n    // 微信小游戏 Android 真机可能传入 { message: \"MiniProgramError\\n...\\nat ...\", stack: \"\" }。\n    // stack 为空时，message 本身就是完整宿主堆栈，必须沿字符串路径解析。\n    const embeddedStack = rawMessage.includes('\\n') ? rawMessage : '';\n    const stack = rawStack.trim() ? rawStack : embeddedStack;\n    const platformMessage = embeddedStack ? getPlatformErrorMessage(embeddedStack) : '';\n    const message =\n      platformMessage ||\n      (rawMessage ? normalizeErrorMessage(rawMessage) : getPlatformErrorMessage(stack));\n    const type = getPlatformErrorType(stack) || getObjectErrorType(error);\n    return type ? { message, stack, type } : { message, stack };\n  } catch (_error) {\n    return undefined;\n  }\n}\n\n/**\n * 安全地提取函数名称\n */\nexport function getFunctionName(fn: any): string {\n  try {\n    return (fn && fn.name) || '<anonymous>';\n  } catch (_e) {\n    return '<anonymous>';\n  }\n}\n\n/**\n * 用新值填充对象属性，保留原始值的引用\n */\nexport interface FillResult {\n  replaced: boolean;\n  restore: () => void;\n}\n\nfunction replacePropertyValue(\n  source: { [key: string]: any },\n  name: string,\n  value: any,\n  enumerable: boolean,\n): boolean {\n  try {\n    source[name] = value;\n    if (source[name] === value) return true;\n  } catch (_e) {\n    // 部分小程序真机把原生 API 暴露为 accessor，直接赋值可能抛错或被 setter 忽略。\n  }\n\n  try {\n    Object.defineProperty(source, name, {\n      configurable: true,\n      enumerable,\n      value,\n      writable: true,\n    });\n    return source[name] === value;\n  } catch (_e) {\n    // 不可配置的宿主属性无法安全替换。\n    return false;\n  }\n}\n\nexport function fill(\n  source: { [key: string]: any },\n  name: string,\n  replacementFactory: (...args: any[]) => any,\n): FillResult | undefined {\n  try {\n    if (!(name in source)) return undefined;\n  } catch (_e) {\n    // 宿主 Proxy 可能拒绝 has 检查；无法确认属性存在时不尝试修改。\n    return undefined;\n  }\n\n  let hadOwnProperty = false;\n  let descriptorInspected = false;\n  let originalDescriptor: PropertyDescriptor | undefined;\n  try {\n    hadOwnProperty = Object.prototype.hasOwnProperty.call(source, name);\n    originalDescriptor = hadOwnProperty ? Object.getOwnPropertyDescriptor(source, name) : undefined;\n    descriptorInspected = true;\n  } catch (_e) {\n    // 宿主代理可能不允许读取 descriptor；仍可继续尝试普通赋值。\n  }\n  let original: () => any;\n  try {\n    original = source[name] as () => any;\n  } catch (_e) {\n    // 无法安全读取原值时不能建立可恢复的包装。\n    return undefined;\n  }\n  const wrapped = replacementFactory(original);\n\n  if (typeof wrapped === 'function') {\n    try {\n      wrapped.prototype = wrapped.prototype || {};\n      wrapped.prototype.constructor = wrapped;\n    } catch (_Oo) {\n      // This can throw in some funky environments\n    }\n  }\n\n  const enumerable = originalDescriptor?.enumerable ?? true;\n  const replaced = replacePropertyValue(source, name, wrapped, enumerable);\n\n  return {\n    replaced,\n    restore: () => {\n      if (!replaced) return;\n\n      // 身份读取失败时无法证明当前属性仍由我们拥有。此时宁可保留透明 wrapper，\n      // 也不能进入恢复 fallback 覆盖宿主或第三方后来安装的实现。\n      try {\n        if (source[name] !== wrapped) return;\n      } catch (_e) {\n        return;\n      }\n\n      try {\n        if (!descriptorInspected) {\n          replacePropertyValue(source, name, original, enumerable);\n        } else if (hadOwnProperty && originalDescriptor) {\n          Object.defineProperty(source, name, originalDescriptor);\n\n          // accessor 可能把值保存在宿主内部；恢复 descriptor 后再尽力恢复原始值。\n          if (source[name] !== original && originalDescriptor.set) {\n            source[name] = original;\n          }\n        } else {\n          delete source[name];\n\n          // 若赋值命中了继承的 setter，删除自有属性后还需恢复其内部值。\n          if (source[name] !== original) {\n            source[name] = original;\n          }\n        }\n      } catch (_e) {\n        // 宿主拒绝精确恢复 descriptor 时，至少尽力恢复原始函数。\n        replacePropertyValue(source, name, original, enumerable);\n      }\n    },\n  };\n}\n","import { captureException, getClient, withScope } from '@sentry/core';\nimport type { Client, Event, Integration, IntegrationFn } from '@sentry/core';\n\nimport { sdk } from '../crossPlatform';\nimport { getErrorDetails } from '../helpers';\n\ninterface RecentInstrumentEvent {\n  capturedAt: number;\n  type: string;\n  value: string;\n}\n\nconst ON_ERROR_DEDUPLICATION_WINDOW_MS = 1000;\nconst MAX_RECENT_INSTRUMENT_EVENTS = 20;\n\ninterface PlatformErrorPayload {\n  message?: unknown;\n  name?: unknown;\n  stack?: unknown;\n}\n\ntype PlatformErrorValue = string | Error | PlatformErrorPayload;\n\nfunction errorFromPlatformValue(value: PlatformErrorValue): Error {\n  if (value instanceof Error) {\n    return value;\n  }\n\n  const details = getErrorDetails(value);\n  const error = new Error(details?.message || 'Unknown platform error');\n  if (details?.type) {\n    error.name = details.type;\n  }\n  // 小程序 / 小游戏 onError 可能直接给字符串，也可能给\n  // { message: \"MiniProgramError\\n...\\nat ...\", stack: \"\" }。覆盖本地构造 Error\n  // 产生的无关 stack，让 MiniappClient 使用用户配置的 stackParser 解析宿主帧。\n  if (details) {\n    error.stack = details.stack || details.message;\n  }\n  return error;\n}\n\n/** JSDoc */\ninterface GlobalHandlersIntegrations {\n  onerror: boolean;\n  onunhandledrejection: boolean;\n  onpagenotfound: boolean;\n  onmemorywarning: 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  private _onErrorHandlerInstalled: boolean = false;\n  private _onUnhandledRejectionHandlerInstalled: boolean = false;\n  private _onPageNotFoundHandlerInstalled: boolean = false;\n  private _onMemoryWarningHandlerInstalled: boolean = false;\n\n  private _errorHandler: ((err: PlatformErrorValue) => void) | null = null;\n  private _rejectionHandler:\n    | ((res: { reason: string | Error; promise: Promise<any> }) => void)\n    | null = null;\n  private _pageNotFoundHandler:\n    | ((res: { path: string; query: Record<string, any>; isEntryPage: boolean }) => void)\n    | null = null;\n  private _memoryWarningHandler: ((res: { level: number }) => void) | null = null;\n  private _client: Client | undefined;\n  private readonly _recentInstrumentEvents: RecentInstrumentEvent[] = [];\n\n  /** JSDoc */\n  public constructor(options?: Partial<GlobalHandlersIntegrations>) {\n    this._options = {\n      onerror: true,\n      onunhandledrejection: true,\n      onpagenotfound: true,\n      onmemorywarning: true,\n      ...options,\n    };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    this._setup();\n  }\n\n  /** 按 core 官方生命周期在每个 client 上安装，并由 client 统一回收。 */\n  public setup(client: Client): void {\n    this._client = client;\n    this._setup();\n    client.registerCleanup(() => this.cleanup());\n  }\n\n  /**\n   * TryCatch 捕获并重新抛出的异常，可能在微信小游戏真机上延迟进入 onError。\n   * 在 Core 完成事件构建后比较最终异常类型和消息，避免依赖宿主原始 Error 的不稳定形态。\n   */\n  public processEvent(event: Event): Event | null {\n    if (!this._options.onerror || event.type) {\n      return event;\n    }\n\n    const exception = event.exception?.values?.find(\n      (value) => value.mechanism?.type === 'instrument' || value.mechanism?.type === 'onerror',\n    );\n    if (!exception?.type || !exception.value) {\n      return event;\n    }\n\n    const now = Date.now();\n    this._removeExpiredInstrumentEvents(now);\n\n    if (exception.mechanism?.type === 'instrument') {\n      this._recentInstrumentEvents.push({\n        capturedAt: now,\n        type: exception.type,\n        value: exception.value,\n      });\n      if (this._recentInstrumentEvents.length > MAX_RECENT_INSTRUMENT_EVENTS) {\n        this._recentInstrumentEvents.splice(\n          0,\n          this._recentInstrumentEvents.length - MAX_RECENT_INSTRUMENT_EVENTS,\n        );\n      }\n      return event;\n    }\n\n    const matchIndex = this._recentInstrumentEvents.findIndex(\n      (candidate) => candidate.type === exception.type && candidate.value === exception.value,\n    );\n    if (matchIndex === -1) {\n      return event;\n    }\n\n    this._recentInstrumentEvents.splice(matchIndex, 1);\n    return null;\n  }\n\n  private _removeExpiredInstrumentEvents(now: number): void {\n    for (let index = this._recentInstrumentEvents.length - 1; index >= 0; index -= 1) {\n      if (\n        now - this._recentInstrumentEvents[index]!.capturedAt >\n        ON_ERROR_DEDUPLICATION_WINDOW_MS\n      ) {\n        this._recentInstrumentEvents.splice(index, 1);\n      }\n    }\n  }\n\n  private _setup(): void {\n    Error.stackTraceLimit = 50;\n\n    if (this._options.onerror) {\n      this._installGlobalOnErrorHandler();\n    }\n\n    if (this._options.onunhandledrejection) {\n      this._installGlobalOnUnhandledRejectionHandler();\n    }\n\n    if (this._options.onpagenotfound) {\n      this._installGlobalOnPageNotFoundHandler();\n    }\n\n    if (this._options.onmemorywarning) {\n      this._installGlobalOnMemoryWarningHandler();\n    }\n  }\n\n  /** JSDoc */\n  private _installGlobalOnErrorHandler(): void {\n    if (this._onErrorHandlerInstalled) {\n      return;\n    }\n\n    if (sdk().onError) {\n      this._errorHandler = (err: PlatformErrorValue) => {\n        if (this._client && getClient() !== this._client) return;\n\n        const error = errorFromPlatformValue(err);\n        captureException(error, {\n          mechanism: {\n            type: 'onerror',\n            handled: false,\n          },\n        });\n      };\n      sdk().onError?.(this._errorHandler);\n    }\n\n    this._onErrorHandlerInstalled = true;\n  }\n\n  /** JSDoc */\n  private _installGlobalOnUnhandledRejectionHandler(): void {\n    if (this._onUnhandledRejectionHandlerInstalled) {\n      return;\n    }\n\n    if (sdk().onUnhandledRejection) {\n      this._rejectionHandler = ({\n        reason,\n        promise,\n      }: {\n        reason: string | Error;\n        promise: Promise<any>;\n      }) => {\n        if (this._client && getClient() !== this._client) return;\n        const error = typeof reason === 'string' ? new Error(reason) : reason;\n        captureException(error, {\n          mechanism: {\n            type: 'onunhandledrejection',\n            handled: false,\n          },\n          data: {\n            promise,\n          },\n        });\n      };\n      sdk().onUnhandledRejection?.(this._rejectionHandler);\n    }\n\n    this._onUnhandledRejectionHandlerInstalled = true;\n  }\n\n  /** JSDoc */\n  private _installGlobalOnPageNotFoundHandler(): void {\n    if (this._onPageNotFoundHandlerInstalled) {\n      return;\n    }\n\n    if (sdk().onPageNotFound) {\n      this._pageNotFoundHandler = (res: {\n        path: string;\n        query: Record<string, any>;\n        isEntryPage: boolean;\n      }) => {\n        if (this._client && getClient() !== this._client) return;\n        const url = res.path.split('?')[0];\n\n        withScope((scope) => {\n          scope.setTag('pagenotfound', url);\n          scope.setContext('page_not_found', {\n            path: res.path,\n            query: res.query,\n            isEntryPage: res.isEntryPage,\n          });\n\n          captureException(new Error(`页面无法找到: ${url}`), {\n            mechanism: {\n              type: 'onpagenotfound',\n              handled: true,\n            },\n          });\n        });\n      };\n      sdk().onPageNotFound?.(this._pageNotFoundHandler);\n    }\n\n    this._onPageNotFoundHandlerInstalled = true;\n  }\n\n  /** JSDoc */\n  private _installGlobalOnMemoryWarningHandler(): void {\n    if (this._onMemoryWarningHandlerInstalled) {\n      return;\n    }\n\n    if (sdk().onMemoryWarning) {\n      this._memoryWarningHandler = ({ level = -1 }: { level: number }) => {\n        if (this._client && getClient() !== this._client) return;\n        let levelMessage = '没有获取到告警级别信息';\n\n        switch (level) {\n          case 5:\n            levelMessage = 'TRIM_MEMORY_RUNNING_MODERATE';\n            break;\n          case 10:\n            levelMessage = 'TRIM_MEMORY_RUNNING_LOW';\n            break;\n          case 15:\n            levelMessage = 'TRIM_MEMORY_RUNNING_CRITICAL';\n            break;\n          default:\n            return;\n        }\n\n        withScope((scope) => {\n          scope.setTag('memory-warning', String(level));\n          scope.setContext('memory_warning', {\n            level,\n            message: levelMessage,\n          });\n\n          captureException(new Error('内存不足告警'), {\n            mechanism: {\n              type: 'onmemorywarning',\n              handled: true,\n            },\n          });\n        });\n      };\n      sdk().onMemoryWarning?.(this._memoryWarningHandler);\n    }\n\n    this._onMemoryWarningHandlerInstalled = true;\n  }\n\n  /**\n   * 清理资源，注销全局事件处理器\n   */\n  public cleanup(): void {\n    try {\n      const currentSdk = sdk() as any;\n      if (this._errorHandler && currentSdk.offError) {\n        currentSdk.offError(this._errorHandler);\n      }\n      if (this._rejectionHandler && currentSdk.offUnhandledRejection) {\n        currentSdk.offUnhandledRejection(this._rejectionHandler);\n      }\n      if (this._pageNotFoundHandler && currentSdk.offPageNotFound) {\n        currentSdk.offPageNotFound(this._pageNotFoundHandler);\n      }\n      if (this._memoryWarningHandler && currentSdk.offMemoryWarning) {\n        currentSdk.offMemoryWarning(this._memoryWarningHandler);\n      }\n    } catch (_e) {\n      // 部分平台可能不支持 off* 方法\n    }\n\n    this._errorHandler = null;\n    this._rejectionHandler = null;\n    this._pageNotFoundHandler = null;\n    this._memoryWarningHandler = null;\n    this._onErrorHandlerInstalled = false;\n    this._onUnhandledRejectionHandlerInstalled = false;\n    this._onPageNotFoundHandlerInstalled = false;\n    this._onMemoryWarningHandlerInstalled = false;\n    this._recentInstrumentEvents.length = 0;\n  }\n}\n\n/**\n * Global handlers integration\n */\nexport const globalHandlersIntegration: IntegrationFn = (\n  options?: Partial<GlobalHandlersIntegrations>,\n) => {\n  return new GlobalHandlers(options);\n};\n","import type { Integration, IntegrationFn } from '@sentry/core';\n\nimport { wrap, fill, getFunctionName } from '../helpers';\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 _wrapTimeFunction(original: (...args: any[]) => any): (...args: any[]) => any {\n    return function (this: any, ...args: any[]): any {\n      const originalCallback = args[0];\n      args[0] = wrap(originalCallback, {\n        mechanism: {\n          data: { function: getFunctionName(original) },\n          // 回调异常捕获后仍会重新抛出，对 crash-free 统计必须标记为未处理。\n          handled: false,\n          type: 'instrument',\n        },\n      });\n      return original.apply(this, args);\n    };\n  }\n\n  /** JSDoc */\n  private _wrapRAF(original: any): (callback: () => void) => any {\n    return function (this: any, callback: () => void): any {\n      return original.call(\n        this,\n        wrap(callback, {\n          mechanism: {\n            data: {\n              function: 'requestAnimationFrame',\n              handler: getFunctionName(original),\n            },\n            handled: false,\n            type: 'instrument',\n          },\n        }),\n      );\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    // In miniapp environment, we mainly focus on wrapping common async functions\n    const global = globalThis as any;\n\n    if (global.setTimeout) {\n      fill(global, 'setTimeout', this._wrapTimeFunction.bind(this));\n    }\n    if (global.setInterval) {\n      fill(global, 'setInterval', this._wrapTimeFunction.bind(this));\n    }\n    if (global.requestAnimationFrame) {\n      fill(global, 'requestAnimationFrame', this._wrapRAF.bind(this));\n    }\n  }\n}\n\n/**\n * TryCatch integration\n */\nexport const tryCatchIntegration: IntegrationFn = () => {\n  return new TryCatch();\n};\n","import type { Event, EventHint, Exception, ExtendedError, Integration } from '@sentry/core';\nimport {\n  exceptionFromError,\n  getCurrentScope,\n  linkedErrorsIntegration as coreLinkedErrorsIntegration,\n} from '@sentry/core';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\n/** Adds SDK info to the event */\nexport class LinkedErrors implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'LinkedErrors';\n\n  /**\n   * @inheritDoc\n   */\n  public 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    // This integration doesn't need setup\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public processEvent(event: Event, hint?: EventHint): Event {\n    const client = getCurrentScope().getClient();\n    if (!client) {\n      return event;\n    }\n\n    // const options = client.getOptions();\n    // Note: getCurrentScope() doesn't have getIntegration method, so we'll process directly\n    return this._handler(event, hint);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  private _handler(event: Event, hint?: EventHint): Event {\n    if (\n      !event.exception ||\n      !event.exception.values ||\n      !hint ||\n      !isInstanceOf(hint.originalException, Error)\n    ) {\n      return event;\n    }\n\n    const linkedErrors = this._walkErrorTree(hint.originalException as ExtendedError, this._key);\n    event.exception.values = [...linkedErrors, ...event.exception.values];\n\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\n    const exception = exceptionFromError(() => [], error[key]);\n    return this._walkErrorTree(error[key], key, [exception, ...stack]);\n  }\n}\n\n/**\n * Safely checks whether a value is an instance of the requested constructor.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isInstanceOf(wat: any, base: any): boolean {\n  try {\n    return wat instanceof base;\n  } catch (_e) {\n    return false;\n  }\n}\n\n/**\n * LinkedErrors integration\n */\nexport const linkedErrorsIntegration = (options?: { key?: string; limit?: number }): Integration =>\n  coreLinkedErrorsIntegration(options);\n","import type { Event, Integration, IntegrationFn } from '@sentry/core';\n\nimport { getSystemInfo, getAccountInfo } from '../crossPlatform';\n\n/** Add node request data to the event */\nexport class HttpContext implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'HttpContext';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = HttpContext.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    // This integration adds context during event processing\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public processEvent(event: Event): Event {\n    // runtime 与 appId 来源的 app 是本集成独有的贡献。\n    // device 由 MiniappClient._prepareEvent 统一写（唯一权威，避免多处重复）；\n    // network 由 NetworkStatusIntegration 写（带连接状态，且不走异步回调时序）。\n    //\n    // app_version / app_identifier 使用 Sentry 标准字段，宿主版本单独放在\n    // contexts.miniapp，避免将微信基础库版本误当成小程序发布版本。\n    const miniappVersion = this._getMiniappVersion();\n    const account = getAccountInfo();\n\n    event.contexts = {\n      ...event.contexts,\n      runtime: {\n        ...(event.contexts?.['runtime'] || {}),\n        name: 'miniapp',\n        version: miniappVersion,\n      },\n      app: {\n        app_identifier: account.appId,\n        app_version: account.version,\n        // 兼容 1.x 已有的非标准字段，2.0 再移除。\n        name: account.appId,\n        version: account.version,\n        ...(event.contexts?.['app'] || {}),\n      },\n    };\n\n    return event;\n  }\n\n  /**\n   * Get miniapp version\n   */\n  private _getMiniappVersion(): string {\n    const sys = getSystemInfo();\n    return sys?.version || sys?.SDKVersion || 'unknown';\n  }\n}\n\n/**\n * HttpContext integration\n */\nexport const httpContextIntegration: IntegrationFn = () => {\n  return new HttpContext();\n};\n","import { dedupeIntegration as coreDedupeIntegration } from '@sentry/core';\nimport type { Event, EventHint, Integration } from '@sentry/core';\n\n/**\n * Deduplication filter.\n *\n * @deprecated 仅保留给依赖 `fuzzyMatch` 的 1.x 历史用法，将在 2.0 移除。\n * 新代码请使用 `dedupeIntegration()`，它直接复用 `@sentry/core` 官方实现。\n */\nexport class Dedupe implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Dedupe';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Dedupe.id;\n\n  /**\n   * @inheritDoc\n   */\n  private _previousEvent?: Event;\n  private readonly _fuzzyMatch: boolean;\n\n  constructor(options: { fuzzyMatch?: boolean } = {}) {\n    this._fuzzyMatch = !!options.fuzzyMatch;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    // This integration doesn't need setup\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public processEvent(currentEvent: Event, _hint?: EventHint): Event | null {\n    // We want to ignore any non-error type events, e.g. transactions or replays\n    // These should never be deduped, and also not be compared against as _previousEvent.\n    if (currentEvent.type) {\n      return currentEvent;\n    }\n\n    // Juuust in case something goes wrong\n    try {\n      if (this._shouldDropEvent(currentEvent, this._previousEvent)) {\n        return null;\n      }\n    } catch (_oO) {\n      this._previousEvent = this._cloneEventForComparison(currentEvent);\n      return currentEvent;\n    }\n\n    this._previousEvent = this._cloneEventForComparison(currentEvent);\n    return currentEvent;\n  }\n\n  /** JSDoc */\n  private _shouldDropEvent(currentEvent: Event, previousEvent?: Event): boolean {\n    if (!previousEvent) {\n      return false;\n    }\n\n    if (this._isSameMessageEvent(currentEvent, previousEvent)) {\n      return true;\n    }\n\n    if (this._isSameExceptionEvent(currentEvent, previousEvent)) {\n      return true;\n    }\n\n    return false;\n  }\n\n  /** JSDoc */\n  private _isSameMessageEvent(currentEvent: Event, previousEvent: Event): boolean {\n    const currentMessage = currentEvent.message;\n    const previousMessage = previousEvent.message;\n\n    // If neither event has a message property, they were both exceptions, so bail out\n    if (!currentMessage && !previousMessage) {\n      return false;\n    }\n\n    // If only one event has a message property, the events are not the same\n    if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n      return false;\n    }\n\n    if (currentMessage !== previousMessage) {\n      return false;\n    }\n\n    if (!this._isSameFingerprint(currentEvent, previousEvent)) {\n      return false;\n    }\n\n    if (!this._isSameStacktrace(currentEvent, previousEvent)) {\n      return false;\n    }\n\n    return true;\n  }\n\n  /** JSDoc */\n  private _isSameExceptionEvent(currentEvent: Event, previousEvent: Event): boolean {\n    const currentException = this._getExceptionFromEvent(currentEvent);\n    const previousException = this._getExceptionFromEvent(previousEvent);\n\n    if (!currentException || !previousException) {\n      return false;\n    }\n\n    if (currentException.type !== previousException.type) {\n      return false;\n    }\n\n    if (this._fuzzyMatch) {\n      if (!fuzzyValueMatch(currentException.value, previousException.value)) {\n        return false;\n      }\n    } else {\n      if (currentException.value !== previousException.value) {\n        return false;\n      }\n    }\n\n    if (!this._isSameFingerprint(currentEvent, previousEvent)) {\n      return false;\n    }\n\n    if (!this._isSameStacktrace(currentEvent, previousEvent)) {\n      return false;\n    }\n\n    return true;\n  }\n\n  /** JSDoc */\n  private _isSameStacktrace(currentEvent: Event, previousEvent: Event): boolean {\n    let currentFrames = this._getFramesFromEvent(currentEvent);\n    let previousFrames = this._getFramesFromEvent(previousEvent);\n\n    // If neither event has a stacktrace, they are assumed to be the same\n    if (!currentFrames && !previousFrames) {\n      return true;\n    }\n\n    // If only one event has a stacktrace, but not the other one, they are not the same\n    if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n      return false;\n    }\n\n    currentFrames = currentFrames as any[];\n    previousFrames = previousFrames as any[];\n\n    // If number of frames differ, they are not the same\n    if (previousFrames.length !== currentFrames.length) {\n      return false;\n    }\n\n    // Otherwise, compare the frames\n    for (let i = 0; i < previousFrames.length; i++) {\n      const frameA = previousFrames[i];\n      const frameB = currentFrames[i];\n\n      if (\n        frameA.filename !== frameB.filename ||\n        frameA.lineno !== frameB.lineno ||\n        frameA.colno !== frameB.colno ||\n        frameA.function !== frameB.function\n      ) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  /** JSDoc */\n  private _isSameFingerprint(currentEvent: Event, previousEvent: Event): boolean {\n    let currentFingerprint = currentEvent.fingerprint;\n    let previousFingerprint = previousEvent.fingerprint;\n\n    // If neither event has a fingerprint, they are assumed to be the same\n    if (!currentFingerprint && !previousFingerprint) {\n      return true;\n    }\n\n    // If only one event has a fingerprint, but not the other one, they are not the same\n    if (\n      (currentFingerprint && !previousFingerprint) ||\n      (!currentFingerprint && previousFingerprint)\n    ) {\n      return false;\n    }\n\n    currentFingerprint = currentFingerprint as string[];\n    previousFingerprint = previousFingerprint as string[];\n\n    // Otherwise, compare the fingerprints\n    try {\n      return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n    } catch (_oO) {\n      return false;\n    }\n  }\n\n  /** JSDoc */\n  private _getExceptionFromEvent(event: Event): any {\n    return event.exception && event.exception.values && event.exception.values[0];\n  }\n\n  /** 浅拷贝事件的关键去重字段 */\n  private _cloneEventForComparison(event: Event): Event {\n    return {\n      message: event.message,\n      fingerprint: event.fingerprint ? [...event.fingerprint] : undefined,\n      exception: event.exception\n        ? {\n            values: event.exception.values?.map((v) => ({\n              type: v.type,\n              value: v.value,\n              stacktrace: v.stacktrace\n                ? {\n                    frames: v.stacktrace.frames?.map((f) => ({ ...f })),\n                  }\n                : undefined,\n            })),\n          }\n        : undefined,\n    } as Event;\n  }\n\n  /** JSDoc */\n  private _getFramesFromEvent(event: Event): any[] | undefined {\n    const exception = event.exception;\n\n    if (exception) {\n      try {\n        // @ts-expect-error Object could be undefined\n        return exception.values[0].stacktrace.frames;\n      } catch (_oO) {\n        // ignore\n      }\n    }\n\n    return undefined;\n  }\n}\n\n/**\n * Dedupe integration\n */\nexport const dedupeIntegration = (): Integration => coreDedupeIntegration();\n\n/**\n * 模糊匹配：忽略错误消息中的动态部分（时间戳、UUID、数字 ID 等）\n */\nconst DYNAMIC_PATTERNS =\n  /\\d{10,}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}/g;\n\nfunction fuzzyValueMatch(a: string | undefined, b: string | undefined): boolean {\n  if (a === b) return true;\n  if (!a || !b) return false;\n  const normalizedA = a.replace(DYNAMIC_PATTERNS, '<dynamic>');\n  const normalizedB = b.replace(DYNAMIC_PATTERNS, '<dynamic>');\n  return normalizedA === normalizedB;\n}\n","import { getCurrentScope, addBreadcrumb } from '@sentry/core';\nimport type { Integration } from '@sentry/core';\n\nimport { getSystemInfo, sdk } from '../crossPlatform';\n\n/**\n * System information integration.\n *\n * @deprecated 默认不启用，且其 system/device/network context 已被 `HttpContext` 与\n * `MiniappClient._prepareEvent` 覆盖。保留导出仅为向后兼容，将在 2.0 移除。请勿在新代码中使用。\n */\nexport class System implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'System';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = System.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    this._addSystemContext();\n    this._addNetworkContext();\n    this._addLocationContext();\n    this._addStorageContext();\n    this._checkAppUpdate();\n  }\n\n  /**\n   * Add system information to context\n   */\n  private _addSystemContext(): void {\n    try {\n      const systemInfo = getSystemInfo();\n      if (systemInfo) {\n        const scope = getCurrentScope();\n\n        // Set device context\n        scope.setContext('device', {\n          name: systemInfo.model,\n          model: systemInfo.model,\n          brand: systemInfo.brand,\n          family: systemInfo.platform,\n          arch: systemInfo.platform,\n        });\n\n        // Set OS context\n        scope.setContext('os', {\n          name: systemInfo.system?.split(' ')[0] || 'unknown',\n          version: systemInfo.system?.split(' ')[1] || 'unknown',\n          kernel_version: systemInfo.version,\n        });\n\n        // Set app context\n        scope.setContext('app', {\n          app_name: (systemInfo as any).appName || 'unknown',\n          app_version: systemInfo.version,\n        });\n\n        // Set screen context\n        scope.setContext('screen', {\n          screen_width: systemInfo.screenWidth,\n          screen_height: systemInfo.screenHeight,\n          screen_density: systemInfo.pixelRatio,\n        });\n\n        // Set tags\n        scope.setTag('device.model', systemInfo.model);\n        scope.setTag('device.brand', systemInfo.brand);\n        scope.setTag('os.name', systemInfo.system?.split(' ')[0] || 'unknown');\n        scope.setTag('os.version', systemInfo.system?.split(' ')[1] || 'unknown');\n        scope.setTag('app.version', systemInfo.version);\n        scope.setTag('language', systemInfo.language);\n      }\n    } catch (_e) {\n      // Ignore errors when getting system info\n    }\n  }\n\n  /**\n   * Add network information to context\n   */\n  private _addNetworkContext(): void {\n    try {\n      if ((sdk() as any).getNetworkType) {\n        (sdk() as any).getNetworkType({\n          success: (res: { networkType: string; isConnected?: boolean }) => {\n            const scope = getCurrentScope();\n            scope.setContext('network', {\n              type: res.networkType,\n              connected: res.isConnected !== false,\n            });\n            scope.setTag('network.type', res.networkType);\n          },\n          fail: () => {\n            // Ignore network type fetch errors\n          },\n        });\n      }\n    } catch (_e) {\n      // Ignore errors when getting network info\n    }\n  }\n\n  /**\n   * Add location information to context (if available)\n   */\n  private _addLocationContext(): void {\n    try {\n      if ((sdk() as any).getLocation) {\n        (sdk() as any).getLocation({\n          type: 'gcj02',\n          success: (res: { latitude: number; longitude: number; accuracy: number }) => {\n            const scope = getCurrentScope();\n            scope.setContext('location', {\n              latitude: res.latitude,\n              longitude: res.longitude,\n              accuracy: res.accuracy,\n            });\n          },\n          fail: () => {\n            // Ignore location fetch errors (user might not grant permission)\n          },\n        });\n      }\n    } catch (_e) {\n      // Ignore errors when getting location info\n    }\n  }\n  /**\n   * 采集存储配额信息\n   */\n  private _addStorageContext(): void {\n    try {\n      const miniappSdk = sdk();\n      if (miniappSdk && typeof miniappSdk.getStorageInfoSync === 'function') {\n        const info = miniappSdk.getStorageInfoSync();\n        if (info) {\n          const currentSize = info.currentSize || 0; // KB\n          const limitSize = info.limitSize || 0; // KB\n          const usagePercent = limitSize > 0 ? Math.round((currentSize / limitSize) * 100) : 0;\n\n          const scope = getCurrentScope();\n          scope.setContext('storage', {\n            currentSize,\n            limitSize,\n            usagePercent,\n          });\n\n          if (usagePercent >= 80) {\n            addBreadcrumb({\n              category: 'storage.warning',\n              message: `存储使用率 ${usagePercent}%（${currentSize}KB / ${limitSize}KB）`,\n              level: 'warning',\n              data: { currentSize, limitSize, usagePercent },\n            });\n          }\n        }\n      }\n    } catch (_e) {\n      // ignore\n    }\n  }\n\n  /**\n   * 检测小程序更新\n   */\n  private _checkAppUpdate(): void {\n    try {\n      const miniappSdk = sdk();\n      if (miniappSdk && typeof miniappSdk.getUpdateManager === 'function') {\n        const updateManager = miniappSdk.getUpdateManager();\n        if (updateManager) {\n          if (typeof updateManager.onCheckForUpdate === 'function') {\n            updateManager.onCheckForUpdate((res: any) => {\n              if (res && res.hasUpdate) {\n                const scope = getCurrentScope();\n                scope.setTag('has_update', 'true');\n\n                addBreadcrumb({\n                  category: 'app.update',\n                  message: '检测到新版本可用',\n                  level: 'info',\n                  data: { hasUpdate: true },\n                });\n              }\n            });\n          }\n\n          if (typeof updateManager.onUpdateReady === 'function') {\n            updateManager.onUpdateReady(() => {\n              addBreadcrumb({\n                category: 'app.update',\n                message: '新版本已下载完成',\n                level: 'info',\n                data: { updateReady: true },\n              });\n            });\n          }\n        }\n      }\n    } catch (_e) {\n      // ignore\n    }\n  }\n}\n","import { getClient } from '@sentry/core';\nimport type { Client } from '@sentry/core';\n\nimport { fill } from './helpers';\n\nexport type FunctionInstrumentationHandler = (\n  original: Function,\n  thisArg: unknown,\n  args: unknown[],\n) => unknown;\n\ninterface FunctionInstrumentationState {\n  handlers: Map<Client, FunctionInstrumentationHandler>;\n  restore: () => void;\n  wrapper: Function;\n}\n\nconst states = new WeakMap<object, Map<string, FunctionInstrumentationState>>();\n\ninterface PropertyReadResult {\n  readable: boolean;\n  value?: unknown;\n}\n\nfunction readProperty(source: object, name: string): PropertyReadResult {\n  try {\n    return { readable: true, value: (source as Record<string, unknown>)[name] };\n  } catch (_e) {\n    return { readable: false };\n  }\n}\n\nfunction warnInDebugMode(state: FunctionInstrumentationState, message: string): void {\n  const debugEnabled = [...state.handlers.keys()].some((client) => {\n    try {\n      return client.getOptions().debug === true;\n    } catch (_e) {\n      return false;\n    }\n  });\n  if (!debugEnabled) return;\n\n  try {\n    console.warn(message);\n  } catch (_e) {\n    // 诊断日志不能阻断宿主 instrumentation 的安装或降级。\n  }\n}\n\nfunction getStateMap(source: object): Map<string, FunctionInstrumentationState> {\n  let stateMap = states.get(source);\n  if (!stateMap) {\n    stateMap = new Map();\n    states.set(source, stateMap);\n  }\n  return stateMap;\n}\n\nfunction createState(\n  source: object,\n  name: string,\n  existingState?: FunctionInstrumentationState,\n): FunctionInstrumentationState | undefined {\n  const stateMap = getStateMap(source);\n  const state =\n    existingState ??\n    ({\n      handlers: new Map<Client, FunctionInstrumentationHandler>(),\n    } as FunctionInstrumentationState);\n  const target = source as Record<string, unknown>;\n\n  const result = fill(target, name, (original: Function) => {\n    const wrapper = function (this: unknown, ...args: unknown[]): unknown {\n      // 宿主 API 被第三方重包后，旧 wrapper 可能仍位于新调用链内部。状态迁移到新 wrapper\n      // 后旧层必须透明转发，否则同一 handler 会递归或重复执行。\n      if (state.wrapper !== wrapper) return original.apply(this, args);\n\n      const activeClient = getClient();\n      const handler = activeClient ? state.handlers.get(activeClient) : undefined;\n      return handler ? handler(original, this, args) : original.apply(this, args);\n    };\n\n    state.wrapper = wrapper;\n    return wrapper;\n  });\n\n  if (!result?.replaced) {\n    return undefined;\n  }\n\n  state.restore = result.restore;\n  stateMap.set(name, state);\n  return state;\n}\n\nfunction ensureState(source: object, name: string): FunctionInstrumentationState | undefined {\n  const stateMap = getStateMap(source);\n  const existing = stateMap.get(name);\n  if (existing) {\n    const current = readProperty(source, name);\n    if (!current.readable) {\n      warnInDebugMode(\n        existing,\n        `[sentry-miniapp] 无法读取宿主 API ${name}，保留现有监控状态并跳过重装`,\n      );\n      return undefined;\n    }\n    if (current.value === existing.wrapper) return existing;\n\n    // 宿主 API 被外部重新赋值后，在新调用链上重装 wrapper，同时保留所有 client handler。\n    // cleanup 闭包继续引用同一个 state，仍能正确退订并恢复最新宿主函数。\n    warnInDebugMode(\n      existing,\n      `[sentry-miniapp] 检测到宿主 API ${name} 被外部替换，正在重新安装监控包装`,\n    );\n\n    const reinstalled = createState(source, name, existing);\n    if (!reinstalled) stateMap.delete(name);\n    return reinstalled;\n  }\n  return createState(source, name);\n}\n\nfunction restoreIfIdle(source: object, name: string, state: FunctionInstrumentationState): void {\n  if (state.handlers.size > 0) return;\n\n  // 只恢复自己仍直接拥有的 wrapper。若第三方后来又包了一层，保留当前调用链，\n  // 空 handler 的 Sentry wrapper 会透明转发，避免覆盖第三方修改。\n  const current = readProperty(source, name);\n  if (current.readable && current.value === state.wrapper) {\n    state.restore();\n    getStateMap(source).delete(name);\n  }\n}\n\n/**\n * 安装一次进程级函数包装，但不绑定 client 处理器。\n *\n * `setupOnce()` 可调用本函数；真正的数据采集必须由 `setup(client)` 注册 handler。\n */\nexport function ensureFunctionInstrumentation(source: object, name: string): boolean {\n  return ensureState(source, name) !== undefined;\n}\n\n/**\n * 为指定 client 注册函数 instrumentation handler。\n *\n * 全局函数只包装一次；调用发生时仅分发给当前 scope 绑定的 client。退订只移除\n * 当前 client 的 handler，最后一个 handler 退出后才安全恢复宿主原函数。\n */\nexport function addFunctionInstrumentationHandler(\n  source: object,\n  name: string,\n  client: Client,\n  handler: FunctionInstrumentationHandler,\n): () => void {\n  const state = ensureState(source, name);\n  if (!state) return () => {};\n\n  state.handlers.set(client, handler);\n\n  let active = true;\n  return () => {\n    if (!active) return;\n    active = false;\n    if (state.handlers.get(client) === handler) {\n      state.handlers.delete(client);\n    }\n    restoreIfIdle(source, name, state);\n  };\n}\n","import { addBreadcrumb, getClient, getCurrentScope } from '@sentry/core';\nimport type { Client, Integration } from '@sentry/core';\nimport { sdk } from '../crossPlatform';\nimport {\n  addFunctionInstrumentationHandler,\n  ensureFunctionInstrumentation,\n} from '../instrumentation';\n\n/**\n * Router integration for miniapp navigation.\n *\n * @deprecated 默认不启用，导航面包屑已由 `PageBreadcrumbs`（基于 Page 生命周期）覆盖。\n * 保留导出仅为向后兼容，将在 2.0 移除。请勿在新代码中使用。\n */\nexport class Router implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Router';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Router.id;\n\n  /**\n   * @inheritDoc\n   */\n  private _lastRoute: string = '';\n\n  private readonly _cleanupCallbacks = new Set<() => void>();\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    this._ensureNavigationInstrumentation();\n  }\n\n  public setup(client: Client): void {\n    const cleanups = [\n      ...this._registerNavigationHandlers(client),\n      this._startRouteMonitoring(client),\n    ];\n    const cleanup = this._trackCleanup(cleanups);\n    client.registerCleanup(cleanup);\n  }\n\n  /**\n   * Instrument navigation functions\n   */\n  private _ensureNavigationInstrumentation(): void {\n    let currentSdk: any;\n    try {\n      currentSdk = sdk();\n    } catch (_e) {\n      return;\n    }\n\n    for (const method of ['navigateTo', 'redirectTo', 'switchTab', 'reLaunch', 'navigateBack']) {\n      if (typeof currentSdk[method] === 'function') {\n        ensureFunctionInstrumentation(currentSdk, method);\n      }\n    }\n  }\n\n  private _registerNavigationHandlers(client: Client): Array<() => void> {\n    let currentSdk: any;\n    try {\n      currentSdk = sdk();\n    } catch (_e) {\n      return []; // No SDK available\n    }\n\n    const cleanups: Array<() => void> = [];\n    const methods = ['navigateTo', 'redirectTo', 'switchTab', 'reLaunch'] as const;\n    for (const method of methods) {\n      if (typeof currentSdk[method] !== 'function') continue;\n      const handler = (original: Function, thisArg: unknown, args: unknown[]): unknown => {\n        const options = (args[0] || {}) as any;\n        this._recordNavigation(method, options.url, this._getCurrentRoute());\n        return original.apply(thisArg, args);\n      };\n      cleanups.push(addFunctionInstrumentationHandler(currentSdk, method, client, handler));\n    }\n\n    if (typeof currentSdk.navigateBack === 'function') {\n      const handler = (original: Function, thisArg: unknown, args: unknown[]): unknown => {\n        const options = (args[0] || {}) as any;\n        this._recordNavigation('navigateBack', 'back', this._getCurrentRoute(), options.delta);\n        return original.apply(thisArg, args.length > 0 ? args : [{}]);\n      };\n      cleanups.push(addFunctionInstrumentationHandler(currentSdk, 'navigateBack', client, handler));\n    }\n    return cleanups;\n  }\n\n  /**\n   * Start monitoring route changes\n   */\n  private _startRouteMonitoring(client?: Client): () => void {\n    // Monitor route changes by checking current pages periodically\n    const monitorTimer = setInterval(() => {\n      if (client && getClient() !== client) return;\n      const currentRoute = this._getCurrentRoute();\n      if (currentRoute && currentRoute !== this._lastRoute) {\n        this._recordRouteChange(this._lastRoute, currentRoute);\n        this._lastRoute = currentRoute;\n      }\n    }, 1000);\n    return () => clearInterval(monitorTimer);\n  }\n\n  /**\n   * 清理资源\n   */\n  public cleanup(): void {\n    for (const cleanup of [...this._cleanupCallbacks]) cleanup();\n    this._lastRoute = '';\n  }\n\n  private _trackCleanup(cleanups: Array<() => void>): () => void {\n    let active = true;\n    const cleanup = (): void => {\n      if (!active) return;\n      active = false;\n      for (const callback of cleanups.reverse()) callback();\n      this._cleanupCallbacks.delete(cleanup);\n    };\n    this._cleanupCallbacks.add(cleanup);\n    return cleanup;\n  }\n\n  /**\n   * Get current route\n   */\n  private _getCurrentRoute(): string {\n    try {\n      const global = globalThis as any;\n      if (global.getCurrentPages) {\n        const pages = global.getCurrentPages();\n        if (pages && pages.length > 0) {\n          const currentPage = pages[pages.length - 1];\n          return currentPage.route || currentPage.__route__ || '';\n        }\n      }\n    } catch (_e) {\n      // Ignore errors\n    }\n    return '';\n  }\n\n  /**\n   * Record navigation action\n   */\n  private _recordNavigation(action: string, to: string, from: string, delta?: number): void {\n    const scope = getCurrentScope();\n\n    // Add breadcrumb\n    addBreadcrumb({\n      category: 'navigation',\n      data: {\n        action,\n        from,\n        to,\n        delta,\n      },\n      message: `Navigation ${action}: ${from} -> ${to}`,\n      type: 'navigation',\n    });\n\n    // Set current route tag\n    scope.setTag('route', to === 'back' ? from : to);\n\n    // Set navigation context\n    scope.setContext('navigation', {\n      action,\n      from,\n      to,\n      delta,\n      timestamp: Date.now(),\n    });\n  }\n\n  /**\n   * Record route change\n   */\n  private _recordRouteChange(from: string, to: string): void {\n    const scope = getCurrentScope();\n\n    // Add breadcrumb\n    addBreadcrumb({\n      category: 'navigation',\n      data: {\n        from,\n        to,\n      },\n      message: `Route changed: ${from} -> ${to}`,\n      type: 'navigation',\n    });\n\n    // Update route tag\n    scope.setTag('route', to);\n\n    // Update route context\n    scope.setContext('route', {\n      current: to,\n      previous: from,\n      timestamp: Date.now(),\n    });\n  }\n}\n","import {\n  getClient,\n  getCurrentScope,\n  startInactiveSpan,\n  startSpan,\n  withActiveSpan,\n} from '@sentry/core';\nimport type { Client, Integration, IntegrationFn } from '@sentry/core';\n\nimport {\n  getPerformanceManager,\n  getSystemInfo,\n  sdk,\n  epochNow,\n  type PerformanceEntry,\n  type NavigationPerformanceEntry,\n  type RenderPerformanceEntry,\n  type ResourcePerformanceEntry,\n  type UserTimingPerformanceEntry,\n  type PerformanceManager,\n  type PerformanceObserver,\n} from '../crossPlatform';\n\nconst EPOCH_TIMESTAMP_THRESHOLD = 100_000_000_000;\nconst MAX_PLAUSIBLE_RELATIVE_RUNTIME = 30 * 24 * 60 * 60 * 1000;\nconst MAX_FUTURE_CLOCK_SKEW = 60 * 1000;\n\n/**\n * Performance API 集成配置\n */\nexport interface PerformanceIntegrationOptions {\n  /** 是否启用导航性能监控 */\n  enableNavigation?: boolean;\n  /** 是否启用渲染性能监控 */\n  enableRender?: boolean;\n  /** 是否启用资源加载性能监控 */\n  enableResource?: boolean;\n  /** 是否启用用户自定义性能监控 */\n  enableUserTiming?: boolean;\n  /** 性能数据采样率 (0-1) */\n  sampleRate?: number;\n  /** 性能条目缓冲区大小 */\n  bufferSize?: number;\n  /** 性能条目统计汇总间隔 (毫秒) */\n  reportInterval?: number;\n  /** 性能阈值配置 */\n  thresholds?: {\n    /** 导航耗时阈值（毫秒，默认 3000） */\n    navigation?: number;\n    /** 渲染耗时阈值（毫秒，默认 1000） */\n    render?: number;\n    /** 资源加载耗时阈值（毫秒，默认 2000） */\n    resource?: number;\n    /** setData 渲染耗时阈值（毫秒，默认 50，参考微信官方建议） */\n    setData?: number;\n  };\n  /** 是否启用内存信息采集 */\n  enableMemory?: boolean;\n}\n\n/** Performance API 集成 */\nexport class PerformanceIntegration implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'PerformanceAPI';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = PerformanceIntegration.id;\n\n  private _options: Required<PerformanceIntegrationOptions>;\n  private _performanceManager: PerformanceManager | null = null;\n  private _observers: PerformanceObserver[] = [];\n  private _entryBuffer: PerformanceEntry[] = [];\n  private _reportTimer: ReturnType<typeof setInterval> | null = null;\n  private _isSetup: boolean = false;\n  private _relativeTimeOrigin: number | null = null;\n  private _setupEpochMilliseconds: number | null = null;\n  private _client: Client | undefined;\n\n  constructor(options: PerformanceIntegrationOptions = {}) {\n    this._options = {\n      enableNavigation: true,\n      enableRender: true,\n      enableResource: true,\n      enableUserTiming: false,\n      sampleRate: 1.0,\n      bufferSize: 100,\n      reportInterval: 30000, // 30秒\n      enableMemory: false,\n      ...options,\n      thresholds: {\n        navigation: 3000,\n        render: 1000,\n        resource: 2000,\n        setData: 50,\n        ...options?.thresholds,\n      },\n    };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    this._setup();\n  }\n\n  public setup(client: Client): void {\n    this._client = client;\n    this._setup();\n    client.registerCleanup(() => this.cleanup());\n  }\n\n  private _setup(): void {\n    if (this._isSetup) return;\n    this._isSetup = true;\n    this._setupEpochMilliseconds = epochNow();\n    this._initializePerformanceManager();\n    if (!this._setupPerformanceObservers()) {\n      return;\n    }\n    this._startAutoReporting();\n    this._addPerformanceContext();\n  }\n\n  /**\n   * 初始化性能管理器\n   */\n  private _initializePerformanceManager(): void {\n    try {\n      this._performanceManager = getPerformanceManager();\n      if (!this._performanceManager) {\n        return;\n      }\n    } catch (error) {\n      console.warn('[sentry-miniapp] Failed to initialize performance manager:', error);\n    }\n  }\n\n  /**\n   * 设置性能观察者\n   */\n  private _setupPerformanceObservers(): boolean {\n    if (!this._performanceManager) {\n      return false;\n    }\n\n    try {\n      if (typeof this._performanceManager.createObserver !== 'function') {\n        return false;\n      }\n\n      const entryTypes: string[] = [];\n\n      if (this._options.enableNavigation) {\n        entryTypes.push('navigation');\n      }\n      if (this._options.enableRender) {\n        entryTypes.push('render');\n      }\n      if (this._options.enableResource) {\n        entryTypes.push('resource');\n      }\n\n      let canObserveUserTiming = this._options.enableUserTiming;\n\n      if (canObserveUserTiming) {\n        try {\n          const systemInfo = getSystemInfo();\n\n          if (systemInfo && systemInfo.platform === 'devtools') {\n            canObserveUserTiming = false;\n          }\n\n          if (canObserveUserTiming) {\n            const globalObj: any =\n              typeof globalThis !== 'undefined'\n                ? globalThis\n                : typeof window !== 'undefined'\n                  ? window\n                  : {};\n\n            const performanceObserverCtor: any = (globalObj as any).PerformanceObserver;\n            const supportedTypes: string[] | undefined =\n              performanceObserverCtor &&\n              Array.isArray((performanceObserverCtor as any).supportedEntryTypes)\n                ? (performanceObserverCtor as any).supportedEntryTypes\n                : undefined;\n\n            if (\n              !supportedTypes ||\n              !supportedTypes.includes('measure') ||\n              !supportedTypes.includes('mark')\n            ) {\n              canObserveUserTiming = false;\n            }\n          }\n        } catch {\n          canObserveUserTiming = false;\n        }\n      }\n\n      if (canObserveUserTiming) {\n        entryTypes.push('measure', 'mark');\n      }\n\n      if (entryTypes.length === 0) {\n        return false;\n      }\n\n      // 创建性能观察者\n      const observer = this._performanceManager.createObserver((entries) => {\n        this._handlePerformanceEntries(entries);\n      });\n\n      try {\n        observer.observe({ entryTypes });\n      } catch (e) {\n        // 如果失败（例如微信小程序不支持 measure/mark），尝试移除这些类型后重试\n        const safeTypes = entryTypes.filter((t) => t !== 'measure' && t !== 'mark');\n\n        if (safeTypes.length < entryTypes.length && safeTypes.length > 0) {\n          // 降级重试\n          observer.observe({ entryTypes: safeTypes });\n          console.warn('[sentry-miniapp] Failed to observe all types, falling back to:', safeTypes);\n\n          // 更新 entryTypes 以便日志记录正确\n          entryTypes.length = 0;\n          entryTypes.push(...safeTypes);\n        } else {\n          throw e; // 如果没有可降级的类型或仍然失败，则抛出\n        }\n      }\n\n      this._observers.push(observer);\n\n      const globalProcess =\n        typeof globalThis !== 'undefined' ? (globalThis as any).process : undefined;\n      if (globalProcess && globalProcess.env && globalProcess.env.NODE_ENV !== 'production') {\n        console.log('[sentry-miniapp] Performance observers setup for:', entryTypes);\n      }\n      return true;\n    } catch (error) {\n      console.warn('[sentry-miniapp] Failed to setup performance observers:', error);\n      return false;\n    }\n  }\n\n  /**\n   * 处理性能条目\n   */\n  private _handlePerformanceEntries(entries: PerformanceEntry[] | any): void {\n    if (!this._isActiveClient() || !entries) {\n      return;\n    }\n\n    // 确保 entries 是数组格式\n    let entriesArray: PerformanceEntry[];\n    if (Array.isArray(entries)) {\n      entriesArray = entries;\n    } else if (typeof entries === 'object' && entries.getEntries) {\n      // 微信小程序可能传入 PerformanceObserverEntryList 对象\n      entriesArray = entries.getEntries();\n    } else if (typeof entries === 'object') {\n      // 如果是单个对象，转换为数组\n      entriesArray = [entries];\n    } else {\n      console.warn('[sentry-miniapp] Invalid entries format:', typeof entries);\n      return;\n    }\n\n    if (entriesArray.length === 0) {\n      return;\n    }\n\n    const currentEpoch = epochNow();\n    entriesArray = entriesArray.filter((entry) =>\n      this._isPlausiblePerformanceEntry(entry, currentEpoch),\n    );\n    if (entriesArray.length === 0) return;\n\n    // 采样控制\n    if (Math.random() > this._options.sampleRate) {\n      return;\n    }\n\n    this._initializeRelativeTimeOrigin(entriesArray);\n    const rootStart = Math.min(...entriesArray.map((entry) => this._entryTimes(entry).start));\n    const rootEnd = Math.max(...entriesArray.map((entry) => this._entryTimes(entry).end));\n    const navigation = entriesArray.find((entry) => entry.entryType === 'navigation');\n    const rootSpan = startInactiveSpan({\n      name: navigation ? `Navigation: ${navigation.name}` : 'Miniapp Performance',\n      op: navigation ? 'navigation' : 'miniapp.performance',\n      forceTransaction: true,\n      startTime: rootStart,\n    });\n    rootSpan.setAttributes({\n      'performance.entry_count': entriesArray.length,\n      'performance.entry_types': Array.from(\n        new Set(entriesArray.map((entry) => entry.entryType)),\n      ).join(','),\n    });\n\n    withActiveSpan(rootSpan, () => {\n      entriesArray.forEach((entry) => {\n        try {\n          this._processPerformanceEntry(entry);\n          this._addToBuffer(entry);\n        } catch (error) {\n          console.warn('[sentry-miniapp] Failed to process performance entry:', error);\n        }\n      });\n    });\n    rootSpan.end(rootEnd);\n  }\n\n  /**\n   * 小程序 PerformanceEntry.startTime 通常是相对运行时起点的毫秒数，不是 Unix epoch。\n   * 第一批条目用“最晚结束点 ≈ 当前时间”建立稳定锚点；已是 epoch 毫秒的宿主值则原样使用。\n   * 锚点不得晚于 SDK setup 时刻，否则延迟送达的陈旧首批数据会被错误平移到当前甚至未来。\n   */\n  private _initializeRelativeTimeOrigin(entries: PerformanceEntry[]): void {\n    if (this._relativeTimeOrigin !== null) return;\n    const currentEpoch = epochNow();\n    const relativeEnds = entries\n      .filter(\n        (entry) => Number.isFinite(entry.startTime) && entry.startTime < EPOCH_TIMESTAMP_THRESHOLD,\n      )\n      .map(\n        (entry) =>\n          Math.max(0, entry.startTime) +\n          (Number.isFinite(entry.duration) ? Math.max(0, entry.duration) : 0),\n      )\n      .filter((relativeEnd) => relativeEnd <= MAX_PLAUSIBLE_RELATIVE_RUNTIME);\n    if (relativeEnds.length === 0) return;\n\n    const candidate = currentEpoch - Math.max(0, ...relativeEnds);\n    const latestPlausibleOrigin = this._setupEpochMilliseconds ?? currentEpoch;\n    const earliestPlausibleOrigin = currentEpoch - MAX_PLAUSIBLE_RELATIVE_RUNTIME;\n    this._relativeTimeOrigin = Math.min(\n      latestPlausibleOrigin,\n      Math.max(earliestPlausibleOrigin, candidate),\n    );\n  }\n\n  private _isPlausiblePerformanceEntry(entry: PerformanceEntry, currentEpoch: number): boolean {\n    if (!Number.isFinite(entry.startTime)) return false;\n    const start = Math.max(0, entry.startTime);\n    const duration = Number.isFinite(entry.duration) ? Math.max(0, entry.duration) : 0;\n    const end = start + duration;\n\n    if (start < EPOCH_TIMESTAMP_THRESHOLD) {\n      return end <= MAX_PLAUSIBLE_RELATIVE_RUNTIME;\n    }\n\n    return (\n      start >= currentEpoch - MAX_PLAUSIBLE_RELATIVE_RUNTIME &&\n      end <= currentEpoch + MAX_FUTURE_CLOCK_SKEW\n    );\n  }\n\n  private _entryTimes(entry: PerformanceEntry): { start: number; end: number } {\n    const validStart = Number.isFinite(entry.startTime) ? entry.startTime : 0;\n    const startMilliseconds =\n      validStart >= EPOCH_TIMESTAMP_THRESHOLD\n        ? validStart\n        : (this._relativeTimeOrigin ?? epochNow()) + Math.max(0, validStart);\n    const endMilliseconds =\n      startMilliseconds + (Number.isFinite(entry.duration) ? Math.max(0, entry.duration) : 0);\n    return { start: startMilliseconds / 1000, end: endMilliseconds / 1000 };\n  }\n\n  /**\n   * 处理单个性能条目\n   */\n  private _processPerformanceEntry(entry: PerformanceEntry): void {\n    switch (entry.entryType) {\n      case 'navigation':\n        this._processNavigationEntry(entry as NavigationPerformanceEntry);\n        break;\n      case 'render':\n        this._processRenderEntry(entry as RenderPerformanceEntry);\n        break;\n      case 'resource':\n        this._processResourceEntry(entry as ResourcePerformanceEntry);\n        break;\n      case 'measure':\n      case 'mark':\n        this._processUserTimingEntry(entry as UserTimingPerformanceEntry);\n        break;\n      default:\n        console.log('[sentry-miniapp] Unknown entry type:', entry.entryType);\n    }\n  }\n\n  /**\n   * 处理导航性能条目\n   */\n  private _processNavigationEntry(entry: NavigationPerformanceEntry): void {\n    const times = this._entryTimes(entry);\n    // 添加面包屑\n    const scope = getCurrentScope();\n    scope.addBreadcrumb({\n      message: `页面导航: ${entry.name}`,\n      category: 'performance.navigation',\n      level: 'info',\n      data: {\n        duration: entry.duration,\n        appLaunchTime: entry.appLaunchTime,\n        pageReadyTime: entry.pageReadyTime,\n      },\n    });\n\n    startSpan(\n      {\n        name: `Navigation: ${entry.name}`,\n        op: 'navigation',\n        startTime: times.start,\n      },\n      (span) => {\n        span.setAttributes({\n          'navigation.name': entry.name,\n          'navigation.duration': entry.duration,\n          'navigation.app_launch_time': entry.appLaunchTime || 0,\n          'navigation.page_ready_time': entry.pageReadyTime || 0,\n          'navigation.first_render_time': entry.firstRenderTime || 0,\n        });\n\n        span.end(times.end);\n      },\n    );\n  }\n\n  /**\n   * 处理渲染性能条目\n   */\n  private _processRenderEntry(entry: RenderPerformanceEntry): void {\n    const times = this._entryTimes(entry);\n    startSpan(\n      {\n        name: `Render: ${entry.name}`,\n        op: 'render',\n        startTime: times.start,\n      },\n      (span) => {\n        span.setAttributes({\n          'render.name': entry.name,\n          'render.duration': entry.duration,\n          'render.start': entry.renderStart || 0,\n          'render.end': entry.renderEnd || 0,\n          'render.script_start': entry.scriptStart || 0,\n          'render.script_end': entry.scriptEnd || 0,\n        });\n\n        span.end(times.end);\n      },\n    );\n\n    // 检测慢渲染（可能由 setData 引起）\n    const setDataThreshold = this._options.thresholds?.setData ?? 50;\n    if (entry.duration > setDataThreshold) {\n      const scope = getCurrentScope();\n      scope.addBreadcrumb({\n        message: `慢渲染检测: ${entry.name} (${entry.duration.toFixed(1)}ms)`,\n        category: 'performance.setData.slow',\n        level: 'warning',\n        data: {\n          name: entry.name,\n          duration: entry.duration,\n          threshold: setDataThreshold,\n          renderStart: entry.renderStart,\n          renderEnd: entry.renderEnd,\n          scriptStart: entry.scriptStart,\n          scriptEnd: entry.scriptEnd,\n        },\n      });\n    }\n  }\n\n  /**\n   * 处理资源加载性能条目\n   */\n  private _processResourceEntry(entry: ResourcePerformanceEntry): void {\n    const times = this._entryTimes(entry);\n    startSpan(\n      {\n        name: `Resource: ${entry.name}`,\n        op: 'resource',\n        startTime: times.start,\n      },\n      (span) => {\n        span.setAttributes({\n          'resource.name': entry.name,\n          'resource.duration': entry.duration,\n          'resource.type': entry.initiatorType || 'unknown',\n          'resource.transfer_size': entry.transferSize || 0,\n          'resource.encoded_size': entry.encodedBodySize || 0,\n          'resource.decoded_size': entry.decodedBodySize || 0,\n        });\n\n        // 网络时序信息\n        if (entry.fetchStart && entry.responseEnd) {\n          span.setAttributes({\n            'resource.fetch_start': entry.fetchStart,\n            'resource.response_end': entry.responseEnd,\n            'resource.network_time': entry.responseEnd - entry.fetchStart,\n          });\n        }\n\n        span.end(times.end);\n      },\n    );\n  }\n\n  /**\n   * 处理用户自定义性能条目\n   */\n  private _processUserTimingEntry(entry: UserTimingPerformanceEntry): void {\n    const times = this._entryTimes(entry);\n    if (entry.entryType === 'measure') {\n      startSpan(\n        {\n          name: `Measure: ${entry.name}`,\n          op: 'measure',\n          startTime: times.start,\n        },\n        (span) => {\n          span.setAttributes({\n            'measure.name': entry.name,\n            'measure.duration': entry.duration,\n            'measure.detail': entry.detail ? JSON.stringify(entry.detail) : undefined,\n          });\n\n          span.end(times.end);\n        },\n      );\n    } else if (entry.entryType === 'mark') {\n      // 标记事件作为面包屑记录\n      const scope = getCurrentScope();\n      scope.addBreadcrumb({\n        message: `性能标记: ${entry.name}`,\n        category: 'performance.mark',\n        level: 'info',\n        data: {\n          timestamp: times.start * 1000,\n          detail: entry.detail,\n        },\n      });\n    }\n  }\n\n  /**\n   * 添加到缓冲区\n   */\n  private _addToBuffer(entry: PerformanceEntry): void {\n    this._entryBuffer.push(entry);\n\n    // 缓冲区溢出处理：移除最早的条目\n    while (this._entryBuffer.length > this._options.bufferSize) {\n      this._entryBuffer.shift();\n    }\n  }\n\n  /** 开始定时汇总性能条目 */\n  private _startAutoReporting(): void {\n    if (!this._performanceManager || this._options.reportInterval <= 0) {\n      return;\n    }\n\n    this._reportTimer = setInterval(() => {\n      this._reportBufferedEntries();\n    }, this._options.reportInterval);\n  }\n\n  /** 汇总缓冲的性能条目，并写入当前 Sentry scope */\n  private _reportBufferedEntries(): void {\n    if (!this._isActiveClient() || this._entryBuffer.length === 0) {\n      return;\n    }\n\n    try {\n      const scope = getCurrentScope();\n\n      // 计算性能统计\n      const stats = this._calculatePerformanceStats();\n\n      // 采集内存信息\n      const memoryInfo = this._collectMemoryInfo();\n      if (memoryInfo) {\n        stats['memory'] = memoryInfo;\n      }\n\n      scope.setContext('performance_summary', {\n        total_entries: this._entryBuffer.length,\n        navigation_count: this._entryBuffer.filter((e) => e.entryType === 'navigation').length,\n        render_count: this._entryBuffer.filter((e) => e.entryType === 'render').length,\n        resource_count: this._entryBuffer.filter((e) => e.entryType === 'resource').length,\n        measure_count: this._entryBuffer.filter((e) => e.entryType === 'measure').length,\n        mark_count: this._entryBuffer.filter((e) => e.entryType === 'mark').length,\n        report_time: new Date().toISOString(),\n        ...stats,\n      });\n\n      // 检查性能阈值并发送警告\n      this._checkPerformanceThresholds(stats);\n\n      // 清空缓冲区\n      this._entryBuffer = [];\n    } catch (error) {\n      console.warn('[sentry-miniapp] Failed to summarize buffered performance entries:', error);\n    }\n  }\n\n  /**\n   * 计算性能统计数据\n   */\n  private _calculatePerformanceStats(): Record<string, any> {\n    const navigationEntries = this._entryBuffer.filter((e) => e.entryType === 'navigation');\n    const renderEntries = this._entryBuffer.filter((e) => e.entryType === 'render');\n    const resourceEntries = this._entryBuffer.filter((e) => e.entryType === 'resource');\n\n    const stats: Record<string, any> = {};\n\n    // 导航性能统计\n    if (navigationEntries.length > 0) {\n      const durations = navigationEntries.map((e) => e.duration);\n      stats['navigation_stats'] = {\n        avg_duration: durations.reduce((a, b) => a + b, 0) / durations.length,\n        max_duration: Math.max(...durations),\n        min_duration: Math.min(...durations),\n      };\n    }\n\n    // 渲染性能统计\n    if (renderEntries.length > 0) {\n      const durations = renderEntries.map((e) => e.duration);\n      stats['render_stats'] = {\n        avg_duration: durations.reduce((a, b) => a + b, 0) / durations.length,\n        max_duration: Math.max(...durations),\n        min_duration: Math.min(...durations),\n      };\n\n      const slowRenders = renderEntries.filter(\n        (e) => e.duration > (this._options.thresholds?.setData ?? 50),\n      );\n      stats['render_stats'].slow_render_count = slowRenders.length;\n      stats['render_stats'].slow_render_ratio = slowRenders.length / renderEntries.length;\n    }\n\n    // 资源加载统计\n    if (resourceEntries.length > 0) {\n      const durations = resourceEntries.map((e) => e.duration);\n      const sizes = resourceEntries\n        .map((e) => (e as ResourcePerformanceEntry).transferSize || 0)\n        .filter((size) => size > 0);\n\n      stats['resource_stats'] = {\n        avg_load_time: durations.reduce((a, b) => a + b, 0) / durations.length,\n        max_load_time: Math.max(...durations),\n        total_transfer_size: sizes.reduce((a, b) => a + b, 0),\n        avg_transfer_size: sizes.length > 0 ? sizes.reduce((a, b) => a + b, 0) / sizes.length : 0,\n      };\n    }\n\n    return stats;\n  }\n\n  /**\n   * 检查性能阈值\n   */\n  private _checkPerformanceThresholds(stats: Record<string, any>): void {\n    const scope = getCurrentScope();\n\n    // 检查导航性能\n    const navigationThreshold = this._options.thresholds?.navigation ?? 3000;\n    if (stats['navigation_stats']?.avg_duration > navigationThreshold) {\n      scope.addBreadcrumb({\n        message: '页面导航性能较慢',\n        category: 'performance.warning',\n        level: 'warning',\n        data: {\n          avg_duration: stats['navigation_stats'].avg_duration,\n          threshold: navigationThreshold,\n        },\n      });\n    }\n\n    // 检查渲染性能\n    const renderThreshold = this._options.thresholds?.render ?? 1000;\n    if (stats['render_stats']?.avg_duration > renderThreshold) {\n      scope.addBreadcrumb({\n        message: '页面渲染性能较慢',\n        category: 'performance.warning',\n        level: 'warning',\n        data: {\n          avg_duration: stats['render_stats'].avg_duration,\n          threshold: renderThreshold,\n        },\n      });\n    }\n\n    // 检查资源加载\n    const resourceThreshold = this._options.thresholds?.resource ?? 2000;\n    if (stats['resource_stats']?.avg_load_time > resourceThreshold) {\n      scope.addBreadcrumb({\n        message: '资源加载性能较慢',\n        category: 'performance.warning',\n        level: 'warning',\n        data: {\n          avg_load_time: stats['resource_stats'].avg_load_time,\n          threshold: resourceThreshold,\n        },\n      });\n    }\n  }\n\n  /**\n   * 采集内存信息\n   */\n  private _collectMemoryInfo(): Record<string, any> | null {\n    if (!this._options.enableMemory) return null;\n\n    try {\n      const currentSdk = sdk();\n      if (currentSdk.getPerformance) {\n        const perf = currentSdk.getPerformance();\n        // 微信小程序 performance 对象可能包含 memory 信息\n        if (perf && (perf as any).memory) {\n          return {\n            jsHeapSizeUsed: (perf as any).memory.jsHeapSizeUsed,\n            jsHeapSizeLimit: (perf as any).memory.jsHeapSizeLimit,\n          };\n        }\n      }\n    } catch (_e) {\n      // Silently ignore\n    }\n    return null;\n  }\n\n  /**\n   * 添加性能上下文信息\n   */\n  private _addPerformanceContext(): void {\n    try {\n      const scope = getCurrentScope();\n      const currentSdk = sdk();\n\n      // 检查 Performance API 支持情况\n      const hasPerformanceAPI = !!currentSdk.getPerformance;\n\n      scope.setTag('performance.api.available', true);\n      scope.setContext('performance', {\n        api_version: 'miniapp-1.0',\n        sample_rate: this._options.sampleRate,\n        buffer_size: this._options.bufferSize,\n      });\n\n      scope.setContext('performance_support', {\n        has_performance_api: hasPerformanceAPI,\n        integration_enabled: true,\n        options: this._options,\n      });\n\n      scope.setTag('performance.integration', 'enabled');\n    } catch (error) {\n      console.warn('[sentry-miniapp] Failed to add performance context:', error);\n    }\n  }\n\n  /**\n   * 清理资源\n   */\n  public cleanup(): void {\n    // 断开所有观察者\n    this._observers.forEach((observer) => {\n      try {\n        observer.disconnect();\n      } catch (error) {\n        console.warn('[sentry-miniapp] Failed to disconnect observer:', error);\n      }\n    });\n    this._observers = [];\n\n    // 清除定时器\n    if (this._reportTimer) {\n      clearInterval(this._reportTimer);\n      this._reportTimer = null;\n    }\n\n    // 旧 client 乱序关闭时不能把它的历史缓冲写入当前 client 的 scope。\n    if (this._isActiveClient()) {\n      this._reportBufferedEntries();\n    } else {\n      this._entryBuffer = [];\n    }\n    this._performanceManager = null;\n    this._relativeTimeOrigin = null;\n    this._setupEpochMilliseconds = null;\n    this._isSetup = false;\n    this._client = undefined;\n  }\n\n  private _isActiveClient(): boolean {\n    return !this._client || getClient() === this._client;\n  }\n}\n\n/**\n * Performance API 集成工厂函数\n */\nexport const performanceIntegration = ((\n  options?: PerformanceIntegrationOptions,\n): PerformanceIntegration => new PerformanceIntegration(options)) satisfies IntegrationFn;\n","import { rewriteFramesIntegration as coreRewriteFramesIntegration } from '@sentry/core';\nimport type { Event, Integration, Exception, StackFrame } from '@sentry/core';\n\nconst DEFAULT_PREFIX = 'app:///';\n\n/** 将各小程序宿主的虚拟路径归一化为 sentry-cli 可匹配的 app:/// 路径。 */\nexport function normalizeMiniappFrameFilename(\n  filename: string,\n  prefix: string = DEFAULT_PREFIX,\n): string {\n  if (filename.startsWith(prefix)) return filename;\n\n  const normalized = filename\n    .replace(/^(appservice|app-service|WAService)\\//i, '')\n    .replace(/^https?:\\/\\/[^/]+\\//i, '')\n    .replace(/^chunks:\\/\\/\\/?/i, 'chunks/')\n    .replace(/^[a-z]+:\\/\\//i, '')\n    .replace(/^\\//, '');\n\n  return `${prefix}${normalized}`;\n}\n\n/** 官方 RewriteFrames 处理器 + 小程序路径归一化规则。 */\nexport const rewriteFramesIntegration = (options: { prefix?: string } = {}): Integration => {\n  const prefix = options.prefix || DEFAULT_PREFIX;\n  return coreRewriteFramesIntegration({\n    iteratee: (frame) =>\n      frame.filename\n        ? { ...frame, filename: normalizeMiniappFrameFilename(frame.filename, prefix) }\n        : frame,\n  });\n};\n\n/**\n * Normalize miniapp stack trace paths to a standard format for source map resolution.\n * E.g., 'appservice/pages/index.js' -> 'app:///pages/index.js'\n */\nexport class RewriteFrames implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'RewriteFrames';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = RewriteFrames.id;\n\n  /**\n   * Optional prefix to append to the normalized path. Defaults to 'app:///'\n   */\n  private readonly _prefix: string;\n\n  public constructor(options: { prefix?: string } = {}) {\n    this._prefix = options.prefix || DEFAULT_PREFIX;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    // In Sentry v10, we usually use addGlobalEventProcessor or similar to add an event processor\n    // For integrations, we can just return the processor in processEvent or register it globally.\n    // However, the cleanest way in v10 is to use `processEvent`.\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public processEvent(event: Event): Event {\n    if (event.exception && event.exception.values) {\n      event.exception.values.forEach((exception: Exception) => {\n        if (exception.stacktrace && exception.stacktrace.frames) {\n          exception.stacktrace.frames.forEach((frame: StackFrame) => {\n            if (frame.filename) {\n              frame.filename = this._normalizeFilename(frame.filename);\n            }\n          });\n        }\n      });\n    }\n    return event;\n  }\n\n  /**\n   * Normalizes a filename from various miniapp platforms\n   */\n  private _normalizeFilename(filename: string): string {\n    return normalizeMiniappFrameFilename(filename, this._prefix);\n  }\n}\n","import {\n  addBreadcrumb,\n  DEFAULT_ENVIRONMENT,\n  getActiveSpan,\n  getClient,\n  hasSpansEnabled,\n  isSentryRequestUrl,\n  SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME,\n  SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,\n  SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n  SEMANTIC_ATTRIBUTE_SENTRY_RELEASE,\n  SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,\n  SPAN_STATUS_OK,\n  SPAN_STATUS_ERROR,\n  getTraceData,\n  setHttpStatus,\n  startInactiveSpan,\n} from '@sentry/core';\nimport type { Client, Integration, Span } from '@sentry/core';\nimport { sdk } from '../crossPlatform';\nimport {\n  addFunctionInstrumentationHandler,\n  ensureFunctionInstrumentation,\n} from '../instrumentation';\nimport { isMarkedSentryRequest } from '../transports/requestMarker';\n\n/**\n * Network Breadcrumbs Integration.\n * Monkey patches miniapp network API (e.g. wx.request, my.httpRequest)\n * to record network breadcrumbs, including request and response body if configured.\n * Supports distributed tracing via sentry-trace/baggage and optional traceparent header injection.\n */\nexport class NetworkBreadcrumbs implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'NetworkBreadcrumbs';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = NetworkBreadcrumbs.id;\n\n  private readonly _traceNetworkBody: boolean;\n  private readonly _sensitiveKeys: string[];\n  private readonly _denyUrls: RegExp[];\n  private readonly _enableTracePropagation: boolean;\n  private readonly _tracePropagationTargets: Array<string | RegExp>;\n  private readonly _propagateTraceparent: boolean;\n  private readonly _enableStandaloneHttpSpans: boolean;\n  private readonly _cleanupCallbacks = new Set<() => void>();\n  private readonly _requestWrappers = new WeakMap<Function, Function>();\n\n  public constructor(\n    options: {\n      traceNetworkBody?: boolean | undefined;\n      /** 需要脱敏的字段名列表（不区分大小写匹配） */\n      sensitiveKeys?: string[];\n      /** 不记录请求体的 URL 模式 */\n      denyBodyUrls?: Array<string | RegExp>;\n      /** 是否启用分布式追踪头注入（默认 true） */\n      enableTracePropagation?: boolean;\n      /** 追踪目标 URL 白名单，匹配的请求才注入追踪头 */\n      tracePropagationTargets?: Array<string | RegExp>;\n      /** 是否额外注入 W3C traceparent 头（默认 false） */\n      propagateTraceparent?: boolean;\n      /** 无 active span 时是否把请求作为独立 segment span 上报（默认 true） */\n      enableStandaloneHttpSpans?: boolean;\n    } = {},\n  ) {\n    this._traceNetworkBody = !!options.traceNetworkBody;\n    this._sensitiveKeys = (\n      options.sensitiveKeys || [\n        'password',\n        'passwd',\n        'secret',\n        'token',\n        'access_token',\n        'refresh_token',\n        'authorization',\n        'cookie',\n        'session',\n        'creditcard',\n        'credit_card',\n        'card_number',\n        'cvv',\n        'ssn',\n        'id_card',\n      ]\n    ).map((k) => k.toLowerCase());\n    this._denyUrls = (options.denyBodyUrls || []).map((pattern) =>\n      typeof pattern === 'string' ? new RegExp(pattern) : pattern,\n    );\n    this._enableTracePropagation = options.enableTracePropagation !== false;\n    this._tracePropagationTargets = options.tracePropagationTargets || [];\n    this._propagateTraceparent = options.propagateTraceparent === true;\n    this._enableStandaloneHttpSpans = options.enableStandaloneHttpSpans !== false;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    const miniappSdk = sdk();\n    this._ensureInstrumentation(miniappSdk, 'request');\n    this._ensureInstrumentation(miniappSdk, 'httpRequest');\n  }\n\n  public setup(client: Client): void {\n    const miniappSdk = sdk();\n    const cleanups: Array<() => void> = [];\n    for (const name of ['request', 'httpRequest'] as const) {\n      if (typeof miniappSdk[name] !== 'function') continue;\n      cleanups.push(\n        addFunctionInstrumentationHandler(miniappSdk, name, client, (original, thisArg, args) =>\n          this._invokeRequestWrapper(original, thisArg, args),\n        ),\n      );\n    }\n    const cleanup = this._trackCleanup(cleanups);\n    client.registerCleanup(cleanup);\n  }\n\n  /**\n   * 清理集成，恢复原始网络请求方法\n   */\n  public cleanup(): void {\n    for (const cleanup of [...this._cleanupCallbacks]) cleanup();\n  }\n\n  private _ensureInstrumentation(\n    miniappSdk: Partial<Record<'request' | 'httpRequest', unknown>>,\n    name: 'request' | 'httpRequest',\n  ): void {\n    if (typeof miniappSdk[name] !== 'function') return;\n    if (!ensureFunctionInstrumentation(miniappSdk, name)) {\n      console.warn(`[sentry-miniapp] 无法包装当前平台的 ${name} API，网络面包屑和请求追踪将不可用`);\n    }\n  }\n\n  private _trackCleanup(cleanups: Array<() => void>): () => void {\n    let active = true;\n    const cleanup = (): void => {\n      if (!active) return;\n      active = false;\n      for (const callback of cleanups.reverse()) callback();\n      this._cleanupCallbacks.delete(cleanup);\n    };\n    this._cleanupCallbacks.add(cleanup);\n    return cleanup;\n  }\n\n  private _invokeRequestWrapper(original: Function, thisArg: unknown, args: unknown[]): unknown {\n    let wrapper = this._requestWrappers.get(original);\n    if (!wrapper) {\n      wrapper = this._createRequestWrapper(original);\n      this._requestWrappers.set(original, wrapper);\n    }\n    return wrapper.apply(thisArg, args);\n  }\n\n  /**\n   * Wraps the miniapp request API to capture breadcrumbs\n   */\n  private _createRequestWrapper(originalRequest: Function): Function {\n    const traceNetworkBody = this._traceNetworkBody;\n    const sanitizeBody = this._sanitizeBody.bind(this);\n    const shouldDenyBodyUrl = this._shouldDenyBodyUrl.bind(this);\n    const enableTracePropagation = this._enableTracePropagation;\n    const shouldPropagateTrace = this._shouldPropagateTrace.bind(this);\n    const propagateTraceparent = this._propagateTraceparent;\n    const enableStandaloneHttpSpans = this._enableStandaloneHttpSpans;\n\n    return function (this: any, options: any): any {\n      if (!options || typeof options !== 'object') {\n        return originalRequest.call(this, options);\n      }\n\n      // 内置 transport 会标记 options 及 header 身份，常见浅拷贝 wrapper 也无需依赖全局 URL。\n      if (isMarkedSentryRequest(options)) {\n        return originalRequest.call(this, options);\n      }\n\n      const url = normalizeUrl(options.url);\n\n      const client = getClient();\n      // 使用 core 的 DSN/tunnel 规则识别 SDK 自身 envelope，避免将同域业务请求误排除。\n      if (isSentryRequestUrl(url, client) || isSentryDsnRequestWithoutURL(url, client)) {\n        return originalRequest.call(this, options);\n      }\n\n      // 浅拷贝 options，后续回调包装与 header 注入不污染调用方对象。\n      const requestOptions = { ...options };\n\n      // 注入分布式追踪头\n      const method = normalizeMethod(options.method);\n      const requestData = options.data;\n      const startTime = Date.now();\n      const requestSpan = startRequestSpan(method, url, enableStandaloneHttpSpans, client);\n      let requestSpanFinished = false;\n      const finishSpanOnce = (finish: RequestSpanFinishOptions): void => {\n        if (requestSpanFinished) return;\n        requestSpanFinished = true;\n        finishRequestSpan(requestSpan, finish);\n      };\n\n      if (enableTracePropagation && shouldPropagateTrace(url)) {\n        injectTraceHeaders(requestOptions, requestSpan, propagateTraceparent);\n      }\n\n      const breadcrumbData: Record<string, any> = {\n        url,\n        method,\n      };\n\n      if (traceNetworkBody && requestData && !shouldDenyBodyUrl(url)) {\n        try {\n          const body = typeof requestData === 'string' ? requestData : JSON.stringify(requestData);\n          breadcrumbData['request_body'] = sanitizeBody(body);\n          breadcrumbData['request_size'] = body.length;\n        } catch (_e) {\n          breadcrumbData['request_body'] = '[Cannot serialize request body]';\n        }\n      }\n\n      const originalSuccess = options.success;\n      const originalFail = options.fail;\n      const originalComplete = options.complete;\n\n      // Wrap success callback\n      requestOptions.success = function (this: any, ...args: any[]) {\n        const res = args[0] || {};\n        const statusCode = getResponseStatusCode(res);\n        const duration = Date.now() - startTime;\n        breadcrumbData['status_code'] = statusCode;\n        breadcrumbData['duration'] = duration;\n        finishSpanOnce({\n          statusCode,\n          status: isErrorStatusCode(statusCode) ? 'error' : 'ok',\n          durationMs: duration,\n        });\n\n        if (traceNetworkBody && res.data && !shouldDenyBodyUrl(url)) {\n          try {\n            const body = typeof res.data === 'string' ? res.data : JSON.stringify(res.data);\n            breadcrumbData['response_body'] = sanitizeBody(body);\n            breadcrumbData['response_size'] = body.length;\n          } catch (_e) {\n            breadcrumbData['response_body'] = '[Cannot serialize response body]';\n          }\n        }\n\n        // 慢请求标记为 warning\n        const level = isErrorStatusCode(statusCode)\n          ? 'warning'\n          : duration > 3000\n            ? 'warning'\n            : 'info';\n\n        addBreadcrumb({\n          type: 'http',\n          category: 'xhr',\n          data: breadcrumbData,\n          level,\n        });\n\n        if (typeof originalSuccess === 'function') {\n          return originalSuccess.apply(this, args);\n        }\n      };\n\n      // Wrap fail callback\n      requestOptions.fail = function (this: any, ...args: any[]) {\n        const err = args[0] || {};\n        const duration = Date.now() - startTime;\n        const errorMessage = err.errMsg || err.errorMessage || 'Network request failed';\n        breadcrumbData['error'] = errorMessage;\n        breadcrumbData['duration'] = duration;\n        finishSpanOnce({\n          status: 'error',\n          errorMessage,\n          durationMs: duration,\n        });\n\n        addBreadcrumb({\n          type: 'http',\n          category: 'xhr',\n          data: breadcrumbData,\n          level: 'error',\n        });\n\n        if (typeof originalFail === 'function') {\n          return originalFail.apply(this, args);\n        }\n      };\n\n      requestOptions.complete = function (this: any, ...args: any[]) {\n        const res = args[0] || {};\n        const statusCode = getResponseStatusCode(res);\n        finishSpanOnce({\n          statusCode,\n          status: isErrorStatusCode(statusCode) ? 'error' : 'ok',\n          durationMs: Date.now() - startTime,\n        });\n\n        if (typeof originalComplete === 'function') {\n          return originalComplete.apply(this, args);\n        }\n      };\n\n      try {\n        return originalRequest.call(this, requestOptions);\n      } catch (error) {\n        finishSpanOnce({\n          status: 'error',\n          errorMessage: error instanceof Error ? error.message : String(error),\n          durationMs: Date.now() - startTime,\n        });\n        throw error;\n      }\n    };\n  }\n\n  /**\n   * 判断是否应该对该 URL 注入追踪头\n   */\n  private _shouldPropagateTrace(url: string): boolean {\n    if (this._tracePropagationTargets.length === 0) {\n      // 小程序没有可靠的“same-origin”概念。未配置白名单时不向任意域名泄露追踪头。\n      return false;\n    }\n    return this._tracePropagationTargets.some((target) => {\n      if (typeof target === 'string') {\n        return url.includes(target);\n      }\n      target.lastIndex = 0;\n      const matches = target.test(url);\n      target.lastIndex = 0;\n      return matches;\n    });\n  }\n\n  /**\n   * 检查 URL 是否在拒绝记录请求体的列表中\n   */\n  private _shouldDenyBodyUrl(url: string): boolean {\n    return this._denyUrls.some((pattern) => pattern.test(url));\n  }\n\n  /**\n   * 对请求/响应体进行敏感字段脱敏\n   */\n  private _sanitizeBody(body: string): string {\n    if (this._sensitiveKeys.length === 0) return body;\n\n    try {\n      const parsed = JSON.parse(body);\n      if (typeof parsed === 'object' && parsed !== null) {\n        this._sanitizeObject(parsed);\n        return JSON.stringify(parsed);\n      }\n    } catch (_e) {\n      // 非 JSON 格式，尝试正则替换常见的 key=value 模式\n      for (const key of this._sensitiveKeys) {\n        const regex = new RegExp(`(${key})=[^&]*`, 'gi');\n        body = body.replace(regex, '$1=[Filtered]');\n      }\n    }\n    return body;\n  }\n\n  /**\n   * 递归脱敏对象中的敏感字段\n   */\n  private _sanitizeObject(obj: Record<string, any>): void {\n    for (const key of Object.keys(obj)) {\n      if (this._sensitiveKeys.includes(key.toLowerCase())) {\n        obj[key] = '[Filtered]';\n      } else if (typeof obj[key] === 'object' && obj[key] !== null) {\n        this._sanitizeObject(obj[key]);\n      }\n    }\n  }\n}\n\ntype RequestSpanFinishOptions = {\n  status: 'ok' | 'error';\n  statusCode?: unknown;\n  errorMessage?: string;\n  durationMs: number;\n};\n\ntype RequestSpan = {\n  span: Span;\n  standalone: boolean;\n};\n\nfunction startRequestSpan(\n  method: string,\n  url: string,\n  enableStandaloneHttpSpans: boolean,\n  client: Client | undefined,\n): RequestSpan | null {\n  try {\n    if (!hasSpansEnabled()) return null;\n    const parentSpan = getActiveSpan();\n    if (!parentSpan && !enableStandaloneHttpSpans) return null;\n\n    const serverAddress = extractHost(url);\n    const spanName = `${method} ${sanitizeSpanNameUrl(url)}`;\n    const standalone = !parentSpan;\n    const standaloneClientOptions = standalone ? client?.getOptions() : undefined;\n    const span = startInactiveSpan({\n      name: spanName,\n      op: 'http.client',\n      kind: 2,\n      parentSpan: parentSpan ?? null,\n      // 静态 trace 生命周期下，无父普通 span 会被转换成 transaction。standalone segment\n      // 直接发送 span envelope，既保留长生命周期小游戏的请求，又不制造高基数根 transaction。\n      ...(!parentSpan && { experimental: { standalone: true } }),\n      attributes: {\n        [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.miniapp',\n        ...(standalone && {\n          [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: spanName,\n          [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: standaloneClientOptions?.release,\n          [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]:\n            standaloneClientOptions?.environment || DEFAULT_ENVIRONMENT,\n        }),\n        'http.request.method': method,\n        'url.full': url,\n        'server.address': serverAddress || undefined,\n      },\n    });\n    return { span, standalone };\n  } catch (_e) {\n    return null;\n  }\n}\n\n/**\n * 生成 `http.client` span 名用的 URL 清洗：去掉 query/fragment 与 URL 内的 userinfo（账号密码），\n * 既防敏感信息泄漏，也削掉一部分基数。\n *\n * **路径刻意保留原样**——SDK 无法推断 REST 路由模板（如 `/users/123` → `/users/:id`），强行参数化\n * 会误伤合法路径。若 REST 路径 id 造成 tracing 维度过高，请用 Sentry 的 `beforeSendTransaction`\n * 统一改写事务 / span 名（对网络与性能 resource span 均生效），见文档「配置 · 采样」。\n */\nfunction sanitizeSpanNameUrl(url: string): string {\n  if (url.startsWith('data:')) {\n    return stripDataUrlContent(url);\n  }\n\n  const withoutQueryAndFragment = stripUrlQueryAndFragment(url);\n  return withoutQueryAndFragment.replace(\n    /^([a-z][a-z0-9+.-]*:\\/\\/)([^/?#@]+@)/i,\n    '$1[filtered]:[filtered]@',\n  );\n}\n\nfunction stripUrlQueryAndFragment(url: string): string {\n  const stripped = url.split(/[?#]/, 1)[0];\n  return stripped === undefined ? url : stripped;\n}\n\nfunction stripDataUrlContent(url: string): string {\n  const mimeTypeMatch = url.match(/^data:([^;,]+)/);\n  const mimeType = mimeTypeMatch && mimeTypeMatch[1] ? mimeTypeMatch[1] : 'text/plain';\n  return `data:${mimeType}`;\n}\n\nfunction injectTraceHeaders(\n  options: any,\n  requestSpan: RequestSpan | null,\n  propagateTraceparent: boolean,\n): void {\n  try {\n    const span = requestSpan?.span;\n    const traceData = getTraceData(\n      span\n        ? propagateTraceparent\n          ? { span, propagateTraceparent: true }\n          : { span }\n        : propagateTraceparent\n          ? { propagateTraceparent: true }\n          : {},\n    );\n    const sentryTrace = traceData['sentry-trace'];\n    if (!sentryTrace) return;\n\n    const header = {\n      ...(isRecord(options.headers) ? options.headers : {}),\n      ...(isRecord(options.header) ? options.header : {}),\n    };\n    if (!hasHeader(header, 'sentry-trace')) {\n      header['sentry-trace'] = sentryTrace;\n    }\n\n    if (traceData.baggage) {\n      const baggageKey = findHeaderKey(header, 'baggage') || 'baggage';\n      header[baggageKey] = mergeBaggageHeader(header[baggageKey], traceData.baggage);\n    }\n\n    if (propagateTraceparent && traceData.traceparent && !hasHeader(header, 'traceparent')) {\n      header['traceparent'] = traceData.traceparent;\n    }\n\n    // 支持微信用 header、支付宝用 headers\n    options.header = header;\n    options.headers = header;\n  } catch (_e) {\n    // 追踪头注入失败不影响请求\n  }\n}\n\nfunction finishRequestSpan(\n  requestSpan: RequestSpan | null,\n  options: RequestSpanFinishOptions,\n): void {\n  if (!requestSpan) return;\n\n  try {\n    const { span, standalone } = requestSpan;\n    const statusCode = normalizeStatusCode(options.statusCode);\n    if (statusCode !== undefined) {\n      setHttpStatus(span, statusCode);\n    } else {\n      span.setStatus({\n        code: options.status === 'error' ? SPAN_STATUS_ERROR : SPAN_STATUS_OK,\n        message: options.status === 'error' ? options.errorMessage || 'error' : 'ok',\n      });\n    }\n    if (options.errorMessage) {\n      span.setAttribute('error.message', options.errorMessage);\n    }\n    if (standalone) {\n      span.setAttribute(SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, Math.max(0, options.durationMs));\n    }\n    span.end();\n  } catch (_e) {\n    // ignore\n  }\n}\n\nfunction normalizeUrl(url: unknown): string {\n  if (typeof url === 'string') {\n    return url;\n  }\n\n  if (url === undefined || url === null) {\n    return '';\n  }\n\n  return String(url);\n}\n\n/**\n * `@sentry/core` 的自请求识别依赖全局 `URL`。部分小游戏运行时没有完整实现该 API，且外层请求库\n * 可能通过浅拷贝丢失 transport 的对象身份标记，因此这里用同一组 DSN 约束做无 `URL` 回退。\n * 同时要求匹配 DSN 主机和 `sentry_key` 查询参数，不能仅按域名过滤业务请求。\n */\nfunction isSentryDsnRequestWithoutURL(url: string, client: Client | undefined): boolean {\n  const dsnHost = client?.getDsn()?.host.toLowerCase();\n  if (!dsnHost || !hasSentryKeyQueryParameter(url)) return false;\n\n  const requestHost = extractHost(url).toLowerCase();\n  return requestHost === dsnHost || requestHost.endsWith(`.${dsnHost}`);\n}\n\nfunction hasSentryKeyQueryParameter(url: string): boolean {\n  const queryStart = url.indexOf('?');\n  if (queryStart === -1) return false;\n\n  const fragmentStart = url.indexOf('#');\n  if (fragmentStart !== -1 && fragmentStart < queryStart) return false;\n\n  const search = url.slice(queryStart, fragmentStart === -1 ? undefined : fragmentStart);\n  return /(^|[?&])sentry_key=/.test(search);\n}\n\nfunction normalizeMethod(method: unknown): string {\n  return typeof method === 'string' && method.trim() !== '' ? method.toUpperCase() : 'GET';\n}\n\nfunction getResponseStatusCode(response: any): unknown {\n  if (!response || typeof response !== 'object') {\n    return undefined;\n  }\n\n  if (response.statusCode !== undefined && response.statusCode !== null) {\n    return response.statusCode;\n  }\n\n  return response.status;\n}\n\nfunction isErrorStatusCode(statusCode: unknown): boolean {\n  const normalizedStatusCode = normalizeStatusCode(statusCode);\n  return normalizedStatusCode !== undefined && normalizedStatusCode >= 400;\n}\n\nfunction isRecord(value: unknown): value is Record<string, any> {\n  return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction hasHeader(header: Record<string, any>, name: string): boolean {\n  return findHeaderKey(header, name) !== undefined;\n}\n\nfunction findHeaderKey(header: Record<string, any>, name: string): string | undefined {\n  const normalizedName = name.toLowerCase();\n  return Object.keys(header).find((key) => key.toLowerCase() === normalizedName);\n}\n\nfunction mergeBaggageHeader(existingBaggage: unknown, sentryBaggage: string): string {\n  const existing =\n    typeof existingBaggage === 'string'\n      ? existingBaggage\n      : Array.isArray(existingBaggage)\n        ? existingBaggage.filter((item) => typeof item === 'string').join(',')\n        : '';\n\n  if (!existing) {\n    return sentryBaggage;\n  }\n\n  const hasSentryBaggage = existing.split(',').some((item) => item.trim().startsWith('sentry-'));\n\n  return hasSentryBaggage ? existing : `${existing},${sentryBaggage}`;\n}\n\nfunction normalizeStatusCode(statusCode: unknown): number | undefined {\n  if (typeof statusCode === 'number' && Number.isFinite(statusCode)) {\n    return statusCode;\n  }\n\n  if (typeof statusCode === 'string' && statusCode.trim() !== '') {\n    const parsed = Number(statusCode);\n    if (Number.isFinite(parsed)) return parsed;\n  }\n\n  return undefined;\n}\n\nfunction extractHost(url: string): string {\n  try {\n    const authorityMatch = url.match(/^https?:\\/\\/([^/?#\\n]+)/i);\n    if (!authorityMatch || !authorityMatch[1]) return '';\n\n    const authority = authorityMatch[1].slice(authorityMatch[1].lastIndexOf('@') + 1);\n    if (authority.startsWith('[')) {\n      const closingBracket = authority.indexOf(']');\n      return closingBracket === -1 ? '' : authority.slice(0, closingBracket + 1);\n    }\n\n    return authority.split(':', 1)[0] || '';\n  } catch (_e) {\n    return '';\n  }\n}\n","/**\n * 全局 App() 生命周期的单一包装点。\n *\n * 小程序的 `App()` 是全局构造函数，只应被猴补一次。此前 SessionIntegration 与\n * PageBreadcrumbs 各自独立猴补 App，存在还原顺序脆弱、重复的全局检测等问题\n * （架构 review P2-c）。这里用引用计数做单次包装：\n *\n * - 首个订阅者触发对 `globalThis.App` 的包装；最后一个退订时还原。\n * - 还原仅在「全局 App 仍是我们的 wrapper」时进行，杜绝乱序 cleanup 丢层 / 覆盖他人后续包装。\n * - 每个生命周期事件（onLaunch/onShow/onHide/onError）在调用业务原回调**之前**广播给所有订阅者。\n * - wrapper 无条件注入四个生命周期回调，确保即使业务未定义某回调，订阅者也能收到广播\n *   （Session 依赖此点保证会话生命周期完整）。\n */\n\nexport interface AppLifecycleHandlers {\n  onLaunch?: (options?: unknown) => void;\n  onShow?: (options?: unknown) => void;\n  onHide?: () => void;\n  onError?: (error?: unknown) => void;\n}\n\nconst LIFECYCLE_METHODS: Array<keyof AppLifecycleHandlers> = [\n  'onLaunch',\n  'onShow',\n  'onHide',\n  'onError',\n];\n\nconst subscribers = new Set<AppLifecycleHandlers>();\nlet originalApp: ((...args: any[]) => any) | null = null;\nlet patched = false;\n\nfunction broadcast(method: keyof AppLifecycleHandlers, arg?: unknown): void {\n  // 复制一份再迭代，避免订阅者在回调里增删集合导致迭代异常。\n  for (const handlers of [...subscribers]) {\n    const fn = handlers[method];\n    if (typeof fn === 'function') {\n      try {\n        (fn as (a?: unknown) => void)(arg);\n      } catch (_e) {\n        // 单个订阅者异常不影响其他订阅者与业务回调。\n      }\n    }\n  }\n}\n\nfunction patchApp(): void {\n  const g = globalThis as any;\n  if (patched || typeof g.App !== 'function') return;\n\n  const currentOriginalApp = g.App as (...args: any[]) => any;\n  originalApp = currentOriginalApp;\n  const wrapper = function (this: any, appOptions: Record<string, any> = {}): any {\n    if (appOptions && typeof appOptions === 'object') {\n      for (const method of LIFECYCLE_METHODS) {\n        const userHandler = appOptions[method];\n        appOptions[method] = function (this: any, ...args: any[]): any {\n          broadcast(method, args[0]);\n          if (typeof userHandler === 'function') {\n            return userHandler.apply(this, args);\n          }\n        };\n      }\n    }\n    return currentOriginalApp.call(this, appOptions);\n  };\n  (wrapper as any).__sentryAppWrapper = true;\n  g.App = wrapper;\n  patched = true;\n}\n\nfunction unpatchAppIfIdle(): void {\n  if (!patched || subscribers.size > 0) return;\n  const g = globalThis as any;\n  // 仅当全局 App 仍是我们的 wrapper 时还原，避免覆盖他人后续包装。\n  if (g.App && g.App.__sentryAppWrapper && originalApp) {\n    g.App = originalApp;\n  }\n  originalApp = null;\n  patched = false;\n}\n\n/**\n * 订阅全局 App 生命周期。首次订阅会包装 `App()`；返回退订函数，\n * 退订到无订阅者时还原 `App()`。\n */\nexport function subscribeAppLifecycle(handlers: AppLifecycleHandlers): () => void {\n  // 无全局 App()（如小游戏，或尚未注入）：订阅毫无意义——既不会有广播，又会把 handler\n  // 永久滞留在模块级 subscribers 里（闭包持有集成实例 → 泄漏）。直接返回 no-op 退订。\n  // 注：一旦已包装，globalThis.App 即我们的 wrapper（仍是 function），后续订阅照常生效。\n  if (typeof (globalThis as any).App !== 'function') {\n    return () => {};\n  }\n\n  subscribers.add(handlers);\n  patchApp();\n  let active = true;\n  return () => {\n    if (!active) return;\n    active = false;\n    subscribers.delete(handlers);\n    unpatchAppIfIdle();\n  };\n}\n\n/** 仅供测试：重置内部包装状态。 */\nexport function _resetAppLifecycle(): void {\n  subscribers.clear();\n  originalApp = null;\n  patched = false;\n}\n","import { addBreadcrumb, getClient, setContext } from '@sentry/core';\nimport type { Client, Integration } from '@sentry/core';\n\nimport { subscribeAppLifecycle } from '../appLifecycle';\nimport {\n  addFunctionInstrumentationHandler,\n  ensureFunctionInstrumentation,\n} from '../instrumentation';\n\nconst PAGE_LIFECYCLE_METHODS = ['onLoad', 'onShow', 'onHide', 'onUnload', 'onReady'] as const;\n\nfunction isUserInteractionHandler(name: string): boolean {\n  if ((PAGE_LIFECYCLE_METHODS as readonly string[]).includes(name)) return false;\n  if (name.startsWith('_')) return false;\n\n  return (\n    /^(on|handle|bind)[A-Z]/.test(name) ||\n    /[Tt]ap$/.test(name) ||\n    /[Cc]lick$/.test(name) ||\n    /[Cc]hange$/.test(name) ||\n    /[Ss]ubmit$/.test(name) ||\n    /[Ss]croll$/.test(name) ||\n    /[Ii]nput$/.test(name)\n  );\n}\n\nexport interface PageBreadcrumbsOptions {\n  /** 是否追踪页面生命周期（默认 true） */\n  enableLifecycle?: boolean;\n  /** 是否追踪用户交互事件（默认 true） */\n  enableUserInteraction?: boolean;\n}\n\ninterface PageSubscriber {\n  firstPageReady: boolean;\n  launchTime: number;\n  options: Required<PageBreadcrumbsOptions>;\n}\n\nconst pageSubscribers = new Map<Client, PageSubscriber>();\n\nfunction getActivePageSubscriber(): PageSubscriber | undefined {\n  const activeClient = getClient();\n  return activeClient ? pageSubscribers.get(activeClient) : undefined;\n}\n\nfunction recordPageLifecycle(\n  subscriber: PageSubscriber,\n  method: (typeof PAGE_LIFECYCLE_METHODS)[number],\n  page: any,\n  args: any[],\n): void {\n  if (!subscriber.options.enableLifecycle) return;\n\n  const route = page?.route || page?.__route__ || 'unknown';\n  const breadcrumbData: Record<string, any> = { action: method, page: route };\n  if (method === 'onLoad' && args[0] && typeof args[0] === 'object') {\n    breadcrumbData['query'] = args[0];\n  }\n  if (method === 'onReady' && !subscriber.firstPageReady && subscriber.launchTime > 0) {\n    subscriber.firstPageReady = true;\n    const coldStartDuration = Date.now() - subscriber.launchTime;\n    breadcrumbData['coldStartDuration'] = coldStartDuration;\n    setContext('startup', { coldStartDuration, firstPage: route });\n  }\n\n  addBreadcrumb({\n    category: 'page.lifecycle',\n    message: `${method}: ${route}`,\n    level: 'info',\n    data: breadcrumbData,\n  });\n}\n\nfunction recordUserInteraction(\n  subscriber: PageSubscriber,\n  key: string,\n  page: any,\n  event: any,\n): void {\n  if (!subscriber.options.enableUserInteraction) return;\n\n  const route = page?.route || page?.__route__ || 'unknown';\n  const breadcrumbData: Record<string, any> = { handler: key, page: route };\n  if (event && typeof event === 'object') {\n    if (event.target) {\n      if (event.target.id) breadcrumbData['targetId'] = event.target.id;\n      if (event.target.dataset) breadcrumbData['dataset'] = event.target.dataset;\n    }\n    if (event.type) breadcrumbData['eventType'] = event.type;\n    if (event.detail) {\n      if (typeof event.detail.x === 'number') breadcrumbData['x'] = event.detail.x;\n      if (typeof event.detail.y === 'number') breadcrumbData['y'] = event.detail.y;\n    }\n    if (event.touches && event.touches.length > 0) {\n      const touch = event.touches[0];\n      if (touch) {\n        breadcrumbData['touchX'] = touch.pageX;\n        breadcrumbData['touchY'] = touch.pageY;\n      }\n    }\n  }\n\n  addBreadcrumb({\n    category: 'user.interaction',\n    message: `${key} on ${route}`,\n    level: 'info',\n    data: breadcrumbData,\n  });\n}\n\n/** Page 定义只注入中立 wrapper，回调执行时再按当前 client 选择配置。 */\nfunction instrumentPageOptions(pageOptions: unknown): void {\n  if (!pageOptions || typeof pageOptions !== 'object') return;\n  const options = pageOptions as Record<string, any>;\n\n  for (const method of PAGE_LIFECYCLE_METHODS) {\n    const original = options[method];\n    if (typeof original !== 'function' || original.__sentryPageCallbackWrapper) continue;\n    const wrapped = function (this: any, ...args: any[]): any {\n      const subscriber = getActivePageSubscriber();\n      if (subscriber) recordPageLifecycle(subscriber, method, this, args);\n      return original.apply(this, args);\n    };\n    Object.defineProperty(wrapped, '__sentryPageCallbackWrapper', { value: true });\n    options[method] = wrapped;\n  }\n\n  for (const key of Object.keys(options)) {\n    const original = options[key];\n    if (\n      typeof original !== 'function' ||\n      original.__sentryPageCallbackWrapper ||\n      !isUserInteractionHandler(key)\n    ) {\n      continue;\n    }\n    const wrapped = function (this: any, event: any, ...rest: any[]): any {\n      const subscriber = getActivePageSubscriber();\n      if (subscriber) recordUserInteraction(subscriber, key, this, event);\n      return original.apply(this, [event, ...rest]);\n    };\n    Object.defineProperty(wrapped, '__sentryPageCallbackWrapper', { value: true });\n    options[key] = wrapped;\n  }\n}\n\nfunction invokePage(original: Function, thisArg: unknown, args: unknown[]): unknown {\n  instrumentPageOptions(args[0]);\n  return original.apply(thisArg, args);\n}\n\n/**\n * 页面与 App 生命周期面包屑。全局 Page 由共享 instrumentation 统一拥有；每个 client\n * 只注册 subscriber，乱序 close 不会拆掉当前 client 的包装或复活旧配置。\n */\nexport class PageBreadcrumbs implements Integration {\n  public static id: string = 'PageBreadcrumbs';\n  public name: string = PageBreadcrumbs.id;\n\n  private readonly _options: Required<PageBreadcrumbsOptions>;\n  private readonly _cleanupCallbacks = new Set<() => void>();\n\n  constructor(options: PageBreadcrumbsOptions = {}) {\n    this._options = {\n      enableLifecycle: true,\n      enableUserInteraction: true,\n      ...options,\n    };\n  }\n\n  public setupOnce(): void {\n    const globalObject = globalThis as Record<PropertyKey, unknown>;\n    if (typeof globalObject['Page'] === 'function') {\n      ensureFunctionInstrumentation(globalObject, 'Page');\n    }\n  }\n\n  public setup(client: Client): void {\n    const subscriber = this._createSubscriber();\n    pageSubscribers.set(client, subscriber);\n    const globalObject = globalThis as Record<PropertyKey, unknown>;\n    const cleanups: Array<() => void> = [\n      () => {\n        if (pageSubscribers.get(client) === subscriber) pageSubscribers.delete(client);\n      },\n      this._subscribeApp(subscriber),\n    ];\n    if (typeof globalObject['Page'] === 'function') {\n      cleanups.push(addFunctionInstrumentationHandler(globalObject, 'Page', client, invokePage));\n    }\n    const cleanup = this._trackCleanup(cleanups);\n    client.registerCleanup(cleanup);\n  }\n\n  public cleanup(): void {\n    for (const cleanup of [...this._cleanupCallbacks]) cleanup();\n  }\n\n  private _createSubscriber(): PageSubscriber {\n    return { firstPageReady: false, launchTime: 0, options: this._options };\n  }\n\n  private _subscribeApp(subscriber: PageSubscriber): () => void {\n    if (!subscriber.options.enableLifecycle) return () => {};\n    return subscribeAppLifecycle({\n      onLaunch: () => {\n        if (getActivePageSubscriber() !== subscriber) return;\n        subscriber.launchTime = Date.now();\n        this._appBreadcrumb('onLaunch');\n      },\n      onShow: () => {\n        if (getActivePageSubscriber() === subscriber) this._appBreadcrumb('onShow');\n      },\n      onHide: () => {\n        if (getActivePageSubscriber() === subscriber) this._appBreadcrumb('onHide');\n      },\n    });\n  }\n\n  private _appBreadcrumb(method: string): void {\n    addBreadcrumb({\n      category: 'app.lifecycle',\n      message: `App.${method}`,\n      level: 'info',\n      data: { action: method },\n    });\n  }\n\n  private _trackCleanup(cleanups: Array<() => void>): () => void {\n    let active = true;\n    const cleanup = (): void => {\n      if (!active) return;\n      active = false;\n      for (const callback of cleanups.reverse()) callback();\n      this._cleanupCallbacks.delete(cleanup);\n    };\n    this._cleanupCallbacks.add(cleanup);\n    return cleanup;\n  }\n}\n\nexport const pageBreadcrumbsIntegration = (options?: PageBreadcrumbsOptions) =>\n  new PageBreadcrumbs(options);\n","import { addBreadcrumb } from '@sentry/core';\nimport type { Client, Integration, SeverityLevel } from '@sentry/core';\n\nimport {\n  addFunctionInstrumentationHandler,\n  ensureFunctionInstrumentation,\n} from '../instrumentation';\n\nconst CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log'] as const;\n\ntype ConsoleLevel = (typeof CONSOLE_LEVELS)[number];\n\nconst LEVEL_TO_SEVERITY: Record<ConsoleLevel, SeverityLevel> = {\n  debug: 'debug',\n  info: 'info',\n  log: 'info',\n  warn: 'warning',\n  error: 'error',\n};\n\n/**\n * Console 面包屑集成配置\n */\nexport interface ConsoleBreadcrumbsOptions {\n  /** 要拦截的 console 级别（默认全部） */\n  levels?: ConsoleLevel[];\n}\n\n/**\n * Console 面包屑集成\n *\n * 拦截 console.log/info/warn/error/debug，将输出记录为面包屑，\n * 帮助在 Sentry 后台重放用户操作时看到开发者的日志输出。\n *\n * 默认不启用，需通过 enableConsoleBreadcrumbs: true 开启。\n */\nexport class ConsoleBreadcrumbs implements Integration {\n  public static id: string = 'ConsoleBreadcrumbs';\n  public name: string = ConsoleBreadcrumbs.id;\n\n  private readonly _levels: ConsoleLevel[];\n  private readonly _cleanupCallbacks = new Set<() => void>();\n\n  constructor(options: ConsoleBreadcrumbsOptions = {}) {\n    this._levels = options.levels || [...CONSOLE_LEVELS];\n  }\n\n  public setupOnce(): void {\n    for (const level of this._levels) {\n      if (typeof console[level] !== 'function') continue;\n      ensureFunctionInstrumentation(console, level);\n    }\n  }\n\n  public setup(client: Client): void {\n    const cleanups: Array<() => void> = [];\n    for (const level of this._levels) {\n      if (typeof console[level] !== 'function') continue;\n      cleanups.push(\n        addFunctionInstrumentationHandler(console, level, client, (original, thisArg, args) =>\n          this._handleConsole(level, original, thisArg, args),\n        ),\n      );\n    }\n    const cleanup = this._trackCleanup(cleanups);\n    client.registerCleanup(cleanup);\n  }\n\n  private _handleConsole(\n    level: ConsoleLevel,\n    original: Function,\n    thisArg: unknown,\n    args: unknown[],\n  ): unknown {\n    addBreadcrumb({\n      category: 'console',\n      level: LEVEL_TO_SEVERITY[level],\n      message: args\n        .map((arg) => {\n          if (typeof arg === 'string') return arg;\n          try {\n            return JSON.stringify(arg);\n          } catch (_e) {\n            return String(arg);\n          }\n        })\n        .join(' '),\n    });\n\n    return original.apply(thisArg ?? console, args);\n  }\n\n  /**\n   * 清理资源，恢复原始 console 方法\n   */\n  public cleanup(): void {\n    for (const cleanup of [...this._cleanupCallbacks]) cleanup();\n  }\n\n  private _trackCleanup(cleanups: Array<() => void>): () => void {\n    let active = true;\n    const cleanup = (): void => {\n      if (!active) return;\n      active = false;\n      for (const callback of cleanups.reverse()) callback();\n      this._cleanupCallbacks.delete(cleanup);\n    };\n    this._cleanupCallbacks.add(cleanup);\n    return cleanup;\n  }\n}\n\n/**\n * Console 面包屑集成工厂函数\n */\nexport const consoleBreadcrumbsIntegration = (options?: ConsoleBreadcrumbsOptions) => {\n  return new ConsoleBreadcrumbs(options);\n};\n","import { startSession, endSession, captureSession, getClient } from '@sentry/core';\nimport type { Client, Integration } from '@sentry/core';\nimport { subscribeAppLifecycle } from '../appLifecycle';\n\n/**\n * Session Integration\n * 自动管理小程序 Session 生命周期，为 Sentry Release Health 提供数据。\n *\n * - App.onLaunch / onShow → 开始新 Session\n * - App.onHide → 结束 Session\n *\n * crashed 标记不在本集成处理：@sentry/core 捕获未处理错误（mechanism.handled=false）时，\n * 会自动把当前 Session 标记为 crashed 并补发（client._updateSessionFromEvent）。早期此处曾用\n * App.onError 钩子手动标记，但它读 currentScope、而 Session 挂在 isolationScope 上——恒为\n * no-op，已删除，避免与 core 的自动标记重复或误导后人。\n *\n * 通过共享的 appLifecycle 订阅全局 App 生命周期（不再自行猴补 App，见架构 review P2-c）。\n */\nexport class SessionIntegration implements Integration {\n  public static id: string = 'Session';\n  public name: string = SessionIntegration.id;\n\n  private _isSessionActive: boolean = false;\n  private _unsubscribe: (() => void) | null = null;\n  private _isSetup: boolean = false;\n  private _client: Client | undefined;\n\n  public setupOnce(): void {\n    this._setup();\n  }\n\n  public setup(client: Client): void {\n    this._client = client;\n    this._setup();\n    client.registerCleanup(() => this.cleanup());\n  }\n\n  private _setup(): void {\n    if (this._isSetup) return;\n    this._isSetup = true;\n    this._unsubscribe = subscribeAppLifecycle({\n      onLaunch: () => this._startSession(),\n      onShow: () => {\n        if (!this._isSessionActive) {\n          this._startSession();\n        }\n      },\n      onHide: () => this._endSession(),\n    });\n  }\n\n  private _startSession(): void {\n    if (this._client && getClient() !== this._client) return;\n    try {\n      startSession({ ignoreDuration: true });\n      captureSession();\n      this._isSessionActive = true;\n    } catch (_e) {\n      // Session 管理不应影响 SDK 正常运行\n    }\n  }\n\n  private _endSession(): void {\n    if (this._client && getClient() !== this._client) return;\n    try {\n      endSession();\n      captureSession();\n      this._isSessionActive = false;\n    } catch (_e) {\n      // ignore\n    }\n  }\n\n  public cleanup(): void {\n    if (this._unsubscribe) {\n      this._unsubscribe();\n      this._unsubscribe = null;\n    }\n    this._isSessionActive = false;\n    this._isSetup = false;\n    this._client = undefined;\n  }\n}\n","import { addBreadcrumb, setContext, getClient } from '@sentry/core';\nimport type { Client, Integration } from '@sentry/core';\nimport { sdk } from '../crossPlatform';\n\n/**\n * Network Status Integration\n * 实时监控网络状态变化，在网络切换时自动添加面包屑并更新上下文。\n */\nexport class NetworkStatusIntegration implements Integration {\n  public static id: string = 'NetworkStatus';\n  public name: string = NetworkStatusIntegration.id;\n\n  private _statusChangeHandler: ((res: any) => void) | null = null;\n  private _lastConnected: boolean | null = null;\n  private _isSetup: boolean = false;\n  private _client: Client | undefined;\n\n  public setupOnce(): void {\n    this._setup();\n  }\n\n  public setup(client: Client): void {\n    this._client = client;\n    this._setup();\n    client.registerCleanup(() => this.cleanup());\n  }\n\n  private _setup(): void {\n    if (this._isSetup) return;\n    this._isSetup = true;\n\n    const miniappSdk = sdk();\n    if (!miniappSdk) return;\n\n    // 初始获取网络状态\n    if (typeof miniappSdk.getNetworkType === 'function') {\n      try {\n        miniappSdk.getNetworkType({\n          success: (res: any) => {\n            if (this._client && getClient() !== this._client) return;\n            const networkType = res.networkType || 'unknown';\n            this._lastConnected = networkType !== 'none';\n            setContext('network', {\n              type: networkType,\n              isConnected: this._lastConnected,\n            });\n          },\n        });\n      } catch (_e) {\n        // ignore\n      }\n    }\n\n    // 监听网络状态变化\n    if (typeof miniappSdk.onNetworkStatusChange === 'function') {\n      this._statusChangeHandler = (res: any) => {\n        if (this._client && getClient() !== this._client) return;\n        const networkType = res.networkType || 'unknown';\n        const isConnected =\n          res.isConnected !== undefined ? res.isConnected : networkType !== 'none';\n\n        setContext('network', {\n          type: networkType,\n          isConnected,\n        });\n\n        addBreadcrumb({\n          category: 'network.change',\n          message: `网络状态变化: ${networkType}`,\n          level: isConnected ? 'info' : 'warning',\n          data: {\n            networkType,\n            isConnected,\n          },\n        });\n\n        // 网络从断到连：主动 flush，尽快补发离线期间积压的事件。best-effort——\n        // 不保证排空离线 store（其重放仍由 transport 的退避 / 启动重试负责）。\n        if (isConnected && this._lastConnected === false) {\n          try {\n            void getClient()?.flush();\n          } catch (_e) {\n            // ignore\n          }\n        }\n        this._lastConnected = isConnected;\n      };\n\n      miniappSdk.onNetworkStatusChange(this._statusChangeHandler);\n    }\n  }\n\n  public cleanup(): void {\n    if (this._statusChangeHandler) {\n      const miniappSdk = sdk();\n      if (miniappSdk && typeof miniappSdk.offNetworkStatusChange === 'function') {\n        try {\n          miniappSdk.offNetworkStatusChange(this._statusChangeHandler);\n        } catch (_e) {\n          // ignore\n        }\n      }\n      this._statusChangeHandler = null;\n    }\n    this._lastConnected = null;\n    this._isSetup = false;\n    this._client = undefined;\n  }\n}\n","import {\n  addBreadcrumb,\n  getClient,\n  setContext,\n  startInactiveSpan,\n  setMeasurement,\n} from '@sentry/core';\nimport type { Client, Integration, IntegrationFn } from '@sentry/core';\nimport { sdk, now, epochNow } from '../crossPlatform';\n\n/**\n * Minigame Integration\n *\n * 面向「小游戏」运行时（微信小游戏 / 抖音小游戏等，无 App()/Page() 与页面路由）的\n * 生命周期与冷启动监控，弥补小程序专用的 PageBreadcrumbs / SessionIntegration 在\n * 小游戏中无法工作的空缺。能力：\n * - 读取 getLaunchOptionsSync() 记录启动场景（scene / path / query）上下文与面包屑；\n * - 测量「SDK 初始化 → 首帧」耗时（首个 requestAnimationFrame 回调，近似首帧渲染）；\n * - 监听 onShow / onHide 记录前后台切换面包屑（携带场景值）。\n */\nexport class MinigameIntegration implements Integration {\n  public static id: string = 'Minigame';\n  public name: string = MinigameIntegration.id;\n\n  // _initTs 用时长时钟（now()）测量耗时；_initEpoch 用 epochNow() 表达 span 的绝对起点。\n  // 两者目前同为墙钟毫秒，但保留语义区分：前者只做差值，后者用于 Sentry 时间戳。\n  private _initTs: number = now();\n  private _initEpoch: number = epochNow();\n  private _showHandler: ((res: any) => void) | null = null;\n  private _hideHandler: (() => void) | null = null;\n  private _coldStartReported: boolean = false;\n  private _isSetup: boolean = false;\n  private _client: Client | undefined;\n  // 累积的 minigame 上下文。setContext 为「覆盖」语义，故内部维护完整对象，\n  // 每次补充字段后整体写回，避免后续字段冲掉启动场景。\n  private _minigameContext: {\n    runtime: string;\n    scene?: unknown;\n    path?: unknown;\n    query?: unknown;\n    coldStartMs?: number;\n  } = { runtime: 'minigame' };\n\n  public setupOnce(): void {\n    this._setup();\n  }\n\n  public setup(client: Client): void {\n    this._client = client;\n    this._setup();\n    client.registerCleanup(() => this.cleanup());\n  }\n\n  private _setup(): void {\n    if (this._isSetup) return;\n    this._isSetup = true;\n    this._initTs = now();\n    this._initEpoch = epochNow();\n    this._coldStartReported = false;\n\n    const miniappSdk = sdk();\n    if (!miniappSdk) return;\n\n    // 启动场景上下文 + 面包屑\n    if (typeof miniappSdk.getLaunchOptionsSync === 'function') {\n      try {\n        const launch = miniappSdk.getLaunchOptionsSync() || {};\n        this._minigameContext.scene = launch.scene;\n        this._minigameContext.path = launch.path;\n        this._minigameContext.query = launch.query;\n        setContext('minigame', { ...this._minigameContext });\n        addBreadcrumb({\n          category: 'minigame.launch',\n          message: '小游戏冷启动',\n          level: 'info',\n          data: { scene: launch.scene, path: launch.path },\n        });\n      } catch (_e) {\n        // ignore\n      }\n    }\n\n    this._measureColdStart();\n\n    // 前台 / 后台切换\n    if (typeof miniappSdk.onShow === 'function') {\n      this._showHandler = (res: any) => {\n        if (!this._isActiveClient()) return;\n        addBreadcrumb({\n          category: 'minigame.lifecycle',\n          message: '小游戏 onShow（进入前台）',\n          level: 'info',\n          data: { scene: res && res.scene },\n        });\n      };\n      miniappSdk.onShow(this._showHandler);\n    }\n    if (typeof miniappSdk.onHide === 'function') {\n      this._hideHandler = () => {\n        if (!this._isActiveClient()) return;\n        addBreadcrumb({\n          category: 'minigame.lifecycle',\n          message: '小游戏 onHide（退到后台）',\n          level: 'info',\n        });\n      };\n      miniappSdk.onHide(this._hideHandler);\n    }\n  }\n\n  /**\n   * 用首个 requestAnimationFrame 回调近似「首帧渲染完成」，计算 SDK 初始化 → 首帧的耗时。\n   */\n  private _measureColdStart(): void {\n    const raf = (globalThis as any).requestAnimationFrame;\n    if (typeof raf !== 'function') return;\n\n    raf(() => {\n      if (!this._isActiveClient() || this._coldStartReported) return;\n      this._coldStartReported = true;\n      const firstFrameTs = now();\n      // 夹下限 0：时长时钟用 Date.now()（见 crossPlatform.now），万一启动头几百 ms 内系统时钟\n      // 向后跳（NTP 校正 / 用户改表），不至于报出负数冷启动。\n      const coldStartMs = Math.max(0, Math.round(firstFrameTs - this._initTs));\n      this._minigameContext.coldStartMs = coldStartMs;\n      setContext('minigame', { ...this._minigameContext });\n      addBreadcrumb({\n        category: 'minigame.performance',\n        message: `SDK 初始化到首帧耗时: ${coldStartMs}ms`,\n        level: 'info',\n        data: { coldStartMs },\n      });\n\n      // 独立性能事件：把「SDK 初始化 → 首帧」包成 transaction，进 Performance 页。\n      // 仅在 tracing 启用（tracesSampleRate/tracesSampler）时真正上报；否则为非记录 span、不发送。\n      // span 时间戳使用 epoch 锚点；duration 用 now() 测得的 coldStartMs 叠加上去，\n      // 保证绝对时间与时长语义各自清晰。\n      const span = startInactiveSpan({\n        name: 'minigame.coldstart',\n        op: 'app.start',\n        forceTransaction: true,\n        startTime: this._initEpoch / 1000,\n      });\n      span.setAttributes({\n        'minigame.scene': this._minigameContext.scene as any,\n        'minigame.path': this._minigameContext.path as any,\n        'minigame.cold_start_ms': coldStartMs,\n      });\n      setMeasurement('cold_start', coldStartMs, 'millisecond', span);\n      span.end((this._initEpoch + coldStartMs) / 1000);\n    });\n  }\n\n  public cleanup(): void {\n    const miniappSdk = sdk();\n    if (miniappSdk) {\n      try {\n        if (this._showHandler && typeof miniappSdk.offShow === 'function') {\n          miniappSdk.offShow(this._showHandler);\n        }\n        if (this._hideHandler && typeof miniappSdk.offHide === 'function') {\n          miniappSdk.offHide(this._hideHandler);\n        }\n      } catch (_e) {\n        // ignore\n      }\n    }\n    this._showHandler = null;\n    this._hideHandler = null;\n    this._isSetup = false;\n    this._client = undefined;\n  }\n\n  private _isActiveClient(): boolean {\n    return !this._client || getClient() === this._client;\n  }\n}\n\n/**\n * 函数式工厂，风格对齐 performanceIntegration。\n */\nexport const minigameIntegration: IntegrationFn = () => new MinigameIntegration();\n","import {\n  addBreadcrumb,\n  flush,\n  getClient,\n  setContext,\n  startInactiveSpan,\n  setMeasurement,\n} from '@sentry/core';\nimport type { Client, Integration, IntegrationFn } from '@sentry/core';\nimport { sdk, now, epochNow } from '../crossPlatform';\nimport type { MinigameFrameRateOptions, MinigameJankLevels } from '../types';\n\ntype FrameRateWindowStats = {\n  fps: number;\n  minFps: number;\n  worstFrameMs: number;\n  jankCount: number;\n  frames: number;\n};\n\n/** 分级卡顿档名（严重程度升序：minor < major < severe）。 */\ntype JankTierName = 'minor' | 'major' | 'severe';\ninterface JankTier {\n  name: JankTierName;\n  threshold: number;\n}\nconst JANK_TIER_NAMES: JankTierName[] = ['minor', 'major', 'severe'];\n\n/**\n * 收集有效分级档（有限正数）并校验「阈值随严重度严格递增」（minor < major < severe）。\n *\n * JANK_TIER_NAMES 本身即严重度升序，按此顺序收集；校验必须在排序前做——否则按数值\n * 排序会抹掉非单调的证据。若阈值未随严重度递增（含相等），说明 jankLevel 名实不符\n * （如 { minor: 100, severe: 17 } 会把重卡标成 minor），此时 warn 并回退单档\n * longFrameThresholdMs。返回空数组表示未启用分级。\n */\nfunction normalizeJankTiers(levels?: MinigameJankLevels): JankTier[] {\n  if (!levels) return [];\n  const tiers: JankTier[] = [];\n  for (const name of JANK_TIER_NAMES) {\n    const threshold = levels[name];\n    if (typeof threshold === 'number' && Number.isFinite(threshold) && threshold > 0) {\n      tiers.push({ name, threshold });\n    }\n  }\n  if (tiers.length === 0) return [];\n  for (let i = 1; i < tiers.length; i++) {\n    const prev = tiers[i - 1];\n    const cur = tiers[i];\n    if (prev && cur && cur.threshold <= prev.threshold) {\n      console.warn(\n        '[sentry-miniapp] jankLevels 阈值须按 minor < major < severe 严格递增，' +\n          '当前配置不满足，已忽略分级并回退到单档 longFrameThresholdMs。',\n      );\n      return [];\n    }\n  }\n  return tiers;\n}\n\n/** 把一帧耗时归入命中的最高档（tiers 升序）；无命中返回 null。 */\nfunction classifyJank(tiers: JankTier[], frameDelta: number): JankTierName | null {\n  for (let i = tiers.length - 1; i >= 0; i--) {\n    const tier = tiers[i];\n    if (tier && frameDelta > tier.threshold) return tier.name;\n  }\n  return null;\n}\n\n/** 取已排序样本的 P95（样本为空时回退到 fallback）。 */\nfunction percentile95(samples: number[], fallback: number): number {\n  if (samples.length === 0) return fallback;\n  const sorted = [...samples].sort((a, b) => a - b);\n  return sorted[Math.floor(0.95 * (sorted.length - 1))] ?? fallback;\n}\n\n/**\n * Minigame FrameRate Integration\n *\n * 面向「小游戏」的帧率（FPS）/ 卡顿（jank）监控。通过自循环采样全局\n * requestAnimationFrame 估算帧率：单帧间隔超过 longFrameThresholdMs 记一次 jank\n * （面包屑按窗口限频，避免持续掉帧刷屏）；每 reportInterval 周期性上报窗口内\n * FPS / 最低瞬时 FPS / 最差帧耗时 / jank 次数到 `minigame.framerate` 上下文。\n *\n * 此外，会话维度累积帧率/卡顿，在退后台（onHide）或集成关闭时发一个汇总\n * transaction（`minigame.framerate.summary`，含 fps_avg / fps_p95 / fps_min /\n * jank_count measurements），独立于 error 事件、进 Sentry Performance 页，由\n * tracesSampleRate 控制——不每窗口发事件，配额友好。\n *\n * 可选 `jankLevels` 把卡顿按 minor/major/severe 三档分级：每帧按命中的最高档归类，\n * 面包屑带 `jankLevel`，summary 对启用的档增发 `jank_{minor,major,severe}_count`\n * （`jank_count` 仍为总数）。不配置时沿用单档 longFrameThresholdMs，行为不变。\n *\n * 仅适用于小游戏：小游戏有绑定真实渲染帧的全局 requestAnimationFrame；小程序为\n * 双线程架构、逻辑层无全局 requestAnimationFrame，缺失时安全降级（不工作）。\n */\nexport class MinigameFrameRateIntegration implements Integration {\n  public static id: string = 'MinigameFrameRate';\n  public name: string = MinigameFrameRateIntegration.id;\n\n  private _options: Required<Omit<MinigameFrameRateOptions, 'jankLevels'>>;\n  // 分级卡顿模型（构造时规范化）：_tiers 升序，空表示未启用分级。\n  private _tiered: boolean;\n  private _tiers: JankTier[];\n  private _jankEntryThreshold: number;\n  private _running: boolean = false;\n  private _windowElapsed: number = 0;\n  private _lastFrameTs: number = 0;\n  private _frameCount: number = 0;\n  private _jankCount: number = 0;\n  private _jankBreadcrumbs: number = 0;\n  private _jankByTier: Record<JankTierName, number> = { minor: 0, major: 0, severe: 0 };\n  private _maxFrameDelta: number = 0;\n\n  // 会话级累积（用于退后台 onHide 时发一个汇总 transaction）\n  // _sessionEpochStart 用 epochNow()（墙钟）作 span 绝对时间锚点；时长用有效帧 delta 累积。\n  private static readonly _MAX_FPS_SAMPLES = 2000;\n  private static readonly _MAX_REASONABLE_FRAME_DELTA_MS = 5000;\n  private static readonly _HIDE_FLUSH_TIMEOUT_MS = 2000;\n  private _sessionEpochStart: number = 0;\n  private _sessionElapsed: number = 0;\n  private _sessionFrames: number = 0;\n  private _sessionJank: number = 0;\n  private _sessionJankByTier: Record<JankTierName, number> = { minor: 0, major: 0, severe: 0 };\n  private _sessionWorstFrame: number = 0;\n  private _fpsSamples: number[] = [];\n  private _showHandler: ((res: any) => void) | null = null;\n  private _hideHandler: (() => void) | null = null;\n  private _isSetup: boolean = false;\n  private _client: Client | undefined;\n\n  constructor(options: MinigameFrameRateOptions = {}) {\n    this._options = {\n      fpsWarningThreshold: options.fpsWarningThreshold ?? 30,\n      longFrameThresholdMs: options.longFrameThresholdMs ?? 50,\n      reportInterval: options.reportInterval ?? 10000,\n      maxJankBreadcrumbsPerWindow: options.maxJankBreadcrumbsPerWindow ?? 3,\n    };\n\n    // 分级卡顿：收集有效档（有限正数）。至少一档有效则启用分级，入档阈值取最低档；\n    // 否则沿用单档 longFrameThresholdMs（jankLevels 优先于 longFrameThresholdMs）。\n    this._tiers = normalizeJankTiers(options.jankLevels);\n    const lowestTier = this._tiers[0];\n    this._tiered = lowestTier !== undefined;\n    this._jankEntryThreshold = lowestTier\n      ? lowestTier.threshold\n      : this._options.longFrameThresholdMs;\n  }\n\n  public setupOnce(): void {\n    this._setup();\n  }\n\n  public setup(client: Client): void {\n    this._client = client;\n    this._setup();\n    client.registerCleanup(() => this.cleanup());\n  }\n\n  private _setup(): void {\n    if (this._isSetup) return;\n    this._isSetup = true;\n\n    const raf = (globalThis as any).requestAnimationFrame;\n    if (typeof raf !== 'function') {\n      console.warn(\n        '[sentry-miniapp] requestAnimationFrame 不可用，小游戏帧率监控已跳过（小程序逻辑层不支持）',\n      );\n      return;\n    }\n\n    this._running = true;\n    const startTs = now();\n    this._lastFrameTs = startTs;\n    this._sessionEpochStart = epochNow();\n\n    const loop = (): void => {\n      if (!this._running) return;\n      const t = now();\n      if (this._isActiveClient()) {\n        this._onFrame(t - this._lastFrameTs);\n      }\n      this._lastFrameTs = t;\n      raf(loop);\n    };\n    raf(loop);\n\n    // 退后台 / 回前台：onHide 发会话汇总 transaction，onShow 开启新会话。\n    const miniappSdk = sdk();\n    if (miniappSdk && typeof miniappSdk.onHide === 'function') {\n      this._hideHandler = () => {\n        if (!this._isActiveClient()) return;\n        if (this._flushSummary()) {\n          this._flushPendingEvents();\n        }\n      };\n      miniappSdk.onHide(this._hideHandler);\n    }\n    if (miniappSdk && typeof miniappSdk.onShow === 'function') {\n      this._showHandler = () => {\n        if (this._isActiveClient()) this._restartOnResume();\n      };\n      miniappSdk.onShow(this._showHandler);\n    }\n  }\n\n  private _onFrame(delta: number): void {\n    const frameDelta = this._sanitizeFrameDelta(delta);\n    if (frameDelta === null) {\n      if (\n        !Number.isFinite(delta) ||\n        delta > MinigameFrameRateIntegration._MAX_REASONABLE_FRAME_DELTA_MS\n      ) {\n        // 超大 delta 通常来自后台暂停 / 调试器停顿，作为采样断点处理，避免污染 FPS 与 duration。\n        this._rollupWindow();\n      }\n      return;\n    }\n\n    this._frameCount += 1;\n    this._windowElapsed += frameDelta;\n\n    if (frameDelta > this._maxFrameDelta) {\n      this._maxFrameDelta = frameDelta;\n    }\n\n    if (frameDelta > this._jankEntryThreshold) {\n      this._jankCount += 1;\n      // 分级模式：按命中的最高档归类，并累计该档窗口计数（入档阈值=最低档，必可归类）。\n      const jankLevel = this._tiered ? classifyJank(this._tiers, frameDelta) : null;\n      if (jankLevel) this._jankByTier[jankLevel] += 1;\n      // 面包屑按窗口限频，避免持续掉帧刷屏；超出阈值仅计数（jankCount 仍如实统计）。\n      if (this._jankBreadcrumbs < this._options.maxJankBreadcrumbsPerWindow) {\n        this._jankBreadcrumbs += 1;\n        addBreadcrumb({\n          category: 'minigame.jank',\n          message: `检测到卡顿帧: ${Math.round(frameDelta)}ms`,\n          level: 'warning',\n          data: jankLevel\n            ? { frameDurationMs: Math.round(frameDelta), jankLevel }\n            : { frameDurationMs: Math.round(frameDelta) },\n        });\n      }\n    }\n\n    if (this._windowElapsed >= this._options.reportInterval) {\n      this._report();\n    }\n  }\n\n  private _sanitizeFrameDelta(delta: number): number | null {\n    if (!Number.isFinite(delta) || delta <= 0) return null;\n    if (delta > MinigameFrameRateIntegration._MAX_REASONABLE_FRAME_DELTA_MS) return null;\n    return delta;\n  }\n\n  private _report(): void {\n    const stats = this._rollupWindow();\n    if (!stats) return;\n\n    setContext('minigame.framerate', {\n      fps: stats.fps,\n      minFps: stats.minFps,\n      worstFrameMs: stats.worstFrameMs,\n      jankCount: stats.jankCount,\n      frames: stats.frames,\n    });\n    addBreadcrumb({\n      category: 'minigame.framerate',\n      message: `FPS: ${stats.fps}（最低 ${stats.minFps}，卡顿 ${stats.jankCount} 次）`,\n      level: stats.fps < this._options.fpsWarningThreshold ? 'warning' : 'info',\n      data: stats,\n    });\n  }\n\n  private _rollupWindow(): FrameRateWindowStats | null {\n    const elapsed = this._windowElapsed;\n    if (this._frameCount === 0 || elapsed <= 0) {\n      this._resetWindow();\n      return null;\n    }\n\n    const fps = Math.round((this._frameCount / elapsed) * 1000);\n    const minFps = this._maxFrameDelta > 0 ? Math.round(1000 / this._maxFrameDelta) : fps;\n    const stats: FrameRateWindowStats = {\n      fps,\n      minFps,\n      worstFrameMs: Math.round(this._maxFrameDelta),\n      jankCount: this._jankCount,\n      frames: this._frameCount,\n    };\n\n    // 并入会话累积（用于 onHide 汇总 transaction）。\n    this._fpsSamples.push(fps);\n    if (this._fpsSamples.length > MinigameFrameRateIntegration._MAX_FPS_SAMPLES) {\n      this._fpsSamples.shift();\n    }\n    this._sessionElapsed += elapsed;\n    this._sessionFrames += this._frameCount;\n    this._sessionJank += this._jankCount;\n    this._sessionJankByTier.minor += this._jankByTier.minor;\n    this._sessionJankByTier.major += this._jankByTier.major;\n    this._sessionJankByTier.severe += this._jankByTier.severe;\n    if (this._maxFrameDelta > this._sessionWorstFrame) {\n      this._sessionWorstFrame = this._maxFrameDelta;\n    }\n\n    this._resetWindow();\n\n    return stats;\n  }\n\n  private _resetWindow(): void {\n    this._windowElapsed = 0;\n    this._frameCount = 0;\n    this._jankCount = 0;\n    this._jankBreadcrumbs = 0;\n    this._maxFrameDelta = 0;\n    this._jankByTier = { minor: 0, major: 0, severe: 0 };\n  }\n\n  /** 重置会话累积（回前台开启新会话）。 */\n  private _resetSession(): void {\n    this._sessionEpochStart = epochNow();\n    this._sessionElapsed = 0;\n    this._sessionFrames = 0;\n    this._sessionJank = 0;\n    this._sessionJankByTier = { minor: 0, major: 0, severe: 0 };\n    this._sessionWorstFrame = 0;\n    this._fpsSamples = [];\n  }\n\n  /**\n   * 回前台（onShow）：开启新会话，并把帧循环 / 窗口基线对齐到当前时刻。\n   * 退后台时 RAF 暂停，回前台后第一帧的 delta 会等于整段后台时长——若不重置基线，\n   * 会被误判为一帧巨型卡顿，拉爆 worstFrame、把 minFps 打到 ~0、jank +1，污染新会话汇总。\n   */\n  private _restartOnResume(): void {\n    this._resetSession();\n    const t = now();\n    this._lastFrameTs = t;\n    this._resetWindow();\n  }\n\n  /**\n   * 发一个会话汇总 transaction（独立于 error 上报，进 Performance 页）。\n   * 仅在 tracing 启用时真正上报；会话无帧则跳过。发完重置会话累积。\n   */\n  private _flushSummary(): boolean {\n    this._rollupWindow();\n    if (this._sessionFrames === 0) return false;\n\n    const elapsed = this._sessionElapsed;\n    const avgFps = elapsed > 0 ? Math.round((this._sessionFrames / elapsed) * 1000) : 0;\n    const minFps =\n      this._sessionWorstFrame > 0 ? Math.round(1000 / this._sessionWorstFrame) : avgFps;\n    const p95Fps = percentile95(this._fpsSamples, avgFps);\n    const worstFrameMs = Math.round(this._sessionWorstFrame);\n    const jankCount = this._sessionJank;\n    const frames = this._sessionFrames;\n\n    // span 绝对时间用 epoch 锚点 + 单调测得的 elapsed 作时长，避免单调时钟落到 1970。\n    const span = startInactiveSpan({\n      name: 'minigame.framerate.summary',\n      op: 'ui.framerate',\n      forceTransaction: true,\n      startTime: this._sessionEpochStart / 1000,\n    });\n    span.setAttributes({\n      'fps.avg': avgFps,\n      'fps.p95': p95Fps,\n      'fps.min': minFps,\n      'frames.total': frames,\n      'jank.count': jankCount,\n      'frame.worst_ms': worstFrameMs,\n    });\n    setMeasurement('fps_avg', avgFps, 'none', span);\n    setMeasurement('fps_p95', p95Fps, 'none', span);\n    setMeasurement('fps_min', minFps, 'none', span);\n    setMeasurement('jank_count', jankCount, 'none', span);\n    // 分级模式：对启用的档增发计数（jank_count 仍为总数；未启用的档不发）。\n    if (this._tiered) {\n      const tierAttrs: Record<string, number> = {};\n      for (const tier of this._tiers) {\n        const tierCount = this._sessionJankByTier[tier.name];\n        tierAttrs[`jank.${tier.name}`] = tierCount;\n        setMeasurement(`jank_${tier.name}_count`, tierCount, 'none', span);\n      }\n      span.setAttributes(tierAttrs);\n    }\n    span.end((this._sessionEpochStart + Math.max(0, elapsed)) / 1000);\n\n    this._resetSession();\n    return true;\n  }\n\n  private _flushPendingEvents(): void {\n    void Promise.resolve(flush(MinigameFrameRateIntegration._HIDE_FLUSH_TIMEOUT_MS)).catch(() => {\n      // ignore\n    });\n  }\n\n  public cleanup(): void {\n    this._running = false;\n    // 会话结束兜底：再发一次汇总；发出了就把传输 flush 掉（与 onHide 路径一致，\n    // 避免集成关闭/客户端拆除时这条汇总 transaction 还滞留在传输队列里没发出）。\n    if (this._isActiveClient()) {\n      if (this._flushSummary()) this._flushPendingEvents();\n    } else {\n      this._resetWindow();\n      this._resetSession();\n    }\n    const miniappSdk = sdk();\n    if (miniappSdk) {\n      try {\n        if (this._hideHandler && typeof miniappSdk.offHide === 'function') {\n          miniappSdk.offHide(this._hideHandler);\n        }\n        if (this._showHandler && typeof miniappSdk.offShow === 'function') {\n          miniappSdk.offShow(this._showHandler);\n        }\n      } catch (_e) {\n        // ignore\n      }\n    }\n    this._hideHandler = null;\n    this._showHandler = null;\n    this._isSetup = false;\n    this._client = undefined;\n  }\n\n  private _isActiveClient(): boolean {\n    return !this._client || getClient() === this._client;\n  }\n}\n\n/**\n * 函数式工厂。\n */\nexport const minigameFrameRateIntegration = ((\n  options?: MinigameFrameRateOptions,\n): MinigameFrameRateIntegration =>\n  new MinigameFrameRateIntegration(options)) satisfies IntegrationFn;\n","export { GlobalHandlers, globalHandlersIntegration } from './globalhandlers';\nexport { TryCatch, tryCatchIntegration } from './trycatch';\nexport { LinkedErrors, linkedErrorsIntegration } from './linkederrors';\nexport { HttpContext, httpContextIntegration } from './httpcontext';\nexport { Dedupe, dedupeIntegration } from './dedupe';\n/** @deprecated 被 HttpContext / MiniappClient context 取代，将在 2.0 移除。 */\nexport { System } from './system';\n/** @deprecated 被 PageBreadcrumbs 取代，将在 2.0 移除。 */\nexport { Router } from './router';\nexport { PerformanceIntegration, performanceIntegration } from './performance';\nexport {\n  RewriteFrames,\n  normalizeMiniappFrameFilename,\n  rewriteFramesIntegration,\n} from './rewriteframes';\nexport { NetworkBreadcrumbs } from './networkbreadcrumbs';\nexport { PageBreadcrumbs, pageBreadcrumbsIntegration } from './pagebreadcrumbs';\nexport { ConsoleBreadcrumbs, consoleBreadcrumbsIntegration } from './console';\nexport { SessionIntegration } from './session';\nexport { NetworkStatusIntegration } from './networkstatus';\nexport { MinigameIntegration, minigameIntegration } from './minigame';\nexport { MinigameFrameRateIntegration, minigameFrameRateIntegration } from './minigame-framerate';\n","import {\n  captureFeedback as captureFeedbackCore,\n  getClient,\n  getCurrentScope,\n  getIntegrationsToSetup,\n  initAndBind,\n  setContext,\n  stackParserFromStackParserOptions,\n  withScope,\n  eventFiltersIntegration,\n} from '@sentry/core';\nimport type { Integration } from '@sentry/core';\nimport { miniappStackParser } from './stacktrace';\nimport { setConsentGranted, isConsentGranted } from './consent';\nexport { getDiagnostics } from './diagnostics';\n\nimport { MiniappClient, setConfiguredDefaultIntegrationsMode } from './client';\nimport { isMiniappEnvironment, isMinigame, resolveMiniappPlatform } from './crossPlatform';\nimport {\n  GlobalHandlers,\n  TryCatch,\n  linkedErrorsIntegration,\n  HttpContext,\n  dedupeIntegration,\n  performanceIntegration,\n  rewriteFramesIntegration,\n  NetworkBreadcrumbs,\n  PageBreadcrumbs,\n  ConsoleBreadcrumbs,\n  SessionIntegration,\n  NetworkStatusIntegration,\n  MinigameIntegration,\n  MinigameFrameRateIntegration,\n} from './integrations/index';\nimport { functionToStringIntegration } from '@sentry/core';\nimport type { MiniappOptions, ReportDialogOptions, SendFeedbackParams } from './types';\n\n/**\n * 构造一组**全新**的默认集成实例。\n *\n * 必须每次 init 现造新实例：有全局副作用的集成会在实例上保存补丁与订阅状态。\n * core 的 `setupOnce` 只负责进程级初始化；每个 client 的安装与回收由 `setup(client)` /\n * `client.registerCleanup()` 配对，不再修改 core 内部的全局门禁。\n */\nexport function getDefaultIntegrations(options: MiniappOptions = {}): Integration[] {\n  const integrations: Integration[] = [\n    // Core integrations\n    functionToStringIntegration(),\n    new HttpContext(),\n    new GlobalHandlers(),\n    new TryCatch(),\n    linkedErrorsIntegration(),\n    dedupeIntegration(),\n    // Performance monitoring\n    performanceIntegration({\n      enableNavigation: true,\n      enableRender: true,\n      enableResource: true,\n      enableUserTiming: true,\n      sampleRate: 1.0,\n      reportInterval: 30000,\n    }),\n  ];\n\n  if (options.enableSourceMap !== false) {\n    integrations.push(rewriteFramesIntegration());\n  }\n\n  const networkOptions: Record<string, any> = { traceNetworkBody: options.traceNetworkBody };\n  if (options.enableTracePropagation !== undefined) {\n    networkOptions['enableTracePropagation'] = options.enableTracePropagation;\n  }\n  if (options.tracePropagationTargets !== undefined) {\n    networkOptions['tracePropagationTargets'] = options.tracePropagationTargets;\n  }\n  if (options.propagateTraceparent !== undefined) {\n    networkOptions['propagateTraceparent'] = options.propagateTraceparent;\n  }\n  if (options.enableStandaloneHttpSpans !== undefined) {\n    networkOptions['enableStandaloneHttpSpans'] = options.enableStandaloneHttpSpans;\n  }\n  integrations.push(new NetworkBreadcrumbs(networkOptions));\n\n  if (options.enableAutoSessionTracking !== false) {\n    integrations.push(new SessionIntegration());\n  }\n\n  const enablePageLifecycleBreadcrumbs = options.enableNavigationBreadcrumbs !== false;\n  const enableUserInteractionBreadcrumbs = options.enableUserInteractionBreadcrumbs !== false;\n  if (enablePageLifecycleBreadcrumbs || enableUserInteractionBreadcrumbs) {\n    integrations.push(\n      new PageBreadcrumbs({\n        enableLifecycle: enablePageLifecycleBreadcrumbs,\n        enableUserInteraction: enableUserInteractionBreadcrumbs,\n      }),\n    );\n  }\n\n  if (options.enableNetworkStatusMonitoring !== false) {\n    integrations.push(new NetworkStatusIntegration());\n  }\n\n  if (options.enableConsoleBreadcrumbs) {\n    integrations.push(new ConsoleBreadcrumbs());\n  }\n\n  const filterOptions: {\n    allowUrls?: Array<string | RegExp>;\n    denyUrls?: Array<string | RegExp>;\n    ignoreErrors?: Array<string | RegExp>;\n  } = {};\n  if (options.allowUrls) filterOptions.allowUrls = options.allowUrls;\n  if (options.denyUrls) filterOptions.denyUrls = options.denyUrls;\n  if (options.ignoreErrors) filterOptions.ignoreErrors = options.ignoreErrors;\n  integrations.push(eventFiltersIntegration(filterOptions));\n\n  // 两个小游戏开关都显式配置后，无需读取运行时环境。这也让下面的兼容快照可以在模块导入时\n  // 保持纯构造，不会提前填充平台检测缓存。\n  const minigame =\n    options.enableMinigameLifecycle === undefined || options.enableMinigameFrameRate === undefined\n      ? isMinigame()\n      : false;\n  if (\n    options.enableMinigameLifecycle === true ||\n    (minigame && options.enableMinigameLifecycle !== false)\n  ) {\n    integrations.push(new MinigameIntegration());\n  }\n  if (\n    options.enableMinigameFrameRate === true ||\n    (minigame && options.enableMinigameFrameRate !== false)\n  ) {\n    integrations.push(new MinigameFrameRateIntegration(options.minigameFrameRateOptions));\n  }\n\n  return integrations;\n}\n\n/**\n * @deprecated 直接复用本数组的实例，会在多次 init / 多 client 间共享 setupOnce 状态、互相踩补丁。\n * 请改用 {@link getDefaultIntegrations}（每次返回全新实例）。导出仅为向后兼容保留。\n * 静态快照不包含依赖运行时检测的小游戏默认集成，以免模块导入阶段提前缓存平台状态。\n */\nexport const defaultIntegrations: Integration[] = getDefaultIntegrations({\n  enableMinigameLifecycle: false,\n  enableMinigameFrameRate: false,\n});\n\nfunction removeGeneratedEventFiltersWhenInboundFiltersIsConfigured(\n  integrations: Integration[],\n  generatedEventFilters: Integration | undefined,\n): Integration[] {\n  if (\n    !generatedEventFilters ||\n    !integrations.some((integration) => integration.name === 'InboundFilters')\n  ) {\n    return integrations;\n  }\n\n  return integrations.filter((integration) => integration !== generatedEventFilters);\n}\n\n/**\n * Initialize the Sentry Miniapp SDK\n * @param options Configuration options for the SDK\n */\nexport function init(options: MiniappOptions = {}): MiniappClient | undefined {\n  if (!isMiniappEnvironment()) {\n    console.warn('[sentry-miniapp] Not running in a supported miniapp environment');\n    return undefined;\n  }\n\n  let configuredDefaultIntegrations: false | Integration[];\n  let generatedEventFilters: Integration | undefined;\n  if (options.defaultIntegrations == null) {\n    configuredDefaultIntegrations = getDefaultIntegrations(options);\n    generatedEventFilters = configuredDefaultIntegrations.find(\n      (integration) => integration.name === 'EventFilters',\n    );\n  } else {\n    configuredDefaultIntegrations = options.defaultIntegrations;\n  }\n  const integrationOptions: {\n    defaultIntegrations: false | Integration[];\n    integrations?: Integration[] | ((integrations: Integration[]) => Integration[]);\n  } = { defaultIntegrations: configuredDefaultIntegrations };\n  if (options.integrations !== undefined) {\n    integrationOptions.integrations = options.integrations;\n  }\n  const integrations = removeGeneratedEventFiltersWhenInboundFiltersIsConfigured(\n    getIntegrationsToSetup(integrationOptions),\n    generatedEventFilters,\n  );\n\n  const miniappPlatform = resolveMiniappPlatform(options);\n  const opts = {\n    ...options,\n    miniappPlatform,\n    defaultIntegrations: [],\n    integrations,\n    stackParser: stackParserFromStackParserOptions(options.stackParser ?? miniappStackParser),\n    transport: options.transport,\n  };\n  // 平台标记。device / os / app context 由 MiniappClient._prepareEvent 在每个事件上统一写入\n  // （唯一权威），此处不再重复设置，避免字段不一致与覆盖歧义（见架构 review P2-b）。\n  setContext('miniapp', {\n    platform: miniappPlatform,\n    environment: 'miniapp',\n  });\n\n  // initAndBind 的类型要求构造参数已是完整 ClientOptions，而 MiniappClient 刻意接收\n  // 更宽的公开 MiniappOptions，并在构造期间补齐 transport / stackParser，因此这里仅作边界适配。\n  initAndBind(MiniappClient as any, opts as any);\n  const client = getCurrentScope().getClient() as MiniappClient | undefined;\n  if (client) {\n    setConfiguredDefaultIntegrationsMode(client, options.defaultIntegrations);\n  }\n  return client;\n}\n\n/**\n * @deprecated Miniapp environment does not support Sentry's default HTML report dialog.\n * Please implement your own UI form to collect user feedback (name, email, comments)\n * and use `Sentry.captureFeedback()` to submit it to Sentry.\n *\n * 小程序环境不支持 Sentry 官方的 HTML 反馈弹窗。\n * 请自行实现 UI 表单收集用户反馈，并调用 `Sentry.captureFeedback()` 进行上报。\n */\nexport function showReportDialog(_options: ReportDialogOptions = {}): void {\n  console.warn(\n    '[sentry-miniapp] showReportDialog is deprecated and does nothing. ' +\n      'Please build your own UI and use `Sentry.captureFeedback()` instead.',\n  );\n}\n\n/**\n * Wrap a function to capture exceptions\n */\nexport function wrap<T extends (...args: any[]) => any>(fn: T): T {\n  return function (this: any, ...args: Parameters<T>) {\n    return withScope(() => {\n      try {\n        return fn.apply(this, args);\n      } catch (error) {\n        getCurrentScope().captureException(error, {\n          mechanism: {\n            type: 'instrument',\n            handled: false,\n            data: { function: 'wrap' },\n          },\n        });\n        throw error;\n      }\n    });\n  } as T;\n}\n\n/**\n * 设置用户对隐私协议的同意状态（配合 `init({ requireConsent: true })` 使用）。\n *\n * - `setConsent(true)`：补发「同意前」缓冲的事件，并恢复正常上报。\n * - `setConsent(false)`：重新闸断网络上报，后续事件继续进入本地缓冲。\n *\n * 未开启 `requireConsent` 时调用本函数无门禁副作用（门禁本就放行）。\n */\nexport function setConsent(granted: boolean): void {\n  setConsentGranted(granted);\n  if (granted) {\n    // 不传 timeout → 触发 core offline transport 立即排空缓冲队列（见 makeOfflineTransport.flush，\n    // 内部 retryDelay 复位 + flushIn(MIN_DELAY)）。fire-and-forget：排空走定时器，无需 await。\n    getClient()?.getTransport()?.flush?.();\n  }\n}\n\n/** 读取当前同意状态（未开启 requireConsent 时恒为 true）。 */\nexport function getConsent(): boolean {\n  return isConsentGranted();\n}\n\n/**\n * Capture feedback using the new feedback API.\n * 使用新的反馈 API 捕获反馈\n *\n * @param params Feedback parameters\n * @returns Event ID\n */\nexport function captureFeedback(params: SendFeedbackParams): string {\n  return captureFeedbackCore(params);\n}\n"],"x_google_ignoreList":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyJA,SAAS,IAAuB;CAC9B,IAAI,OAAO,aAAe,KACxB,OAAO;CAET,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAI,OAAO,OAAS,KAAa,OAAO;CAExC,IAAI;EACF,OAAO,SAAS,aAAa,CAAC,CAAC;CACjC,SAAS,GAAI;EAEX;CACF;AACF;AAMA,SAAgB,IAAyB;CACvC,IAAI;EACF,IAAM,IAAY,EAAgB;EAElC,IAAI,CAAC,GAAW;GACd,QAAQ,KACN,mFACF;GACA;EACF;EAGA,AAAW,EAAU,oBAAoB,WACvC,EAAU,kBAAkB;CAEhC,SAAS,GAAO;EACd,QAAQ,KAAK,iDAAiD,CAAK;CACrE;AACF;AAMA,SAAgB,IAAwB;CAGtC,EAAiB;AACnB;AAAA,IAAA,GAAA,IAAA,QAAA;CAhMM,IAAN,MAAM,EAAwB;EAG5B,YAAY,GAA+E;GACzF,IAH0C,KAAA,WAAA,CAAA,GAGtC,OAAO,KAAS,UAClB,KAAK,aAAa,CAAI;QACjB,IAAI,MAAM,QAAQ,CAAI,GACtB,KAAA,IAAM,KAAQ,GACj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