@cloudflare/vite-plugin 2.0.0-beta.sha-67fa336fd → 2.0.0-beta.v.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["isErrorEvent","DEBUG_BUILD","console","logger","DEBUG_BUILD","DEBUG_BUILD","handler","handler","handler","handler","resolve","getModule","parseStackFrames","exceptionFromError","isErrorEvent","ex","eventFromUnknownInput","eventFromMessage","resolve","setupIntegrations","setupIntegrations","isError","eventFromUnknownInput","eventFromMessage","#integrationsInitialized","#sdk","getModule","#options","sentry: ReturnType<typeof setupSentry> | undefined"],"sources":["../../../../workers-shared/utils/responses.ts","../../../../workers-shared/utils/tracing.ts","../../../../workers-shared/asset-worker/src/utils/rules-engine.ts","../../../../workers-shared/utils/performance.ts","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/is.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/string.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/version.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/worldwide.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/browser.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/debug-build.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/logger.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/dsn.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/error.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/object.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/stacktrace.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/instrument/handlers.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/time.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/instrument/globalError.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/instrument/globalUnhandledRejection.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/memo.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/misc.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/normalize.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/path.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/syncpromise.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/promisebuffer.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/node-stack-trace.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/envelope.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/ratelimit.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/eventbuilder.js","../../../../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/propagationContext.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/debug-build.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/carrier.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/session.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/utils/spanOnScope.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/scope.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/defaultScopes.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/asyncContext/stackStrategy.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/asyncContext/index.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/currentScopes.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/metrics/metric-summary.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/semanticAttributes.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/tracing/spanstatus.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/utils/spanUtils.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/tracing/errors.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/constants.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/utils/parseSampleRate.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/envelope.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/eventProcessors.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/utils/prepareEvent.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/sessionflusher.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/api.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/integration.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/baseclient.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/checkin.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/server-runtime-client.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/transports/base.js","../../../../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/integrations/rewriteframes.js","../../../../../node_modules/.pnpm/toucan-js@4.0.0_patch_hash=60bdb1dcdbde0a135bb56d6fa1a1027caba891b149e2cfcb48d6a5b3524e0a91/node_modules/toucan-js/dist/index.esm.js","../../../../workers-shared/utils/sentry.ts","../../../../workers-shared/router-worker/src/analytics.ts","../../../../workers-shared/router-worker/src/configuration.ts","../../../../workers-shared/router-worker/src/limited-response.ts","../../../../workers-shared/router-worker/src/worker.ts"],"sourcesContent":["export class OkResponse extends Response {\n\tstatic readonly status = 200;\n\n\tconstructor(body: BodyInit | null, init?: ResponseInit) {\n\t\tsuper(body, {\n\t\t\t...init,\n\t\t\tstatus: OkResponse.status,\n\t\t});\n\t}\n}\n\nexport class NotFoundResponse extends Response {\n\tstatic readonly status = 404;\n\n\tconstructor(...[body, init]: ConstructorParameters<typeof Response>) {\n\t\tsuper(body, {\n\t\t\t...init,\n\t\t\tstatus: NotFoundResponse.status,\n\t\t\tstatusText: \"Not Found\",\n\t\t});\n\t}\n}\n\n// A magical response type which is used to signal that a user worker should be invoked if one is present.\nexport class NoIntentResponse extends NotFoundResponse {\n\tconstructor() {\n\t\tsuper();\n\t}\n}\n\nexport class MethodNotAllowedResponse extends Response {\n\tstatic readonly status = 405;\n\n\tconstructor(...[body, init]: ConstructorParameters<typeof Response>) {\n\t\tsuper(body, {\n\t\t\t...init,\n\t\t\tstatus: MethodNotAllowedResponse.status,\n\t\t\tstatusText: \"Method Not Allowed\",\n\t\t});\n\t}\n}\n\nexport class InternalServerErrorResponse extends Response {\n\tstatic readonly status = 500;\n\n\tconstructor(_: Error, init?: ResponseInit) {\n\t\tsuper(null, {\n\t\t\t...init,\n\t\t\tstatus: InternalServerErrorResponse.status,\n\t\t});\n\t}\n}\n\nexport class NotModifiedResponse extends Response {\n\tstatic readonly status = 304;\n\n\tconstructor(...[_body, init]: ConstructorParameters<typeof Response>) {\n\t\tsuper(null, {\n\t\t\t...init,\n\t\t\tstatus: NotModifiedResponse.status,\n\t\t\tstatusText: \"Not Modified\",\n\t\t});\n\t}\n}\n\nexport class MovedPermanentlyResponse extends Response {\n\tstatic readonly status = 301;\n\n\tconstructor(location: string, init?: ResponseInit) {\n\t\tsuper(null, {\n\t\t\t...init,\n\t\t\tstatus: MovedPermanentlyResponse.status,\n\t\t\tstatusText: \"Moved Permanently\",\n\t\t\theaders: {\n\t\t\t\t...init?.headers,\n\t\t\t\tLocation: location,\n\t\t\t},\n\t\t});\n\t}\n}\n\nexport class FoundResponse extends Response {\n\tstatic readonly status = 302;\n\n\tconstructor(location: string, init?: ResponseInit) {\n\t\tsuper(null, {\n\t\t\t...init,\n\t\t\tstatus: FoundResponse.status,\n\t\t\tstatusText: \"Found\",\n\t\t\theaders: {\n\t\t\t\t...init?.headers,\n\t\t\t\tLocation: location,\n\t\t\t},\n\t\t});\n\t}\n}\n\nexport class SeeOtherResponse extends Response {\n\tstatic readonly status = 303;\n\n\tconstructor(location: string, init?: ResponseInit) {\n\t\tsuper(null, {\n\t\t\t...init,\n\t\t\tstatus: SeeOtherResponse.status,\n\t\t\tstatusText: \"See Other\",\n\t\t\theaders: {\n\t\t\t\t...init?.headers,\n\t\t\t\tLocation: location,\n\t\t\t},\n\t\t});\n\t}\n}\n\nexport class TemporaryRedirectResponse extends Response {\n\tstatic readonly status = 307;\n\n\tconstructor(location: string, init?: ResponseInit) {\n\t\tsuper(null, {\n\t\t\t...init,\n\t\t\tstatus: TemporaryRedirectResponse.status,\n\t\t\tstatusText: \"Temporary Redirect\",\n\t\t\theaders: {\n\t\t\t\t...init?.headers,\n\t\t\t\tLocation: location,\n\t\t\t},\n\t\t});\n\t}\n}\n\nexport class PermanentRedirectResponse extends Response {\n\tstatic readonly status = 308;\n\n\tconstructor(location: string, init?: ResponseInit) {\n\t\tsuper(null, {\n\t\t\t...init,\n\t\t\tstatus: PermanentRedirectResponse.status,\n\t\t\tstatusText: \"Permanent Redirect\",\n\t\t\theaders: {\n\t\t\t\t...init?.headers,\n\t\t\t\tLocation: location,\n\t\t\t},\n\t\t});\n\t}\n}\n","import type { JaegerTracing, Span } from \"./types\";\n\nexport function mockJaegerBindingSpan(): Span {\n\treturn {\n\t\taddLogs: () => {},\n\t\tsetTags: () => {},\n\t\tend: () => {},\n\t\tisRecording: true,\n\t};\n}\n\nexport function mockJaegerBinding(): JaegerTracing {\n\treturn {\n\t\tenterSpan: (_, span, ...args) => {\n\t\t\treturn span(mockJaegerBindingSpan(), ...args);\n\t\t},\n\t\tgetSpanContext: () => ({\n\t\t\ttraceId: \"test-trace\",\n\t\t\tspanId: \"test-span\",\n\t\t\tparentSpanId: \"test-parent-span\",\n\t\t\ttraceFlags: 0,\n\t\t}),\n\t\trunWithSpanContext: (_, callback, ...args) => {\n\t\t\treturn callback(...args);\n\t\t},\n\n\t\ttraceId: \"test-trace\",\n\t\tspanId: \"test-span\",\n\t\tparentSpanId: \"test-parent-span\",\n\t\tcfTraceIdHeader: \"test-trace:test-span:0\",\n\t};\n}\n","// Taken from https://stackoverflow.com/a/3561711\n// which is everything from the tc39 proposal, plus the following two characters: ^/\n// It's also everything included in the URLPattern escape (https://wicg.github.io/urlpattern/#escape-a-regexp-string), plus the following: -\n\nimport { REDIRECTS_VERSION } from \"../handler\";\nimport type { NormalizedAssetConfig } from \"../types\";\n\n// As the answer says, there's no downside to escaping these extra characters, so better safe than sorry\nconst ESCAPE_REGEX_CHARACTERS = /[-/\\\\^$*+?.()|[\\]{}]/g;\nconst escapeRegex = (str: string) => {\n\treturn str.replace(ESCAPE_REGEX_CHARACTERS, \"\\\\$&\");\n};\n\n// Placeholder names must begin with a colon then a letter, be alphanumeric and optionally contain underscores.\n// e.g. :place_123_holder\nconst HOST_PLACEHOLDER_REGEX =\n\t/(?<=^https:\\\\\\/\\\\\\/[^/]*?):([A-Za-z]\\w*)(?=\\\\)/g;\nconst PLACEHOLDER_REGEX = /:([A-Za-z]\\w*)/g;\n\nexport type Replacements = Record<string, string>;\n\nexport type Removals = string[];\n\nexport const replacer = (str: string, replacements: Replacements) => {\n\tfor (const [replacement, value] of Object.entries(replacements)) {\n\t\tstr = str.replaceAll(`:${replacement}`, value);\n\t}\n\treturn str;\n};\n\nexport const generateGlobOnlyRuleRegExp = (rule: string) => {\n\t// Escape all regex characters other than globs (the \"*\" character) since that's all that's supported.\n\trule = rule.split(\"*\").map(escapeRegex).join(\".*\");\n\n\t// Wrap in line terminators to be safe.\n\trule = \"^\" + rule + \"$\";\n\n\treturn RegExp(rule);\n};\n\nexport const generateRuleRegExp = (rule: string) => {\n\t// Create :splat capturer then escape.\n\trule = rule.split(\"*\").map(escapeRegex).join(\"(?<splat>.*)\");\n\n\t// Create :placeholder capturers (already escaped).\n\t// For placeholders in the host, we separate at forward slashes and periods.\n\t// For placeholders in the path, we separate at forward slashes.\n\t// This matches the behavior of URLPattern.\n\t// e.g. https://:subdomain.domain/ -> https://(here).domain/\n\t// e.g. /static/:file -> /static/(image.jpg)\n\t// e.g. /blog/:post -> /blog/(an-exciting-post)\n\tconst host_matches = rule.matchAll(HOST_PLACEHOLDER_REGEX);\n\tfor (const host_match of host_matches) {\n\t\trule = rule.split(host_match[0]).join(`(?<${host_match[1]}>[^/.]+)`);\n\t}\n\n\tconst path_matches = rule.matchAll(PLACEHOLDER_REGEX);\n\tfor (const path_match of path_matches) {\n\t\trule = rule.split(path_match[0]).join(`(?<${path_match[1]}>[^/]+)`);\n\t}\n\n\t// Wrap in line terminators to be safe.\n\trule = \"^\" + rule + \"$\";\n\n\treturn RegExp(rule);\n};\n\nexport const generateRulesMatcher = <T>(\n\trules?: Record<string, T>,\n\treplacerFn: (match: T, replacements: Replacements) => T = (match) => match\n) => {\n\tif (!rules) {\n\t\treturn () => [];\n\t}\n\n\tconst compiledRules = Object.entries(rules)\n\t\t.map(([rule, match]) => {\n\t\t\tconst crossHost = rule.startsWith(\"https://\");\n\n\t\t\ttry {\n\t\t\t\tconst regExp = generateRuleRegExp(rule);\n\t\t\t\treturn [{ crossHost, regExp }, match];\n\t\t\t} catch {}\n\t\t})\n\t\t.filter((value) => value !== undefined) as [\n\t\t{ crossHost: boolean; regExp: RegExp },\n\t\tT,\n\t][];\n\n\treturn ({ request }: { request: Request }) => {\n\t\tconst { pathname, hostname } = new URL(request.url);\n\n\t\treturn compiledRules\n\t\t\t.map(([{ crossHost, regExp }, match]) => {\n\t\t\t\t// This, rather confusingly, means that although we enforce `https://` protocols in\n\t\t\t\t// the rules of `_headers`/`_redirects`, we don't actually respect that at all at runtime.\n\t\t\t\t// When processing a request against an absolute URL rule, we rewrite the protocol to `https://`.\n\t\t\t\t// This has the benefit of ensuring attackers can't specify a different protocol\n\t\t\t\t// to circumvent a developer's security rules (e.g. CORS), but it isn't obvious behavior.\n\t\t\t\t// We should consider different syntax in the future for developers when they specify rules.\n\t\t\t\t// For example, `*://example.com/path`, `://example.com/path` or `//example.com/`.\n\t\t\t\t// Though we'd need to be careful with that last one\n\t\t\t\t// as that would currently be read as a relative URL.\n\t\t\t\t// Perhaps, if we ever move the `_headers`/`_redirects` files to acting ahead of Functions,\n\t\t\t\t// this might be a good time for this change.\n\t\t\t\tconst test = crossHost ? `https://${hostname}${pathname}` : pathname;\n\t\t\t\tconst result = regExp.exec(test);\n\t\t\t\tif (result) {\n\t\t\t\t\treturn replacerFn(match, result.groups || {});\n\t\t\t\t}\n\t\t\t})\n\t\t\t.filter((value) => value !== undefined) as T[];\n\t};\n};\n\nexport const staticRedirectsMatcher = (\n\tconfiguration: NormalizedAssetConfig,\n\thost: string,\n\tpathname: string\n) => {\n\tconst withHostMatch =\n\t\tconfiguration.redirects.staticRules[`https://${host}${pathname}`];\n\tconst withoutHostMatch = configuration.redirects.staticRules[pathname];\n\n\tif (withHostMatch && withoutHostMatch) {\n\t\tif (withHostMatch.lineNumber < withoutHostMatch.lineNumber) {\n\t\t\treturn withHostMatch;\n\t\t} else {\n\t\t\treturn withoutHostMatch;\n\t\t}\n\t}\n\n\treturn withHostMatch || withoutHostMatch;\n};\n\nexport const generateRedirectsMatcher = (\n\tconfiguration: NormalizedAssetConfig\n) =>\n\tgenerateRulesMatcher(\n\t\tconfiguration.redirects.version === REDIRECTS_VERSION\n\t\t\t? configuration.redirects.rules\n\t\t\t: {},\n\t\t({ status, to }, replacements) => {\n\t\t\tconst target = replacer(to, replacements).trim();\n\t\t\tconst protoPattern = /^(\\w+:\\/\\/)/;\n\t\t\tif (protoPattern.test(target)) {\n\t\t\t\t// External redirects are not modified.\n\t\t\t\treturn {\n\t\t\t\t\tstatus,\n\t\t\t\t\tto: target,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Relative redirects are modified to remove multiple slashes.\n\t\t\t\treturn {\n\t\t\t\t\tstatus,\n\t\t\t\t\tto: target.replace(/\\/+/g, \"/\"),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t);\n\nexport const generateStaticRoutingRuleMatcher =\n\t(rules: string[]) =>\n\t({ request }: { request: Request }) => {\n\t\tconst { pathname } = new URL(request.url);\n\t\tfor (const rule of rules) {\n\t\t\ttry {\n\t\t\t\tconst regExp = generateGlobOnlyRuleRegExp(rule);\n\t\t\t\tif (regExp.test(pathname)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t}\n\n\t\treturn false;\n\t};\n","import type { UnsafePerformanceTimer } from \"./types\";\n\nexport class PerformanceTimer {\n\tprivate performanceTimer;\n\n\tconstructor(performanceTimer?: UnsafePerformanceTimer) {\n\t\tthis.performanceTimer = performanceTimer;\n\t}\n\n\tnow() {\n\t\tif (this.performanceTimer) {\n\t\t\treturn this.performanceTimer.timeOrigin + this.performanceTimer.now();\n\t\t}\n\t\treturn Date.now();\n\t}\n}\n","// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isError(wat) {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat, className) {\n return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isErrorEvent(wat) {\n return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMError(wat) {\n return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMException(wat) {\n return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isString(wat) {\n return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given string is parameterized\n * {@link isParameterizedString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isParameterizedString(wat) {\n return (\n typeof wat === 'object' &&\n wat !== null &&\n '__sentry_template_string__' in wat &&\n '__sentry_template_values__' in wat\n );\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPrimitive(wat) {\n return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal, or a class instance.\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPlainObject(wat) {\n return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isEvent(wat) {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isElement(wat) {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isRegExp(wat) {\n return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nfunction isThenable(wat) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isSyntheticEvent(wat) {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nfunction isInstanceOf(wat, base) {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n\n/**\n * Checks whether given value's type is a Vue ViewModel.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isVueViewModel(wat) {\n // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.\n return !!(typeof wat === 'object' && wat !== null && ((wat ).__isVue || (wat )._isVue));\n}\n\nexport { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isString, isSyntheticEvent, isThenable, isVueViewModel };\n//# sourceMappingURL=is.js.map\n","import { isVueViewModel, isString, isRegExp } from './is.js';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\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}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\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 // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n // console warnings. This happens when a Vue template is rendered with\n // an undeclared variable, which we try to stringify, ultimately causing\n // Vue to issue another warning which repeats indefinitely.\n // see: https://github.com/getsentry/sentry-javascript/pull/8981\n if (isVueViewModel(value)) {\n output.push('[VueViewModel]');\n } else {\n output.push(String(value));\n }\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nfunction isMatchingPattern(\n value,\n pattern,\n requireExactStringMatch = false,\n) {\n if (!isString(value)) {\n return false;\n }\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\n return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nfunction stringMatchesSomePattern(\n testString,\n patterns = [],\n requireExactStringMatch = false,\n) {\n return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n\nexport { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate };\n//# sourceMappingURL=string.js.map\n","const SDK_VERSION = '8.9.2';\n\nexport { SDK_VERSION };\n//# sourceMappingURL=version.js.map\n","import { SDK_VERSION } from './version.js';\n\n/** Get's the global object for the current JavaScript runtime */\nconst GLOBAL_OBJ = globalThis ;\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__[]` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nfunction getGlobalSingleton(name, creator, obj) {\n const gbl = (obj || GLOBAL_OBJ) ;\n const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});\n const versionedCarrier = (__SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {});\n return versionedCarrier[name] || (versionedCarrier[name] = creator());\n}\n\nexport { GLOBAL_OBJ, getGlobalSingleton };\n//# sourceMappingURL=worldwide.js.map\n","import { isString } from './is.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nconst WINDOW = GLOBAL_OBJ ;\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction htmlTreeAsString(\n elem,\n options = {},\n) {\n if (!elem) {\n return '<unknown>';\n }\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem ;\n const MAX_TRAVERSE_HEIGHT = 5;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds maxStringLength\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '<unknown>';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el, keyAttrs) {\n const elem = el\n\n;\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n // @ts-expect-error WINDOW has HTMLElement\n if (WINDOW.HTMLElement) {\n // If using the component name annotation plugin, this value may be available on the DOM node\n if (elem instanceof HTMLElement && elem.dataset) {\n if (elem.dataset['sentryComponent']) {\n return elem.dataset['sentryComponent'];\n }\n if (elem.dataset['sentryElement']) {\n return elem.dataset['sentryElement'];\n }\n }\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs =\n keyAttrs && keyAttrs.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n }\n const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nfunction getLocationHref() {\n try {\n return WINDOW.document.location.href;\n } catch (oO) {\n return '';\n }\n}\n\n/**\n * Gets a DOM element by using document.querySelector.\n *\n * This wrapper will first check for the existance of the function before\n * actually calling it so that we don't have to take care of this check,\n * every time we want to access the DOM.\n *\n * Reason: DOM/querySelector is not available in all environments.\n *\n * We have to cast to any because utils can be consumed by a variety of environments,\n * and we don't want to break TS users. If you know what element will be selected by\n * `document.querySelector`, specify it as part of the generic call. For example,\n * `const element = getDomElement<Element>('selector');`\n *\n * @param selector the selector string passed on to document.querySelector\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getDomElement(selector) {\n if (WINDOW.document && WINDOW.document.querySelector) {\n return WINDOW.document.querySelector(selector) ;\n }\n return null;\n}\n\n/**\n * Given a DOM element, traverses up the tree until it finds the first ancestor node\n * that has the `data-sentry-component` or `data-sentry-element` attribute with `data-sentry-component` taking\n * precendence. This attribute is added at build-time by projects that have the component name annotation plugin installed.\n *\n * @returns a string representation of the component for the provided DOM element, or `null` if not found\n */\nfunction getComponentName(elem) {\n // @ts-expect-error WINDOW has HTMLElement\n if (!WINDOW.HTMLElement) {\n return null;\n }\n\n let currentElem = elem ;\n const MAX_TRAVERSE_HEIGHT = 5;\n for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) {\n if (!currentElem) {\n return null;\n }\n\n if (currentElem instanceof HTMLElement) {\n if (currentElem.dataset['sentryComponent']) {\n return currentElem.dataset['sentryComponent'];\n }\n if (currentElem.dataset['sentryElement']) {\n return currentElem.dataset['sentryElement'];\n }\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return null;\n}\n\nexport { getComponentName, getDomElement, getLocationHref, htmlTreeAsString };\n//# sourceMappingURL=browser.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nconst CONSOLE_LEVELS = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] ;\n\n/** This may be mutated by the console instrumentation. */\nconst originalConsoleMethods\n\n = {};\n\n/** JSDoc */\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nfunction consoleSandbox(callback) {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console ;\n const wrappedFuncs = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) ;\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level] ;\n wrappedFuncs[level] = console[level] ;\n console[level] = originalConsoleMethod;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] ;\n });\n }\n}\n\nfunction makeLogger() {\n let enabled = false;\n const logger = {\n enable: () => {\n enabled = true;\n },\n disable: () => {\n enabled = false;\n },\n isEnabled: () => enabled,\n };\n\n if (DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(name => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n logger[name] = (...args) => {\n if (enabled) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = () => undefined;\n });\n }\n\n return logger ;\n}\n\nconst logger = makeLogger();\n\nexport { CONSOLE_LEVELS, consoleSandbox, logger, originalConsoleMethods };\n//# sourceMappingURL=logger.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { consoleSandbox, logger } from './logger.js';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol) {\n return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nfunction dsnToString(dsn, withPassword = false) {\n const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n return (\n `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string\n */\nfunction dsnFromString(str) {\n const match = DSN_REGEX.exec(str);\n\n if (!match) {\n // This should be logged to the console\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(`Invalid Sentry Dsn: ${str}`);\n });\n return undefined;\n }\n\n const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);\n let path = '';\n let projectId = lastPath;\n\n const split = projectId.split('/');\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop() ;\n }\n\n if (projectId) {\n const projectMatch = projectId.match(/^\\d+/);\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey });\n}\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}\n\nfunction validateDsn(dsn) {\n if (!DEBUG_BUILD) {\n return true;\n }\n\n const { port, projectId, protocol } = dsn;\n\n const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];\n const hasMissingRequiredComponent = requiredComponents.find(component => {\n if (!dsn[component]) {\n logger.error(`Invalid Sentry Dsn: ${component} missing`);\n return true;\n }\n return false;\n });\n\n if (hasMissingRequiredComponent) {\n return false;\n }\n\n if (!projectId.match(/^\\d+$/)) {\n logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n return false;\n }\n\n if (!isValidProtocol(protocol)) {\n logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n return false;\n }\n\n if (port && isNaN(parseInt(port, 10))) {\n logger.error(`Invalid Sentry Dsn: Invalid port ${port}`);\n return false;\n }\n\n return true;\n}\n\n/**\n * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.\n * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source\n */\nfunction makeDsn(from) {\n const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n if (!components || !validateDsn(components)) {\n return undefined;\n }\n return components;\n}\n\nexport { dsnFromString, dsnToString, makeDsn };\n//# sourceMappingURL=dsn.js.map\n","/** An error emitted by Sentry SDKs and related utilities. */\nclass SentryError extends Error {\n /** Display name of this error instance. */\n\n constructor( message, logLevel = 'warn') {\n super(message);this.message = message;\n this.name = new.target.prototype.constructor.name;\n // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n // instances of `SentryError` fail `obj instanceof SentryError` checks.\n Object.setPrototypeOf(this, new.target.prototype);\n this.logLevel = logLevel;\n }\n}\n\nexport { SentryError };\n//# sourceMappingURL=error.js.map\n","import { htmlTreeAsString } from './browser.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { isError, isEvent, isInstanceOf, isElement, isPlainObject, isPrimitive } from './is.js';\nimport { logger } from './logger.js';\nimport { truncate } from './string.js';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other\n * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nfunction fill(source, name, replacementFactory) {\n if (!(name in source)) {\n return;\n }\n\n const original = source[name] ;\n const wrapped = replacementFactory(original) ;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (typeof wrapped === 'function') {\n markFunctionWrapped(wrapped, original);\n }\n\n source[name] = wrapped;\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\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: value,\n writable: true,\n configurable: true,\n });\n } catch (o_O) {\n DEBUG_BUILD && logger.log(`Failed to add non-enumerable property \"${name}\" to object`, obj);\n }\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\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 (o_O) {} // eslint-disable-line no-empty\n}\n\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\nfunction getOriginalFunction(func) {\n return func.__sentry_original__;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nfunction urlEncode(object) {\n return Object.keys(object)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n .join('&');\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor\n * an Error.\n */\nfunction convertToPlainObject(\n value,\n)\n\n {\n if (isError(value)) {\n return {\n message: value.message,\n name: value.name,\n stack: value.stack,\n ...getOwnProperties(value),\n };\n } else if (isEvent(value)) {\n const newObj\n\n = {\n type: value.type,\n target: serializeEventTarget(value.target),\n currentTarget: serializeEventTarget(value.currentTarget),\n ...getOwnProperties(value),\n };\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n newObj.detail = value.detail;\n }\n\n return newObj;\n } else {\n return value;\n }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target) {\n try {\n return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n } catch (_oO) {\n return '<unknown>';\n }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj) {\n if (typeof obj === 'object' && obj !== null) {\n const extractedProps = {};\n for (const property in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, property)) {\n extractedProps[property] = (obj )[property];\n }\n }\n return extractedProps;\n } else {\n return {};\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nfunction extractExceptionKeysForMessage(exception, maxLength = 40) {\n const keys = Object.keys(convertToPlainObject(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n */\nfunction dropUndefinedKeys(inputValue) {\n // This map keeps track of what already visited nodes map to.\n // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n // references as the input object.\n const memoizationMap = new Map();\n\n // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys(inputValue, memoizationMap) {\n if (isPojo(inputValue)) {\n // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal ;\n }\n\n const returnValue = {};\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n for (const key of Object.keys(inputValue)) {\n if (typeof inputValue[key] !== 'undefined') {\n returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);\n }\n }\n\n return returnValue ;\n }\n\n if (Array.isArray(inputValue)) {\n // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal ;\n }\n\n const returnValue = [];\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n inputValue.forEach((item) => {\n returnValue.push(_dropUndefinedKeys(item, memoizationMap));\n });\n\n return returnValue ;\n }\n\n return inputValue;\n}\n\nfunction isPojo(input) {\n if (!isPlainObject(input)) {\n return false;\n }\n\n try {\n const name = (Object.getPrototypeOf(input) ).constructor.name;\n return !name || name === 'Object';\n } catch (e) {\n return true;\n }\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nfunction objectify(wat) {\n let objectified;\n switch (true) {\n case wat === undefined || wat === null:\n objectified = new String(wat);\n break;\n\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\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new (wat ).constructor(wat);\n break;\n\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, urlEncode };\n//# sourceMappingURL=object.js.map\n","const STACKTRACE_FRAME_LIMIT = 50;\nconst UNKNOWN_FUNCTION = '?';\n// Used to sanitize webpack (error: *) wrapped stack errors\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\nconst STRIP_FRAME_REGEXP = /captureMessage|captureException/;\n\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\nfunction createStackParser(...parsers) {\n const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);\n\n return (stack, skipFirstLines = 0, framesToPop = 0) => {\n const frames = [];\n const lines = stack.split('\\n');\n\n for (let i = skipFirstLines; i < lines.length; i++) {\n const line = lines[i];\n // Ignore lines over 1kb as they are unlikely to be stack frames.\n // Many of the regular expressions use backtracking which results in run time that increases exponentially with\n // input size. Huge strings can result in hangs/Denial of Service:\n // https://github.com/getsentry/sentry-javascript/issues/2286\n if (line.length > 1024) {\n continue;\n }\n\n // https://github.com/getsentry/sentry-javascript/issues/5459\n // Remove webpack (error: *) wrappers\n const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n\n // https://github.com/getsentry/sentry-javascript/issues/7813\n // Skip Error: lines\n if (cleanedLine.match(/\\S*Error: /)) {\n continue;\n }\n\n for (const parser of sortedParsers) {\n const frame = parser(cleanedLine);\n\n if (frame) {\n frames.push(frame);\n break;\n }\n }\n\n if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) {\n break;\n }\n }\n\n return stripSentryFramesAndReverse(frames.slice(framesToPop));\n };\n}\n\n/**\n * Gets a stack parser implementation from Options.stackParser\n * @see Options\n *\n * If options contains an array of line parsers, it is converted into a parser\n */\nfunction stackParserFromStackParserOptions(stackParser) {\n if (Array.isArray(stackParser)) {\n return createStackParser(...stackParser);\n }\n return stackParser;\n}\n\n/**\n * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.\n * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the\n * function that caused the crash is the last frame in the array.\n * @hidden\n */\nfunction stripSentryFramesAndReverse(stack) {\n if (!stack.length) {\n return [];\n }\n\n const localStack = Array.from(stack);\n\n // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n if (/sentryWrapped/.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n\n // Reversing in the middle of the procedure allows us to just pop the values off the stack\n localStack.reverse();\n\n // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n\n // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')`\n // is produced within the hub itself, making it:\n //\n // Sentry.captureException()\n // getCurrentHub().captureException()\n //\n // instead of just the top `Sentry` call itself.\n // This forces us to possibly strip an additional frame in the exact same was as above.\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n }\n\n return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({\n ...frame,\n filename: frame.filename || localStack[localStack.length - 1].filename,\n function: frame.function || UNKNOWN_FUNCTION,\n }));\n}\n\nconst defaultFunctionName = '<anonymous>';\n\n/**\n * Safely extract function name from itself\n */\nfunction getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}\n\n/**\n * Get's stack frames from an event without needing to check for undefined properties.\n */\nfunction getFramesFromEvent(event) {\n const exception = event.exception;\n\n if (exception) {\n const frames = [];\n try {\n // @ts-expect-error Object could be undefined\n exception.values.forEach(value => {\n // @ts-expect-error Value could be undefined\n if (value.stacktrace.frames) {\n // @ts-expect-error Value could be undefined\n frames.push(...value.stacktrace.frames);\n }\n });\n return frames;\n } catch (_oO) {\n return undefined;\n }\n }\n return undefined;\n}\n\nexport { UNKNOWN_FUNCTION, createStackParser, getFramesFromEvent, getFunctionName, stackParserFromStackParserOptions, stripSentryFramesAndReverse };\n//# sourceMappingURL=stacktrace.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { logger } from '../logger.js';\nimport { getFunctionName } from '../stacktrace.js';\n\n// We keep the handlers globally\nconst handlers = {};\nconst instrumented = {};\n\n/** Add a handler function. */\nfunction addHandler(type, handler) {\n handlers[type] = handlers[type] || [];\n (handlers[type] ).push(handler);\n}\n\n/**\n * Reset all instrumentation handlers.\n * This can be used by tests to ensure we have a clean slate of instrumentation handlers.\n */\nfunction resetInstrumentationHandlers() {\n Object.keys(handlers).forEach(key => {\n handlers[key ] = undefined;\n });\n}\n\n/** Maybe run an instrumentation function, unless it was already called. */\nfunction maybeInstrument(type, instrumentFn) {\n if (!instrumented[type]) {\n instrumentFn();\n instrumented[type] = true;\n }\n}\n\n/** Trigger handlers for a given instrumentation type. */\nfunction triggerHandlers(type, data) {\n const typeHandlers = type && handlers[type];\n if (!typeHandlers) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n\nexport { addHandler, maybeInstrument, resetInstrumentationHandlers, triggerHandlers };\n//# sourceMappingURL=handlers.js.map\n","import { GLOBAL_OBJ } from './worldwide.js';\n\nconst ONE_SECOND_IN_MS = 1000;\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n *\n * TODO(v8): Return type should be rounded.\n */\nfunction dateTimestampInSeconds() {\n return Date.now() / ONE_SECOND_IN_MS;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction createUnixTimestampInSecondsFunc() {\n const { performance } = GLOBAL_OBJ ;\n if (!performance || !performance.now) {\n return dateTimestampInSeconds;\n }\n\n // Some browser and environments don't have a timeOrigin, so we fallback to\n // using Date.now() to compute the starting time.\n const approxStartingTimeOrigin = Date.now() - performance.now();\n const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin;\n\n // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current\n // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed.\n //\n // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the\n // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and\n // correct for this.\n // See: https://github.com/getsentry/sentry-javascript/issues/2590\n // See: https://github.com/mdn/content/issues/4713\n // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6\n return () => {\n return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS;\n };\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nconst timestampInSeconds = createUnixTimestampInSecondsFunc();\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nlet _browserPerformanceTimeOriginMode;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nconst browserPerformanceTimeOrigin = (() => {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n\n const { performance } = GLOBAL_OBJ ;\n if (!performance || !performance.now) {\n _browserPerformanceTimeOriginMode = 'none';\n return undefined;\n }\n\n const threshold = 3600 * 1000;\n const performanceNow = performance.now();\n const dateNow = Date.now();\n\n // if timeOrigin isn't available set delta to threshold so it isn't used\n const timeOriginDelta = performance.timeOrigin\n ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n : threshold;\n const timeOriginIsReliable = timeOriginDelta < threshold;\n\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n const navigationStart = performance.timing && performance.timing.navigationStart;\n const hasNavigationStart = typeof navigationStart === 'number';\n // if navigationStart isn't available set delta to threshold so it isn't used\n const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n const navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n _browserPerformanceTimeOriginMode = 'timeOrigin';\n return performance.timeOrigin;\n } else {\n _browserPerformanceTimeOriginMode = 'navigationStart';\n return navigationStart;\n }\n }\n\n // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n _browserPerformanceTimeOriginMode = 'dateNow';\n return dateNow;\n})();\n\nexport { _browserPerformanceTimeOriginMode, browserPerformanceTimeOrigin, dateTimestampInSeconds, timestampInSeconds };\n//# sourceMappingURL=time.js.map\n","import { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';\n\nlet _oldOnErrorHandler = null;\n\n/**\n * Add an instrumentation handler for when an error is captured by the global error handler.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addGlobalErrorInstrumentationHandler(handler) {\n const type = 'error';\n addHandler(type, handler);\n maybeInstrument(type, instrumentError);\n}\n\nfunction instrumentError() {\n _oldOnErrorHandler = GLOBAL_OBJ.onerror;\n\n GLOBAL_OBJ.onerror = function (\n msg,\n url,\n line,\n column,\n error,\n ) {\n const handlerData = {\n column,\n error,\n line,\n msg,\n url,\n };\n triggerHandlers('error', handlerData);\n\n if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n\n GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;\n}\n\nexport { addGlobalErrorInstrumentationHandler };\n//# sourceMappingURL=globalError.js.map\n","import { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';\n\nlet _oldOnUnhandledRejectionHandler = null;\n\n/**\n * Add an instrumentation handler for when an unhandled promise rejection is captured.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addGlobalUnhandledRejectionInstrumentationHandler(\n handler,\n) {\n const type = 'unhandledrejection';\n addHandler(type, handler);\n maybeInstrument(type, instrumentUnhandledRejection);\n}\n\nfunction instrumentUnhandledRejection() {\n _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection;\n\n GLOBAL_OBJ.onunhandledrejection = function (e) {\n const handlerData = e;\n triggerHandlers('unhandledrejection', handlerData);\n\n if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n\n GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;\n}\n\nexport { addGlobalUnhandledRejectionInstrumentationHandler };\n//# sourceMappingURL=globalUnhandledRejection.js.map\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Helper to decycle json objects\n */\nfunction memoBuilder() {\n const hasWeakSet = typeof WeakSet === 'function';\n const inner = hasWeakSet ? new WeakSet() : [];\n function memoize(obj) {\n if (hasWeakSet) {\n if (inner.has(obj)) {\n return true;\n }\n inner.add(obj);\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < inner.length; i++) {\n const value = inner[i];\n if (value === obj) {\n return true;\n }\n }\n inner.push(obj);\n return false;\n }\n\n function unmemoize(obj) {\n if (hasWeakSet) {\n inner.delete(obj);\n } else {\n for (let i = 0; i < inner.length; i++) {\n if (inner[i] === obj) {\n inner.splice(i, 1);\n break;\n }\n }\n }\n }\n return [memoize, unmemoize];\n}\n\nexport { memoBuilder };\n//# sourceMappingURL=memo.js.map\n","import { addNonEnumerableProperty } from './object.js';\nimport { snipLine } from './string.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nfunction uuid4() {\n const gbl = GLOBAL_OBJ ;\n const crypto = gbl.crypto || gbl.msCrypto;\n\n let getRandomByte = () => Math.random() * 16;\n try {\n if (crypto && crypto.randomUUID) {\n return crypto.randomUUID().replace(/-/g, '');\n }\n if (crypto && crypto.getRandomValues) {\n getRandomByte = () => {\n // crypto.getRandomValues might return undefined instead of the typed array\n // in old Chromium versions (e.g. 23.0.1235.0 (151422))\n // However, `typedArray` is still filled in-place.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray\n const typedArray = new Uint8Array(1);\n crypto.getRandomValues(typedArray);\n return typedArray[0];\n };\n }\n } catch (_) {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, 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 && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nfunction getEventDescription(event) {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\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}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\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}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nfunction addExceptionMechanism(event, newMechanism) {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nfunction parseSemver(input) {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nfunction addContextToFrame(lines, frame, linesOfContext = 5) {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nfunction checkOrSetAlreadyCaught(exception) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && (exception ).__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception , '__sentry_captured__', true);\n } catch (err) {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nfunction arrayify(maybeArray) {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n\nexport { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, arrayify, checkOrSetAlreadyCaught, getEventDescription, parseSemver, uuid4 };\n//# sourceMappingURL=misc.js.map\n","import { isVueViewModel, isSyntheticEvent } from './is.js';\nimport { memoBuilder } from './memo.js';\nimport { convertToPlainObject } from './object.js';\nimport { getFunctionName } from './stacktrace.js';\n\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output.\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction normalize(input, depth = 100, maxProperties = +Infinity) {\n try {\n // since we're at the outermost level, we don't provide a key\n return visit('', input, depth, maxProperties);\n } catch (err) {\n return { ERROR: `**non-serializable** (${err})` };\n }\n}\n\n/** JSDoc */\nfunction normalizeToSize(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n object,\n // Default Node.js REPL depth\n depth = 3,\n // 100kB, as 200kB is max payload size, so half sounds reasonable\n maxSize = 100 * 1024,\n) {\n const normalized = normalize(object, depth);\n\n if (jsonSize(normalized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return normalized ;\n}\n\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\nfunction visit(\n key,\n value,\n depth = +Infinity,\n maxProperties = +Infinity,\n memo = memoBuilder(),\n) {\n const [memoize, unmemoize] = memo;\n\n // Get the simple cases out of the way first\n if (\n value == null || // this matches null and undefined -> eqeq not eqeqeq\n (['number', 'boolean', 'string'].includes(typeof value) && !Number.isNaN(value))\n ) {\n return value ;\n }\n\n const stringified = stringifyValue(key, value);\n\n // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n if (!stringified.startsWith('[object ')) {\n return stringified;\n }\n\n // From here on, we can assert that `value` is either an object or an array.\n\n // Do not normalize objects that we know have already been normalized. As a general rule, the\n // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n // have already been normalized.\n if ((value )['__sentry_skip_normalization__']) {\n return value ;\n }\n\n // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there\n // We keep a certain amount of depth.\n // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state.\n const remainingDepth =\n typeof (value )['__sentry_override_normalization_depth__'] === 'number'\n ? ((value )['__sentry_override_normalization_depth__'] )\n : depth;\n\n // We're also done if we've reached the max depth\n if (remainingDepth === 0) {\n // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n return stringified.replace('object ', '');\n }\n\n // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n if (memoize(value)) {\n return '[Circular ~]';\n }\n\n // If the value has a `toJSON` method, we call it to extract more information\n const valueWithToJSON = value ;\n if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n try {\n const jsonValue = valueWithToJSON.toJSON();\n // We need to normalize the return value of `.toJSON()` in case it has circular references\n return visit('', jsonValue, remainingDepth - 1, maxProperties, memo);\n } catch (err) {\n // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n }\n }\n\n // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n // property/entry, and keep track of the number of items we add to it.\n const normalized = (Array.isArray(value) ? [] : {}) ;\n let numAdded = 0;\n\n // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n // properties are non-enumerable and otherwise would get missed.\n const visitable = convertToPlainObject(value );\n\n for (const visitKey in visitable) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n continue;\n }\n\n if (numAdded >= maxProperties) {\n normalized[visitKey] = '[MaxProperties ~]';\n break;\n }\n\n // Recursively visit all the child nodes\n const visitValue = visitable[visitKey];\n normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);\n\n numAdded++;\n }\n\n // Once we've visited all the branches, remove the parent from memo storage\n unmemoize(value);\n\n // Return accumulated values\n return normalized;\n}\n\n/* eslint-disable complexity */\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\nfunction stringifyValue(\n key,\n // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n // our internal use, it'll do\n value,\n) {\n try {\n if (key === 'domain' && value && typeof value === 'object' && (value )._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n // which won't throw if they are not present.\n\n if (typeof global !== 'undefined' && value === global) {\n return '[Global]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n }\n\n if (isVueViewModel(value)) {\n return '[VueViewModel]';\n }\n\n // React's SyntheticEvent thingy\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (typeof value === 'function') {\n return `[Function: ${getFunctionName(value)}]`;\n }\n\n if (typeof value === 'symbol') {\n return `[${String(value)}]`;\n }\n\n // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n if (typeof value === 'bigint') {\n return `[BigInt: ${String(value)}]`;\n }\n\n // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n // we can make sure that only plain objects come out that way.\n const objName = getConstructorName(value);\n\n // Handle HTML Elements\n if (/^HTML(\\w*)Element$/.test(objName)) {\n return `[HTMLElement: ${objName}]`;\n }\n\n return `[object ${objName}]`;\n } catch (err) {\n return `**non-serializable** (${err})`;\n }\n}\n/* eslint-enable complexity */\n\nfunction getConstructorName(value) {\n const prototype = Object.getPrototypeOf(value);\n\n return prototype ? prototype.constructor.name : 'null prototype';\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value) {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction jsonSize(value) {\n return utf8Length(JSON.stringify(value));\n}\n\n/**\n * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint\n * across platforms and working directory.\n *\n * @param url The URL to be normalized.\n * @param basePath The application base path.\n * @returns The normalized URL.\n */\nfunction normalizeUrlToBase(url, basePath) {\n const escapedBase = basePath\n // Backslash to forward\n .replace(/\\\\/g, '/')\n // Escape RegExp special characters\n .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n\n let newUrl = url;\n try {\n newUrl = decodeURI(url);\n } catch (_Oo) {\n // Sometime this breaks\n }\n return (\n newUrl\n .replace(/\\\\/g, '/')\n .replace(/webpack:\\/?/g, '') // Remove intermediate base path\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///')\n );\n}\n\nexport { normalize, normalizeToSize, normalizeUrlToBase };\n//# sourceMappingURL=normalize.js.map\n","// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript\n// https://github.com/calvinmetcalf/rollup-plugin-node-builtins/blob/63ab8aacd013767445ca299e468d9a60a95328d7/src/es6/path.js\n//\n// Copyright Joyent, Inc.and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n/** JSDoc */\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\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\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nconst splitPathRe = /^(\\S+:\\\\|\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^/\\\\]+?|)(\\.[^./\\\\]*|))(?:[/\\\\]*)$/;\n/** JSDoc */\nfunction splitPath(filename) {\n // Truncate files names greater than 1024 characters to avoid regex dos\n // https://github.com/getsentry/sentry-javascript/pull/8737#discussion_r1285719172\n const truncated = filename.length > 1024 ? `<truncated>${filename.slice(-1024)}` : filename;\n const parts = splitPathRe.exec(truncated);\n return parts ? parts.slice(1) : [];\n}\n\n// path.resolve([from ...], to)\n// posix version\n/** JSDoc */\nfunction resolve(...args) {\n let resolvedPath = '';\n let resolvedAbsolute = false;\n\n for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n const path = i >= 0 ? args[i] : '/';\n\n // Skip empty entries\n if (!path) {\n continue;\n }\n\n resolvedPath = `${path}/${resolvedPath}`;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(\n resolvedPath.split('/').filter(p => !!p),\n !resolvedAbsolute,\n ).join('/');\n\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}\n\n/** JSDoc */\nfunction trim(arr) {\n let start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') {\n break;\n }\n }\n\n let end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') {\n break;\n }\n }\n\n if (start > end) {\n return [];\n }\n return arr.slice(start, end - start + 1);\n}\n\n// path.relative(from, to)\n// posix version\n/** JSDoc */\nfunction relative(from, to) {\n /* eslint-disable no-param-reassign */\n from = resolve(from).slice(1);\n to = resolve(to).slice(1);\n /* eslint-enable no-param-reassign */\n\n const fromParts = trim(from.split('/'));\n const toParts = trim(to.split('/'));\n\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\n let outputParts = [];\n for (let i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}\n\n// path.normalize(path)\n// posix version\n/** JSDoc */\nfunction normalizePath(path) {\n const isPathAbsolute = isAbsolute(path);\n const trailingSlash = path.slice(-1) === '/';\n\n // Normalize the path\n let normalizedPath = normalizeArray(\n path.split('/').filter(p => !!p),\n !isPathAbsolute,\n ).join('/');\n\n if (!normalizedPath && !isPathAbsolute) {\n normalizedPath = '.';\n }\n if (normalizedPath && trailingSlash) {\n normalizedPath += '/';\n }\n\n return (isPathAbsolute ? '/' : '') + normalizedPath;\n}\n\n// posix version\n/** JSDoc */\nfunction isAbsolute(path) {\n return path.charAt(0) === '/';\n}\n\n// posix version\n/** JSDoc */\nfunction join(...args) {\n return normalizePath(args.join('/'));\n}\n\n/** JSDoc */\nfunction dirname(path) {\n const result = splitPath(path);\n const root = result[0];\n let dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.slice(0, dir.length - 1);\n }\n\n return root + dir;\n}\n\n/** JSDoc */\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 { isThenable } from './is.js';\n\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/** SyncPromise internal states */\nvar States; (function (States) {\n /** Pending */\n const PENDING = 0; States[States[\"PENDING\"] = PENDING] = \"PENDING\";\n /** Resolved / OK */\n const RESOLVED = 1; States[States[\"RESOLVED\"] = RESOLVED] = \"RESOLVED\";\n /** Rejected / Error */\n const REJECTED = 2; States[States[\"REJECTED\"] = REJECTED] = \"REJECTED\";\n})(States || (States = {}));\n\n// Overloads so we can call resolvedSyncPromise without arguments and generic argument\n\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\nfunction resolvedSyncPromise(value) {\n return new SyncPromise(resolve => {\n resolve(value);\n });\n}\n\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\nfunction rejectedSyncPromise(reason) {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise {\n\n constructor(\n executor,\n ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this);\n this._state = States.PENDING;\n this._handlers = [];\n\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n\n /** JSDoc */\n then(\n onfulfilled,\n onrejected,\n ) {\n return new SyncPromise((resolve, reject) => {\n this._handlers.push([\n false,\n result => {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\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\n /** JSDoc */\n catch(\n onrejected,\n ) {\n return this.then(val => val, onrejected);\n }\n\n /** JSDoc */\n finally(onfinally) {\n return new SyncPromise((resolve, reject) => {\n let val;\n let isRejected;\n\n return this.then(\n value => {\n isRejected = false;\n val = value;\n if (onfinally) {\n onfinally();\n }\n },\n reason => {\n isRejected = true;\n val = reason;\n if (onfinally) {\n onfinally();\n }\n },\n ).then(() => {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve(val );\n });\n });\n }\n\n /** JSDoc */\n __init() {this._resolve = (value) => {\n this._setResult(States.RESOLVED, value);\n };}\n\n /** JSDoc */\n __init2() {this._reject = (reason) => {\n this._setResult(States.REJECTED, reason);\n };}\n\n /** JSDoc */\n __init3() {this._setResult = (state, value) => {\n if (this._state !== States.PENDING) {\n return;\n }\n\n if (isThenable(value)) {\n void (value ).then(this._resolve, this._reject);\n return;\n }\n\n this._state = state;\n this._value = value;\n\n this._executeHandlers();\n };}\n\n /** JSDoc */\n __init4() {this._executeHandlers = () => {\n if (this._state === States.PENDING) {\n return;\n }\n\n const cachedHandlers = this._handlers.slice();\n this._handlers = [];\n\n cachedHandlers.forEach(handler => {\n if (handler[0]) {\n return;\n }\n\n if (this._state === States.RESOLVED) {\n handler[1](this._value );\n }\n\n if (this._state === States.REJECTED) {\n handler[2](this._value);\n }\n\n handler[0] = true;\n });\n };}\n}\n\nexport { SyncPromise, rejectedSyncPromise, resolvedSyncPromise };\n//# sourceMappingURL=syncpromise.js.map\n","import { SentryError } from './error.js';\nimport { rejectedSyncPromise, SyncPromise, resolvedSyncPromise } from './syncpromise.js';\n\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\nfunction makePromiseBuffer(limit) {\n const buffer = [];\n\n function isReady() {\n return limit === undefined || buffer.length < limit;\n }\n\n /**\n * Remove a promise from the queue.\n *\n * @param task Can be any PromiseLike<T>\n * @returns Removed promise.\n */\n function remove(task) {\n return buffer.splice(buffer.indexOf(task), 1)[0];\n }\n\n /**\n * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n *\n * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task:\n * PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor\n * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n * limit check.\n * @returns The original promise.\n */\n function add(taskProducer) {\n if (!isReady()) {\n return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));\n }\n\n // start the task and add its promise to the queue\n const task = taskProducer();\n if (buffer.indexOf(task) === -1) {\n buffer.push(task);\n }\n void task\n .then(() => remove(task))\n // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n // have promises, so TS has to polyfill when down-compiling.)\n .then(null, () =>\n remove(task).then(null, () => {\n // We have to add another catch here because `remove()` starts a new promise chain.\n }),\n );\n return task;\n }\n\n /**\n * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n * `false` otherwise\n */\n function drain(timeout) {\n return new SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void resolvedSyncPromise(item).then(() => {\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }\n\n return {\n $: buffer,\n add,\n drain,\n };\n}\n\nexport { makePromiseBuffer };\n//# sourceMappingURL=promisebuffer.js.map\n","import { UNKNOWN_FUNCTION } from './stacktrace.js';\n\n/**\n * Does this filename look like it's part of the app code?\n */\nfunction filenameIsInApp(filename, isNative = false) {\n const isInternal =\n isNative ||\n (filename &&\n // It's not internal if it's an absolute linux path\n !filename.startsWith('/') &&\n // It's not internal if it's an absolute windows path\n !filename.match(/^[A-Z]:/) &&\n // It's not internal if the path is starting with a dot\n !filename.startsWith('.') &&\n // It's not internal if the frame has a protocol. In node, this is usually the case if the file got pre-processed with a bundler like webpack\n !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\\-+])*:\\/\\//)); // Schema from: https://stackoverflow.com/a/3641782\n\n // in_app is all that's not an internal Node function or a module within node_modules\n // note that isNative appears to return true even for node core libraries\n // see https://github.com/getsentry/raven-node/issues/176\n\n return !isInternal && filename !== undefined && !filename.includes('node_modules/');\n}\n\n/** Node Stack line parser */\nfunction node(getModule) {\n const FILENAME_MATCH = /^\\s*[-]{4,}$/;\n const FULL_MATCH = /at (?:async )?(?:(.+?)\\s+\\()?(?:(.+):(\\d+):(\\d+)?|([^)]+))\\)?/;\n\n // eslint-disable-next-line complexity\n return (line) => {\n const lineMatch = line.match(FULL_MATCH);\n\n if (lineMatch) {\n let object;\n let method;\n let functionName;\n let typeName;\n let methodName;\n\n if (lineMatch[1]) {\n functionName = lineMatch[1];\n\n let methodStart = functionName.lastIndexOf('.');\n if (functionName[methodStart - 1] === '.') {\n methodStart--;\n }\n\n if (methodStart > 0) {\n object = functionName.slice(0, methodStart);\n method = functionName.slice(methodStart + 1);\n const objectEnd = object.indexOf('.Module');\n if (objectEnd > 0) {\n functionName = functionName.slice(objectEnd + 1);\n object = object.slice(0, objectEnd);\n }\n }\n typeName = undefined;\n }\n\n if (method) {\n typeName = object;\n methodName = method;\n }\n\n if (method === '<anonymous>') {\n methodName = undefined;\n functionName = undefined;\n }\n\n if (functionName === undefined) {\n methodName = methodName || UNKNOWN_FUNCTION;\n functionName = typeName ? `${typeName}.${methodName}` : methodName;\n }\n\n let filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2];\n const isNative = lineMatch[5] === 'native';\n\n // If it's a Windows path, trim the leading slash so that `/C:/foo` becomes `C:/foo`\n if (filename && filename.match(/\\/[A-Z]:/)) {\n filename = filename.slice(1);\n }\n\n if (!filename && lineMatch[5] && !isNative) {\n filename = lineMatch[5];\n }\n\n return {\n filename,\n module: getModule ? getModule(filename) : undefined,\n function: functionName,\n lineno: parseInt(lineMatch[3], 10) || undefined,\n colno: parseInt(lineMatch[4], 10) || undefined,\n in_app: filenameIsInApp(filename, isNative),\n };\n }\n\n if (line.match(FILENAME_MATCH)) {\n return {\n filename: line,\n };\n }\n\n return undefined;\n };\n}\n\n/**\n * Node.js stack line parser\n *\n * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.\n * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain\n */\nfunction nodeStackLineParser(getModule) {\n return [90, node(getModule)];\n}\n\nexport { filenameIsInApp, node, nodeStackLineParser };\n//# sourceMappingURL=node-stack-trace.js.map\n","import { dsnToString } from './dsn.js';\nimport { normalize } from './normalize.js';\nimport { dropUndefinedKeys } from './object.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/**\n * Creates an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nfunction createEnvelope(headers, items = []) {\n return [headers, items] ;\n}\n\n/**\n * Add an item to an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nfunction addItemToEnvelope(envelope, newItem) {\n const [headers, items] = envelope;\n return [headers, [...items, newItem]] ;\n}\n\n/**\n * Convenience function to loop through the items and item types of an envelope.\n * (This function was mostly created because working with envelope types is painful at the moment)\n *\n * If the callback returns true, the rest of the items will be skipped.\n */\nfunction forEachEnvelopeItem(\n envelope,\n callback,\n) {\n const envelopeItems = envelope[1];\n\n for (const envelopeItem of envelopeItems) {\n const envelopeItemType = envelopeItem[0].type;\n const result = callback(envelopeItem, envelopeItemType);\n\n if (result) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Returns true if the envelope contains any of the given envelope item types\n */\nfunction envelopeContainsItemType(envelope, types) {\n return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));\n}\n\n/**\n * Encode a string to UTF8 array.\n */\nfunction encodeUTF8(input) {\n return GLOBAL_OBJ.__SENTRY__ && GLOBAL_OBJ.__SENTRY__.encodePolyfill\n ? GLOBAL_OBJ.__SENTRY__.encodePolyfill(input)\n : new TextEncoder().encode(input);\n}\n\n/**\n * Decode a UTF8 array to string.\n */\nfunction decodeUTF8(input) {\n return GLOBAL_OBJ.__SENTRY__ && GLOBAL_OBJ.__SENTRY__.decodePolyfill\n ? GLOBAL_OBJ.__SENTRY__.decodePolyfill(input)\n : new TextDecoder().decode(input);\n}\n\n/**\n * Serializes an envelope.\n */\nfunction serializeEnvelope(envelope) {\n const [envHeaders, items] = envelope;\n\n // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data\n let parts = JSON.stringify(envHeaders);\n\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\n for (const item of items) {\n const [itemHeaders, payload] = item;\n\n append(`\\n${JSON.stringify(itemHeaders)}\\n`);\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 (e) {\n // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still\n // fails, we try again after normalizing it again with infinite normalization depth. This of course has a\n // performance impact but in this case a performance hit is better than throwing.\n stringifiedPayload = JSON.stringify(normalize(payload));\n }\n append(stringifiedPayload);\n }\n }\n\n return typeof parts === 'string' ? parts : concatBuffers(parts);\n}\n\nfunction concatBuffers(buffers) {\n const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);\n\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\n return merged;\n}\n\n/**\n * Parses an envelope\n */\nfunction parseEnvelope(env) {\n let buffer = typeof env === 'string' ? encodeUTF8(env) : env;\n\n function readBinary(length) {\n const bin = buffer.subarray(0, length);\n // Replace the buffer with the remaining data excluding trailing newline\n buffer = buffer.subarray(length + 1);\n return bin;\n }\n\n function readJson() {\n let i = buffer.indexOf(0xa);\n // If we couldn't find a newline, we must have found the end of the buffer\n if (i < 0) {\n i = buffer.length;\n }\n\n return JSON.parse(decodeUTF8(readBinary(i))) ;\n }\n\n const envelopeHeader = readJson();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const items = [];\n\n while (buffer.length) {\n const itemHeader = readJson();\n const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;\n\n items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);\n }\n\n return [envelopeHeader, items];\n}\n\n/**\n * Creates envelope item for a single span\n */\nfunction createSpanEnvelopeItem(spanJson) {\n const spanHeaders = {\n type: 'span',\n };\n\n return [spanHeaders, spanJson];\n}\n\n/**\n * Creates attachment envelope items\n */\nfunction createAttachmentEnvelopeItem(attachment) {\n const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data) : attachment.data;\n\n return [\n dropUndefinedKeys({\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}\n\nconst ITEM_TYPE_TO_DATA_CATEGORY_MAP = {\n session: 'session',\n sessions: 'session',\n attachment: 'attachment',\n transaction: 'transaction',\n event: 'error',\n client_report: 'internal',\n user_report: 'default',\n profile: 'profile',\n profile_chunk: 'profile',\n replay_event: 'replay',\n replay_recording: 'replay',\n check_in: 'monitor',\n feedback: 'feedback',\n span: 'span',\n statsd: 'metric_bucket',\n};\n\n/**\n * Maps the type of an envelope item to a data category.\n */\nfunction envelopeItemTypeToDataCategory(type) {\n return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];\n}\n\n/** Extracts the minimal SDK info from the metadata or an events */\nfunction getSdkMetadataForEnvelopeHeader(metadataOrEvent) {\n if (!metadataOrEvent || !metadataOrEvent.sdk) {\n return;\n }\n const { name, version } = metadataOrEvent.sdk;\n return { name, version };\n}\n\n/**\n * Creates event envelope headers, based on event, sdk info and tunnel\n * Note: This function was extracted from the core package to make it available in Replay\n */\nfunction createEventEnvelopeHeaders(\n event,\n sdkInfo,\n tunnel,\n dsn,\n) {\n const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;\n return {\n event_id: event.event_id ,\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n ...(dynamicSamplingContext && {\n trace: dropUndefinedKeys({ ...dynamicSamplingContext }),\n }),\n };\n}\n\nexport { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, createEventEnvelopeHeaders, createSpanEnvelopeItem, envelopeContainsItemType, envelopeItemTypeToDataCategory, forEachEnvelopeItem, getSdkMetadataForEnvelopeHeader, parseEnvelope, serializeEnvelope };\n//# sourceMappingURL=envelope.js.map\n","// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend\n\nconst DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\nfunction parseRetryAfterHeader(header, now = Date.now()) {\n const headerDelay = parseInt(`${header}`, 10);\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n const headerDate = Date.parse(`${header}`);\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return DEFAULT_RETRY_AFTER;\n}\n\n/**\n * Gets the time that the given category is disabled until for rate limiting.\n * In case no category-specific limit is set but a general rate limit across all categories is active,\n * that time is returned.\n *\n * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.\n */\nfunction disabledUntil(limits, dataCategory) {\n return limits[dataCategory] || limits.all || 0;\n}\n\n/**\n * Checks if a category is rate limited\n */\nfunction isRateLimited(limits, dataCategory, now = Date.now()) {\n return disabledUntil(limits, dataCategory) > now;\n}\n\n/**\n * Update ratelimits from incoming headers.\n *\n * @return the updated RateLimits object.\n */\nfunction updateRateLimits(\n limits,\n { statusCode, headers },\n now = Date.now(),\n) {\n const updatedRateLimits = {\n ...limits,\n };\n\n // \"The name is case-insensitive.\"\n // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n const rateLimitHeader = headers && headers['x-sentry-rate-limits'];\n const retryAfterHeader = headers && headers['retry-after'];\n\n if (rateLimitHeader) {\n /**\n * rate limit headers are of the form\n * <header>,<header>,..\n * where each <header> is of the form\n * <retry_after>: <categories>: <scope>: <reason_code>: <namespaces>\n * where\n * <retry_after> is a delay in seconds\n * <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form\n * <category>;<category>;...\n * <scope> is what's being limited (org, project, or key) - ignored by SDK\n * <reason_code> is an arbitrary string like \"org_quota\" - ignored by SDK\n * <namespaces> Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected.\n * Only present if rate limit applies to the metric_bucket data category.\n */\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) * 1000; // 60sec default\n if (!categories) {\n updatedRateLimits.all = now + delay;\n } else {\n for (const category of categories.split(';')) {\n if (category === 'metric_bucket') {\n // namespaces will be present when 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 * 1000;\n }\n\n return updatedRateLimits;\n}\n\nexport { DEFAULT_RETRY_AFTER, disabledUntil, isRateLimited, parseRetryAfterHeader, updateRateLimits };\n//# sourceMappingURL=ratelimit.js.map\n","import { isParameterizedString, isError, isPlainObject, isErrorEvent } from './is.js';\nimport { addExceptionTypeValue, addExceptionMechanism } from './misc.js';\nimport { normalizeToSize } from './normalize.js';\nimport { extractExceptionKeysForMessage } from './object.js';\n\n/**\n * Extracts stack frames from the error.stack string\n */\nfunction parseStackFrames(stackParser, error) {\n return stackParser(error.stack || '', 1);\n}\n\n/**\n * Extracts stack frames from the error and builds a Sentry Exception\n */\nfunction exceptionFromError(stackParser, error) {\n const exception = {\n type: error.name || error.constructor.name,\n value: error.message,\n };\n\n const frames = parseStackFrames(stackParser, error);\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n return exception;\n}\n\n/** If a plain object has a property that is an `Error`, return this error. */\nfunction getErrorPropertyFromObject(obj) {\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n const value = obj[prop];\n if (value instanceof Error) {\n return value;\n }\n }\n }\n\n return undefined;\n}\n\nfunction getMessageForObject(exception) {\n if ('name' in exception && typeof exception.name === 'string') {\n let message = `'${exception.name}' captured as exception`;\n\n if ('message' in exception && typeof exception.message === 'string') {\n message += ` with message '${exception.message}'`;\n }\n\n return message;\n } else if ('message' in exception && typeof exception.message === 'string') {\n return exception.message;\n }\n\n const keys = extractExceptionKeysForMessage(exception);\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as exception with message \\`${exception.message}\\``;\n }\n\n const className = getObjectClassName(exception);\n\n return `${\n className && className !== 'Object' ? `'${className}'` : 'Object'\n } captured as exception with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj) {\n try {\n const prototype = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch (e) {\n // ignore errors here\n }\n}\n\nfunction getException(\n client,\n mechanism,\n exception,\n hint,\n) {\n if (isError(exception)) {\n return [exception, undefined];\n }\n\n // Mutate this!\n mechanism.synthetic = true;\n\n if (isPlainObject(exception)) {\n const normalizeDepth = client && client.getOptions().normalizeDepth;\n const extras = { ['__serialized__']: normalizeToSize(exception , normalizeDepth) };\n\n const errorFromProp = getErrorPropertyFromObject(exception);\n if (errorFromProp) {\n return [errorFromProp, extras];\n }\n\n const message = getMessageForObject(exception);\n const ex = (hint && hint.syntheticException) || new Error(message);\n ex.message = message;\n\n return [ex, extras];\n }\n\n // This handles when someone does: `throw \"something awesome\";`\n // We use synthesized Error here so we can extract a (rough) stack trace.\n const ex = (hint && hint.syntheticException) || new Error(exception );\n ex.message = `${exception}`;\n\n return [ex, undefined];\n}\n\n/**\n * Builds and Event from a Exception\n * @hidden\n */\nfunction eventFromUnknownInput(\n client,\n stackParser,\n exception,\n hint,\n) {\n const providedMechanism =\n hint && hint.data && (hint.data ).mechanism;\n const mechanism = providedMechanism || {\n handled: true,\n type: 'generic',\n };\n\n const [ex, extras] = getException(client, mechanism, exception, hint);\n\n const event = {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n\n if (extras) {\n event.extra = extras;\n }\n\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, mechanism);\n\n return {\n ...event,\n event_id: hint && hint.event_id,\n };\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nfunction eventFromMessage(\n stackParser,\n message,\n level = 'info',\n hint,\n attachStacktrace,\n) {\n const event = {\n event_id: hint && hint.event_id,\n level,\n };\n\n if (attachStacktrace && hint && 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 }\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nexport { eventFromMessage, eventFromUnknownInput, exceptionFromError, parseStackFrames };\n//# sourceMappingURL=eventbuilder.js.map\n","import { uuid4 } from './misc.js';\n\n/**\n * Returns a new minimal propagation context\n */\nfunction generatePropagationContext() {\n return {\n traceId: uuid4(),\n spanId: uuid4().substring(16),\n };\n}\n\nexport { generatePropagationContext };\n//# sourceMappingURL=propagationContext.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { GLOBAL_OBJ, SDK_VERSION } from '@sentry/utils';\n\n/**\n * An object that contains globally accessible properties and maintains a scope stack.\n * @hidden\n */\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nfunction getMainCarrier() {\n // This ensures a Sentry carrier exists\n getSentryCarrier(GLOBAL_OBJ);\n return GLOBAL_OBJ;\n}\n\n/** Will either get the existing sentry carrier, or create a new one. */\nfunction getSentryCarrier(carrier) {\n const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n\n // For now: First SDK that sets the .version property wins\n __SENTRY__.version = __SENTRY__.version || SDK_VERSION;\n\n // Intentionally populating and returning the version of \"this\" SDK instance\n // rather than what's set in .version so that \"this\" SDK always gets its carrier\n return (__SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {});\n}\n\nexport { getMainCarrier, getSentryCarrier };\n//# sourceMappingURL=carrier.js.map\n","import { timestampInSeconds, uuid4, dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nfunction makeSession(context) {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\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\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\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\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\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 = undefined;\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}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\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\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session) {\n return dropUndefinedKeys({\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 * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\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","import { addNonEnumerableProperty } from '@sentry/utils';\n\nconst SCOPE_SPAN_FIELD = '_sentrySpan';\n\n/**\n * Set the active span for a given scope.\n * NOTE: This should NOT be used directly, but is only used internally by the trace methods.\n */\nfunction _setSpanForScope(scope, span) {\n if (span) {\n addNonEnumerableProperty(scope , SCOPE_SPAN_FIELD, span);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete (scope )[SCOPE_SPAN_FIELD];\n }\n}\n\n/**\n * Get the active span for a given scope.\n * NOTE: This should NOT be used directly, but is only used internally by the trace methods.\n */\nfunction _getSpanForScope(scope) {\n return scope[SCOPE_SPAN_FIELD];\n}\n\nexport { _getSpanForScope, _setSpanForScope };\n//# sourceMappingURL=spanOnScope.js.map\n","import { generatePropagationContext, isPlainObject, dateTimestampInSeconds, uuid4, logger } from '@sentry/utils';\nimport { updateSession } from './session.js';\nimport { _setSpanForScope, _getSpanForScope } from './utils/spanOnScope.js';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * Holds additional event information.\n */\nclass ScopeClass {\n /** Flag if notifying is happening. */\n\n /** Callback for client to receive scope changes. */\n\n /** Callback list that will be called during event processing. */\n\n /** Array of breadcrumbs. */\n\n /** User */\n\n /** Tags */\n\n /** Extra */\n\n /** Contexts */\n\n /** Attachments */\n\n /** Propagation Context for distributed tracing */\n\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n\n /** Fingerprint */\n\n /** Severity */\n\n /**\n * Transaction Name\n *\n * IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects.\n * It's purpose is to assign a transaction to the scope that's added to non-transaction events.\n */\n\n /** Session */\n\n /** Request Mode Session Status */\n\n /** The client on this scope */\n\n /** Contains the last event id of a captured event. */\n\n // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\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._extra = {};\n this._contexts = {};\n this._sdkProcessingMetadata = {};\n this._propagationContext = generatePropagationContext();\n }\n\n /**\n * @inheritDoc\n */\n clone() {\n const newScope = new ScopeClass();\n newScope._breadcrumbs = [...this._breadcrumbs];\n newScope._tags = { ...this._tags };\n newScope._extra = { ...this._extra };\n newScope._contexts = { ...this._contexts };\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._requestSession = this._requestSession;\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\n _setSpanForScope(newScope, _getSpanForScope(this));\n\n return newScope;\n }\n\n /**\n * @inheritDoc\n */\n setClient(client) {\n this._client = client;\n }\n\n /**\n * @inheritDoc\n */\n setLastEventId(lastEventId) {\n this._lastEventId = lastEventId;\n }\n\n /**\n * @inheritDoc\n */\n getClient() {\n return this._client ;\n }\n\n /**\n * @inheritDoc\n */\n lastEventId() {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n */\n addScopeListener(callback) {\n this._scopeListeners.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n addEventProcessor(callback) {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setUser(user) {\n // If null is passed we want to unset everything, but still define keys,\n // so that later down in the pipeline any existing values are cleared.\n this._user = user || {\n email: undefined,\n id: undefined,\n ip_address: undefined,\n username: undefined,\n };\n\n if (this._session) {\n updateSession(this._session, { user });\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getUser() {\n return this._user;\n }\n\n /**\n * @inheritDoc\n */\n getRequestSession() {\n return this._requestSession;\n }\n\n /**\n * @inheritDoc\n */\n setRequestSession(requestSession) {\n this._requestSession = requestSession;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTags(tags) {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTag(key, value) {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setExtras(extras) {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setExtra(key, extra) {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setFingerprint(fingerprint) {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setLevel(level) {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTransactionName(name) {\n this._transactionName = name;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setContext(key, context) {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\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 /**\n * @inheritDoc\n */\n getSession() {\n return this._session;\n }\n\n /**\n * @inheritDoc\n */\n update(captureContext) {\n if (!captureContext) {\n return this;\n }\n\n const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext;\n\n const [scopeInstance, requestSession] =\n scopeToMerge instanceof Scope\n ? [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()]\n : isPlainObject(scopeToMerge)\n ? [captureContext , (captureContext ).requestSession]\n : [];\n\n const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {};\n\n this._tags = { ...this._tags, ...tags };\n this._extra = { ...this._extra, ...extra };\n this._contexts = { ...this._contexts, ...contexts };\n\n if (user && Object.keys(user).length) {\n this._user = user;\n }\n\n if (level) {\n this._level = level;\n }\n\n if (fingerprint.length) {\n this._fingerprint = fingerprint;\n }\n\n if (propagationContext) {\n this._propagationContext = propagationContext;\n }\n\n if (requestSession) {\n this._requestSession = requestSession;\n }\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n clear() {\n // client is not cleared here on purpose!\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._requestSession = undefined;\n this._session = undefined;\n _setSpanForScope(this, undefined);\n this._attachments = [];\n this._propagationContext = generatePropagationContext();\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n addBreadcrumb(breadcrumb, maxBreadcrumbs) {\n const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n // No data has been changed, so don't notify scope listeners\n if (maxCrumbs <= 0) {\n return this;\n }\n\n const mergedBreadcrumb = {\n timestamp: dateTimestampInSeconds(),\n ...breadcrumb,\n };\n\n const breadcrumbs = this._breadcrumbs;\n breadcrumbs.push(mergedBreadcrumb);\n this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;\n\n this._notifyScopeListeners();\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getLastBreadcrumb() {\n return this._breadcrumbs[this._breadcrumbs.length - 1];\n }\n\n /**\n * @inheritDoc\n */\n clearBreadcrumbs() {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n addAttachment(attachment) {\n this._attachments.push(attachment);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n clearAttachments() {\n this._attachments = [];\n return this;\n }\n\n /** @inheritDoc */\n getScopeData() {\n return {\n breadcrumbs: this._breadcrumbs,\n attachments: this._attachments,\n contexts: this._contexts,\n tags: this._tags,\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 };\n }\n\n /**\n * @inheritDoc\n */\n setSDKProcessingMetadata(newData) {\n this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setPropagationContext(context) {\n this._propagationContext = context;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getPropagationContext() {\n return this._propagationContext;\n }\n\n /**\n * @inheritDoc\n */\n captureException(exception, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture exception!');\n return eventId;\n }\n\n const syntheticException = new Error('Sentry syntheticException');\n\n this._client.captureException(\n exception,\n {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureMessage(message, level, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture message!');\n return eventId;\n }\n\n const syntheticException = new Error(message);\n\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\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureEvent(event, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture event!');\n return eventId;\n }\n\n this._client.captureEvent(event, { ...hint, event_id: eventId }, this);\n\n return eventId;\n }\n\n /**\n * This will be called on every set call.\n */\n _notifyScopeListeners() {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }\n}\n\n// NOTE: By exporting this here as const & type, instead of doing `export class`,\n// We can get the correct class when importing from `@sentry/core`, but the original type (from `@sentry/types`)\n// This is helpful for interop, e.g. when doing `import type { Scope } from '@sentry/node';` (which re-exports this)\n\n/**\n * Holds additional event information.\n */\nconst Scope = ScopeClass;\n\n/**\n * Holds additional event information.\n */\n\nexport { Scope };\n//# sourceMappingURL=scope.js.map\n","import { getGlobalSingleton } from '@sentry/utils';\nimport { Scope } from './scope.js';\n\n/** Get the default current scope. */\nfunction getDefaultCurrentScope() {\n return getGlobalSingleton('defaultCurrentScope', () => new Scope());\n}\n\n/** Get the default isolation scope. */\nfunction getDefaultIsolationScope() {\n return getGlobalSingleton('defaultIsolationScope', () => new Scope());\n}\n\nexport { getDefaultCurrentScope, getDefaultIsolationScope };\n//# sourceMappingURL=defaultScopes.js.map\n","import { isThenable } from '@sentry/utils';\nimport { getDefaultCurrentScope, getDefaultIsolationScope } from '../defaultScopes.js';\nimport { Scope } from '../scope.js';\nimport { getMainCarrier, getSentryCarrier } from '../carrier.js';\n\n/**\n * This is an object that holds a stack of scopes.\n */\nclass AsyncContextStack {\n\n constructor(scope, isolationScope) {\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n this._stack = [{ scope: assignedScope }];\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * Fork a scope for the stack.\n */\n withScope(callback) {\n const scope = this._pushScope();\n\n let maybePromiseResult;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n this._popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n // @ts-expect-error - isThenable returns the wrong type\n return maybePromiseResult.then(\n res => {\n this._popScope();\n return res;\n },\n e => {\n this._popScope();\n throw e;\n },\n );\n }\n\n this._popScope();\n return maybePromiseResult;\n }\n\n /**\n * Get the client of the stack.\n */\n getClient() {\n return this.getStackTop().client ;\n }\n\n /**\n * Returns the scope of the top stack.\n */\n getScope() {\n return this.getStackTop().scope;\n }\n\n /**\n * Get the isolation scope for the stack.\n */\n getIsolationScope() {\n return this._isolationScope;\n }\n\n /**\n * Returns the scope stack for domains or the process.\n */\n getStack() {\n return this._stack;\n }\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 /**\n * Push a scope to the stack.\n */\n _pushScope() {\n // We want to clone the content of prev scope\n const scope = this.getScope().clone();\n this.getStack().push({\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * Pop a scope from the stack.\n */\n _popScope() {\n if (this.getStack().length <= 1) return false;\n return !!this.getStack().pop();\n }\n}\n\n/**\n * Get the global async context stack.\n * This will be removed during the v8 cycle and is only here to make migration easier.\n */\nfunction getAsyncContextStack() {\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n\n return (sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope()));\n}\n\nfunction withScope(callback) {\n return getAsyncContextStack().withScope(callback);\n}\n\nfunction withSetScope(scope, callback) {\n const stack = getAsyncContextStack() ;\n return stack.withScope(() => {\n stack.getStackTop().scope = scope;\n return callback(scope);\n });\n}\n\nfunction withIsolationScope(callback) {\n return getAsyncContextStack().withScope(() => {\n return callback(getAsyncContextStack().getIsolationScope());\n });\n}\n\n/**\n * Get the stack-based async context strategy.\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 { getMainCarrier, getSentryCarrier } from '../carrier.js';\nimport { getStackAsyncContextStrategy } from './stackStrategy.js';\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nfunction setAsyncContextStrategy(strategy) {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n sentry.acs = strategy;\n}\n\n/**\n * Get the current async context strategy.\n * If none has been setup, the default will be used.\n */\nfunction getAsyncContextStrategy(carrier) {\n const sentry = getSentryCarrier(carrier);\n\n if (sentry.acs) {\n return sentry.acs;\n }\n\n // Otherwise, use the default one (stack)\n return getStackAsyncContextStrategy();\n}\n\nexport { getAsyncContextStrategy, setAsyncContextStrategy };\n//# sourceMappingURL=index.js.map\n","import { getGlobalSingleton } from '@sentry/utils';\nimport { getAsyncContextStrategy } from './asyncContext/index.js';\nimport { getMainCarrier } from './carrier.js';\nimport { Scope } from './scope.js';\n\n/**\n * Get the currently active scope.\n */\nfunction getCurrentScope() {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n return acs.getCurrentScope();\n}\n\n/**\n * Get the currently active isolation scope.\n * The isolation scope is active for the current exection context.\n */\nfunction getIsolationScope() {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n return acs.getIsolationScope();\n}\n\n/**\n * Get the global scope.\n * This scope is applied to _all_ events.\n */\nfunction getGlobalScope() {\n return getGlobalSingleton('globalScope', () => new Scope());\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n */\n\n/**\n * Either creates a new active scope, or sets the given scope as active scope in the given callback.\n */\nfunction withScope(\n ...rest\n) {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [scope, callback] = rest;\n\n if (!scope) {\n return acs.withScope(callback);\n }\n\n return acs.withSetScope(scope, callback);\n }\n\n return acs.withScope(rest[0]);\n}\n\n/**\n * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no\n * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the\n * case, for example, in the browser).\n *\n * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.\n *\n * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in \"normal\"\n * applications directly because it comes with pitfalls. Use at your own risk!\n */\n\n/**\n * Either creates a new active isolation scope, or sets the given isolation scope as active scope in the given callback.\n */\nfunction withIsolationScope(\n ...rest\n\n) {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [isolationScope, callback] = rest;\n\n if (!isolationScope) {\n return acs.withIsolationScope(callback);\n }\n\n return acs.withSetIsolationScope(isolationScope, callback);\n }\n\n return acs.withIsolationScope(rest[0]);\n}\n\n/**\n * Get the currently active client.\n */\nfunction getClient() {\n return getCurrentScope().getClient();\n}\n\nexport { getClient, getCurrentScope, getGlobalScope, getIsolationScope, withIsolationScope, withScope };\n//# sourceMappingURL=currentScopes.js.map\n","import { dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * key: bucketKey\n * value: [exportKey, MetricSummary]\n */\n\nconst METRICS_SPAN_FIELD = '_sentryMetrics';\n\n/**\n * Fetches the metric summary if it exists for the passed span\n */\nfunction getMetricSummaryJsonForSpan(span) {\n const storage = (span )[METRICS_SPAN_FIELD];\n\n if (!storage) {\n return undefined;\n }\n const output = {};\n\n for (const [, [exportKey, summary]] of storage) {\n if (!output[exportKey]) {\n output[exportKey] = [];\n }\n\n output[exportKey].push(dropUndefinedKeys(summary));\n }\n\n return output;\n}\n\n/**\n * Updates the metric summary on a span.\n */\nfunction updateMetricSummaryOnSpan(\n span,\n metricType,\n sanitizedName,\n value,\n unit,\n tags,\n bucketKey,\n) {\n const existingStorage = (span )[METRICS_SPAN_FIELD];\n const storage =\n existingStorage ||\n ((span )[METRICS_SPAN_FIELD] = new Map());\n\n const exportKey = `${metricType}:${sanitizedName}@${unit}`;\n const bucketItem = storage.get(bucketKey);\n\n if (bucketItem) {\n const [, summary] = bucketItem;\n storage.set(bucketKey, [\n exportKey,\n {\n min: Math.min(summary.min, value),\n max: Math.max(summary.max, value),\n count: (summary.count += 1),\n sum: (summary.sum += value),\n tags: summary.tags,\n },\n ]);\n } else {\n storage.set(bucketKey, [\n exportKey,\n {\n min: value,\n max: value,\n count: 1,\n sum: value,\n tags,\n },\n ]);\n }\n}\n\nexport { getMetricSummaryJsonForSpan, updateMetricSummaryOnSpan };\n//# sourceMappingURL=metric-summary.js.map\n","/**\n * Use this attribute to represent the source of a span.\n * Should be one of: custom, url, route, view, component, task, unknown\n *\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Use this attribute to represent the sample rate used for a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n\n/**\n * Use this attribute to represent the operation of a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op';\n\n/**\n * Use this attribute to represent the origin of a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin';\n\n/** The reason why an idle span finished. */\nconst SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = 'sentry.idle_span_finish_reason';\n\n/** The unit of a measurement, which may be stored as a TimedEvent. */\nconst SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = 'sentry.measurement_unit';\n\n/** The value of a measurement, which may be stored as a TimedEvent. */\nconst SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = 'sentry.measurement_value';\n\n/**\n * The id of the profile that this span occured in.\n */\nconst SEMANTIC_ATTRIBUTE_PROFILE_ID = 'sentry.profile_id';\n\nconst SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = 'sentry.exclusive_time';\n\nconst SEMANTIC_ATTRIBUTE_CACHE_HIT = 'cache.hit';\n\nconst SEMANTIC_ATTRIBUTE_CACHE_KEY = 'cache.key';\n\nconst SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = 'cache.item_size';\n\nexport { SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_PROFILE_ID, 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_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE };\n//# sourceMappingURL=semanticAttributes.js.map\n","const SPAN_STATUS_UNSET = 0;\nconst SPAN_STATUS_OK = 1;\nconst SPAN_STATUS_ERROR = 2;\n\n/**\n * Converts a HTTP status code into a sentry status with a message.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\n// https://develop.sentry.dev/sdk/event-payloads/span/\nfunction getSpanStatusFromHttpCode(httpStatus) {\n if (httpStatus < 400 && httpStatus >= 100) {\n return { code: SPAN_STATUS_OK };\n }\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\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\n return { code: SPAN_STATUS_ERROR, message: 'unknown_error' };\n}\n\n/**\n * Sets the Http status attributes on the current span based on the http code.\n * Additionally, the span's status is updated, depending on the http code.\n */\nfunction setHttpStatus(span, httpStatus) {\n span.setAttribute('http.response.status_code', httpStatus);\n\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 { dropUndefinedKeys, generateSentryTraceHeader, addNonEnumerableProperty, timestampInSeconds } from '@sentry/utils';\nimport { getAsyncContextStrategy } from '../asyncContext/index.js';\nimport { getMainCarrier } from '../carrier.js';\nimport { getCurrentScope } from '../currentScopes.js';\nimport { getMetricSummaryJsonForSpan, updateMetricSummaryOnSpan } from '../metrics/metric-summary.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../semanticAttributes.js';\nimport { SPAN_STATUS_UNSET, SPAN_STATUS_OK } from '../tracing/spanstatus.js';\nimport { _getSpanForScope } from './spanOnScope.js';\n\n// These are aligned with OpenTelemetry trace flags\nconst TRACE_FLAG_NONE = 0x0;\nconst TRACE_FLAG_SAMPLED = 0x1;\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in an event.\n * By default, this will only include trace_id, span_id & parent_span_id.\n * If `includeAllData` is true, it will also include data, op, status & origin.\n */\nfunction spanToTransactionTraceContext(span) {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { data, op, parent_span_id, status, origin } = spanToJSON(span);\n\n return dropUndefinedKeys({\n parent_span_id,\n span_id,\n trace_id,\n data,\n op,\n status,\n origin,\n });\n}\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in a non-transaction event.\n */\nfunction spanToTraceContext(span) {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { parent_span_id } = spanToJSON(span);\n\n return dropUndefinedKeys({ parent_span_id, span_id, trace_id });\n}\n\n/**\n * Convert a Span to a Sentry trace header.\n */\nfunction spanToTraceHeader(span) {\n const { traceId, spanId } = span.spanContext();\n const sampled = spanIsSampled(span);\n return generateSentryTraceHeader(traceId, spanId, sampled);\n}\n\n/**\n * Convert a span time input intp a timestamp in seconds.\n */\nfunction spanTimeInputToSeconds(input) {\n if (typeof input === 'number') {\n return ensureTimestampInSeconds(input);\n }\n\n if (Array.isArray(input)) {\n // See {@link HrTime} for the array-based time format\n return input[0] + input[1] / 1e9;\n }\n\n if (input instanceof Date) {\n return ensureTimestampInSeconds(input.getTime());\n }\n\n return timestampInSeconds();\n}\n\n/**\n * Converts a timestamp to second, if it was in milliseconds, or keeps it as second.\n */\nfunction ensureTimestampInSeconds(timestamp) {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Convert a span to a JSON representation.\n */\n// Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).\n// This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.\n// And `spanToJSON` needs the Span class from `span.ts` to check here.\nfunction spanToJSON(span) {\n if (spanIsSentrySpan(span)) {\n return span.getSpanJSON();\n }\n\n try {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n\n // Handle a span from @opentelemetry/sdk-base-trace's `Span` class\n if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) {\n const { attributes, startTime, name, endTime, parentSpanId, status } = span;\n\n return dropUndefinedKeys({\n span_id,\n trace_id,\n data: attributes,\n description: name,\n parent_span_id: parentSpanId,\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) || undefined,\n status: getStatusMessage(status),\n op: attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP],\n origin: attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] ,\n _metrics_summary: getMetricSummaryJsonForSpan(span),\n });\n }\n\n // Finally, at least we have `spanContext()`....\n return {\n span_id,\n trace_id,\n };\n } catch (e) {\n return {};\n }\n}\n\nfunction spanIsOpenTelemetrySdkTraceBaseSpan(span) {\n const castSpan = span ;\n return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status;\n}\n\n/** Exported only for tests. */\n\n/**\n * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof.\n * :( So instead we approximate this by checking if it has the `getSpanJSON` method.\n */\nfunction spanIsSentrySpan(span) {\n return typeof (span ).getSpanJSON === 'function';\n}\n\n/**\n * Returns true if a span is sampled.\n * In most cases, you should just use `span.isRecording()` instead.\n * However, this has a slightly different semantic, as it also returns false if the span is finished.\n * So in the case where this distinction is important, use this method.\n */\nfunction spanIsSampled(span) {\n // We align our trace flags with the ones OpenTelemetry use\n // So we also check for sampled the same way they do.\n const { traceFlags } = span.spanContext();\n return traceFlags === TRACE_FLAG_SAMPLED;\n}\n\n/** Get the status message to use for a JSON representation of a span. */\nfunction getStatusMessage(status) {\n if (!status || status.code === SPAN_STATUS_UNSET) {\n return undefined;\n }\n\n if (status.code === SPAN_STATUS_OK) {\n return 'ok';\n }\n\n return status.message || 'unknown_error';\n}\n\nconst CHILD_SPANS_FIELD = '_sentryChildSpans';\nconst ROOT_SPAN_FIELD = '_sentryRootSpan';\n\n/**\n * Adds an opaque child span reference to a span.\n */\nfunction addChildSpanToSpan(span, childSpan) {\n // We store the root span reference on the child span\n // We need this for `getRootSpan()` to work\n const rootSpan = span[ROOT_SPAN_FIELD] || span;\n addNonEnumerableProperty(childSpan , ROOT_SPAN_FIELD, rootSpan);\n\n // We store a list of child spans on the parent span\n // We need this for `getSpanDescendants()` to work\n if (span[CHILD_SPANS_FIELD]) {\n span[CHILD_SPANS_FIELD].add(childSpan);\n } else {\n addNonEnumerableProperty(span, CHILD_SPANS_FIELD, new Set([childSpan]));\n }\n}\n\n/** This is only used internally by Idle Spans. */\nfunction removeChildSpanFromSpan(span, childSpan) {\n if (span[CHILD_SPANS_FIELD]) {\n span[CHILD_SPANS_FIELD].delete(childSpan);\n }\n}\n\n/**\n * Returns an array of the given span and all of its descendants.\n */\nfunction getSpanDescendants(span) {\n const resultSet = new Set();\n\n function addSpanChildren(span) {\n // This exit condition is required to not infinitely loop in case of a circular dependency.\n if (resultSet.has(span)) {\n return;\n // We want to ignore unsampled spans (e.g. non recording spans)\n } else if (spanIsSampled(span)) {\n resultSet.add(span);\n const childSpans = span[CHILD_SPANS_FIELD] ? Array.from(span[CHILD_SPANS_FIELD]) : [];\n for (const childSpan of childSpans) {\n addSpanChildren(childSpan);\n }\n }\n }\n\n addSpanChildren(span);\n\n return Array.from(resultSet);\n}\n\n/**\n * Returns the root span of a given span.\n */\nfunction getRootSpan(span) {\n return span[ROOT_SPAN_FIELD] || span;\n}\n\n/**\n * Returns the currently active span.\n */\nfunction getActiveSpan() {\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n if (acs.getActiveSpan) {\n return acs.getActiveSpan();\n }\n\n return _getSpanForScope(getCurrentScope());\n}\n\n/**\n * Updates the metric summary on the currently active span\n */\nfunction updateMetricSummaryOnActiveSpan(\n metricType,\n sanitizedName,\n value,\n unit,\n tags,\n bucketKey,\n) {\n const span = getActiveSpan();\n if (span) {\n updateMetricSummaryOnSpan(span, metricType, sanitizedName, value, unit, tags, bucketKey);\n }\n}\n\nexport { TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED, addChildSpanToSpan, getActiveSpan, getRootSpan, getSpanDescendants, getStatusMessage, removeChildSpanFromSpan, spanIsSampled, spanTimeInputToSeconds, spanToJSON, spanToTraceContext, spanToTraceHeader, spanToTransactionTraceContext, updateMetricSummaryOnActiveSpan };\n//# sourceMappingURL=spanUtils.js.map\n","import { addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getActiveSpan, getRootSpan } from '../utils/spanUtils.js';\nimport { SPAN_STATUS_ERROR } from './spanstatus.js';\n\nlet errorsInstrumented = false;\n\n/**\n * Ensure that global errors automatically set the active span status.\n */\nfunction registerSpanErrorInstrumentation() {\n if (errorsInstrumented) {\n return;\n }\n\n errorsInstrumented = true;\n addGlobalErrorInstrumentationHandler(errorCallback);\n addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active root span as failed\n */\nfunction errorCallback() {\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan && getRootSpan(activeSpan);\n if (rootSpan) {\n const message = 'internal_error';\n DEBUG_BUILD && logger.log(`[Tracing] Root span: ${message} -> Global error occured`);\n rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message });\n }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n\nexport { registerSpanErrorInstrumentation };\n//# sourceMappingURL=errors.js.map\n","const DEFAULT_ENVIRONMENT = 'production';\n\nexport { DEFAULT_ENVIRONMENT };\n//# sourceMappingURL=constants.js.map\n","import { dropUndefinedKeys, dynamicSamplingContextToSentryBaggageHeader, addNonEnumerableProperty } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getClient } from '../currentScopes.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes.js';\nimport { spanToJSON, getRootSpan, spanIsSampled } from '../utils/spanUtils.js';\n\n/**\n * If you change this value, also update the terser plugin config to\n * avoid minification of the object property!\n */\nconst FROZEN_DSC_FIELD = '_frozenDsc';\n\n/**\n * Freeze the given DSC on the given span.\n */\nfunction freezeDscOnSpan(span, dsc) {\n const spanWithMaybeDsc = span ;\n addNonEnumerableProperty(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc);\n}\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nfunction getDynamicSamplingContextFromClient(trace_id, client) {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n public_key,\n trace_id,\n }) ;\n\n client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nfunction getDynamicSamplingContextFromSpan(span) {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client);\n\n const rootSpan = getRootSpan(span);\n if (!rootSpan) {\n return dsc;\n }\n\n const frozenDsc = (rootSpan )[FROZEN_DSC_FIELD];\n if (frozenDsc) {\n return frozenDsc;\n }\n\n const jsonSpan = spanToJSON(rootSpan);\n const attributes = jsonSpan.data || {};\n const maybeSampleRate = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];\n\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(rootSpan));\n\n client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * Convert a Span to a baggage header.\n */\nfunction spanToBaggageHeader(span) {\n const dsc = getDynamicSamplingContextFromSpan(span);\n return dynamicSamplingContextToSentryBaggageHeader(dsc);\n}\n\nexport { freezeDscOnSpan, getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan, spanToBaggageHeader };\n//# sourceMappingURL=dynamicSamplingContext.js.map\n","import { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\n\n/**\n * Parse a sample rate from a given value.\n * This will either return a boolean or number sample rate, if the sample rate is valid (between 0 and 1).\n * If a string is passed, we try to convert it to a number.\n *\n * Any invalid sample rate will return `undefined`.\n */\nfunction parseSampleRate(sampleRate) {\n if (typeof sampleRate === 'boolean') {\n return Number(sampleRate);\n }\n\n const rate = typeof sampleRate === 'string' ? parseFloat(sampleRate) : sampleRate;\n if (typeof rate !== 'number' || isNaN(rate) || rate < 0 || rate > 1) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Given sample rate is invalid. 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 undefined;\n }\n\n return rate;\n}\n\nexport { parseSampleRate };\n//# sourceMappingURL=parseSampleRate.js.map\n","import { getSdkMetadataForEnvelopeHeader, dsnToString, createEnvelope, createEventEnvelopeHeaders, createSpanEnvelopeItem } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from './tracing/dynamicSamplingContext.js';\nimport { spanToJSON } from './utils/spanUtils.js';\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event, sdkInfo) {\n if (!sdkInfo) {\n return event;\n }\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || sdkInfo.name;\n event.sdk.version = event.sdk.version || sdkInfo.version;\n event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n return event;\n}\n\n/** Creates an envelope from a Session */\nfunction createSessionEnvelope(\n session,\n dsn,\n metadata,\n tunnel,\n) {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n const envelopeHeaders = {\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n };\n\n const envelopeItem =\n 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()];\n\n return createEnvelope(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n * Create an Envelope from an event.\n */\nfunction createEventEnvelope(\n event,\n dsn,\n metadata,\n tunnel,\n) {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n\n /*\n Note: Due to TS, event.type may be `replay_event`, theoretically.\n In practice, we never call `createEventEnvelope` with `replay_event` type,\n and we'd have to adjut a looot of types to make this work properly.\n We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)\n So the safe choice is to really guard against the replay_event type here.\n */\n const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';\n\n enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n\n const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n\n // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n delete event.sdkProcessingMetadata;\n\n const eventItem = [{ type: eventType }, event];\n return createEnvelope(envelopeHeaders, [eventItem]);\n}\n\n/**\n * Create envelope from Span item.\n *\n * Takes an optional client and runs spans through `beforeSendSpan` if available.\n */\nfunction createSpanEnvelope(spans, client) {\n function dscHasRequiredProps(dsc) {\n return !!dsc.trace_id && !!dsc.public_key;\n }\n\n // For the moment we'll obtain the DSC from the first span in the array\n // This might need to be changed if we permit sending multiple spans from\n // different segments in one envelope\n const dsc = getDynamicSamplingContextFromSpan(spans[0]);\n\n const dsn = client && client.getDsn();\n const tunnel = client && client.getOptions().tunnel;\n\n const headers = {\n sent_at: new Date().toISOString(),\n ...(dscHasRequiredProps(dsc) && { trace: dsc }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n };\n\n const beforeSendSpan = client && client.getOptions().beforeSendSpan;\n const convertToSpanJSON = beforeSendSpan\n ? (span) => beforeSendSpan(spanToJSON(span) )\n : (span) => spanToJSON(span);\n\n const items = [];\n for (const span of spans) {\n const spanJson = convertToSpanJSON(span);\n if (spanJson) {\n items.push(createSpanEnvelopeItem(spanJson));\n }\n }\n\n return createEnvelope(headers, items);\n}\n\nexport { createEventEnvelope, createSessionEnvelope, createSpanEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { SyncPromise, logger, isThenable } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\n\n/**\n * Process an array of event processors, returning the processed event (or `null` if the event was dropped).\n */\nfunction notifyEventProcessors(\n processors,\n event,\n hint,\n index = 0,\n) {\n return new SyncPromise((resolve, reject) => {\n const processor = processors[index];\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n const result = processor({ ...event }, hint) ;\n\n DEBUG_BUILD && processor.id && result === null && logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n if (isThenable(result)) {\n void result\n .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n .then(null, reject);\n } else {\n void notifyEventProcessors(processors, result, hint, index + 1)\n .then(resolve)\n .then(null, reject);\n }\n }\n });\n}\n\nexport { notifyEventProcessors };\n//# sourceMappingURL=eventProcessors.js.map\n","import { dropUndefinedKeys, arrayify } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext.js';\nimport { spanToTraceContext, getRootSpan, spanToJSON } from './spanUtils.js';\n\n/**\n * Applies data from the scope to the event and runs all event processors on it.\n */\nfunction applyScopeDataToEvent(event, data) {\n const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data;\n\n // Apply general data\n applyDataToEvent(event, data);\n\n // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relies on that.\n if (span) {\n applySpanToEvent(event, span);\n }\n\n applyFingerprintToEvent(event, fingerprint);\n applyBreadcrumbsToEvent(event, breadcrumbs);\n applySdkMetadataToEvent(event, sdkProcessingMetadata);\n}\n\n/** Merge data of two scopes together. */\nfunction mergeScopeData(data, mergeData) {\n const {\n extra,\n tags,\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\n mergeAndOverwriteScopeData(data, 'extra', extra);\n mergeAndOverwriteScopeData(data, 'tags', tags);\n mergeAndOverwriteScopeData(data, 'user', user);\n mergeAndOverwriteScopeData(data, 'contexts', contexts);\n mergeAndOverwriteScopeData(data, 'sdkProcessingMetadata', sdkProcessingMetadata);\n\n if (level) {\n data.level = level;\n }\n\n if (transactionName) {\n data.transactionName = transactionName;\n }\n\n if (span) {\n data.span = span;\n }\n\n if (breadcrumbs.length) {\n data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs];\n }\n\n if (fingerprint.length) {\n data.fingerprint = [...data.fingerprint, ...fingerprint];\n }\n\n if (eventProcessors.length) {\n data.eventProcessors = [...data.eventProcessors, ...eventProcessors];\n }\n\n if (attachments.length) {\n data.attachments = [...data.attachments, ...attachments];\n }\n\n data.propagationContext = { ...data.propagationContext, ...propagationContext };\n}\n\n/**\n * Merges certain scope data. Undefined values will overwrite any existing values.\n * Exported only for tests.\n */\nfunction mergeAndOverwriteScopeData\n\n(data, prop, mergeVal) {\n if (mergeVal && Object.keys(mergeVal).length) {\n // Clone object\n data[prop] = { ...data[prop] };\n for (const key in mergeVal) {\n if (Object.prototype.hasOwnProperty.call(mergeVal, key)) {\n data[prop][key] = mergeVal[key];\n }\n }\n }\n}\n\nfunction applyDataToEvent(event, data) {\n const { extra, tags, user, contexts, level, transactionName } = data;\n\n const cleanedExtra = dropUndefinedKeys(extra);\n if (cleanedExtra && Object.keys(cleanedExtra).length) {\n event.extra = { ...cleanedExtra, ...event.extra };\n }\n\n const cleanedTags = dropUndefinedKeys(tags);\n if (cleanedTags && Object.keys(cleanedTags).length) {\n event.tags = { ...cleanedTags, ...event.tags };\n }\n\n const cleanedUser = dropUndefinedKeys(user);\n if (cleanedUser && Object.keys(cleanedUser).length) {\n event.user = { ...cleanedUser, ...event.user };\n }\n\n const cleanedContexts = dropUndefinedKeys(contexts);\n if (cleanedContexts && Object.keys(cleanedContexts).length) {\n event.contexts = { ...cleanedContexts, ...event.contexts };\n }\n\n if (level) {\n event.level = level;\n }\n\n // transaction events get their `transaction` from the root span name\n if (transactionName && event.type !== 'transaction') {\n event.transaction = transactionName;\n }\n}\n\nfunction applyBreadcrumbsToEvent(event, breadcrumbs) {\n const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs];\n event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined;\n}\n\nfunction applySdkMetadataToEvent(event, sdkProcessingMetadata) {\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n ...sdkProcessingMetadata,\n };\n}\n\nfunction applySpanToEvent(event, span) {\n event.contexts = {\n trace: spanToTraceContext(span),\n ...event.contexts,\n };\n\n event.sdkProcessingMetadata = {\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),\n ...event.sdkProcessingMetadata,\n };\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}\n\n/**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\nfunction applyFingerprintToEvent(event, fingerprint) {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n // If we have something on the scope, then merge it with event\n if (fingerprint) {\n event.fingerprint = event.fingerprint.concat(fingerprint);\n }\n\n // If we have no data at all, remove empty array default\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n}\n\nexport { applyScopeDataToEvent, mergeAndOverwriteScopeData, mergeScopeData };\n//# sourceMappingURL=applyScopeDataToEvent.js.map\n","import { uuid4, dateTimestampInSeconds, addExceptionMechanism, truncate, GLOBAL_OBJ, normalize } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getGlobalScope } from '../currentScopes.js';\nimport { notifyEventProcessors } from '../eventProcessors.js';\nimport { Scope } from '../scope.js';\nimport { mergeScopeData, applyScopeDataToEvent } from './applyScopeDataToEvent.js';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nfunction prepareEvent(\n options,\n event,\n hint,\n scope,\n client,\n isolationScope,\n) {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = 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\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Scope.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n const eventProcessors = [\n ...clientEventProcessors,\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event, options) {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\nconst debugIdStackParserCache = new WeakMap();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nfunction applyDebugIds(event, stackParser) {\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n if (!debugIdMap) {\n return;\n }\n\n let debugIdStackFramesCache;\n const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n if (cachedDebugIdStackFrameCache) {\n debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n } else {\n debugIdStackFramesCache = new Map();\n debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n }\n\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = Object.keys(debugIdMap).reduce((acc, debugIdStackTrace) => {\n let parsedStack;\n const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n if (cachedParsedStack) {\n parsedStack = cachedParsedStack;\n } else {\n parsedStack = stackParser(debugIdStackTrace);\n debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n }\n\n for (let i = parsedStack.length - 1; i >= 0; i--) {\n const stackFrame = parsedStack[i];\n if (stackFrame.filename) {\n acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n break;\n }\n }\n return acc;\n }, {});\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nfunction applyDebugMeta(event) {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\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 } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\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.keys(filenameDebugIdMap).forEach(filename => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id: filenameDebugIdMap[filename],\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\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}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event, depth, maxBreadth) {\n if (!event) {\n return null;\n }\n\n const normalized = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, 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\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\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\n return normalized;\n}\n\nfunction getFinalScope(\n scope,\n captureContext,\n) {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nfunction parseEventHintOrCaptureContext(\n hint,\n) {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(\n hint,\n) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\nconst captureContextKeys = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'requestSession',\n 'propagationContext',\n] ;\n\nfunction hintIsScopeContext(hint) {\n return Object.keys(hint).some(key => captureContextKeys.includes(key ));\n}\n\nexport { applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext, prepareEvent };\n//# sourceMappingURL=prepareEvent.js.map\n","import { dropUndefinedKeys } from '@sentry/utils';\nimport { getIsolationScope } from './currentScopes.js';\n\n/**\n * @inheritdoc\n */\nclass SessionFlusher {\n\n // Cast to any so that it can use Node.js timeout\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n constructor(client, attrs) {\n this._client = client;\n this.flushTimeout = 60;\n this._pendingAggregates = {};\n this._isEnabled = true;\n\n // Call to setInterval, so that flush is called every 60 seconds.\n this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (this._intervalId.unref) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n this._intervalId.unref();\n }\n this._sessionAttrs = attrs;\n }\n\n /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */\n flush() {\n const sessionAggregates = this.getSessionAggregates();\n if (sessionAggregates.aggregates.length === 0) {\n return;\n }\n this._pendingAggregates = {};\n this._client.sendSession(sessionAggregates);\n }\n\n /** Massages the entries in `pendingAggregates` and returns aggregated sessions */\n getSessionAggregates() {\n const aggregates = Object.keys(this._pendingAggregates).map((key) => {\n return this._pendingAggregates[parseInt(key)];\n });\n\n const sessionAggregates = {\n attrs: this._sessionAttrs,\n aggregates,\n };\n return dropUndefinedKeys(sessionAggregates);\n }\n\n /** JSDoc */\n close() {\n clearInterval(this._intervalId);\n this._isEnabled = false;\n this.flush();\n }\n\n /**\n * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then\n * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to\n * `_incrementSessionStatusCount` along with the start date\n */\n incrementSessionStatusCount() {\n if (!this._isEnabled) {\n return;\n }\n const isolationScope = getIsolationScope();\n const requestSession = isolationScope.getRequestSession();\n\n if (requestSession && requestSession.status) {\n this._incrementSessionStatusCount(requestSession.status, new Date());\n // This is not entirely necessarily but is added as a safe guard to indicate the bounds of a request and so in\n // case captureRequestSession is called more than once to prevent double count\n isolationScope.setRequestSession(undefined);\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n }\n }\n\n /**\n * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of\n * the session received\n */\n _incrementSessionStatusCount(status, date) {\n // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys\n const sessionStartedTrunc = new Date(date).setSeconds(0, 0);\n this._pendingAggregates[sessionStartedTrunc] = this._pendingAggregates[sessionStartedTrunc] || {};\n\n // corresponds to aggregated sessions in one specific minute bucket\n // for example, {\"started\":\"2021-03-16T08:00:00.000Z\",\"exited\":4, \"errored\": 1}\n const aggregationCounts = this._pendingAggregates[sessionStartedTrunc];\n if (!aggregationCounts.started) {\n aggregationCounts.started = new Date(sessionStartedTrunc).toISOString();\n }\n\n switch (status) {\n case 'errored':\n aggregationCounts.errored = (aggregationCounts.errored || 0) + 1;\n return aggregationCounts.errored;\n case 'ok':\n aggregationCounts.exited = (aggregationCounts.exited || 0) + 1;\n return aggregationCounts.exited;\n default:\n aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1;\n return aggregationCounts.crashed;\n }\n }\n}\n\nexport { SessionFlusher };\n//# sourceMappingURL=sessionflusher.js.map\n","import { makeDsn, dsnToString, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\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}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn) {\n return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn, sdkInfo) {\n return urlEncode({\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION,\n ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),\n });\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nfunction getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) {\n return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nfunction getReportDialogEndpoint(\n dsnLike,\n dialogOptions\n\n,\n) {\n const dsn = makeDsn(dsnLike);\n if (!dsn) {\n return '';\n }\n\n const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n let encodedOptions = `dsn=${dsnToString(dsn)}`;\n for (const key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'onClose') {\n continue;\n }\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\n return `${endpoint}?${encodedOptions}`;\n}\n\nexport { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint };\n//# sourceMappingURL=api.js.map\n","import { arrayify, logger } from '@sentry/utils';\nimport { getClient } from './currentScopes.js';\nimport { DEBUG_BUILD } from './debug-build.js';\n\nconst installedIntegrations = [];\n\n/** Map of integrations assigned to a client */\n\n/**\n * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to\n * preseve the order of integrations in the array.\n *\n * @private\n */\nfunction filterDuplicates(integrations) {\n const integrationsByName = {};\n\n integrations.forEach(currentInstance => {\n const { name } = currentInstance;\n\n const existingInstance = integrationsByName[name];\n\n // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a\n // default instance to overwrite an existing user instance\n if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n return;\n }\n\n integrationsByName[name] = currentInstance;\n });\n\n return Object.keys(integrationsByName).map(k => integrationsByName[k]);\n}\n\n/** Gets integrations to install */\nfunction getIntegrationsToSetup(options) {\n const defaultIntegrations = options.defaultIntegrations || [];\n const userIntegrations = options.integrations;\n\n // We flag default instances, so that later we can tell them apart from any user-created instances of the same class\n defaultIntegrations.forEach(integration => {\n integration.isDefaultInstance = true;\n });\n\n let integrations;\n\n if (Array.isArray(userIntegrations)) {\n integrations = [...defaultIntegrations, ...userIntegrations];\n } else if (typeof userIntegrations === 'function') {\n integrations = arrayify(userIntegrations(defaultIntegrations));\n } else {\n integrations = defaultIntegrations;\n }\n\n const finalIntegrations = filterDuplicates(integrations);\n\n // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or\n // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event\n // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore\n // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.\n const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');\n if (debugIndex !== -1) {\n const [debugInstance] = finalIntegrations.splice(debugIndex, 1);\n finalIntegrations.push(debugInstance);\n }\n\n return finalIntegrations;\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nfunction setupIntegrations(client, integrations) {\n const integrationIndex = {};\n\n integrations.forEach(integration => {\n // guard against empty provided integrations\n if (integration) {\n setupIntegration(client, integration, integrationIndex);\n }\n });\n\n return integrationIndex;\n}\n\n/**\n * Execute the `afterAllSetup` hooks of the given integrations.\n */\nfunction afterSetupIntegrations(client, integrations) {\n for (const integration of integrations) {\n // guard against empty provided integrations\n if (integration && integration.afterAllSetup) {\n integration.afterAllSetup(client);\n }\n }\n}\n\n/** Setup a single integration. */\nfunction setupIntegration(client, integration, integrationIndex) {\n if (integrationIndex[integration.name]) {\n DEBUG_BUILD && logger.log(`Integration skipped because it was already installed: ${integration.name}`);\n return;\n }\n integrationIndex[integration.name] = integration;\n\n // `setupOnce` is only called the first time\n if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === 'function') {\n integration.setupOnce();\n installedIntegrations.push(integration.name);\n }\n\n // `setup` is run for each client\n if (integration.setup && typeof integration.setup === 'function') {\n integration.setup(client);\n }\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\n if (typeof integration.processEvent === 'function') {\n const callback = integration.processEvent.bind(integration) ;\n\n const processor = Object.assign((event, hint) => callback(event, hint, client), {\n id: integration.name,\n });\n\n client.addEventProcessor(processor);\n }\n\n DEBUG_BUILD && logger.log(`Integration installed: ${integration.name}`);\n}\n\n/** Add an integration to the current scope's client. */\nfunction addIntegration(integration) {\n const client = getClient();\n\n if (!client) {\n DEBUG_BUILD && logger.warn(`Cannot add integration \"${integration.name}\" because no SDK Client is available.`);\n return;\n }\n\n client.addIntegration(integration);\n}\n\n// Polyfill for Array.findIndex(), which is not supported in ES5\nfunction findIndex(arr, callback) {\n for (let i = 0; i < arr.length; i++) {\n if (callback(arr[i]) === true) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Define an integration function that can be used to create an integration instance.\n * Note that this by design hides the implementation details of the integration, as they are considered internal.\n */\nfunction defineIntegration(fn) {\n return fn;\n}\n\nexport { addIntegration, afterSetupIntegrations, defineIntegration, getIntegrationsToSetup, installedIntegrations, setupIntegration, setupIntegrations };\n//# sourceMappingURL=integration.js.map\n","import { makeDsn, logger, uuid4, checkOrSetAlreadyCaught, isParameterizedString, isPrimitive, resolvedSyncPromise, addItemToEnvelope, createAttachmentEnvelopeItem, SyncPromise, dropUndefinedKeys, rejectedSyncPromise, SentryError, isThenable, isPlainObject } from '@sentry/utils';\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api.js';\nimport { 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 { updateSession } from './session.js';\nimport { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext.js';\nimport { parseSampleRate } from './utils/parseSampleRate.js';\nimport { prepareEvent } from './utils/prepareEvent.js';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient<NodeOptions> {\n * public constructor(options: NodeOptions) {\n * super(options);\n * }\n *\n * // ...\n * }\n */\nclass BaseClient {\n /** Options passed to the SDK. */\n\n /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n\n /** Array of set up integrations. */\n\n /** Number of calls being processed */\n\n /** Holds flushable */\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n\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\n if (options.dsn) {\n this._dsn = makeDsn(options.dsn);\n } else {\n DEBUG_BUILD && logger.warn('No DSN provided, client will not send events.');\n }\n\n if (this._dsn) {\n const url = getEnvelopeEndpointWithUrlEncodedAuth(\n this._dsn,\n options.tunnel,\n options._metadata ? options._metadata.sdk : undefined,\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 }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n captureException(exception, hint, scope) {\n const eventId = uuid4();\n\n // ensure we haven't captured this very object before\n if (checkOrSetAlreadyCaught(exception)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return eventId;\n }\n\n const hintWithEventId = {\n event_id: eventId,\n ...hint,\n };\n\n this._process(\n this.eventFromException(exception, hintWithEventId).then(event =>\n this._captureEvent(event, hintWithEventId, scope),\n ),\n );\n\n return hintWithEventId.event_id;\n }\n\n /**\n * @inheritDoc\n */\n captureMessage(\n message,\n level,\n hint,\n currentScope,\n ) {\n const hintWithEventId = {\n event_id: uuid4(),\n ...hint,\n };\n\n const eventMessage = isParameterizedString(message) ? message : String(message);\n\n const promisedEvent = isPrimitive(message)\n ? this.eventFromMessage(eventMessage, level, hintWithEventId)\n : this.eventFromException(message, hintWithEventId);\n\n this._process(promisedEvent.then(event => this._captureEvent(event, hintWithEventId, currentScope)));\n\n return hintWithEventId.event_id;\n }\n\n /**\n * @inheritDoc\n */\n captureEvent(event, hint, currentScope) {\n const eventId = uuid4();\n\n // ensure we haven't captured this very object before\n if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return eventId;\n }\n\n const hintWithEventId = {\n event_id: eventId,\n ...hint,\n };\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope;\n\n this._process(this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope));\n\n return hintWithEventId.event_id;\n }\n\n /**\n * @inheritDoc\n */\n captureSession(session) {\n if (!(typeof session.release === 'string')) {\n DEBUG_BUILD && logger.warn('Discarded session because of missing or non-string release');\n } else {\n this.sendSession(session);\n // After sending, we set init false to indicate it's not the first occurrence\n updateSession(session, { init: false });\n }\n }\n\n /**\n * @inheritDoc\n */\n getDsn() {\n return this._dsn;\n }\n\n /**\n * @inheritDoc\n */\n getOptions() {\n return this._options;\n }\n\n /**\n * @see SdkMetadata in @sentry/types\n *\n * @return The metadata of the SDK\n */\n getSdkMetadata() {\n return this._options._metadata;\n }\n\n /**\n * @inheritDoc\n */\n getTransport() {\n return this._transport;\n }\n\n /**\n * @inheritDoc\n */\n flush(timeout) {\n const transport = this._transport;\n if (transport) {\n this.emit('flush');\n return this._isClientDoneProcessing(timeout).then(clientFinished => {\n return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n });\n } else {\n return resolvedSyncPromise(true);\n }\n }\n\n /**\n * @inheritDoc\n */\n close(timeout) {\n return this.flush(timeout).then(result => {\n this.getOptions().enabled = false;\n this.emit('close');\n return result;\n });\n }\n\n /** Get all installed event processors. */\n getEventProcessors() {\n return this._eventProcessors;\n }\n\n /** @inheritDoc */\n addEventProcessor(eventProcessor) {\n this._eventProcessors.push(eventProcessor);\n }\n\n /** @inheritdoc */\n init() {\n if (this._isEnabled()) {\n this._setupIntegrations();\n }\n }\n\n /**\n * Gets an installed integration by its name.\n *\n * @returns 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 /**\n * @inheritDoc\n */\n addIntegration(integration) {\n const isAlreadyInstalled = this._integrations[integration.name];\n\n // This hook takes care of only installing if not already installed\n setupIntegration(this, integration, this._integrations);\n // Here we need to check manually to make sure to not run this multiple times\n if (!isAlreadyInstalled) {\n afterSetupIntegrations(this, [integration]);\n }\n }\n\n /**\n * @inheritDoc\n */\n sendEvent(event, hint = {}) {\n this.emit('beforeSendEvent', event, hint);\n\n let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n for (const attachment of hint.attachments || []) {\n env = addItemToEnvelope(env, createAttachmentEnvelopeItem(attachment));\n }\n\n const promise = this.sendEnvelope(env);\n if (promise) {\n promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n }\n }\n\n /**\n * @inheritDoc\n */\n sendSession(session) {\n const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n\n // sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(env);\n }\n\n /**\n * @inheritDoc\n */\n recordDroppedEvent(reason, category, _event) {\n // Note: we use `event` in replay, where we overwrite this hook.\n\n if (this._options.sendClientReports) {\n // We want to track each category (error, transaction, session, replay_event) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`\n // With typescript 4.1 we could even use template literal types\n const key = `${reason}:${category}`;\n DEBUG_BUILD && logger.log(`Adding outcome: \"${key}\"`);\n\n // The following works because undefined + 1 === NaN and NaN is falsy\n this._outcomes[key] = this._outcomes[key] + 1 || 1;\n }\n }\n\n // Keep on() & emit() signatures in sync with types' client.ts interface\n /* eslint-disable @typescript-eslint/unified-signatures */\n\n /** @inheritdoc */\n\n /** @inheritdoc */\n on(hook, callback) {\n if (!this._hooks[hook]) {\n this._hooks[hook] = [];\n }\n\n // @ts-expect-error We assue the types are correct\n this._hooks[hook].push(callback);\n }\n\n /** @inheritdoc */\n\n /** @inheritdoc */\n emit(hook, ...rest) {\n if (this._hooks[hook]) {\n this._hooks[hook].forEach(callback => callback(...rest));\n }\n }\n\n /**\n * @inheritdoc\n */\n sendEnvelope(envelope) {\n this.emit('beforeEnvelope', envelope);\n\n if (this._isEnabled() && this._transport) {\n return this._transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending event:', reason);\n return reason;\n });\n }\n\n DEBUG_BUILD && logger.error('Transport disabled');\n\n return resolvedSyncPromise({});\n }\n\n /* eslint-enable @typescript-eslint/unified-signatures */\n\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\n /** Updates existing session based on the provided event */\n _updateSessionFromEvent(session, event) {\n let crashed = false;\n let errored = false;\n const exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n for (const ex of exceptions) {\n const mechanism = ex.mechanism;\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n }\n\n // A session is updated and that session update is sent in only one of the two following scenarios:\n // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n const sessionNonTerminal = session.status === 'ok';\n const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\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 /**\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 _isClientDoneProcessing(timeout) {\n return new SyncPromise(resolve => {\n let ticked = 0;\n const tick = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }\n\n /** Determines whether this SDK is enabled and a transport is present. */\n _isEnabled() {\n return this.getOptions().enabled !== false && this._transport !== undefined;\n }\n\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param currentScope A scope containing event metadata.\n * @returns A new event with more information.\n */\n _prepareEvent(\n event,\n hint,\n currentScope,\n isolationScope = getIsolationScope(),\n ) {\n const options = this.getOptions();\n const integrations = Object.keys(this._integrations);\n if (!hint.integrations && integrations.length > 0) {\n hint.integrations = integrations;\n }\n\n this.emit('preprocessEvent', event, hint);\n\n if (!event.type) {\n isolationScope.setLastEventId(event.event_id || hint.event_id);\n }\n\n return prepareEvent(options, event, hint, currentScope, this, isolationScope).then(evt => {\n if (evt === null) {\n return evt;\n }\n\n const propagationContext = {\n ...isolationScope.getPropagationContext(),\n ...(currentScope ? currentScope.getPropagationContext() : undefined),\n };\n\n const trace = evt.contexts && evt.contexts.trace;\n if (!trace && propagationContext) {\n const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext;\n evt.contexts = {\n trace: dropUndefinedKeys({\n trace_id,\n span_id: spanId,\n parent_span_id: parentSpanId,\n }),\n ...evt.contexts,\n };\n\n const dynamicSamplingContext = dsc ? dsc : getDynamicSamplingContextFromClient(trace_id, this);\n\n evt.sdkProcessingMetadata = {\n dynamicSamplingContext,\n ...evt.sdkProcessingMetadata,\n };\n }\n return evt;\n });\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 = {}, scope) {\n return this._processEvent(event, hint, scope).then(\n finalEvent => {\n return finalEvent.event_id;\n },\n reason => {\n if (DEBUG_BUILD) {\n // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n // control flow, log just the message (no stack) as a log-level log.\n const sentryError = reason ;\n if (sentryError.logLevel === 'log') {\n logger.log(sentryError.message);\n } else {\n logger.warn(sentryError);\n }\n }\n return undefined;\n },\n );\n }\n\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param 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) {\n const options = this.getOptions();\n const { sampleRate } = options;\n\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\n // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n const parsedSampleRate = typeof sampleRate === 'undefined' ? undefined : parseSampleRate(sampleRate);\n if (isError && typeof parsedSampleRate === 'number' && Math.random() > parsedSampleRate) {\n this.recordDroppedEvent('sample_rate', 'error', event);\n return rejectedSyncPromise(\n new SentryError(\n `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n 'log',\n ),\n );\n }\n\n const dataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope;\n\n return this._prepareEvent(event, hint, currentScope, capturedSpanIsolationScope)\n .then(prepared => {\n if (prepared === null) {\n this.recordDroppedEvent('event_processor', dataCategory, event);\n throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n }\n\n const isInternalException = hint.data && (hint.data ).__sentry__ === true;\n if (isInternalException) {\n return prepared;\n }\n\n const result = processBeforeSend(options, prepared, hint);\n return _validateBeforeSendResult(result, beforeSendLabel);\n })\n .then(processedEvent => {\n if (processedEvent === null) {\n this.recordDroppedEvent('before_send', dataCategory, event);\n throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n }\n\n const session = currentScope && currentScope.getSession();\n if (!isTransaction && session) {\n this._updateSessionFromEvent(session, processedEvent);\n }\n\n // None of the Sentry built event processor will update transaction name,\n // so if the transaction name has been changed by an event processor, we know\n // it has to come from custom event processor added by a user\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\n this.sendEvent(processedEvent, hint);\n return processedEvent;\n })\n .then(null, reason => {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n this.captureException(reason, {\n data: {\n __sentry__: true,\n },\n originalException: reason,\n });\n throw new SentryError(\n `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n );\n });\n }\n\n /**\n * Occupies the client with processing and event\n */\n _process(promise) {\n this._numProcessing++;\n void promise.then(\n value => {\n this._numProcessing--;\n return value;\n },\n reason => {\n this._numProcessing--;\n return reason;\n },\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.keys(outcomes).map(key => {\n const [reason, category] = key.split(':') ;\n return {\n reason,\n category,\n quantity: outcomes[key],\n };\n });\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n beforeSendResult,\n beforeSendLabel,\n) {\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 new SentryError(invalidValueError);\n }\n return event;\n },\n e => {\n throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n },\n );\n } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n throw new SentryError(invalidValueError);\n }\n return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n options,\n event,\n hint,\n) {\n const { beforeSend, beforeSendTransaction, beforeSendSpan } = options;\n\n if (isErrorEvent(event) && beforeSend) {\n return beforeSend(event, hint);\n }\n\n if (isTransactionEvent(event)) {\n if (event.spans && beforeSendSpan) {\n const processedSpans = [];\n for (const span of event.spans) {\n const processedSpan = beforeSendSpan(span);\n if (processedSpan) {\n processedSpans.push(processedSpan);\n }\n }\n event.spans = processedSpans;\n }\n\n if (beforeSendTransaction) {\n return beforeSendTransaction(event, hint);\n }\n }\n\n return event;\n}\n\nfunction isErrorEvent(event) {\n return event.type === undefined;\n}\n\nfunction isTransactionEvent(event) {\n return event.type === 'transaction';\n}\n\nexport { BaseClient };\n//# sourceMappingURL=baseclient.js.map\n","import { dsnToString, dropUndefinedKeys, createEnvelope } from '@sentry/utils';\n\n/**\n * Create envelope from check in item.\n */\nfunction createCheckInEnvelope(\n checkIn,\n dynamicSamplingContext,\n metadata,\n tunnel,\n dsn,\n) {\n const headers = {\n sent_at: new Date().toISOString(),\n };\n\n if (metadata && metadata.sdk) {\n headers.sdk = {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n };\n }\n\n if (!!tunnel && !!dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n if (dynamicSamplingContext) {\n headers.trace = dropUndefinedKeys(dynamicSamplingContext) ;\n }\n\n const item = createCheckInEnvelopeItem(checkIn);\n return createEnvelope(headers, [item]);\n}\n\nfunction createCheckInEnvelopeItem(checkIn) {\n const checkInHeaders = {\n type: 'check_in',\n };\n return [checkInHeaders, checkIn];\n}\n\nexport { createCheckInEnvelope };\n//# sourceMappingURL=checkin.js.map\n","import { resolvedSyncPromise, eventFromUnknownInput, eventFromMessage, logger, uuid4 } from '@sentry/utils';\nimport { BaseClient } from './baseclient.js';\nimport { createCheckInEnvelope } from './checkin.js';\nimport { getIsolationScope } from './currentScopes.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { SessionFlusher } from './sessionflusher.js';\nimport { registerSpanErrorInstrumentation } from './tracing/errors.js';\nimport { _getSpanForScope } from './utils/spanOnScope.js';\nimport { getRootSpan, spanToTraceContext } from './utils/spanUtils.js';\nimport { getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext.js';\n\n/**\n * The Sentry Server Runtime Client SDK.\n */\nclass ServerRuntimeClient\n\n extends BaseClient {\n\n /**\n * Creates a new Edge SDK instance.\n * @param options Configuration options for this SDK.\n */\n constructor(options) {\n // Server clients always support tracing\n registerSpanErrorInstrumentation();\n\n super(options);\n }\n\n /**\n * @inheritDoc\n */\n eventFromException(exception, hint) {\n return resolvedSyncPromise(eventFromUnknownInput(this, this._options.stackParser, exception, hint));\n }\n\n /**\n * @inheritDoc\n */\n eventFromMessage(\n message,\n level = 'info',\n hint,\n ) {\n return resolvedSyncPromise(\n eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace),\n );\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n captureException(exception, hint, scope) {\n // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only\n // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload\n // sent to the Server only when the `requestHandler` middleware is used\n if (this._options.autoSessionTracking && this._sessionFlusher) {\n const requestSession = getIsolationScope().getRequestSession();\n\n // Necessary checks to ensure this is code block is executed only within a request\n // Should override the status only if `requestSession.status` is `Ok`, which is its initial stage\n if (requestSession && requestSession.status === 'ok') {\n requestSession.status = 'errored';\n }\n }\n\n return super.captureException(exception, hint, scope);\n }\n\n /**\n * @inheritDoc\n */\n captureEvent(event, hint, scope) {\n // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only\n // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload\n // sent to the Server only when the `requestHandler` middleware is used\n if (this._options.autoSessionTracking && this._sessionFlusher) {\n const eventType = event.type || 'exception';\n const isException =\n eventType === 'exception' && event.exception && event.exception.values && event.exception.values.length > 0;\n\n // If the event is of type Exception, then a request session should be captured\n if (isException) {\n const requestSession = getIsolationScope().getRequestSession();\n\n // Ensure that this is happening within the bounds of a request, and make sure not to override\n // Session Status if Errored / Crashed\n if (requestSession && requestSession.status === 'ok') {\n requestSession.status = 'errored';\n }\n }\n }\n\n return super.captureEvent(event, hint, scope);\n }\n\n /**\n *\n * @inheritdoc\n */\n close(timeout) {\n if (this._sessionFlusher) {\n this._sessionFlusher.close();\n }\n return super.close(timeout);\n }\n\n /** Method that initialises an instance of SessionFlusher on Client */\n initSessionFlusher() {\n const { release, environment } = this._options;\n if (!release) {\n DEBUG_BUILD && logger.warn('Cannot initialise an instance of SessionFlusher if no release is provided!');\n } else {\n this._sessionFlusher = new SessionFlusher(this, {\n release,\n environment,\n });\n }\n }\n\n /**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\n captureCheckIn(checkIn, monitorConfig, scope) {\n const id = 'checkInId' in checkIn && checkIn.checkInId ? checkIn.checkInId : uuid4();\n if (!this._isEnabled()) {\n DEBUG_BUILD && logger.warn('SDK not enabled, will not capture checkin.');\n return id;\n }\n\n const options = this.getOptions();\n const { release, environment, tunnel } = options;\n\n const serializedCheckIn = {\n check_in_id: id,\n monitor_slug: checkIn.monitorSlug,\n status: checkIn.status,\n release,\n environment,\n };\n\n if ('duration' in checkIn) {\n serializedCheckIn.duration = checkIn.duration;\n }\n\n if (monitorConfig) {\n serializedCheckIn.monitor_config = {\n schedule: monitorConfig.schedule,\n checkin_margin: monitorConfig.checkinMargin,\n max_runtime: monitorConfig.maxRuntime,\n timezone: monitorConfig.timezone,\n failure_issue_threshold: monitorConfig.failureIssueThreshold,\n recovery_threshold: monitorConfig.recoveryThreshold,\n };\n }\n\n const [dynamicSamplingContext, traceContext] = this._getTraceInfoFromScope(scope);\n if (traceContext) {\n serializedCheckIn.contexts = {\n trace: traceContext,\n };\n }\n\n const envelope = createCheckInEnvelope(\n serializedCheckIn,\n dynamicSamplingContext,\n this.getSdkMetadata(),\n tunnel,\n this.getDsn(),\n );\n\n DEBUG_BUILD && logger.info('Sending checkin:', checkIn.monitorSlug, checkIn.status);\n\n // sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(envelope);\n\n return id;\n }\n\n /**\n * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment\n * appropriate session aggregates bucket\n */\n _captureRequestSession() {\n if (!this._sessionFlusher) {\n DEBUG_BUILD && logger.warn('Discarded request mode session because autoSessionTracking option was disabled');\n } else {\n this._sessionFlusher.incrementSessionStatusCount();\n }\n }\n\n /**\n * @inheritDoc\n */\n _prepareEvent(\n event,\n hint,\n scope,\n isolationScope,\n ) {\n if (this._options.platform) {\n event.platform = event.platform || this._options.platform;\n }\n\n if (this._options.runtime) {\n event.contexts = {\n ...event.contexts,\n runtime: (event.contexts || {}).runtime || this._options.runtime,\n };\n }\n\n if (this._options.serverName) {\n event.server_name = event.server_name || this._options.serverName;\n }\n\n return super._prepareEvent(event, hint, scope, isolationScope);\n }\n\n /** Extract trace information from scope */\n _getTraceInfoFromScope(\n scope,\n ) {\n if (!scope) {\n return [undefined, undefined];\n }\n\n const span = _getSpanForScope(scope);\n if (span) {\n const rootSpan = getRootSpan(span);\n const samplingContext = getDynamicSamplingContextFromSpan(rootSpan);\n return [samplingContext, spanToTraceContext(rootSpan)];\n }\n\n const { traceId, spanId, parentSpanId, dsc } = scope.getPropagationContext();\n const traceContext = {\n trace_id: traceId,\n span_id: spanId,\n parent_span_id: parentSpanId,\n };\n if (dsc) {\n return [dsc, traceContext];\n }\n\n return [getDynamicSamplingContextFromClient(traceId, this), traceContext];\n }\n}\n\nexport { ServerRuntimeClient };\n//# sourceMappingURL=server-runtime-client.js.map\n","import { makePromiseBuffer, forEachEnvelopeItem, envelopeItemTypeToDataCategory, isRateLimited, resolvedSyncPromise, createEnvelope, SentryError, logger, serializeEnvelope, updateRateLimits } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\n\nconst DEFAULT_TRANSPORT_BUFFER_SIZE = 64;\n\n/**\n * Creates an instance of a Sentry `Transport`\n *\n * @param options\n * @param makeRequest\n */\nfunction createTransport(\n options,\n makeRequest,\n buffer = makePromiseBuffer(\n options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,\n ),\n) {\n let rateLimits = {};\n const flush = (timeout) => buffer.drain(timeout);\n\n function send(envelope) {\n const filteredEnvelopeItems = [];\n\n // Drop rate limited items from envelope\n forEachEnvelopeItem(envelope, (item, type) => {\n const dataCategory = envelopeItemTypeToDataCategory(type);\n if (isRateLimited(rateLimits, dataCategory)) {\n const event = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent('ratelimit_backoff', dataCategory, event);\n } else {\n filteredEnvelopeItems.push(item);\n }\n });\n\n // Skip sending if envelope is empty after filtering out rate limited events\n if (filteredEnvelopeItems.length === 0) {\n return resolvedSyncPromise({});\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems );\n\n // Creates client report for each item in an envelope\n const recordEnvelopeLoss = (reason) => {\n forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n const event = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);\n });\n };\n\n const requestTask = () =>\n makeRequest({ body: serializeEnvelope(filteredEnvelope) }).then(\n response => {\n // We don't want to throw on NOK responses, but we want to at least log them\n if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {\n DEBUG_BUILD && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n }\n\n rateLimits = updateRateLimits(rateLimits, response);\n return response;\n },\n error => {\n recordEnvelopeLoss('network_error');\n throw error;\n },\n );\n\n return buffer.add(requestTask).then(\n result => result,\n error => {\n if (error instanceof SentryError) {\n DEBUG_BUILD && logger.error('Skipped sending event because buffer is full.');\n recordEnvelopeLoss('queue_overflow');\n return resolvedSyncPromise({});\n } else {\n throw error;\n }\n },\n );\n }\n\n return {\n send,\n flush,\n };\n}\n\nfunction getEventForEnvelopeItem(item, type) {\n if (type !== 'event' && type !== 'transaction') {\n return undefined;\n }\n\n return Array.isArray(item) ? (item )[1] : undefined;\n}\n\nexport { DEFAULT_TRANSPORT_BUFFER_SIZE, createTransport };\n//# sourceMappingURL=base.js.map\n","import { GLOBAL_OBJ, relative, basename } from '@sentry/utils';\nimport { defineIntegration } from '../integration.js';\n\nconst INTEGRATION_NAME = 'RewriteFrames';\n\n/**\n * Rewrite event frames paths.\n */\nconst rewriteFramesIntegration = defineIntegration((options = {}) => {\n const root = options.root;\n const prefix = options.prefix || 'app:///';\n\n const isBrowser = 'window' in GLOBAL_OBJ && GLOBAL_OBJ.window !== undefined;\n\n const iteratee = options.iteratee || generateIteratee({ isBrowser, root, prefix });\n\n /** Process an exception event. */\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 (_oO) {\n return event;\n }\n }\n\n /** Process a stack trace. */\n function _processStacktrace(stacktrace) {\n return {\n ...stacktrace,\n frames: stacktrace && stacktrace.frames && stacktrace.frames.map(f => iteratee(f)),\n };\n }\n\n return {\n name: INTEGRATION_NAME,\n processEvent(originalEvent) {\n let processedEvent = originalEvent;\n\n if (originalEvent.exception && Array.isArray(originalEvent.exception.values)) {\n processedEvent = _processExceptionsEvent(processedEvent);\n }\n\n return processedEvent;\n },\n };\n});\n\n/**\n * Exported only for tests.\n */\nfunction generateIteratee({\n isBrowser,\n root,\n prefix,\n}\n\n) {\n return (frame) => {\n if (!frame.filename) {\n return frame;\n }\n\n // Determine if this is a Windows frame by checking for a Windows-style prefix such as `C:\\`\n const isWindowsFrame =\n /^[a-zA-Z]:\\\\/.test(frame.filename) ||\n // or the presence of a backslash without a forward slash (which are not allowed on Windows)\n (frame.filename.includes('\\\\') && !frame.filename.includes('/'));\n\n // Check if the frame filename begins with `/`\n const startsWithSlash = /^\\//.test(frame.filename);\n\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\n ? frame.filename\n .replace(/^[a-zA-Z]:/, '') // remove Windows-style prefix\n .replace(/\\\\/g, '/') // replace all `\\\\` instances with `/`\n : frame.filename;\n const base = root ? relative(root, filename) : basename(filename);\n frame.filename = `${prefix}${base}`;\n }\n }\n\n return frame;\n };\n}\n\nexport { generateIteratee, rewriteFramesIntegration };\n//# sourceMappingURL=rewriteframes.js.map\n","import { GLOBAL_OBJ, isError, isPlainObject, extractExceptionKeysForMessage, normalizeToSize, addExceptionTypeValue, addExceptionMechanism, isInstanceOf, resolvedSyncPromise, createStackParser, nodeStackLineParser, basename, rejectedSyncPromise, stackParserFromStackParserOptions } from '@sentry/utils';\nimport { defineIntegration, ServerRuntimeClient, createTransport, Scope, getIntegrationsToSetup } from '@sentry/core';\nexport { dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration } from '@sentry/core';\n\nfunction isObject(value) {\n return typeof value === 'object' && value !== null;\n}\nfunction isMechanism(value) {\n return (isObject(value) &&\n 'handled' in value &&\n typeof value.handled === 'boolean' &&\n 'type' in value &&\n typeof value.type === 'string');\n}\nfunction containsMechanism(value) {\n return (isObject(value) && 'mechanism' in value && isMechanism(value['mechanism']));\n}\n/**\n * Tries to find release in a global\n */\nfunction getSentryRelease() {\n // Most of the plugins from https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/ inject SENTRY_RELEASE global to the bundle\n if (GLOBAL_OBJ.SENTRY_RELEASE && GLOBAL_OBJ.SENTRY_RELEASE.id) {\n return GLOBAL_OBJ.SENTRY_RELEASE.id;\n }\n}\n/**\n * Creates an entry on existing object and returns it, or creates a new object with the entry if it doesn't exist.\n *\n * @param target\n * @param entry\n * @returns Object with new entry.\n */\nfunction setOnOptional(target, entry) {\n if (target !== undefined) {\n target[entry[0]] = entry[1];\n return target;\n }\n else {\n return { [entry[0]]: entry[1] };\n }\n}\n\n/**\n * Extracts stack frames from the error.stack string\n */\nfunction parseStackFrames(stackParser, error) {\n return stackParser(error.stack || '', 1);\n}\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex) {\n const message = ex && ex.message;\n if (!message) {\n return 'No error message';\n }\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n return message;\n}\n/**\n * Extracts stack frames from the error and builds a Sentry Exception\n */\nfunction exceptionFromError(stackParser, error) {\n const exception = {\n type: error.name || error.constructor.name,\n value: extractMessage(error),\n };\n const frames = parseStackFrames(stackParser, error);\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n return exception;\n}\n/**\n * Builds and Event from a Exception\n */\nfunction eventFromUnknownInput(sdk, stackParser, exception, hint) {\n let ex;\n const providedMechanism = hint && hint.data && containsMechanism(hint.data)\n ? hint.data.mechanism\n : undefined;\n const mechanism = providedMechanism ?? {\n handled: true,\n type: 'generic',\n };\n if (!isError(exception)) {\n if (isPlainObject(exception)) {\n // This will allow us to group events based on top-level keys\n // which is much better than creating new group when any key/value change\n const message = `Non-Error exception captured with keys: ${extractExceptionKeysForMessage(exception)}`;\n const client = sdk?.getClient();\n const normalizeDepth = client && client.getOptions().normalizeDepth;\n sdk?.setExtra('__serialized__', normalizeToSize(exception, normalizeDepth));\n ex = (hint && hint.syntheticException) || new Error(message);\n ex.message = message;\n }\n else {\n // This handles when someone does: `throw \"something awesome\";`\n // We use synthesized Error here so we can extract a (rough) stack trace.\n ex = (hint && hint.syntheticException) || new Error(exception);\n ex.message = exception;\n }\n mechanism.synthetic = true;\n }\n else {\n ex = exception;\n }\n const event = {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, mechanism);\n return {\n ...event,\n event_id: hint && hint.event_id,\n };\n}\n/**\n * Builds and Event from a Message\n */\nfunction eventFromMessage(stackParser, message, level = 'info', hint, attachStacktrace) {\n const event = {\n event_id: hint && hint.event_id,\n level,\n message,\n };\n if (attachStacktrace && hint && 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 }\n }\n return event;\n}\n\nconst DEFAULT_LIMIT = 5;\nconst linkedErrorsIntegration = defineIntegration((options = { limit: DEFAULT_LIMIT }) => {\n return {\n name: 'LinkedErrors',\n processEvent: (event, hint, client) => {\n return handler(client.getOptions().stackParser, options.limit, event, hint);\n },\n };\n});\nfunction handler(parser, limit, event, hint) {\n if (!event.exception ||\n !event.exception.values ||\n !hint ||\n !isInstanceOf(hint.originalException, Error)) {\n return event;\n }\n const linkedErrors = walkErrorTree(parser, limit, hint.originalException);\n event.exception.values = [...linkedErrors, ...event.exception.values];\n return event;\n}\nfunction walkErrorTree(parser, limit, error, stack = []) {\n if (!isInstanceOf(error.cause, Error) || stack.length + 1 >= limit) {\n return stack;\n }\n const exception = exceptionFromError(parser, error.cause);\n return walkErrorTree(parser, limit, error.cause, [\n exception,\n ...stack,\n ]);\n}\n\nconst defaultRequestDataOptions = {\n allowedHeaders: ['CF-RAY', 'CF-Worker'],\n};\nconst requestDataIntegration = defineIntegration((userOptions = {}) => {\n const options = { ...defaultRequestDataOptions, ...userOptions };\n return {\n name: 'RequestData',\n preprocessEvent: (event) => {\n const { sdkProcessingMetadata } = event;\n if (!sdkProcessingMetadata) {\n return event;\n }\n if ('request' in sdkProcessingMetadata &&\n sdkProcessingMetadata.request instanceof Request) {\n event.request = toEventRequest(sdkProcessingMetadata.request, options);\n event.user = toEventUser(event.user ?? {}, sdkProcessingMetadata.request, options);\n }\n if ('requestData' in sdkProcessingMetadata) {\n if (event.request) {\n event.request.data = sdkProcessingMetadata.requestData;\n }\n else {\n event.request = {\n data: sdkProcessingMetadata.requestData,\n };\n }\n }\n return event;\n },\n };\n});\n/**\n * Applies allowlists on existing user object.\n *\n * @param user\n * @param request\n * @param options\n * @returns New copy of user\n */\nfunction toEventUser(user, request, options) {\n const ip_address = request.headers.get('CF-Connecting-IP');\n const { allowedIps } = options;\n const newUser = { ...user };\n if (!('ip_address' in user) && // If ip_address is already set from explicitly called setUser, we don't want to overwrite it\n ip_address &&\n allowedIps !== undefined &&\n testAllowlist(ip_address, allowedIps)) {\n newUser.ip_address = ip_address;\n }\n return Object.keys(newUser).length > 0 ? newUser : undefined;\n}\n/**\n * Converts data from fetch event's Request to Sentry Request used in Sentry Event\n *\n * @param request Native Request object\n * @param options Integration options\n * @returns Sentry Request object\n */\nfunction toEventRequest(request, options) {\n // Build cookies\n const cookieString = request.headers.get('cookie');\n let cookies = undefined;\n if (cookieString) {\n try {\n cookies = parseCookie(cookieString);\n }\n catch (e) {\n // Cookie string failed to parse, no need to do anything\n }\n }\n const headers = {};\n // Build headers (omit cookie header, because we used it in the previous step)\n for (const [k, v] of request.headers.entries()) {\n if (k !== 'cookie') {\n headers[k] = v;\n }\n }\n const eventRequest = {\n method: request.method,\n cookies,\n headers,\n };\n try {\n const url = new URL(request.url);\n eventRequest.url = `${url.protocol}//${url.hostname}${url.pathname}`;\n eventRequest.query_string = url.search;\n }\n catch (e) {\n // `new URL` failed, let's try to split URL the primitive way\n const qi = request.url.indexOf('?');\n if (qi < 0) {\n // no query string\n eventRequest.url = request.url;\n }\n else {\n eventRequest.url = request.url.substr(0, qi);\n eventRequest.query_string = request.url.substr(qi + 1);\n }\n }\n // Let's try to remove sensitive data from incoming Request\n const { allowedHeaders, allowedCookies, allowedSearchParams } = options;\n if (allowedHeaders !== undefined && eventRequest.headers) {\n eventRequest.headers = applyAllowlistToObject(eventRequest.headers, allowedHeaders);\n if (Object.keys(eventRequest.headers).length === 0) {\n delete eventRequest.headers;\n }\n }\n else {\n delete eventRequest.headers;\n }\n if (allowedCookies !== undefined && eventRequest.cookies) {\n eventRequest.cookies = applyAllowlistToObject(eventRequest.cookies, allowedCookies);\n if (Object.keys(eventRequest.cookies).length === 0) {\n delete eventRequest.cookies;\n }\n }\n else {\n delete eventRequest.cookies;\n }\n if (allowedSearchParams !== undefined) {\n const params = Object.fromEntries(new URLSearchParams(eventRequest.query_string));\n const allowedParams = new URLSearchParams();\n Object.keys(applyAllowlistToObject(params, allowedSearchParams)).forEach((allowedKey) => {\n allowedParams.set(allowedKey, params[allowedKey]);\n });\n eventRequest.query_string = allowedParams.toString();\n }\n else {\n delete eventRequest.query_string;\n }\n return eventRequest;\n}\n/**\n * Helper function that tests 'allowlist' on string.\n *\n * @param target\n * @param allowlist\n * @returns True if target is allowed.\n */\nfunction testAllowlist(target, allowlist) {\n if (typeof allowlist === 'boolean') {\n return allowlist;\n }\n else if (allowlist instanceof RegExp) {\n return allowlist.test(target);\n }\n else if (Array.isArray(allowlist)) {\n const allowlistLowercased = allowlist.map((item) => item.toLowerCase());\n return allowlistLowercased.includes(target);\n }\n else {\n return false;\n }\n}\n/**\n * Helper function that applies 'allowlist' to target's entries.\n *\n * @param target\n * @param allowlist\n * @returns New object with allowed keys.\n */\nfunction applyAllowlistToObject(target, allowlist) {\n let predicate = () => false;\n if (typeof allowlist === 'boolean') {\n return allowlist ? target : {};\n }\n else if (allowlist instanceof RegExp) {\n predicate = (item) => allowlist.test(item);\n }\n else if (Array.isArray(allowlist)) {\n const allowlistLowercased = allowlist.map((item) => item.toLowerCase());\n predicate = (item) => allowlistLowercased.includes(item.toLowerCase());\n }\n else {\n return {};\n }\n return Object.keys(target)\n .filter(predicate)\n .reduce((allowed, key) => {\n allowed[key] = target[key];\n return allowed;\n }, {});\n}\n/**\n * Converts cookie string to an object.\n *\n * @param cookieString\n * @returns Object of cookie entries, or empty object if something went wrong during the conversion.\n */\nfunction parseCookie(cookieString) {\n if (typeof cookieString !== 'string') {\n return {};\n }\n try {\n return cookieString\n .split(';')\n .map((part) => part.split('='))\n .reduce((acc, [cookieKey, cookieValue]) => {\n acc[decodeURIComponent(cookieKey.trim())] = decodeURIComponent(cookieValue.trim());\n return acc;\n }, {});\n }\n catch {\n return {};\n }\n}\n\n/**\n * Installs integrations on the current scope.\n *\n * @param integrations array of integration instances\n */\nfunction setupIntegrations(integrations, sdk) {\n const integrationIndex = {};\n integrations.forEach((integration) => {\n integrationIndex[integration.name] = integration;\n // `setupOnce` is only called the first time\n if (typeof integration.setupOnce === 'function') {\n integration.setupOnce();\n }\n const client = sdk.getClient();\n if (!client) {\n return;\n }\n // `setup` is run for each client\n if (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 });\n return integrationIndex;\n}\n\n/**\n * The Cloudflare Workers SDK Client.\n */\nclass ToucanClient extends ServerRuntimeClient {\n /**\n * Some functions need to access the scope (Toucan instance) this client is bound to,\n * but calling 'getCurrentHub()' is unsafe because it uses globals.\n * So we store a reference to the Hub after binding to it and provide it to methods that need it.\n */\n #sdk = null;\n #integrationsInitialized = false;\n /**\n * Creates a new Toucan SDK instance.\n * @param options Configuration options for this SDK.\n */\n constructor(options) {\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'toucan-js',\n packages: [\n {\n name: 'npm:' + 'toucan-js',\n version: '4.0.0',\n },\n ],\n version: '4.0.0',\n };\n super(options);\n }\n /**\n * By default, integrations are stored in a global. We want to store them in a local instance because they may have contextual data, such as event request.\n */\n setupIntegrations() {\n if (this._isEnabled() && !this.#integrationsInitialized && this.#sdk) {\n this._integrations = setupIntegrations(this._options.integrations, this.#sdk);\n this.#integrationsInitialized = true;\n }\n }\n eventFromException(exception, hint) {\n return resolvedSyncPromise(eventFromUnknownInput(this.#sdk, this._options.stackParser, exception, hint));\n }\n eventFromMessage(message, level = 'info', hint) {\n return resolvedSyncPromise(eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace));\n }\n _prepareEvent(event, hint, scope) {\n event.platform = event.platform || 'javascript';\n if (this.getOptions().request) {\n // Set 'request' on sdkProcessingMetadata to be later processed by RequestData integration\n event.sdkProcessingMetadata = setOnOptional(event.sdkProcessingMetadata, [\n 'request',\n this.getOptions().request,\n ]);\n }\n if (this.getOptions().requestData) {\n // Set 'requestData' on sdkProcessingMetadata to be later processed by RequestData integration\n event.sdkProcessingMetadata = setOnOptional(event.sdkProcessingMetadata, [\n 'requestData',\n this.getOptions().requestData,\n ]);\n }\n return super._prepareEvent(event, hint, scope);\n }\n getSdk() {\n return this.#sdk;\n }\n setSdk(sdk) {\n this.#sdk = sdk;\n }\n /**\n * Sets the request body context on all future events.\n *\n * @param body Request body.\n * @example\n * const body = await request.text();\n * toucan.setRequestBody(body);\n */\n setRequestBody(body) {\n this.getOptions().requestData = body;\n }\n /**\n * Enable/disable the SDK.\n *\n * @param enabled\n */\n setEnabled(enabled) {\n this.getOptions().enabled = enabled;\n }\n}\n\n/**\n * Stack line parser for Cloudflare Workers.\n * This wraps node stack parser and adjusts root paths to match with source maps.\n *\n */\nfunction workersStackLineParser(getModule) {\n const [arg1, arg2] = nodeStackLineParser(getModule);\n const fn = (line) => {\n const result = arg2(line);\n if (result) {\n const filename = result.filename;\n // Workers runtime runs a single bundled file that is always in a virtual root\n result.abs_path =\n filename !== undefined && !filename.startsWith('/')\n ? `/${filename}`\n : filename;\n // There is no way to tell what code is in_app and what comes from dependencies (node_modules), since we have one bundled file.\n // So everything is in_app, unless an error comes from runtime function (ie. JSON.parse), which is determined by the presence of filename.\n result.in_app = filename !== undefined;\n }\n return result;\n };\n return [arg1, fn];\n}\n/**\n * Gets the module from filename.\n *\n * @param filename\n * @returns Module name\n */\nfunction getModule(filename) {\n if (!filename) {\n return;\n }\n // In Cloudflare Workers there is always only one bundled file\n return basename(filename, '.js');\n}\n/** Cloudflare Workers stack parser */\nconst defaultStackParser = createStackParser(workersStackLineParser(getModule));\n\n/**\n * Creates a Transport that uses native fetch. This transport automatically extends the Workers lifetime with 'waitUntil'.\n */\nfunction makeFetchTransport(options) {\n function makeRequest({ body, }) {\n try {\n const fetchFn = options.fetcher ?? fetch;\n const request = fetchFn(options.url, {\n method: 'POST',\n headers: options.headers,\n body,\n }).then((response) => {\n return {\n statusCode: response.status,\n headers: {\n 'retry-after': response.headers.get('Retry-After'),\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n },\n };\n });\n /**\n * Call waitUntil to extend Workers Event lifetime\n */\n if (options.context) {\n options.context.waitUntil(request);\n }\n return request;\n }\n catch (e) {\n return rejectedSyncPromise(e);\n }\n }\n return createTransport(options, makeRequest);\n}\n\n/**\n * The Cloudflare Workers SDK.\n */\nclass Toucan extends Scope {\n #options;\n constructor(options) {\n super();\n options.defaultIntegrations =\n options.defaultIntegrations === false\n ? []\n : [\n ...(Array.isArray(options.defaultIntegrations)\n ? options.defaultIntegrations\n : [\n requestDataIntegration(options.requestDataOptions),\n linkedErrorsIntegration(),\n ]),\n ];\n if (options.release === undefined) {\n const detectedRelease = getSentryRelease();\n if (detectedRelease !== undefined) {\n options.release = detectedRelease;\n }\n }\n this.#options = options;\n this.attachNewClient();\n }\n /**\n * Creates new ToucanClient and links it to this instance.\n */\n attachNewClient() {\n const client = new ToucanClient({\n ...this.#options,\n transport: makeFetchTransport,\n integrations: getIntegrationsToSetup(this.#options),\n stackParser: stackParserFromStackParserOptions(this.#options.stackParser || defaultStackParser),\n transportOptions: {\n ...this.#options.transportOptions,\n context: this.#options.context,\n },\n });\n this.setClient(client);\n client.setSdk(this);\n client.setupIntegrations();\n }\n /**\n * Sets the request body context on all future events.\n *\n * @param body Request body.\n * @example\n * const body = await request.text();\n * toucan.setRequestBody(body);\n */\n setRequestBody(body) {\n this.getClient()?.setRequestBody(body);\n }\n /**\n * Enable/disable the SDK.\n *\n * @param enabled\n */\n setEnabled(enabled) {\n this.getClient()?.setEnabled(enabled);\n }\n /**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\n captureCheckIn(checkIn, monitorConfig, scope) {\n if (checkIn.status === 'in_progress') {\n this.setContext('monitor', { slug: checkIn.monitorSlug });\n }\n const client = this.getClient();\n return client.captureCheckIn(checkIn, monitorConfig, scope);\n }\n /**\n * Add a breadcrumb to the current scope.\n */\n addBreadcrumb(breadcrumb, maxBreadcrumbs = 100) {\n const client = this.getClient();\n const max = client.getOptions().maxBreadcrumbs || maxBreadcrumbs;\n return super.addBreadcrumb(breadcrumb, max);\n }\n /**\n * Clone all data from this instance into a new Toucan instance.\n *\n * @override\n * @returns New Toucan instance.\n */\n clone() {\n // Create new scope using the same options\n const toucan = new Toucan({ ...this.#options });\n // And copy all the scope data\n toucan._breadcrumbs = [...this._breadcrumbs];\n toucan._tags = { ...this._tags };\n toucan._extra = { ...this._extra };\n toucan._contexts = { ...this._contexts };\n toucan._user = this._user;\n toucan._level = this._level;\n toucan._session = this._session;\n toucan._transactionName = this._transactionName;\n toucan._fingerprint = this._fingerprint;\n toucan._eventProcessors = [...this._eventProcessors];\n toucan._requestSession = this._requestSession;\n toucan._attachments = [...this._attachments];\n toucan._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };\n toucan._propagationContext = { ...this._propagationContext };\n toucan._lastEventId = this._lastEventId;\n return toucan;\n }\n /**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n */\n withScope(callback) {\n const toucan = this.clone();\n return callback(toucan);\n }\n}\n\nexport { Toucan, linkedErrorsIntegration, requestDataIntegration };\n","import { rewriteFramesIntegration, Toucan } from \"toucan-js\";\nimport type { ColoMetadata } from \"./types\";\n\nexport function setupSentry(\n\trequest: Request,\n\tcontext: ExecutionContext | undefined,\n\tdsn: string,\n\tclientId: string,\n\tclientSecret: string,\n\tcoloMetadata?: ColoMetadata,\n\tversionMetadata?: WorkerVersionMetadata,\n\taccountId?: number,\n\tscriptId?: number\n): Toucan | undefined {\n\t// Are we running locally without access to Sentry secrets? If so, don't initialise Sentry\n\tif (!(dsn && clientId && clientSecret)) {\n\t\treturn undefined;\n\t}\n\tconst sentry = new Toucan({\n\t\tdsn,\n\t\trequest,\n\t\tcontext,\n\t\tsampleRate: 1.0,\n\t\trelease: versionMetadata?.tag,\n\t\tintegrations: [\n\t\t\trewriteFramesIntegration({\n\t\t\t\titeratee(frame) {\n\t\t\t\t\tframe.filename = \"/index.js\";\n\t\t\t\t\treturn frame;\n\t\t\t\t},\n\t\t\t}),\n\t\t],\n\t\trequestDataOptions: {\n\t\t\tallowedHeaders: [\n\t\t\t\t\"user-agent\",\n\t\t\t\t\"cf-challenge\",\n\t\t\t\t\"accept-encoding\",\n\t\t\t\t\"accept-language\",\n\t\t\t\t\"cf-ray\",\n\t\t\t\t\"content-length\",\n\t\t\t\t\"content-type\",\n\t\t\t\t\"host\",\n\t\t\t],\n\t\t\tallowedSearchParams: /(.*)/,\n\t\t},\n\n\t\ttransportOptions: {\n\t\t\theaders: {\n\t\t\t\t\"CF-Access-Client-ID\": clientId,\n\t\t\t\t\"CF-Access-Client-Secret\": clientSecret,\n\t\t\t},\n\t\t},\n\t});\n\n\tif (coloMetadata) {\n\t\tsentry.setTag(\"colo\", coloMetadata.coloId);\n\t\tsentry.setTag(\"metal\", coloMetadata.metalId);\n\t}\n\n\tif (accountId && scriptId) {\n\t\tsentry.setTag(\"accountId\", accountId);\n\t\tsentry.setTag(\"scriptId\", scriptId);\n\t}\n\n\tsentry.setUser({ id: accountId?.toString() });\n\n\treturn sentry;\n}\n","import type { ReadyAnalytics } from \"./types\";\n\n// This will allow us to make breaking changes to the analytic schema\nconst VERSION = 1;\n\nexport enum STATIC_ROUTING_DECISION {\n\tNOT_PROVIDED = 0,\n\tNOT_ROUTED = 1,\n\tROUTED = 2,\n}\n\nexport enum DISPATCH_TYPE {\n\tASSETS = \"asset\",\n\tWORKER = \"worker\",\n}\n\n// When adding new columns please update the schema\ntype Data = {\n\t// -- Indexes --\n\taccountId?: number;\n\tscriptId?: number;\n\n\t// -- Doubles --\n\t// double1 - The time it takes for the whole request to complete in milliseconds\n\trequestTime?: number;\n\t// double2 - Colo ID\n\tcoloId?: number;\n\t// double3 - Metal ID\n\tmetalId?: number;\n\t// double4 - Colo tier (e.g. tier 1, tier 2, tier 3)\n\tcoloTier?: number;\n\t// double5 - Run user worker ahead of assets\n\tuserWorkerAhead?: boolean;\n\t// double6 - Routing performed based on the _routes.json (if provided)\n\tstaticRoutingDecision?: STATIC_ROUTING_DECISION;\n\t// double7 - Whether the request was blocked by abuse mitigation or not\n\tabuseMitigationBlocked?: boolean;\n\t// double8 - User worker invocation denied due to free tier limiting\n\tuserWorkerFreeTierLimiting?: boolean;\n\t// double9 - The time it takes for the request to be handed off the Asset Worker or user Worker in milliseconds\n\ttimeToDispatch?: number;\n\n\t// -- Blobs --\n\t// blob1 - Hostname of the request\n\thostname?: string;\n\t// blob2 - Dispatch type - what kind of thing did we dispatch\n\tdispatchtype?: DISPATCH_TYPE;\n\t// blob3 - Error message\n\terror?: string;\n\t// blob4 - The current version UUID of router-server\n\tversion?: string;\n\t// blob5 - Region of the colo (e.g. WEUR)\n\tcoloRegion?: string;\n\t// blob6 - URL for analysis\n\tabuseMitigationURLHost?: string;\n\t// blob7 - XSS detection href parameter value\n\txssDetectionImageHref?: string;\n\t// blob8 - cdn-cgi backslash bypass attempt URL\n\tcdnCgiBackslashBypassUrl?: string;\n};\n\nexport class Analytics {\n\tprivate data: Data = {};\n\tprivate readyAnalytics?: ReadyAnalytics;\n\tprivate hasWritten: boolean = false;\n\n\tconstructor(readyAnalytics?: ReadyAnalytics) {\n\t\tthis.readyAnalytics = readyAnalytics;\n\t}\n\n\tsetData(newData: Partial<Data>) {\n\t\tthis.data = { ...this.data, ...newData };\n\t}\n\n\tgetData(key: keyof Data) {\n\t\treturn this.data[key];\n\t}\n\n\twrite() {\n\t\tif (this.hasWritten) {\n\t\t\t// We've already written analytics, don't double send\n\t\t\treturn;\n\t\t} else if (!this.readyAnalytics) {\n\t\t\t// Local environment, no-op\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hasWritten = true;\n\n\t\tthis.readyAnalytics.logEvent({\n\t\t\tversion: VERSION,\n\t\t\taccountId: this.data.accountId,\n\t\t\tindexId: this.data.scriptId?.toString(),\n\t\t\tdoubles: [\n\t\t\t\tthis.data.requestTime ?? -1, // double1\n\t\t\t\tthis.data.coloId ?? -1, // double2\n\t\t\t\tthis.data.metalId ?? -1, // double3\n\t\t\t\tthis.data.coloTier ?? -1, // double4\n\t\t\t\tthis.data.userWorkerAhead === undefined // double5\n\t\t\t\t\t? -1\n\t\t\t\t\t: Number(this.data.userWorkerAhead),\n\t\t\t\tthis.data.staticRoutingDecision ?? STATIC_ROUTING_DECISION.NOT_PROVIDED, // double6\n\t\t\t\tthis.data.abuseMitigationBlocked ? 1 : 0, // double7\n\t\t\t\tthis.data.userWorkerFreeTierLimiting ? 1 : 0, // double8\n\t\t\t\tthis.data.timeToDispatch ?? -1, // double9\n\t\t\t],\n\t\t\tblobs: [\n\t\t\t\tthis.data.hostname?.substring(0, 256), // blob1 - trim to 256 bytes\n\t\t\t\tthis.data.dispatchtype, // blob2\n\t\t\t\tthis.data.error?.substring(0, 256), // blob3 - trim to 256 bytes\n\t\t\t\tthis.data.version, // blob4\n\t\t\t\tthis.data.coloRegion, // blob5\n\t\t\t\tthis.data.abuseMitigationURLHost, // blob6\n\t\t\t\tthis.data.xssDetectionImageHref, // blob7\n\t\t\t\tthis.data.cdnCgiBackslashBypassUrl?.substring(0, 256), // blob8 - trim to 256 bytes\n\t\t\t],\n\t\t});\n\t}\n}\n","import type { EyeballRouterConfig, RouterConfig } from \"../../utils/types\";\n\ntype RequiredEyeballRouterConfig = Required<Exclude<EyeballRouterConfig, null>>;\n\nexport const applyRouterConfigDefaults = (\n\tconfiguration?: RouterConfig\n): Required<RouterConfig> => {\n\treturn {\n\t\tinvoke_user_worker_ahead_of_assets:\n\t\t\tconfiguration?.invoke_user_worker_ahead_of_assets ?? false,\n\t\thas_user_worker: configuration?.has_user_worker ?? false,\n\t\taccount_id: configuration?.account_id ?? -1,\n\t\tscript_id: configuration?.script_id ?? -1,\n\t\tdebug: configuration?.debug ?? false,\n\t\tstatic_routing: configuration?.static_routing ?? {\n\t\t\tuser_worker: [],\n\t\t},\n\t};\n};\n\nexport const applyEyeballConfigDefaults = (\n\teyeballConfiguration?: EyeballRouterConfig\n): RequiredEyeballRouterConfig => {\n\treturn {\n\t\tlimitedAssetsOnly: eyeballConfiguration?.limitedAssetsOnly ?? false,\n\t};\n};\n","function formatDate(date: Date) {\n\tconst formatter = new Intl.DateTimeFormat(\"en-CA\", {\n\t\t// en-CA for YYYY-MM-DD\n\t\tyear: \"numeric\",\n\t\tmonth: \"2-digit\",\n\t\tday: \"2-digit\",\n\t\thour: \"2-digit\",\n\t\tminute: \"2-digit\",\n\t\tsecond: \"2-digit\",\n\t\thourCycle: \"h23\", // Ensures 24-hour format\n\t\ttimeZone: \"UTC\",\n\t});\n\tconst parts = formatter.formatToParts(date);\n\tlet year, month, day, hour, minute, second;\n\tfor (const part of parts) {\n\t\tswitch (part.type) {\n\t\t\tcase \"year\":\n\t\t\t\tyear = part.value;\n\t\t\t\tbreak;\n\t\t\tcase \"month\":\n\t\t\t\tmonth = part.value;\n\t\t\t\tbreak;\n\t\t\tcase \"day\":\n\t\t\t\tday = part.value;\n\t\t\t\tbreak;\n\t\t\tcase \"hour\":\n\t\t\t\thour = part.value;\n\t\t\t\tbreak;\n\t\t\tcase \"minute\":\n\t\t\t\tminute = part.value;\n\t\t\t\tbreak;\n\t\t\tcase \"second\":\n\t\t\t\tsecond = part.value;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn `${year}-${month}-${day} ${hour}:${minute}:${second} UTC`;\n}\n\nexport function renderLimitedResponse(req: Request) {\n\tconst hostname = new URL(req.url).hostname;\n\tconst ip = req.headers.get(\"cf-connecting-ip\") ?? \"\";\n\tconst ray = req.headers.get(\"cf-ray\") ?? \"\";\n\tconst date = formatDate(new Date());\n\n\treturn `\n\t<!doctype html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]> <html class=\"no-js ie7 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 8]> <html class=\"no-js ie8 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if gt IE 8]><!-->\n<html class=\"no-js\" lang=\"en-US\">\n <!--<![endif]-->\n <head>\n <title>\n This website has been temporarily rate limited |\n ${hostname} | Cloudflare\n </title>\n <meta charset=\"UTF-8\" />\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\" />\n <meta name=\"robots\" content=\"noindex, nofollow\" />\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n <!--[if lt IE 9\n ]><link\n rel=\"stylesheet\"\n id=\"cf_styles-ie-css\"\n href=\"/cdn-cgi/styles/cf.errors.ie.css\"\n /><![endif]-->\n <style>\n #cf-wrapper a,\n #cf-wrapper abbr,\n #cf-wrapper article,\n #cf-wrapper aside,\n #cf-wrapper b,\n #cf-wrapper big,\n #cf-wrapper blockquote,\n #cf-wrapper body,\n #cf-wrapper canvas,\n #cf-wrapper caption,\n #cf-wrapper center,\n #cf-wrapper cite,\n #cf-wrapper code,\n #cf-wrapper dd,\n #cf-wrapper del,\n #cf-wrapper details,\n #cf-wrapper dfn,\n #cf-wrapper div,\n #cf-wrapper dl,\n #cf-wrapper dt,\n #cf-wrapper em,\n #cf-wrapper embed,\n #cf-wrapper fieldset,\n #cf-wrapper figcaption,\n #cf-wrapper figure,\n #cf-wrapper footer,\n #cf-wrapper form,\n #cf-wrapper h1,\n #cf-wrapper h2,\n #cf-wrapper h3,\n #cf-wrapper h4,\n #cf-wrapper h5,\n #cf-wrapper h6,\n #cf-wrapper header,\n #cf-wrapper hgroup,\n #cf-wrapper html,\n #cf-wrapper i,\n #cf-wrapper iframe,\n #cf-wrapper img,\n #cf-wrapper label,\n #cf-wrapper legend,\n #cf-wrapper li,\n #cf-wrapper mark,\n #cf-wrapper menu,\n #cf-wrapper nav,\n #cf-wrapper object,\n #cf-wrapper ol,\n #cf-wrapper output,\n #cf-wrapper p,\n #cf-wrapper pre,\n #cf-wrapper s,\n #cf-wrapper samp,\n #cf-wrapper section,\n #cf-wrapper small,\n #cf-wrapper span,\n #cf-wrapper strike,\n #cf-wrapper strong,\n #cf-wrapper sub,\n #cf-wrapper summary,\n #cf-wrapper sup,\n #cf-wrapper table,\n #cf-wrapper tbody,\n #cf-wrapper td,\n #cf-wrapper tfoot,\n #cf-wrapper th,\n #cf-wrapper thead,\n #cf-wrapper tr,\n #cf-wrapper tt,\n #cf-wrapper u,\n #cf-wrapper ul {\n margin: 0;\n padding: 0;\n border: 0;\n font: inherit;\n font-size: 100%;\n text-decoration: none;\n vertical-align: baseline;\n }\n #cf-wrapper a img {\n border: none;\n }\n #cf-wrapper article,\n #cf-wrapper aside,\n #cf-wrapper details,\n #cf-wrapper figcaption,\n #cf-wrapper figure,\n #cf-wrapper footer,\n #cf-wrapper header,\n #cf-wrapper hgroup,\n #cf-wrapper menu,\n #cf-wrapper nav,\n #cf-wrapper section,\n #cf-wrapper summary {\n display: block;\n }\n #cf-wrapper .cf-columns:after,\n #cf-wrapper .cf-columns:before,\n #cf-wrapper .cf-section:after,\n #cf-wrapper .cf-section:before,\n #cf-wrapper .cf-wrapper:after,\n #cf-wrapper .cf-wrapper:before,\n #cf-wrapper .clearfix:after,\n #cf-wrapper .clearfix:before,\n #cf-wrapper section:after,\n #cf-wrapper section:before {\n content: \" \";\n display: table;\n }\n #cf-wrapper .cf-columns:after,\n #cf-wrapper .cf-section:after,\n #cf-wrapper .cf-wrapper:after,\n #cf-wrapper .clearfix:after,\n #cf-wrapper section:after {\n clear: both;\n }\n #cf-wrapper {\n display: block;\n margin: 0;\n padding: 0;\n position: relative;\n text-align: left;\n width: 100%;\n z-index: 999999999;\n color: #404040 !important;\n font-family:\n -apple-system,\n BlinkMacSystemFont,\n Segoe UI,\n Roboto,\n Oxygen,\n Ubuntu,\n Helvetica Neue,\n Arial,\n sans-serif !important;\n font-size: 15px !important;\n line-height: 1.5 !important;\n text-decoration: none !important;\n letter-spacing: normal;\n -webkit-tap-highlight-color: rgba(246, 139, 31, 0.3);\n -webkit-font-smoothing: antialiased;\n }\n #cf-wrapper .cf-section,\n #cf-wrapper section {\n background: 0 0;\n display: block;\n margin-bottom: 2em;\n margin-top: 2em;\n }\n #cf-wrapper .cf-wrapper {\n margin-left: auto;\n margin-right: auto;\n width: 90%;\n }\n #cf-wrapper .cf-columns {\n display: block;\n list-style: none;\n padding: 0;\n width: 100%;\n }\n #cf-wrapper .cf-columns img,\n #cf-wrapper .cf-columns input,\n #cf-wrapper .cf-columns object,\n #cf-wrapper .cf-columns select,\n #cf-wrapper .cf-columns textarea {\n max-width: 100%;\n }\n #cf-wrapper .cf-columns > .cf-column {\n float: left;\n padding-bottom: 45px;\n width: 100%;\n box-sizing: border-box;\n }\n @media screen and (min-width: 49.2em) {\n #cf-wrapper .cf-columns.cols-2 > .cf-column:nth-child(n + 3),\n #cf-wrapper .cf-columns.cols-3 > .cf-column:nth-child(n + 4),\n #cf-wrapper .cf-columns.cols-4 > .cf-column:nth-child(n + 3),\n #cf-wrapper .cf-columns.four > .cf-column:nth-child(n + 3),\n #cf-wrapper .cf-columns.three > .cf-column:nth-child(n + 4),\n #cf-wrapper .cf-columns.two > .cf-column:nth-child(n + 3) {\n padding-top: 67.5px;\n }\n #cf-wrapper .cf-columns > .cf-column {\n padding-bottom: 0;\n }\n #cf-wrapper .cf-columns.cols-2 > .cf-column,\n #cf-wrapper .cf-columns.cols-4 > .cf-column,\n #cf-wrapper .cf-columns.four > .cf-column,\n #cf-wrapper .cf-columns.two > .cf-column {\n padding-left: 0;\n padding-right: 22.5px;\n width: 50%;\n }\n #cf-wrapper .cf-columns.cols-2 > .cf-column:nth-child(2n),\n #cf-wrapper .cf-columns.cols-4 > .cf-column:nth-child(2n),\n #cf-wrapper .cf-columns.four > .cf-column:nth-child(2n),\n #cf-wrapper .cf-columns.two > .cf-column:nth-child(2n) {\n padding-left: 22.5px;\n padding-right: 0;\n }\n #cf-wrapper .cf-columns.cols-2 > .cf-column:nth-child(odd),\n #cf-wrapper .cf-columns.cols-4 > .cf-column:nth-child(odd),\n #cf-wrapper .cf-columns.four > .cf-column:nth-child(odd),\n #cf-wrapper .cf-columns.two > .cf-column:nth-child(odd) {\n clear: left;\n }\n #cf-wrapper .cf-columns.cols-3 > .cf-column,\n #cf-wrapper .cf-columns.three > .cf-column {\n padding-left: 30px;\n width: 33.3333333333333%;\n }\n #cf-wrapper .cf-columns.cols-3 > .cf-column:first-child,\n #cf-wrapper .cf-columns.cols-3 > .cf-column:nth-child(3n + 1),\n #cf-wrapper .cf-columns.three > .cf-column:first-child,\n #cf-wrapper .cf-columns.three > .cf-column:nth-child(3n + 1) {\n clear: left;\n padding-left: 0;\n padding-right: 30px;\n }\n #cf-wrapper .cf-columns.cols-3 > .cf-column:nth-child(3n + 2),\n #cf-wrapper .cf-columns.three > .cf-column:nth-child(3n + 2) {\n padding-left: 15px;\n padding-right: 15px;\n }\n #cf-wrapper .cf-columns.cols-3 > .cf-column:nth-child(-n + 3),\n #cf-wrapper .cf-columns.three > .cf-column:nth-child(-n + 3) {\n padding-top: 0;\n }\n }\n @media screen and (min-width: 66em) {\n #cf-wrapper .cf-columns > .cf-column {\n padding-bottom: 0;\n }\n #cf-wrapper .cf-columns.cols-4 > .cf-column,\n #cf-wrapper .cf-columns.four > .cf-column {\n padding-left: 33.75px;\n width: 25%;\n }\n #cf-wrapper .cf-columns.cols-4 > .cf-column:nth-child(odd),\n #cf-wrapper .cf-columns.four > .cf-column:nth-child(odd) {\n clear: none;\n }\n #cf-wrapper .cf-columns.cols-4 > .cf-column:first-child,\n #cf-wrapper .cf-columns.cols-4 > .cf-column:nth-child(4n + 1),\n #cf-wrapper .cf-columns.four > .cf-column:first-child,\n #cf-wrapper .cf-columns.four > .cf-column:nth-child(4n + 1) {\n clear: left;\n padding-left: 0;\n padding-right: 33.75px;\n }\n #cf-wrapper .cf-columns.cols-4 > .cf-column:nth-child(4n + 2),\n #cf-wrapper .cf-columns.four > .cf-column:nth-child(4n + 2) {\n padding-left: 11.25px;\n padding-right: 22.5px;\n }\n #cf-wrapper .cf-columns.cols-4 > .cf-column:nth-child(4n + 3),\n #cf-wrapper .cf-columns.four > .cf-column:nth-child(4n + 3) {\n padding-left: 22.5px;\n padding-right: 11.25px;\n }\n #cf-wrapper .cf-columns.cols-4 > .cf-column:nth-child(n + 5),\n #cf-wrapper .cf-columns.four > .cf-column:nth-child(n + 5) {\n padding-top: 67.5px;\n }\n #cf-wrapper .cf-columns.cols-4 > .cf-column:nth-child(-n + 4),\n #cf-wrapper .cf-columns.four > .cf-column:nth-child(-n + 4) {\n padding-top: 0;\n }\n }\n #cf-wrapper a {\n background: 0 0;\n border: 0;\n color: #0051c3;\n outline: 0;\n text-decoration: none;\n -webkit-transition: all 0.15s ease;\n transition: all 0.15s ease;\n }\n #cf-wrapper a:hover {\n background: 0 0;\n border: 0;\n color: #f68b1f;\n }\n #cf-wrapper a:focus {\n background: 0 0;\n border: 0;\n color: #62a1d8;\n outline: 0;\n }\n #cf-wrapper a:active {\n background: 0 0;\n border: 0;\n color: #c16508;\n outline: 0;\n }\n #cf-wrapper h1,\n #cf-wrapper h2,\n #cf-wrapper h3,\n #cf-wrapper h4,\n #cf-wrapper h5,\n #cf-wrapper h6,\n #cf-wrapper p {\n color: #404040;\n margin: 0;\n padding: 0;\n }\n #cf-wrapper h1,\n #cf-wrapper h2,\n #cf-wrapper h3 {\n font-weight: 400;\n }\n #cf-wrapper h4,\n #cf-wrapper h5,\n #cf-wrapper h6,\n #cf-wrapper strong {\n font-weight: 600;\n }\n #cf-wrapper h1 {\n font-size: 36px;\n line-height: 1.2;\n }\n #cf-wrapper h2 {\n font-size: 30px;\n line-height: 1.3;\n }\n #cf-wrapper h3 {\n font-size: 25px;\n line-height: 1.3;\n }\n #cf-wrapper h4 {\n font-size: 20px;\n line-height: 1.3;\n }\n #cf-wrapper h5 {\n font-size: 15px;\n }\n #cf-wrapper h6 {\n font-size: 13px;\n }\n #cf-wrapper ol,\n #cf-wrapper ul {\n list-style: none;\n margin-left: 3em;\n }\n #cf-wrapper ul {\n list-style-type: disc;\n }\n #cf-wrapper ol {\n list-style-type: decimal;\n }\n #cf-wrapper em {\n font-style: italic;\n }\n #cf-wrapper .cf-subheadline {\n color: #595959;\n font-weight: 300;\n }\n #cf-wrapper .cf-text-error {\n color: #bd2426;\n }\n #cf-wrapper .cf-text-success {\n color: #9bca3e;\n }\n #cf-wrapper ol + h2,\n #cf-wrapper ol + h3,\n #cf-wrapper ol + h4,\n #cf-wrapper ol + h5,\n #cf-wrapper ol + h6,\n #cf-wrapper ol + p,\n #cf-wrapper p + dl,\n #cf-wrapper p + ol,\n #cf-wrapper p + p,\n #cf-wrapper p + table,\n #cf-wrapper p + ul,\n #cf-wrapper ul + h2,\n #cf-wrapper ul + h3,\n #cf-wrapper ul + h4,\n #cf-wrapper ul + h5,\n #cf-wrapper ul + h6,\n #cf-wrapper ul + p {\n margin-top: 1.5em;\n }\n #cf-wrapper h1 + p,\n #cf-wrapper p + h1,\n #cf-wrapper p + h2,\n #cf-wrapper p + h3,\n #cf-wrapper p + h4,\n #cf-wrapper p + h5,\n #cf-wrapper p + h6 {\n margin-top: 1.25em;\n }\n #cf-wrapper h1 + h2,\n #cf-wrapper h1 + h3,\n #cf-wrapper h2 + h3,\n #cf-wrapper h3 + h4,\n #cf-wrapper h4 + h5 {\n margin-top: 0.25em;\n }\n #cf-wrapper h2 + p {\n margin-top: 1em;\n }\n #cf-wrapper h1 + h4,\n #cf-wrapper h1 + h5,\n #cf-wrapper h1 + h6,\n #cf-wrapper h2 + h4,\n #cf-wrapper h2 + h5,\n #cf-wrapper h2 + h6,\n #cf-wrapper h3 + h5,\n #cf-wrapper h3 + h6,\n #cf-wrapper h3 + p,\n #cf-wrapper h4 + p,\n #cf-wrapper h5 + ol,\n #cf-wrapper h5 + p,\n #cf-wrapper h5 + ul {\n margin-top: 0.5em;\n }\n #cf-wrapper .cf-btn {\n background-color: transparent;\n border: 1px solid #999;\n color: #404040;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.2;\n margin: 0;\n padding: 0.6em 1.33333em 0.53333em;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: -moz-inline-stack;\n display: inline-block;\n vertical-align: middle;\n zoom: 1;\n border-radius: 2px;\n box-sizing: border-box;\n -webkit-transition: all 0.2s ease;\n transition: all 0.2s ease;\n }\n #cf-wrapper .cf-btn:hover {\n background-color: #bfbfbf;\n border: 1px solid #737373;\n color: #fff;\n }\n #cf-wrapper .cf-btn:focus {\n color: inherit;\n outline: 0;\n box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);\n }\n #cf-wrapper .cf-btn.active,\n #cf-wrapper .cf-btn:active {\n background-color: #bfbfbf;\n border: 1px solid #404040;\n color: #272727;\n }\n #cf-wrapper .cf-btn::-moz-focus-inner {\n padding: 0;\n border: 0;\n }\n #cf-wrapper .cf-btn .cf-caret {\n border-top-color: currentColor;\n margin-left: 0.25em;\n margin-top: 0.18333em;\n }\n #cf-wrapper .cf-btn-primary {\n background-color: #2f7bbf;\n border: 1px solid transparent;\n color: #fff;\n }\n #cf-wrapper .cf-btn-primary:hover {\n background-color: #62a1d8;\n border: 1px solid #2f7bbf;\n color: #fff;\n }\n #cf-wrapper .cf-btn-primary.active,\n #cf-wrapper .cf-btn-primary:active,\n #cf-wrapper .cf-btn-primary:focus {\n background-color: #62a1d8;\n border: 1px solid #163959;\n color: #fff;\n }\n #cf-wrapper .cf-btn-danger,\n #cf-wrapper .cf-btn-error,\n #cf-wrapper .cf-btn-important {\n background-color: #bd2426;\n border-color: transparent;\n color: #fff;\n }\n #cf-wrapper .cf-btn-danger:hover,\n #cf-wrapper .cf-btn-error:hover,\n #cf-wrapper .cf-btn-important:hover {\n background-color: #de5052;\n border-color: #bd2426;\n color: #fff;\n }\n #cf-wrapper .cf-btn-danger.active,\n #cf-wrapper .cf-btn-danger:active,\n #cf-wrapper .cf-btn-danger:focus,\n #cf-wrapper .cf-btn-error.active,\n #cf-wrapper .cf-btn-error:active,\n #cf-wrapper .cf-btn-error:focus,\n #cf-wrapper .cf-btn-important.active,\n #cf-wrapper .cf-btn-important:active,\n #cf-wrapper .cf-btn-important:focus {\n background-color: #de5052;\n border-color: #521010;\n color: #fff;\n }\n #cf-wrapper .cf-btn-accept,\n #cf-wrapper .cf-btn-success {\n background-color: #9bca3e;\n border: 1px solid transparent;\n color: #fff;\n }\n #cf-wrapper .cf-btn-accept:hover,\n #cf-wrapper .cf-btn-success:hover {\n background-color: #bada7a;\n border: 1px solid #9bca3e;\n color: #fff;\n }\n #cf-wrapper .active.cf-btn-accept,\n #cf-wrapper .cf-btn-accept:active,\n #cf-wrapper .cf-btn-accept:focus,\n #cf-wrapper .cf-btn-success.active,\n #cf-wrapper .cf-btn-success:active,\n #cf-wrapper .cf-btn-success:focus {\n background-color: #bada7a;\n border: 1px solid #516b1d;\n color: #fff;\n }\n #cf-wrapper .cf-btn-accept {\n color: transparent;\n font-size: 0;\n height: 36.38px;\n overflow: hidden;\n position: relative;\n text-indent: 0;\n width: 36.38px;\n white-space: nowrap;\n }\n #cf-wrapper input,\n #cf-wrapper select,\n #cf-wrapper textarea {\n background: #fff !important;\n border: 1px solid #999 !important;\n color: #404040 !important;\n font-size: 0.86667em !important;\n line-height: 1.24 !important;\n margin: 0 0 1em !important;\n max-width: 100% !important;\n outline: 0 !important;\n padding: 0.45em 0.75em !important;\n vertical-align: middle !important;\n display: -moz-inline-stack;\n display: inline-block;\n zoom: 1;\n box-sizing: border-box;\n -webkit-transition: all 0.2s ease;\n transition: all 0.2s ease;\n border-radius: 2px;\n }\n #cf-wrapper input:hover,\n #cf-wrapper select:hover,\n #cf-wrapper textarea:hover {\n border-color: gray;\n }\n #cf-wrapper input:focus,\n #cf-wrapper select:focus,\n #cf-wrapper textarea:focus {\n border-color: #2f7bbf;\n outline: 0;\n box-shadow: 0 0 8px rgba(47, 123, 191, 0.5);\n }\n #cf-wrapper fieldset {\n width: 100%;\n }\n #cf-wrapper label {\n display: block;\n font-size: 13px;\n margin-bottom: 0.38333em;\n }\n #cf-wrapper .cf-form-stacked .select2-container,\n #cf-wrapper .cf-form-stacked input,\n #cf-wrapper .cf-form-stacked select,\n #cf-wrapper .cf-form-stacked textarea {\n display: block;\n width: 100%;\n }\n #cf-wrapper .cf-form-stacked input[type=\"button\"],\n #cf-wrapper .cf-form-stacked input[type=\"checkbox\"],\n #cf-wrapper .cf-form-stacked input[type=\"submit\"] {\n display: -moz-inline-stack;\n display: inline-block;\n vertical-align: middle;\n zoom: 1;\n width: auto;\n }\n #cf-wrapper .cf-form-actions {\n text-align: right;\n }\n #cf-wrapper .cf-alert {\n background-color: #f9b169;\n border: 1px solid #904b06;\n color: #404040;\n font-size: 13px;\n padding: 7.5px 15px;\n position: relative;\n vertical-align: middle;\n border-radius: 2px;\n }\n #cf-wrapper .cf-alert:empty {\n display: none;\n }\n #cf-wrapper .cf-alert .cf-close {\n border: 1px solid transparent;\n color: inherit;\n font-size: 18.75px;\n line-height: 1;\n padding: 0;\n position: relative;\n right: -18.75px;\n top: 0;\n }\n #cf-wrapper .cf-alert .cf-close:hover {\n background-color: transparent;\n border-color: currentColor;\n color: inherit;\n }\n #cf-wrapper .cf-alert-danger,\n #cf-wrapper .cf-alert-error {\n background-color: #de5052;\n border-color: #521010;\n color: #fff;\n }\n #cf-wrapper .cf-alert-success {\n background-color: #bada7a;\n border-color: #516b1d;\n color: #516b1d;\n }\n #cf-wrapper .cf-alert-warning {\n background-color: #f9b169;\n border-color: #904b06;\n color: #404040;\n }\n #cf-wrapper .cf-alert-info {\n background-color: #62a1d8;\n border-color: #163959;\n color: #163959;\n }\n #cf-wrapper .cf-alert-nonessential {\n background-color: #ebebeb;\n border-color: #999;\n color: #404040;\n }\n #cf-wrapper .cf-icon-exclamation-sign {\n background: url(/cdn-cgi/images/icon-exclamation.png?1376755637)\n 50% no-repeat;\n height: 54px;\n width: 54px;\n display: -moz-inline-stack;\n display: inline-block;\n vertical-align: middle;\n zoom: 1;\n }\n #cf-wrapper h1 .cf-icon-exclamation-sign {\n margin-top: -10px;\n }\n #cf-wrapper #cf-error-banner {\n background-color: #fff;\n border-bottom: 3px solid #f68b1f;\n padding: 15px 15px 20px;\n position: relative;\n z-index: 999999999;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);\n }\n #cf-wrapper #cf-error-banner h4,\n #cf-wrapper #cf-error-banner p {\n display: -moz-inline-stack;\n display: inline-block;\n vertical-align: bottom;\n zoom: 1;\n }\n #cf-wrapper #cf-error-banner h4 {\n color: #2f7bbf;\n font-weight: 400;\n font-size: 20px;\n line-height: 1;\n vertical-align: baseline;\n }\n #cf-wrapper #cf-error-banner .cf-error-actions {\n margin-bottom: 10px;\n text-align: center;\n width: 100%;\n }\n #cf-wrapper #cf-error-banner .cf-error-actions a {\n display: -moz-inline-stack;\n display: inline-block;\n vertical-align: middle;\n zoom: 1;\n }\n #cf-wrapper #cf-error-banner .cf-error-actions a + a {\n margin-left: 10px;\n }\n #cf-wrapper #cf-error-banner .cf-error-actions .cf-btn-accept,\n #cf-wrapper #cf-error-banner .cf-error-actions .cf-btn-success {\n color: #fff;\n }\n #cf-wrapper #cf-error-banner .error-header-desc {\n text-align: left;\n }\n #cf-wrapper #cf-error-banner .cf-close {\n color: #999;\n cursor: pointer;\n display: inline-block;\n font-size: 34.5px;\n float: none;\n font-weight: 700;\n height: 22.5px;\n line-height: 0.6;\n overflow: hidden;\n position: absolute;\n right: 20px;\n top: 25px;\n text-indent: 200%;\n width: 22.5px;\n }\n #cf-wrapper #cf-error-banner .cf-close:hover {\n color: gray;\n }\n #cf-wrapper #cf-error-banner .cf-close:before {\n content: \"\\\\00D7\";\n left: 0;\n height: 100%;\n position: absolute;\n text-align: center;\n text-indent: 0;\n top: 0;\n width: 100%;\n }\n #cf-inline-error-wrapper {\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);\n }\n #cf-wrapper #cf-error-details {\n background: #fff;\n }\n #cf-wrapper #cf-error-details .cf-error-overview {\n padding: 25px 0 0;\n }\n #cf-wrapper #cf-error-details .cf-error-overview h1,\n #cf-wrapper #cf-error-details .cf-error-overview h2 {\n font-weight: 300;\n }\n #cf-wrapper #cf-error-details .cf-error-overview h2 {\n margin-top: 0;\n }\n #cf-wrapper #cf-error-details .cf-highlight {\n background: #ebebeb;\n overflow-x: hidden;\n padding: 30px 0;\n background-image: -webkit-gradient(\n linear,\n left top,\n left bottom,\n from(#dedede),\n color-stop(3%, #ebebeb),\n color-stop(97%, #ebebeb),\n to(#dedede)\n );\n background-image: linear-gradient(\n top,\n #dedede,\n #ebebeb 3%,\n #ebebeb 97%,\n #dedede\n );\n }\n #cf-wrapper #cf-error-details .cf-highlight h3 {\n color: #999;\n font-weight: 300;\n }\n #cf-wrapper #cf-error-details .cf-highlight .cf-column:last-child {\n padding-bottom: 0;\n }\n #cf-wrapper #cf-error-details .cf-highlight .cf-highlight-inverse {\n background-color: #fff;\n padding: 15px;\n border-radius: 2px;\n }\n #cf-wrapper #cf-error-details .cf-status-display h3 {\n margin-top: 0.5em;\n }\n #cf-wrapper #cf-error-details .cf-status-label {\n color: #9bca3e;\n font-size: 1.46667em;\n }\n #cf-wrapper #cf-error-details .cf-status-label,\n #cf-wrapper #cf-error-details .cf-status-name {\n display: inline;\n }\n #cf-wrapper #cf-error-details .cf-status-item {\n display: block;\n position: relative;\n text-align: left;\n }\n #cf-wrapper #cf-error-details .cf-status-item,\n #cf-wrapper #cf-error-details .cf-status-item.cf-column {\n padding-bottom: 1.5em;\n }\n #cf-wrapper #cf-error-details .cf-status-item.cf-error-source {\n display: block;\n text-align: center;\n }\n #cf-wrapper\n #cf-error-details\n .cf-status-item.cf-error-source:after {\n bottom: -60px;\n content: \"\";\n display: none;\n border-bottom: 18px solid #fff;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n height: 0;\n left: 50%;\n margin-left: -9px;\n position: absolute;\n right: 50%;\n width: 0;\n }\n #cf-wrapper #cf-error-details .cf-status-item + .cf-status-item {\n border-top: 1px solid #dedede;\n padding-top: 1.5em;\n }\n #cf-wrapper\n #cf-error-details\n .cf-status-item\n + .cf-status-item:before {\n background: url(/cdn-cgi/images/cf-icon-horizontal-arrow.png)\n no-repeat;\n content: \"\";\n display: block;\n left: 0;\n position: absolute;\n top: 25.67px;\n }\n #cf-wrapper\n #cf-error-details\n .cf-error-source\n .cf-icon-error-container {\n height: 85px;\n margin-bottom: 2.5em;\n }\n #cf-wrapper #cf-error-details .cf-error-source .cf-status-label {\n color: #bd2426;\n }\n #cf-wrapper #cf-error-details .cf-error-source .cf-icon {\n display: block;\n }\n #cf-wrapper #cf-error-details .cf-error-source .cf-icon-status {\n bottom: -10px;\n left: 50%;\n top: auto;\n right: auto;\n }\n #cf-wrapper #cf-error-details .cf-error-source .cf-status-label,\n #cf-wrapper #cf-error-details .cf-error-source .cf-status-name {\n display: block;\n }\n #cf-wrapper #cf-error-details .cf-icon-error-container {\n height: auto;\n position: relative;\n }\n #cf-wrapper #cf-error-details .cf-icon-status {\n display: block;\n margin-left: -24px;\n position: absolute;\n top: 0;\n right: 0;\n }\n #cf-wrapper #cf-error-details .cf-icon {\n display: none;\n margin: 0 auto;\n }\n #cf-wrapper #cf-error-details .cf-status-desc {\n display: block;\n height: 22.5px;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 100%;\n white-space: nowrap;\n }\n #cf-wrapper #cf-error-details .cf-status-desc:empty {\n display: none;\n }\n #cf-wrapper #cf-error-details .cf-error-footer {\n padding: 1.33333em 0;\n border-top: 1px solid #ebebeb;\n text-align: center;\n }\n #cf-wrapper #cf-error-details .cf-error-footer p {\n font-size: 13px;\n }\n #cf-wrapper #cf-error-details .cf-error-footer select {\n margin: 0 !important;\n }\n #cf-wrapper #cf-error-details .cf-footer-item {\n display: block;\n margin-bottom: 5px;\n text-align: left;\n }\n #cf-wrapper #cf-error-details .cf-footer-separator {\n display: none;\n }\n #cf-wrapper #cf-error-details .cf-captcha-info {\n margin-bottom: 10px;\n position: relative;\n text-align: center;\n }\n #cf-wrapper #cf-error-details .cf-captcha-image {\n height: 57px;\n width: 300px;\n }\n #cf-wrapper #cf-error-details .cf-captcha-actions {\n margin-top: 15px;\n }\n #cf-wrapper #cf-error-details .cf-captcha-actions a {\n font-size: 0;\n height: 36.38px;\n overflow: hidden;\n padding-left: 1.2em;\n padding-right: 1.2em;\n position: relative;\n text-indent: -9999px;\n width: 36.38px;\n white-space: nowrap;\n }\n #cf-wrapper\n #cf-error-details\n .cf-captcha-actions\n a.cf-icon-refresh\n span {\n background-position: 0 -787px;\n }\n #cf-wrapper\n #cf-error-details\n .cf-captcha-actions\n a.cf-icon-announce\n span {\n background-position: 0 -767px;\n }\n #cf-wrapper\n #cf-error-details\n .cf-captcha-actions\n a.cf-icon-question\n span {\n background-position: 0 -827px;\n }\n #cf-wrapper #cf-error-details .cf-screenshot-container {\n background: url(/cdn-cgi/images/browser-bar.png?1376755637)\n no-repeat #fff;\n max-height: 400px;\n max-width: 100%;\n overflow: hidden;\n padding-top: 53px;\n width: 960px;\n border-radius: 5px 5px 0 0;\n }\n #cf-wrapper\n #cf-error-details\n .cf-screenshot-container\n .cf-no-screenshot {\n background: url(/cdn-cgi/images/cf-no-screenshot-warn.png)\n no-repeat;\n display: block;\n height: 158px;\n left: 25%;\n margin-top: -79px;\n overflow: hidden;\n position: relative;\n top: 50%;\n width: 178px;\n }\n #cf-wrapper\n #cf-error-details\n .cf-captcha-container\n .cf-screenshot-container,\n #cf-wrapper\n #cf-error-details\n .cf-captcha-container\n .cf-screenshot-container\n img,\n #recaptcha-widget .cf-alert,\n #recaptcha-widget .recaptcha_only_if_audio,\n .cf-cookie-error {\n display: none;\n }\n #cf-wrapper\n #cf-error-details\n .cf-screenshot-container\n .cf-no-screenshot.error {\n background: url(/cdn-cgi/images/cf-no-screenshot-error.png)\n no-repeat;\n height: 175px;\n }\n #cf-wrapper\n #cf-error-details\n .cf-screenshot-container.cf-screenshot-full\n .cf-no-screenshot {\n left: 50%;\n margin-left: -89px;\n }\n .cf-captcha-info iframe {\n max-width: 100%;\n }\n #cf-wrapper .cf-icon-ok {\n background: url(/cdn-cgi/images/cf-icon-ok.png) no-repeat;\n height: 48px;\n width: 48px;\n }\n #cf-wrapper .cf-icon-error {\n background: url(/cdn-cgi/images/cf-icon-error.png) no-repeat;\n height: 48px;\n width: 48px;\n }\n #cf-wrapper .cf-icon-browser {\n background: url(/cdn-cgi/images/cf-icon-browser.png) no-repeat;\n height: 80px;\n width: 100px;\n }\n #cf-wrapper .cf-icon-cloud {\n background: url(/cdn-cgi/images/cf-icon-cloud.png) no-repeat;\n height: 77px;\n width: 151px;\n }\n #cf-wrapper .cf-icon-server {\n background: url(/cdn-cgi/images/cf-icon-server.png) no-repeat;\n height: 75px;\n width: 95px;\n }\n #cf-wrapper .cf-caret {\n border: 0.33333em solid transparent;\n border-top-color: inherit;\n content: \"\";\n height: 0;\n width: 0;\n display: -moz-inline-stack;\n display: inline-block;\n vertical-align: middle;\n zoom: 1;\n }\n @media screen and (min-width: 49.2em) {\n #cf-wrapper #cf-error-details .cf-status-desc:empty,\n #cf-wrapper\n #cf-error-details\n .cf-status-item.cf-error-source:after,\n #cf-wrapper #cf-error-details .cf-status-item .cf-icon,\n #cf-wrapper #cf-error-details .cf-status-label,\n #cf-wrapper #cf-error-details .cf-status-name {\n display: block;\n }\n #cf-wrapper .cf-wrapper {\n width: 708px;\n }\n #cf-wrapper #cf-error-banner {\n padding: 20px 20px 25px;\n }\n #cf-wrapper #cf-error-banner .cf-error-actions {\n margin-bottom: 15px;\n }\n #cf-wrapper #cf-error-banner .cf-error-header-desc h4 {\n margin-right: 0.5em;\n }\n #cf-wrapper #cf-error-details h1 {\n font-size: 4em;\n }\n #cf-wrapper #cf-error-details .cf-error-overview {\n padding-top: 2.33333em;\n }\n #cf-wrapper #cf-error-details .cf-highlight {\n padding: 4em 0;\n }\n #cf-wrapper #cf-error-details .cf-status-item {\n text-align: center;\n }\n #cf-wrapper #cf-error-details .cf-status-item,\n #cf-wrapper #cf-error-details .cf-status-item.cf-column {\n padding-bottom: 0;\n }\n #cf-wrapper\n #cf-error-details\n .cf-status-item\n + .cf-status-item {\n border: 0;\n padding-top: 0;\n }\n #cf-wrapper\n #cf-error-details\n .cf-status-item\n + .cf-status-item:before {\n background-position: 0 -544px;\n height: 24.75px;\n margin-left: -37.5px;\n width: 75px;\n background-size: 131.25px auto;\n }\n #cf-wrapper #cf-error-details .cf-icon-error-container {\n height: 85px;\n margin-bottom: 2.5em;\n }\n #cf-wrapper #cf-error-details .cf-icon-status {\n bottom: -10px;\n left: 50%;\n top: auto;\n right: auto;\n }\n #cf-wrapper #cf-error-details .cf-error-footer {\n padding: 2.66667em 0;\n }\n #cf-wrapper #cf-error-details .cf-footer-item,\n #cf-wrapper #cf-error-details .cf-footer-separator {\n display: -moz-inline-stack;\n display: inline-block;\n vertical-align: baseline;\n zoom: 1;\n }\n #cf-wrapper #cf-error-details .cf-footer-separator {\n padding: 0 0.25em;\n }\n #cf-wrapper\n #cf-error-details\n .cf-status-item.cloudflare-status:before {\n margin-left: -50px;\n }\n #cf-wrapper\n #cf-error-details\n .cf-status-item.cloudflare-status\n + .status-item:before {\n margin-left: -25px;\n }\n #cf-wrapper #cf-error-details .cf-screenshot-container {\n height: 400px;\n margin-bottom: -4em;\n max-width: none;\n }\n #cf-wrapper\n #cf-error-details\n .cf-captcha-container\n .cf-screenshot-container,\n #cf-wrapper\n #cf-error-details\n .cf-captcha-container\n .cf-screenshot-container\n img {\n display: block;\n }\n }\n @media screen and (min-width: 66em) {\n #cf-wrapper .cf-wrapper {\n width: 960px;\n }\n #cf-wrapper #cf-error-banner .cf-close {\n position: relative;\n right: auto;\n top: auto;\n }\n #cf-wrapper #cf-error-banner .cf-details {\n white-space: nowrap;\n }\n #cf-wrapper #cf-error-banner .cf-details-link {\n padding-right: 0.5em;\n }\n #cf-wrapper #cf-error-banner .cf-error-actions {\n float: right;\n margin-bottom: 0;\n text-align: left;\n width: auto;\n }\n #cf-wrapper\n #cf-error-details\n .cf-status-item\n + .cf-status-item:before {\n background-position: 0 -734px;\n height: 33px;\n margin-left: -50px;\n width: 100px;\n background-size: auto;\n }\n #cf-wrapper\n #cf-error-details\n .cf-status-item.cf-cloudflare-status:before {\n margin-left: -66.67px;\n }\n #cf-wrapper\n #cf-error-details\n .cf-status-item.cf-cloudflare-status\n + .cf-status-item:before {\n margin-left: -37.5px;\n }\n #cf-wrapper #cf-error-details .cf-captcha-image {\n float: left;\n }\n #cf-wrapper #cf-error-details .cf-captcha-actions {\n position: absolute;\n top: 0;\n right: 0;\n }\n }\n .no-js #cf-wrapper .js-only {\n display: none;\n }\n #cf-wrapper #cf-error-details .heading-ray-id {\n font-family: monaco, courier, monospace;\n font-size: 15px;\n white-space: nowrap;\n }\n #cf-wrapper #cf-error-details .cf-footer-item.hidden,\n .cf-error-footer .hidden {\n display: none;\n }\n .cf-error-footer .cf-footer-ip-reveal-btn {\n -webkit-appearance: button;\n -moz-appearance: button;\n appearance: button;\n text-decoration: none;\n background: none;\n color: inherit;\n border: none;\n padding: 0;\n font: inherit;\n cursor: pointer;\n color: #0051c3;\n -webkit-transition: color 0.15s ease;\n transition: color 0.15s ease;\n }\n .cf-error-footer .cf-footer-ip-reveal-btn:hover {\n color: #ee730a;\n }\n </style>\n <style>\n body {\n margin: 0;\n padding: 0;\n }\n </style>\n\n <!--[if gte IE 10]><!-->\n <script>\n if (!navigator.cookieEnabled) {\n window.addEventListener(\"DOMContentLoaded\", function () {\n var cookieEl = document.getElementById(\"cookie-alert\");\n cookieEl.style.display = \"block\";\n });\n }\n </script>\n <!--<![endif]-->\n\n <style type=\"text/css\">\n body {\n margin: 0;\n padding: 0;\n }\n\n #cf-wrapper {\n font-family:\n -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto,\n Helvetica, Arial, sans-serif, \"Apple Color Emoji\",\n \"Segoe UI Emoji\", \"Segoe UI Symbol\" !important;\n }\n .cf-error-description {\n max-width: 600px;\n }\n </style>\n </head>\n <body>\n <div id=\"cf-wrapper\">\n <div\n id=\"cookie-alert\"\n class=\"cf-alert cf-alert-error cf-cookie-error\"\n data-translate=\"enable_cookies\"\n >\n Please enable cookies.\n </div>\n <div id=\"cf-error-details\" class=\"cf-error-details-wrapper\">\n <div class=\"cf-wrapper cf-header cf-error-overview\">\n <h1>\n <span\n class=\"cf-error-type\"\n data-translate=\"please check back later\"\n >Please check back later</span\n >\n </h1>\n <h2 class=\"cf-subheadline\">Error 1027</h2>\n </div>\n\n <div class=\"cf-section cf-wrapper\">\n <p>\n <span\n style=\"\n width: 16px;\n display: inline-block;\n vertical-align: text-top;\n \"\n >\n <svg\n fill=\"#b03340\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n >\n <path\n d=\"M15.672,14.2,8.3,1.443a.352.352,0,0,0-.609,0L.328,14.2a.352.352,0,0,0,.3.527H15.368A.352.352,0,0,0,15.672,14.2ZM8.743,12.9a.221.221,0,0,1-.221.221H7.478a.221.221,0,0,1-.221-.221V11.86a.221.221,0,0,1,.221-.221H8.522a.221.221,0,0,1,.221.221Zm-.025-2.422H7.282L7.257,6.005H8.743Z\"\n />\n </svg>\n </span>\n <strong>\n This website has been temporarily rate limited\n </strong>\n </p>\n <p class=\"cf-error-description\">\n You cannot access this site because the owner has\n reached their plan limits. Check back later once traffic\n has gone down.\n </p>\n\n <p class=\"cf-error-description\">\n If you are owner of this website, prevent this from\n happening again by upgrading your plan on the\n <a\n href=\"https://dash.cloudflare.com/?account=workers/plans\"\n target=\"_blank\"\n >Cloudflare Workers dashboard</a\n >.\n </p>\n\n <p>\n <a\n href=\"https://developers.cloudflare.com/workers/about/limits/#number-of-requests-limit\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn more about this issue →\n </a>\n </p>\n </div>\n\n <div class=\"cf-error-footer cf-wrapper\">\n <p>\n <span class=\"cf-footer-item\"\n >Cloudflare Ray ID: ${ray}</span\n >\n <span class=\"cf-footer-separator\">&bull;</span>\n <span class=\"cf-footer-item\"\n >${date}</span\n >\n <span\n id=\"cf-footer-item-ip\"\n class=\"cf-footer-item hidden\"\n >\n <span class=\"cf-footer-separator\">&bull;</span>\n Your IP:\n <button\n type=\"button\"\n id=\"cf-footer-ip-reveal\"\n class=\"cf-footer-ip-reveal-btn\"\n >\n Click to reveal\n </button>\n <span class=\"hidden\" id=\"cf-footer-ip\"\n >${ip}</span\n >\n </span>\n <span class=\"cf-footer-separator\">&bull;</span>\n <span class=\"cf-footer-item\"\n ><span>Runs on </span\n ><a\n rel=\"noopener noreferrer\"\n href=\"https://workers.cloudflare.com?utm_source=error_footer\"\n id=\"brand_link\"\n target=\"_blank\"\n >Cloudflare Workers</a\n ></span\n >\n </p>\n <script>\n (function () {\n function d() {\n var b = a.getElementById(\"cf-footer-item-ip\"),\n c = a.getElementById(\"cf-footer-ip-reveal\");\n b &&\n \"classList\" in b &&\n (b.classList.remove(\"hidden\"),\n c.addEventListener(\"click\", function () {\n c.classList.add(\"hidden\");\n a.getElementById(\n \"cf-footer-ip\",\n ).classList.remove(\"hidden\");\n }));\n }\n var a = document;\n document.addEventListener &&\n a.addEventListener(\"DOMContentLoaded\", d);\n })();\n </script>\n </div>\n <!-- /.error-footer -->\n </div>\n </div>\n\n <script>\n window._cf_translation = {};\n </script>\n </body>\n</html>`;\n}\n","import { WorkerEntrypoint } from \"cloudflare:workers\";\nimport { generateStaticRoutingRuleMatcher } from \"../../asset-worker/src/utils/rules-engine\";\nimport { PerformanceTimer } from \"../../utils/performance\";\nimport { TemporaryRedirectResponse } from \"../../utils/responses\";\nimport { setupSentry } from \"../../utils/sentry\";\nimport { mockJaegerBinding } from \"../../utils/tracing\";\nimport { Analytics, DISPATCH_TYPE, STATIC_ROUTING_DECISION } from \"./analytics\";\nimport {\n\tapplyEyeballConfigDefaults,\n\tapplyRouterConfigDefaults,\n} from \"./configuration\";\nimport { renderLimitedResponse } from \"./limited-response\";\nimport type AssetWorker from \"../../asset-worker\";\nimport type {\n\tEyeballRouterConfig,\n\tJaegerTracing,\n\tRouterConfig,\n\tUnsafePerformanceTimer,\n} from \"../../utils/types\";\nimport type { ColoMetadata, Environment, ReadyAnalytics } from \"./types\";\n\nexport interface Env {\n\tASSET_WORKER: Service<AssetWorker>;\n\tUSER_WORKER: Fetcher;\n\tCONFIG: RouterConfig;\n\tEYEBALL_CONFIG: EyeballRouterConfig;\n\n\tSENTRY_DSN: string;\n\tENVIRONMENT: Environment;\n\tANALYTICS: ReadyAnalytics;\n\tCOLO_METADATA: ColoMetadata;\n\tUNSAFE_PERFORMANCE: UnsafePerformanceTimer;\n\tVERSION_METADATA: WorkerVersionMetadata;\n\tJAEGER: JaegerTracing;\n\n\tSENTRY_ACCESS_CLIENT_ID: string;\n\tSENTRY_ACCESS_CLIENT_SECRET: string;\n}\n\ntype LoopbackExecutionContext = ExecutionContext & {\n\texports: {\n\t\tRouterInnerEntrypoint(options: { props: Record<string, never> }): {\n\t\t\tfetch(request: Request): Promise<Response>;\n\t\t};\n\t};\n};\n\n// This now-unused Entrypoint can be used for loopback invocations if made the\n// default export, which is how cohorted deployments will be implemented.\n// For now, the latency added by loopback invocations is too much for such a\n// load-bearing Worker. When that has been addressed in the future, re-enable\n// loopback by making this the default export.\nexport class RouterOuterEntrypoint extends WorkerEntrypoint<Env> {\n\toverride async fetch(request: Request): Promise<Response> {\n\t\t// Router worker is typechecked both in this package and as a transitive\n\t\t// dependency during miniflare builds. In the miniflare type context,\n\t\t// Cloudflare.Exports may not include this worker's mainModule mapping from\n\t\t// worker-configuration.d.ts, so `ctx.exports.RouterInnerEntrypoint` does not\n\t\t// resolve structurally. Keep this narrow cast so loopback typechecks in both\n\t\t// compilation contexts without changing runtime behavior.\n\t\tconst loopbackCtx = this.ctx as LoopbackExecutionContext;\n\n\t\tconst analytics = new Analytics(this.env.ANALYTICS);\n\t\tlet inner;\n\t\ttry {\n\t\t\tif (\n\t\t\t\tthis.env.COLO_METADATA &&\n\t\t\t\tthis.env.VERSION_METADATA &&\n\t\t\t\tthis.env.CONFIG\n\t\t\t) {\n\t\t\t\tconst url = new URL(request.url);\n\t\t\t\tanalytics.setData({\n\t\t\t\t\taccountId: this.env.CONFIG.account_id,\n\t\t\t\t\tscriptId: this.env.CONFIG.script_id,\n\t\t\t\t\tcoloId: this.env.COLO_METADATA.coloId,\n\t\t\t\t\tmetalId: this.env.COLO_METADATA.metalId,\n\t\t\t\t\tcoloTier: this.env.COLO_METADATA.coloTier,\n\t\t\t\t\tcoloRegion: this.env.COLO_METADATA.coloRegion,\n\t\t\t\t\thostname: url.hostname,\n\t\t\t\t\tversion: this.env.VERSION_METADATA.tag,\n\t\t\t\t});\n\t\t\t}\n\t\t\tinner = loopbackCtx.exports.RouterInnerEntrypoint({ props: {} });\n\t\t} catch (err) {\n\t\t\tconst sentry = setupSentry(\n\t\t\t\trequest,\n\t\t\t\tthis.ctx,\n\t\t\t\tthis.env.SENTRY_DSN,\n\t\t\t\tthis.env.SENTRY_ACCESS_CLIENT_ID,\n\t\t\t\tthis.env.SENTRY_ACCESS_CLIENT_SECRET,\n\t\t\t\tthis.env.COLO_METADATA,\n\t\t\t\tthis.env.VERSION_METADATA,\n\t\t\t\tthis.env.CONFIG?.account_id,\n\t\t\t\tthis.env.CONFIG?.script_id\n\t\t\t);\n\t\t\tsentry?.captureException(err);\n\n\t\t\tif (err instanceof Error) {\n\t\t\t\tanalytics.setData({ error: err.message });\n\t\t\t}\n\t\t\tanalytics.write();\n\n\t\t\tthrow err;\n\t\t}\n\n\t\treturn inner.fetch(request);\n\t}\n}\n\nexport class RouterInnerEntrypoint extends WorkerEntrypoint<Env> {\n\toverride async fetch(request: Request): Promise<Response> {\n\t\tlet sentry: ReturnType<typeof setupSentry> | undefined;\n\t\tlet userWorkerInvocation = false;\n\t\tconst analytics = new Analytics(this.env.ANALYTICS);\n\t\tconst performance = new PerformanceTimer(this.env.UNSAFE_PERFORMANCE);\n\t\tconst startTimeMs = performance.now();\n\n\t\ttry {\n\t\t\tif (!this.env.JAEGER) {\n\t\t\t\tthis.env.JAEGER = mockJaegerBinding();\n\t\t\t}\n\n\t\t\tsentry = setupSentry(\n\t\t\t\trequest,\n\t\t\t\tthis.ctx,\n\t\t\t\tthis.env.SENTRY_DSN,\n\t\t\t\tthis.env.SENTRY_ACCESS_CLIENT_ID,\n\t\t\t\tthis.env.SENTRY_ACCESS_CLIENT_SECRET,\n\t\t\t\tthis.env.COLO_METADATA,\n\t\t\t\tthis.env.VERSION_METADATA,\n\t\t\t\tthis.env.CONFIG?.account_id,\n\t\t\t\tthis.env.CONFIG?.script_id\n\t\t\t);\n\n\t\t\tconst hasStaticRouting = this.env.CONFIG.static_routing !== undefined;\n\t\t\tconst config = applyRouterConfigDefaults(this.env.CONFIG);\n\t\t\tconst eyeballConfig = applyEyeballConfigDefaults(this.env.EYEBALL_CONFIG);\n\n\t\t\tconst url = new URL(request.url);\n\n\t\t\tif (\n\t\t\t\tthis.env.COLO_METADATA &&\n\t\t\t\tthis.env.VERSION_METADATA &&\n\t\t\t\tthis.env.CONFIG\n\t\t\t) {\n\t\t\t\tanalytics.setData({\n\t\t\t\t\taccountId: this.env.CONFIG.account_id,\n\t\t\t\t\tscriptId: this.env.CONFIG.script_id,\n\n\t\t\t\t\tcoloId: this.env.COLO_METADATA.coloId,\n\t\t\t\t\tmetalId: this.env.COLO_METADATA.metalId,\n\t\t\t\t\tcoloTier: this.env.COLO_METADATA.coloTier,\n\n\t\t\t\t\tcoloRegion: this.env.COLO_METADATA.coloRegion,\n\t\t\t\t\thostname: url.hostname,\n\t\t\t\t\tversion: this.env.VERSION_METADATA.tag,\n\t\t\t\t\tuserWorkerAhead: config.invoke_user_worker_ahead_of_assets,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Handle /cdn-cgi\\... backslash bypass attempts\n\t\t\t// - in production if pathname starts with `/cdn-cgi/` then it bypassed the external\n\t\t\t// routing and so must have actually started with `/cdn-cgi\\`.\n\t\t\t// - in local dev it is possible for pathname to start with `/cdn-cgi/`\n\t\t\t// even if it doesn't start with `/cdn-cgi\\` so we also check the raw URL for that.\n\t\t\tif (\n\t\t\t\turl.pathname.startsWith(\"/cdn-cgi/\") &&\n\t\t\t\trequest.url.includes(\"/cdn-cgi\\\\\")\n\t\t\t) {\n\t\t\t\tanalytics.setData({ cdnCgiBackslashBypassUrl: request.url });\n\t\t\t\treturn new TemporaryRedirectResponse(url.href);\n\t\t\t}\n\n\t\t\tconst routeToUserWorker = async ({\n\t\t\t\tasset,\n\t\t\t}: {\n\t\t\t\tasset: \"static_routing\" | \"none\";\n\t\t\t}) => {\n\t\t\t\tif (!config.has_user_worker) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\"Fetch for user worker without having a user worker binding\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (eyeballConfig.limitedAssetsOnly) {\n\t\t\t\t\tanalytics.setData({ userWorkerFreeTierLimiting: true });\n\t\t\t\t\treturn new Response(renderLimitedResponse(request), {\n\t\t\t\t\t\tstatus: 429,\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\"Content-Type\": \"text/html\",\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tanalytics.setData({ dispatchtype: DISPATCH_TYPE.WORKER });\n\t\t\t\tuserWorkerInvocation = true;\n\t\t\t\treturn this.env.JAEGER.enterSpan(\"dispatch_worker\", async (span) => {\n\t\t\t\t\tspan.setTags({\n\t\t\t\t\t\thasUserWorker: true,\n\t\t\t\t\t\tasset: asset,\n\t\t\t\t\t\tdispatchType: DISPATCH_TYPE.WORKER,\n\t\t\t\t\t});\n\n\t\t\t\t\tlet shouldCheckContentType = false;\n\t\t\t\t\tif (url.pathname.endsWith(\"/_next/image\")) {\n\t\t\t\t\t\t// is a next image\n\t\t\t\t\t\tconst queryURLParam = url.searchParams.get(\"url\");\n\t\t\t\t\t\tif (queryURLParam && !queryURLParam.startsWith(\"/\")) {\n\t\t\t\t\t\t\t// that's a remote resource\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\trequest.method !== \"GET\" ||\n\t\t\t\t\t\t\t\trequest.headers.get(\"sec-fetch-dest\") !== \"image\"\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// that was not loaded via a browser's <img> tag\n\t\t\t\t\t\t\t\tshouldCheckContentType = true;\n\t\t\t\t\t\t\t\tanalytics.setData({ abuseMitigationURLHost: queryURLParam });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// otherwise, we're good\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (url.pathname === \"/_image\") {\n\t\t\t\t\t\tconst hrefParam = url.searchParams.get(\"href\");\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\threfParam &&\n\t\t\t\t\t\t\threfParam.length > 2 &&\n\t\t\t\t\t\t\threfParam.startsWith(\"//\")\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst hrefUrl = new URL(\"https:\" + hrefParam);\n\t\t\t\t\t\t\t\tconst isImageFetchDest =\n\t\t\t\t\t\t\t\t\trequest.headers.get(\"sec-fetch-dest\") == \"image\";\n\n\t\t\t\t\t\t\t\tif (hrefUrl.hostname !== url.hostname && !isImageFetchDest) {\n\t\t\t\t\t\t\t\t\tanalytics.setData({ xssDetectionImageHref: hrefParam });\n\t\t\t\t\t\t\t\t\treturn new Response(\"Blocked\", { status: 403 });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\tconsole.log(`Invalid href parameter in /_image: ${hrefParam}`);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tanalytics.setData({\n\t\t\t\t\t\ttimeToDispatch: performance.now() - startTimeMs,\n\t\t\t\t\t});\n\n\t\t\t\t\tif (shouldCheckContentType) {\n\t\t\t\t\t\tconst response = await this.env.USER_WORKER.fetch(request);\n\n\t\t\t\t\t\tif (response.status !== 304 && shouldBlockContentType(response)) {\n\t\t\t\t\t\t\tanalytics.setData({ abuseMitigationBlocked: true });\n\t\t\t\t\t\t\treturn new Response(\"Blocked\", { status: 403 });\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn response;\n\t\t\t\t\t}\n\t\t\t\t\treturn this.env.USER_WORKER.fetch(request);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst routeToAssets = async ({\n\t\t\t\tasset,\n\t\t\t}: {\n\t\t\t\tasset: \"static_routing\" | \"found\" | \"none\";\n\t\t\t}) => {\n\t\t\t\tanalytics.setData({ dispatchtype: DISPATCH_TYPE.ASSETS });\n\t\t\t\treturn await this.env.JAEGER.enterSpan(\n\t\t\t\t\t\"dispatch_assets\",\n\t\t\t\t\tasync (span) => {\n\t\t\t\t\t\tspan.setTags({\n\t\t\t\t\t\t\thasUserWorker: config.has_user_worker,\n\t\t\t\t\t\t\tasset: asset,\n\t\t\t\t\t\t\tdispatchType: DISPATCH_TYPE.ASSETS,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tanalytics.setData({\n\t\t\t\t\t\t\ttimeToDispatch: performance.now() - startTimeMs,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn this.env.ASSET_WORKER.fetch(request);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tif (config.static_routing) {\n\t\t\t\t// evaluate \"exclude\" rules\n\t\t\t\tconst excludeRulesMatcher = generateStaticRoutingRuleMatcher(\n\t\t\t\t\tconfig.static_routing.asset_worker ?? []\n\t\t\t\t);\n\t\t\t\tif (\n\t\t\t\t\texcludeRulesMatcher({\n\t\t\t\t\t\trequest,\n\t\t\t\t\t})\n\t\t\t\t) {\n\t\t\t\t\t// direct to asset worker\n\t\t\t\t\tanalytics.setData({\n\t\t\t\t\t\tstaticRoutingDecision: STATIC_ROUTING_DECISION.ROUTED,\n\t\t\t\t\t});\n\t\t\t\t\treturn await routeToAssets({ asset: \"static_routing\" });\n\t\t\t\t}\n\t\t\t\t// evaluate \"include\" rules\n\t\t\t\tconst includeRulesMatcher = generateStaticRoutingRuleMatcher(\n\t\t\t\t\tconfig.static_routing.user_worker ?? []\n\t\t\t\t);\n\t\t\t\tif (\n\t\t\t\t\tincludeRulesMatcher({\n\t\t\t\t\t\trequest,\n\t\t\t\t\t})\n\t\t\t\t) {\n\t\t\t\t\tif (!config.has_user_worker) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\"Fetch for user worker without having a user worker binding\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// direct to user worker\n\t\t\t\t\tanalytics.setData({\n\t\t\t\t\t\tstaticRoutingDecision: STATIC_ROUTING_DECISION.ROUTED,\n\t\t\t\t\t});\n\t\t\t\t\treturn await routeToUserWorker({ asset: \"static_routing\" });\n\t\t\t\t}\n\n\t\t\t\tanalytics.setData({\n\t\t\t\t\tstaticRoutingDecision: hasStaticRouting\n\t\t\t\t\t\t? STATIC_ROUTING_DECISION.NOT_ROUTED\n\t\t\t\t\t\t: STATIC_ROUTING_DECISION.NOT_PROVIDED,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// User's configuration indicates they want user-Worker to run ahead of any\n\t\t\t// assets. Do not provide any fallback logic.\n\t\t\tif (config.invoke_user_worker_ahead_of_assets) {\n\t\t\t\treturn await routeToUserWorker({ asset: \"static_routing\" });\n\t\t\t}\n\n\t\t\t// If we have a user-Worker, but no assets, dispatch to Worker script\n\t\t\t// Do not pass the original request as it would consume the body\n\t\t\tconst assetsExist = await this.env.ASSET_WORKER.unstable_canFetch(\n\t\t\t\tnew Request(request.url, {\n\t\t\t\t\theaders: request.headers,\n\t\t\t\t\tmethod: request.method,\n\t\t\t\t})\n\t\t\t);\n\t\t\tif (config.has_user_worker && !assetsExist) {\n\t\t\t\treturn await routeToUserWorker({ asset: \"none\" });\n\t\t\t}\n\n\t\t\t// Otherwise, we either don't have a user worker, OR we have matching assets and should fetch from the assets binding\n\t\t\treturn await routeToAssets({ asset: assetsExist ? \"found\" : \"none\" });\n\t\t} catch (err) {\n\t\t\tif (userWorkerInvocation) {\n\t\t\t\t// Don't send user Worker errors to sentry; we have no way to distinguish between\n\t\t\t\t// CF errors and errors from the user's code.\n\t\t\t\tthrow err;\n\t\t\t} else if (err instanceof Error) {\n\t\t\t\tanalytics.setData({ error: err.message });\n\t\t\t}\n\n\t\t\t// Log to Sentry if we can\n\t\t\tif (sentry) {\n\t\t\t\tsentry.captureException(err);\n\t\t\t}\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tanalytics.setData({ requestTime: performance.now() - startTimeMs });\n\t\t\tanalytics.write();\n\t\t}\n\t}\n}\n\nexport default RouterInnerEntrypoint;\n\n/**\n * Check if the Content Type is allowed for the the `_next/image` endpoint.\n *\n * - Content Type with multiple values should be blocked\n * - Only Image and Plain Text types are not blocked\n *\n * @param contentType The value of the Content Type header (`null` if no set)\n * @returns Whether the Content Type should be blocked\n */\nfunction shouldBlockContentType(response: Response): boolean {\n\tconst contentType = response.headers.get(\"content-type\");\n\n\tif (contentType === null) {\n\t\treturn true;\n\t}\n\n\t// Block responses with multiple Content Types.\n\t// https://httpwg.org/specs/rfc9110.html#field.content-type\n\tif (contentType.includes(\",\")) {\n\t\treturn true;\n\t}\n\n\t// Allow only\n\t// - images (`image/...`)\n\t// - plain text (`text/plain`, `text/plain;charset=UTF-8`), used by Next errors\n\treturn !(\n\t\tcontentType.startsWith(\"image/\") ||\n\t\tcontentType.split(\";\")[0] === \"text/plain\"\n\t);\n}\n"],"x_google_ignoreList":[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],"mappings":";;;AAiHA,IAAa,4BAAb,MAAa,kCAAkC,SAAS;CACvD,OAAgB,SAAS;CAEzB,YAAY,UAAkB,MAAqB;AAClD,QAAM,MAAM;GACX,GAAG;GACH,QAAQ,0BAA0B;GAClC,YAAY;GACZ,SAAS;IACR,GAAG,MAAM;IACT,UAAU;IACV;GACD,CAAC;;;;;;AC3HJ,SAAgB,wBAA8B;AAC7C,QAAO;EACN,eAAe;EACf,eAAe;EACf,WAAW;EACX,aAAa;EACb;;AAGF,SAAgB,oBAAmC;AAClD,QAAO;EACN,YAAY,GAAG,MAAM,GAAG,SAAS;AAChC,UAAO,KAAK,uBAAuB,EAAE,GAAG,KAAK;;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