UNPKG

convex

Version:

Client for the Convex Cloud

1,380 lines (1,364 loc) 5.72 MB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __reflectGet = Reflect.get; var __typeError = (msg) => { throw TypeError(msg); }; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod2) => function __require() { return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports; }; var __export = (target3, all) => { for (var name in all) __defProp(target3, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod2, isNodeMode, target3) => (target3 = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target3, "default", { value: mod2, enumerable: true }) : target3, mod2 )); var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj); var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); var __privateWrapper = (obj, member, setter, getter) => ({ set _(value) { __privateSet(obj, member, value, setter); }, get _() { return __privateGet(obj, member, getter); } }); var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj); // ../common/temp/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js function assembleStyles() { const codes = /* @__PURE__ */ new Map(); for (const [groupName, group] of Object.entries(styles)) { for (const [styleName, style] of Object.entries(group)) { styles[styleName] = { open: `\x1B[${style[0]}m`, close: `\x1B[${style[1]}m` }; group[styleName] = styles[styleName]; codes.set(style[0], style[1]); } Object.defineProperty(styles, groupName, { value: group, enumerable: false }); } Object.defineProperty(styles, "codes", { value: codes, enumerable: false }); styles.color.close = "\x1B[39m"; styles.bgColor.close = "\x1B[49m"; styles.color.ansi = wrapAnsi16(); styles.color.ansi256 = wrapAnsi256(); styles.color.ansi16m = wrapAnsi16m(); styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); Object.defineProperties(styles, { rgbToAnsi256: { value(red2, green2, blue2) { if (red2 === green2 && green2 === blue2) { if (red2 < 8) { return 16; } if (red2 > 248) { return 231; } return Math.round((red2 - 8) / 247 * 24) + 232; } return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue2 / 255 * 5); }, enumerable: false }, hexToRgb: { value(hex) { const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); if (!matches) { return [0, 0, 0]; } let [colorString] = matches; if (colorString.length === 3) { colorString = [...colorString].map((character) => character + character).join(""); } const integer2 = Number.parseInt(colorString, 16); return [ /* eslint-disable no-bitwise */ integer2 >> 16 & 255, integer2 >> 8 & 255, integer2 & 255 /* eslint-enable no-bitwise */ ]; }, enumerable: false }, hexToAnsi256: { value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), enumerable: false }, ansi256ToAnsi: { value(code2) { if (code2 < 8) { return 30 + code2; } if (code2 < 16) { return 90 + (code2 - 8); } let red2; let green2; let blue2; if (code2 >= 232) { red2 = ((code2 - 232) * 10 + 8) / 255; green2 = red2; blue2 = red2; } else { code2 -= 16; const remainder = code2 % 36; red2 = Math.floor(code2 / 36) / 5; green2 = Math.floor(remainder / 6) / 5; blue2 = remainder % 6 / 5; } const value = Math.max(red2, green2, blue2) * 2; if (value === 0) { return 30; } let result = 30 + (Math.round(blue2) << 2 | Math.round(green2) << 1 | Math.round(red2)); if (value === 2) { result += 60; } return result; }, enumerable: false }, rgbToAnsi: { value: (red2, green2, blue2) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red2, green2, blue2)), enumerable: false }, hexToAnsi: { value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), enumerable: false } }); return styles; } var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default; var init_ansi_styles = __esm({ "../common/temp/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js"() { ANSI_BACKGROUND_OFFSET = 10; wrapAnsi16 = (offset = 0) => (code2) => `\x1B[${code2 + offset}m`; wrapAnsi256 = (offset = 0) => (code2) => `\x1B[${38 + offset};5;${code2}m`; wrapAnsi16m = (offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`; styles = { modifier: { reset: [0, 0], // 21 isn't widely supported and 22 does the same thing bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], // Bright color blackBright: [90, 39], gray: [90, 39], // Alias of `blackBright` grey: [90, 39], // Alias of `blackBright` redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], // Bright color bgBlackBright: [100, 49], bgGray: [100, 49], // Alias of `bgBlackBright` bgGrey: [100, 49], // Alias of `bgBlackBright` bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; modifierNames = Object.keys(styles.modifier); foregroundColorNames = Object.keys(styles.color); backgroundColorNames = Object.keys(styles.bgColor); colorNames = [...foregroundColorNames, ...backgroundColorNames]; ansiStyles = assembleStyles(); ansi_styles_default = ansiStyles; } }); // ../common/temp/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) { const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; const position = argv.indexOf(prefix + flag); const terminatorPosition = argv.indexOf("--"); return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); } function envForceColor() { if ("FORCE_COLOR" in env) { if (env.FORCE_COLOR === "true") { return 1; } if (env.FORCE_COLOR === "false") { return 0; } return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); } } function translateLevel(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { const noFlagForceColor = envForceColor(); if (noFlagForceColor !== void 0) { flagForceColor = noFlagForceColor; } const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; if (forceColor === 0) { return 0; } if (sniffFlags) { if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { return 3; } if (hasFlag("color=256")) { return 2; } } if ("TF_BUILD" in env && "AGENT_NAME" in env) { return 1; } if (haveStream && !streamIsTTY && forceColor === void 0) { return 0; } const min = forceColor || 0; if (env.TERM === "dumb") { return min; } if (import_node_process.default.platform === "win32") { const osRelease = import_node_os.default.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ("CI" in env) { if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) { return 3; } if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { return 1; } return min; } if ("TEAMCITY_VERSION" in env) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } if (env.COLORTERM === "truecolor") { return 3; } if (env.TERM === "xterm-kitty") { return 3; } if (env.TERM === "xterm-ghostty") { return 3; } if (env.TERM === "wezterm") { return 3; } if ("TERM_PROGRAM" in env) { const version4 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env.TERM_PROGRAM) { case "iTerm.app": { return version4 >= 3 ? 3 : 2; } case "Apple_Terminal": { return 2; } } } if (/-256(color)?$/i.test(env.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { return 1; } if ("COLORTERM" in env) { return 1; } return min; } function createSupportsColor(stream, options = {}) { const level = _supportsColor(stream, { streamIsTTY: stream && stream.isTTY, ...options }); return translateLevel(level); } var import_node_process, import_node_os, import_node_tty, env, flagForceColor, supportsColor, supports_color_default; var init_supports_color = __esm({ "../common/temp/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js"() { import_node_process = __toESM(require("process"), 1); import_node_os = __toESM(require("os"), 1); import_node_tty = __toESM(require("tty"), 1); ({ env } = import_node_process.default); if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { flagForceColor = 0; } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { flagForceColor = 1; } supportsColor = { stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }), stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) }) }; supports_color_default = supportsColor; } }); // ../common/temp/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js function stringReplaceAll(string3, substring, replacer) { let index = string3.indexOf(substring); if (index === -1) { return string3; } const substringLength = substring.length; let endIndex = 0; let returnValue = ""; do { returnValue += string3.slice(endIndex, index) + substring + replacer; endIndex = index + substringLength; index = string3.indexOf(substring, endIndex); } while (index !== -1); returnValue += string3.slice(endIndex); return returnValue; } function stringEncaseCRLFWithFirstIndex(string3, prefix, postfix, index) { let endIndex = 0; let returnValue = ""; do { const gotCR = string3[index - 1] === "\r"; returnValue += string3.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix; endIndex = index + 1; index = string3.indexOf("\n", endIndex); } while (index !== -1); returnValue += string3.slice(endIndex); return returnValue; } var init_utilities = __esm({ "../common/temp/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js"() { } }); // ../common/temp/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js function createChalk(options) { return chalkFactory(options); } var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default; var init_source = __esm({ "../common/temp/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js"() { init_ansi_styles(); init_supports_color(); init_utilities(); ({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default); GENERATOR = Symbol("GENERATOR"); STYLER = Symbol("STYLER"); IS_EMPTY = Symbol("IS_EMPTY"); levelMapping = [ "ansi", "ansi", "ansi256", "ansi16m" ]; styles2 = /* @__PURE__ */ Object.create(null); applyOptions = (object3, options = {}) => { if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { throw new Error("The `level` option should be an integer from 0 to 3"); } const colorLevel = stdoutColor ? stdoutColor.level : 0; object3.level = options.level === void 0 ? colorLevel : options.level; }; chalkFactory = (options) => { const chalk2 = (...strings) => strings.join(" "); applyOptions(chalk2, options); Object.setPrototypeOf(chalk2, createChalk.prototype); return chalk2; }; Object.setPrototypeOf(createChalk.prototype, Function.prototype); for (const [styleName, style] of Object.entries(ansi_styles_default)) { styles2[styleName] = { get() { const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); Object.defineProperty(this, styleName, { value: builder }); return builder; } }; } styles2.visible = { get() { const builder = createBuilder(this, this[STYLER], true); Object.defineProperty(this, "visible", { value: builder }); return builder; } }; getModelAnsi = (model, level, type, ...arguments_) => { if (model === "rgb") { if (level === "ansi16m") { return ansi_styles_default[type].ansi16m(...arguments_); } if (level === "ansi256") { return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)); } return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)); } if (model === "hex") { return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_)); } return ansi_styles_default[type][model](...arguments_); }; usedModels = ["rgb", "hex", "ansi256"]; for (const model of usedModels) { styles2[model] = { get() { const { level } = this; return function(...arguments_) { const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]); return createBuilder(this, styler, this[IS_EMPTY]); }; } }; const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); styles2[bgModel] = { get() { const { level } = this; return function(...arguments_) { const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]); return createBuilder(this, styler, this[IS_EMPTY]); }; } }; } proto = Object.defineProperties(() => { }, { ...styles2, level: { enumerable: true, get() { return this[GENERATOR].level; }, set(level) { this[GENERATOR].level = level; } } }); createStyler = (open3, close3, parent) => { let openAll; let closeAll; if (parent === void 0) { openAll = open3; closeAll = close3; } else { openAll = parent.openAll + open3; closeAll = close3 + parent.closeAll; } return { open: open3, close: close3, openAll, closeAll, parent }; }; createBuilder = (self2, _styler, _isEmpty) => { const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); Object.setPrototypeOf(builder, proto); builder[GENERATOR] = self2; builder[STYLER] = _styler; builder[IS_EMPTY] = _isEmpty; return builder; }; applyStyle = (self2, string3) => { if (self2.level <= 0 || !string3) { return self2[IS_EMPTY] ? "" : string3; } let styler = self2[STYLER]; if (styler === void 0) { return string3; } const { openAll, closeAll } = styler; if (string3.includes("\x1B")) { while (styler !== void 0) { string3 = stringReplaceAll(string3, styler.close, styler.open); styler = styler.parent; } } const lfIndex = string3.indexOf("\n"); if (lfIndex !== -1) { string3 = stringEncaseCRLFWithFirstIndex(string3, closeAll, openAll, lfIndex); } return openAll + string3 + closeAll; }; Object.defineProperties(createChalk.prototype, styles2); chalk = createChalk(); chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); source_default = chalk; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/is.js var require_is = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/is.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var objectToString = Object.prototype.toString; function isError(wat) { switch (objectToString.call(wat)) { case "[object Error]": case "[object Exception]": case "[object DOMException]": return true; default: return isInstanceOf(wat, Error); } } function isBuiltin(wat, className) { return objectToString.call(wat) === `[object ${className}]`; } function isErrorEvent(wat) { return isBuiltin(wat, "ErrorEvent"); } function isDOMError(wat) { return isBuiltin(wat, "DOMError"); } function isDOMException(wat) { return isBuiltin(wat, "DOMException"); } function isString(wat) { return isBuiltin(wat, "String"); } function isParameterizedString(wat) { return typeof wat === "object" && wat !== null && "__sentry_template_string__" in wat && "__sentry_template_values__" in wat; } function isPrimitive(wat) { return wat === null || isParameterizedString(wat) || typeof wat !== "object" && typeof wat !== "function"; } function isPlainObject4(wat) { return isBuiltin(wat, "Object"); } function isEvent(wat) { return typeof Event !== "undefined" && isInstanceOf(wat, Event); } function isElement(wat) { return typeof Element !== "undefined" && isInstanceOf(wat, Element); } function isRegExp(wat) { return isBuiltin(wat, "RegExp"); } function isThenable(wat) { return Boolean(wat && wat.then && typeof wat.then === "function"); } function isSyntheticEvent(wat) { return isPlainObject4(wat) && "nativeEvent" in wat && "preventDefault" in wat && "stopPropagation" in wat; } function isNaN2(wat) { return typeof wat === "number" && wat !== wat; } function isInstanceOf(wat, base) { try { return wat instanceof base; } catch (_e) { return false; } } function isVueViewModel(wat) { return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue)); } exports2.isDOMError = isDOMError; exports2.isDOMException = isDOMException; exports2.isElement = isElement; exports2.isError = isError; exports2.isErrorEvent = isErrorEvent; exports2.isEvent = isEvent; exports2.isInstanceOf = isInstanceOf; exports2.isNaN = isNaN2; exports2.isParameterizedString = isParameterizedString; exports2.isPlainObject = isPlainObject4; exports2.isPrimitive = isPrimitive; exports2.isRegExp = isRegExp; exports2.isString = isString; exports2.isSyntheticEvent = isSyntheticEvent; exports2.isThenable = isThenable; exports2.isVueViewModel = isVueViewModel; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/string.js var require_string = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/string.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var is = require_is(); function truncate(str, max = 0) { if (typeof str !== "string" || max === 0) { return str; } return str.length <= max ? str : `${str.slice(0, max)}...`; } function snipLine(line, colno) { let newLine = line; const lineLength = newLine.length; if (lineLength <= 150) { return newLine; } if (colno > lineLength) { colno = lineLength; } let start = Math.max(colno - 60, 0); if (start < 5) { start = 0; } let end = Math.min(start + 140, lineLength); if (end > lineLength - 5) { end = lineLength; } if (end === lineLength) { start = Math.max(end - 140, 0); } newLine = newLine.slice(start, end); if (start > 0) { newLine = `'{snip} ${newLine}`; } if (end < lineLength) { newLine += " {snip}"; } return newLine; } function safeJoin(input, delimiter) { if (!Array.isArray(input)) { return ""; } const output = []; for (let i = 0; i < input.length; i++) { const value = input[i]; try { if (is.isVueViewModel(value)) { output.push("[VueViewModel]"); } else { output.push(String(value)); } } catch (e) { output.push("[value cannot be serialized]"); } } return output.join(delimiter); } function isMatchingPattern(value, pattern, requireExactStringMatch = false) { if (!is.isString(value)) { return false; } if (is.isRegExp(pattern)) { return pattern.test(value); } if (is.isString(pattern)) { return requireExactStringMatch ? value === pattern : value.includes(pattern); } return false; } function stringMatchesSomePattern(testString, patterns = [], requireExactStringMatch = false) { return patterns.some((pattern) => isMatchingPattern(testString, pattern, requireExactStringMatch)); } exports2.isMatchingPattern = isMatchingPattern; exports2.safeJoin = safeJoin; exports2.snipLine = snipLine; exports2.stringMatchesSomePattern = stringMatchesSomePattern; exports2.truncate = truncate; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/aggregate-errors.js var require_aggregate_errors = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/aggregate-errors.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var is = require_is(); var string3 = require_string(); function applyAggregateErrorsToEvent(exceptionFromErrorImplementation, parser, maxValueLimit = 250, key, limit, event, hint) { if (!event.exception || !event.exception.values || !hint || !is.isInstanceOf(hint.originalException, Error)) { return; } const originalException = event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : void 0; if (originalException) { event.exception.values = truncateAggregateExceptions( aggregateExceptionsFromError( exceptionFromErrorImplementation, parser, limit, hint.originalException, key, event.exception.values, originalException, 0 ), maxValueLimit ); } } function aggregateExceptionsFromError(exceptionFromErrorImplementation, parser, limit, error3, key, prevExceptions, exception, exceptionId) { if (prevExceptions.length >= limit + 1) { return prevExceptions; } let newExceptions = [...prevExceptions]; if (is.isInstanceOf(error3[key], Error)) { applyExceptionGroupFieldsForParentException(exception, exceptionId); const newException = exceptionFromErrorImplementation(parser, error3[key]); const newExceptionId = newExceptions.length; applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId); newExceptions = aggregateExceptionsFromError( exceptionFromErrorImplementation, parser, limit, error3[key], key, [newException, ...newExceptions], newException, newExceptionId ); } if (Array.isArray(error3.errors)) { error3.errors.forEach((childError, i) => { if (is.isInstanceOf(childError, Error)) { applyExceptionGroupFieldsForParentException(exception, exceptionId); const newException = exceptionFromErrorImplementation(parser, childError); const newExceptionId = newExceptions.length; applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId); newExceptions = aggregateExceptionsFromError( exceptionFromErrorImplementation, parser, limit, childError, key, [newException, ...newExceptions], newException, newExceptionId ); } }); } return newExceptions; } function applyExceptionGroupFieldsForParentException(exception, exceptionId) { exception.mechanism = exception.mechanism || { type: "generic", handled: true }; exception.mechanism = { ...exception.mechanism, ...exception.type === "AggregateError" && { is_exception_group: true }, exception_id: exceptionId }; } function applyExceptionGroupFieldsForChildException(exception, source, exceptionId, parentId) { exception.mechanism = exception.mechanism || { type: "generic", handled: true }; exception.mechanism = { ...exception.mechanism, type: "chained", source, exception_id: exceptionId, parent_id: parentId }; } function truncateAggregateExceptions(exceptions, maxValueLength) { return exceptions.map((exception) => { if (exception.value) { exception.value = string3.truncate(exception.value, maxValueLength); } return exception; }); } exports2.applyAggregateErrorsToEvent = applyAggregateErrorsToEvent; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/worldwide.js var require_worldwide = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/worldwide.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); function isGlobalObj(obj) { return obj && obj.Math == Math ? obj : void 0; } var GLOBAL_OBJ = typeof globalThis == "object" && isGlobalObj(globalThis) || // eslint-disable-next-line no-restricted-globals typeof window == "object" && isGlobalObj(window) || typeof self == "object" && isGlobalObj(self) || typeof global == "object" && isGlobalObj(global) || /* @__PURE__ */ (function() { return this; })() || {}; function getGlobalObject() { return GLOBAL_OBJ; } function getGlobalSingleton(name, creator, obj) { const gbl = obj || GLOBAL_OBJ; const __SENTRY__ = gbl.__SENTRY__ = gbl.__SENTRY__ || {}; const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator()); return singleton; } exports2.GLOBAL_OBJ = GLOBAL_OBJ; exports2.getGlobalObject = getGlobalObject; exports2.getGlobalSingleton = getGlobalSingleton; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/browser.js var require_browser = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/browser.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var is = require_is(); var worldwide = require_worldwide(); var WINDOW = worldwide.getGlobalObject(); var DEFAULT_MAX_STRING_LENGTH = 80; function htmlTreeAsString(elem, options = {}) { if (!elem) { return "<unknown>"; } try { let currentElem = elem; const MAX_TRAVERSE_HEIGHT = 5; const out = []; let height2 = 0; let len = 0; const separator = " > "; const sepLength = separator.length; let nextStr; const keyAttrs = Array.isArray(options) ? options : options.keyAttrs; const maxStringLength = !Array.isArray(options) && options.maxStringLength || DEFAULT_MAX_STRING_LENGTH; while (currentElem && height2++ < MAX_TRAVERSE_HEIGHT) { nextStr = _htmlElementAsString(currentElem, keyAttrs); if (nextStr === "html" || height2 > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength) { break; } out.push(nextStr); len += nextStr.length; currentElem = currentElem.parentNode; } return out.reverse().join(separator); } catch (_oO) { return "<unknown>"; } } function _htmlElementAsString(el, keyAttrs) { const elem = el; const out = []; let className; let classes; let key; let attr; let i; if (!elem || !elem.tagName) { return ""; } if (WINDOW.HTMLElement) { if (elem instanceof HTMLElement && elem.dataset && elem.dataset["sentryComponent"]) { return elem.dataset["sentryComponent"]; } } out.push(elem.tagName.toLowerCase()); const keyAttrPairs = keyAttrs && keyAttrs.length ? keyAttrs.filter((keyAttr) => elem.getAttribute(keyAttr)).map((keyAttr) => [keyAttr, elem.getAttribute(keyAttr)]) : null; if (keyAttrPairs && keyAttrPairs.length) { keyAttrPairs.forEach((keyAttrPair) => { out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`); }); } else { if (elem.id) { out.push(`#${elem.id}`); } className = elem.className; if (className && is.isString(className)) { classes = className.split(/\s+/); for (i = 0; i < classes.length; i++) { out.push(`.${classes[i]}`); } } } const allowedAttrs = ["aria-label", "type", "name", "title", "alt"]; for (i = 0; i < allowedAttrs.length; i++) { key = allowedAttrs[i]; attr = elem.getAttribute(key); if (attr) { out.push(`[${key}="${attr}"]`); } } return out.join(""); } function getLocationHref() { try { return WINDOW.document.location.href; } catch (oO) { return ""; } } function getDomElement(selector) { if (WINDOW.document && WINDOW.document.querySelector) { return WINDOW.document.querySelector(selector); } return null; } function getComponentName(elem) { if (!WINDOW.HTMLElement) { return null; } let currentElem = elem; const MAX_TRAVERSE_HEIGHT = 5; for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) { if (!currentElem) { return null; } if (currentElem instanceof HTMLElement && currentElem.dataset["sentryComponent"]) { return currentElem.dataset["sentryComponent"]; } currentElem = currentElem.parentNode; } return null; } exports2.getComponentName = getComponentName; exports2.getDomElement = getDomElement; exports2.getLocationHref = getLocationHref; exports2.htmlTreeAsString = htmlTreeAsString; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/debug-build.js var require_debug_build = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/debug-build.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; exports2.DEBUG_BUILD = DEBUG_BUILD; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/logger.js var require_logger = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/logger.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var debugBuild = require_debug_build(); var worldwide = require_worldwide(); var PREFIX = "Sentry Logger "; var CONSOLE_LEVELS = [ "debug", "info", "warn", "error", "log", "assert", "trace" ]; var originalConsoleMethods = {}; function consoleSandbox(callback) { if (!("console" in worldwide.GLOBAL_OBJ)) { return callback(); } const console2 = worldwide.GLOBAL_OBJ.console; const wrappedFuncs = {}; const wrappedLevels = Object.keys(originalConsoleMethods); wrappedLevels.forEach((level) => { const originalConsoleMethod = originalConsoleMethods[level]; wrappedFuncs[level] = console2[level]; console2[level] = originalConsoleMethod; }); try { return callback(); } finally { wrappedLevels.forEach((level) => { console2[level] = wrappedFuncs[level]; }); } } function makeLogger() { let enabled = false; const logger2 = { enable: () => { enabled = true; }, disable: () => { enabled = false; }, isEnabled: () => enabled }; if (debugBuild.DEBUG_BUILD) { CONSOLE_LEVELS.forEach((name) => { logger2[name] = (...args) => { if (enabled) { consoleSandbox(() => { worldwide.GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args); }); } }; }); } else { CONSOLE_LEVELS.forEach((name) => { logger2[name] = () => void 0; }); } return logger2; } var logger = makeLogger(); exports2.CONSOLE_LEVELS = CONSOLE_LEVELS; exports2.consoleSandbox = consoleSandbox; exports2.logger = logger; exports2.originalConsoleMethods = originalConsoleMethods; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/dsn.js var require_dsn = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/dsn.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var debugBuild = require_debug_build(); var logger = require_logger(); var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; function isValidProtocol(protocol) { return protocol === "http" || protocol === "https"; } function dsnToString(dsn, withPassword = false) { const { host, path: path39, pass, port, projectId, protocol, publicKey } = dsn; return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path39 ? `${path39}/` : path39}${projectId}`; } function dsnFromString(str) { const match = DSN_REGEX.exec(str); if (!match) { logger.consoleSandbox(() => { console.error(`Invalid Sentry Dsn: ${str}`); }); return void 0; } const [protocol, publicKey, pass = "", host, port = "", lastPath] = match.slice(1); let path39 = ""; let projectId = lastPath; const split = projectId.split("/"); if (split.length > 1) { path39 = split.slice(0, -1).join("/"); projectId = split.pop(); } if (projectId) { const projectMatch = projectId.match(/^\d+/); if (projectMatch) { projectId = projectMatch[0]; } } return dsnFromComponents({ host, pass, path: path39, projectId, port, protocol, publicKey }); } function dsnFromComponents(components) { return { protocol: components.protocol, publicKey: components.publicKey || "", pass: components.pass || "", host: components.host, port: components.port || "", path: components.path || "", projectId: components.projectId }; } function validateDsn(dsn) { if (!debugBuild.DEBUG_BUILD) { return true; } const { port, projectId, protocol } = dsn; const requiredComponents = ["protocol", "publicKey", "host", "projectId"]; const hasMissingRequiredComponent = requiredComponents.find((component) => { if (!dsn[component]) { logger.logger.error(`Invalid Sentry Dsn: ${component} missing`); return true; } return false; }); if (hasMissingRequiredComponent) { return false; } if (!projectId.match(/^\d+$/)) { logger.logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); return false; } if (!isValidProtocol(protocol)) { logger.logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); return false; } if (port && isNaN(parseInt(port, 10))) { logger.logger.error(`Invalid Sentry Dsn: Invalid port ${port}`); return false; } return true; } function makeDsn(from) { const components = typeof from === "string" ? dsnFromString(from) : dsnFromComponents(from); if (!components || !validateDsn(components)) { return void 0; } return components; } exports2.dsnFromString = dsnFromString; exports2.dsnToString = dsnToString; exports2.makeDsn = makeDsn; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/error.js var require_error = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/error.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var SentryError = class extends Error { /** Display name of this error instance. */ constructor(message, logLevel = "warn") { super(message); this.message = message; this.name = new.target.prototype.constructor.name; Object.setPrototypeOf(this, new.target.prototype); this.logLevel = logLevel; } }; exports2.SentryError = SentryError; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/object.js var require_object = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/object.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); var browser = require_browser(); var debugBuild = require_debug_build(); var is = require_is(); var logger = require_logger(); var string3 = require_string(); function fill(source, name, replacementFactory) { if (!(name in source)) { return; } const original = source[name]; const wrapped = replacementFactory(original); if (typeof wrapped === "function") { markFunctionWrapped(wrapped, original); } source[name] = wrapped; } function addNonEnumerableProperty(obj, name, value) { try { Object.defineProperty(obj, name, { // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it value, writable: true, configurable: true }); } catch (o_O) { debugBuild.DEBUG_BUILD && logger.logger.log(`Failed to add non-enumerable property "${name}" to object`, obj); } } function markFunctionWrapped(wrapped, original) { try { const proto2 = original.prototype || {}; wrapped.prototype = original.prototype = proto2; addNonEnumerableProperty(wrapped, "__sentry_original__", original); } catch (o_O) { } } function getOriginalFunction(func) { return func.__sentry_original__; } function urlEncode(object3) { return Object.keys(object3).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(object3[key])}`).join("&"); } function convertToPlainObject(value) { if (is.isError(value)) { return { message: value.message, name: value.name, stack: value.stack, ...getOwnProperties(value) }; } else if (is.isEvent(value)) { const newObj = { type: value.type, target: serializeEventTarget(value.target), currentTarget: serializeEventTarget(value.currentTarget), ...getOwnProperties(value) }; if (typeof CustomEvent !== "undefined" && is.isInstanceOf(value, CustomEvent)) { newObj.detail = value.detail; } return newObj; } else { return value; } } function serializeEventTarget(target3) { try { return is.isElement(target3) ? browser.htmlTreeAsString(target3) : Object.prototype.toString.call(target3); } catch (_oO) { return "<unknown>"; } } function getOwnProperties(obj) { if (typeof obj === "object" && obj !== null) { const extractedProps = {}; for (const property in obj) { if (Object.prototype.hasOwnProperty.call(obj, property)) { extractedProps[property] = obj[property]; } } return extractedProps; } else { return {}; } } function extractExceptionKeysForMessage(exception, maxLength = 40) { const keys = Object.keys(convertToPlainObject(exception)); keys.sort(); if (!keys.length) { return "[object has no keys]"; } if (keys[0].length >= maxLength) { return string3.truncate(keys[0], maxLength); } for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) { const serialized = keys.slice(0, includedKeys).join(", "); if (serialized.length > maxLength) { continue; } if (includedKeys === keys.length) { return serialized; } return string3.truncate(serialized, maxLength); } return ""; } function dropUndefinedKeys(inputValue) { const memoizationMap = /* @__PURE__ */ new Map(); return _dropUndefinedKeys(inputValue, memoizationMap); } function _dropUndefinedKeys(inputValue, memoizationMap) { if (isPojo(inputValue)) { const memoVal = memoizationMap.get(inputValue); if (memoVal !== void 0) { return memoVal; } const returnValue = {}; memoizationMap.set(inputValue, returnValue); for (const key of Object.keys(inputValue)) { if (typeof inputValue[key] !== "undefined") { returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); } } return returnValue; } if (Array.isArray(inputValue)) { const memoVal = memoizationMap.get(inputValue); if (memoVal !== void 0) { return memoVal; } const returnValue = []; memoizationMap.set(inputValue, returnValue); inputValue.forEach((item) => { returnValue.push(_dropUndefinedKeys(item, memoizationMap)); }); return returnValue; } return inputValue; } function isPojo(input) { if (!is.isPlainObject(input)) { return false; } try { const name = Object.getPrototypeOf(input).constructor.name; return !name || name === "Object"; } catch (e) { return true; } } function objectify(wat) { let objectified; switch (true) { case (wat === void 0 || wat === null): objectified = new String(wat); break; // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as // an object in order to wrap it. case (typeof wat === "symbol" || typeof wat === "bigint"): objectified = Object(wat); break; // this will catch the remaining primitives: `String`, `Number`, and `Boolean` case is.isPrimitive(wat): objectified = new wat.constructor(wat); break; // by process of elimination, at this point we know that `wat` must already be an object default: objectified = wat; break; } return objectified; } exports2.addNonEnumerableProperty = addNonEnumerableProperty; exports2.convertToPlainObject = convertToPlainObject; exports2.dropUndefinedKeys = dropUndefinedKeys; exports2.extractExceptionKeysForMessage = extractExceptionKeysForMessage; exports2.fill = fill; exports2.getOriginalFunction = getOriginalFunction; exports2.markFunctionWrapped = markFunctionWrapped; exports2.objectify = objectify; exports2.urlEncode = urlEncode; } }); // ../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/node-stack-trace.js var require_node_stack_trace = __commonJS({ "../common/temp/node_modules/.pnpm/@sentry+utils@7.120.4/node_modules/@sentry/utils/cjs/node-stack-trace.js"(exports2) { Object.defineProperty(exports2, "__esModule", { value: true }); function filenameIsInApp(filename, isNative = false) { const isInternal = isNative || filename && // It's not internal if it's an absolute linux path !filename.startsWith("/") && // It's not internal if it's an absolute windows path !filename.match(/^[A-Z]:/) && // It's not internal if the path is starting with a dot !filename.startsWith(".") && // 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 !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//); return !isInternal && filename !== void 0 && !filename.includes("node_modules/"); } function node(getModule2) { const FILENAME_MATCH = /^\s*[-]{4,}$/; const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;