vercel
Version:
The command-line interface for Vercel
1,372 lines (1,354 loc) • 995 kB
JavaScript
import { createRequire as __createRequire } from 'node:module';
import { fileURLToPath as __fileURLToPath } from 'node:url';
import { dirname as __dirname_ } from 'node:path';
const require = __createRequire(import.meta.url);
const __filename = __fileURLToPath(import.meta.url);
const __dirname = __dirname_(__filename);
import {
__commonJS,
__require
} from "./chunk-TZ2YI2VH.js";
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/is.js
var require_is = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/is.js"(exports) {
Object.defineProperty(exports, "__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 isPlainObject(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 isPlainObject(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));
}
exports.isDOMError = isDOMError;
exports.isDOMException = isDOMException;
exports.isElement = isElement;
exports.isError = isError;
exports.isErrorEvent = isErrorEvent;
exports.isEvent = isEvent;
exports.isInstanceOf = isInstanceOf;
exports.isNaN = isNaN2;
exports.isParameterizedString = isParameterizedString;
exports.isPlainObject = isPlainObject;
exports.isPrimitive = isPrimitive;
exports.isRegExp = isRegExp;
exports.isString = isString;
exports.isSyntheticEvent = isSyntheticEvent;
exports.isThenable = isThenable;
exports.isVueViewModel = isVueViewModel;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/string.js
var require_string = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/string.js"(exports) {
Object.defineProperty(exports, "__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));
}
exports.isMatchingPattern = isMatchingPattern;
exports.safeJoin = safeJoin;
exports.snipLine = snipLine;
exports.stringMatchesSomePattern = stringMatchesSomePattern;
exports.truncate = truncate;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/aggregate-errors.js
var require_aggregate_errors = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/aggregate-errors.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var is = require_is();
var string = 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, error, key, prevExceptions, exception, exceptionId) {
if (prevExceptions.length >= limit + 1) {
return prevExceptions;
}
let newExceptions = [...prevExceptions];
if (is.isInstanceOf(error[key], Error)) {
applyExceptionGroupFieldsForParentException(exception, exceptionId);
const newException = exceptionFromErrorImplementation(parser, error[key]);
const newExceptionId = newExceptions.length;
applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);
newExceptions = aggregateExceptionsFromError(
exceptionFromErrorImplementation,
parser,
limit,
error[key],
key,
[newException, ...newExceptions],
newException,
newExceptionId
);
}
if (Array.isArray(error.errors)) {
error.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 = string.truncate(exception.value, maxValueLength);
}
return exception;
});
}
exports.applyAggregateErrorsToEvent = applyAggregateErrorsToEvent;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/worldwide.js
var require_worldwide = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/worldwide.js"(exports) {
Object.defineProperty(exports, "__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) || 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;
}
exports.GLOBAL_OBJ = GLOBAL_OBJ;
exports.getGlobalObject = getGlobalObject;
exports.getGlobalSingleton = getGlobalSingleton;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/browser.js
var require_browser = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/browser.js"(exports) {
Object.defineProperty(exports, "__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 height = 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 && height++ < MAX_TRAVERSE_HEIGHT) {
nextStr = _htmlElementAsString(currentElem, keyAttrs);
if (nextStr === "html" || height > 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;
}
exports.getComponentName = getComponentName;
exports.getDomElement = getDomElement;
exports.getLocationHref = getLocationHref;
exports.htmlTreeAsString = htmlTreeAsString;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/debug-build.js
var require_debug_build = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/debug-build.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
exports.DEBUG_BUILD = DEBUG_BUILD;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/logger.js
var require_logger = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/logger.js"(exports) {
Object.defineProperty(exports, "__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();
exports.CONSOLE_LEVELS = CONSOLE_LEVELS;
exports.consoleSandbox = consoleSandbox;
exports.logger = logger;
exports.originalConsoleMethods = originalConsoleMethods;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/dsn.js
var require_dsn = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/dsn.js"(exports) {
Object.defineProperty(exports, "__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, pass, port, projectId, protocol, publicKey } = dsn;
return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path ? `${path}/` : path}${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 path = "";
let projectId = lastPath;
const split = projectId.split("/");
if (split.length > 1) {
path = 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, 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;
}
exports.dsnFromString = dsnFromString;
exports.dsnToString = dsnToString;
exports.makeDsn = makeDsn;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/error.js
var require_error = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/error.js"(exports) {
Object.defineProperty(exports, "__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;
}
};
exports.SentryError = SentryError;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/object.js
var require_object = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/object.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var browser = require_browser();
var debugBuild = require_debug_build();
var is = require_is();
var logger = require_logger();
var string = 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 proto = original.prototype || {};
wrapped.prototype = original.prototype = proto;
addNonEnumerableProperty(wrapped, "__sentry_original__", original);
} catch (o_O) {
}
}
function getOriginalFunction(func) {
return func.__sentry_original__;
}
function urlEncode(object) {
return Object.keys(object).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(object[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(target) {
try {
return is.isElement(target) ? browser.htmlTreeAsString(target) : Object.prototype.toString.call(target);
} 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 string.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 string.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;
case (typeof wat === "symbol" || typeof wat === "bigint"):
objectified = Object(wat);
break;
case is.isPrimitive(wat):
objectified = new wat.constructor(wat);
break;
default:
objectified = wat;
break;
}
return objectified;
}
exports.addNonEnumerableProperty = addNonEnumerableProperty;
exports.convertToPlainObject = convertToPlainObject;
exports.dropUndefinedKeys = dropUndefinedKeys;
exports.extractExceptionKeysForMessage = extractExceptionKeysForMessage;
exports.fill = fill;
exports.getOriginalFunction = getOriginalFunction;
exports.markFunctionWrapped = markFunctionWrapped;
exports.objectify = objectify;
exports.urlEncode = urlEncode;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/node-stack-trace.js
var require_node_stack_trace = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/node-stack-trace.js"(exports) {
Object.defineProperty(exports, "__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(getModule) {
const FILENAME_MATCH = /^\s*[-]{4,}$/;
const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
return (line) => {
const lineMatch = line.match(FULL_MATCH);
if (lineMatch) {
let object;
let method;
let functionName;
let typeName;
let methodName;
if (lineMatch[1]) {
functionName = lineMatch[1];
let methodStart = functionName.lastIndexOf(".");
if (functionName[methodStart - 1] === ".") {
methodStart--;
}
if (methodStart > 0) {
object = functionName.slice(0, methodStart);
method = functionName.slice(methodStart + 1);
const objectEnd = object.indexOf(".Module");
if (objectEnd > 0) {
functionName = functionName.slice(objectEnd + 1);
object = object.slice(0, objectEnd);
}
}
typeName = void 0;
}
if (method) {
typeName = object;
methodName = method;
}
if (method === "<anonymous>") {
methodName = void 0;
functionName = void 0;
}
if (functionName === void 0) {
methodName = methodName || "<anonymous>";
functionName = typeName ? `${typeName}.${methodName}` : methodName;
}
let filename = lineMatch[2] && lineMatch[2].startsWith("file://") ? lineMatch[2].slice(7) : lineMatch[2];
const isNative = lineMatch[5] === "native";
if (filename && filename.match(/\/[A-Z]:/)) {
filename = filename.slice(1);
}
if (!filename && lineMatch[5] && !isNative) {
filename = lineMatch[5];
}
return {
filename,
module: getModule ? getModule(filename) : void 0,
function: functionName,
lineno: parseInt(lineMatch[3], 10) || void 0,
colno: parseInt(lineMatch[4], 10) || void 0,
in_app: filenameIsInApp(filename, isNative)
};
}
if (line.match(FILENAME_MATCH)) {
return {
filename: line
};
}
return void 0;
};
}
exports.filenameIsInApp = filenameIsInApp;
exports.node = node;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/stacktrace.js
var require_stacktrace = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/stacktrace.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var nodeStackTrace = require_node_stack_trace();
var STACKTRACE_FRAME_LIMIT = 50;
var WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
var STRIP_FRAME_REGEXP = /captureMessage|captureException/;
function createStackParser(...parsers) {
const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map((p) => p[1]);
return (stack, skipFirst = 0) => {
const frames = [];
const lines = stack.split("\n");
for (let i = skipFirst; i < lines.length; i++) {
const line = lines[i];
if (line.length > 1024) {
continue;
}
const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, "$1") : line;
if (cleanedLine.match(/\S*Error: /)) {
continue;
}
for (const parser of sortedParsers) {
const frame = parser(cleanedLine);
if (frame) {
frames.push(frame);
break;
}
}
if (frames.length >= STACKTRACE_FRAME_LIMIT) {
break;
}
}
return stripSentryFramesAndReverse(frames);
};
}
function stackParserFromStackParserOptions(stackParser) {
if (Array.isArray(stackParser)) {
return createStackParser(...stackParser);
}
return stackParser;
}
function stripSentryFramesAndReverse(stack) {
if (!stack.length) {
return [];
}
const localStack = Array.from(stack);
if (/sentryWrapped/.test(localStack[localStack.length - 1].function || "")) {
localStack.pop();
}
localStack.reverse();
if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || "")) {
localStack.pop();
if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || "")) {
localStack.pop();
}
}
return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame) => ({
...frame,
filename: frame.filename || localStack[localStack.length - 1].filename,
function: frame.function || "?"
}));
}
var defaultFunctionName = "<anonymous>";
function getFunctionName(fn) {
try {
if (!fn || typeof fn !== "function") {
return defaultFunctionName;
}
return fn.name || defaultFunctionName;
} catch (e) {
return defaultFunctionName;
}
}
function nodeStackLineParser(getModule) {
return [90, nodeStackTrace.node(getModule)];
}
exports.filenameIsInApp = nodeStackTrace.filenameIsInApp;
exports.createStackParser = createStackParser;
exports.getFunctionName = getFunctionName;
exports.nodeStackLineParser = nodeStackLineParser;
exports.stackParserFromStackParserOptions = stackParserFromStackParserOptions;
exports.stripSentryFramesAndReverse = stripSentryFramesAndReverse;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/instrument/_handlers.js
var require_handlers = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/instrument/_handlers.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var debugBuild = require_debug_build();
var logger = require_logger();
var stacktrace = require_stacktrace();
var handlers = {};
var instrumented = {};
function addHandler(type, handler) {
handlers[type] = handlers[type] || [];
handlers[type].push(handler);
}
function resetInstrumentationHandlers() {
Object.keys(handlers).forEach((key) => {
handlers[key] = void 0;
});
}
function maybeInstrument(type, instrumentFn) {
if (!instrumented[type]) {
instrumentFn();
instrumented[type] = true;
}
}
function triggerHandlers(type, data) {
const typeHandlers = type && handlers[type];
if (!typeHandlers) {
return;
}
for (const handler of typeHandlers) {
try {
handler(data);
} catch (e) {
debugBuild.DEBUG_BUILD && logger.logger.error(
`Error while triggering instrumentation handler.
Type: ${type}
Name: ${stacktrace.getFunctionName(handler)}
Error:`,
e
);
}
}
}
exports.addHandler = addHandler;
exports.maybeInstrument = maybeInstrument;
exports.resetInstrumentationHandlers = resetInstrumentationHandlers;
exports.triggerHandlers = triggerHandlers;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/instrument/console.js
var require_console = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/instrument/console.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var logger = require_logger();
var object = require_object();
var worldwide = require_worldwide();
var _handlers = require_handlers();
function addConsoleInstrumentationHandler(handler) {
const type = "console";
_handlers.addHandler(type, handler);
_handlers.maybeInstrument(type, instrumentConsole);
}
function instrumentConsole() {
if (!("console" in worldwide.GLOBAL_OBJ)) {
return;
}
logger.CONSOLE_LEVELS.forEach(function(level) {
if (!(level in worldwide.GLOBAL_OBJ.console)) {
return;
}
object.fill(worldwide.GLOBAL_OBJ.console, level, function(originalConsoleMethod) {
logger.originalConsoleMethods[level] = originalConsoleMethod;
return function(...args) {
const handlerData = { args, level };
_handlers.triggerHandlers("console", handlerData);
const log = logger.originalConsoleMethods[level];
log && log.apply(worldwide.GLOBAL_OBJ.console, args);
};
});
});
}
exports.addConsoleInstrumentationHandler = addConsoleInstrumentationHandler;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/misc.js
var require_misc = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/misc.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var object = require_object();
var string = require_string();
var worldwide = require_worldwide();
function uuid4() {
const gbl = worldwide.GLOBAL_OBJ;
const crypto = gbl.crypto || gbl.msCrypto;
let getRandomByte = () => Math.random() * 16;
try {
if (crypto && crypto.randomUUID) {
return crypto.randomUUID().replace(/-/g, "");
}
if (crypto && crypto.getRandomValues) {
getRandomByte = () => {
const typedArray = new Uint8Array(1);
crypto.getRandomValues(typedArray);
return typedArray[0];
};
}
} catch (_) {
}
return ([1e7] + 1e3 + 4e3 + 8e3 + 1e11).replace(
/[018]/g,
(c) => (
// eslint-disable-next-line no-bitwise
(c ^ (getRandomByte() & 15) >> c / 4).toString(16)
)
);
}
function getFirstException(event) {
return event.exception && event.exception.values ? event.exception.values[0] : void 0;
}
function getEventDescription(event) {
const { message, event_id: eventId } = event;
if (message) {
return message;
}
const firstException = getFirstException(event);
if (firstException) {
if (firstException.type && firstException.value) {
return `${firstException.type}: ${firstException.value}`;
}
return firstException.type || firstException.value || eventId || "<unknown>";
}
return eventId || "<unknown>";
}
function addExceptionTypeValue(event, value, type) {
const exception = event.exception = event.exception || {};
const values = exception.values = exception.values || [];
const firstException = values[0] = values[0] || {};
if (!firstException.value) {
firstException.value = value || "";
}
if (!firstException.type) {
firstException.type = type || "Error";
}
}
function addExceptionMechanism(event, newMechanism) {
const firstException = getFirstException(event);
if (!firstException) {
return;
}
const defaultMechanism = { type: "generic", handled: true };
const currentMechanism = firstException.mechanism;
firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };
if (newMechanism && "data" in newMechanism) {
const mergedData = { ...currentMechanism && currentMechanism.data, ...newMechanism.data };
firstException.mechanism.data = mergedData;
}
}
var SEMVER_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
function parseSemver(input) {
const match = input.match(SEMVER_REGEXP) || [];
const major = parseInt(match[1], 10);
const minor = parseInt(match[2], 10);
const patch = parseInt(match[3], 10);
return {
buildmetadata: match[5],
major: isNaN(major) ? void 0 : major,
minor: isNaN(minor) ? void 0 : minor,
patch: isNaN(patch) ? void 0 : patch,
prerelease: match[4]
};
}
function addContextToFrame(lines, frame, linesOfContext = 5) {
if (frame.lineno === void 0) {
return;
}
const maxLines = lines.length;
const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);
frame.pre_context = lines.slice(Math.max(0, sourceLine - linesOfContext), sourceLine).map((line) => string.snipLine(line, 0));
frame.context_line = string.snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);
frame.post_context = lines.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext).map((line) => string.snipLine(line, 0));
}
function checkOrSetAlreadyCaught(exception) {
if (exception && exception.__sentry_captured__) {
return true;
}
try {
object.addNonEnumerableProperty(exception, "__sentry_captured__", true);
} catch (err) {
}
return false;
}
function arrayify(maybeArray) {
return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
}
exports.addContextToFrame = addContextToFrame;
exports.addExceptionMechanism = addExceptionMechanism;
exports.addExceptionTypeValue = addExceptionTypeValue;
exports.arrayify = arrayify;
exports.checkOrSetAlreadyCaught = checkOrSetAlreadyCaught;
exports.getEventDescription = getEventDescription;
exports.parseSemver = parseSemver;
exports.uuid4 = uuid4;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/instrument/dom.js
var require_dom = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/instrument/dom.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var misc = require_misc();
var object = require_object();
var worldwide = require_worldwide();
var _handlers = require_handlers();
var WINDOW = worldwide.GLOBAL_OBJ;
var DEBOUNCE_DURATION = 1e3;
var debounceTimerID;
var lastCapturedEventType;
var lastCapturedEventTargetId;
function addClickKeypressInstrumentationHandler(handler) {
const type = "dom";
_handlers.addHandler(type, handler);
_handlers.maybeInstrument(type, instrumentDOM);
}
function instrumentDOM() {
if (!WINDOW.document) {
return;
}
const triggerDOMHandler = _handlers.triggerHandlers.bind(null, "dom");
const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);
WINDOW.document.addEventListener("click", globalDOMEventHandler, false);
WINDOW.document.addEventListener("keypress", globalDOMEventHandler, false);
["EventTarget", "Node"].forEach((target) => {
const proto = WINDOW[target] && WINDOW[target].prototype;
if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty("addEventListener")) {
return;
}
object.fill(proto, "addEventListener", function(originalAddEventListener) {
return function(type, listener, options) {
if (type === "click" || type == "keypress") {
try {
const el = this;
const handlers = el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {};
const handlerForType = handlers[type] = handlers[type] || { refCount: 0 };
if (!handlerForType.handler) {
const handler = makeDOMEventHandler(triggerDOMHandler);
handlerForType.handler = handler;
originalAddEventListener.call(this, type, handler, options);
}
handlerForType.refCount++;
} catch (e) {
}
}
return originalAddEventListener.call(this, type, listener, options);
};
});
object.fill(
proto,
"removeEventListener",
function(originalRemoveEventListener) {
return function(type, listener, options) {
if (type === "click" || type == "keypress") {
try {
const el = this;
const handlers = el.__sentry_instrumentation_handlers__ || {};
const handlerForType = handlers[type];
if (handlerForType) {
handlerForType.refCount--;
if (handlerForType.refCount <= 0) {
originalRemoveEventListener.call(this, type, handlerForType.handler, options);
handlerForType.handler = void 0;
delete handlers[type];
}
if (Object.keys(handlers).length === 0) {
delete el.__sentry_instrumentation_handlers__;
}
}
} catch (e) {
}
}
return originalRemoveEventListener.call(this, type, listener, options);
};
}
);
});
}
function isSimilarToLastCapturedEvent(event) {
if (event.type !== lastCapturedEventType) {
return false;
}
try {
if (!event.target || event.target._sentryId !== lastCapturedEventTargetId) {
return false;
}
} catch (e) {
}
return true;
}
function shouldSkipDOMEvent(eventType, target) {
if (eventType !== "keypress") {
return false;
}
if (!target || !target.tagName) {
return true;
}
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable) {
return false;
}
return true;
}
function makeDOMEventHandler(handler, globalListener = false) {
return (event) => {
if (!event || event["_sentryCaptured"]) {
return;
}
const target = getEventTarget(event);
if (shouldSkipDOMEvent(event.type, target)) {
return;
}
object.addNonEnumerableProperty(event, "_sentryCaptured", true);
if (target && !target._sentryId) {
object.addNonEnumerableProperty(target, "_sentryId", misc.uuid4());
}
const name = event.type === "keypress" ? "input" : event.type;
if (!isSimilarToLastCapturedEvent(event)) {
const handlerData = { event, name, global: globalListener };
handler(handlerData);
lastCapturedEventType = event.type;
lastCapturedEventTargetId = target ? target._sentryId : void 0;
}
clearTimeout(debounceTimerID);
debounceTimerID = WINDOW.setTimeout(() => {
lastCapturedEventTargetId = void 0;
lastCapturedEventType = void 0;
}, DEBOUNCE_DURATION);
};
}
function getEventTarget(event) {
try {
return event.target;
} catch (e) {
return null;
}
}
exports.addClickKeypressInstrumentationHandler = addClickKeypressInstrumentationHandler;
exports.instrumentDOM = instrumentDOM;
}
});
// ../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/supports.js
var require_supports = __commonJS({
"../../node_modules/.pnpm/@sentry+utils@7.120.1/node_modules/@sentry/utils/cjs/supports.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var debugBuild = require_debug_build();
var logger = require_logger();
var worldwide = require_worldwide();
var WINDOW = worldwide.getGlobalObject();
function supportsErrorEvent() {
try {
new ErrorEvent("");
return true;
} catch (e) {
return false;
}
}
function supportsDOMError() {
try {
new DOMError("");
return true;
} catch (e) {
return false;
}
}
function supportsDOMException() {
try {
new DOMException("");
return true;
} catch (e) {
return false;
}
}
function supportsFetch() {
if (!("fetch" in WINDOW)) {
return false;
}
try {
new Headers();
new Request("http://www.example.com");
new Response();
return true;
} catch (e) {
return false;
}
}
function isNativeFetch(func) {
return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString());
}
function supportsNativeFetch() {
if (typeof EdgeRuntime === "string") {
return true;
}
if (!supportsFetch()) {
return false;