@cloudflare/vite-plugin 2.0.0-beta.sha-52b0dc0e9 → 2.0.0-beta.sha-8c6014f9a
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.
- package/dist/cf-vite.mjs +8 -1
- package/dist/cf-vite.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +11577 -5604
- package/dist/index.mjs.map +1 -1
- package/dist/{package-rhA_Ulu_.mjs → package-D0rj_bHG.mjs} +6 -6
- package/dist/{package-rhA_Ulu_.mjs.map → package-D0rj_bHG.mjs.map} +1 -1
- package/dist/workers/asset-worker/index.js +2 -1
- package/dist/workers/asset-worker/index.js.map +1 -0
- package/dist/workers/router-worker/index.js +2 -1
- package/dist/workers/router-worker/index.js.map +1 -0
- package/dist/workers/runner-worker/index.js +2 -1
- package/dist/workers/runner-worker/index.js.map +1 -0
- package/dist/workers/runner-worker/module-runner-legacy.js +2 -1
- package/dist/workers/runner-worker/module-runner-legacy.js.map +1 -0
- package/dist/workers/runner-worker/module-runner.js +3 -2
- package/dist/workers/runner-worker/module-runner.js.map +1 -0
- package/dist/workers/vite-proxy-worker/index.js +2 -1
- package/dist/workers/vite-proxy-worker/index.js.map +1 -0
- package/package.json +13 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["isErrorEvent","DEBUG_BUILD","console","logger","DEBUG_BUILD","DEBUG_BUILD","handler","handler","handler","crypto","handler","resolve","getModule","parseStackFrames","exceptionFromError","isErrorEvent","ex","eventFromUnknownInput","eventFromMessage","resolve","setupIntegrations","setupIntegrations","isError","eventFromUnknownInput","eventFromMessage","#integrationsInitialized","#sdk","getModule","#options","VERSION","COMPATIBILITY_FLAG_MASKS: Record<ENABLEMENT_COMPATIBILITY_FLAGS, number>","normalizedSegments: string[]","replacedSet: Record<string, string>","pathname: string | null","redirectResult: Intent","eTagResult: string | null","sentry: ReturnType<typeof setupSentry> | undefined"],"sources":["../../../../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/utils/tracing.ts","../../../../workers-shared/asset-worker/src/analytics.ts","../../../../workers-shared/utils/constants.ts","../../../../workers-shared/asset-worker/src/assets-manifest.ts","../../../../workers-shared/utils/base-path.ts","../../../../workers-shared/asset-worker/src/compatibility-flags.ts","../../../../workers-shared/asset-worker/src/configuration.ts","../../../../workers-shared/asset-worker/src/experiment-analytics.ts","../../../../workers-shared/utils/responses.ts","../../../../workers-shared/asset-worker/src/utils/base-path.ts","../../../../workers-shared/asset-worker/src/constants.ts","../../../../workers-shared/asset-worker/src/utils/rules-engine.ts","../../../../workers-shared/asset-worker/src/utils/headers.ts","../../../../workers-shared/asset-worker/src/handler.ts","../../../../workers-shared/asset-worker/src/utils/final-operations.ts","../../../../workers-shared/asset-worker/src/utils/kv.ts","../../../../workers-shared/asset-worker/src/worker.ts","../../../src/shared.ts","../../../src/workers/asset-worker/index.ts"],"sourcesContent":["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 { 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","import type { ENABLEMENT_COMPATIBILITY_FLAGS } from \"./compatibility-flags\";\nimport type { ReadyAnalytics } from \"./types\";\n\n// This will allow us to make breaking changes to the analytic schema\nconst VERSION = 1;\n\n// Identifies which entrypoint produced the analytics row.\n// Values must stay in sync with the ClickHouse view in cloudflare/ch/ready-analytics.\nexport enum EntrypointType {\n\tOuter = 0,\n\tInner = 1,\n}\n\nexport type ServedBy =\n\t| \"asset\"\n\t| \"spa\"\n\t| \"404-page\"\n\t| \"none\"\n\t| \"redirect\"\n\t| \"not-modified\"\n\t| \"method-not-allowed\"\n\t| \"error\";\n\nexport type RequestKind = \"navigation\" | \"subresource\";\n\nexport function getRequestKind(request: Request): RequestKind {\n\tconst dest = request.headers.get(\"Sec-Fetch-Dest\");\n\tif (dest) {\n\t\treturn dest === \"document\" || dest === \"iframe\"\n\t\t\t? \"navigation\"\n\t\t\t: \"subresource\";\n\t}\n\n\tconst { pathname } = new URL(request.url);\n\tconst lastSegment = pathname.slice(pathname.lastIndexOf(\"/\") + 1);\n\tconst dotIndex = lastSegment.lastIndexOf(\".\");\n\tif (dotIndex <= 0) {\n\t\t// No extension, or a dotfile with no other extension.\n\t\treturn \"navigation\";\n\t}\n\treturn lastSegment.slice(dotIndex + 1).toLowerCase() === \"html\"\n\t\t? \"navigation\"\n\t\t: \"subresource\";\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 - Response status code\n\tstatus?: number;\n\t// double6 - Compatibility flags\n\tcompatibilityFlags?: string[]; // converted into a bitmask\n\t// double7 - Entrypoint discriminator (see EntrypointType enum)\n\tentrypoint?: EntrypointType;\n\n\t// -- Blobs --\n\t// blob1 - Hostname of the request\n\thostname?: string;\n\t// blob2 - User agent making the request\n\tuserAgent?: string;\n\t// blob3 - Html handling option\n\thtmlHandling?: string;\n\t// blob4 - Not found handling option\n\tnotFoundHandling?: string;\n\t// blob5 - Error message\n\terror?: string;\n\t// blob6 - The current version UUID of asset-worker\n\tversion?: string;\n\t// blob7 - Region of the colo (e.g. WEUR)\n\tcoloRegion?: string;\n\t// blob8 - The cache status of the request\n\tcacheStatus?: string;\n\t// blob9 - Account cohort (\"ent\", \"paid\", \"free\", \"employee\", or \"unknown\")\n\tcohort?: string;\n\t// blob10 - What produced the served response (see ServedBy)\n\tservedBy?: ServedBy;\n\t// blob11 - Whether the request was a navigation or a subresource\n\trequestKind?: RequestKind;\n};\n\nconst COMPATIBILITY_FLAG_MASKS: Record<ENABLEMENT_COMPATIBILITY_FLAGS, number> =\n\t{\n\t\tassets_navigation_prefers_asset_serving: 1 << 0,\n\t\t// next_one: 1 << 1\n\t\t// one_after_that: 1 << 2\n\t\t// etc: 1 << 3\n\t};\n\nexport class Analytics {\n\tprivate data: Data = {};\n\tprivate readyAnalytics?: ReadyAnalytics;\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 extends keyof Data>(key: Key): Data[Key] {\n\t\treturn this.data[key];\n\t}\n\n\twrite() {\n\t\tif (!this.readyAnalytics) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet compatibilityFlagsBitmask = 0;\n\t\tfor (const compatibilityFlag of this.data.compatibilityFlags || []) {\n\t\t\tconst mask =\n\t\t\t\tCOMPATIBILITY_FLAG_MASKS[\n\t\t\t\t\tcompatibilityFlag as ENABLEMENT_COMPATIBILITY_FLAGS\n\t\t\t\t];\n\t\t\tif (mask) {\n\t\t\t\tcompatibilityFlagsBitmask += mask;\n\t\t\t}\n\t\t}\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.status ?? -1, // double5\n\t\t\t\tcompatibilityFlagsBitmask, // double6\n\t\t\t\tthis.data.entrypoint ?? -1, // double7\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.userAgent?.substring(0, 256), // blob2 - trim to 256 bytes\n\t\t\t\tthis.data.htmlHandling, // blob3\n\t\t\t\tthis.data.notFoundHandling, // blob4\n\t\t\t\tthis.data.error?.substring(0, 256), // blob5 - trim to 256 bytes\n\t\t\t\tthis.data.version, // blob6\n\t\t\t\tthis.data.coloRegion, // blob7\n\t\t\t\tthis.data.cacheStatus, // blob8\n\t\t\t\tthis.data.cohort, // blob9\n\t\t\t\tthis.data.servedBy, // blob10\n\t\t\t\tthis.data.requestKind, // blob11\n\t\t\t],\n\t\t});\n\t}\n}\n","// -- Constants for manifest encoding/decoding --\n// (header and tails are not currently being used for anything afaik)\n// NB these all refer to bytes\n\n/** Reserved header at the start of the whole manifest, NOT in each entry (currently unused)\n * manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ]\n */\nexport const HEADER_SIZE = 20;\n/** manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */\nexport const PATH_HASH_SIZE = 16;\n/** manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */\nexport const CONTENT_HASH_SIZE = 16;\n/** manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */\nexport const TAIL_SIZE = 8;\n/** offset of PATH_HASH from start of each entry\n * manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */\nexport const PATH_HASH_OFFSET = 0;\n/** offset of CONTENT_HASH from start of each entry\n * manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */\nexport const CONTENT_HASH_OFFSET = PATH_HASH_SIZE;\n/** manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */\nexport const ENTRY_SIZE = PATH_HASH_SIZE + CONTENT_HASH_SIZE + TAIL_SIZE;\n\n// -- Manifest creation constants --\n// used in wrangler dev and deploy\n/**\n * Maximum number of assets that can be deployed with a Worker; this is a global\n * ceiling, and may vary by the user's subscription.\n */\nexport const MAX_ASSET_COUNT = 100_000;\n/** Maximum size per asset that can be deployed with a Worker */\nexport const MAX_ASSET_SIZE = 25 * 1024 * 1024;\n\nexport const CF_ASSETS_IGNORE_FILENAME = \".assetsignore\";\nexport const REDIRECTS_FILENAME = \"_redirects\";\nexport const HEADERS_FILENAME = \"_headers\";\n","import {\n\tCONTENT_HASH_OFFSET,\n\tCONTENT_HASH_SIZE,\n\tENTRY_SIZE,\n\tHEADER_SIZE,\n\tPATH_HASH_OFFSET,\n\tPATH_HASH_SIZE,\n} from \"../../utils/constants\";\n\nexport class AssetsManifest {\n\tprivate data: Uint8Array;\n\n\tconstructor(data: ArrayBuffer) {\n\t\tthis.data = new Uint8Array(data);\n\t}\n\n\tasync get(pathname: string) {\n\t\tconst pathHash = await hashPath(pathname);\n\t\tconst entry = binarySearch(this.data, pathHash);\n\t\treturn entry ? Uint8ToHexString(entry) : null;\n\t}\n}\n\nexport const hashPath = async (path: string) => {\n\tconst encoder = new TextEncoder();\n\tconst data = encoder.encode(path);\n\tconst hashBuffer = await crypto.subtle.digest(\n\t\t\"SHA-256\",\n\t\tdata.buffer as ArrayBuffer\n\t);\n\treturn new Uint8Array(hashBuffer, 0, PATH_HASH_SIZE);\n};\n\n/**\n * Search for an entry with the given hash path.\n *\n * @param manifest the manifest bytes\n * @param pathHash the path hash to find in the manifest\n * @returns The content hash when the entry is found and `false` otherwise\n */\nexport const binarySearch = (\n\tmanifest: Uint8Array,\n\tpathHash: Uint8Array\n): Uint8Array | false => {\n\tif (pathHash.byteLength !== PATH_HASH_SIZE) {\n\t\tthrow new TypeError(\n\t\t\t`Search value should have a length of ${PATH_HASH_SIZE}`\n\t\t);\n\t}\n\n\tconst numberOfEntries = (manifest.byteLength - HEADER_SIZE) / ENTRY_SIZE;\n\n\tif (numberOfEntries === 0) {\n\t\treturn false;\n\t}\n\n\tlet lowIndex = 0;\n\tlet highIndex = numberOfEntries - 1;\n\n\twhile (lowIndex <= highIndex) {\n\t\tconst middleIndex = (lowIndex + highIndex) >> 1;\n\n\t\tconst cmp = comparePathHashWithEntry(pathHash, manifest, middleIndex);\n\n\t\tif (cmp < 0) {\n\t\t\thighIndex = middleIndex - 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (cmp > 0) {\n\t\t\tlowIndex = middleIndex + 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\treturn new Uint8Array(\n\t\t\tmanifest.buffer,\n\t\t\tHEADER_SIZE + middleIndex * ENTRY_SIZE + CONTENT_HASH_OFFSET,\n\t\t\tCONTENT_HASH_SIZE\n\t\t);\n\t}\n\n\treturn false;\n};\n\n/**\n * Compares a search value with a path hash in the manifest\n *\n * @param searchValue a `Uint8Array` of size `PATH_HASH_SIZE`\n * @param manifest the manifest bytes\n * @param entryIndex the index in the manifest of the entry to compare\n */\nfunction comparePathHashWithEntry(\n\tsearchValue: Uint8Array,\n\tmanifest: Uint8Array,\n\tentryIndex: number\n) {\n\tlet pathHashOffset = HEADER_SIZE + entryIndex * ENTRY_SIZE + PATH_HASH_OFFSET;\n\tfor (let offset = 0; offset < PATH_HASH_SIZE; offset++, pathHashOffset++) {\n\t\tconst s = searchValue[offset];\n\t\tconst e = manifest[pathHashOffset];\n\t\tif (s === undefined || e === undefined) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Unexpected undefined value at offset ${offset} during path hash comparison`\n\t\t\t);\n\t\t}\n\t\tif (s < e) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (s > e) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\treturn 0;\n}\n\n/**\n * Converts an Uint8Array to an hex string\n *\n * @param array The content hash\n * @returns padded hex string\n */\nconst Uint8ToHexString = (array: Uint8Array) => {\n\treturn [...array].map((b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n};\n","/**\n * Canonical normalization for the `assets.base_path` configuration field.\n *\n * This implements the shared canonical path contract applied by the Asset\n * Worker when it receives its final configuration.\n *\n * The stored canonical form is either the root `\"/\"` or an absolute pathname\n * with both leading and trailing slashes, such as `\"/subpath/\"`.\n */\n\nexport type BasePathValidationResult =\n\t| { valid: true; value: string }\n\t| { valid: false; error: string };\n\n// eslint-disable-next-line no-control-regex -- control characters are matched intentionally so they can be rejected in `base_path`\nconst CONTROL_CHARACTER = /[\\u0000-\\u001f\\u007f]/;\n\n/**\n * Validate and normalize a raw `base_path` value into its canonical stored form.\n *\n * Relative and absolute pathname inputs are accepted and interpreted as a fixed\n * root-relative request prefix. Empty and dot segments are resolved before a\n * leading and trailing slash are applied. URL-shaped values, query or fragment\n * delimiters, backslashes, control characters, and percent-encoded sequences\n * are rejected. Unicode pathname characters are allowed.\n */\nexport function normalizeBasePath(value: unknown): BasePathValidationResult {\n\tif (value === \"/\") {\n\t\treturn { valid: true, value: \"/\" };\n\t}\n\n\tif (typeof value !== \"string\") {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\terror: `Expected a string but got ${typeof value}.`,\n\t\t};\n\t}\n\n\tif (value.length === 0) {\n\t\treturn { valid: false, error: `The value must not be empty.` };\n\t}\n\n\tif (value.startsWith(\"//\") || /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(value)) {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\terror: `The value must be a pathname, not a URL.`,\n\t\t};\n\t}\n\n\tif (value.includes(\"\\\\\")) {\n\t\treturn { valid: false, error: `The value must not contain backslashes.` };\n\t}\n\n\tif (CONTROL_CHARACTER.test(value)) {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\terror: `The value must not contain control characters.`,\n\t\t};\n\t}\n\n\tif (value.includes(\"?\") || value.includes(\"#\")) {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\terror: `The value must not contain query strings or fragments.`,\n\t\t};\n\t}\n\n\tif (value.includes(\"%\")) {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\terror: `The value must not contain percent-encoded sequences.`,\n\t\t};\n\t}\n\n\tconst normalizedSegments: string[] = [];\n\tfor (const segment of value.split(\"/\")) {\n\t\tif (segment === \"\" || segment === \".\") {\n\t\t\tcontinue;\n\t\t}\n\t\tif (segment === \"..\") {\n\t\t\tnormalizedSegments.pop();\n\t\t\tcontinue;\n\t\t}\n\t\tnormalizedSegments.push(segment);\n\t}\n\n\tconst canonical =\n\t\tnormalizedSegments.length === 0 ? \"/\" : `/${normalizedSegments.join(\"/\")}/`;\n\treturn { valid: true, value: canonical };\n}\n\n/**\n * Decode and normalize a URI-encoded `base_path` without decoding reserved URI\n * delimiters. In particular, `decodeURI` leaves encoded path separators such\n * as `%2F` intact so that `normalizeBasePath` rejects them as ambiguous.\n */\nexport function normalizeUriEncodedBasePath(\n\tvalue: unknown\n): BasePathValidationResult {\n\tif (typeof value !== \"string\") {\n\t\treturn normalizeBasePath(value);\n\t}\n\n\ttry {\n\t\treturn normalizeBasePath(decodeURI(value));\n\t} catch {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\terror: `The value contains malformed URI encoding.`,\n\t\t};\n\t}\n}\n","import type { AssetConfig } from \"../../utils/types\";\nimport type { NormalizedAssetConfig } from \"./types\";\n\ninterface CompatibilityFlag {\n\tenable: `assets_${string}`;\n\tdisable: `assets_${string}`;\n\tonByDefaultAfter?: string;\n}\n\nexport const SEC_FETCH_MODE_NAVIGATE_HEADER_PREFERS_ASSET_SERVING = {\n\tenable: \"assets_navigation_prefers_asset_serving\",\n\tdisable: \"assets_navigation_has_no_effect\",\n\tonByDefaultAfter: \"2025-04-01\",\n} satisfies CompatibilityFlag;\n\nconst COMPATIBILITY_FLAGS = [\n\tSEC_FETCH_MODE_NAVIGATE_HEADER_PREFERS_ASSET_SERVING,\n] as const;\n\nexport type ENABLEMENT_COMPATIBILITY_FLAGS =\n\t(typeof COMPATIBILITY_FLAGS)[number][\"enable\"];\n\nexport const resolveCompatibilityOptions = (configuration?: AssetConfig) => {\n\tconst compatibilityDate = configuration?.compatibility_date ?? \"2021-11-02\";\n\tconst compatibilityFlags = configuration?.compatibility_flags ?? [];\n\n\tconst resolvedCompatibilityFlags = compatibilityFlags;\n\tfor (const compatibilityFlag of COMPATIBILITY_FLAGS) {\n\t\tif (\n\t\t\tcompatibilityFlag.onByDefaultAfter &&\n\t\t\tcompatibilityDate >= compatibilityFlag.onByDefaultAfter &&\n\t\t\t!resolvedCompatibilityFlags.find(\n\t\t\t\t(flag) => flag === compatibilityFlag.disable\n\t\t\t) &&\n\t\t\t!resolvedCompatibilityFlags.find(\n\t\t\t\t(flag) => flag === compatibilityFlag.enable\n\t\t\t)\n\t\t) {\n\t\t\tresolvedCompatibilityFlags.push(compatibilityFlag.enable);\n\t\t}\n\t}\n\n\treturn {\n\t\tcompatibilityDate,\n\t\tcompatibilityFlags: resolvedCompatibilityFlags,\n\t};\n};\n\nexport const flagIsEnabled = (\n\tconfiguration: NormalizedAssetConfig,\n\tcompatibilityFlag: (typeof COMPATIBILITY_FLAGS)[number]\n) => {\n\treturn !!configuration.compatibility_flags.find(\n\t\t(flag) => flag === compatibilityFlag.enable\n\t);\n};\n","import { normalizeBasePath } from \"../../utils/base-path\";\nimport { resolveCompatibilityOptions } from \"./compatibility-flags\";\nimport type { AssetConfig } from \"../../utils/types\";\nimport type { NormalizedAssetConfig } from \"./types\";\n\nexport const normalizeConfiguration = (\n\tconfiguration?: AssetConfig\n): NormalizedAssetConfig => {\n\tconst compatibilityOptions = resolveCompatibilityOptions(configuration);\n\tconst basePath = normalizeBasePath(configuration?.base_path ?? \"/\");\n\tif (!basePath.valid) {\n\t\tthrow new Error(`Invalid assets base_path: ${basePath.error}`);\n\t}\n\n\treturn {\n\t\tcompatibility_date: compatibilityOptions.compatibilityDate,\n\t\tcompatibility_flags: compatibilityOptions.compatibilityFlags,\n\t\thtml_handling: configuration?.html_handling ?? \"auto-trailing-slash\",\n\t\tnot_found_handling: configuration?.not_found_handling ?? \"none\",\n\t\tbase_path: basePath.value,\n\t\tredirects: configuration?.redirects ?? {\n\t\t\tversion: 1,\n\t\t\tstaticRules: {},\n\t\t\trules: {},\n\t\t},\n\t\theaders: configuration?.headers ?? {\n\t\t\tversion: 2,\n\t\t\trules: {},\n\t\t},\n\t\thas_static_routing: configuration?.has_static_routing ?? 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};\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\n// When adding new columns please update the schema\ntype Data = {\n\t// -- Indexes --\n\taccountId?: number;\n\texperimentName?: string;\n\n\t// -- Doubles --\n\t// double1 - The time it takes to read the manifest in milliseconds\n\tmanifestReadTime?: number;\n\n\t// -- Blobs --\n\t// blob1 current or perfTest version of binary search\n\tbinarySearchVersion?: \"current\" | \"perfTest\" | \"current-fallback\";\n};\n\nexport class ExperimentAnalytics {\n\tprivate data: Data = {};\n\tprivate readyAnalytics?: ReadyAnalytics;\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.readyAnalytics) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.readyAnalytics.logEvent({\n\t\t\tversion: VERSION,\n\t\t\taccountId: this.data.accountId,\n\t\t\tindexId: this.data.experimentName,\n\t\t\tdoubles: [\n\t\t\t\tthis.data.manifestReadTime ?? -1, // double1\n\t\t\t],\n\t\t\tblobs: [\n\t\t\t\tthis.data.binarySearchVersion, // blob1\n\t\t\t],\n\t\t});\n\t}\n}\n","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","/**\n * Asset-worker-local helpers for converting between public request pathnames\n * and asset-directory-relative pathnames using the configured `base_path`.\n *\n * `base` is always the canonical stored form: either `\"/\"` or an absolute\n * pathname with a trailing slash such as `\"/subpath/\"`.\n */\n\n/**\n * Segment-aware check that a decoded public path is at, or nested under, the\n * base. `/subpath` matches `/subpath` and `/subpath/...`, but not\n * `/subpath-other`. The root base `\"/\"` matches everything.\n */\nfunction isWithinBase(publicDecodedPath: string, base: string): boolean {\n\tif (base === \"/\") {\n\t\treturn true;\n\t}\n\treturn (\n\t\tpublicDecodedPath === base.slice(0, -1) ||\n\t\tpublicDecodedPath.startsWith(base)\n\t);\n}\n\n/**\n * Strip the configured base from a decoded public pathname, returning the\n * asset-directory-relative path.\n *\n * - When `base` is `\"/\"` this is the identity mapping (`inPrefix: true`).\n * - The base root itself maps to `assetPath: \"/\"`.\n * - A leading `/` is always preserved on the returned asset path.\n * - When the path is off-prefix, `inPrefix` is `false` and the caller returns\n * `NoIntentResponse`.\n */\nexport function stripBasePath(\n\tpublicDecodedPath: string,\n\tbase: string\n): { inPrefix: boolean; assetPath: string } {\n\tif (base === \"/\") {\n\t\treturn { inPrefix: true, assetPath: publicDecodedPath };\n\t}\n\n\tif (!isWithinBase(publicDecodedPath, base)) {\n\t\treturn { inPrefix: false, assetPath: publicDecodedPath };\n\t}\n\n\tconst stripped = publicDecodedPath.slice(base.length - 1);\n\treturn { inPrefix: true, assetPath: stripped === \"\" ? \"/\" : stripped };\n}\n\n/**\n * Re-append the configured base to an asset-directory-relative location,\n * producing a public path. Only ever call this with an explicitly\n * asset-relative location (e.g. an asset-worker-generated redirect); never with\n * a value that might already be public. The empty string represents the base\n * root without its canonical trailing slash.\n */\nexport function addBasePath(assetRelativePath: string, base: string): string {\n\tif (base === \"/\") {\n\t\treturn assetRelativePath;\n\t}\n\tif (assetRelativePath === \"/\") {\n\t\treturn base;\n\t}\n\treturn base.slice(0, -1) + assetRelativePath;\n}\n","// have the browser check in with the server to make sure its local cache is valid before using it\nexport const CACHE_CONTROL_BROWSER = \"public, max-age=0, must-revalidate\";\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 { mockJaegerBinding } from \"../../../utils/tracing\";\nimport {\n\tflagIsEnabled,\n\tSEC_FETCH_MODE_NAVIGATE_HEADER_PREFERS_ASSET_SERVING,\n} from \"../compatibility-flags\";\nimport { CACHE_CONTROL_BROWSER } from \"../constants\";\nimport { HEADERS_VERSION } from \"../handler\";\nimport { generateRulesMatcher, replacer } from \"./rules-engine\";\nimport type { JaegerTracing } from \"../../../utils/types\";\nimport type { AssetIntentWithResolver } from \"../handler\";\nimport type { NormalizedAssetConfig } from \"../types\";\nimport type { Env } from \"../worker\";\n\n/**\n * Returns a Headers object that contains additional headers (to those\n * present in the original request) that the Assets Server Worker\n * should attach to its response.\n *\n */\nexport function getAssetHeaders(\n\t{ eTag, resolver }: AssetIntentWithResolver,\n\tcontentType: string | undefined,\n\tcacheStatus: string,\n\trequest: Request,\n\tconfiguration: NormalizedAssetConfig\n) {\n\tconst headers = new Headers({\n\t\tETag: `\"${eTag}\"`,\n\t});\n\n\tif (contentType !== undefined) {\n\t\theaders.append(\"Content-Type\", contentType);\n\t}\n\n\tif (isCacheable(request)) {\n\t\theaders.append(\"Cache-Control\", CACHE_CONTROL_BROWSER);\n\t}\n\n\t// Attach CF-Cache-Status, this will show to users that we are caching assets\n\t// and it will also populate the cache fields through the logging pipeline.\n\theaders.append(\"CF-Cache-Status\", cacheStatus);\n\n\tif (\n\t\tconfiguration.debug &&\n\t\tresolver === \"not-found\" &&\n\t\tflagIsEnabled(\n\t\t\tconfiguration,\n\t\t\tSEC_FETCH_MODE_NAVIGATE_HEADER_PREFERS_ASSET_SERVING\n\t\t)\n\t) {\n\t\theaders.append(\n\t\t\t\"X-Mf-Additional-Response-Log\",\n\t\t\t\"`Sec-Fetch-Mode: navigate` header present - using `not_found_handling` behavior\"\n\t\t);\n\t}\n\n\treturn headers;\n}\n\nfunction isCacheable(request: Request) {\n\treturn !request.headers.has(\"Authorization\") && !request.headers.has(\"Range\");\n}\n\nexport function attachCustomHeaders(\n\trequest: Request,\n\tresponse: Response,\n\tconfiguration: NormalizedAssetConfig,\n\tenv: Env\n) {\n\tconst jaeger: JaegerTracing = env.JAEGER ?? mockJaegerBinding();\n\treturn jaeger.enterSpan(\"add_headers\", (span) => {\n\t\t// Iterate through rules and find rules that match the path\n\t\tconst headersMatcher = generateRulesMatcher(\n\t\t\tconfiguration.headers?.version === HEADERS_VERSION\n\t\t\t\t? configuration.headers.rules\n\t\t\t\t: {},\n\t\t\t({ set = {}, unset = [] }, replacements) => {\n\t\t\t\tconst replacedSet: Record<string, string> = {};\n\t\t\t\tObject.entries(set).forEach(([key, value]) => {\n\t\t\t\t\treplacedSet[key] = replacer(value, replacements);\n\t\t\t\t});\n\t\t\t\treturn {\n\t\t\t\t\tset: replacedSet,\n\t\t\t\t\tunset,\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\t\tconst matches = headersMatcher({ request });\n\n\t\t// This keeps track of every header that we've set from _headers\n\t\t// because we want to combine user declared headers but overwrite\n\t\t// existing and extra ones\n\t\tconst setMap = new Set();\n\t\t// Apply every matched rule in order\n\t\tmatches.forEach(({ set = {}, unset = [] }) => {\n\t\t\tunset.forEach((key) => {\n\t\t\t\tresponse.headers.delete(key);\n\t\t\t\tspan.addLogs({ remove_header: key });\n\t\t\t});\n\t\t\tObject.entries(set).forEach(([key, value]) => {\n\t\t\t\tif (setMap.has(key.toLowerCase())) {\n\t\t\t\t\tresponse.headers.append(key, value);\n\t\t\t\t\tspan.addLogs({ append_header: key });\n\t\t\t\t} else {\n\t\t\t\t\tresponse.headers.set(key, value);\n\t\t\t\t\tsetMap.add(key.toLowerCase());\n\t\t\t\t\tspan.addLogs({ add_header: key });\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\treturn response;\n\t});\n}\n","import {\n\tFoundResponse,\n\tInternalServerErrorResponse,\n\tMethodNotAllowedResponse,\n\tMovedPermanentlyResponse,\n\tNoIntentResponse,\n\tNotFoundResponse,\n\tNotModifiedResponse,\n\tOkResponse,\n\tPermanentRedirectResponse,\n\tSeeOtherResponse,\n\tTemporaryRedirectResponse,\n} from \"../../utils/responses\";\nimport { mockJaegerBinding } from \"../../utils/tracing\";\nimport {\n\tflagIsEnabled,\n\tSEC_FETCH_MODE_NAVIGATE_HEADER_PREFERS_ASSET_SERVING,\n} from \"./compatibility-flags\";\nimport { addBasePath, stripBasePath } from \"./utils/base-path\";\nimport { attachCustomHeaders, getAssetHeaders } from \"./utils/headers\";\nimport {\n\tgenerateRedirectsMatcher,\n\tstaticRedirectsMatcher,\n} from \"./utils/rules-engine\";\nimport type { Analytics, ServedBy } from \"./analytics\";\nimport type { NormalizedAssetConfig } from \"./types\";\nimport type EntrypointType from \"./worker\";\nimport type { Env } from \"./worker\";\n\nexport const REDIRECTS_VERSION = 1;\nexport const HEADERS_VERSION = 2;\n\ntype AssetIntent = {\n\teTag: string;\n\tstatus: typeof OkResponse.status | typeof NotFoundResponse.status;\n};\n\nexport type AssetIntentWithResolver = AssetIntent & { resolver: Resolver };\n\nconst getResponseOrAssetIntent = async (\n\trequest: Request,\n\tenv: Env,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists,\n\toriginalDecodedPathname: string,\n\tanalytics?: Analytics\n): Promise<Response | AssetIntentWithResolver> => {\n\tconst url = new URL(request.url);\n\tconst { search } = url;\n\n\tconst base = configuration.base_path;\n\n\t// The caller has already enforced the base against the original public\n\t// pathname. Redirect matching keeps the full public pathname; a non-`200`\n\t// authored redirect returns unchanged, while a `200` rewrite is checked\n\t// again below as an authoritative public target.\n\tconst redirectResult = handleRedirects(\n\t\tenv,\n\t\trequest,\n\t\tconfiguration,\n\t\turl.host,\n\t\turl.pathname,\n\t\tsearch\n\t);\n\tif (redirectResult instanceof Response) {\n\t\tanalytics?.setData({ servedBy: \"redirect\" });\n\t\treturn redirectResult;\n\t}\n\tconst { proxied, pathname } = redirectResult;\n\n\t// A `200` proxy rewrite defines the effective public path used for asset\n\t// lookup. The original request has already passed the public entry-point\n\t// boundary check, but the rewritten target must be checked independently.\n\tconst effectiveDecodedPathname = proxied\n\t\t? decodePath(pathname)\n\t\t: originalDecodedPathname;\n\tconst { inPrefix, assetPath } = stripBasePath(effectiveDecodedPathname, base);\n\tif (!inPrefix) {\n\t\treturn noIntent(\n\t\t\tenv,\n\t\t\tanalytics,\n\t\t\tconfiguration,\n\t\t\teffectiveDecodedPathname,\n\t\t\tproxied\n\t\t);\n\t}\n\n\tconst baseRootIntent = proxied\n\t\t? null\n\t\t: await getBaseRootIntent(\n\t\t\t\teffectiveDecodedPathname,\n\t\t\t\tbase,\n\t\t\t\trequest,\n\t\t\t\tconfiguration,\n\t\t\t\texists\n\t\t\t);\n\tconst intent =\n\t\tbaseRootIntent ??\n\t\t(await getIntent(assetPath, request, configuration, exists));\n\n\tif (!intent) {\n\t\treturn noIntent(\n\t\t\tenv,\n\t\t\tanalytics,\n\t\t\tconfiguration,\n\t\t\teffectiveDecodedPathname,\n\t\t\tproxied\n\t\t);\n\t}\n\n\tconst method = request.method.toUpperCase();\n\tif (![\"GET\", \"HEAD\"].includes(method)) {\n\t\tanalytics?.setData({ servedBy: \"method-not-allowed\" });\n\t\treturn env.JAEGER.enterSpan(\"method_not_allowed\", (span) => {\n\t\t\tspan.setTags({\n\t\t\t\tmethod,\n\t\t\t\tstatus: MethodNotAllowedResponse.status,\n\t\t\t});\n\n\t\t\treturn new MethodNotAllowedResponse();\n\t\t});\n\t}\n\n\t// `intent.redirect` is an asset-relative location generated by the asset\n\t// Worker; re-prefix it with the public base exactly once. The non-redirect\n\t// fallback is the effective public pathname and must NOT be re-prefixed.\n\tconst decodedDestination =\n\t\tintent.redirect !== null\n\t\t\t? addBasePath(intent.redirect, base)\n\t\t\t: effectiveDecodedPathname;\n\tconst encodedDestination = encodePath(decodedDestination);\n\n\t/**\n\t * The canonical path we serve an asset at is the decoded and re-encoded version.\n\t * Thus we need to redirect if that is different from the decoded version.\n\t * We combine this with other redirects (e.g. for html_handling) to avoid multiple redirects.\n\t */\n\tif (\n\t\t(encodedDestination !== pathname && intent.asset) ||\n\t\tintent.redirect !== null\n\t) {\n\t\tanalytics?.setData({ servedBy: \"redirect\" });\n\t\treturn env.JAEGER.enterSpan(\"redirect\", (span) => {\n\t\t\tspan.setTags({\n\t\t\t\toriginalPath: pathname,\n\t\t\t\tlocation:\n\t\t\t\t\tencodedDestination !== pathname\n\t\t\t\t\t\t? encodedDestination\n\t\t\t\t\t\t: (intent.redirect ?? \"<unknown>\"),\n\t\t\t\tstatus: TemporaryRedirectResponse.status,\n\t\t\t});\n\n\t\t\treturn new TemporaryRedirectResponse(encodedDestination + search);\n\t\t});\n\t}\n\n\tif (!intent.asset) {\n\t\tanalytics?.setData({ servedBy: \"error\" });\n\t\treturn env.JAEGER.enterSpan(\"unknown_action\", (span) => {\n\t\t\tspan.setTags({\n\t\t\t\tpathname,\n\t\t\t\tstatus: InternalServerErrorResponse.status,\n\t\t\t});\n\n\t\t\treturn new InternalServerErrorResponse(new Error(\"Unknown action\"));\n\t\t});\n\t}\n\n\treturn { ...intent.asset, resolver: intent.resolver };\n};\n\n/**\n * Return the protocol-level response for a request the Asset Worker does not\n * intend to serve, while recording the public decoded pathname in telemetry.\n * Proxied rewrites are claimed as 404s unless the caller explicitly opts out.\n */\nfunction noIntent(\n\tenv: Env,\n\tanalytics: Analytics | undefined,\n\tconfiguration: NormalizedAssetConfig,\n\tdecodedPathname: string,\n\tproxied: boolean,\n\tclaimProxiedRequest = true\n): Response {\n\tconst response =\n\t\tproxied && claimProxiedRequest\n\t\t\t? new NotFoundResponse()\n\t\t\t: new NoIntentResponse();\n\n\tanalytics?.setData({ servedBy: \"none\" });\n\treturn env.JAEGER.enterSpan(\"no_intent\", (span) => {\n\t\tspan.setTags({\n\t\t\tdecodedPathname,\n\t\t\tconfiguration: JSON.stringify(configuration),\n\t\t\tproxied,\n\t\t\tstatus: response.status,\n\t\t});\n\n\t\treturn response;\n\t});\n}\n\nconst resolveAssetIntentToResponse = async (\n\tassetIntent: AssetIntentWithResolver,\n\trequest: Request,\n\tenv: Env,\n\tconfiguration: NormalizedAssetConfig,\n\tgetByETag: typeof EntrypointType.prototype.unstable_getByETag,\n\tanalytics: Analytics\n) => {\n\tconst { pathname } = new URL(request.url);\n\tconst method = request.method.toUpperCase();\n\n\tconst asset = await env.JAEGER.enterSpan(\"getByETag\", async (span) => {\n\t\tspan.setTags({\n\t\t\tpathname,\n\t\t\teTag: assetIntent.eTag,\n\t\t\tstatus: assetIntent.status,\n\t\t});\n\n\t\treturn await getByETag(assetIntent.eTag, request);\n\t});\n\n\tconst headers = getAssetHeaders(\n\t\tassetIntent,\n\t\tasset.contentType,\n\t\tasset.cacheStatus,\n\t\trequest,\n\t\tconfiguration\n\t);\n\tanalytics.setData({ cacheStatus: asset.cacheStatus });\n\n\tconst strongETag = `\"${assetIntent.eTag}\"`;\n\tconst weakETag = `W/${strongETag}`;\n\tconst ifNoneMatch = request.headers.get(\"If-None-Match\") || \"\";\n\tif ([weakETag, strongETag].includes(ifNoneMatch)) {\n\t\tanalytics.setData({ servedBy: \"not-modified\" });\n\t\treturn env.JAEGER.enterSpan(\"matched_etag\", (span) => {\n\t\t\tspan.setTags({\n\t\t\t\tmatchedEtag: ifNoneMatch,\n\t\t\t\tstatus: NotModifiedResponse.status,\n\t\t\t});\n\n\t\t\treturn new NotModifiedResponse(null, { headers });\n\t\t});\n\t}\n\n\tanalytics.setData({\n\t\tservedBy: servedByForResolver(assetIntent.resolver, configuration),\n\t});\n\treturn env.JAEGER.enterSpan(\"response\", (span) => {\n\t\tspan.setTags({\n\t\t\tetag: assetIntent.eTag,\n\t\t\tstatus: assetIntent.status,\n\t\t\thead: method === \"HEAD\",\n\t\t});\n\n\t\tconst body = method === \"HEAD\" ? null : asset.readableStream;\n\t\tswitch (assetIntent.status) {\n\t\t\tcase NotFoundResponse.status:\n\t\t\t\treturn new NotFoundResponse(body, { headers });\n\t\t\tcase OkResponse.status:\n\t\t\t\treturn new OkResponse(body, { headers });\n\t\t}\n\t});\n};\n\n/**\n * Decode the request pathname exactly once and map it from the public URL\n * namespace into the asset-directory namespace. The returned decodedPathname\n * always remains public and is suitable for request-facing telemetry.\n */\nfunction getRequestBasePath(\n\trequest: Request,\n\tbase: string\n): { decodedPathname: string; inPrefix: boolean; assetPath: string } {\n\tconst decodedPathname = decodePath(new URL(request.url).pathname);\n\treturn {\n\t\tdecodedPathname,\n\t\t...stripBasePath(decodedPathname, base),\n\t};\n}\n\nexport const canFetch = async (\n\trequest: Request,\n\tenv: Env,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists\n): Promise<boolean> => {\n\tconst requestPath = getRequestBasePath(request, configuration.base_path);\n\tif (!requestPath.inPrefix) {\n\t\treturn false;\n\t}\n\n\tconst shouldKeepNotFoundHandling =\n\t\tconfiguration.has_static_routing ||\n\t\t(flagIsEnabled(\n\t\t\tconfiguration,\n\t\t\tSEC_FETCH_MODE_NAVIGATE_HEADER_PREFERS_ASSET_SERVING\n\t\t) &&\n\t\t\trequest.headers.get(\"Sec-Fetch-Mode\") === \"navigate\");\n\tif (!shouldKeepNotFoundHandling) {\n\t\tconfiguration = {\n\t\t\t...configuration,\n\t\t\tnot_found_handling: \"none\",\n\t\t};\n\t}\n\n\tconst responseOrAssetIntent = await getResponseOrAssetIntent(\n\t\trequest,\n\t\tenv,\n\t\tconfiguration,\n\t\texists,\n\t\trequestPath.decodedPathname\n\t);\n\n\tif (responseOrAssetIntent instanceof NoIntentResponse) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\nexport const handleRequest = async (\n\trequest: Request,\n\tenv: Env,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists,\n\tgetByETag: typeof EntrypointType.prototype.unstable_getByETag,\n\tanalytics: Analytics\n) => {\n\tconst requestPath = getRequestBasePath(request, configuration.base_path);\n\tif (!requestPath.inPrefix) {\n\t\treturn noIntent(\n\t\t\tenv,\n\t\t\tanalytics,\n\t\t\tconfiguration,\n\t\t\trequestPath.decodedPathname,\n\t\t\tfalse\n\t\t);\n\t}\n\n\tconst responseOrAssetIntent = await getResponseOrAssetIntent(\n\t\trequest,\n\t\tenv,\n\t\tconfiguration,\n\t\texists,\n\t\trequestPath.decodedPathname,\n\t\tanalytics\n\t);\n\n\tconst response =\n\t\tresponseOrAssetIntent instanceof Response\n\t\t\t? responseOrAssetIntent\n\t\t\t: await resolveAssetIntentToResponse(\n\t\t\t\t\tresponseOrAssetIntent,\n\t\t\t\t\trequest,\n\t\t\t\t\tenv,\n\t\t\t\t\tconfiguration,\n\t\t\t\t\tgetByETag,\n\t\t\t\t\tanalytics\n\t\t\t\t);\n\n\treturn attachCustomHeaders(request, response, configuration, env);\n};\n\ntype Resolver = \"html-handling\" | \"not-found\";\n\nfunction servedByForResolver(\n\tresolver: Resolver,\n\tconfiguration: NormalizedAssetConfig\n): ServedBy {\n\tif (resolver === \"html-handling\") {\n\t\treturn \"asset\";\n\t}\n\n\tswitch (configuration.not_found_handling) {\n\t\tcase \"single-page-application\":\n\t\t\treturn \"spa\";\n\t\tcase \"404-page\":\n\t\t\treturn \"404-page\";\n\t\tcase \"none\":\n\t\t\treturn \"none\";\n\t\tdefault:\n\t\t\tconfiguration.not_found_handling satisfies never;\n\t\t\treturn \"error\";\n\t}\n}\n\ntype Intent =\n\t| {\n\t\t\tasset: AssetIntent;\n\t\t\tredirect: null;\n\t\t\tresolver: Resolver;\n\t }\n\t| { asset: null; redirect: string; resolver: Resolver }\n\t| null;\n\n// TODO: Trace this\nexport const getIntent = async (\n\tpathname: string,\n\trequest: Request,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists,\n\tskipRedirects = false\n): Promise<Intent> => {\n\tswitch (configuration.html_handling) {\n\t\tcase \"auto-trailing-slash\": {\n\t\t\treturn htmlHandlingAutoTrailingSlash(\n\t\t\t\tpathname,\n\t\t\t\trequest,\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects\n\t\t\t);\n\t\t}\n\t\tcase \"force-trailing-slash\": {\n\t\t\treturn htmlHandlingForceTrailingSlash(\n\t\t\t\tpathname,\n\t\t\t\trequest,\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects\n\t\t\t);\n\t\t}\n\t\tcase \"drop-trailing-slash\": {\n\t\t\treturn htmlHandlingDropTrailingSlash(\n\t\t\t\tpathname,\n\t\t\t\trequest,\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects\n\t\t\t);\n\t\t}\n\t\tcase \"none\": {\n\t\t\treturn htmlHandlingNone(pathname, request, configuration, exists);\n\t\t}\n\t}\n};\n\n/**\n * Resolve the generated redirect, if any, for the public base root. The\n * returned redirect is asset-relative and must be prefixed exactly once by the\n * top-level handler. Authored redirects and proxy rewrites are handled before\n * this helper is called.\n */\nasync function getBaseRootIntent(\n\tpublicDecodedPath: string,\n\tbase: string,\n\trequest: Request,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists\n): Promise<Intent> {\n\tlet pathname: string | null;\n\tswitch (configuration.html_handling) {\n\t\tcase \"force-trailing-slash\":\n\t\tcase \"auto-trailing-slash\":\n\t\t\tpathname =\n\t\t\t\tbase !== \"/\" && publicDecodedPath === base.slice(0, -1) ? \"/\" : null;\n\t\t\tbreak;\n\t\tcase \"drop-trailing-slash\":\n\t\t\tpathname = base !== \"/\" && publicDecodedPath === base ? \"\" : null;\n\t\t\tbreak;\n\t\tcase \"none\":\n\t\t\treturn null;\n\t}\n\n\tif (pathname === null || !(await exists(\"/index.html\", request))) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tasset: null,\n\t\tredirect: pathname,\n\t\tresolver: \"html-handling\",\n\t};\n}\n\nconst htmlHandlingAutoTrailingSlash = async (\n\tpathname: string,\n\trequest: Request,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists,\n\tskipRedirects: boolean\n): Promise<Intent> => {\n\tlet redirectResult: Intent = null;\n\tlet eTagResult: string | null = null;\n\tconst exactETag = await exists(pathname, request);\n\tif (pathname.endsWith(\"/index\")) {\n\t\tif (exactETag) {\n\t\t\t// there's a binary /index file\n\t\t\treturn {\n\t\t\t\tasset: {\n\t\t\t\t\teTag: exactETag,\n\t\t\t\t\tstatus: OkResponse.status,\n\t\t\t\t},\n\t\t\t\tredirect: null,\n\t\t\t\tresolver: \"html-handling\",\n\t\t\t};\n\t\t} else {\n\t\t\tif (\n\t\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t\t`${pathname}.html`,\n\t\t\t\t\trequest,\n\t\t\t\t\tpathname.slice(0, -\"index\".length),\n\t\t\t\t\tconfiguration,\n\t\t\t\t\texists,\n\t\t\t\t\tskipRedirects,\n\t\t\t\t\t\"html-handling\"\n\t\t\t\t))\n\t\t\t) {\n\t\t\t\t// /foo/index.html exists so redirect to /foo/\n\t\t\t\treturn redirectResult;\n\t\t\t} else if (\n\t\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t\t`${pathname.slice(0, -\"/index\".length)}.html`,\n\t\t\t\t\trequest,\n\t\t\t\t\tpathname.slice(0, -\"/index\".length),\n\t\t\t\t\tconfiguration,\n\t\t\t\t\texists,\n\t\t\t\t\tskipRedirects,\n\t\t\t\t\t\"html-handling\"\n\t\t\t\t))\n\t\t\t) {\n\t\t\t\t// /foo.html exists so redirect to /foo\n\t\t\t\treturn redirectResult;\n\t\t\t}\n\t\t}\n\t} else if (pathname.endsWith(\"/index.html\")) {\n\t\tif (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\tpathname,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\"index.html\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo/index.html exists so redirect to /foo/\n\t\t\treturn redirectResult;\n\t\t} else if (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t`${pathname.slice(0, -\"/index.html\".length)}.html`,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\"/index.html\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo.html exists so redirect to /foo\n\t\t\treturn redirectResult;\n\t\t}\n\t} else if (pathname.endsWith(\"/\")) {\n\t\tif ((eTagResult = await exists(`${pathname}index.html`, request))) {\n\t\t\t// /foo/index.html exists so serve at /foo/\n\t\t\treturn {\n\t\t\t\tasset: { eTag: eTagResult, status: OkResponse.status },\n\t\t\t\tredirect: null,\n\t\t\t\tresolver: \"html-handling\",\n\t\t\t};\n\t\t} else if (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t`${pathname.slice(0, -\"/\".length)}.html`,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\"/\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo.html exists so redirect to /foo\n\t\t\treturn redirectResult;\n\t\t}\n\t} else if (pathname.endsWith(\".html\")) {\n\t\tif (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\tpathname,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\".html\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo.html exists so redirect to /foo\n\t\t\treturn redirectResult;\n\t\t} else if (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t`${pathname.slice(0, -\".html\".length)}/index.html`,\n\t\t\t\trequest,\n\t\t\t\t`${pathname.slice(0, -\".html\".length)}/`,\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// request for /foo.html but /foo/index.html exists so redirect to /foo/\n\t\t\treturn redirectResult;\n\t\t}\n\t}\n\n\tif (exactETag) {\n\t\t// there's a binary /foo file\n\t\treturn {\n\t\t\tasset: { eTag: exactETag, status: OkResponse.status },\n\t\t\tredirect: null,\n\t\t\tresolver: \"html-handling\",\n\t\t};\n\t} else if ((eTagResult = await exists(`${pathname}.html`, request))) {\n\t\t// foo.html exists so serve at /foo\n\t\treturn {\n\t\t\tasset: { eTag: eTagResult, status: OkResponse.status },\n\t\t\tredirect: null,\n\t\t\tresolver: \"html-handling\",\n\t\t};\n\t} else if (\n\t\t(redirectResult = await safeRedirect(\n\t\t\t`${pathname}/index.html`,\n\t\t\trequest,\n\t\t\t`${pathname}/`,\n\t\t\tconfiguration,\n\t\t\texists,\n\t\t\tskipRedirects,\n\t\t\t\"html-handling\"\n\t\t))\n\t) {\n\t\t// /foo/index.html exists so redirect to /foo/\n\t\treturn redirectResult;\n\t}\n\n\treturn notFound(pathname, request, configuration, exists);\n};\n\nconst htmlHandlingForceTrailingSlash = async (\n\tpathname: string,\n\trequest: Request,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists,\n\tskipRedirects: boolean\n): Promise<Intent> => {\n\tlet redirectResult: Intent = null;\n\tlet eTagResult: string | null = null;\n\tconst exactETag = await exists(pathname, request);\n\tif (pathname.endsWith(\"/index\")) {\n\t\tif (exactETag) {\n\t\t\t// there's a binary /index file\n\t\t\treturn {\n\t\t\t\tasset: { eTag: exactETag, status: OkResponse.status },\n\t\t\t\tredirect: null,\n\t\t\t\tresolver: \"html-handling\",\n\t\t\t};\n\t\t} else {\n\t\t\tif (\n\t\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t\t`${pathname}.html`,\n\t\t\t\t\trequest,\n\t\t\t\t\tpathname.slice(0, -\"index\".length),\n\t\t\t\t\tconfiguration,\n\t\t\t\t\texists,\n\t\t\t\t\tskipRedirects,\n\t\t\t\t\t\"html-handling\"\n\t\t\t\t))\n\t\t\t) {\n\t\t\t\t// /foo/index.html exists so redirect to /foo/\n\t\t\t\treturn redirectResult;\n\t\t\t} else if (\n\t\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t\t`${pathname.slice(0, -\"/index\".length)}.html`,\n\t\t\t\t\trequest,\n\t\t\t\t\tpathname.slice(0, -\"index\".length),\n\t\t\t\t\tconfiguration,\n\t\t\t\t\texists,\n\t\t\t\t\tskipRedirects,\n\t\t\t\t\t\"html-handling\"\n\t\t\t\t))\n\t\t\t) {\n\t\t\t\t// /foo.html exists so redirect to /foo/\n\t\t\t\treturn redirectResult;\n\t\t\t}\n\t\t}\n\t} else if (pathname.endsWith(\"/index.html\")) {\n\t\tif (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\tpathname,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\"index.html\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo/index.html exists so redirect to /foo/\n\t\t\treturn redirectResult;\n\t\t} else if (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t`${pathname.slice(0, -\"/index.html\".length)}.html`,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\"index.html\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo.html exists so redirect to /foo/\n\t\t\treturn redirectResult;\n\t\t}\n\t} else if (pathname.endsWith(\"/\")) {\n\t\tif ((eTagResult = await exists(`${pathname}index.html`, request))) {\n\t\t\t// /foo/index.html exists so serve at /foo/\n\t\t\treturn {\n\t\t\t\tasset: { eTag: eTagResult, status: OkResponse.status },\n\t\t\t\tredirect: null,\n\t\t\t\tresolver: \"html-handling\",\n\t\t\t};\n\t\t} else if (\n\t\t\t(eTagResult = await exists(\n\t\t\t\t`${pathname.slice(0, -\"/\".length)}.html`,\n\t\t\t\trequest\n\t\t\t))\n\t\t) {\n\t\t\t// /foo.html exists so serve at /foo/\n\t\t\treturn {\n\t\t\t\tasset: { eTag: eTagResult, status: OkResponse.status },\n\t\t\t\tredirect: null,\n\t\t\t\tresolver: \"html-handling\",\n\t\t\t};\n\t\t}\n\t} else if (pathname.endsWith(\".html\")) {\n\t\tif (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\tpathname,\n\t\t\t\trequest,\n\t\t\t\t`${pathname.slice(0, -\".html\".length)}/`,\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo.html exists so redirect to /foo/\n\t\t\treturn redirectResult;\n\t\t} else if (exactETag) {\n\t\t\t// there's both /foo.html and /foo/index.html so we serve /foo.html at /foo.html only\n\t\t\treturn {\n\t\t\t\tasset: { eTag: exactETag, status: OkResponse.status },\n\t\t\t\tredirect: null,\n\t\t\t\tresolver: \"html-handling\",\n\t\t\t};\n\t\t} else if (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t`${pathname.slice(0, -\".html\".length)}/index.html`,\n\t\t\t\trequest,\n\t\t\t\t`${pathname.slice(0, -\".html\".length)}/`,\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo/index.html exists so redirect to /foo/\n\t\t\treturn redirectResult;\n\t\t}\n\t}\n\n\tif (exactETag) {\n\t\t// there's a binary /foo file\n\t\treturn {\n\t\t\tasset: { eTag: exactETag, status: OkResponse.status },\n\t\t\tredirect: null,\n\t\t\tresolver: \"html-handling\",\n\t\t};\n\t} else if (\n\t\t(redirectResult = await safeRedirect(\n\t\t\t`${pathname}.html`,\n\t\t\trequest,\n\t\t\t`${pathname}/`,\n\t\t\tconfiguration,\n\t\t\texists,\n\t\t\tskipRedirects,\n\t\t\t\"html-handling\"\n\t\t))\n\t) {\n\t\t// /foo.html exists so redirect to /foo/\n\t\treturn redirectResult;\n\t} else if (\n\t\t(redirectResult = await safeRedirect(\n\t\t\t`${pathname}/index.html`,\n\t\t\trequest,\n\t\t\t`${pathname}/`,\n\t\t\tconfiguration,\n\t\t\texists,\n\t\t\tskipRedirects,\n\t\t\t\"html-handling\"\n\t\t))\n\t) {\n\t\t// /foo/index.html exists so redirect to /foo/\n\t\treturn redirectResult;\n\t}\n\n\treturn notFound(pathname, request, configuration, exists);\n};\n\nconst htmlHandlingDropTrailingSlash = async (\n\tpathname: string,\n\trequest: Request,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists,\n\tskipRedirects: boolean\n): Promise<Intent> => {\n\tlet redirectResult: Intent = null;\n\tlet eTagResult: string | null = null;\n\tconst exactETag = await exists(pathname, request);\n\tif (pathname.endsWith(\"/index\")) {\n\t\tif (exactETag) {\n\t\t\t// there's a binary /index file\n\t\t\treturn {\n\t\t\t\tasset: { eTag: exactETag, status: OkResponse.status },\n\t\t\t\tredirect: null,\n\t\t\t\tresolver: \"html-handling\",\n\t\t\t};\n\t\t} else {\n\t\t\tif (pathname === \"/index\") {\n\t\t\t\tif (\n\t\t\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t\t\t\"/index.html\",\n\t\t\t\t\t\trequest,\n\t\t\t\t\t\t\"/\",\n\t\t\t\t\t\tconfiguration,\n\t\t\t\t\t\texists,\n\t\t\t\t\t\tskipRedirects,\n\t\t\t\t\t\t\"html-handling\"\n\t\t\t\t\t))\n\t\t\t\t) {\n\t\t\t\t\treturn redirectResult;\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t\t`${pathname.slice(0, -\"/index\".length)}.html`,\n\t\t\t\t\trequest,\n\t\t\t\t\tpathname.slice(0, -\"/index\".length),\n\t\t\t\t\tconfiguration,\n\t\t\t\t\texists,\n\t\t\t\t\tskipRedirects,\n\t\t\t\t\t\"html-handling\"\n\t\t\t\t))\n\t\t\t) {\n\t\t\t\t// /foo.html exists so redirect to /foo\n\t\t\t\treturn redirectResult;\n\t\t\t} else if (\n\t\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t\t`${pathname}.html`,\n\t\t\t\t\trequest,\n\t\t\t\t\tpathname.slice(0, -\"/index\".length),\n\t\t\t\t\tconfiguration,\n\t\t\t\t\texists,\n\t\t\t\t\tskipRedirects,\n\t\t\t\t\t\"html-handling\"\n\t\t\t\t))\n\t\t\t) {\n\t\t\t\t// /foo/index.html exists so redirect to /foo\n\t\t\t\treturn redirectResult;\n\t\t\t}\n\t\t}\n\t} else if (pathname.endsWith(\"/index.html\")) {\n\t\t// special handling so you don't drop / if the path is just /\n\t\tif (pathname === \"/index.html\") {\n\t\t\tif (\n\t\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t\t\"/index.html\",\n\t\t\t\t\trequest,\n\t\t\t\t\t\"/\",\n\t\t\t\t\tconfiguration,\n\t\t\t\t\texists,\n\t\t\t\t\tskipRedirects,\n\t\t\t\t\t\"html-handling\"\n\t\t\t\t))\n\t\t\t) {\n\t\t\t\treturn redirectResult;\n\t\t\t}\n\t\t} else if (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\tpathname,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\"/index.html\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo/index.html exists so redirect to /foo\n\t\t\treturn redirectResult;\n\t\t} else if (exactETag) {\n\t\t\t// there's both /foo.html and /foo/index.html so we serve /foo/index.html at /foo/index.html only\n\t\t\treturn {\n\t\t\t\tasset: { eTag: exactETag, status: OkResponse.status },\n\t\t\t\tredirect: null,\n\t\t\t\tresolver: \"html-handling\",\n\t\t\t};\n\t\t} else if (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t`${pathname.slice(0, -\"/index.html\".length)}.html`,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\"/index.html\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo.html exists so redirect to /foo\n\t\t\treturn redirectResult;\n\t\t}\n\t} else if (pathname.endsWith(\"/\")) {\n\t\tif (pathname === \"/\") {\n\t\t\tif ((eTagResult = await exists(\"/index.html\", request))) {\n\t\t\t\t// /index.html exists so serve at /\n\t\t\t\treturn {\n\t\t\t\t\tasset: { eTag: eTagResult, status: OkResponse.status },\n\t\t\t\t\tredirect: null,\n\t\t\t\t\tresolver: \"html-handling\",\n\t\t\t\t};\n\t\t\t}\n\t\t} else if (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t`${pathname.slice(0, -\"/\".length)}.html`,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\"/\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo.html exists so redirect to /foo\n\t\t\treturn redirectResult;\n\t\t} else if (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t`${pathname.slice(0, -\"/\".length)}/index.html`,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\"/\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo/index.html exists so redirect to /foo\n\t\t\treturn redirectResult;\n\t\t}\n\t} else if (pathname.endsWith(\".html\")) {\n\t\tif (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\tpathname,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\".html\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo.html exists so redirect to /foo\n\t\t\treturn redirectResult;\n\t\t} else if (\n\t\t\t(redirectResult = await safeRedirect(\n\t\t\t\t`${pathname.slice(0, -\".html\".length)}/index.html`,\n\t\t\t\trequest,\n\t\t\t\tpathname.slice(0, -\".html\".length),\n\t\t\t\tconfiguration,\n\t\t\t\texists,\n\t\t\t\tskipRedirects,\n\t\t\t\t\"html-handling\"\n\t\t\t))\n\t\t) {\n\t\t\t// /foo/index.html exists so redirect to /foo\n\t\t\treturn redirectResult;\n\t\t}\n\t}\n\n\tif (exactETag) {\n\t\t// there's a binary /foo file\n\t\treturn {\n\t\t\tasset: { eTag: exactETag, status: OkResponse.status },\n\t\t\tredirect: null,\n\t\t\tresolver: \"html-handling\",\n\t\t};\n\t} else if ((eTagResult = await exists(`${pathname}.html`, request))) {\n\t\t// /foo.html exists so serve at /foo\n\t\treturn {\n\t\t\tasset: { eTag: eTagResult, status: OkResponse.status },\n\t\t\tredirect: null,\n\t\t\tresolver: \"html-handling\",\n\t\t};\n\t} else if ((eTagResult = await exists(`${pathname}/index.html`, request))) {\n\t\t// /foo/index.html exists so serve at /foo\n\t\treturn {\n\t\t\tasset: { eTag: eTagResult, status: OkResponse.status },\n\t\t\tredirect: null,\n\t\t\tresolver: \"html-handling\",\n\t\t};\n\t}\n\n\treturn notFound(pathname, request, configuration, exists);\n};\n\nconst htmlHandlingNone = async (\n\tpathname: string,\n\trequest: Request,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists\n): Promise<Intent> => {\n\tconst exactETag = await exists(pathname, request);\n\tif (exactETag) {\n\t\treturn {\n\t\t\tasset: { eTag: exactETag, status: OkResponse.status },\n\t\t\tredirect: null,\n\t\t\tresolver: \"html-handling\",\n\t\t};\n\t} else {\n\t\treturn notFound(pathname, request, configuration, exists);\n\t}\n};\n\nconst notFound = async (\n\tpathname: string,\n\trequest: Request,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists\n): Promise<Intent> => {\n\tswitch (configuration.not_found_handling) {\n\t\tcase \"single-page-application\": {\n\t\t\tconst eTag = await exists(\"/index.html\", request);\n\t\t\tif (eTag) {\n\t\t\t\treturn {\n\t\t\t\t\tasset: { eTag, status: OkResponse.status },\n\t\t\t\t\tredirect: null,\n\t\t\t\t\tresolver: \"not-found\",\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\tcase \"404-page\": {\n\t\t\tlet cwd = pathname;\n\t\t\twhile (cwd) {\n\t\t\t\tcwd = cwd.slice(0, cwd.lastIndexOf(\"/\"));\n\t\t\t\tconst eTag = await exists(`${cwd}/404.html`, request);\n\t\t\t\tif (eTag) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tasset: { eTag, status: NotFoundResponse.status },\n\t\t\t\t\t\tredirect: null,\n\t\t\t\t\t\tresolver: \"not-found\",\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\tcase \"none\":\n\t\tdefault: {\n\t\t\treturn null;\n\t\t}\n\t}\n};\n\nconst safeRedirect = async (\n\tfile: string,\n\trequest: Request,\n\tdestination: string,\n\tconfiguration: NormalizedAssetConfig,\n\texists: typeof EntrypointType.prototype.unstable_exists,\n\tskip: boolean,\n\tresolver: Resolver\n): Promise<Intent> => {\n\tif (skip) {\n\t\treturn null;\n\t}\n\n\tif (!(await exists(destination, request))) {\n\t\tconst intent = await getIntent(\n\t\t\tdestination,\n\t\t\trequest,\n\t\t\tconfiguration,\n\t\t\texists,\n\t\t\ttrue\n\t\t);\n\t\t// return only if the eTag matches - i.e. not the 404 case\n\t\tif (intent?.asset && intent.asset.eTag === (await exists(file, request))) {\n\t\t\treturn {\n\t\t\t\tasset: null,\n\t\t\t\tredirect: destination,\n\t\t\t\tresolver,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn null;\n};\n\n/**\n *\n * +===========================================+===========+======================+\n * | character type | fetch() | encodeURIComponent() |\n * +===========================================+===========+======================+\n * | unreserved ASCII e.g. a-z | unchanged | unchanged |\n * +-------------------------------------------+-----------+----------------------+\n * | reserved (sometimes encoded) | unchanged | encoded |\n * | e.g. [ ] @ $ ! ' ( ) * + , ; = : ? # & % | | |\n * +-------------------------------------------+-----------+----------------------+\n * | non-ASCII e.g. ü. and space | encoded | encoded |\n * +-------------------------------------------+-----------+----------------------+\n *\n * 1. Decode incoming path to handle non-ASCII characters or optionally encoded characters (e.g. square brackets)\n * 2. Match decoded path to manifest\n * 3. Re-encode the path and redirect if the re-encoded path is different from the original path\n *\n * If the user uploads a file that is already URL-encoded, that is accessible only at the (double) encoded path.\n * e.g. /%5Bboop%5D.html is served at /%255Bboop%255D only\n *\n * */\n\n/**\n * Decode all incoming paths to ensure that we can handle paths with non-ASCII characters.\n */\nconst decodePath = (pathname: string) => {\n\treturn (\n\t\tpathname\n\t\t\t.split(\"/\")\n\t\t\t.map((x) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst decoded = decodeURIComponent(x);\n\t\t\t\t\treturn decoded;\n\t\t\t\t} catch {\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.join(\"/\")\n\t\t\t// normalize the path; remove multiple slashes which could lead to same-schema redirects\n\t\t\t.replace(/\\/+/g, \"/\")\n\t);\n};\n/**\n * Use the encoded path as the canonical path for sometimes-encoded characters\n * e.g. /[boop] -> /%5Bboop%5D 307\n */\nconst encodePath = (pathname: string) => {\n\treturn pathname\n\t\t.split(\"/\")\n\t\t.map((x) => {\n\t\t\ttry {\n\t\t\t\tconst encoded = encodeURIComponent(x);\n\t\t\t\treturn encoded;\n\t\t\t} catch {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t})\n\t\t.join(\"/\");\n};\n\nconst handleRedirects = (\n\tenv: Env,\n\trequest: Request,\n\tconfiguration: NormalizedAssetConfig,\n\thost: string,\n\tpathname: string,\n\tsearch: string\n): { proxied: boolean; pathname: string } | Response => {\n\tconst jaeger = env.JAEGER ?? mockJaegerBinding();\n\treturn jaeger.enterSpan(\"handle_redirects\", (span) => {\n\t\tconst redirectMatch =\n\t\t\tstaticRedirectsMatcher(configuration, host, pathname) ||\n\t\t\tgenerateRedirectsMatcher(configuration)({ request })[0];\n\n\t\tlet proxied = false;\n\t\tif (redirectMatch) {\n\t\t\tif (redirectMatch.status === 200) {\n\t\t\t\t// A 200 redirect means that we are proxying/rewriting to a different asset, for example,\n\t\t\t\t// a request with url /users/12345 could be pointed to /users/id.html. In order to\n\t\t\t\t// do this, we overwrite the pathname, and instead match for assets with that url,\n\t\t\t\t// and importantly, do not use the regular redirect handler - as the url visible to\n\t\t\t\t// the user does not change\n\t\t\t\tpathname = new URL(redirectMatch.to, request.url).pathname;\n\t\t\t\tproxied = true;\n\n\t\t\t\tspan.setTags({\n\t\t\t\t\tmatched: true,\n\t\t\t\t\tproxied: true,\n\t\t\t\t\tnew_path: pathname,\n\t\t\t\t\tstatus: redirectMatch.status,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst { status, to } = redirectMatch;\n\t\t\t\tconst destination = new URL(to, request.url);\n\t\t\t\tconst location =\n\t\t\t\t\tdestination.origin === new URL(request.url).origin\n\t\t\t\t\t\t? `${destination.pathname}${destination.search || search}${\n\t\t\t\t\t\t\t\tdestination.hash\n\t\t\t\t\t\t\t}`\n\t\t\t\t\t\t: `${destination.href.slice(0, destination.href.length - (destination.search.length + destination.hash.length))}${\n\t\t\t\t\t\t\t\tdestination.search ? destination.search : search\n\t\t\t\t\t\t\t}${destination.hash}`;\n\n\t\t\t\tspan.setTags({\n\t\t\t\t\tmatched: true,\n\t\t\t\t\tdestination: location,\n\t\t\t\t\tstatus,\n\t\t\t\t});\n\n\t\t\t\tswitch (status) {\n\t\t\t\t\tcase MovedPermanentlyResponse.status:\n\t\t\t\t\t\treturn new MovedPermanentlyResponse(location);\n\t\t\t\t\tcase SeeOtherResponse.status:\n\t\t\t\t\t\treturn new SeeOtherResponse(location);\n\t\t\t\t\tcase TemporaryRedirectResponse.status:\n\t\t\t\t\t\treturn new TemporaryRedirectResponse(location);\n\t\t\t\t\tcase PermanentRedirectResponse.status:\n\t\t\t\t\t\treturn new PermanentRedirectResponse(location);\n\t\t\t\t\tcase FoundResponse.status:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn new FoundResponse(location);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspan.setTags({\n\t\t\t\tmatched: false,\n\t\t\t});\n\t\t}\n\n\t\treturn { proxied, pathname };\n\t});\n};\n","import { InternalServerErrorResponse } from \"../../../utils/responses\";\nimport type { PerformanceTimer } from \"../../../utils/performance\";\nimport type { Analytics } from \"../analytics\";\nimport type { Toucan } from \"toucan-js\";\n\nexport function handleError(\n\tsentry: Toucan | undefined,\n\tanalytics: Analytics,\n\terr: unknown\n) {\n\ttry {\n\t\tconst response = new InternalServerErrorResponse(err as Error);\n\n\t\t// Log to Sentry if we can\n\t\tif (sentry) {\n\t\t\tsentry.captureException(err);\n\t\t}\n\n\t\tanalytics.setData({ servedBy: \"error\" });\n\t\tif (err instanceof Error) {\n\t\t\tanalytics.setData({ error: err.message });\n\t\t}\n\n\t\treturn response;\n\t} catch (e) {\n\t\tconsole.error(\"Error handling error\", e);\n\t\treturn new InternalServerErrorResponse(e as Error);\n\t}\n}\n\nexport function submitMetrics(\n\tanalytics: Analytics,\n\tperformance: PerformanceTimer,\n\tstartTimeMs: number\n) {\n\ttry {\n\t\tanalytics.setData({ requestTime: performance.now() - startTimeMs });\n\t\tanalytics.write();\n\t} catch (e) {\n\t\tconsole.error(\"Error submitting metrics\", e);\n\t}\n}\n","import type { Toucan } from \"toucan-js\";\n\nexport type AssetMetadata = {\n\tcontentType: string;\n};\n\nexport async function getAssetWithMetadataFromKV(\n\tassetsKVNamespace: KVNamespace,\n\tassetKey: string,\n\tsentry?: Toucan,\n\tretries = 3\n) {\n\tlet attempts = 0;\n\n\twhile (attempts <= retries) {\n\t\ttry {\n\t\t\tconst asset = await assetsKVNamespace.getWithMetadata<AssetMetadata>(\n\t\t\t\tassetKey,\n\t\t\t\t{\n\t\t\t\t\ttype: \"stream\",\n\t\t\t\t\tcacheTtl: 31536000, // 1 year\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif (asset.value === null) {\n\t\t\t\t// Don't cache a 404 for a year by re-requesting with a minimum cacheTtl\n\t\t\t\tconst retriedAsset =\n\t\t\t\t\tawait assetsKVNamespace.getWithMetadata<AssetMetadata>(assetKey, {\n\t\t\t\t\t\ttype: \"stream\",\n\t\t\t\t\t\tcacheTtl: 60, // Minimum value allowed\n\t\t\t\t\t});\n\n\t\t\t\tif (retriedAsset.value !== null && sentry) {\n\t\t\t\t\tsentry.captureException(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Initial request for asset ${assetKey} failed, but subsequent request succeeded.`\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn retriedAsset;\n\t\t\t}\n\t\t\treturn asset;\n\t\t} catch (err) {\n\t\t\tif (attempts >= retries) {\n\t\t\t\tlet message = `KV GET ${assetKey} failed.`;\n\t\t\t\tif (err instanceof Error) {\n\t\t\t\t\tmessage = `KV GET ${assetKey} failed: ${err.message}`;\n\t\t\t\t}\n\t\t\t\tthrow new Error(message);\n\t\t\t}\n\n\t\t\t// Exponential backoff, 1 second first time, then 2 second, then 4 second etc.\n\t\t\tawait new Promise((resolvePromise) =>\n\t\t\t\tsetTimeout(resolvePromise, Math.pow(2, attempts++) * 1000)\n\t\t\t);\n\t\t}\n\t}\n}\n","import { WorkerEntrypoint } from \"cloudflare:workers\";\nimport { PerformanceTimer } from \"../../utils/performance\";\nimport { setupSentry } from \"../../utils/sentry\";\nimport { mockJaegerBinding } from \"../../utils/tracing\";\nimport { Analytics, EntrypointType, getRequestKind } from \"./analytics\";\nimport { AssetsManifest } from \"./assets-manifest\";\nimport { normalizeConfiguration } from \"./configuration\";\nimport { ExperimentAnalytics } from \"./experiment-analytics\";\nimport { canFetch, handleRequest } from \"./handler\";\nimport { handleError, submitMetrics } from \"./utils/final-operations\";\nimport { getAssetWithMetadataFromKV } from \"./utils/kv\";\nimport type {\n\tAssetConfig,\n\tColoMetadata,\n\tJaegerTracing,\n\tSpanContext,\n\tUnsafePerformanceTimer,\n} from \"../../utils/types\";\nimport type { AccountCohortQuerierBinding } from \"../worker-configuration\";\nimport type { Environment, ReadyAnalytics } from \"./types\";\n\n// ============================================================\n// SECTION 1: SHARED TYPES & INTERFACE CONTRACT\n// ============================================================\n\nexport type Env = {\n\t/*\n\t * ASSETS_MANIFEST is a pipeline binding to an ArrayBuffer containing the\n\t * binary-encoded site manifest\n\t */\n\tASSETS_MANIFEST: ArrayBuffer;\n\n\t/*\n\t * ASSETS_KV_NAMESPACE is a pipeline binding to the KV namespace that the\n\t * assets are in.\n\t */\n\tASSETS_KV_NAMESPACE: KVNamespace;\n\n\tCONFIG: AssetConfig;\n\n\tSENTRY_DSN: string;\n\tSENTRY_ACCESS_CLIENT_ID: string;\n\tSENTRY_ACCESS_CLIENT_SECRET: string;\n\n\tJAEGER: JaegerTracing;\n\n\tENVIRONMENT: Environment;\n\tEXPERIMENT_ANALYTICS: ReadyAnalytics;\n\tANALYTICS: ReadyAnalytics;\n\tCOLO_METADATA: ColoMetadata;\n\tUNSAFE_PERFORMANCE: UnsafePerformanceTimer;\n\tVERSION_METADATA: WorkerVersionMetadata;\n\tACCOUNT_COHORT_QUERIER?: AccountCohortQuerierBinding;\n};\n\nexport type AssetWorkerEntrypointProps = {\n\ttraceContext?: SpanContext | null;\n};\n\ntype GetByETagResult = {\n\treadableStream: ReadableStream;\n\tcontentType: string | undefined;\n\tcacheStatus: \"HIT\" | \"MISS\";\n};\n\ntype ExistsFn = (pathname: string, request?: Request) => Promise<string | null>;\ntype GetByETagFn = (\n\teTag: string,\n\trequest?: Request\n) => Promise<GetByETagResult>;\n\n/**\n * Interface defining the public API methods that both the outer and inner\n * entrypoints implement. The outer entrypoint (AssetWorkerOuter) routes to\n * the inner entrypoint (AssetWorkerInner) via ctx.exports.\n */\ninterface AssetWorkerMethods {\n\tfetch(request: Request): Promise<Response>;\n\tunstable_canFetch(request: Request): Promise<boolean>;\n\tunstable_getByETag(eTag: string, request?: Request): Promise<GetByETagResult>;\n\tunstable_getByPathname(\n\t\tpathname: string,\n\t\trequest?: Request\n\t): Promise<GetByETagResult | null>;\n\tunstable_exists(pathname: string, request?: Request): Promise<string | null>;\n}\n\n/**\n * Context type used for communication between outer and inner entrypoints\n * via ctx.exports. AssetWorkerOuter accesses the inner factory via exports,\n * AssetWorkerInner receives props via ctx.props.\n */\ntype AssetWorkerContext = ExecutionContext & {\n\texports?: {\n\t\tAssetWorkerInner?: (options: {\n\t\t\tprops: AssetWorkerEntrypointProps;\n\t\t\tversion?: { cohort?: string };\n\t\t}) => AssetWorkerMethods;\n\t};\n\tprops?: AssetWorkerEntrypointProps;\n};\n\n// ============================================================\n// SECTION 2: SHARED IMPLEMENTATION FUNCTIONS\n// ============================================================\n\nasync function unstableExistsImpl(\n\tenv: Env,\n\tpathname: string,\n\t_request?: Request\n): Promise<string | null> {\n\tconst analytics = new ExperimentAnalytics(env.EXPERIMENT_ANALYTICS);\n\tconst performance = new PerformanceTimer(env.UNSAFE_PERFORMANCE);\n\tconst jaeger = env.JAEGER ?? mockJaegerBinding();\n\treturn jaeger.enterSpan(\"unstable_exists\", async (span) => {\n\t\tif (env.COLO_METADATA && env.VERSION_METADATA && env.CONFIG) {\n\t\t\tanalytics.setData({\n\t\t\t\taccountId: env.CONFIG.account_id,\n\t\t\t\texperimentName: \"manifest-read-timing\",\n\t\t\t});\n\t\t}\n\n\t\tconst startTimeMs = performance.now();\n\t\ttry {\n\t\t\tconst assetsManifest = new AssetsManifest(env.ASSETS_MANIFEST);\n\t\t\tconst eTag = await assetsManifest.get(pathname);\n\n\t\t\tspan.setTags({\n\t\t\t\tpath: pathname,\n\t\t\t\tfound: eTag !== null,\n\t\t\t\tetag: eTag ?? \"\",\n\t\t\t});\n\n\t\t\treturn eTag;\n\t\t} finally {\n\t\t\tanalytics.setData({\n\t\t\t\tmanifestReadTime: performance.now() - startTimeMs,\n\t\t\t});\n\t\t\tanalytics.write();\n\t\t}\n\t});\n}\n\nasync function unstableGetByETagImpl(\n\tenv: Env,\n\teTag: string,\n\t_request?: Request\n): Promise<GetByETagResult> {\n\tconst performance = new PerformanceTimer(env.UNSAFE_PERFORMANCE);\n\tconst jaeger = env.JAEGER ?? mockJaegerBinding();\n\treturn jaeger.enterSpan(\"unstable_getByETag\", async (span) => {\n\t\tconst startTime = performance.now();\n\t\tconst asset = await getAssetWithMetadataFromKV(\n\t\t\tenv.ASSETS_KV_NAMESPACE,\n\t\t\teTag\n\t\t);\n\t\tconst endTime = performance.now();\n\t\tconst assetFetchTime = endTime - startTime;\n\n\t\tif (!asset || !asset.value) {\n\t\t\tspan.setTags({\n\t\t\t\terror: true,\n\t\t\t});\n\t\t\tspan.addLogs({\n\t\t\t\terror: `Requested asset ${eTag} exists in the asset manifest but not in the KV namespace.`,\n\t\t\t});\n\t\t\tthrow new Error(\n\t\t\t\t`Requested asset ${eTag} exists in the asset manifest but not in the KV namespace.`\n\t\t\t);\n\t\t}\n\n\t\t// KV does not yet provide a way to check if a value was fetched from cache\n\t\t// so we assume that if the fetch time is less than 100ms, it was a cache hit.\n\t\t// This is a reasonable assumption given the data we have and how KV works.\n\t\tconst cacheStatus = assetFetchTime <= 100 ? \"HIT\" : \"MISS\";\n\n\t\tspan.setTags({\n\t\t\tetag: eTag,\n\t\t\tcontentType: asset.metadata?.contentType ?? \"unknown\",\n\t\t\tcacheStatus,\n\t\t});\n\n\t\treturn {\n\t\t\treadableStream: asset.value,\n\t\t\tcontentType: asset.metadata?.contentType,\n\t\t\tcacheStatus,\n\t\t};\n\t});\n}\n\nasync function unstableGetByPathnameImpl(\n\tenv: Env,\n\texists: ExistsFn,\n\tgetByETag: GetByETagFn,\n\tpathname: string,\n\trequest?: Request\n): Promise<GetByETagResult | null> {\n\tconst jaeger = env.JAEGER ?? mockJaegerBinding();\n\treturn jaeger.enterSpan(\"unstable_getByPathname\", async (span) => {\n\t\tconst eTag = await exists(pathname, request);\n\n\t\tspan.setTags({\n\t\t\tpath: pathname,\n\t\t\tfound: eTag !== null,\n\t\t});\n\n\t\tif (!eTag) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn getByETag(eTag, request);\n\t});\n}\n\nexport const COHORT_LOOKUP_TIMEOUT_MS = 5;\n\n/**\n * Resolves the deployment cohort for a customer account via the\n * AccountCohortQuerier RPC binding. Returns null when the binding is\n * unavailable, the RPC fails, times out, or the cohort is undetermined\n * (cold cache). Intentionally fails open — a null cohort means the\n * request runs under default routing.\n */\nexport async function lookupCohort(\n\tenv: Env,\n\taccountId: number | undefined\n): Promise<string | null> {\n\tconst querier = env.ACCOUNT_COHORT_QUERIER;\n\tif (!querier || !accountId) {\n\t\treturn null;\n\t}\n\tconst ac = new AbortController();\n\ttry {\n\t\tconst rpc = querier.lookupAccountCohort(accountId.toString());\n\t\t// Prevent unhandled rejection if timeout wins but RPC later rejects.\n\t\tvoid rpc.catch(() => {});\n\t\tconst timeout = new Promise<never>((_, reject) => {\n\t\t\tconst id = setTimeout(() => {\n\t\t\t\treject(new Error(\"cohort lookup timed out\"));\n\t\t\t}, COHORT_LOOKUP_TIMEOUT_MS);\n\t\t\tac.signal.addEventListener(\"abort\", () => clearTimeout(id));\n\t\t});\n\t\tconst res = await Promise.race([rpc, timeout]);\n\t\tif (!res.ok) {\n\t\t\tconsole.error(\"cohort lookup failed\", res.errors);\n\t\t\treturn null;\n\t\t}\n\t\treturn res.result ?? null;\n\t} catch (e: unknown) {\n\t\tconsole.error(\"cohort lookup failed\", e);\n\t\treturn null;\n\t} finally {\n\t\tac.abort();\n\t}\n}\n\nasync function runFetchRequest(\n\trequest: Request,\n\tenv: Env,\n\tctx: ExecutionContext,\n\texists: ExistsFn,\n\tgetByETag: GetByETagFn,\n\tcohort?: string\n): Promise<Response> {\n\tlet sentry: ReturnType<typeof setupSentry> | undefined;\n\tconst analytics = new Analytics(env.ANALYTICS);\n\tconst performance = new PerformanceTimer(env.UNSAFE_PERFORMANCE);\n\tconst startTimeMs = performance.now();\n\n\ttry {\n\t\t// TODO: Mock this with Miniflare\n\t\tenv.JAEGER ??= mockJaegerBinding();\n\n\t\tsentry = setupSentry(\n\t\t\trequest,\n\t\t\tctx,\n\t\t\tenv.SENTRY_DSN,\n\t\t\tenv.SENTRY_ACCESS_CLIENT_ID,\n\t\t\tenv.SENTRY_ACCESS_CLIENT_SECRET,\n\t\t\tenv.COLO_METADATA,\n\t\t\tenv.VERSION_METADATA,\n\t\t\tenv.CONFIG?.account_id,\n\t\t\tenv.CONFIG?.script_id\n\t\t);\n\n\t\tconst config = normalizeConfiguration(env.CONFIG);\n\t\tsentry?.setContext(\"compatibilityOptions\", {\n\t\t\tcompatibilityDate: config.compatibility_date,\n\t\t\tcompatibilityFlags: config.compatibility_flags,\n\t\t\toriginalCompatibilityFlags: env.CONFIG.compatibility_flags,\n\t\t});\n\t\tconst userAgent = request.headers.get(\"user-agent\") ?? \"UA UNKNOWN\";\n\n\t\tconst url = new URL(request.url);\n\t\tif (env.COLO_METADATA && env.VERSION_METADATA && env.CONFIG) {\n\t\t\tanalytics.setData({\n\t\t\t\taccountId: env.CONFIG.account_id,\n\t\t\t\tscriptId: env.CONFIG.script_id,\n\n\t\t\t\tcoloId: env.COLO_METADATA.coloId,\n\t\t\t\tmetalId: env.COLO_METADATA.metalId,\n\t\t\t\tcoloTier: env.COLO_METADATA.coloTier,\n\n\t\t\t\tcoloRegion: env.COLO_METADATA.coloRegion,\n\t\t\t\tversion: env.VERSION_METADATA.tag,\n\t\t\t\thostname: url.hostname,\n\t\t\t\thtmlHandling: config.html_handling,\n\t\t\t\tnotFoundHandling: config.not_found_handling,\n\t\t\t\tcompatibilityFlags: config.compatibility_flags,\n\t\t\t\tuserAgent: userAgent,\n\t\t\t\tentrypoint: EntrypointType.Inner,\n\t\t\t\tcohort: cohort ?? \"unknown\",\n\t\t\t\trequestKind: getRequestKind(request),\n\t\t\t});\n\t\t}\n\n\t\treturn await env.JAEGER.enterSpan(\"handleRequest\", async (span) => {\n\t\t\tspan.setTags({\n\t\t\t\thostname: url.hostname,\n\t\t\t\teyeballPath: url.pathname,\n\t\t\t\tenv: env.ENVIRONMENT,\n\t\t\t\tversion: env.VERSION_METADATA?.id,\n\t\t\t});\n\n\t\t\tconst response = await handleRequest(\n\t\t\t\trequest,\n\t\t\t\tenv,\n\t\t\t\tconfig,\n\t\t\t\texists,\n\t\t\t\tgetByETag,\n\t\t\t\tanalytics\n\t\t\t);\n\n\t\t\tanalytics.setData({ status: response.status });\n\n\t\t\treturn response;\n\t\t});\n\t} catch (err) {\n\t\treturn handleError(sentry, analytics, err);\n\t} finally {\n\t\tsubmitMetrics(analytics, performance, startTimeMs);\n\t}\n}\n\n// ============================================================\n// SECTION 3: OUTER ENTRYPOINT (AssetWorkerOuter)\n// ============================================================\n\n/*\n * The Asset Worker is currently set up as a `WorkerEntrypoint` class so\n * that it is able to accept RPC calls to any of its public methods. There\n * are currently four such public methods defined on this Worker:\n * `canFetch`, `getByETag`, `getByPathname` and `exists`. While we are\n * stabilizing the implementation details of these methods, we would like\n * to prevent developers from having their Workers call these methods\n * directly. To that end, we are adopting the `unstable_<method_name>`\n * naming convention for all of the aforementioned methods, to indicate that\n * they are still in flux and that they are not an established API contract.\n *\n * AssetWorkerOuter serves as the dispatch layer. It forwards all method\n * calls to AssetWorkerInner via ctx.exports.\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 high for normal\n * traffic. When that has been addressed, re-enable loopback by making this\n * the default export.\n */\nexport class AssetWorkerOuter<TEnv extends Env = Env>\n\textends WorkerEntrypoint<TEnv>\n\timplements AssetWorkerMethods\n{\n\tprivate resolvedCohort: string | null | undefined = undefined;\n\n\t/**\n\t * Resolves and caches the cohort for this request. The cohort is\n\t * constant for the lifetime of the outer entrypoint instance, so\n\t * we only pay the RPC cost once even if multiple methods are called.\n\t */\n\tprivate async getCohort(): Promise<string | null> {\n\t\tif (this.resolvedCohort === undefined) {\n\t\t\t// TODO: Hardcoding temporarily for latency testing.\n\t\t\t// this.resolvedCohort = await lookupCohort(\n\t\t\t// \tthis.env,\n\t\t\t// \tthis.env.CONFIG?.account_id\n\t\t\t// );\n\t\t\tthis.resolvedCohort = \"ent\";\n\t\t}\n\t\treturn this.resolvedCohort;\n\t}\n\n\t/**\n\t * Gets the inner entrypoint from ctx.exports to forward requests to.\n\t * When a cohort is provided, the runtime routes the inner entrypoint\n\t * to the version assigned to that cohort in the current deployment.\n\t */\n\tprivate getInnerEntrypoint(_cohort?: string | null): AssetWorkerMethods {\n\t\tconst loopbackCtx = this.ctx as AssetWorkerContext;\n\t\tconst entrypoint = loopbackCtx.exports?.AssetWorkerInner;\n\t\tif (entrypoint === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t\"AssetWorkerInner not found on ctx.exports. \" +\n\t\t\t\t\t\"Ensure enable_ctx_exports compatibility flag is set and \" +\n\t\t\t\t\t\"AssetWorkerInner is exported from the worker module.\"\n\t\t\t);\n\t\t}\n\t\treturn entrypoint({\n\t\t\tprops: { traceContext: this.env.JAEGER.getSpanContext() },\n\t\t\t// TODO: Hardcoding temporarily for latency testing.\n\t\t\t// ...(cohort ? { version: { cohort } } : {}),\n\t\t});\n\t}\n\n\toverride async fetch(request: Request): Promise<Response> {\n\t\tthis.env.JAEGER ??= mockJaegerBinding();\n\t\tlet sentry: ReturnType<typeof setupSentry> | undefined;\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\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\tentrypoint: EntrypointType.Outer,\n\t\t\t\t\trequestKind: getRequestKind(request),\n\t\t\t\t});\n\t\t\t}\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 cohort = await this.getCohort();\n\t\t\tanalytics.setData({ cohort: cohort ?? \"unknown\" });\n\n\t\t\tconst response = await this.getInnerEntrypoint(cohort).fetch(request);\n\t\t\tanalytics.setData({ status: response.status });\n\t\t\tif (response.status >= 500) {\n\t\t\t\tanalytics.setData({\n\t\t\t\t\terror: \"inner entrypoint error\",\n\t\t\t\t\tservedBy: \"error\",\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn response;\n\t\t} catch (err) {\n\t\t\tanalytics.setData({ status: 500 });\n\t\t\treturn handleError(sentry, analytics, err);\n\t\t} finally {\n\t\t\tsubmitMetrics(analytics, performance, startTimeMs);\n\t\t}\n\t}\n\n\tasync unstable_canFetch(request: Request): Promise<boolean> {\n\t\tthis.env.JAEGER ??= mockJaegerBinding();\n\t\tconst cohort = await this.getCohort();\n\t\treturn this.getInnerEntrypoint(cohort).unstable_canFetch(request);\n\t}\n\n\tasync unstable_getByETag(\n\t\teTag: string,\n\t\trequest?: Request\n\t): Promise<GetByETagResult> {\n\t\tthis.env.JAEGER ??= mockJaegerBinding();\n\t\tconst cohort = await this.getCohort();\n\t\treturn this.getInnerEntrypoint(cohort).unstable_getByETag(eTag, request);\n\t}\n\n\tasync unstable_getByPathname(\n\t\tpathname: string,\n\t\trequest?: Request\n\t): Promise<GetByETagResult | null> {\n\t\tthis.env.JAEGER ??= mockJaegerBinding();\n\t\tconst cohort = await this.getCohort();\n\t\treturn this.getInnerEntrypoint(cohort).unstable_getByPathname(\n\t\t\tpathname,\n\t\t\trequest\n\t\t);\n\t}\n\n\tasync unstable_exists(\n\t\tpathname: string,\n\t\trequest?: Request\n\t): Promise<string | null> {\n\t\tthis.env.JAEGER ??= mockJaegerBinding();\n\t\tconst cohort = await this.getCohort();\n\t\treturn this.getInnerEntrypoint(cohort).unstable_exists(pathname, request);\n\t}\n}\n\n// ============================================================\n// SECTION 4: INNER ENTRYPOINT (AssetWorkerInner)\n// ============================================================\n\n/*\n * AssetWorkerInner contains the actual implementation logic for all asset\n * worker methods. AssetWorkerOuter can instantiate it via ctx.exports to\n * enable cohort-based loopback. For local development, tools such as the Vite\n * plugin can subclass AssetWorkerInner directly to override methods like\n * unstable_exists and unstable_getByETag with dev-server-backed implementations.\n */\nexport class AssetWorkerInner<TEnv extends Env = Env>\n\textends WorkerEntrypoint<TEnv>\n\timplements AssetWorkerMethods\n{\n\toverride async fetch(request: Request): Promise<Response> {\n\t\t// TODO: Mock this with Miniflare\n\t\tthis.env.JAEGER ??= mockJaegerBinding();\n\t\tconst loopbackCtx = this.ctx as AssetWorkerContext;\n\t\tconst traceContext = loopbackCtx.props?.traceContext ?? null;\n\t\tconst cohort = this.ctx.version?.cohort;\n\t\tconst runRequest = () =>\n\t\t\trunFetchRequest(\n\t\t\t\trequest,\n\t\t\t\tthis.env,\n\t\t\t\tthis.ctx,\n\t\t\t\tthis.unstable_exists.bind(this),\n\t\t\t\tthis.unstable_getByETag.bind(this),\n\t\t\t\tcohort\n\t\t\t);\n\n\t\tconst response = traceContext\n\t\t\t? await this.env.JAEGER.runWithSpanContext(traceContext, runRequest)\n\t\t\t: await runRequest();\n\n\t\tif (response instanceof Response) {\n\t\t\treturn response;\n\t\t}\n\n\t\tthrow new Error(\"AssetWorkerInner fetch returned non-Response value.\");\n\t}\n\n\tasync unstable_canFetch(request: Request): Promise<boolean> {\n\t\t// TODO: Mock this with Miniflare\n\t\tthis.env.JAEGER ??= mockJaegerBinding();\n\n\t\treturn canFetch(\n\t\t\trequest,\n\t\t\tthis.env,\n\t\t\tnormalizeConfiguration(this.env.CONFIG),\n\t\t\tthis.unstable_exists.bind(this)\n\t\t);\n\t}\n\n\tasync unstable_getByETag(\n\t\teTag: string,\n\t\trequest?: Request\n\t): Promise<GetByETagResult> {\n\t\treturn unstableGetByETagImpl(this.env, eTag, request);\n\t}\n\n\tasync unstable_getByPathname(\n\t\tpathname: string,\n\t\trequest?: Request\n\t): Promise<GetByETagResult | null> {\n\t\treturn unstableGetByPathnameImpl(\n\t\t\tthis.env,\n\t\t\tthis.unstable_exists.bind(this),\n\t\t\tthis.unstable_getByETag.bind(this),\n\t\t\tpathname,\n\t\t\trequest\n\t\t);\n\t}\n\n\tasync unstable_exists(\n\t\tpathname: string,\n\t\trequest?: Request\n\t): Promise<string | null> {\n\t\treturn unstableExistsImpl(this.env, pathname, request);\n\t}\n}\n\nexport default AssetWorkerInner;\n","export const UNKNOWN_HOST = \"http://localhost\";\n\n// pathnames\nexport const INIT_PATH = \"/__vite_plugin_cloudflare_init__\";\nexport const GET_EXPORT_TYPES_PATH =\n\t\"/__vite_plugin_cloudflare_get_export_types__\";\n\n// headers\nexport const WORKER_ENTRY_PATH_HEADER = \"__VITE_WORKER_ENTRY_PATH__\";\nexport const IS_ENTRY_WORKER_HEADER = \"__VITE_IS_ENTRY_WORKER__\";\nexport const ENVIRONMENT_NAME_HEADER = \"__VITE_ENVIRONMENT_NAME__\";\nexport const IS_PARENT_ENVIRONMENT_HEADER = \"__VITE_IS_PARENT_ENVIRONMENT__\";\n\n// virtual modules\nexport const virtualPrefix = \"virtual:cloudflare/\";\nexport const VIRTUAL_WORKER_ENTRY = `${virtualPrefix}worker-entry`;\nexport const VIRTUAL_EXPORT_TYPES = `${virtualPrefix}export-types`;\n","import { AssetWorkerInner } from \"@cloudflare/workers-shared/asset-worker\";\nimport { UNKNOWN_HOST } from \"../../shared\";\nimport type { Env as _Env } from \"@cloudflare/workers-shared/asset-worker\";\nimport type { ResolvedConfig } from \"vite\";\n\ninterface Env extends _Env {\n\t__VITE_HTML_EXISTS__: Fetcher;\n\t__VITE_FETCH_HTML__: Fetcher;\n\t__VITE_HEADERS__: string;\n}\n\nexport default class CustomAssetWorker extends AssetWorkerInner<Env> {\n\toverride async fetch(request: Request) {\n\t\tconst response = await super.fetch(request);\n\t\tconst modifiedResponse = new Response(response.body, response);\n\t\tmodifiedResponse.headers.delete(\"ETag\");\n\t\tmodifiedResponse.headers.delete(\"Cache-Control\");\n\t\t// Add headers set via `server.headers` in the Vite config\n\t\tconst viteHeaders = JSON.parse(\n\t\t\tthis.env.__VITE_HEADERS__\n\t\t) as ResolvedConfig[\"server\"][\"headers\"];\n\n\t\tfor (const [key, value] of Object.entries(viteHeaders)) {\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const item of value) {\n\t\t\t\t\tmodifiedResponse.headers.append(key, item);\n\t\t\t\t}\n\t\t\t} else if (value !== undefined) {\n\t\t\t\tmodifiedResponse.headers.set(key, String(value));\n\t\t\t}\n\t\t}\n\n\t\treturn modifiedResponse;\n\t}\n\toverride async unstable_getByETag(eTag: string) {\n\t\tconst url = new URL(eTag, UNKNOWN_HOST);\n\t\tconst response = await this.env.__VITE_FETCH_HTML__.fetch(url);\n\n\t\tif (!response.body) {\n\t\t\tthrow new Error(`Unexpected error. No HTML found for \"${eTag}\".`);\n\t\t}\n\n\t\treturn {\n\t\t\treadableStream: response.body,\n\t\t\tcontentType: \"text/html\",\n\t\t\tcacheStatus: \"MISS\",\n\t\t} as const;\n\t}\n\toverride async unstable_exists(pathname: string) {\n\t\t// We need this regex to avoid getting `//` as a pathname, which results in an invalid URL. Should this be fixed upstream?\n\t\tconst url = new URL(pathname.replace(/^\\/{2,}/, \"/\"), UNKNOWN_HOST);\n\t\tconst response = await this.env.__VITE_HTML_EXISTS__.fetch(url);\n\n\t\treturn response.json() as Promise<string | null>;\n\t}\n}\n"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],"mappings":";;;AAEA,IAAa,mBAAb,MAA8B;CAC7B,AAAQ;CAER,YAAY,kBAA2C;AACtD,OAAK,mBAAmB;;CAGzB,MAAM;AACL,MAAI,KAAK,iBACR,QAAO,KAAK,iBAAiB,aAAa,KAAK,iBAAiB,KAAK;AAEtE,SAAO,KAAK,KAAK;;;;;;ACZnB,MAAM,iBAAiB,OAAO,UAAU;;;;;;;;AASxC,SAAS,QAAQ,KAAK;AACpB,SAAQ,eAAe,KAAK,IAAI,EAAhC;EACE,KAAK;EACL,KAAK;EACL,KAAK,wBACH,QAAO;EACT,QACE,QAAO,aAAa,KAAK,MAAM;;;;;;;;;;AAUrC,SAAS,UAAU,KAAK,WAAW;AACjC,QAAO,eAAe,KAAK,IAAI,KAAK,WAAW,UAAU;;;;;;;;;AAU3D,SAASA,eAAa,KAAK;AACzB,QAAO,UAAU,KAAK,aAAa;;;;;;;;;AAgCrC,SAAS,SAAS,KAAK;AACrB,QAAO,UAAU,KAAK,SAAS;;;;;;;;;AAUjC,SAAS,sBAAsB,KAAK;AAClC,QACE,OAAO,QAAQ,YACf,QAAQ,QACR,gCAAgC,OAChC,gCAAgC;;;;;;;;;AAWpC,SAAS,YAAY,KAAK;AACxB,QAAO,QAAQ,QAAQ,sBAAsB,IAAI,IAAK,OAAO,QAAQ,YAAY,OAAO,QAAQ;;;;;;;;;AAUlG,SAAS,cAAc,KAAK;AAC1B,QAAO,UAAU,KAAK,SAAS;;;;;;;;;AAUjC,SAAS,QAAQ,KAAK;AACpB,QAAO,OAAO,UAAU,eAAe,aAAa,KAAK,MAAM;;;;;;;;;AAUjE,SAAS,UAAU,KAAK;AACtB,QAAO,OAAO,YAAY,eAAe,a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