diff --git a/3/ecolyo.436a1ec4c3cc3543aa5c.js b/3/ecolyo.b6b6d00740ffe3a09bc9.js similarity index 99% rename from 3/ecolyo.436a1ec4c3cc3543aa5c.js rename to 3/ecolyo.b6b6d00740ffe3a09bc9.js index dd02b9b9b0f19034d95085c3781527e6fd4259bf..c087a20507d601919f776ba6ef3fa99375986ebf 100644 --- a/3/ecolyo.436a1ec4c3cc3543aa5c.js +++ b/3/ecolyo.b6b6d00740ffe3a09bc9.js @@ -6580,11 +6580,11 @@ var ExpiredConsentModal = function ExpiredConsentModal(_ref) { pdlConfirm: true, shouldLaunchAccount: true })); - dispatch((0, _global.setShouldRefreshConsent)(true)); } toggleModal(); history.push("/consumption/".concat(_fluid.FluidType[fluidType].toLocaleLowerCase())); + dispatch((0, _global.setShouldRefreshConsent)(true)); }, [dispatch, fluidStatus, fluidType, history, toggleModal]); return /*#__PURE__*/_react.default.createElement(_Dialog.default, { open: open, @@ -7180,10 +7180,11 @@ var ConnectionResult = function ConnectionResult(_ref) { pdlConfirm: true, shouldLaunchAccount: true })); - dispatch((0, _global.setShouldRefreshConsent)(true)); } else { deleteAccountsAndTriggers(); } + + dispatch((0, _global.setShouldRefreshConsent)(true)); }, [deleteAccountsAndTriggers, dispatch, (_fluidStatus$connecti2 = fluidStatus.connection.account) === null || _fluidStatus$connecti2 === void 0 ? void 0 : _fluidStatus$connecti2.auth]); (0, _react.useEffect)(function () { var _fluidStatus$connecti3, _fluidStatus$connecti4, _fluidStatus$connecti5; diff --git a/8/ecolyo.bbf213875c65dc7c68ce.js b/8/ecolyo.b34c0432001c988f322b.js similarity index 99% rename from 8/ecolyo.bbf213875c65dc7c68ce.js rename to 8/ecolyo.b34c0432001c988f322b.js index 9d4e5d4bf44a4fe547a5aea2366b15711776c353..0f734dd84e5c0bd03b61c2a2ea1bd328986a47ea 100644 --- a/8/ecolyo.bbf213875c65dc7c68ce.js +++ b/8/ecolyo.b34c0432001c988f322b.js @@ -1747,6 +1747,11 @@ var OptionsView = function OptionsView() { setHeaderHeight(height); }; + var envFiles = function envFiles() { + console.log('click icon'); + throw new Error('custom error 2'); + }; + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CozyBar.default, { titleKey: 'common.title_options' }), /*#__PURE__*/_react.default.createElement(_Header.default, { @@ -1754,7 +1759,9 @@ var OptionsView = function OptionsView() { desktopTitleKey: 'common.title_options' }), /*#__PURE__*/_react.default.createElement(_Content.default, { height: headerHeight - }, /*#__PURE__*/_react.default.createElement(_ProfileTypeOptions.default, null), /*#__PURE__*/_react.default.createElement(_exportOptions.default, null), /*#__PURE__*/_react.default.createElement(_ReportOptions.default, null), /*#__PURE__*/_react.default.createElement(_FAQLink.default, null), /*#__PURE__*/_react.default.createElement(_LegalNoticeLink.default, null), /*#__PURE__*/_react.default.createElement(_GCULink.default, null), /*#__PURE__*/_react.default.createElement(_MatomoOptOut.MatomoOptOut, null), /*#__PURE__*/_react.default.createElement("div", { + }, /*#__PURE__*/_react.default.createElement("button", { + onClick: envFiles + }, "Break the world"), ";", /*#__PURE__*/_react.default.createElement(_ProfileTypeOptions.default, null), /*#__PURE__*/_react.default.createElement(_exportOptions.default, null), /*#__PURE__*/_react.default.createElement(_ReportOptions.default, null), /*#__PURE__*/_react.default.createElement(_FAQLink.default, null), /*#__PURE__*/_react.default.createElement(_LegalNoticeLink.default, null), /*#__PURE__*/_react.default.createElement(_GCULink.default, null), /*#__PURE__*/_react.default.createElement(_MatomoOptOut.MatomoOptOut, null), /*#__PURE__*/_react.default.createElement("div", { className: "parameters-logos" }, /*#__PURE__*/_react.default.createElement("img", { src: _logos.default, diff --git a/app/ecolyo.919f7af1dbe9cda80ed7.js b/app/ecolyo.d09ed6a039279dd1e8dc.js similarity index 99% rename from app/ecolyo.919f7af1dbe9cda80ed7.js rename to app/ecolyo.d09ed6a039279dd1e8dc.js index a61c3a5c1fb2b75ffa4387cc61459d03ff7d7a2d..71ac43ebb8e556108823a6cf76c914d6873c20c7 100644 --- a/app/ecolyo.919f7af1dbe9cda80ed7.js +++ b/app/ecolyo.d09ed6a039279dd1e8dc.js @@ -64,7 +64,7 @@ /******/ /******/ // script path function /******/ function jsonpScriptSrc(chunkId) { -/******/ return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + "/ecolyo." + {"2":"7e00bbcedd3d4f071dd4","3":"436a1ec4c3cc3543aa5c","4":"99e0fa1742cfe21c53ce","5":"9a0ab13eae90cfe2c5f4","6":"1228a468bb34bc1e20f3","7":"8e0088481e1baf094fa4","8":"bbf213875c65dc7c68ce","9":"cef536e96c5efd865b2c","10":"2c80746565ffb33a7e2c","11":"9cb80588b9255f7c6d85"}[chunkId] + ".js" +/******/ return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + "/ecolyo." + {"2":"7e00bbcedd3d4f071dd4","3":"b6b6d00740ffe3a09bc9","4":"99e0fa1742cfe21c53ce","5":"9a0ab13eae90cfe2c5f4","6":"1228a468bb34bc1e20f3","7":"8e0088481e1baf094fa4","8":"b34c0432001c988f322b","9":"cef536e96c5efd865b2c","10":"2c80746565ffb33a7e2c","11":"9cb80588b9255f7c6d85"}[chunkId] + ".js" /******/ } /******/ /******/ // The require function @@ -655,6 +655,12 @@ var _reactRouterDom = __webpack_require__("55Ip"); var _matomoTracker = _interopRequireDefault(__webpack_require__("vMBp")); +var Sentry = _interopRequireWildcard(__webpack_require__("agHs")); + +var _tracing = __webpack_require__("aI3+"); + +var _environment = _interopRequireDefault(__webpack_require__("X6DI")); + function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } @@ -684,6 +690,7 @@ var setupApp = (0, _lodash.memoize)(function () { }); var persistedState = {}; var store = (0, _store.default)(client, persistedState); + var development = new _environment.default().isDev(); cozy.bar.init({ appName: data.app.name, appEditor: data.app.editor, @@ -707,6 +714,17 @@ var setupApp = (0, _lodash.memoize)(function () { }); } + Sentry.init({ + dsn: "https://c868f6010f3f431d95be8f70d7f37666@grandlyon.errors.cozycloud.cc/6", + integrations: [new _tracing.BrowserTracing()], + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production + tracesSampleRate: 1.0, + // Custom settings below + release: client.appMetadata.version, + environment: development ? 'development' : 'production' + }); return { root: root, store: store, @@ -9628,6 +9646,12 @@ var _challenge = __webpack_require__("TYd+"); var _profileEcogesture = __webpack_require__("L0ad"); +var Sentry = _interopRequireWildcard(__webpack_require__("agHs")); + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + var ecolyoReducer = (0, _redux.combineReducers)({ global: _global.globalReducer, profile: _profile.profileReducer, @@ -9638,6 +9662,7 @@ var ecolyoReducer = (0, _redux.combineReducers)({ challenge: _challenge.challengeReducer }); exports.ecolyoReducer = ecolyoReducer; +var sentryReduxEnhancer = Sentry.createReduxEnhancer({}); var configureStore = function configureStore(client, persistedState) { var middlewares = [_reduxThunk.default.withExtraArgument({ @@ -9648,8 +9673,9 @@ var configureStore = function configureStore(client, persistedState) { ecolyo: ecolyoReducer, cozy: client.reducer(), persistedState: persistedState - }), // eslint-disable-next-line prefer-spread - composeEnhancers(_redux.applyMiddleware.apply(null, middlewares))); + }), composeEnhancers( // eslint-disable-next-line prefer-spread + _redux.applyMiddleware.apply(null, middlewares), sentryReduxEnhancer) // composeEnhancers(applyMiddleware.apply(null, middlewares)) + ); return store; }; @@ -21247,12 +21273,22 @@ var EnvironmentService = /*#__PURE__*/function () { (0, _createClass2.default)(EnvironmentService, [{ key: "isAlpha", value: function isAlpha() { - if (true) { - return true; - } - + return true; + } + }, { + key: "isLocal", + value: function isLocal() { return false; } + /** + * Returns true for local OR alpha + */ + + }, { + key: "isDev", + value: function isDev() { + return true || false; + } }, { key: "isProduction", value: function isProduction() { @@ -21271,11 +21307,6 @@ var EnvironmentService = /*#__PURE__*/function () { return 'https://ecolyo-agent-rec.grandlyon.com'; } } - }, { - key: "isLocal", - value: function isLocal() { - return false; - } }]); return EnvironmentService; }(); diff --git a/index.html b/index.html index e8b51d3f1e354c18e29b7e89823333e5764931e4..733ef453dd35275a7db31a519679798c692dc428 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,user-scalable=0,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212"><!-- PWA iOS title --><meta name="apple-mobile-web-app-title" content="Ecolyo">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.0d9221201ffbd1127b31.js"></script><script src="app/ecolyo.919f7af1dbe9cda80ed7.js"></script></div></body></html> \ No newline at end of file +<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,user-scalable=0,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212"><!-- PWA iOS title --><meta name="apple-mobile-web-app-title" content="Ecolyo">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.0bd55135efc0369df819.js"></script><script src="app/ecolyo.d09ed6a039279dd1e8dc.js"></script></div></body></html> \ No newline at end of file diff --git a/services/aggregatorUsageEvents/ecolyo.js b/services/aggregatorUsageEvents/ecolyo.js index 407c2add8d082323c6bc098b755a138361003a00..dd7357928f636f96e9d48ac560e77cea5aec6e9d 100644 --- a/services/aggregatorUsageEvents/ecolyo.js +++ b/services/aggregatorUsageEvents/ecolyo.js @@ -99096,11 +99096,19 @@ exports.default = void 0; class EnvironmentService { isAlpha() { - if (true) { - return true; - } + return true; + } - return false; + isLocal() { + return __DEVELOPMENT__; + } + /** + * Returns true for local OR alpha + */ + + + isDev() { + return true || false; } isProduction() { @@ -99119,10 +99127,6 @@ class EnvironmentService { } } - isLocal() { - return __DEVELOPMENT__; - } - } exports.default = EnvironmentService; diff --git a/services/consumptionAlert/ecolyo.js b/services/consumptionAlert/ecolyo.js index 4b775341e65f80aec9abda8290f2ce8fbb10ad39..338d8bc7aea70c08b434a44a16352666d15cc2e2 100644 --- a/services/consumptionAlert/ecolyo.js +++ b/services/consumptionAlert/ecolyo.js @@ -81523,11 +81523,19 @@ exports.default = void 0; class EnvironmentService { isAlpha() { - if (true) { - return true; - } + return true; + } - return false; + isLocal() { + return __DEVELOPMENT__; + } + /** + * Returns true for local OR alpha + */ + + + isDev() { + return true || false; } isProduction() { @@ -81546,10 +81554,6 @@ class EnvironmentService { } } - isLocal() { - return __DEVELOPMENT__; - } - } exports.default = EnvironmentService; diff --git a/services/fluidsPrices/ecolyo.js b/services/fluidsPrices/ecolyo.js index 839f6e9f3751ef7d4264ac85ddb3bf093c6ea679..f82d2c269b9b681e4a11e3130eeeabbf7d613a95 100644 --- a/services/fluidsPrices/ecolyo.js +++ b/services/fluidsPrices/ecolyo.js @@ -79892,11 +79892,19 @@ exports.default = void 0; class EnvironmentService { isAlpha() { - if (true) { - return true; - } + return true; + } - return false; + isLocal() { + return __DEVELOPMENT__; + } + /** + * Returns true for local OR alpha + */ + + + isDev() { + return true || false; } isProduction() { @@ -79915,10 +79923,6 @@ class EnvironmentService { } } - isLocal() { - return __DEVELOPMENT__; - } - } exports.default = EnvironmentService; diff --git a/services/monthlyReportNotification/ecolyo.js b/services/monthlyReportNotification/ecolyo.js index 75086bf27ed90d5f53bec6dd8c97b80130016a74..d20f2d119eb2d50e96e959720b73ab25359e75f4 100644 --- a/services/monthlyReportNotification/ecolyo.js +++ b/services/monthlyReportNotification/ecolyo.js @@ -81523,11 +81523,19 @@ exports.default = void 0; class EnvironmentService { isAlpha() { - if (true) { - return true; - } + return true; + } - return false; + isLocal() { + return __DEVELOPMENT__; + } + /** + * Returns true for local OR alpha + */ + + + isDev() { + return true || false; } isProduction() { @@ -81546,10 +81554,6 @@ class EnvironmentService { } } - isLocal() { - return __DEVELOPMENT__; - } - } exports.default = EnvironmentService; diff --git a/vendors/ecolyo.0d9221201ffbd1127b31.js b/vendors/ecolyo.0bd55135efc0369df819.js similarity index 95% rename from vendors/ecolyo.0d9221201ffbd1127b31.js rename to vendors/ecolyo.0bd55135efc0369df819.js index bed0d71fc9aae55a1db42d17820ddae3117e7871..0d06eef61408164972ce69b788b7ea2423e46eed 100644 --- a/vendors/ecolyo.0d9221201ffbd1127b31.js +++ b/vendors/ecolyo.0bd55135efc0369df819.js @@ -441,12 +441,14 @@ function createSidecarMedium(options) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return truncate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "snipLine", function() { return snipLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeJoin", function() { return safeJoin; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMatchingPattern", function() { return isMatchingPattern; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeStringForRegex", function() { return escapeStringForRegex; }); -/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9AQC"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMatchingPattern", function() { return isMatchingPattern; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeJoin", function() { return safeJoin; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "snipLine", function() { return snipLine; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringMatchesSomePattern", function() { return stringMatchesSomePattern; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return truncate; }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9AQC"); + /** * Truncates given string to the maximum characters count @@ -455,13 +457,13 @@ __webpack_require__.r(__webpack_exports__); * @param max Maximum number of characters in truncated string (0 = unlimited) * @returns string Encoded */ -function truncate(str, max) { - if (max === void 0) { max = 0; } - if (typeof str !== 'string' || max === 0) { - return str; - } - return str.length <= max ? str : str.substr(0, max) + "..."; +function truncate(str, max = 0) { + if (typeof str !== 'string' || max === 0) { + return str; + } + return str.length <= max ? str : `${str.substr(0, max)}...`; } + /** * This is basically just `trim_line` from * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67 @@ -471,35 +473,40 @@ function truncate(str, max) { * @returns string Encoded */ function snipLine(line, colno) { - var newLine = line; - var lineLength = newLine.length; - if (lineLength <= 150) { - return newLine; - } - if (colno > lineLength) { - // eslint-disable-next-line no-param-reassign - colno = lineLength; - } - var start = Math.max(colno - 60, 0); - if (start < 5) { - start = 0; - } - var 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}'; - } + let newLine = line; + const lineLength = newLine.length; + if (lineLength <= 150) { return newLine; + } + if (colno > lineLength) { + // eslint-disable-next-line no-param-reassign + 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; } + /** * Join values in array * @param input array of values to be joined together @@ -508,39 +515,69 @@ function snipLine(line, colno) { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function safeJoin(input, delimiter) { - if (!Array.isArray(input)) { - return ''; - } - var output = []; - // eslint-disable-next-line @typescript-eslint/prefer-for-of - for (var i = 0; i < input.length; i++) { - var value = input[i]; - try { - output.push(String(value)); - } - catch (e) { - output.push('[value cannot be serialized]'); - } + if (!Array.isArray(input)) { + return ''; + } + + const output = []; + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let i = 0; i < input.length; i++) { + const value = input[i]; + try { + output.push(String(value)); + } catch (e) { + output.push('[value cannot be serialized]'); } - return output.join(delimiter); + } + + return output.join(delimiter); } + /** - * Checks if the value matches a regex or includes the string - * @param value The string value to be checked against - * @param pattern Either a regex or a string that must be contained in value + * Checks if the given value matches a regex or string + * + * @param value The string to test + * @param pattern Either a regex or a string against which `value` will be matched + * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match + * `pattern` if it contains `pattern`. Only applies to string-type patterns. */ -function isMatchingPattern(value, pattern) { - if (!Object(_is__WEBPACK_IMPORTED_MODULE_0__["isString"])(value)) { - return false; - } - if (Object(_is__WEBPACK_IMPORTED_MODULE_0__["isRegExp"])(pattern)) { - return pattern.test(value); - } - if (typeof pattern === 'string') { - return value.indexOf(pattern) !== -1; - } +function isMatchingPattern( + value, + pattern, + requireExactStringMatch = false, +) { + if (!Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isString"])(value)) { return false; + } + + if (Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isRegExp"])(pattern)) { + return pattern.test(value); + } + if (Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isString"])(pattern)) { + return requireExactStringMatch ? value === pattern : value.includes(pattern); + } + + return false; +} + +/** + * Test the given string against an array of strings and regexes. By default, string matching is done on a + * substring-inclusion basis rather than a strict equality basis + * + * @param testString The string to test + * @param patterns The patterns against which to test the string + * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to + * count. If false, `testString` will match a string pattern if it contains that pattern. + * @returns + */ +function stringMatchesSomePattern( + testString, + patterns = [], + requireExactStringMatch = false, +) { + return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch)); } + /** * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to * `new RegExp()`. @@ -553,12 +590,15 @@ function isMatchingPattern(value, pattern) { * @returns An version of the string with all special regex characters escaped */ function escapeStringForRegex(regexString) { - // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems - // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20. - return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d'); + // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems + // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20. + return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d'); } + + //# sourceMappingURL=string.js.map + /***/ }), /***/ "+A1k": @@ -566,10 +606,12 @@ function escapeStringForRegex(regexString) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(process, module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeEnv", function() { return isNodeEnv; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dynamicRequire", function() { return dynamicRequire; }); +/* WEBPACK VAR INJECTION */(function(process, module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dynamicRequire", function() { return dynamicRequire; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeEnv", function() { return isNodeEnv; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadModule", function() { return loadModule; }); -/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("RQwI"); +/* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("RQwI"); + + /** * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. @@ -581,11 +623,14 @@ __webpack_require__.r(__webpack_exports__); * @returns Answer to given question */ function isNodeEnv() { - // explicitly check for browser bundles as those can be optimized statically - // by terser/rollup. - return (!Object(_env__WEBPACK_IMPORTED_MODULE_0__["isBrowserBundle"])() && - Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'); + // explicitly check for browser bundles as those can be optimized statically + // by terser/rollup. + return ( + !Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isBrowserBundle"])() && + Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]' + ); } + /** * Requires a module which is protected against bundler minification. * @@ -593,9 +638,10 @@ function isNodeEnv() { */ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any function dynamicRequire(mod, request) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - return mod.require(request); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return mod.require(request); } + /** * Helper for dynamically loading module that should work with linked dependencies. * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))` @@ -610,23 +656,27 @@ function dynamicRequire(mod, request) { * @returns possibly required module */ function loadModule(moduleName) { - var mod; - try { - mod = dynamicRequire(module, moduleName); - } - catch (e) { - // no-empty - } - try { - var cwd = dynamicRequire(module, 'process').cwd; - mod = dynamicRequire(module, cwd() + "/node_modules/" + moduleName); - } - catch (e) { - // no-empty - } - return mod; + let mod; + + try { + mod = dynamicRequire(module, moduleName); + } catch (e) { + // no-empty + } + + try { + const { cwd } = dynamicRequire(module, 'process'); + mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) ; + } catch (e) { + // no-empty + } + + return mod; } + + //# sourceMappingURL=node.js.map + /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"), __webpack_require__("3UD+")(module))) /***/ }), @@ -1041,9 +1091,12 @@ module.exports = cloneArrayBuffer; "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return SDK_VERSION; }); -var SDK_VERSION = '6.19.7'; +const SDK_VERSION = '7.20.1'; + + //# sourceMappingURL=version.js.map + /***/ }), /***/ "+KYJ": @@ -2948,17 +3001,6 @@ __webpack_require__.r(__webpack_exports__); }); -/***/ }), - -/***/ "+usi": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SeverityLevels", function() { return SeverityLevels; }); -var SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical']; -//# sourceMappingURL=enums.js.map - /***/ }), /***/ "+vYJ": @@ -3636,115 +3678,6 @@ function ordinal (number) { module.exports = buildFormatLocale -/***/ }), - -/***/ "/3cH": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseBackend", function() { return BaseBackend; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); -/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("3MsT"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("yA8j"); -/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("KRiW"); -/* harmony import */ var _transports_noop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("31uO"); - - - - - - -/** - * This is the base implemention of a Backend. - * @hidden - */ -var BaseBackend = /** @class */ (function () { - /** Creates a new backend instance. */ - function BaseBackend(options) { - this._options = options; - if (!this._options.dsn) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('No DSN provided, backend will not do anything.'); - } - this._transport = this._setupTransport(); - } - /** - * @inheritDoc - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types - BaseBackend.prototype.eventFromException = function (_exception, _hint) { - throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SentryError"]('Backend has to implement `eventFromException` method'); - }; - /** - * @inheritDoc - */ - BaseBackend.prototype.eventFromMessage = function (_message, _level, _hint) { - throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SentryError"]('Backend has to implement `eventFromMessage` method'); - }; - /** - * @inheritDoc - */ - BaseBackend.prototype.sendEvent = function (event) { - // TODO(v7): Remove the if-else - if (this._newTransport && - this._options.dsn && - this._options._experiments && - this._options._experiments.newTransport) { - var api = Object(_api__WEBPACK_IMPORTED_MODULE_2__["initAPIDetails"])(this._options.dsn, this._options._metadata, this._options.tunnel); - var env = Object(_request__WEBPACK_IMPORTED_MODULE_4__["createEventEnvelope"])(event, api); - void this._newTransport.send(env).then(null, function (reason) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Error while sending event:', reason); - }); - } - else { - void this._transport.sendEvent(event).then(null, function (reason) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Error while sending event:', reason); - }); - } - }; - /** - * @inheritDoc - */ - BaseBackend.prototype.sendSession = function (session) { - if (!this._transport.sendSession) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn("Dropping session because custom transport doesn't implement sendSession"); - return; - } - // TODO(v7): Remove the if-else - if (this._newTransport && - this._options.dsn && - this._options._experiments && - this._options._experiments.newTransport) { - var api = Object(_api__WEBPACK_IMPORTED_MODULE_2__["initAPIDetails"])(this._options.dsn, this._options._metadata, this._options.tunnel); - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(Object(_request__WEBPACK_IMPORTED_MODULE_4__["createSessionEnvelope"])(session, api), 1), env = _a[0]; - void this._newTransport.send(env).then(null, function (reason) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Error while sending session:', reason); - }); - } - else { - void this._transport.sendSession(session).then(null, function (reason) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Error while sending session:', reason); - }); - } - }; - /** - * @inheritDoc - */ - BaseBackend.prototype.getTransport = function () { - return this._transport; - }; - /** - * Sets up the transport so it can be used later to send requests. - */ - BaseBackend.prototype._setupTransport = function () { - return new _transports_noop__WEBPACK_IMPORTED_MODULE_5__["NoopTransport"](); - }; - return BaseBackend; -}()); - -//# sourceMappingURL=basebackend.js.map - /***/ }), /***/ "/6mT": @@ -5300,6 +5233,539 @@ microee__WEBPACK_IMPORTED_MODULE_5___default.a.mixin(ConnectionFlow); /***/ }), +/***/ "/HJS": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseClient", function() { return BaseClient; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("uzXi"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Um2S"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("OEZb"); +/* harmony import */ var _integration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("HbKt"); + +/* eslint-disable max-lines */ + + + + +var ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; +/** + * Base implementation for all JavaScript SDK clients. + * + * Call the constructor with the corresponding backend constructor and options + * specific to the client subclass. To access these options later, use + * {@link Client.getOptions}. Also, the Backend instance is available via + * {@link Client.getBackend}. + * + * If a Dsn is specified in the options, it will be parsed and stored. Use + * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is + * invalid, the constructor will throw a {@link SentryException}. Note that + * without a valid Dsn, the SDK will not send any events to Sentry. + * + * Before sending an event via the backend, it is passed through + * {@link BaseClient._prepareEvent} to add SDK information and scope data + * (breadcrumbs and context). To add more custom information, override this + * method and extend the resulting prepared event. + * + * To issue automatically created events (e.g. via instrumentation), use + * {@link Client.captureEvent}. It will prepare the event and pass it through + * the callback lifecycle. To issue auto-breadcrumbs, use + * {@link Client.addBreadcrumb}. + * + * @example + * class NodeClient extends BaseClient<NodeBackend, NodeOptions> { + * public constructor(options: NodeOptions) { + * super(NodeBackend, options); + * } + * + * // ... + * } + */ +var BaseClient = /** @class */ (function () { + /** + * Initializes this client instance. + * + * @param backendClass A constructor function to create the backend. + * @param options Options for the client. + */ + function BaseClient(backendClass, options) { + /** Array of used integrations. */ + this._integrations = {}; + /** Number of calls being processed */ + this._numProcessing = 0; + this._backend = new backendClass(options); + this._options = options; + if (options.dsn) { + this._dsn = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["makeDsn"])(options.dsn); + } + } + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + BaseClient.prototype.captureException = function (exception, hint, scope) { + var _this = this; + // ensure we haven't captured this very object before + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["checkOrSetAlreadyCaught"])(exception)) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log(ALREADY_SEEN_ERROR); + return; + } + var eventId = hint && hint.event_id; + this._process(this._getBackend() + .eventFromException(exception, hint) + .then(function (event) { return _this._captureEvent(event, hint, scope); }) + .then(function (result) { + eventId = result; + })); + return eventId; + }; + /** + * @inheritDoc + */ + BaseClient.prototype.captureMessage = function (message, level, hint, scope) { + var _this = this; + var eventId = hint && hint.event_id; + var promisedEvent = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isPrimitive"])(message) + ? this._getBackend().eventFromMessage(String(message), level, hint) + : this._getBackend().eventFromException(message, hint); + this._process(promisedEvent + .then(function (event) { return _this._captureEvent(event, hint, scope); }) + .then(function (result) { + eventId = result; + })); + return eventId; + }; + /** + * @inheritDoc + */ + BaseClient.prototype.captureEvent = function (event, hint, scope) { + // ensure we haven't captured this very object before + if (hint && hint.originalException && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["checkOrSetAlreadyCaught"])(hint.originalException)) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log(ALREADY_SEEN_ERROR); + return; + } + var eventId = hint && hint.event_id; + this._process(this._captureEvent(event, hint, scope).then(function (result) { + eventId = result; + })); + return eventId; + }; + /** + * @inheritDoc + */ + BaseClient.prototype.captureSession = function (session) { + if (!this._isEnabled()) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('SDK not enabled, will not capture session.'); + return; + } + if (!(typeof session.release === 'string')) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Discarded session because of missing or non-string release'); + } + else { + this._sendSession(session); + // After sending, we set init false to indicate it's not the first occurrence + session.update({ init: false }); + } + }; + /** + * @inheritDoc + */ + BaseClient.prototype.getDsn = function () { + return this._dsn; + }; + /** + * @inheritDoc + */ + BaseClient.prototype.getOptions = function () { + return this._options; + }; + /** + * @inheritDoc + */ + BaseClient.prototype.getTransport = function () { + return this._getBackend().getTransport(); + }; + /** + * @inheritDoc + */ + BaseClient.prototype.flush = function (timeout) { + var _this = this; + return this._isClientDoneProcessing(timeout).then(function (clientFinished) { + return _this.getTransport() + .close(timeout) + .then(function (transportFlushed) { return clientFinished && transportFlushed; }); + }); + }; + /** + * @inheritDoc + */ + BaseClient.prototype.close = function (timeout) { + var _this = this; + return this.flush(timeout).then(function (result) { + _this.getOptions().enabled = false; + return result; + }); + }; + /** + * Sets up the integrations + */ + BaseClient.prototype.setupIntegrations = function () { + if (this._isEnabled() && !this._integrations.initialized) { + this._integrations = Object(_integration__WEBPACK_IMPORTED_MODULE_4__["setupIntegrations"])(this._options); + } + }; + /** + * @inheritDoc + */ + BaseClient.prototype.getIntegration = function (integration) { + try { + return this._integrations[integration.id] || null; + } + catch (_oO) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn("Cannot retrieve integration " + integration.id + " from the current Client"); + return null; + } + }; + /** Updates existing session based on the provided event */ + BaseClient.prototype._updateSessionFromEvent = function (session, event) { + var e_1, _a; + var crashed = false; + var errored = false; + var exceptions = event.exception && event.exception.values; + if (exceptions) { + errored = true; + try { + for (var exceptions_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(exceptions), exceptions_1_1 = exceptions_1.next(); !exceptions_1_1.done; exceptions_1_1 = exceptions_1.next()) { + var ex = exceptions_1_1.value; + var mechanism = ex.mechanism; + if (mechanism && mechanism.handled === false) { + crashed = true; + break; + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (exceptions_1_1 && !exceptions_1_1.done && (_a = exceptions_1.return)) _a.call(exceptions_1); + } + finally { if (e_1) throw e_1.error; } + } + } + // A session is updated and that session update is sent in only one of the two following scenarios: + // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update + // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update + var sessionNonTerminal = session.status === 'ok'; + var shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed); + if (shouldUpdateAndSend) { + session.update(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, (crashed && { status: 'crashed' })), { errors: session.errors || Number(errored || crashed) })); + this.captureSession(session); + } + }; + /** Deliver captured session to Sentry */ + BaseClient.prototype._sendSession = function (session) { + this._getBackend().sendSession(session); + }; + /** + * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying + * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not + * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to + * `true`. + * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and + * `false` otherwise + */ + BaseClient.prototype._isClientDoneProcessing = function (timeout) { + var _this = this; + return new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SyncPromise"](function (resolve) { + var ticked = 0; + var tick = 1; + var interval = setInterval(function () { + if (_this._numProcessing == 0) { + clearInterval(interval); + resolve(true); + } + else { + ticked += tick; + if (timeout && ticked >= timeout) { + clearInterval(interval); + resolve(false); + } + } + }, tick); + }); + }; + /** Returns the current backend. */ + BaseClient.prototype._getBackend = function () { + return this._backend; + }; + /** Determines whether this SDK is enabled and a valid Dsn is present. */ + BaseClient.prototype._isEnabled = function () { + return this.getOptions().enabled !== false && this._dsn !== undefined; + }; + /** + * Adds common information to events. + * + * The information includes release and environment from `options`, + * breadcrumbs and context (extra, tags and user) from the scope. + * + * Information that is already present in the event is never overwritten. For + * nested objects, such as the context, keys are merged. + * + * @param event The original event. + * @param hint May contain additional information about the original exception. + * @param scope A scope containing event metadata. + * @returns A new event with more information. + */ + BaseClient.prototype._prepareEvent = function (event, scope, hint) { + var _this = this; + var _a = this.getOptions(), _b = _a.normalizeDepth, normalizeDepth = _b === void 0 ? 3 : _b, _c = _a.normalizeMaxBreadth, normalizeMaxBreadth = _c === void 0 ? 1000 : _c; + var prepared = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, event), { event_id: event.event_id || (hint && hint.event_id ? hint.event_id : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["uuid4"])()), timestamp: event.timestamp || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["dateTimestampInSeconds"])() }); + this._applyClientOptions(prepared); + this._applyIntegrationsMetadata(prepared); + // If we have scope given to us, use it as the base for further modifications. + // This allows us to prevent unnecessary copying of data if `captureContext` is not provided. + var finalScope = scope; + if (hint && hint.captureContext) { + finalScope = _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["Scope"].clone(finalScope).update(hint.captureContext); + } + // We prepare the result here with a resolved Event. + var result = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["resolvedSyncPromise"])(prepared); + // This should be the last thing called, since we want that + // {@link Hub.addEventProcessor} gets the finished prepared event. + if (finalScope) { + // In case we have a hub we reassign it. + result = finalScope.applyToEvent(prepared, hint); + } + return result.then(function (evt) { + if (evt) { + // TODO this is more of the hack trying to solve https://github.com/getsentry/sentry-javascript/issues/2809 + // it is only attached as extra data to the event if the event somehow skips being normalized + evt.sdkProcessingMetadata = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, evt.sdkProcessingMetadata), { normalizeDepth: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalize"])(normalizeDepth) + " (" + typeof normalizeDepth + ")" }); + } + if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { + return _this._normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); + } + return evt; + }); + }; + /** + * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. + * Normalized keys: + * - `breadcrumbs.data` + * - `user` + * - `contexts` + * - `extra` + * @param event Event + * @returns Normalized event + */ + BaseClient.prototype._normalizeEvent = function (event, depth, maxBreadth) { + if (!event) { + return null; + } + var normalized = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, event), (event.breadcrumbs && { + breadcrumbs: event.breadcrumbs.map(function (b) { return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, b), (b.data && { + data: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalize"])(b.data, depth, maxBreadth), + }))); }), + })), (event.user && { + user: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalize"])(event.user, depth, maxBreadth), + })), (event.contexts && { + contexts: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalize"])(event.contexts, depth, maxBreadth), + })), (event.extra && { + extra: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalize"])(event.extra, depth, maxBreadth), + })); + // event.contexts.trace stores information about a Transaction. Similarly, + // event.spans[] stores information about child Spans. Given that a + // Transaction is conceptually a Span, normalization should apply to both + // Transactions and Spans consistently. + // For now the decision is to skip normalization of Transactions and Spans, + // so this block overwrites the normalized event to add back the original + // Transaction information prior to normalization. + if (event.contexts && event.contexts.trace) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + normalized.contexts.trace = event.contexts.trace; + } + normalized.sdkProcessingMetadata = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, normalized.sdkProcessingMetadata), { baseClientNormalized: true }); + return normalized; + }; + /** + * Enhances event using the client configuration. + * It takes care of all "static" values like environment, release and `dist`, + * as well as truncating overly long values. + * @param event event instance to be enhanced + */ + BaseClient.prototype._applyClientOptions = function (event) { + var options = this.getOptions(); + var environment = options.environment, release = options.release, dist = options.dist, _a = options.maxValueLength, maxValueLength = _a === void 0 ? 250 : _a; + if (!('environment' in event)) { + event.environment = 'environment' in options ? environment : 'production'; + } + if (event.release === undefined && release !== undefined) { + event.release = release; + } + if (event.dist === undefined && dist !== undefined) { + event.dist = dist; + } + if (event.message) { + event.message = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["truncate"])(event.message, maxValueLength); + } + var exception = event.exception && event.exception.values && event.exception.values[0]; + if (exception && exception.value) { + exception.value = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["truncate"])(exception.value, maxValueLength); + } + var request = event.request; + if (request && request.url) { + request.url = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["truncate"])(request.url, maxValueLength); + } + }; + /** + * This function adds all used integrations to the SDK info in the event. + * @param event The event that will be filled with all integrations. + */ + BaseClient.prototype._applyIntegrationsMetadata = function (event) { + var integrationsArray = Object.keys(this._integrations); + if (integrationsArray.length > 0) { + event.sdk = event.sdk || {}; + event.sdk.integrations = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((event.sdk.integrations || []), integrationsArray); + } + }; + /** + * Tells the backend to send this event + * @param event The Sentry event to send + */ + BaseClient.prototype._sendEvent = function (event) { + this._getBackend().sendEvent(event); + }; + /** + * Processes the event and logs an error in case of rejection + * @param event + * @param hint + * @param scope + */ + BaseClient.prototype._captureEvent = function (event, hint, scope) { + return this._processEvent(event, hint, scope).then(function (finalEvent) { + return finalEvent.event_id; + }, function (reason) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].error(reason); + return undefined; + }); + }; + /** + * Processes an event (either error or message) and sends it to Sentry. + * + * This also adds breadcrumbs and context information to the event. However, + * platform specific meta data (such as the User's IP address) must be added + * by the SDK implementor. + * + * + * @param event The event to send to Sentry. + * @param hint May contain additional information about the original exception. + * @param scope A scope containing event metadata. + * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. + */ + BaseClient.prototype._processEvent = function (event, hint, scope) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/unbound-method + var _a = this.getOptions(), beforeSend = _a.beforeSend, sampleRate = _a.sampleRate; + var transport = this.getTransport(); + function recordLostEvent(outcome, category) { + if (transport.recordLostEvent) { + transport.recordLostEvent(outcome, category); + } + } + if (!this._isEnabled()) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["rejectedSyncPromise"])(new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]('SDK not enabled, will not capture event.')); + } + var isTransaction = event.type === 'transaction'; + // 1.0 === 100% events are sent + // 0.0 === 0% events are sent + // Sampling for transaction happens somewhere else + if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) { + recordLostEvent('sample_rate', 'event'); + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["rejectedSyncPromise"])(new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]("Discarding event because it's not included in the random sample (sampling rate = " + sampleRate + ")")); + } + return this._prepareEvent(event, scope, hint) + .then(function (prepared) { + if (prepared === null) { + recordLostEvent('event_processor', event.type || 'event'); + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]('An event processor returned null, will not send event.'); + } + var isInternalException = hint && hint.data && hint.data.__sentry__ === true; + if (isInternalException || isTransaction || !beforeSend) { + return prepared; + } + var beforeSendResult = beforeSend(prepared, hint); + return _ensureBeforeSendRv(beforeSendResult); + }) + .then(function (processedEvent) { + if (processedEvent === null) { + recordLostEvent('before_send', event.type || 'event'); + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]('`beforeSend` returned `null`, will not send event.'); + } + var session = scope && scope.getSession && scope.getSession(); + if (!isTransaction && session) { + _this._updateSessionFromEvent(session, processedEvent); + } + _this._sendEvent(processedEvent); + return processedEvent; + }) + .then(null, function (reason) { + if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]) { + throw reason; + } + _this.captureException(reason, { + data: { + __sentry__: true, + }, + originalException: reason, + }); + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: " + reason); + }); + }; + /** + * Occupies the client with processing and event + */ + BaseClient.prototype._process = function (promise) { + var _this = this; + this._numProcessing += 1; + void promise.then(function (value) { + _this._numProcessing -= 1; + return value; + }, function (reason) { + _this._numProcessing -= 1; + return reason; + }); + }; + return BaseClient; +}()); + +/** + * Verifies that return value of configured `beforeSend` is of expected type. + */ +function _ensureBeforeSendRv(rv) { + var nullErr = '`beforeSend` method has to return `null` or a valid event.'; + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isThenable"])(rv)) { + return rv.then(function (event) { + if (!(Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(event) || event === null)) { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"](nullErr); + } + return event; + }, function (e) { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]("beforeSend rejected with " + e); + }); + } + else if (!(Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(rv) || rv === null)) { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"](nullErr); + } + return rv; +} +//# sourceMappingURL=baseclient.js.map + +/***/ }), + /***/ "/Izb": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -5856,6 +6322,193 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "/TIq": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reactRouterV4Instrumentation", function() { return reactRouterV4Instrumentation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reactRouterV5Instrumentation", function() { return reactRouterV5Instrumentation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withSentryRouting", function() { return withSentryRouting; }); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("WSEr"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("2mql"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("q1tI"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); + + + + +const _jsxFileName = "/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/reactrouter.tsx"; +// We need to disable eslint no-explict-any because any is required for the +// react-router typings. +/* eslint-disable @typescript-eslint/no-explicit-any */ + +/* eslint-enable @typescript-eslint/no-explicit-any */ + +let activeTransaction; + +function reactRouterV4Instrumentation( + history, + routes, + matchPath, +) { + return createReactRouterInstrumentation(history, 'react-router-v4', routes, matchPath); +} + +function reactRouterV5Instrumentation( + history, + routes, + matchPath, +) { + return createReactRouterInstrumentation(history, 'react-router-v5', routes, matchPath); +} + +function createReactRouterInstrumentation( + history, + name, + allRoutes = [], + matchPath, +) { + function getInitPathName() { + if (history && history.location) { + return history.location.pathname; + } + + if (_sentry_browser__WEBPACK_IMPORTED_MODULE_0__["WINDOW"] && _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].location) { + return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].location.pathname; + } + + return undefined; + } + + /** + * Normalizes a transaction name. Returns the new name as well as the + * source of the transaction. + * + * @param pathname The initial pathname we normalize + */ + function normalizeTransactionName(pathname) { + if (allRoutes.length === 0 || !matchPath) { + return [pathname, 'url']; + } + + const branches = matchRoutes(allRoutes, pathname, matchPath); + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let x = 0; x < branches.length; x++) { + if (branches[x].match.isExact) { + return [branches[x].match.path, 'route']; + } + } + + return [pathname, 'url']; + } + + const tags = { + 'routing.instrumentation': name, + }; + + return (customStartTransaction, startTransactionOnPageLoad = true, startTransactionOnLocationChange = true) => { + const initPathName = getInitPathName(); + if (startTransactionOnPageLoad && initPathName) { + const [name, source] = normalizeTransactionName(initPathName); + activeTransaction = customStartTransaction({ + name, + op: 'pageload', + tags, + metadata: { + source, + }, + }); + } + + if (startTransactionOnLocationChange && history.listen) { + history.listen((location, action) => { + if (action && (action === 'PUSH' || action === 'POP')) { + if (activeTransaction) { + activeTransaction.finish(); + } + + const [name, source] = normalizeTransactionName(location.pathname); + activeTransaction = customStartTransaction({ + name, + op: 'navigation', + tags, + metadata: { + source, + }, + }); + } + }); + } + }; +} + +/** + * Matches a set of routes to a pathname + * Based on implementation from + */ +function matchRoutes( + routes, + pathname, + matchPath, + branch = [], +) { + routes.some(route => { + const match = route.path + ? matchPath(pathname, route) + : branch.length + ? branch[branch.length - 1].match // use parent match + : computeRootMatch(pathname); // use default "root" match + + if (match) { + branch.push({ route, match }); + + if (route.routes) { + matchRoutes(route.routes, pathname, matchPath, branch); + } + } + + return !!match; + }); + + return branch; +} + +function computeRootMatch(pathname) { + return { path: '/', url: '/', params: {}, isExact: pathname === '/' }; +} + +/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */ +function withSentryRouting(Route) { + const componentDisplayName = (Route ).displayName || (Route ).name; + + const WrappedRoute = (props) => { + if (activeTransaction && props && props.computedMatch && props.computedMatch.isExact) { + activeTransaction.setName(props.computedMatch.path, 'route'); + } + + // @ts-ignore Setting more specific React Component typing for `R` generic above + // will break advanced type inference done by react router params: + // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13dc4235c069e25fe7ee16e11f529d909f9f3ff8/types/react-router/index.d.ts#L154-L164 + return react__WEBPACK_IMPORTED_MODULE_2__["createElement"](Route, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 174}} ); + }; + + WrappedRoute.displayName = `sentryRoute(${componentDisplayName})`; + hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_1___default()(WrappedRoute, Route); + // @ts-ignore Setting more specific React Component typing for `R` generic above + // will break advanced type inference done by react router params: + // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13dc4235c069e25fe7ee16e11f529d909f9f3ff8/types/react-router/index.d.ts#L154-L164 + return WrappedRoute; +} +/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */ + + +//# sourceMappingURL=reactrouter.js.map + + /***/ }), /***/ "/Tkk": @@ -5992,79 +6645,82 @@ module.exports = function floor(x) { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BREADCRUMB_INTEGRATION_ID", function() { return BREADCRUMB_INTEGRATION_ID; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Breadcrumbs", function() { return Breadcrumbs; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("PIsB"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("TwdF"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("vzc1"); + + + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -/* eslint-disable max-lines */ +/** JSDoc */ +const BREADCRUMB_INTEGRATION_ID = 'Breadcrumbs'; /** * Default Breadcrumbs instrumentations * TODO: Deprecated - with v6, this will be renamed to `Instrument` */ -var Breadcrumbs = /** @class */ (function () { - /** - * @inheritDoc - */ - function Breadcrumbs(options) { - /** - * @inheritDoc - */ - this.name = Breadcrumbs.id; - this._options = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ console: true, dom: true, fetch: true, history: true, sentry: true, xhr: true }, options); - } - /** - * Create a breadcrumb of `sentry` from the events themselves - */ - Breadcrumbs.prototype.addSentryBreadcrumb = function (event) { - if (!this._options.sentry) { - return; - } - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ - category: "sentry." + (event.type === 'transaction' ? 'transaction' : 'event'), - event_id: event.event_id, - level: event.level, - message: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["getEventDescription"])(event), - }, { - event: event, - }); - }; - /** - * Instrument browser built-ins w/ breadcrumb capturing - * - Console API - * - DOM API (click/typing) - * - XMLHttpRequest API - * - Fetch API - * - History API - */ - Breadcrumbs.prototype.setupOnce = function () { - if (this._options.console) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('console', _consoleBreadcrumb); - } - if (this._options.dom) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('dom', _domBreadcrumb(this._options.dom)); - } - if (this._options.xhr) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('xhr', _xhrBreadcrumb); - } - if (this._options.fetch) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('fetch', _fetchBreadcrumb); - } - if (this._options.history) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('history', _historyBreadcrumb); - } +class Breadcrumbs { + /** + * @inheritDoc + */ + static __initStatic() {this.id = BREADCRUMB_INTEGRATION_ID;} + + /** + * @inheritDoc + */ + __init() {this.name = Breadcrumbs.id;} + + /** + * Options of the breadcrumbs integration. + */ + // This field is public, because we use it in the browser client to check if the `sentry` option is enabled. + + /** + * @inheritDoc + */ + constructor(options) {;Breadcrumbs.prototype.__init.call(this); + this.options = { + console: true, + dom: true, + fetch: true, + history: true, + sentry: true, + xhr: true, + ...options, }; - /** - * @inheritDoc - */ - Breadcrumbs.id = 'Breadcrumbs'; - return Breadcrumbs; -}()); + } + + /** + * Instrument browser built-ins w/ breadcrumb capturing + * - Console API + * - DOM API (click/typing) + * - XMLHttpRequest API + * - Fetch API + * - History API + */ + setupOnce() { + if (this.options.console) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addInstrumentationHandler"])('console', _consoleBreadcrumb); + } + if (this.options.dom) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addInstrumentationHandler"])('dom', _domBreadcrumb(this.options.dom)); + } + if (this.options.xhr) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addInstrumentationHandler"])('xhr', _xhrBreadcrumb); + } + if (this.options.fetch) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addInstrumentationHandler"])('fetch', _fetchBreadcrumb); + } + if (this.options.history) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addInstrumentationHandler"])('history', _historyBreadcrumb); + } + } +} Breadcrumbs.__initStatic(); /** * A HOC that creaes a function that creates breadcrumbs from DOM API calls. @@ -6072,159 +6728,204 @@ var Breadcrumbs = /** @class */ (function () { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function _domBreadcrumb(dom) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - function _innerDomBreadcrumb(handlerData) { - var target; - var keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined; - if (typeof keyAttrs === 'string') { - keyAttrs = [keyAttrs]; - } - // Accessing event.target can throw (see getsentry/raven-js#838, #768) - try { - target = handlerData.event.target - ? Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["htmlTreeAsString"])(handlerData.event.target, keyAttrs) - : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["htmlTreeAsString"])(handlerData.event, keyAttrs); - } - catch (e) { - target = '<unknown>'; - } - if (target.length === 0) { - return; - } - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ - category: "ui." + handlerData.name, - message: target, - }, { - event: handlerData.event, - name: handlerData.name, - global: handlerData.global, - }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function _innerDomBreadcrumb(handlerData) { + let target; + let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined; + + if (typeof keyAttrs === 'string') { + keyAttrs = [keyAttrs]; } - return _innerDomBreadcrumb; + + // Accessing event.target can throw (see getsentry/raven-js#838, #768) + try { + target = handlerData.event.target + ? Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["htmlTreeAsString"])(handlerData.event.target , keyAttrs) + : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["htmlTreeAsString"])(handlerData.event , keyAttrs); + } catch (e) { + target = '<unknown>'; + } + + if (target.length === 0) { + return; + } + + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().addBreadcrumb( + { + category: `ui.${handlerData.name}`, + message: target, + }, + { + event: handlerData.event, + name: handlerData.name, + global: handlerData.global, + }, + ); + } + + return _innerDomBreadcrumb; } + /** * Creates breadcrumbs from console API calls */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function _consoleBreadcrumb(handlerData) { - var breadcrumb = { - category: 'console', - data: { - arguments: handlerData.args, - logger: 'console', - }, - level: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["severityFromString"])(handlerData.level), - message: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["safeJoin"])(handlerData.args, ' '), - }; - if (handlerData.level === 'assert') { - if (handlerData.args[0] === false) { - breadcrumb.message = "Assertion failed: " + (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["safeJoin"])(handlerData.args.slice(1), ' ') || 'console.assert'); - breadcrumb.data.arguments = handlerData.args.slice(1); - } - else { - // Don't capture a breadcrumb for passed assertions - return; - } + // This is a hack to fix a Vue3-specific bug that causes an infinite loop of + // console warnings. This happens when a Vue template is rendered with + // an undeclared variable, which we try to stringify, ultimately causing + // Vue to issue another warning which repeats indefinitely. + // see: https://github.com/getsentry/sentry-javascript/pull/6010 + // see: https://github.com/getsentry/sentry-javascript/issues/5916 + for (let i = 0; i < handlerData.args.length; i++) { + if (handlerData.args[i] === 'ref=Ref<') { + handlerData.args[i + 1] = 'viewRef'; + break; } - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb(breadcrumb, { - input: handlerData.args, - level: handlerData.level, - }); + } + const breadcrumb = { + category: 'console', + data: { + arguments: handlerData.args, + logger: 'console', + }, + level: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["severityLevelFromString"])(handlerData.level), + message: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["safeJoin"])(handlerData.args, ' '), + }; + + if (handlerData.level === 'assert') { + if (handlerData.args[0] === false) { + breadcrumb.message = `Assertion failed: ${Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["safeJoin"])(handlerData.args.slice(1), ' ') || 'console.assert'}`; + breadcrumb.data.arguments = handlerData.args.slice(1); + } else { + // Don't capture a breadcrumb for passed assertions + return; + } + } + + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().addBreadcrumb(breadcrumb, { + input: handlerData.args, + level: handlerData.level, + }); } + /** * Creates breadcrumbs from XHR API calls */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function _xhrBreadcrumb(handlerData) { - if (handlerData.endTimestamp) { - // We only capture complete, non-sentry requests - if (handlerData.xhr.__sentry_own_request__) { - return; - } - var _a = handlerData.xhr.__sentry_xhr__ || {}, method = _a.method, url = _a.url, status_code = _a.status_code, body = _a.body; - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ - category: 'xhr', - data: { - method: method, - url: url, - status_code: status_code, - }, - type: 'http', - }, { - xhr: handlerData.xhr, - input: body, - }); - return; + if (handlerData.endTimestamp) { + // We only capture complete, non-sentry requests + if (handlerData.xhr.__sentry_own_request__) { + return; } + + const { method, url, status_code, body } = handlerData.xhr.__sentry_xhr__ || {}; + + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().addBreadcrumb( + { + category: 'xhr', + data: { + method, + url, + status_code, + }, + type: 'http', + }, + { + xhr: handlerData.xhr, + input: body, + }, + ); + + return; + } } + /** * Creates breadcrumbs from fetch API calls */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function _fetchBreadcrumb(handlerData) { - // We only capture complete fetch requests - if (!handlerData.endTimestamp) { - return; - } - if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') { - // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests) - return; - } - if (handlerData.error) { - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ - category: 'fetch', - data: handlerData.fetchData, - level: _sentry_types__WEBPACK_IMPORTED_MODULE_2__["Severity"].Error, - type: 'http', - }, { - data: handlerData.error, - input: handlerData.args, - }); - } - else { - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ - category: 'fetch', - data: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData.fetchData), { status_code: handlerData.response.status }), - type: 'http', - }, { - input: handlerData.args, - response: handlerData.response, - }); - } + // We only capture complete fetch requests + if (!handlerData.endTimestamp) { + return; + } + + if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') { + // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests) + return; + } + + if (handlerData.error) { + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().addBreadcrumb( + { + category: 'fetch', + data: handlerData.fetchData, + level: 'error', + type: 'http', + }, + { + data: handlerData.error, + input: handlerData.args, + }, + ); + } else { + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().addBreadcrumb( + { + category: 'fetch', + data: { + ...handlerData.fetchData, + status_code: handlerData.response.status, + }, + type: 'http', + }, + { + input: handlerData.args, + response: handlerData.response, + }, + ); + } } + /** * Creates breadcrumbs from history API calls */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function _historyBreadcrumb(handlerData) { - var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["getGlobalObject"])(); - var from = handlerData.from; - var to = handlerData.to; - var parsedLoc = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["parseUrl"])(global.location.href); - var parsedFrom = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["parseUrl"])(from); - var parsedTo = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["parseUrl"])(to); - // Initial pushState doesn't provide `from` information - if (!parsedFrom.path) { - parsedFrom = parsedLoc; - } - // Use only the path component of the URL if the URL matches the current - // document (almost all the time when using pushState) - if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) { - to = parsedTo.relative; - } - if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) { - from = parsedFrom.relative; - } - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ - category: 'navigation', - data: { - from: from, - to: to, - }, - }); + let from = handlerData.from; + let to = handlerData.to; + const parsedLoc = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["parseUrl"])(_helpers_js__WEBPACK_IMPORTED_MODULE_2__["WINDOW"].location.href); + let parsedFrom = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["parseUrl"])(from); + const parsedTo = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["parseUrl"])(to); + + // Initial pushState doesn't provide `from` information + if (!parsedFrom.path) { + parsedFrom = parsedLoc; + } + + // Use only the path component of the URL if the URL matches the current + // document (almost all the time when using pushState) + if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) { + to = parsedTo.relative; + } + if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) { + from = parsedFrom.relative; + } + + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().addBreadcrumb({ + category: 'navigation', + data: { + from, + to, + }, + }); } + + //# sourceMappingURL=breadcrumbs.js.map + /***/ }), /***/ "/aQN": @@ -11784,6 +12485,131 @@ var SearchService = /*#__PURE__*/function () { /***/ }), +/***/ "/gRg": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return truncate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "snipLine", function() { return snipLine; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeJoin", function() { return safeJoin; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMatchingPattern", function() { return isMatchingPattern; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeStringForRegex", function() { return escapeStringForRegex; }); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("fUgN"); + +/** + * Truncates given string to the maximum characters count + * + * @param str An object that contains serializable values + * @param max Maximum number of characters in truncated string (0 = unlimited) + * @returns string Encoded + */ +function truncate(str, max) { + if (max === void 0) { max = 0; } + if (typeof str !== 'string' || max === 0) { + return str; + } + return str.length <= max ? str : str.substr(0, max) + "..."; +} +/** + * This is basically just `trim_line` from + * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67 + * + * @param str An object that contains serializable values + * @param max Maximum number of characters in truncated string + * @returns string Encoded + */ +function snipLine(line, colno) { + var newLine = line; + var lineLength = newLine.length; + if (lineLength <= 150) { + return newLine; + } + if (colno > lineLength) { + // eslint-disable-next-line no-param-reassign + colno = lineLength; + } + var start = Math.max(colno - 60, 0); + if (start < 5) { + start = 0; + } + var 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; +} +/** + * Join values in array + * @param input array of values to be joined together + * @param delimiter string to be placed in-between values + * @returns Joined values + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function safeJoin(input, delimiter) { + if (!Array.isArray(input)) { + return ''; + } + var output = []; + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (var i = 0; i < input.length; i++) { + var value = input[i]; + try { + output.push(String(value)); + } + catch (e) { + output.push('[value cannot be serialized]'); + } + } + return output.join(delimiter); +} +/** + * Checks if the value matches a regex or includes the string + * @param value The string value to be checked against + * @param pattern Either a regex or a string that must be contained in value + */ +function isMatchingPattern(value, pattern) { + if (!Object(_is__WEBPACK_IMPORTED_MODULE_0__["isString"])(value)) { + return false; + } + if (Object(_is__WEBPACK_IMPORTED_MODULE_0__["isRegExp"])(pattern)) { + return pattern.test(value); + } + if (typeof pattern === 'string') { + return value.indexOf(pattern) !== -1; + } + return false; +} +/** + * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to + * `new RegExp()`. + * + * Based on https://github.com/sindresorhus/escape-string-regexp. Vendored to a) reduce the size by skipping the runtime + * type-checking, and b) ensure it gets down-compiled for old versions of Node (the published package only supports Node + * 12+). + * + * @param regexString The string to escape + * @returns An version of the string with all special regex characters escaped + */ +function escapeStringForRegex(regexString) { + // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems + // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20. + return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d'); +} +//# sourceMappingURL=string.js.map + +/***/ }), + /***/ "/jK0": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -14116,6 +14942,233 @@ if (false) {} /* harmony default export */ __webpack_exports__["default"] = (ExpansionPanelContext); +/***/ }), + +/***/ "0G76": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mongo", function() { return Mongo; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("QXPM"); + + + + +// This allows us to use the same array for both defaults options and the type itself. +// (note `as const` at the end to make it a union of string literal types (i.e. "a" | "b" | ... ) +// and not just a string[]) + +const OPERATIONS = [ + 'aggregate', // aggregate(pipeline, options, callback) + 'bulkWrite', // bulkWrite(operations, options, callback) + 'countDocuments', // countDocuments(query, options, callback) + 'createIndex', // createIndex(fieldOrSpec, options, callback) + 'createIndexes', // createIndexes(indexSpecs, options, callback) + 'deleteMany', // deleteMany(filter, options, callback) + 'deleteOne', // deleteOne(filter, options, callback) + 'distinct', // distinct(key, query, options, callback) + 'drop', // drop(options, callback) + 'dropIndex', // dropIndex(indexName, options, callback) + 'dropIndexes', // dropIndexes(options, callback) + 'estimatedDocumentCount', // estimatedDocumentCount(options, callback) + 'find', // find(query, options, callback) + 'findOne', // findOne(query, options, callback) + 'findOneAndDelete', // findOneAndDelete(filter, options, callback) + 'findOneAndReplace', // findOneAndReplace(filter, replacement, options, callback) + 'findOneAndUpdate', // findOneAndUpdate(filter, update, options, callback) + 'indexes', // indexes(options, callback) + 'indexExists', // indexExists(indexes, options, callback) + 'indexInformation', // indexInformation(options, callback) + 'initializeOrderedBulkOp', // initializeOrderedBulkOp(options, callback) + 'insertMany', // insertMany(docs, options, callback) + 'insertOne', // insertOne(doc, options, callback) + 'isCapped', // isCapped(options, callback) + 'mapReduce', // mapReduce(map, reduce, options, callback) + 'options', // options(options, callback) + 'parallelCollectionScan', // parallelCollectionScan(options, callback) + 'rename', // rename(newName, options, callback) + 'replaceOne', // replaceOne(filter, doc, options, callback) + 'stats', // stats(options, callback) + 'updateMany', // updateMany(filter, update, options, callback) + 'updateOne', // updateOne(filter, update, options, callback) +] ; + +// All of the operations above take `options` and `callback` as their final parameters, but some of them +// take additional parameters as well. For those operations, this is a map of +// { <operation name>: [<names of additional parameters>] }, as a way to know what to call the operation's +// positional arguments when we add them to the span's `data` object later +const OPERATION_SIGNATURES + + = { + // aggregate intentionally not included because `pipeline` arguments are too complex to serialize well + // see https://github.com/getsentry/sentry-javascript/pull/3102 + bulkWrite: ['operations'], + countDocuments: ['query'], + createIndex: ['fieldOrSpec'], + createIndexes: ['indexSpecs'], + deleteMany: ['filter'], + deleteOne: ['filter'], + distinct: ['key', 'query'], + dropIndex: ['indexName'], + find: ['query'], + findOne: ['query'], + findOneAndDelete: ['filter'], + findOneAndReplace: ['filter', 'replacement'], + findOneAndUpdate: ['filter', 'update'], + indexExists: ['indexes'], + insertMany: ['docs'], + insertOne: ['doc'], + mapReduce: ['map', 'reduce'], + rename: ['newName'], + replaceOne: ['filter', 'doc'], + updateMany: ['filter', 'update'], + updateOne: ['filter', 'update'], +}; + +/** Tracing integration for mongo package */ +class Mongo { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Mongo';} + + /** + * @inheritDoc + */ + __init() {this.name = Mongo.id;} + + /** + * @inheritDoc + */ + constructor(options = {}) {;Mongo.prototype.__init.call(this); + this._operations = Array.isArray(options.operations) ? options.operations : (OPERATIONS ); + this._describeOperations = 'describeOperations' in options ? options.describeOperations : true; + this._useMongoose = !!options.useMongoose; + } + + /** + * @inheritDoc + */ + setupOnce(_, getCurrentHub) { + const moduleName = this._useMongoose ? 'mongoose' : 'mongodb'; + const pkg = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["loadModule"])(moduleName); + + if (!pkg) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error(`Mongo Integration was unable to require \`${moduleName}\` package.`); + return; + } + + if (Object(_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__["shouldDisableAutoInstrumentation"])(getCurrentHub)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('Mongo Integration is skipped because of instrumenter configuration.'); + return; + } + + this._instrumentOperations(pkg.Collection, this._operations, getCurrentHub); + } + + /** + * Patches original collection methods + */ + _instrumentOperations(collection, operations, getCurrentHub) { + operations.forEach((operation) => this._patchOperation(collection, operation, getCurrentHub)); + } + + /** + * Patches original collection to utilize our tracing functionality + */ + _patchOperation(collection, operation, getCurrentHub) { + if (!(operation in collection.prototype)) return; + + const getSpanContext = this._getSpanContextFromOperationArguments.bind(this); + + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(collection.prototype, operation, function (orig) { + return function ( ...args) { + const lastArg = args[args.length - 1]; + const scope = getCurrentHub().getScope(); + const parentSpan = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]); + + // Check if the operation was passed a callback. (mapReduce requires a different check, as + // its (non-callback) arguments can also be functions.) + if (typeof lastArg !== 'function' || (operation === 'mapReduce' && args.length === 2)) { + const span = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5(getSpanContext(this, operation, args))]); + const maybePromise = orig.call(this, ...args) ; + + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isThenable"])(maybePromise)) { + return maybePromise.then((res) => { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]); + return res; + }); + } else { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]); + return maybePromise; + } + } + + const span = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([parentSpan, 'optionalAccess', _10 => _10.startChild, 'call', _11 => _11(getSpanContext(this, operation, args.slice(0, -1)))]); + return orig.call(this, ...args.slice(0, -1), function (err, result) { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]); + lastArg(err, result); + }); + }; + }); + } + + /** + * Form a SpanContext based on the user input to a given operation. + */ + _getSpanContextFromOperationArguments( + collection, + operation, + args, + ) { + const data = { + collectionName: collection.collectionName, + dbName: collection.dbName, + namespace: collection.namespace, + }; + const spanContext = { + op: 'db', + description: operation, + data, + }; + + // If the operation takes no arguments besides `options` and `callback`, or if argument + // collection is disabled for this operation, just return early. + const signature = OPERATION_SIGNATURES[operation]; + const shouldDescribe = Array.isArray(this._describeOperations) + ? this._describeOperations.includes(operation) + : this._describeOperations; + + if (!signature || !shouldDescribe) { + return spanContext; + } + + try { + // Special case for `mapReduce`, as the only one accepting functions as arguments. + if (operation === 'mapReduce') { + const [map, reduce] = args ; + data[signature[0]] = typeof map === 'string' ? map : map.name || '<anonymous>'; + data[signature[1]] = typeof reduce === 'string' ? reduce : reduce.name || '<anonymous>'; + } else { + for (let i = 0; i < signature.length; i++) { + data[signature[i]] = JSON.stringify(args[i]); + } + } + } catch (_oO) { + // no-empty + } + + return spanContext; + } +}Mongo.__initStatic(); + + +//# sourceMappingURL=mongo.js.map + + /***/ }), /***/ "0GWl": @@ -15037,6 +16090,338 @@ module.exports = intersection; module.exports = __webpack_require__("43KI").Transform +/***/ }), + +/***/ "0YSH": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addRequestDataToEvent", function() { return addRequestDataToEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addRequestDataToTransaction", function() { return addRequestDataToTransaction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractPathForTransaction", function() { return extractPathForTransaction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractRequestData", function() { return extractRequestData; }); +/* harmony import */ var _buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9AQC"); +/* harmony import */ var _normalize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Fffm"); +/* harmony import */ var _url_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("DTqw"); + + + + + +const DEFAULT_INCLUDES = { + ip: false, + request: true, + transaction: true, + user: true, +}; +const DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url']; +const DEFAULT_USER_INCLUDES = ['id', 'username', 'email']; + +/** + * Sets parameterized route as transaction name e.g.: `GET /users/:id` + * Also adds more context data on the transaction from the request + */ +function addRequestDataToTransaction( + transaction, + req, + deps, +) { + if (!transaction) return; + if (!transaction.metadata.source || transaction.metadata.source === 'url') { + // Attempt to grab a parameterized route off of the request + transaction.setName(...extractPathForTransaction(req, { path: true, method: true })); + } + transaction.setData('url', req.originalUrl || req.url); + if (req.baseUrl) { + transaction.setData('baseUrl', req.baseUrl); + } + transaction.setData('query', extractQueryParams(req, deps)); +} + +/** + * Extracts a complete and parameterized path from the request object and uses it to construct transaction name. + * If the parameterized transaction name cannot be extracted, we fall back to the raw URL. + * + * Additionally, this function determines and returns the transaction name source + * + * eg. GET /mountpoint/user/:id + * + * @param req A request object + * @param options What to include in the transaction name (method, path, or a custom route name to be + * used instead of the request's route) + * + * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url') + */ +function extractPathForTransaction( + req, + options = {}, +) { + const method = req.method && req.method.toUpperCase(); + + let path = ''; + let source = 'url'; + + // Check to see if there's a parameterized route we can use (as there is in Express) + if (options.customRoute || req.route) { + path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`; + source = 'route'; + } + + // Otherwise, just take the original URL + else if (req.originalUrl || req.url) { + path = Object(_url_js__WEBPACK_IMPORTED_MODULE_3__["stripUrlQueryAndFragment"])(req.originalUrl || req.url || ''); + } + + let name = ''; + if (options.method && method) { + name += method; + } + if (options.method && options.path) { + name += ' '; + } + if (options.path && path) { + name += path; + } + + return [name, source]; +} + +/** JSDoc */ +function extractTransaction(req, type) { + switch (type) { + case 'path': { + return extractPathForTransaction(req, { path: true })[0]; + } + case 'handler': { + return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || '<anonymous>'; + } + case 'methodPath': + default: { + return extractPathForTransaction(req, { path: true, method: true })[0]; + } + } +} + +/** JSDoc */ +function extractUserData( + user + +, + keys, +) { + const extractedUser = {}; + const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES; + + attributes.forEach(key => { + if (user && key in user) { + extractedUser[key] = user[key]; + } + }); + + return extractedUser; +} + +/** + * Normalize data from the request object, accounting for framework differences. + * + * @param req The request object from which to extract data + * @param options.include An optional array of keys to include in the normalized data. Defaults to + * DEFAULT_REQUEST_INCLUDES if not provided. + * @param options.deps Injected, platform-specific dependencies + * @returns An object containing normalized request data + */ +function extractRequestData( + req, + options + +, +) { + const { include = DEFAULT_REQUEST_INCLUDES, deps } = options || {}; + const requestData = {}; + + // headers: + // node, express, koa, nextjs: req.headers + const headers = (req.headers || {}) + +; + // method: + // node, express, koa, nextjs: req.method + const method = req.method; + // host: + // express: req.hostname in > 4 and req.host in < 4 + // koa: req.host + // node, nextjs: req.headers.host + const host = req.hostname || req.host || headers.host || '<no host>'; + // protocol: + // node, nextjs: <n/a> + // express, koa: req.protocol + const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http'; + // url (including path and query string): + // node, express: req.originalUrl + // koa, nextjs: req.url + const originalUrl = req.originalUrl || req.url || ''; + // absolute url + const absoluteUrl = `${protocol}://${host}${originalUrl}`; + include.forEach(key => { + switch (key) { + case 'headers': { + requestData.headers = headers; + break; + } + case 'method': { + requestData.method = method; + break; + } + case 'url': { + requestData.url = absoluteUrl; + break; + } + case 'cookies': { + // cookies: + // node, express, koa: req.headers.cookie + // vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + requestData.cookies = + // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can + // come off in v8 + req.cookies || (headers.cookie && deps && deps.cookie && deps.cookie.parse(headers.cookie)) || {}; + break; + } + case 'query_string': { + // query string: + // node: req.url (raw) + // express, koa, nextjs: req.query + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + requestData.query_string = extractQueryParams(req, deps); + break; + } + case 'data': { + if (method === 'GET' || method === 'HEAD') { + break; + } + // body data: + // express, koa, nextjs: req.body + // + // when using node by itself, you have to read the incoming stream(see + // https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know + // where they're going to store the final result, so they'll have to capture this data themselves + if (req.body !== undefined) { + requestData.data = Object(_is_js__WEBPACK_IMPORTED_MODULE_1__["isString"])(req.body) ? req.body : JSON.stringify(Object(_normalize_js__WEBPACK_IMPORTED_MODULE_2__["normalize"])(req.body)); + } + break; + } + default: { + if ({}.hasOwnProperty.call(req, key)) { + requestData[key] = (req )[key]; + } + } + } + }); + + return requestData; +} + +/** + * Options deciding what parts of the request to use when enhancing an event + */ + +/** + * Add data from the given request to the given event + * + * @param event The event to which the request data will be added + * @param req Request object + * @param options.include Flags to control what data is included + * @param options.deps Injected platform-specific dependencies + * @hidden + */ +function addRequestDataToEvent( + event, + req, + options, +) { + const include = { + ...DEFAULT_INCLUDES, + ...Object(_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([options, 'optionalAccess', _ => _.include]), + }; + + if (include.request) { + const extractedRequestData = Array.isArray(include.request) + ? extractRequestData(req, { include: include.request, deps: Object(_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([options, 'optionalAccess', _2 => _2.deps]) }) + : extractRequestData(req, { deps: Object(_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([options, 'optionalAccess', _3 => _3.deps]) }); + + event.request = { + ...event.request, + ...extractedRequestData, + }; + } + + if (include.user) { + const extractedUser = req.user && Object(_is_js__WEBPACK_IMPORTED_MODULE_1__["isPlainObject"])(req.user) ? extractUserData(req.user, include.user) : {}; + + if (Object.keys(extractedUser).length) { + event.user = { + ...event.user, + ...extractedUser, + }; + } + } + + // client ip: + // node, nextjs: req.socket.remoteAddress + // express, koa: req.ip + if (include.ip) { + const ip = req.ip || (req.socket && req.socket.remoteAddress); + if (ip) { + event.user = { + ...event.user, + ip_address: ip, + }; + } + } + + if (include.transaction && !event.transaction) { + // TODO do we even need this anymore? + // TODO make this work for nextjs + event.transaction = extractTransaction(req, include.transaction); + } + + return event; +} + +function extractQueryParams( + req, + deps, +) { + // url (including path and query string): + // node, express: req.originalUrl + // koa, nextjs: req.url + let originalUrl = req.originalUrl || req.url || ''; + + if (!originalUrl) { + return; + } + + // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and + // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use. + if (originalUrl.startsWith('/')) { + originalUrl = `http://dogs.are.great${originalUrl}`; + } + + return ( + req.query || + (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) || + // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node + (deps && deps.url && deps.url.parse(originalUrl).query) || + undefined + ); +} + + +//# sourceMappingURL=requestdata.js.map + + /***/ }), /***/ "0YWM": @@ -15105,43 +16490,6 @@ function createCaseFirst(methodName) { module.exports = createCaseFirst; -/***/ }), - -/***/ "0bfL": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeNewFetchTransport", function() { return makeNewFetchTransport; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("2TjN"); - - - -/** - * Creates a Transport that uses the Fetch API to send events to Sentry. - */ -function makeNewFetchTransport(options, nativeFetch) { - if (nativeFetch === void 0) { nativeFetch = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getNativeFetchImplementation"])(); } - function makeRequest(request) { - var requestOptions = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ body: request.body, method: 'POST', referrerPolicy: 'origin' }, options.requestOptions); - return nativeFetch(options.url, requestOptions).then(function (response) { - return response.text().then(function (body) { return ({ - body: body, - headers: { - 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'), - 'retry-after': response.headers.get('Retry-After'), - }, - reason: response.statusText, - statusCode: response.status, - }); }); - }); - } - return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["createTransport"])({ bufferSize: options.bufferSize }, makeRequest); -} -//# sourceMappingURL=new-fetch.js.map - /***/ }), /***/ "0d5s": @@ -19592,6 +20940,43 @@ var brown = { }; /* harmony default export */ __webpack_exports__["default"] = (brown); +/***/ }), + +/***/ "11UV": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_createStarExport", function() { return _createStarExport; }); +/** + * Copy properties from an object into `exports`. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * + * @param obj The object containing the properties to copy. + */ +function _createStarExport(obj) { + Object.keys(obj) + .filter(key => key !== 'default' && key !== '__esModule' && !(key in exports)) + .forEach(key => (exports[key] = obj[key])); +} + +// Sucrase version: +// function _createStarExport(obj) { +// Object.keys(obj) +// .filter(key => key !== 'default' && key !== '__esModule') +// .forEach(key => { +// if (exports.hasOwnProperty(key)) { +// return; +// } +// Object.defineProperty(exports, key, { enumerable: true, get: () => obj[key] }); +// }); +// } + + +//# sourceMappingURL=_createStarExport.js.map + + /***/ }), /***/ "16Al": @@ -21729,6 +23114,104 @@ var SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'crit /***/ }), +/***/ "1WlT": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONSOLE_LEVELS", function() { return CONSOLE_LEVELS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consoleSandbox", function() { return consoleSandbox; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return logger; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("yCCt"); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ETVo"); + + + +// TODO: Implement different loggers for different environments +var global = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); +/** Prefix for logging strings */ +var PREFIX = 'Sentry Logger '; +var CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert']; +/** + * Temporarily disable sentry console instrumentations. + * + * @param callback The function to run against the original `console` messages + * @returns The results of the callback + */ +function consoleSandbox(callback) { + var global = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); + if (!('console' in global)) { + return callback(); + } + var originalConsole = global.console; + var wrappedLevels = {}; + // Restore all wrapped console methods + CONSOLE_LEVELS.forEach(function (level) { + // TODO(v7): Remove this check as it's only needed for Node 6 + var originalWrappedFunc = originalConsole[level] && originalConsole[level].__sentry_original__; + if (level in global.console && originalWrappedFunc) { + wrappedLevels[level] = originalConsole[level]; + originalConsole[level] = originalWrappedFunc; + } + }); + try { + return callback(); + } + finally { + // Revert restoration to wrapped state + Object.keys(wrappedLevels).forEach(function (level) { + originalConsole[level] = wrappedLevels[level]; + }); + } +} +function makeLogger() { + var enabled = false; + var logger = { + enable: function () { + enabled = true; + }, + disable: function () { + enabled = false; + }, + }; + if (_flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"]) { + CONSOLE_LEVELS.forEach(function (name) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + logger[name] = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (enabled) { + consoleSandbox(function () { + var _a; + (_a = global.console)[name].apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([PREFIX + "[" + name + "]:"], args)); + }); + } + }; + }); + } + else { + CONSOLE_LEVELS.forEach(function (name) { + logger[name] = function () { return undefined; }; + }); + } + return logger; +} +// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used +var logger; +if (_flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"]) { + logger = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalSingleton"])('logger', makeLogger); +} +else { + logger = makeLogger(); +} + +//# sourceMappingURL=logger.js.map + +/***/ }), + /***/ "1afE": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -23366,6 +24849,41 @@ var DialogContentText = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["forward name: 'MuiDialogContentText' })(DialogContentText)); +/***/ }), + +/***/ "2Egv": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_interopNamespaceDefaultOnly", function() { return _interopNamespaceDefaultOnly; }); +/** + * Wrap a module in an object, as the value under the key `default`. + * + * Adapted from Rollup (https://github.com/rollup/rollup) + * + * @param requireResult The result of calling `require` on a module + * @returns An object containing the key-value pair (`default`, `requireResult`) + */ +function _interopNamespaceDefaultOnly(requireResult) { + return { + __proto__: null, + default: requireResult, + }; +} + +// Rollup version +// function _interopNamespaceDefaultOnly(e) { +// return { +// __proto__: null, +// 'default': e +// }; +// } + + +//# sourceMappingURL=_interopNamespaceDefaultOnly.js.map + + /***/ }), /***/ "2GTP": @@ -23587,92 +25105,61 @@ module.exports = __webpack_require__("zLkG").f('iterator'); "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FetchTransport", function() { return FetchTransport; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeFetchTransport", function() { return makeFetchTransport; }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); -/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("DTjN"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("2TjN"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("2TjN"); -/** `fetch` based transport */ -var FetchTransport = /** @class */ (function (_super) { - Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FetchTransport, _super); - function FetchTransport(options, fetchImpl) { - if (fetchImpl === void 0) { fetchImpl = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["getNativeFetchImplementation"])(); } - var _this = _super.call(this, options) || this; - _this._fetch = fetchImpl; - return _this; - } - /** - * @param sentryRequest Prepared SentryRequest to be delivered - * @param originalPayload Original payload used to create SentryRequest - */ - FetchTransport.prototype._sendRequest = function (sentryRequest, originalPayload) { - var _this = this; - // eslint-disable-next-line deprecation/deprecation - if (this._isRateLimited(sentryRequest.type)) { - this.recordLostEvent('ratelimit_backoff', sentryRequest.type); - return Promise.reject({ - event: originalPayload, - type: sentryRequest.type, - // eslint-disable-next-line deprecation/deprecation - reason: "Transport for " + sentryRequest.type + " requests locked till " + this._disabledUntil(sentryRequest.type) + " due to too many requests.", - status: 429, - }); - } - var options = { - body: sentryRequest.body, - method: 'POST', - // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default' - // (see https://caniuse.com/#feat=referrer-policy), - // it doesn't. And it throws an exception instead of ignoring this parameter... - // REF: https://github.com/getsentry/raven-js/issues/1233 - referrerPolicy: (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["supportsReferrerPolicy"])() ? 'origin' : ''), - }; - if (this.options.fetchParameters !== undefined) { - Object.assign(options, this.options.fetchParameters); - } - if (this.options.headers !== undefined) { - options.headers = this.options.headers; - } - return this._buffer - .add(function () { - return new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"](function (resolve, reject) { - void _this._fetch(sentryRequest.url, options) - .then(function (response) { - var headers = { - 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'), - 'retry-after': response.headers.get('Retry-After'), - }; - _this._handleResponse({ - requestType: sentryRequest.type, - response: response, - headers: headers, - resolve: resolve, - reject: reject, - }); - }) - .catch(reject); - }); - }) - .then(undefined, function (reason) { - // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError. - if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SentryError"]) { - _this.recordLostEvent('queue_overflow', sentryRequest.type); - } - else { - _this.recordLostEvent('network_error', sentryRequest.type); - } - throw reason; - }); +/** + * Creates a Transport that uses the Fetch API to send events to Sentry. + */ +function makeFetchTransport( + options, + nativeFetch = Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["getNativeFetchImplementation"])(), +) { + function makeRequest(request) { + const requestOptions = { + body: request.body, + method: 'POST', + referrerPolicy: 'origin', + headers: options.headers, + // Outgoing requests are usually cancelled when navigating to a different page, causing a "TypeError: Failed to + // fetch" error and sending a "network_error" client-outcome - in Chrome, the request status shows "(cancelled)". + // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're + // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions). + // Gotchas: + // - `keepalive` isn't supported by Firefox + // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch), a request with `keepalive: true` + // and a content length of > 64 kibibytes returns a network error. We will therefore only activate the flag when + // we're below that limit. + keepalive: request.body.length <= 65536, + ...options.fetchOptions, }; - return FetchTransport; -}(_base__WEBPACK_IMPORTED_MODULE_2__["BaseTransport"])); + + try { + return nativeFetch(options.url, requestOptions).then(response => ({ + statusCode: response.status, + headers: { + 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'), + 'retry-after': response.headers.get('Retry-After'), + }, + })); + } catch (e) { + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["clearCachedFetchImplementation"])(); + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["rejectedSyncPromise"])(e); + } + } + + return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["createTransport"])(options, makeRequest); +} + //# sourceMappingURL=fetch.js.map + /***/ }), /***/ "2OiF": @@ -23808,14 +25295,15 @@ var TwoFactorAuthenticatorResponse = /*#__PURE__*/function (_BaseResponse) { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearCachedFetchImplementation", function() { return clearCachedFetchImplementation; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNativeFetchImplementation", function() { return getNativeFetchImplementation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sendReport", function() { return sendReport; }); /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("3Uor"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("vzc1"); -var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])(); -var cachedFetchImpl; + +let cachedFetchImpl = undefined; + /** * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers. * Whenever someone wraps the Fetch API and returns the wrong promise chain, @@ -23855,62 +25343,49 @@ var cachedFetchImpl; * Safari: resource blocked by content blocker */ function getNativeFetchImplementation() { - if (cachedFetchImpl) { - return cachedFetchImpl; - } - /* eslint-disable @typescript-eslint/unbound-method */ - // Fast path to avoid DOM I/O - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isNativeFetch"])(global.fetch)) { - return (cachedFetchImpl = global.fetch.bind(global)); - } - var document = global.document; - var fetchImpl = global.fetch; - // eslint-disable-next-line deprecation/deprecation - if (document && typeof document.createElement === 'function') { - try { - var sandbox = document.createElement('iframe'); - sandbox.hidden = true; - document.head.appendChild(sandbox); - var contentWindow = sandbox.contentWindow; - if (contentWindow && contentWindow.fetch) { - fetchImpl = contentWindow.fetch; - } - document.head.removeChild(sandbox); - } - catch (e) { - _flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"] && - _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e); - } + if (cachedFetchImpl) { + return cachedFetchImpl; + } + + /* eslint-disable @typescript-eslint/unbound-method */ + + // Fast path to avoid DOM I/O + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isNativeFetch"])(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].fetch)) { + return (cachedFetchImpl = _helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].fetch.bind(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"])); + } + + const document = _helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].document; + let fetchImpl = _helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].fetch; + // eslint-disable-next-line deprecation/deprecation + if (document && typeof document.createElement === 'function') { + try { + const sandbox = document.createElement('iframe'); + sandbox.hidden = true; + document.head.appendChild(sandbox); + const contentWindow = sandbox.contentWindow; + if (contentWindow && contentWindow.fetch) { + fetchImpl = contentWindow.fetch; + } + document.head.removeChild(sandbox); + } catch (e) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e); } - return (cachedFetchImpl = fetchImpl.bind(global)); - /* eslint-enable @typescript-eslint/unbound-method */ + } + + return (cachedFetchImpl = fetchImpl.bind(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"])); + /* eslint-enable @typescript-eslint/unbound-method */ } -/** - * Sends sdk client report using sendBeacon or fetch as a fallback if available - * - * @param url report endpoint - * @param body report payload - */ -function sendReport(url, body) { - var isRealNavigator = Object.prototype.toString.call(global && global.navigator) === '[object Navigator]'; - var hasSendBeacon = isRealNavigator && typeof global.navigator.sendBeacon === 'function'; - if (hasSendBeacon) { - // Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch - var sendBeacon = global.navigator.sendBeacon.bind(global.navigator); - return sendBeacon(url, body); - } - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["supportsFetch"])()) { - var fetch_1 = getNativeFetchImplementation(); - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["forget"])(fetch_1(url, { - body: body, - method: 'POST', - credentials: 'omit', - keepalive: true, - })); - } + +/** Clears cached fetch impl */ +function clearCachedFetchImplementation() { + cachedFetchImpl = undefined; } + + //# sourceMappingURL=utils.js.map + /***/ }), /***/ "2V/z": @@ -24150,6 +25625,43 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "2bdC": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerErrorInstrumentation", function() { return registerErrorInstrumentation; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("FGHR"); + + + +/** + * Configures global error listeners + */ +function registerErrorInstrumentation() { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["addInstrumentationHandler"])('error', errorCallback); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["addInstrumentationHandler"])('unhandledrejection', errorCallback); +} + +/** + * If an error or unhandled promise occurs, we mark the active transaction as failed + */ +function errorCallback() { + const activeTransaction = Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__["getActiveTransaction"])(); + if (activeTransaction) { + const status = 'internal_error'; + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(`[Tracing] Transaction: ${status} -> Global error occured`); + activeTransaction.setStatus(status); + } +} + + +//# sourceMappingURL=errors.js.map + + /***/ }), /***/ "2bil": @@ -26157,6 +27669,47 @@ __webpack_require__.r(__webpack_exports__); }); +/***/ }), + +/***/ "2vUq": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRACEPARENT_REGEXP", function() { return TRACEPARENT_REGEXP; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractTraceparentData", function() { return extractTraceparentData; }); +var TRACEPARENT_REGEXP = new RegExp('^[ \\t]*' + // whitespace + '([0-9a-f]{32})?' + // trace_id + '-?([0-9a-f]{16})?' + // span_id + '-?([01])?' + // sampled + '[ \\t]*$'); +/** + * Extract transaction context data from a `sentry-trace` header. + * + * @param traceparent Traceparent string + * + * @returns Object containing data from the header, or undefined if traceparent string is malformed + */ +function extractTraceparentData(traceparent) { + var matches = traceparent.match(TRACEPARENT_REGEXP); + if (matches) { + var parentSampled = void 0; + if (matches[3] === '1') { + parentSampled = true; + } + else if (matches[3] === '0') { + parentSampled = false; + } + return { + traceId: matches[1], + parentSampled: parentSampled, + parentSpanId: matches[2], + }; + } + return undefined; +} +//# sourceMappingURL=tracing.js.map + /***/ }), /***/ "2yTz": @@ -26402,40 +27955,6 @@ function textFunction(value) { }); -/***/ }), - -/***/ "31uO": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoopTransport", function() { return NoopTransport; }); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); - -/** Noop transport */ -var NoopTransport = /** @class */ (function () { - function NoopTransport() { - } - /** - * @inheritDoc - */ - NoopTransport.prototype.sendEvent = function (_) { - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["resolvedSyncPromise"])({ - reason: 'NoopTransport: Event has been skipped because no Dsn is configured.', - status: 'skipped', - }); - }; - /** - * @inheritDoc - */ - NoopTransport.prototype.close = function (_) { - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["resolvedSyncPromise"])(true); - }; - return NoopTransport; -}()); - -//# sourceMappingURL=noop.js.map - /***/ }), /***/ "36Cw": @@ -27483,22 +29002,30 @@ UnlockForm.defaultProps = { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "close", function() { return close; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultIntegrations", function() { return defaultIntegrations; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return flush; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forceLoad", function() { return forceLoad; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "init", function() { return init; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showReportDialog", function() { return showReportDialog; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastEventId", function() { return lastEventId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forceLoad", function() { return forceLoad; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return onLoad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return flush; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "close", function() { return close; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showReportDialog", function() { return showReportDialog; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TwdF"); -/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("kWuB"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("3Uor"); -/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("vzc1"); -/* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("4kjc"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _client_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("kWuB"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("vzc1"); +/* harmony import */ var _integrations_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("4kjc"); +/* harmony import */ var _stack_parsers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("xHdX"); +/* harmony import */ var _transports_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("nXHh"); +/* harmony import */ var _integrations_trycatch_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("wytX"); +/* harmony import */ var _integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("/ZhC"); +/* harmony import */ var _integrations_globalhandlers_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("UBq+"); +/* harmony import */ var _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("ZAf6"); +/* harmony import */ var _integrations_dedupe_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("WBcU"); +/* harmony import */ var _integrations_httpcontext_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("fL16"); +/* harmony import */ var _transports_fetch_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("2O0U"); +/* harmony import */ var _transports_xhr_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("MT+3"); @@ -27506,16 +29033,26 @@ __webpack_require__.r(__webpack_exports__); -var defaultIntegrations = [ - new _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Integrations"].InboundFilters(), - new _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Integrations"].FunctionToString(), - new _integrations__WEBPACK_IMPORTED_MODULE_6__["TryCatch"](), - new _integrations__WEBPACK_IMPORTED_MODULE_6__["Breadcrumbs"](), - new _integrations__WEBPACK_IMPORTED_MODULE_6__["GlobalHandlers"](), - new _integrations__WEBPACK_IMPORTED_MODULE_6__["LinkedErrors"](), - new _integrations__WEBPACK_IMPORTED_MODULE_6__["Dedupe"](), - new _integrations__WEBPACK_IMPORTED_MODULE_6__["UserAgent"](), + + + + + + + + + +const defaultIntegrations = [ + new _sentry_core__WEBPACK_IMPORTED_MODULE_0__["Integrations"].InboundFilters(), + new _sentry_core__WEBPACK_IMPORTED_MODULE_0__["Integrations"].FunctionToString(), + new _integrations_trycatch_js__WEBPACK_IMPORTED_MODULE_7__["TryCatch"](), + new _integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_8__["Breadcrumbs"](), + new _integrations_globalhandlers_js__WEBPACK_IMPORTED_MODULE_9__["GlobalHandlers"](), + new _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_10__["LinkedErrors"](), + new _integrations_dedupe_js__WEBPACK_IMPORTED_MODULE_11__["Dedupe"](), + new _integrations_httpcontext_js__WEBPACK_IMPORTED_MODULE_12__["HttpContext"](), ]; + /** * The Sentry Browser SDK Client. * @@ -27573,71 +29110,109 @@ var defaultIntegrations = [ * * @see {@link BrowserOptions} for documentation on configuration options. */ -function init(options) { - if (options === void 0) { options = {}; } - if (options.defaultIntegrations === undefined) { - options.defaultIntegrations = defaultIntegrations; - } - if (options.release === undefined) { - var window_1 = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); - // This supports the variable that sentry-webpack-plugin injects - if (window_1.SENTRY_RELEASE && window_1.SENTRY_RELEASE.id) { - options.release = window_1.SENTRY_RELEASE.id; - } - } - if (options.autoSessionTracking === undefined) { - options.autoSessionTracking = true; - } - if (options.sendClientReports === undefined) { - options.sendClientReports = true; - } - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["initAndBind"])(_client__WEBPACK_IMPORTED_MODULE_3__["BrowserClient"], options); - if (options.autoSessionTracking) { - startSessionTracking(); +function init(options = {}) { + if (options.defaultIntegrations === undefined) { + options.defaultIntegrations = defaultIntegrations; + } + if (options.release === undefined) { + // This supports the variable that sentry-webpack-plugin injects + if (_helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].SENTRY_RELEASE && _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].SENTRY_RELEASE.id) { + options.release = _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].SENTRY_RELEASE.id; } + } + if (options.autoSessionTracking === undefined) { + options.autoSessionTracking = true; + } + if (options.sendClientReports === undefined) { + options.sendClientReports = true; + } + + const clientOptions = { + ...options, + stackParser: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["stackParserFromStackParserOptions"])(options.stackParser || _stack_parsers_js__WEBPACK_IMPORTED_MODULE_5__["defaultStackParser"]), + integrations: Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getIntegrationsToSetup"])(options), + transport: options.transport || (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["supportsFetch"])() ? _transports_fetch_js__WEBPACK_IMPORTED_MODULE_13__["makeFetchTransport"] : _transports_xhr_js__WEBPACK_IMPORTED_MODULE_14__["makeXHRTransport"]), + }; + + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["initAndBind"])(_client_js__WEBPACK_IMPORTED_MODULE_2__["BrowserClient"], clientOptions); + + if (options.autoSessionTracking) { + startSessionTracking(); + } } + /** * Present the user with a report dialog. * * @param options Everything is optional, we try to fetch all info need from the global scope. */ -function showReportDialog(options) { - if (options === void 0) { options = {}; } - var hub = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])(); - var scope = hub.getScope(); - if (scope) { - options.user = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, scope.getUser()), options.user); - } - if (!options.eventId) { - options.eventId = hub.lastEventId(); - } - var client = hub.getClient(); - if (client) { - client.showReportDialog(options); - } +function showReportDialog(options = {}, hub = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])()) { + // doesn't work without a document (React Native) + if (!_helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].document) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Global document not defined in showReportDialog call'); + return; + } + + const { client, scope } = hub.getStackTop(); + const dsn = options.dsn || (client && client.getDsn()); + if (!dsn) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('DSN not configured for showReportDialog call'); + return; + } + + if (scope) { + options.user = { + ...scope.getUser(), + ...options.user, + }; + } + + if (!options.eventId) { + options.eventId = hub.lastEventId(); + } + + const script = _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].document.createElement('script'); + script.async = true; + script.src = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getReportDialogEndpoint"])(dsn, options); + + if (options.onLoad) { + // eslint-disable-next-line @typescript-eslint/unbound-method + script.onload = options.onLoad; + } + + const injectionPoint = _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].document.head || _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].document.body; + if (injectionPoint) { + injectionPoint.appendChild(script); + } else { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Not injecting report dialog. No injection point found in HTML'); + } } + /** * This is the getter for lastEventId. * * @returns The last event id of a captured event. */ function lastEventId() { - return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().lastEventId(); + return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().lastEventId(); } + /** * This function is here to be API compatible with the loader. * @hidden */ function forceLoad() { - // Noop + // Noop } + /** * This function is here to be API compatible with the loader. * @hidden */ function onLoad(callback) { - callback(); + callback(); } + /** * Call `flush()` on the current client, if there is one. See {@link Client.flush}. * @@ -27647,13 +29222,14 @@ function onLoad(callback) { * doesn't (or if there's no client defined). */ function flush(timeout) { - var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().getClient(); - if (client) { - return client.flush(timeout); - } - _flags__WEBPACK_IMPORTED_MODULE_4__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Cannot flush events. No client defined.'); - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["resolvedSyncPromise"])(false); + const client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().getClient(); + if (client) { + return client.flush(timeout); + } + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('Cannot flush events. No client defined.'); + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["resolvedSyncPromise"])(false); } + /** * Call `close()` on the current client, if there is one. See {@link Client.close}. * @@ -27663,13 +29239,14 @@ function flush(timeout) { * doesn't (or if there's no client defined). */ function close(timeout) { - var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().getClient(); - if (client) { - return client.close(timeout); - } - _flags__WEBPACK_IMPORTED_MODULE_4__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Cannot flush events and disable SDK. No client defined.'); - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["resolvedSyncPromise"])(false); + const client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().getClient(); + if (client) { + return client.close(timeout); + } + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('Cannot flush events and disable SDK. No client defined.'); + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["resolvedSyncPromise"])(false); } + /** * Wrap code within a try/catch block so the SDK is able to capture errors. * @@ -27679,48 +29256,55 @@ function close(timeout) { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function wrap(fn) { - return Object(_helpers__WEBPACK_IMPORTED_MODULE_5__["wrap"])(fn)(); + return Object(_helpers_js__WEBPACK_IMPORTED_MODULE_3__["wrap"])(fn)(); } + function startSessionOnHub(hub) { - hub.startSession({ ignoreDuration: true }); - hub.captureSession(); + hub.startSession({ ignoreDuration: true }); + hub.captureSession(); } + /** * Enable automatic Session Tracking for the initial page load. */ function startSessionTracking() { - var window = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); - var document = window.document; - if (typeof document === 'undefined') { - _flags__WEBPACK_IMPORTED_MODULE_4__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Session tracking in non-browser environment with @sentry/browser is not supported.'); - return; - } - var hub = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])(); - // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and - // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are - // pinned at the same version in package.json, but there are edge cases where it's possible. See - // https://github.com/getsentry/sentry-javascript/issues/3207 and - // https://github.com/getsentry/sentry-javascript/issues/3234 and - // https://github.com/getsentry/sentry-javascript/issues/3278. - if (!hub.captureSession) { - return; + if (typeof _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].document === 'undefined') { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('Session tracking in non-browser environment with @sentry/browser is not supported.'); + return; + } + + const hub = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])(); + + // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and + // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are + // pinned at the same version in package.json, but there are edge cases where it's possible. See + // https://github.com/getsentry/sentry-javascript/issues/3207 and + // https://github.com/getsentry/sentry-javascript/issues/3234 and + // https://github.com/getsentry/sentry-javascript/issues/3278. + if (!hub.captureSession) { + return; + } + + // The session duration for browser sessions does not track a meaningful + // concept that can be used as a metric. + // Automatically captured sessions are akin to page views, and thus we + // discard their duration. + startSessionOnHub(hub); + + // We want to create a session for every navigation as well + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addInstrumentationHandler"])('history', ({ from, to }) => { + // Don't create an additional session for the initial route or if the location did not change + if (!(from === undefined || from === to)) { + startSessionOnHub(Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])()); } - // The session duration for browser sessions does not track a meaningful - // concept that can be used as a metric. - // Automatically captured sessions are akin to page views, and thus we - // discard their duration. - startSessionOnHub(hub); - // We want to create a session for every navigation as well - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addInstrumentationHandler"])('history', function (_a) { - var from = _a.from, to = _a.to; - // Don't create an additional session for the initial route or if the location did not change - if (!(from === undefined || from === to)) { - startSessionOnHub(Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])()); - } - }); + }); } + + //# sourceMappingURL=sdk.js.map + /***/ }), /***/ "3CvY": @@ -28551,163 +30135,97 @@ var CollectionRequest = function CollectionRequest(collection) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "API", function() { return API; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initAPIDetails", function() { return initAPIDetails; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStoreEndpointWithUrlEncodedAuth", function() { return getStoreEndpointWithUrlEncodedAuth; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeEndpointWithUrlEncodedAuth", function() { return getEnvelopeEndpointWithUrlEncodedAuth; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRequestHeaders", function() { return getRequestHeaders; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getReportDialogEndpoint", function() { return getReportDialogEndpoint; }); /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); -var SENTRY_API_VERSION = '7'; -/** - * Helper class to provide urls, headers and metadata that can be used to form - * different types of requests to Sentry endpoints. - * Supports both envelopes and regular event requests. - * - * @deprecated Please use APIDetails - **/ -var API = /** @class */ (function () { - /** Create a new instance of API */ - function API(dsn, metadata, tunnel) { - if (metadata === void 0) { metadata = {}; } - this.dsn = dsn; - this._dsnObject = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makeDsn"])(dsn); - this.metadata = metadata; - this._tunnel = tunnel; - } - /** Returns the Dsn object. */ - API.prototype.getDsn = function () { - return this._dsnObject; - }; - /** Does this transport force envelopes? */ - API.prototype.forceEnvelope = function () { - return !!this._tunnel; - }; - /** Returns the prefix to construct Sentry ingestion API endpoints. */ - API.prototype.getBaseApiEndpoint = function () { - return getBaseApiEndpoint(this._dsnObject); - }; - /** Returns the store endpoint URL. */ - API.prototype.getStoreEndpoint = function () { - return getStoreEndpoint(this._dsnObject); - }; - /** - * Returns the store endpoint URL with auth in the query string. - * - * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. - */ - API.prototype.getStoreEndpointWithUrlEncodedAuth = function () { - return getStoreEndpointWithUrlEncodedAuth(this._dsnObject); - }; - /** - * Returns the envelope endpoint URL with auth in the query string. - * - * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. - */ - API.prototype.getEnvelopeEndpointWithUrlEncodedAuth = function () { - return getEnvelopeEndpointWithUrlEncodedAuth(this._dsnObject, this._tunnel); - }; - return API; -}()); -/** Initializes API Details */ -function initAPIDetails(dsn, metadata, tunnel) { - return { - initDsn: dsn, - metadata: metadata || {}, - dsn: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makeDsn"])(dsn), - tunnel: tunnel, - }; -} +const SENTRY_API_VERSION = '7'; + /** Returns the prefix to construct Sentry ingestion API endpoints. */ function getBaseApiEndpoint(dsn) { - var protocol = dsn.protocol ? dsn.protocol + ":" : ''; - var port = dsn.port ? ":" + dsn.port : ''; - return protocol + "//" + dsn.host + port + (dsn.path ? "/" + dsn.path : '') + "/api/"; + const protocol = dsn.protocol ? `${dsn.protocol}:` : ''; + const port = dsn.port ? `:${dsn.port}` : ''; + return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`; } + /** Returns the ingest API endpoint for target. */ -function _getIngestEndpoint(dsn, target) { - return "" + getBaseApiEndpoint(dsn) + dsn.projectId + "/" + target + "/"; +function _getIngestEndpoint(dsn) { + return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`; } + /** Returns a URL-encoded string with auth config suitable for a query string. */ -function _encodedAuth(dsn) { - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["urlEncode"])({ - // We send only the minimum set of required information. See - // https://github.com/getsentry/sentry-javascript/issues/2572. - sentry_key: dsn.publicKey, - sentry_version: SENTRY_API_VERSION, - }); -} -/** Returns the store endpoint URL. */ -function getStoreEndpoint(dsn) { - return _getIngestEndpoint(dsn, 'store'); -} -/** - * Returns the store endpoint URL with auth in the query string. - * - * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. - */ -function getStoreEndpointWithUrlEncodedAuth(dsn) { - return getStoreEndpoint(dsn) + "?" + _encodedAuth(dsn); -} -/** Returns the envelope endpoint URL. */ -function _getEnvelopeEndpoint(dsn) { - return _getIngestEndpoint(dsn, 'envelope'); +function _encodedAuth(dsn, sdkInfo) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["urlEncode"])({ + // We send only the minimum set of required information. See + // https://github.com/getsentry/sentry-javascript/issues/2572. + sentry_key: dsn.publicKey, + sentry_version: SENTRY_API_VERSION, + ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }), + }); } + /** * Returns the envelope endpoint URL with auth in the query string. * * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. */ -function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel) { - return tunnel ? tunnel : _getEnvelopeEndpoint(dsn) + "?" + _encodedAuth(dsn); -} -/** - * Returns an object that can be used in request headers. - * This is needed for node and the old /store endpoint in sentry - */ -function getRequestHeaders(dsn, clientName, clientVersion) { - // CHANGE THIS to use metadata but keep clientName and clientVersion compatible - var header = ["Sentry sentry_version=" + SENTRY_API_VERSION]; - header.push("sentry_client=" + clientName + "/" + clientVersion); - header.push("sentry_key=" + dsn.publicKey); - if (dsn.pass) { - header.push("sentry_secret=" + dsn.pass); - } - return { - 'Content-Type': 'application/json', - 'X-Sentry-Auth': header.join(', '), - }; +function getEnvelopeEndpointWithUrlEncodedAuth( + dsn, + // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below + // options: ClientOptions = {} as ClientOptions, + tunnelOrOptions = {} , +) { + // TODO (v8): Use this code instead + // const { tunnel, _metadata = {} } = options; + // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`; + + const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel; + const sdkInfo = + typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk; + + return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`; } + /** Returns the url to the report dialog endpoint. */ -function getReportDialogEndpoint(dsnLike, dialogOptions) { - var dsn = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makeDsn"])(dsnLike); - var endpoint = getBaseApiEndpoint(dsn) + "embed/error-page/"; - var encodedOptions = "dsn=" + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dsnToString"])(dsn); - for (var key in dialogOptions) { - if (key === 'dsn') { - continue; - } - if (key === 'user') { - if (!dialogOptions.user) { - continue; - } - if (dialogOptions.user.name) { - encodedOptions += "&name=" + encodeURIComponent(dialogOptions.user.name); - } - if (dialogOptions.user.email) { - encodedOptions += "&email=" + encodeURIComponent(dialogOptions.user.email); - } - } - else { - encodedOptions += "&" + encodeURIComponent(key) + "=" + encodeURIComponent(dialogOptions[key]); - } +function getReportDialogEndpoint( + dsnLike, + dialogOptions + +, +) { + const dsn = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makeDsn"])(dsnLike); + const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`; + + let encodedOptions = `dsn=${Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dsnToString"])(dsn)}`; + for (const key in dialogOptions) { + if (key === 'dsn') { + continue; } - return endpoint + "?" + encodedOptions; + + if (key === 'user') { + const user = dialogOptions.user; + if (!user) { + continue; + } + if (user.name) { + encodedOptions += `&name=${encodeURIComponent(user.name)}`; + } + if (user.email) { + encodedOptions += `&email=${encodeURIComponent(user.email)}`; + } + } else { + encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`; + } + } + + return `${endpoint}?${encodedOptions}`; } + + //# sourceMappingURL=api.js.map + /***/ }), /***/ "3O+N": @@ -29072,31 +30590,6 @@ module.exports = function(originalModule) { }; -/***/ }), - -/***/ "3Uor": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IS_DEBUG_BUILD", function() { return IS_DEBUG_BUILD; }); -/* - * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking - * for users. - * - * Debug flags need to be declared in each package individually and must not be imported across package boundaries, - * because some build tools have trouble tree-shaking imported guards. - * - * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder. - * - * Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during - * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not - * replaced. - */ -/** Flag that is true for debug builds, false otherwise. */ -var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__; -//# sourceMappingURL=flags.js.map - /***/ }), /***/ "3Uuo": @@ -30337,6 +31830,34 @@ module.exports = Object.freeze({ /***/ }), +/***/ "3pfK": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SentryError", function() { return SentryError; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("LQFB"); + + +/** An error emitted by Sentry SDKs and related utilities. */ +var SentryError = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SentryError, _super); + function SentryError(message) { + var _newTarget = this.constructor; + var _this = _super.call(this, message) || this; + _this.message = message; + _this.name = _newTarget.prototype.constructor.name; + Object(_polyfill__WEBPACK_IMPORTED_MODULE_1__["setPrototypeOf"])(_this, _newTarget.prototype); + return _this; + } + return SentryError; +}(Error)); + +//# sourceMappingURL=error.js.map + +/***/ }), + /***/ "3r7G": /***/ (function(module, exports, __webpack_require__) { @@ -33163,6 +34684,364 @@ var SelectionReadOnlyResponse = /*#__PURE__*/function (_BaseResponse) { /***/ }), +/***/ "4E6N": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return isError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isErrorEvent", function() { return isErrorEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDOMError", function() { return isDOMError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDOMException", function() { return isDOMException; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPrimitive", function() { return isPrimitive; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return isPlainObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEvent", function() { return isEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return isElement; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return isRegExp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isThenable", function() { return isThenable; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSyntheticEvent", function() { return isSyntheticEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return isNaN; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInstanceOf", function() { return isInstanceOf; }); +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +// eslint-disable-next-line @typescript-eslint/unbound-method +var objectToString = Object.prototype.toString; +/** + * Checks whether given value's type is one of a few Error or Error-like + * {@link isError}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +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, ty) { + return objectToString.call(wat) === "[object " + ty + "]"; +} +/** + * Checks whether given value's type is ErrorEvent + * {@link isErrorEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isErrorEvent(wat) { + return isBuiltin(wat, 'ErrorEvent'); +} +/** + * Checks whether given value's type is DOMError + * {@link isDOMError}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isDOMError(wat) { + return isBuiltin(wat, 'DOMError'); +} +/** + * Checks whether given value's type is DOMException + * {@link isDOMException}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isDOMException(wat) { + return isBuiltin(wat, 'DOMException'); +} +/** + * Checks whether given value's type is a string + * {@link isString}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isString(wat) { + return isBuiltin(wat, 'String'); +} +/** + * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol) + * {@link isPrimitive}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isPrimitive(wat) { + return wat === null || (typeof wat !== 'object' && typeof wat !== 'function'); +} +/** + * Checks whether given value's type is an object literal + * {@link isPlainObject}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isPlainObject(wat) { + return isBuiltin(wat, 'Object'); +} +/** + * Checks whether given value's type is an Event instance + * {@link isEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isEvent(wat) { + return typeof Event !== 'undefined' && isInstanceOf(wat, Event); +} +/** + * Checks whether given value's type is an Element instance + * {@link isElement}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isElement(wat) { + return typeof Element !== 'undefined' && isInstanceOf(wat, Element); +} +/** + * Checks whether given value's type is an regexp + * {@link isRegExp}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isRegExp(wat) { + return isBuiltin(wat, 'RegExp'); +} +/** + * Checks whether given value has a then function. + * @param wat A value to be checked. + */ +function isThenable(wat) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return Boolean(wat && wat.then && typeof wat.then === 'function'); +} +/** + * Checks whether given value's type is a SyntheticEvent + * {@link isSyntheticEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isSyntheticEvent(wat) { + return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat; +} +/** + * Checks whether given value is NaN + * {@link isNaN}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isNaN(wat) { + return typeof wat === 'number' && wat !== wat; +} +/** + * Checks whether given value's type is an instance of provided constructor. + * {@link isInstanceOf}. + * + * @param wat A value to be checked. + * @param base A constructor to be used in a check. + * @returns A boolean representing the result. + */ +function isInstanceOf(wat, base) { + try { + return wat instanceof base; + } + catch (_e) { + return false; + } +} +//# sourceMappingURL=is.js.map + +/***/ }), + +/***/ "4HQh": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return resolve; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return relative; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizePath", function() { return normalizePath; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAbsolute", function() { return isAbsolute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "join", function() { return join; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return dirname; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return basename; }); +// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript +// https://raw.githubusercontent.com/calvinmetcalf/rollup-plugin-node-builtins/master/src/es6/path.js +/** JSDoc */ +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } + else if (last === '..') { + parts.splice(i, 1); + // eslint-disable-next-line no-plusplus + up++; + } + else if (up) { + parts.splice(i, 1); + // eslint-disable-next-line no-plusplus + up--; + } + } + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + // eslint-disable-next-line no-plusplus + for (; up--; up) { + parts.unshift('..'); + } + } + return parts; +} +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/; +/** JSDoc */ +function splitPath(filename) { + var parts = splitPathRe.exec(filename); + return parts ? parts.slice(1) : []; +} +// path.resolve([from ...], to) +// posix version +/** JSDoc */ +function resolve() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var resolvedPath = ''; + var resolvedAbsolute = false; + for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = i >= 0 ? args[i] : '/'; + // Skip empty entries + if (!path) { + continue; + } + resolvedPath = path + "/" + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + // Normalize the path + resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/'); + return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; +} +/** JSDoc */ +function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') { + break; + } + } + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') { + break; + } + } + if (start > end) { + return []; + } + return arr.slice(start, end - start + 1); +} +// path.relative(from, to) +// posix version +/** JSDoc */ +function relative(from, to) { + /* eslint-disable no-param-reassign */ + from = resolve(from).substr(1); + to = resolve(to).substr(1); + /* eslint-enable no-param-reassign */ + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + return outputParts.join('/'); +} +// path.normalize(path) +// posix version +/** JSDoc */ +function normalizePath(path) { + var isPathAbsolute = isAbsolute(path); + var trailingSlash = path.substr(-1) === '/'; + // Normalize the path + var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/'); + if (!normalizedPath && !isPathAbsolute) { + normalizedPath = '.'; + } + if (normalizedPath && trailingSlash) { + normalizedPath += '/'; + } + return (isPathAbsolute ? '/' : '') + normalizedPath; +} +// posix version +/** JSDoc */ +function isAbsolute(path) { + return path.charAt(0) === '/'; +} +// posix version +/** JSDoc */ +function join() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return normalizePath(args.join('/')); +} +/** JSDoc */ +function dirname(path) { + var result = splitPath(path); + var root = result[0]; + var dir = result[1]; + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + return root + dir; +} +/** JSDoc */ +function basename(path, ext) { + var f = splitPath(path)[2]; + if (ext && f.substr(ext.length * -1) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +} +//# sourceMappingURL=path.js.map + +/***/ }), + /***/ "4Hym": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -33936,21 +35815,23 @@ module.exports = partialRight(merge, mergeBuffer); "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsErrorEvent", function() { return supportsErrorEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNativeFetch", function() { return isNativeFetch; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsDOMError", function() { return supportsDOMError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsDOMException", function() { return supportsDOMException; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsErrorEvent", function() { return supportsErrorEvent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsFetch", function() { return supportsFetch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNativeFetch", function() { return isNativeFetch; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsHistory", function() { return supportsHistory; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsNativeFetch", function() { return supportsNativeFetch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsReportingObserver", function() { return supportsReportingObserver; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsReferrerPolicy", function() { return supportsReferrerPolicy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsHistory", function() { return supportsHistory; }); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("NDfa"); -/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("z+RT"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("8LbN"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsReportingObserver", function() { return supportsReportingObserver; }); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8LbN"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("rbyU"); +// eslint-disable-next-line deprecation/deprecation +const WINDOW = Object(_worldwide_js__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + /** * Tells whether current environment supports ErrorEvent objects * {@link supportsErrorEvent}. @@ -33958,14 +35839,14 @@ __webpack_require__.r(__webpack_exports__); * @returns Answer to the given question. */ function supportsErrorEvent() { - try { - new ErrorEvent(''); - return true; - } - catch (e) { - return false; - } + try { + new ErrorEvent(''); + return true; + } catch (e) { + return false; + } } + /** * Tells whether current environment supports DOMError objects * {@link supportsDOMError}. @@ -33973,17 +35854,17 @@ function supportsErrorEvent() { * @returns Answer to the given question. */ function supportsDOMError() { - try { - // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError': - // 1 argument required, but only 0 present. - // @ts-ignore It really needs 1 argument, not 0. - new DOMError(''); - return true; - } - catch (e) { - return false; - } + try { + // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError': + // 1 argument required, but only 0 present. + // @ts-ignore It really needs 1 argument, not 0. + new DOMError(''); + return true; + } catch (e) { + return false; + } } + /** * Tells whether current environment supports DOMException objects * {@link supportsDOMException}. @@ -33991,14 +35872,14 @@ function supportsDOMError() { * @returns Answer to the given question. */ function supportsDOMException() { - try { - new DOMException(''); - return true; - } - catch (e) { - return false; - } + try { + new DOMException(''); + return true; + } catch (e) { + return false; + } } + /** * Tells whether current environment supports Fetch API * {@link supportsFetch}. @@ -34006,26 +35887,27 @@ function supportsDOMException() { * @returns Answer to the given question. */ function supportsFetch() { - if (!('fetch' in Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])())) { - return false; - } - try { - new Headers(); - new Request(''); - new Response(); - return true; - } - catch (e) { - return false; - } + if (!('fetch' in WINDOW)) { + return false; + } + + try { + new Headers(); + new Request('http://www.example.com'); + new Response(); + return true; + } catch (e) { + return false; + } } /** * isNativeFetch checks if the given function is a native implementation of fetch() */ // eslint-disable-next-line @typescript-eslint/ban-types function isNativeFetch(func) { - return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); + return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); } + /** * Tells whether current environment supports Fetch API natively * {@link supportsNativeFetch}. @@ -34033,38 +35915,40 @@ function isNativeFetch(func) { * @returns true if `window.fetch` is natively implemented, false otherwise */ function supportsNativeFetch() { - if (!supportsFetch()) { - return false; - } - var global = Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); - // Fast path to avoid DOM I/O - // eslint-disable-next-line @typescript-eslint/unbound-method - if (isNativeFetch(global.fetch)) { - return true; - } - // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension) - // so create a "pure" iframe to see if that has native fetch - var result = false; - var doc = global.document; - // eslint-disable-next-line deprecation/deprecation - if (doc && typeof doc.createElement === 'function') { - try { - var sandbox = doc.createElement('iframe'); - sandbox.hidden = true; - doc.head.appendChild(sandbox); - if (sandbox.contentWindow && sandbox.contentWindow.fetch) { - // eslint-disable-next-line @typescript-eslint/unbound-method - result = isNativeFetch(sandbox.contentWindow.fetch); - } - doc.head.removeChild(sandbox); - } - catch (err) { - _flags__WEBPACK_IMPORTED_MODULE_0__["IS_DEBUG_BUILD"] && - _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err); - } + if (!supportsFetch()) { + return false; + } + + // Fast path to avoid DOM I/O + // eslint-disable-next-line @typescript-eslint/unbound-method + if (isNativeFetch(WINDOW.fetch)) { + return true; + } + + // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension) + // so create a "pure" iframe to see if that has native fetch + let result = false; + const doc = WINDOW.document; + // eslint-disable-next-line deprecation/deprecation + if (doc && typeof (doc.createElement ) === 'function') { + try { + const sandbox = doc.createElement('iframe'); + sandbox.hidden = true; + doc.head.appendChild(sandbox); + if (sandbox.contentWindow && sandbox.contentWindow.fetch) { + // eslint-disable-next-line @typescript-eslint/unbound-method + result = isNativeFetch(sandbox.contentWindow.fetch); + } + doc.head.removeChild(sandbox); + } catch (err) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _logger_js__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err); } - return result; + } + + return result; } + /** * Tells whether current environment supports ReportingObserver API * {@link supportsReportingObserver}. @@ -34072,8 +35956,9 @@ function supportsNativeFetch() { * @returns Answer to the given question. */ function supportsReportingObserver() { - return 'ReportingObserver' in Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + return 'ReportingObserver' in WINDOW; } + /** * Tells whether current environment supports Referrer Policy API * {@link supportsReferrerPolicy}. @@ -34081,23 +35966,25 @@ function supportsReportingObserver() { * @returns Answer to the given question. */ function supportsReferrerPolicy() { - // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default' - // (see https://caniuse.com/#feat=referrer-policy), - // it doesn't. And it throws an exception instead of ignoring this parameter... - // REF: https://github.com/getsentry/raven-js/issues/1233 - if (!supportsFetch()) { - return false; - } - try { - new Request('_', { - referrerPolicy: 'origin', - }); - return true; - } - catch (e) { - return false; - } + // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default' + // (see https://caniuse.com/#feat=referrer-policy), + // it doesn't. And it throws an exception instead of ignoring this parameter... + // REF: https://github.com/getsentry/raven-js/issues/1233 + + if (!supportsFetch()) { + return false; + } + + try { + new Request('_', { + referrerPolicy: 'origin' , + }); + return true; + } catch (e) { + return false; + } } + /** * Tells whether current environment supports History API * {@link supportsHistory}. @@ -34105,20 +35992,23 @@ function supportsReferrerPolicy() { * @returns Answer to the given question. */ function supportsHistory() { - // NOTE: in Chrome App environment, touching history.pushState, *even inside - // a try/catch block*, will cause Chrome to output an error to console.error - // borrowed from: https://github.com/angular/angular.js/pull/13945/files - var global = Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); - /* eslint-disable @typescript-eslint/no-unsafe-member-access */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var chrome = global.chrome; - var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime; - /* eslint-enable @typescript-eslint/no-unsafe-member-access */ - var hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState; - return !isChromePackagedApp && hasHistoryApi; + // NOTE: in Chrome App environment, touching history.pushState, *even inside + // a try/catch block*, will cause Chrome to output an error to console.error + // borrowed from: https://github.com/angular/angular.js/pull/13945/files + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const chrome = (WINDOW ).chrome; + const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime; + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState; + + return !isChromePackagedApp && hasHistoryApi; } + + //# sourceMappingURL=supports.js.map + /***/ }), /***/ "4Toj": @@ -35559,6 +37449,199 @@ module.exports = Document; /***/ }), +/***/ "4YnS": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSessionEnvelope", function() { return createSessionEnvelope; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sessionToSentryRequest", function() { return sessionToSentryRequest; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEventEnvelope", function() { return createEventEnvelope; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventToSentryRequest", function() { return eventToSentryRequest; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Um2S"); +/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("W/Py"); + + + +/** Extract sdk info from from the API metadata */ +function getSdkMetadataForEnvelopeHeader(api) { + if (!api.metadata || !api.metadata.sdk) { + return; + } + var _a = api.metadata.sdk, name = _a.name, version = _a.version; + return { name: name, version: version }; +} +/** + * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key. + * Merge with existing data if any. + **/ +function enhanceEventWithSdkInfo(event, sdkInfo) { + if (!sdkInfo) { + return event; + } + event.sdk = event.sdk || {}; + event.sdk.name = event.sdk.name || sdkInfo.name; + event.sdk.version = event.sdk.version || sdkInfo.version; + event.sdk.integrations = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((event.sdk.integrations || []), (sdkInfo.integrations || [])); + event.sdk.packages = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((event.sdk.packages || []), (sdkInfo.packages || [])); + return event; +} +/** Creates an envelope from a Session */ +function createSessionEnvelope(session, api) { + var sdkInfo = getSdkMetadataForEnvelopeHeader(api); + var envelopeHeaders = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dsnToString"])(api.dsn) })); + // I know this is hacky but we don't want to add `sessions` to request type since it's never rate limited + var type = 'aggregates' in session ? 'sessions' : 'session'; + // TODO (v7) Have to cast type because envelope items do not accept a `SentryRequestType` + var envelopeItem = [{ type: type }, session]; + var envelope = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["createEnvelope"])(envelopeHeaders, [envelopeItem]); + return [envelope, type]; +} +/** Creates a SentryRequest from a Session. */ +function sessionToSentryRequest(session, api) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(createSessionEnvelope(session, api), 2), envelope = _a[0], type = _a[1]; + return { + body: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["serializeEnvelope"])(envelope), + type: type, + url: Object(_api__WEBPACK_IMPORTED_MODULE_2__["getEnvelopeEndpointWithUrlEncodedAuth"])(api.dsn, api.tunnel), + }; +} +/** + * Create an Envelope from an event. Note that this is duplicated from below, + * but on purpose as this will be refactored in v7. + */ +function createEventEnvelope(event, api) { + var sdkInfo = getSdkMetadataForEnvelopeHeader(api); + var eventType = event.type || 'event'; + var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling; + var _a = transactionSampling || {}, samplingMethod = _a.method, sampleRate = _a.rate; + // TODO: Below is a temporary hack in order to debug a serialization error - see + // https://github.com/getsentry/sentry-javascript/issues/2809, + // https://github.com/getsentry/sentry-javascript/pull/4425, and + // https://github.com/getsentry/sentry-javascript/pull/4574. + // + // TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to + // throw a circular reference error. + // + // When it's time to remove it: + // 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting + // `sdkProcessingMetadata` + // 2. Restore the original version of the request body, which is commented out + // 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the + // baseClient tests in this package + enhanceEventWithSdkInfo(event, api.metadata.sdk); + event.tags = event.tags || {}; + event.extra = event.extra || {}; + // In theory, all events should be marked as having gone through normalization and so + // we should never set this tag/extra data + if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) { + event.tags.skippedNormalization = true; + event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset'; + } + // prevent this data from being sent to sentry + // TODO: This is NOT part of the hack - DO NOT DELETE + delete event.sdkProcessingMetadata; + var envelopeHeaders = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ event_id: event.event_id, sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dsnToString"])(api.dsn) })); + var eventItem = [ + { + type: eventType, + sample_rates: [{ id: samplingMethod, rate: sampleRate }], + }, + event, + ]; + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["createEnvelope"])(envelopeHeaders, [eventItem]); +} +/** Creates a SentryRequest from an event. */ +function eventToSentryRequest(event, api) { + var sdkInfo = getSdkMetadataForEnvelopeHeader(api); + var eventType = event.type || 'event'; + var useEnvelope = eventType === 'transaction' || !!api.tunnel; + var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling; + var _a = transactionSampling || {}, samplingMethod = _a.method, sampleRate = _a.rate; + // TODO: Below is a temporary hack in order to debug a serialization error - see + // https://github.com/getsentry/sentry-javascript/issues/2809, + // https://github.com/getsentry/sentry-javascript/pull/4425, and + // https://github.com/getsentry/sentry-javascript/pull/4574. + // + // TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to + // throw a circular reference error. + // + // When it's time to remove it: + // 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting + // `sdkProcessingMetadata` + // 2. Restore the original version of the request body, which is commented out + // 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the + // baseClient tests in this package + enhanceEventWithSdkInfo(event, api.metadata.sdk); + event.tags = event.tags || {}; + event.extra = event.extra || {}; + // In theory, all events should be marked as having gone through normalization and so + // we should never set this tag/extra data + if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) { + event.tags.skippedNormalization = true; + event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset'; + } + // prevent this data from being sent to sentry + // TODO: This is NOT part of the hack - DO NOT DELETE + delete event.sdkProcessingMetadata; + var body; + try { + // 99.9% of events should get through just fine - no change in behavior for them + body = JSON.stringify(event); + } + catch (err) { + // Record data about the error without replacing original event data, then force renormalization + event.tags.JSONStringifyError = true; + event.extra.JSONStringifyError = err; + try { + body = JSON.stringify(Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["normalize"])(event)); + } + catch (newErr) { + // At this point even renormalization hasn't worked, meaning something about the event data has gone very wrong. + // Time to cut our losses and record only the new error. With luck, even in the problematic cases we're trying to + // debug with this hack, we won't ever land here. + var innerErr = newErr; + body = JSON.stringify({ + message: 'JSON.stringify error after renormalization', + // setting `extra: { innerErr }` here for some reason results in an empty object, so unpack manually + extra: { message: innerErr.message, stack: innerErr.stack }, + }); + } + } + var req = { + // this is the relevant line of code before the hack was added, to make it easy to undo said hack once we've solved + // the mystery + // body: JSON.stringify(sdkInfo ? enhanceEventWithSdkInfo(event, api.metadata.sdk) : event), + body: body, + type: eventType, + url: useEnvelope + ? Object(_api__WEBPACK_IMPORTED_MODULE_2__["getEnvelopeEndpointWithUrlEncodedAuth"])(api.dsn, api.tunnel) + : Object(_api__WEBPACK_IMPORTED_MODULE_2__["getStoreEndpointWithUrlEncodedAuth"])(api.dsn), + }; + // https://develop.sentry.dev/sdk/envelopes/ + // Since we don't need to manipulate envelopes nor store them, there is no + // exported concept of an Envelope with operations including serialization and + // deserialization. Instead, we only implement a minimal subset of the spec to + // serialize events inline here. + if (useEnvelope) { + var envelopeHeaders = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ event_id: event.event_id, sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dsnToString"])(api.dsn) })); + var eventItem = [ + { + type: eventType, + sample_rates: [{ id: samplingMethod, rate: sampleRate }], + }, + req.body, + ]; + var envelope = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["createEnvelope"])(envelopeHeaders, [eventItem]); + req.body = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["serializeEnvelope"])(envelope); + } + return req; +} +//# sourceMappingURL=request.js.map + +/***/ }), + /***/ "4bGx": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -35655,7 +37738,7 @@ module.exports = subWeeks __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "client", function() { return client; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hub", function() { return hub; }); -/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("WSEr"); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("irNY"); /** * Creates a Sentry client connected to the Harvest project @@ -36174,23 +38257,23 @@ var Badge = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](functi "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _globalhandlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("UBq+"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GlobalHandlers", function() { return _globalhandlers__WEBPACK_IMPORTED_MODULE_0__["GlobalHandlers"]; }); +/* harmony import */ var _globalhandlers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("UBq+"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GlobalHandlers", function() { return _globalhandlers_js__WEBPACK_IMPORTED_MODULE_0__["GlobalHandlers"]; }); -/* harmony import */ var _trycatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wytX"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TryCatch", function() { return _trycatch__WEBPACK_IMPORTED_MODULE_1__["TryCatch"]; }); +/* harmony import */ var _trycatch_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wytX"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TryCatch", function() { return _trycatch_js__WEBPACK_IMPORTED_MODULE_1__["TryCatch"]; }); -/* harmony import */ var _breadcrumbs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("/ZhC"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Breadcrumbs", function() { return _breadcrumbs__WEBPACK_IMPORTED_MODULE_2__["Breadcrumbs"]; }); +/* harmony import */ var _breadcrumbs_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("/ZhC"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Breadcrumbs", function() { return _breadcrumbs_js__WEBPACK_IMPORTED_MODULE_2__["Breadcrumbs"]; }); -/* harmony import */ var _linkederrors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("ZAf6"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LinkedErrors", function() { return _linkederrors__WEBPACK_IMPORTED_MODULE_3__["LinkedErrors"]; }); +/* harmony import */ var _linkederrors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("ZAf6"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LinkedErrors", function() { return _linkederrors_js__WEBPACK_IMPORTED_MODULE_3__["LinkedErrors"]; }); -/* harmony import */ var _useragent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("nmNn"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UserAgent", function() { return _useragent__WEBPACK_IMPORTED_MODULE_4__["UserAgent"]; }); +/* harmony import */ var _httpcontext_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("fL16"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpContext", function() { return _httpcontext_js__WEBPACK_IMPORTED_MODULE_4__["HttpContext"]; }); -/* harmony import */ var _dedupe__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("WBcU"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dedupe", function() { return _dedupe__WEBPACK_IMPORTED_MODULE_5__["Dedupe"]; }); +/* harmony import */ var _dedupe_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("WBcU"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dedupe", function() { return _dedupe_js__WEBPACK_IMPORTED_MODULE_5__["Dedupe"]; }); @@ -36200,6 +38283,7 @@ __webpack_require__.r(__webpack_exports__); //# sourceMappingURL=index.js.map + /***/ }), /***/ "4kuk": @@ -38881,6 +40965,107 @@ module.exports = function (it) { }; +/***/ }), + +/***/ "5K7t": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("gtzJ"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["addBreadcrumb"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["captureException"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["captureEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["captureMessage"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["configureScope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["startTransaction"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setContext"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setExtra"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setExtras"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setTag"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setTags"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setUser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["withScope"]; }); + +/* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("uzXi"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["getHubFromCarrier"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["Hub"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["makeMain"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["Scope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Session", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["Session"]; }); + +/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("W/Py"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "API", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["API"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeEndpointWithUrlEncodedAuth", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["getEnvelopeEndpointWithUrlEncodedAuth"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStoreEndpointWithUrlEncodedAuth", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["getStoreEndpointWithUrlEncodedAuth"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRequestHeaders", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["getRequestHeaders"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initAPIDetails", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["initAPIDetails"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getReportDialogEndpoint", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["getReportDialogEndpoint"]; }); + +/* harmony import */ var _baseclient__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("/HJS"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseClient", function() { return _baseclient__WEBPACK_IMPORTED_MODULE_3__["BaseClient"]; }); + +/* harmony import */ var _basebackend__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("gu//"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseBackend", function() { return _basebackend__WEBPACK_IMPORTED_MODULE_4__["BaseBackend"]; }); + +/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("4YnS"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventToSentryRequest", function() { return _request__WEBPACK_IMPORTED_MODULE_5__["eventToSentryRequest"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sessionToSentryRequest", function() { return _request__WEBPACK_IMPORTED_MODULE_5__["sessionToSentryRequest"]; }); + +/* harmony import */ var _sdk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("MVaA"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initAndBind", function() { return _sdk__WEBPACK_IMPORTED_MODULE_6__["initAndBind"]; }); + +/* harmony import */ var _transports_noop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("e0PC"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NoopTransport", function() { return _transports_noop__WEBPACK_IMPORTED_MODULE_7__["NoopTransport"]; }); + +/* harmony import */ var _transports_base__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("8f/b"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createTransport", function() { return _transports_base__WEBPACK_IMPORTED_MODULE_8__["createTransport"]; }); + +/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("bOYC"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return _version__WEBPACK_IMPORTED_MODULE_9__["SDK_VERSION"]; }); + +/* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("fRnL"); +/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "Integrations", function() { return _integrations__WEBPACK_IMPORTED_MODULE_10__; }); + + + + + + + + + + + + +//# sourceMappingURL=index.js.map + /***/ }), /***/ "5NTL": @@ -39976,6 +42161,111 @@ var MykiCsvImporter = /*#__PURE__*/function (_BaseImporter) { /***/ }), +/***/ "5w3M": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStackParser", function() { return createStackParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripSentryFramesAndReverse", function() { return stripSentryFramesAndReverse; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFunctionName", function() { return getFunctionName; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); + +var STACKTRACE_LIMIT = 50; +/** + * Creates a stack parser with the supplied line parsers + * + * StackFrames are returned in the correct order for Sentry Exception + * frames and with Sentry SDK internal frames removed from the top and bottom + * + */ +function createStackParser() { + var parsers = []; + for (var _i = 0; _i < arguments.length; _i++) { + parsers[_i] = arguments[_i]; + } + var sortedParsers = parsers.sort(function (a, b) { return a[0] - b[0]; }).map(function (p) { return p[1]; }); + return function (stack, skipFirst) { + var e_1, _a, e_2, _b; + if (skipFirst === void 0) { skipFirst = 0; } + var frames = []; + try { + for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(stack.split('\n').slice(skipFirst)), _d = _c.next(); !_d.done; _d = _c.next()) { + var line = _d.value; + try { + for (var sortedParsers_1 = (e_2 = void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(sortedParsers)), sortedParsers_1_1 = sortedParsers_1.next(); !sortedParsers_1_1.done; sortedParsers_1_1 = sortedParsers_1.next()) { + var parser = sortedParsers_1_1.value; + var frame = parser(line); + if (frame) { + frames.push(frame); + break; + } + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (sortedParsers_1_1 && !sortedParsers_1_1.done && (_b = sortedParsers_1.return)) _b.call(sortedParsers_1); + } + finally { if (e_2) throw e_2.error; } + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_d && !_d.done && (_a = _c.return)) _a.call(_c); + } + finally { if (e_1) throw e_1.error; } + } + return stripSentryFramesAndReverse(frames); + }; +} +/** + * @hidden + */ +function stripSentryFramesAndReverse(stack) { + if (!stack.length) { + return []; + } + var localStack = stack; + var firstFrameFunction = localStack[0].function || ''; + var lastFrameFunction = localStack[localStack.length - 1].function || ''; + // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call) + if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) { + localStack = localStack.slice(1); + } + // 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) + if (lastFrameFunction.indexOf('sentryWrapped') !== -1) { + localStack = localStack.slice(0, -1); + } + // The frame where the crash happened, should be the last entry in the array + return localStack + .slice(0, STACKTRACE_LIMIT) + .map(function (frame) { return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, frame), { filename: frame.filename || localStack[0].filename, function: frame.function || '?' })); }) + .reverse(); +} +var defaultFunctionName = '<anonymous>'; +/** + * Safely extract function name from itself + */ +function getFunctionName(fn) { + try { + if (!fn || typeof fn !== 'function') { + return defaultFunctionName; + } + return fn.name || defaultFunctionName; + } + catch (e) { + // Just accessing custom props in some Selenium environments + // can cause a "Permission denied" exception (see raven-js#495). + return defaultFunctionName; + } +} +//# sourceMappingURL=stacktrace.js.map + +/***/ }), + /***/ "5wLP": /***/ (function(module, exports, __webpack_require__) { @@ -43357,19 +45647,18 @@ var Slider = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__["forwardRef"](funct "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return fill; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addNonEnumerableProperty", function() { return addNonEnumerableProperty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "markFunctionWrapped", function() { return markFunctionWrapped; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOriginalFunction", function() { return getOriginalFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlEncode", function() { return urlEncode; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToPlainObject", function() { return convertToPlainObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractExceptionKeysForMessage", function() { return extractExceptionKeysForMessage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dropUndefinedKeys", function() { return dropUndefinedKeys; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractExceptionKeysForMessage", function() { return extractExceptionKeysForMessage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return fill; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOriginalFunction", function() { return getOriginalFunction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "markFunctionWrapped", function() { return markFunctionWrapped; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "objectify", function() { return objectify; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("vFt6"); -/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("9AQC"); -/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("+924"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlEncode", function() { return urlEncode; }); +/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("vFt6"); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9AQC"); +/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("+924"); @@ -43386,24 +45675,27 @@ __webpack_require__.r(__webpack_exports__); * @returns void */ function fill(source, name, replacementFactory) { - if (!(name in source)) { - return; - } - var original = source[name]; - var wrapped = replacementFactory(original); - // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work - // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" - if (typeof wrapped === 'function') { - try { - markFunctionWrapped(wrapped, original); - } - catch (_Oo) { - // This can throw if multiple fill happens on a global object like XMLHttpRequest - // Fixes https://github.com/getsentry/sentry-javascript/issues/2043 - } + if (!(name in source)) { + return; + } + + const original = source[name] ; + const wrapped = replacementFactory(original) ; + + // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work + // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" + if (typeof wrapped === 'function') { + try { + markFunctionWrapped(wrapped, original); + } catch (_Oo) { + // This can throw if multiple fill happens on a global object like XMLHttpRequest + // Fixes https://github.com/getsentry/sentry-javascript/issues/2043 } - source[name] = wrapped; + } + + source[name] = wrapped; } + /** * Defines a non-enumerable property on the given object. * @@ -43412,13 +45704,14 @@ function fill(source, name, replacementFactory) { * @param value The value to which to set the property */ function addNonEnumerableProperty(obj, name, value) { - Object.defineProperty(obj, name, { - // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it - value: value, - writable: true, - configurable: true, - }); + Object.defineProperty(obj, name, { + // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it + value: value, + writable: true, + configurable: true, + }); } + /** * Remembers the original function on the wrapped function and * patches up the prototype. @@ -43427,10 +45720,11 @@ function addNonEnumerableProperty(obj, name, value) { * @param original the original function that gets wrapped */ function markFunctionWrapped(wrapped, original) { - var proto = original.prototype || {}; - wrapped.prototype = original.prototype = proto; - addNonEnumerableProperty(wrapped, '__sentry_original__', original); + const proto = original.prototype || {}; + wrapped.prototype = original.prototype = proto; + addNonEnumerableProperty(wrapped, '__sentry_original__', original); } + /** * This extracts the original function if available. See * `markFunctionWrapped` for more information. @@ -43439,8 +45733,9 @@ function markFunctionWrapped(wrapped, original) { * @returns the unwrapped version of the function if available. */ function getOriginalFunction(func) { - return func.__sentry_original__; + return func.__sentry_original__; } + /** * Encodes given object into url-friendly format * @@ -43448,107 +45743,164 @@ function getOriginalFunction(func) { * @returns string Encoded */ function urlEncode(object) { - return Object.keys(object) - .map(function (key) { return encodeURIComponent(key) + "=" + encodeURIComponent(object[key]); }) - .join('&'); + return Object.keys(object) + .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`) + .join('&'); } + /** - * Transforms any object into an object literal with all its attributes - * attached to it. + * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their + * non-enumerable properties attached. * * @param value Initial source that we have to transform in order for it to be usable by the serializer + * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor + * an Error. */ -function convertToPlainObject(value) { - var newObj = value; - if (Object(_is__WEBPACK_IMPORTED_MODULE_2__["isError"])(value)) { - newObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ message: value.message, name: value.name, stack: value.stack }, getOwnProperties(value)); - } - else if (Object(_is__WEBPACK_IMPORTED_MODULE_2__["isEvent"])(value)) { - var event_1 = value; - newObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ type: event_1.type, target: serializeEventTarget(event_1.target), currentTarget: serializeEventTarget(event_1.currentTarget) }, getOwnProperties(event_1)); - if (typeof CustomEvent !== 'undefined' && Object(_is__WEBPACK_IMPORTED_MODULE_2__["isInstanceOf"])(value, CustomEvent)) { - newObj.detail = event_1.detail; - } +function convertToPlainObject( + value, +) + + { + if (Object(_is_js__WEBPACK_IMPORTED_MODULE_1__["isError"])(value)) { + return { + message: value.message, + name: value.name, + stack: value.stack, + ...getOwnProperties(value), + }; + } else if (Object(_is_js__WEBPACK_IMPORTED_MODULE_1__["isEvent"])(value)) { + const newObj + + = { + type: value.type, + target: serializeEventTarget(value.target), + currentTarget: serializeEventTarget(value.currentTarget), + ...getOwnProperties(value), + }; + + if (typeof CustomEvent !== 'undefined' && Object(_is_js__WEBPACK_IMPORTED_MODULE_1__["isInstanceOf"])(value, CustomEvent)) { + newObj.detail = value.detail; } + return newObj; + } else { + return value; + } } + /** Creates a string representation of the target of an `Event` object */ function serializeEventTarget(target) { - try { - return Object(_is__WEBPACK_IMPORTED_MODULE_2__["isElement"])(target) ? Object(_browser__WEBPACK_IMPORTED_MODULE_1__["htmlTreeAsString"])(target) : Object.prototype.toString.call(target); - } - catch (_oO) { - return '<unknown>'; - } + try { + return Object(_is_js__WEBPACK_IMPORTED_MODULE_1__["isElement"])(target) ? Object(_browser_js__WEBPACK_IMPORTED_MODULE_0__["htmlTreeAsString"])(target) : Object.prototype.toString.call(target); + } catch (_oO) { + return '<unknown>'; + } } + /** Filters out all but an object's own properties */ function getOwnProperties(obj) { - var extractedProps = {}; - for (var property in obj) { - if (Object.prototype.hasOwnProperty.call(obj, property)) { - extractedProps[property] = obj[property]; - } + 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 {}; + } } + /** * Given any captured exception, extract its keys and create a sorted * and truncated list that will be used inside the event message. * eg. `Non-error exception captured with keys: foo, bar, baz` */ -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -function extractExceptionKeysForMessage(exception, maxLength) { - if (maxLength === void 0) { maxLength = 40; } - var keys = Object.keys(convertToPlainObject(exception)); - keys.sort(); - if (!keys.length) { - return '[object has no keys]'; - } - if (keys[0].length >= maxLength) { - return Object(_string__WEBPACK_IMPORTED_MODULE_3__["truncate"])(keys[0], maxLength); +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 Object(_string_js__WEBPACK_IMPORTED_MODULE_2__["truncate"])(keys[0], maxLength); + } + + for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) { + const serialized = keys.slice(0, includedKeys).join(', '); + if (serialized.length > maxLength) { + continue; } - for (var includedKeys = keys.length; includedKeys > 0; includedKeys--) { - var serialized = keys.slice(0, includedKeys).join(', '); - if (serialized.length > maxLength) { - continue; - } - if (includedKeys === keys.length) { - return serialized; - } - return Object(_string__WEBPACK_IMPORTED_MODULE_3__["truncate"])(serialized, maxLength); + if (includedKeys === keys.length) { + return serialized; } - return ''; + return Object(_string_js__WEBPACK_IMPORTED_MODULE_2__["truncate"])(serialized, maxLength); + } + + return ''; } + /** - * Given any object, return the new object with removed keys that value was `undefined`. + * Given any object, return a new object having removed all fields whose value was `undefined`. * Works recursively on objects and arrays. + * + * Attention: This function keeps circular references in the returned object. */ -function dropUndefinedKeys(val) { - var e_1, _a; - if (Object(_is__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(val)) { - var rv = {}; - try { - for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(Object.keys(val)), _c = _b.next(); !_c.done; _c = _b.next()) { - var key = _c.value; - if (typeof val[key] !== 'undefined') { - rv[key] = dropUndefinedKeys(val[key]); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return rv; +function dropUndefinedKeys(inputValue) { + // This map keeps track of what already visited nodes map to. + // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular + // references as the input object. + const memoizationMap = new Map(); + + // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API + return _dropUndefinedKeys(inputValue, memoizationMap); +} + +function _dropUndefinedKeys(inputValue, memoizationMap) { + if (Object(_is_js__WEBPACK_IMPORTED_MODULE_1__["isPlainObject"])(inputValue)) { + // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object + const memoVal = memoizationMap.get(inputValue); + if (memoVal !== undefined) { + return memoVal ; } - if (Array.isArray(val)) { - return val.map(dropUndefinedKeys); + + const returnValue = {}; + // Store the mapping of this value in case we visit it again, in case of circular data + memoizationMap.set(inputValue, returnValue); + + for (const key of Object.keys(inputValue)) { + if (typeof inputValue[key] !== 'undefined') { + returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); + } } - return val; + + return returnValue ; + } + + if (Array.isArray(inputValue)) { + // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object + const memoVal = memoizationMap.get(inputValue); + if (memoVal !== undefined) { + return memoVal ; + } + + const returnValue = []; + // Store the mapping of this value in case we visit it again, in case of circular data + memoizationMap.set(inputValue, returnValue); + + inputValue.forEach((item) => { + returnValue.push(_dropUndefinedKeys(item, memoizationMap)); + }); + + return returnValue ; + } + + return inputValue; } + /** * Ensure that something is an object. * @@ -43559,31 +45911,37 @@ function dropUndefinedKeys(val) { * @returns A version of `wat` which can safely be used with `Object` class methods */ function objectify(wat) { - var objectified; - switch (true) { - case wat === undefined || 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 Object(_is__WEBPACK_IMPORTED_MODULE_2__["isPrimitive"])(wat): - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - 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; + let objectified; + switch (true) { + case wat === undefined || 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 Object(_is_js__WEBPACK_IMPORTED_MODULE_1__["isPrimitive"])(wat): + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + 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; } + + //# sourceMappingURL=object.js.map + /***/ }), /***/ "6ROZ": @@ -43711,6 +46069,116 @@ var purple = { /***/ }), +/***/ "6VZY": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNativeFetchImplementation", function() { return getNativeFetchImplementation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sendReport", function() { return sendReport; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Um2S"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("dO1v"); + + +var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])(); +var cachedFetchImpl; +/** + * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers. + * Whenever someone wraps the Fetch API and returns the wrong promise chain, + * this chain becomes orphaned and there is no possible way to capture it's rejections + * other than allowing it bubble up to this very handler. eg. + * + * const f = window.fetch; + * window.fetch = function () { + * const p = f.apply(this, arguments); + * + * p.then(function() { + * console.log('hi.'); + * }); + * + * return p; + * } + * + * `p.then(function () { ... })` is producing a completely separate promise chain, + * however, what's returned is `p` - the result of original `fetch` call. + * + * This mean, that whenever we use the Fetch API to send our own requests, _and_ + * some ad-blocker blocks it, this orphaned chain will _always_ reject, + * effectively causing another event to be captured. + * This makes a whole process become an infinite loop, which we need to somehow + * deal with, and break it in one way or another. + * + * To deal with this issue, we are making sure that we _always_ use the real + * browser Fetch API, instead of relying on what `window.fetch` exposes. + * The only downside to this would be missing our own requests as breadcrumbs, + * but because we are already not doing this, it should be just fine. + * + * Possible failed fetch error messages per-browser: + * + * Chrome: Failed to fetch + * Edge: Failed to Fetch + * Firefox: NetworkError when attempting to fetch resource + * Safari: resource blocked by content blocker + */ +function getNativeFetchImplementation() { + if (cachedFetchImpl) { + return cachedFetchImpl; + } + /* eslint-disable @typescript-eslint/unbound-method */ + // Fast path to avoid DOM I/O + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isNativeFetch"])(global.fetch)) { + return (cachedFetchImpl = global.fetch.bind(global)); + } + var document = global.document; + var fetchImpl = global.fetch; + // eslint-disable-next-line deprecation/deprecation + if (document && typeof document.createElement === 'function') { + try { + var sandbox = document.createElement('iframe'); + sandbox.hidden = true; + document.head.appendChild(sandbox); + var contentWindow = sandbox.contentWindow; + if (contentWindow && contentWindow.fetch) { + fetchImpl = contentWindow.fetch; + } + document.head.removeChild(sandbox); + } + catch (e) { + _flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"] && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e); + } + } + return (cachedFetchImpl = fetchImpl.bind(global)); + /* eslint-enable @typescript-eslint/unbound-method */ +} +/** + * Sends sdk client report using sendBeacon or fetch as a fallback if available + * + * @param url report endpoint + * @param body report payload + */ +function sendReport(url, body) { + var isRealNavigator = Object.prototype.toString.call(global && global.navigator) === '[object Navigator]'; + var hasSendBeacon = isRealNavigator && typeof global.navigator.sendBeacon === 'function'; + if (hasSendBeacon) { + // Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch + var sendBeacon = global.navigator.sendBeacon.bind(global.navigator); + return sendBeacon(url, body); + } + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["supportsFetch"])()) { + var fetch_1 = getNativeFetchImplementation(); + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["forget"])(fetch_1(url, { + body: body, + method: 'POST', + credentials: 'omit', + keepalive: true, + })); + } +} +//# sourceMappingURL=utils.js.map + +/***/ }), + /***/ "6VaU": /***/ (function(module, exports, __webpack_require__) { @@ -44183,6 +46651,50 @@ function moveHelperToHooks(instance, helperName, keepHelper) { //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O3lDQUF1QyxnQ0FBZ0M7Ozs7MkJBQzlDLGdCQUFnQjs7OztvQ0FDUCwwQkFBMEI7Ozs7eUJBQ3JDLGNBQWM7Ozs7MEJBQ2IsZUFBZTs7Ozs2QkFDWixrQkFBa0I7Ozs7MkJBQ3BCLGdCQUFnQjs7OztBQUVsQyxTQUFTLHNCQUFzQixDQUFDLFFBQVEsRUFBRTtBQUMvQyx5Q0FBMkIsUUFBUSxDQUFDLENBQUM7QUFDckMsMkJBQWEsUUFBUSxDQUFDLENBQUM7QUFDdkIsb0NBQXNCLFFBQVEsQ0FBQyxDQUFDO0FBQ2hDLHlCQUFXLFFBQVEsQ0FBQyxDQUFDO0FBQ3JCLDBCQUFZLFFBQVEsQ0FBQyxDQUFDO0FBQ3RCLDZCQUFlLFFBQVEsQ0FBQyxDQUFDO0FBQ3pCLDJCQUFhLFFBQVEsQ0FBQyxDQUFDO0NBQ3hCOztBQUVNLFNBQVMsaUJBQWlCLENBQUMsUUFBUSxFQUFFLFVBQVUsRUFBRSxVQUFVLEVBQUU7QUFDbEUsTUFBSSxRQUFRLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxFQUFFO0FBQ2hDLFlBQVEsQ0FBQyxLQUFLLENBQUMsVUFBVSxDQUFDLEdBQUcsUUFBUSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztBQUMxRCxRQUFJLENBQUMsVUFBVSxFQUFFO0FBQ2YsYUFBTyxRQUFRLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0tBQ3JDO0dBQ0Y7Q0FDRiIsImZpbGUiOiJoZWxwZXJzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHJlZ2lzdGVyQmxvY2tIZWxwZXJNaXNzaW5nIGZyb20gJy4vaGVscGVycy9ibG9jay1oZWxwZXItbWlzc2luZyc7XG5pbXBvcnQgcmVnaXN0ZXJFYWNoIGZyb20gJy4vaGVscGVycy9lYWNoJztcbmltcG9ydCByZWdpc3RlckhlbHBlck1pc3NpbmcgZnJvbSAnLi9oZWxwZXJzL2hlbHBlci1taXNzaW5nJztcbmltcG9ydCByZWdpc3RlcklmIGZyb20gJy4vaGVscGVycy9pZic7XG5pbXBvcnQgcmVnaXN0ZXJMb2cgZnJvbSAnLi9oZWxwZXJzL2xvZyc7XG5pbXBvcnQgcmVnaXN0ZXJMb29rdXAgZnJvbSAnLi9oZWxwZXJzL2xvb2t1cCc7XG5pbXBvcnQgcmVnaXN0ZXJXaXRoIGZyb20gJy4vaGVscGVycy93aXRoJztcblxuZXhwb3J0IGZ1bmN0aW9uIHJlZ2lzdGVyRGVmYXVsdEhlbHBlcnMoaW5zdGFuY2UpIHtcbiAgcmVnaXN0ZXJCbG9ja0hlbHBlck1pc3NpbmcoaW5zdGFuY2UpO1xuICByZWdpc3RlckVhY2goaW5zdGFuY2UpO1xuICByZWdpc3RlckhlbHBlck1pc3NpbmcoaW5zdGFuY2UpO1xuICByZWdpc3RlcklmKGluc3RhbmNlKTtcbiAgcmVnaXN0ZXJMb2coaW5zdGFuY2UpO1xuICByZWdpc3Rlckxvb2t1cChpbnN0YW5jZSk7XG4gIHJlZ2lzdGVyV2l0aChpbnN0YW5jZSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBtb3ZlSGVscGVyVG9Ib29rcyhpbnN0YW5jZSwgaGVscGVyTmFtZSwga2VlcEhlbHBlcikge1xuICBpZiAoaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXSkge1xuICAgIGluc3RhbmNlLmhvb2tzW2hlbHBlck5hbWVdID0gaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXTtcbiAgICBpZiAoIWtlZXBIZWxwZXIpIHtcbiAgICAgIGRlbGV0ZSBpbnN0YW5jZS5oZWxwZXJzW2hlbHBlck5hbWVdO1xuICAgIH1cbiAgfVxufVxuIl19 +/***/ }), + +/***/ "6fQM": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_asyncNullishCoalesce", function() { return _asyncNullishCoalesce; }); +/* harmony import */ var _nullishCoalesce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("P/f2"); + + +// adapted from Sucrase (https://github.com/alangpierce/sucrase) + +/** + * Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the + * result of an async operation. + * + * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the + * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * + * @param lhs The value of the expression to the left of the `??` + * @param rhsFn A function returning the value of the expression to the right of the `??` + * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value + */ +// eslint-disable-next-line @sentry-internal/sdk/no-async-await +async function _asyncNullishCoalesce(lhs, rhsFn) { + return Object(_nullishCoalesce_js__WEBPACK_IMPORTED_MODULE_0__["_nullishCoalesce"])(lhs, rhsFn); +} + +// Sucrase version: +// async function _asyncNullishCoalesce(lhs, rhsFn) { +// if (lhs != null) { +// return lhs; +// } else { +// return await rhsFn(); +// } +// } + + +//# sourceMappingURL=_asyncNullishCoalesce.js.map + + /***/ }), /***/ "6h3Y": @@ -44253,14 +46765,12 @@ function selection_cloneDeep() { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addInstrumentationHandler", function() { return addInstrumentationHandler; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("NDfa"); -/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("z+RT"); -/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("9AQC"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("8LbN"); -/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("6PXS"); -/* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("pRiV"); -/* harmony import */ var _supports__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("4Ssk"); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9AQC"); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("8LbN"); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("6PXS"); +/* harmony import */ var _stacktrace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("pRiV"); +/* harmony import */ var _supports_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("4Ssk"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("rbyU"); @@ -44268,8 +46778,9 @@ __webpack_require__.r(__webpack_exports__); +// eslint-disable-next-line deprecation/deprecation +const WINDOW = Object(_worldwide_js__WEBPACK_IMPORTED_MODULE_5__["getGlobalObject"])(); -var global = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); /** * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc. * - Console API @@ -44280,354 +46791,367 @@ var global = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); * - Error API * - UnhandledRejection API */ -var handlers = {}; -var instrumented = {}; + +const handlers = {}; +const instrumented = {}; + /** Instruments given API */ function instrument(type) { - if (instrumented[type]) { - return; - } - instrumented[type] = true; - switch (type) { - case 'console': - instrumentConsole(); - break; - case 'dom': - instrumentDOM(); - break; - case 'xhr': - instrumentXHR(); - break; - case 'fetch': - instrumentFetch(); - break; - case 'history': - instrumentHistory(); - break; - case 'error': - instrumentError(); - break; - case 'unhandledrejection': - instrumentUnhandledRejection(); - break; - default: - _flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"] && _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].warn('unknown instrumentation type:', type); - return; - } + if (instrumented[type]) { + return; + } + + instrumented[type] = true; + + switch (type) { + case 'console': + instrumentConsole(); + break; + case 'dom': + instrumentDOM(); + break; + case 'xhr': + instrumentXHR(); + break; + case 'fetch': + instrumentFetch(); + break; + case 'history': + instrumentHistory(); + break; + case 'error': + instrumentError(); + break; + case 'unhandledrejection': + instrumentUnhandledRejection(); + break; + default: + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _logger_js__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('unknown instrumentation type:', type); + return; + } } + /** * Add handler that will be called when given type of instrumentation triggers. * Use at your own risk, this might break without changelog notice, only used internally. * @hidden */ function addInstrumentationHandler(type, callback) { - handlers[type] = handlers[type] || []; - handlers[type].push(callback); - instrument(type); + handlers[type] = handlers[type] || []; + (handlers[type] ).push(callback); + instrument(type); } + /** JSDoc */ function triggerHandlers(type, data) { - var e_1, _a; - if (!type || !handlers[type]) { - return; - } + if (!type || !handlers[type]) { + return; + } + + for (const handler of handlers[type] || []) { try { - for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(handlers[type] || []), _c = _b.next(); !_c.done; _c = _b.next()) { - var handler = _c.value; - try { - handler(data); - } - catch (e) { - _flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"] && - _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].error("Error while triggering instrumentation handler.\nType: " + type + "\nName: " + Object(_stacktrace__WEBPACK_IMPORTED_MODULE_6__["getFunctionName"])(handler) + "\nError:", e); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } + handler(data); + } catch (e) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _logger_js__WEBPACK_IMPORTED_MODULE_1__["logger"].error( + `Error while triggering instrumentation handler.\nType: ${type}\nName: ${Object(_stacktrace_js__WEBPACK_IMPORTED_MODULE_3__["getFunctionName"])(handler)}\nError:`, + e, + ); } + } } + /** JSDoc */ function instrumentConsole() { - if (!('console' in global)) { - return; + if (!('console' in WINDOW)) { + return; + } + + _logger_js__WEBPACK_IMPORTED_MODULE_1__["CONSOLE_LEVELS"].forEach(function (level) { + if (!(level in WINDOW.console)) { + return; } - _logger__WEBPACK_IMPORTED_MODULE_4__["CONSOLE_LEVELS"].forEach(function (level) { - if (!(level in global.console)) { - return; + + Object(_object_js__WEBPACK_IMPORTED_MODULE_2__["fill"])(WINDOW.console, level, function (originalConsoleMethod) { + return function (...args) { + triggerHandlers('console', { args, level }); + + // this fails for some browsers. :( + if (originalConsoleMethod) { + originalConsoleMethod.apply(WINDOW.console, args); } - Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global.console, level, function (originalConsoleMethod) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - triggerHandlers('console', { args: args, level: level }); - // this fails for some browsers. :( - if (originalConsoleMethod) { - originalConsoleMethod.apply(global.console, args); - } - }; - }); + }; }); + }); } + /** JSDoc */ function instrumentFetch() { - if (!Object(_supports__WEBPACK_IMPORTED_MODULE_7__["supportsNativeFetch"])()) { - return; - } - Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global, 'fetch', function (originalFetch) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var handlerData = { - args: args, - fetchData: { - method: getFetchMethod(args), - url: getFetchUrl(args), - }, - startTimestamp: Date.now(), - }; - triggerHandlers('fetch', Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData)); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - return originalFetch.apply(global, args).then(function (response) { - triggerHandlers('fetch', Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData), { endTimestamp: Date.now(), response: response })); - return response; - }, function (error) { - triggerHandlers('fetch', Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData), { endTimestamp: Date.now(), error: error })); - // NOTE: If you are a Sentry user, and you are seeing this stack frame, - // it means the sentry.javascript SDK caught an error invoking your application code. - // This is expected behavior and NOT indicative of a bug with sentry.javascript. - throw error; - }); - }; - }); + if (!Object(_supports_js__WEBPACK_IMPORTED_MODULE_4__["supportsNativeFetch"])()) { + return; + } + + Object(_object_js__WEBPACK_IMPORTED_MODULE_2__["fill"])(WINDOW, 'fetch', function (originalFetch) { + return function (...args) { + const handlerData = { + args, + fetchData: { + method: getFetchMethod(args), + url: getFetchUrl(args), + }, + startTimestamp: Date.now(), + }; + + triggerHandlers('fetch', { + ...handlerData, + }); + + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return originalFetch.apply(WINDOW, args).then( + (response) => { + triggerHandlers('fetch', { + ...handlerData, + endTimestamp: Date.now(), + response, + }); + return response; + }, + (error) => { + triggerHandlers('fetch', { + ...handlerData, + endTimestamp: Date.now(), + error, + }); + // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the sentry.javascript SDK caught an error invoking your application code. + // This is expected behavior and NOT indicative of a bug with sentry.javascript. + throw error; + }, + ); + }; + }); } + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /** Extract `method` from fetch call arguments */ -function getFetchMethod(fetchArgs) { - if (fetchArgs === void 0) { fetchArgs = []; } - if ('Request' in global && Object(_is__WEBPACK_IMPORTED_MODULE_3__["isInstanceOf"])(fetchArgs[0], Request) && fetchArgs[0].method) { - return String(fetchArgs[0].method).toUpperCase(); - } - if (fetchArgs[1] && fetchArgs[1].method) { - return String(fetchArgs[1].method).toUpperCase(); - } - return 'GET'; +function getFetchMethod(fetchArgs = []) { + if ('Request' in WINDOW && Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isInstanceOf"])(fetchArgs[0], Request) && fetchArgs[0].method) { + return String(fetchArgs[0].method).toUpperCase(); + } + if (fetchArgs[1] && fetchArgs[1].method) { + return String(fetchArgs[1].method).toUpperCase(); + } + return 'GET'; } + /** Extract `url` from fetch call arguments */ -function getFetchUrl(fetchArgs) { - if (fetchArgs === void 0) { fetchArgs = []; } - if (typeof fetchArgs[0] === 'string') { - return fetchArgs[0]; - } - if ('Request' in global && Object(_is__WEBPACK_IMPORTED_MODULE_3__["isInstanceOf"])(fetchArgs[0], Request)) { - return fetchArgs[0].url; - } - return String(fetchArgs[0]); +function getFetchUrl(fetchArgs = []) { + if (typeof fetchArgs[0] === 'string') { + return fetchArgs[0]; + } + if ('Request' in WINDOW && Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isInstanceOf"])(fetchArgs[0], Request)) { + return fetchArgs[0].url; + } + return String(fetchArgs[0]); } /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + /** JSDoc */ function instrumentXHR() { - if (!('XMLHttpRequest' in global)) { - return; - } - var xhrproto = XMLHttpRequest.prototype; - Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(xhrproto, 'open', function (originalOpen) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - // eslint-disable-next-line @typescript-eslint/no-this-alias - var xhr = this; - var url = args[1]; - var xhrInfo = (xhr.__sentry_xhr__ = { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - method: Object(_is__WEBPACK_IMPORTED_MODULE_3__["isString"])(args[0]) ? args[0].toUpperCase() : args[0], - url: args[1], - }); - // if Sentry key appears in URL, don't capture it as a request - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - if (Object(_is__WEBPACK_IMPORTED_MODULE_3__["isString"])(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) { - xhr.__sentry_own_request__ = true; - } - var onreadystatechangeHandler = function () { - if (xhr.readyState === 4) { - try { - // touching statusCode in some platforms throws - // an exception - xhrInfo.status_code = xhr.status; - } - catch (e) { - /* do nothing */ - } - triggerHandlers('xhr', { - args: args, - endTimestamp: Date.now(), - startTimestamp: Date.now(), - xhr: xhr, - }); - } - }; - if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') { - Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(xhr, 'onreadystatechange', function (original) { - return function () { - var readyStateArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - readyStateArgs[_i] = arguments[_i]; - } - onreadystatechangeHandler(); - return original.apply(xhr, readyStateArgs); - }; - }); - } - else { - xhr.addEventListener('readystatechange', onreadystatechangeHandler); - } - return originalOpen.apply(xhr, args); - }; - }); - Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(xhrproto, 'send', function (originalSend) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (this.__sentry_xhr__ && args[0] !== undefined) { - this.__sentry_xhr__.body = args[0]; - } - triggerHandlers('xhr', { - args: args, - startTimestamp: Date.now(), - xhr: this, - }); - return originalSend.apply(this, args); - }; - }); + if (!('XMLHttpRequest' in WINDOW)) { + return; + } + + const xhrproto = XMLHttpRequest.prototype; + + Object(_object_js__WEBPACK_IMPORTED_MODULE_2__["fill"])(xhrproto, 'open', function (originalOpen) { + return function ( ...args) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const xhr = this; + const url = args[1]; + const xhrInfo = (xhr.__sentry_xhr__ = { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + method: Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isString"])(args[0]) ? args[0].toUpperCase() : args[0], + url: args[1], + }); + + // if Sentry key appears in URL, don't capture it as a request + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isString"])(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) { + xhr.__sentry_own_request__ = true; + } + + const onreadystatechangeHandler = function () { + if (xhr.readyState === 4) { + try { + // touching statusCode in some platforms throws + // an exception + xhrInfo.status_code = xhr.status; + } catch (e) { + /* do nothing */ + } + + triggerHandlers('xhr', { + args, + endTimestamp: Date.now(), + startTimestamp: Date.now(), + xhr, + }); + } + }; + + if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') { + Object(_object_js__WEBPACK_IMPORTED_MODULE_2__["fill"])(xhr, 'onreadystatechange', function (original) { + return function (...readyStateArgs) { + onreadystatechangeHandler(); + return original.apply(xhr, readyStateArgs); + }; + }); + } else { + xhr.addEventListener('readystatechange', onreadystatechangeHandler); + } + + return originalOpen.apply(xhr, args); + }; + }); + + Object(_object_js__WEBPACK_IMPORTED_MODULE_2__["fill"])(xhrproto, 'send', function (originalSend) { + return function ( ...args) { + if (this.__sentry_xhr__ && args[0] !== undefined) { + this.__sentry_xhr__.body = args[0]; + } + + triggerHandlers('xhr', { + args, + startTimestamp: Date.now(), + xhr: this, + }); + + return originalSend.apply(this, args); + }; + }); } -var lastHref; + +let lastHref; + /** JSDoc */ function instrumentHistory() { - if (!Object(_supports__WEBPACK_IMPORTED_MODULE_7__["supportsHistory"])()) { - return; + if (!Object(_supports_js__WEBPACK_IMPORTED_MODULE_4__["supportsHistory"])()) { + return; + } + + const oldOnPopState = WINDOW.onpopstate; + WINDOW.onpopstate = function ( ...args) { + const to = WINDOW.location.href; + // keep track of the current URL state, as we always receive only the updated state + const from = lastHref; + lastHref = to; + triggerHandlers('history', { + from, + to, + }); + if (oldOnPopState) { + // Apparently this can throw in Firefox when incorrectly implemented plugin is installed. + // https://github.com/getsentry/sentry-javascript/issues/3344 + // https://github.com/bugsnag/bugsnag-js/issues/469 + try { + return oldOnPopState.apply(this, args); + } catch (_oO) { + // no-empty + } } - var oldOnPopState = global.onpopstate; - global.onpopstate = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var to = global.location.href; + }; + + /** @hidden */ + function historyReplacementFunction(originalHistoryFunction) { + return function ( ...args) { + const url = args.length > 2 ? args[2] : undefined; + if (url) { + // coerce to string (this is what pushState does) + const from = lastHref; + const to = String(url); // keep track of the current URL state, as we always receive only the updated state - var from = lastHref; lastHref = to; triggerHandlers('history', { - from: from, - to: to, + from, + to, }); - if (oldOnPopState) { - // Apparently this can throw in Firefox when incorrectly implemented plugin is installed. - // https://github.com/getsentry/sentry-javascript/issues/3344 - // https://github.com/bugsnag/bugsnag-js/issues/469 - try { - return oldOnPopState.apply(this, args); - } - catch (_oO) { - // no-empty - } - } + } + return originalHistoryFunction.apply(this, args); }; - /** @hidden */ - function historyReplacementFunction(originalHistoryFunction) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var url = args.length > 2 ? args[2] : undefined; - if (url) { - // coerce to string (this is what pushState does) - var from = lastHref; - var to = String(url); - // keep track of the current URL state, as we always receive only the updated state - lastHref = to; - triggerHandlers('history', { - from: from, - to: to, - }); - } - return originalHistoryFunction.apply(this, args); - }; - } - Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global.history, 'pushState', historyReplacementFunction); - Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global.history, 'replaceState', historyReplacementFunction); + } + + Object(_object_js__WEBPACK_IMPORTED_MODULE_2__["fill"])(WINDOW.history, 'pushState', historyReplacementFunction); + Object(_object_js__WEBPACK_IMPORTED_MODULE_2__["fill"])(WINDOW.history, 'replaceState', historyReplacementFunction); } -var debounceDuration = 1000; -var debounceTimerID; -var lastCapturedEvent; + +const debounceDuration = 1000; +let debounceTimerID; +let lastCapturedEvent; + /** * Decide whether the current event should finish the debounce of previously captured one. * @param previous previously captured event * @param current event to be captured */ function shouldShortcircuitPreviousDebounce(previous, current) { - // If there was no previous event, it should always be swapped for the new one. - if (!previous) { - return true; - } - // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress. - if (previous.type !== current.type) { - return true; - } - try { - // If both events have the same type, it's still possible that actions were performed on different targets. - // e.g. 2 clicks on different buttons. - if (previous.target !== current.target) { - return true; - } - } - catch (e) { - // just accessing `target` property can throw an exception in some rare circumstances - // see: https://github.com/getsentry/sentry-javascript/issues/838 + // If there was no previous event, it should always be swapped for the new one. + if (!previous) { + return true; + } + + // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress. + if (previous.type !== current.type) { + return true; + } + + try { + // If both events have the same type, it's still possible that actions were performed on different targets. + // e.g. 2 clicks on different buttons. + if (previous.target !== current.target) { + return true; } - // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_ - // to which an event listener was attached), we treat them as the same action, as we want to capture - // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box. - return false; + } catch (e) { + // just accessing `target` property can throw an exception in some rare circumstances + // see: https://github.com/getsentry/sentry-javascript/issues/838 + } + + // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_ + // to which an event listener was attached), we treat them as the same action, as we want to capture + // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box. + return false; } + /** * Decide whether an event should be captured. * @param event event to be captured */ function shouldSkipDOMEvent(event) { - // We are only interested in filtering `keypress` events for now. - if (event.type !== 'keypress') { - return false; - } - try { - var target = event.target; - if (!target || !target.tagName) { - return true; - } - // Only consider keypress events on actual input elements. This will disregard keypresses targeting body - // e.g.tabbing through elements, hotkeys, etc. - if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) { - return false; - } + // We are only interested in filtering `keypress` events for now. + if (event.type !== 'keypress') { + return false; + } + + try { + const target = event.target ; + + if (!target || !target.tagName) { + return true; } - catch (e) { - // just accessing `target` property can throw an exception in some rare circumstances - // see: https://github.com/getsentry/sentry-javascript/issues/838 + + // Only consider keypress events on actual input elements. This will disregard keypresses targeting body + // e.g.tabbing through elements, hotkeys, etc. + if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) { + return false; } - return true; + } catch (e) { + // just accessing `target` property can throw an exception in some rare circumstances + // see: https://github.com/getsentry/sentry-javascript/issues/838 + } + + return true; } + /** * Wraps addEventListener to capture UI breadcrumbs * @param handler function that will be triggered @@ -44635,157 +47159,194 @@ function shouldSkipDOMEvent(event) { * @returns wrapped breadcrumb events handler * @hidden */ -function makeDOMEventHandler(handler, globalListener) { - if (globalListener === void 0) { globalListener = false; } - return function (event) { - // It's possible this handler might trigger multiple times for the same - // event (e.g. event propagation through node ancestors). - // Ignore if we've already captured that event. - if (!event || lastCapturedEvent === event) { - return; - } - // We always want to skip _some_ events. - if (shouldSkipDOMEvent(event)) { - return; - } - var name = event.type === 'keypress' ? 'input' : event.type; - // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons. - if (debounceTimerID === undefined) { - handler({ - event: event, - name: name, - global: globalListener, - }); - lastCapturedEvent = event; - } - // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one. - // If that's the case, emit the previous event and store locally the newly-captured DOM event. - else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) { - handler({ - event: event, - name: name, - global: globalListener, - }); - lastCapturedEvent = event; - } - // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together. - clearTimeout(debounceTimerID); - debounceTimerID = global.setTimeout(function () { - debounceTimerID = undefined; - }, debounceDuration); - }; +function makeDOMEventHandler(handler, globalListener = false) { + return (event) => { + // It's possible this handler might trigger multiple times for the same + // event (e.g. event propagation through node ancestors). + // Ignore if we've already captured that event. + if (!event || lastCapturedEvent === event) { + return; + } + + // We always want to skip _some_ events. + if (shouldSkipDOMEvent(event)) { + return; + } + + const name = event.type === 'keypress' ? 'input' : event.type; + + // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons. + if (debounceTimerID === undefined) { + handler({ + event: event, + name, + global: globalListener, + }); + lastCapturedEvent = event; + } + // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one. + // If that's the case, emit the previous event and store locally the newly-captured DOM event. + else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) { + handler({ + event: event, + name, + global: globalListener, + }); + lastCapturedEvent = event; + } + + // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together. + clearTimeout(debounceTimerID); + debounceTimerID = WINDOW.setTimeout(() => { + debounceTimerID = undefined; + }, debounceDuration); + }; } + /** JSDoc */ function instrumentDOM() { - if (!('document' in global)) { - return; + if (!('document' in WINDOW)) { + return; + } + + // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom + // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before + // we instrument `addEventListener` so that we don't end up attaching this handler twice. + const triggerDOMHandler = triggerHandlers.bind(null, 'dom'); + const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true); + WINDOW.document.addEventListener('click', globalDOMEventHandler, false); + WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false); + + // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled + // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That + // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler + // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still + // guaranteed to fire at least once.) + ['EventTarget', 'Node'].forEach((target) => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const proto = (WINDOW )[target] && (WINDOW )[target].prototype; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins + if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { + return; } - // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom - // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before - // we instrument `addEventListener` so that we don't end up attaching this handler twice. - var triggerDOMHandler = triggerHandlers.bind(null, 'dom'); - var globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true); - global.document.addEventListener('click', globalDOMEventHandler, false); - global.document.addEventListener('keypress', globalDOMEventHandler, false); - // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled - // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That - // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler - // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still - // guaranteed to fire at least once.) - ['EventTarget', 'Node'].forEach(function (target) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - var proto = global[target] && global[target].prototype; - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins - if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { - return; + + Object(_object_js__WEBPACK_IMPORTED_MODULE_2__["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 += 1; + } catch (e) { + // Accessing dom properties is always fragile. + // Also allows us to skip `addEventListenrs` calls with no proper `this` context. + } } - Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(proto, 'addEventListener', function (originalAddEventListener) { - return function (type, listener, options) { - if (type === 'click' || type == 'keypress') { - try { - var el = this; - var handlers_1 = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {}); - var handlerForType = (handlers_1[type] = handlers_1[type] || { refCount: 0 }); - if (!handlerForType.handler) { - var handler = makeDOMEventHandler(triggerDOMHandler); - handlerForType.handler = handler; - originalAddEventListener.call(this, type, handler, options); - } - handlerForType.refCount += 1; - } - catch (e) { - // Accessing dom properties is always fragile. - // Also allows us to skip `addEventListenrs` calls with no proper `this` context. - } + + return originalAddEventListener.call(this, type, listener, options); + }; + }); + + Object(_object_js__WEBPACK_IMPORTED_MODULE_2__["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 -= 1; + // If there are no longer any custom handlers of the current type on this element, we can remove ours, too. + if (handlerForType.refCount <= 0) { + originalRemoveEventListener.call(this, type, handlerForType.handler, options); + handlerForType.handler = undefined; + delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete } - return originalAddEventListener.call(this, type, listener, options); - }; - }); - Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(proto, 'removeEventListener', function (originalRemoveEventListener) { - return function (type, listener, options) { - if (type === 'click' || type == 'keypress') { - try { - var el = this; - var handlers_2 = el.__sentry_instrumentation_handlers__ || {}; - var handlerForType = handlers_2[type]; - if (handlerForType) { - handlerForType.refCount -= 1; - // If there are no longer any custom handlers of the current type on this element, we can remove ours, too. - if (handlerForType.refCount <= 0) { - originalRemoveEventListener.call(this, type, handlerForType.handler, options); - handlerForType.handler = undefined; - delete handlers_2[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete - } - // If there are no longer any custom handlers of any type on this element, cleanup everything. - if (Object.keys(handlers_2).length === 0) { - delete el.__sentry_instrumentation_handlers__; - } - } - } - catch (e) { - // Accessing dom properties is always fragile. - // Also allows us to skip `addEventListenrs` calls with no proper `this` context. - } + + // If there are no longer any custom handlers of any type on this element, cleanup everything. + if (Object.keys(handlers).length === 0) { + delete el.__sentry_instrumentation_handlers__; } - return originalRemoveEventListener.call(this, type, listener, options); - }; - }); - }); + } + } catch (e) { + // Accessing dom properties is always fragile. + // Also allows us to skip `addEventListenrs` calls with no proper `this` context. + } + } + + return originalRemoveEventListener.call(this, type, listener, options); + }; + }, + ); + }); } -var _oldOnErrorHandler = null; + +let _oldOnErrorHandler = null; /** JSDoc */ function instrumentError() { - _oldOnErrorHandler = global.onerror; - global.onerror = function (msg, url, line, column, error) { - triggerHandlers('error', { - column: column, - error: error, - line: line, - msg: msg, - url: url, - }); - if (_oldOnErrorHandler) { - // eslint-disable-next-line prefer-rest-params - return _oldOnErrorHandler.apply(this, arguments); - } - return false; - }; + _oldOnErrorHandler = WINDOW.onerror; + + WINDOW.onerror = function (msg, url, line, column, error) { + triggerHandlers('error', { + column, + error, + line, + msg, + url, + }); + + if (_oldOnErrorHandler) { + // eslint-disable-next-line prefer-rest-params + return _oldOnErrorHandler.apply(this, arguments); + } + + return false; + }; } -var _oldOnUnhandledRejectionHandler = null; + +let _oldOnUnhandledRejectionHandler = null; /** JSDoc */ function instrumentUnhandledRejection() { - _oldOnUnhandledRejectionHandler = global.onunhandledrejection; - global.onunhandledrejection = function (e) { - triggerHandlers('unhandledrejection', e); - if (_oldOnUnhandledRejectionHandler) { - // eslint-disable-next-line prefer-rest-params - return _oldOnUnhandledRejectionHandler.apply(this, arguments); - } - return true; - }; + _oldOnUnhandledRejectionHandler = WINDOW.onunhandledrejection; + + WINDOW.onunhandledrejection = function (e) { + triggerHandlers('unhandledrejection', e); + + if (_oldOnUnhandledRejectionHandler) { + // eslint-disable-next-line prefer-rest-params + return _oldOnUnhandledRejectionHandler.apply(this, arguments); + } + + return true; + }; } + + //# sourceMappingURL=instrument.js.map + /***/ }), /***/ "6hg5": @@ -44852,6 +47413,53 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "6mNm": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onHidden", function() { return onHidden; }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Wezb"); + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const onHidden = (cb, once) => { + const onHiddenOrPageHide = (event) => { + if (event.type === 'pagehide' || _types_js__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].document.visibilityState === 'hidden') { + cb(event); + if (once) { + removeEventListener('visibilitychange', onHiddenOrPageHide, true); + removeEventListener('pagehide', onHiddenOrPageHide, true); + } + } + }; + addEventListener('visibilitychange', onHiddenOrPageHide, true); + // Some browsers have buggy implementations of visibilitychange, + // so we use pagehide in addition, just to be safe. + addEventListener('pagehide', onHiddenOrPageHide, true); +}; + + +//# sourceMappingURL=onHidden.js.map + + /***/ }), /***/ "6mlG": @@ -47599,6 +50207,183 @@ var EncryptionType; /***/ }), +/***/ "7JmA": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return resolve; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return relative; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizePath", function() { return normalizePath; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAbsolute", function() { return isAbsolute; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "join", function() { return join; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return dirname; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return basename; }); +// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript +// https://raw.githubusercontent.com/calvinmetcalf/rollup-plugin-node-builtins/master/src/es6/path.js +/** JSDoc */ +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } + else if (last === '..') { + parts.splice(i, 1); + // eslint-disable-next-line no-plusplus + up++; + } + else if (up) { + parts.splice(i, 1); + // eslint-disable-next-line no-plusplus + up--; + } + } + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + // eslint-disable-next-line no-plusplus + for (; up--; up) { + parts.unshift('..'); + } + } + return parts; +} +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/; +/** JSDoc */ +function splitPath(filename) { + var parts = splitPathRe.exec(filename); + return parts ? parts.slice(1) : []; +} +// path.resolve([from ...], to) +// posix version +/** JSDoc */ +function resolve() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var resolvedPath = ''; + var resolvedAbsolute = false; + for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = i >= 0 ? args[i] : '/'; + // Skip empty entries + if (!path) { + continue; + } + resolvedPath = path + "/" + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + // Normalize the path + resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/'); + return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; +} +/** JSDoc */ +function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') { + break; + } + } + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') { + break; + } + } + if (start > end) { + return []; + } + return arr.slice(start, end - start + 1); +} +// path.relative(from, to) +// posix version +/** JSDoc */ +function relative(from, to) { + /* eslint-disable no-param-reassign */ + from = resolve(from).substr(1); + to = resolve(to).substr(1); + /* eslint-enable no-param-reassign */ + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + return outputParts.join('/'); +} +// path.normalize(path) +// posix version +/** JSDoc */ +function normalizePath(path) { + var isPathAbsolute = isAbsolute(path); + var trailingSlash = path.substr(-1) === '/'; + // Normalize the path + var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/'); + if (!normalizedPath && !isPathAbsolute) { + normalizedPath = '.'; + } + if (normalizedPath && trailingSlash) { + normalizedPath += '/'; + } + return (isPathAbsolute ? '/' : '') + normalizedPath; +} +// posix version +/** JSDoc */ +function isAbsolute(path) { + return path.charAt(0) === '/'; +} +// posix version +/** JSDoc */ +function join() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return normalizePath(args.join('/')); +} +/** JSDoc */ +function dirname(path) { + var result = splitPath(path); + var root = result[0]; + var dir = result[1]; + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + return root + dir; +} +/** JSDoc */ +function basename(path, ext) { + var f = splitPath(path)[2]; + if (ext && f.substr(ext.length * -1) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +} +//# sourceMappingURL=path.js.map + +/***/ }), + /***/ "7K3h": /***/ (function(module, exports) { @@ -48095,6 +50880,61 @@ function baseSum(array, iteratee) { module.exports = baseSum; +/***/ }), + +/***/ "7QCm": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeNewXHRTransport", function() { return makeNewXHRTransport; }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Um2S"); + + +/** + * The DONE ready state for XmlHttpRequest + * + * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined + * (e.g. during testing, it is `undefined`) + * + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState} + */ +var XHR_READYSTATE_DONE = 4; +/** + * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry. + */ +function makeNewXHRTransport(options) { + function makeRequest(request) { + return new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"](function (resolve, _reject) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function () { + if (xhr.readyState === XHR_READYSTATE_DONE) { + var response = { + body: xhr.response, + headers: { + 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'), + 'retry-after': xhr.getResponseHeader('Retry-After'), + }, + reason: xhr.statusText, + statusCode: xhr.status, + }; + resolve(response); + } + }; + xhr.open('POST', options.url); + for (var header in options.headers) { + if (Object.prototype.hasOwnProperty.call(options.headers, header)) { + xhr.setRequestHeader(header, options.headers[header]); + } + } + xhr.send(request.body); + }); + } + return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["createTransport"])({ bufferSize: options.bufferSize }, makeRequest); +} +//# sourceMappingURL=new-xhr.js.map + /***/ }), /***/ "7Qtz": @@ -50251,6 +53091,176 @@ function shortOut(func) { module.exports = shortOut; +/***/ }), + +/***/ "88Rr": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolvedSyncPromise", function() { return resolvedSyncPromise; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rejectedSyncPromise", function() { return rejectedSyncPromise; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyncPromise", function() { return SyncPromise; }); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4E6N"); +/* eslint-disable @typescript-eslint/explicit-function-return-type */ +/* eslint-disable @typescript-eslint/typedef */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +/** + * Creates a resolved sync promise. + * + * @param value the value to resolve the promise with + * @returns the resolved sync promise + */ +function resolvedSyncPromise(value) { + return new SyncPromise(function (resolve) { + resolve(value); + }); +} +/** + * Creates a rejected sync promise. + * + * @param value the value to reject the promise with + * @returns the rejected sync promise + */ +function rejectedSyncPromise(reason) { + return new SyncPromise(function (_, reject) { + reject(reason); + }); +} +/** + * Thenable class that behaves like a Promise and follows it's interface + * but is not async internally + */ +var SyncPromise = /** @class */ (function () { + function SyncPromise(executor) { + var _this = this; + this._state = 0 /* PENDING */; + this._handlers = []; + /** JSDoc */ + this._resolve = function (value) { + _this._setResult(1 /* RESOLVED */, value); + }; + /** JSDoc */ + this._reject = function (reason) { + _this._setResult(2 /* REJECTED */, reason); + }; + /** JSDoc */ + this._setResult = function (state, value) { + if (_this._state !== 0 /* PENDING */) { + return; + } + if (Object(_is__WEBPACK_IMPORTED_MODULE_0__["isThenable"])(value)) { + void value.then(_this._resolve, _this._reject); + return; + } + _this._state = state; + _this._value = value; + _this._executeHandlers(); + }; + /** JSDoc */ + this._executeHandlers = function () { + if (_this._state === 0 /* PENDING */) { + return; + } + var cachedHandlers = _this._handlers.slice(); + _this._handlers = []; + cachedHandlers.forEach(function (handler) { + if (handler[0]) { + return; + } + if (_this._state === 1 /* RESOLVED */) { + // eslint-disable-next-line @typescript-eslint/no-floating-promises + handler[1](_this._value); + } + if (_this._state === 2 /* REJECTED */) { + handler[2](_this._value); + } + handler[0] = true; + }); + }; + try { + executor(this._resolve, this._reject); + } + catch (e) { + this._reject(e); + } + } + /** JSDoc */ + SyncPromise.prototype.then = function (onfulfilled, onrejected) { + var _this = this; + return new SyncPromise(function (resolve, reject) { + _this._handlers.push([ + false, + function (result) { + if (!onfulfilled) { + // TODO: ¯\_(ツ)_/¯ + // TODO: FIXME + resolve(result); + } + else { + try { + resolve(onfulfilled(result)); + } + catch (e) { + reject(e); + } + } + }, + function (reason) { + if (!onrejected) { + reject(reason); + } + else { + try { + resolve(onrejected(reason)); + } + catch (e) { + reject(e); + } + } + }, + ]); + _this._executeHandlers(); + }); + }; + /** JSDoc */ + SyncPromise.prototype.catch = function (onrejected) { + return this.then(function (val) { return val; }, onrejected); + }; + /** JSDoc */ + SyncPromise.prototype.finally = function (onfinally) { + var _this = this; + return new SyncPromise(function (resolve, reject) { + var val; + var isRejected; + return _this.then(function (value) { + isRejected = false; + val = value; + if (onfinally) { + onfinally(); + } + }, function (reason) { + isRejected = true; + val = reason; + if (onfinally) { + onfinally(); + } + }).then(function () { + if (isRejected) { + reject(val); + return; + } + resolve(val); + }); + }); + }; + return SyncPromise; +}()); + +//# sourceMappingURL=syncpromise.js.map + /***/ }), /***/ "88zv": @@ -54355,17 +57365,14 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONSOLE_LEVELS", function() { return CONSOLE_LEVELS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consoleSandbox", function() { return consoleSandbox; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return logger; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("NDfa"); -/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("z+RT"); - +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("rbyU"); -// TODO: Implement different loggers for different environments -var global = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); /** Prefix for logging strings */ -var PREFIX = 'Sentry Logger '; -var CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert']; +const PREFIX = 'Sentry Logger '; + +const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] ; + /** * Temporarily disable sentry console instrumentations. * @@ -54373,76 +57380,77 @@ var CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert']; * @returns The results of the callback */ function consoleSandbox(callback) { - var global = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); - if (!('console' in global)) { - return callback(); + if (!('console' in _worldwide_js__WEBPACK_IMPORTED_MODULE_0__["GLOBAL_OBJ"])) { + return callback(); + } + + const originalConsole = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__["GLOBAL_OBJ"].console ; + const wrappedLevels = {}; + + // Restore all wrapped console methods + CONSOLE_LEVELS.forEach(level => { + // TODO(v7): Remove this check as it's only needed for Node 6 + const originalWrappedFunc = + originalConsole[level] && (originalConsole[level] ).__sentry_original__; + if (level in originalConsole && originalWrappedFunc) { + wrappedLevels[level] = originalConsole[level] ; + originalConsole[level] = originalWrappedFunc ; } - var originalConsole = global.console; - var wrappedLevels = {}; - // Restore all wrapped console methods - CONSOLE_LEVELS.forEach(function (level) { - // TODO(v7): Remove this check as it's only needed for Node 6 - var originalWrappedFunc = originalConsole[level] && originalConsole[level].__sentry_original__; - if (level in global.console && originalWrappedFunc) { - wrappedLevels[level] = originalConsole[level]; - originalConsole[level] = originalWrappedFunc; - } + }); + + try { + return callback(); + } finally { + // Revert restoration to wrapped state + Object.keys(wrappedLevels).forEach(level => { + originalConsole[level] = wrappedLevels[level ]; }); - try { - return callback(); - } - finally { - // Revert restoration to wrapped state - Object.keys(wrappedLevels).forEach(function (level) { - originalConsole[level] = wrappedLevels[level]; - }); - } + } } + function makeLogger() { - var enabled = false; - var logger = { - enable: function () { - enabled = true; - }, - disable: function () { - enabled = false; - }, - }; - if (_flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"]) { - CONSOLE_LEVELS.forEach(function (name) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - logger[name] = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (enabled) { - consoleSandbox(function () { - var _a; - (_a = global.console)[name].apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([PREFIX + "[" + name + "]:"], args)); - }); - } - }; - }); - } - else { - CONSOLE_LEVELS.forEach(function (name) { - logger[name] = function () { return undefined; }; - }); - } - return logger; + let enabled = false; + const logger = { + enable: () => { + enabled = true; + }, + disable: () => { + enabled = false; + }, + }; + + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + CONSOLE_LEVELS.forEach(name => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + logger[name] = (...args) => { + if (enabled) { + consoleSandbox(() => { + _worldwide_js__WEBPACK_IMPORTED_MODULE_0__["GLOBAL_OBJ"].console[name](`${PREFIX}[${name}]:`, ...args); + }); + } + }; + }); + } else { + CONSOLE_LEVELS.forEach(name => { + logger[name] = () => undefined; + }); + } + + return logger ; } + // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used -var logger; -if (_flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"]) { - logger = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalSingleton"])('logger', makeLogger); -} -else { - logger = makeLogger(); +let logger; +if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + logger = Object(_worldwide_js__WEBPACK_IMPORTED_MODULE_0__["getGlobalSingleton"])('logger', makeLogger); +} else { + logger = makeLogger(); } + //# sourceMappingURL=logger.js.map + /***/ }), /***/ "8MEG": @@ -55292,6 +58300,171 @@ module.exports = function (object, index, value) { }; +/***/ }), + +/***/ "8ckN": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorBoundary", function() { return ErrorBoundary; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNKNOWN_COMPONENT", function() { return UNKNOWN_COMPONENT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAtLeastReact17", function() { return isAtLeastReact17; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withErrorBoundary", function() { return withErrorBoundary; }); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("WSEr"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("2mql"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("q1tI"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); + + + + + +const _jsxFileName = "/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/errorboundary.tsx"; +function isAtLeastReact17(version) { + const major = version.match(/^([^.]+)/); + return major !== null && parseInt(major[0]) >= 17; +} + +const UNKNOWN_COMPONENT = 'unknown'; + +const INITIAL_STATE = { + componentStack: null, + error: null, + eventId: null, +}; + +/** + * A ErrorBoundary component that logs errors to Sentry. Requires React >= 16. + * NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the + * Sentry React SDK ErrorBoundary caught an error invoking your application code. This + * is expected behavior and NOT indicative of a bug with the Sentry React SDK. + */ +class ErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_3__["Component"] {constructor(...args) { super(...args); ErrorBoundary.prototype.__init.call(this);ErrorBoundary.prototype.__init2.call(this); } + __init() {this.state = INITIAL_STATE;} + + componentDidCatch(error, { componentStack }) { + const { beforeCapture, onError, showDialog, dialogOptions } = this.props; + + Object(_sentry_browser__WEBPACK_IMPORTED_MODULE_0__["withScope"])(scope => { + // If on React version >= 17, create stack trace from componentStack param and links + // to to the original error using `error.cause` otherwise relies on error param for stacktrace. + // Linking errors requires the `LinkedErrors` integration be enabled. + // See: https://reactjs.org/blog/2020/08/10/react-v17-rc.html#native-component-stacks + // + // Although `componentDidCatch` is typed to accept an `Error` object, it can also be invoked + // with non-error objects. This is why we need to check if the error is an error-like object. + // See: https://github.com/getsentry/sentry-javascript/issues/6167 + if (isAtLeastReact17(react__WEBPACK_IMPORTED_MODULE_3__["version"]) && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isError"])(error)) { + const errorBoundaryError = new Error(error.message); + errorBoundaryError.name = `React ErrorBoundary ${errorBoundaryError.name}`; + errorBoundaryError.stack = componentStack; + + // Using the `LinkedErrors` integration to link the errors together. + error.cause = errorBoundaryError; + } + + if (beforeCapture) { + beforeCapture(scope, error, componentStack); + } + const eventId = Object(_sentry_browser__WEBPACK_IMPORTED_MODULE_0__["captureException"])(error, { contexts: { react: { componentStack } } }); + if (onError) { + onError(error, componentStack, eventId); + } + if (showDialog) { + Object(_sentry_browser__WEBPACK_IMPORTED_MODULE_0__["showReportDialog"])({ ...dialogOptions, eventId }); + } + + // componentDidCatch is used over getDerivedStateFromError + // so that componentStack is accessible through state. + this.setState({ error, componentStack, eventId }); + }); + } + + componentDidMount() { + const { onMount } = this.props; + if (onMount) { + onMount(); + } + } + + componentWillUnmount() { + const { error, componentStack, eventId } = this.state; + const { onUnmount } = this.props; + if (onUnmount) { + onUnmount(error, componentStack, eventId); + } + } + + __init2() {this.resetErrorBoundary = () => { + const { onReset } = this.props; + const { error, componentStack, eventId } = this.state; + if (onReset) { + onReset(error, componentStack, eventId); + } + this.setState(INITIAL_STATE); + };} + + render() { + const { fallback, children } = this.props; + const { error, componentStack, eventId } = this.state; + + if (error) { + let element = undefined; + if (typeof fallback === 'function') { + element = fallback({ error, componentStack, resetError: this.resetErrorBoundary, eventId }); + } else { + element = fallback; + } + + if (react__WEBPACK_IMPORTED_MODULE_3__["isValidElement"](element)) { + return element; + } + + if (fallback) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('fallback did not produce a valid ReactElement'); + } + + // Fail gracefully if no fallback provided or is not valid + return null; + } + + if (typeof children === 'function') { + return (children )(); + } + return children; + } +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function withErrorBoundary( + WrappedComponent, + errorBoundaryOptions, +) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const componentDisplayName = WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT; + + const Wrapped = (props) => ( + react__WEBPACK_IMPORTED_MODULE_3__["createElement"](ErrorBoundary, { ...errorBoundaryOptions, __self: this, __source: {fileName: _jsxFileName, lineNumber: 173}} + , react__WEBPACK_IMPORTED_MODULE_3__["createElement"](WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 174}} ) + ) + ); + + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + Wrapped.displayName = `errorBoundary(${componentDisplayName})`; + + // Copy over static methods from Wrapped component to Profiler HOC + // See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over + hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2___default()(Wrapped, WrappedComponent); + return Wrapped; +} + + +//# sourceMappingURL=errorboundary.js.map + + /***/ }), /***/ "8cru": @@ -55579,6 +58752,80 @@ __webpack_require__.r(__webpack_exports__); var slice = Array.prototype.slice; +/***/ }), + +/***/ "8f/b": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ERROR_TRANSPORT_CATEGORY", function() { return ERROR_TRANSPORT_CATEGORY; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRANSACTION_TRANSPORT_CATEGORY", function() { return TRANSACTION_TRANSPORT_CATEGORY; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ATTACHMENT_TRANSPORT_CATEGORY", function() { return ATTACHMENT_TRANSPORT_CATEGORY; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SESSION_TRANSPORT_CATEGORY", function() { return SESSION_TRANSPORT_CATEGORY; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_TRANSPORT_BUFFER_SIZE", function() { return DEFAULT_TRANSPORT_BUFFER_SIZE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTransport", function() { return createTransport; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Um2S"); + +var ERROR_TRANSPORT_CATEGORY = 'error'; +var TRANSACTION_TRANSPORT_CATEGORY = 'transaction'; +var ATTACHMENT_TRANSPORT_CATEGORY = 'attachment'; +var SESSION_TRANSPORT_CATEGORY = 'session'; +var DEFAULT_TRANSPORT_BUFFER_SIZE = 30; +/** + * Creates a `NewTransport` + * + * @param options + * @param makeRequest + */ +function createTransport(options, makeRequest, buffer) { + if (buffer === void 0) { buffer = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makePromiseBuffer"])(options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE); } + var rateLimits = {}; + var flush = function (timeout) { return buffer.drain(timeout); }; + function send(envelope) { + var envCategory = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getEnvelopeType"])(envelope); + var category = envCategory === 'event' ? 'error' : envCategory; + var request = { + category: category, + body: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["serializeEnvelope"])(envelope), + }; + // Don't add to buffer if transport is already rate-limited + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isRateLimited"])(rateLimits, category)) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["rejectedSyncPromise"])({ + status: 'rate_limit', + reason: getRateLimitReason(rateLimits, category), + }); + } + var requestTask = function () { + return makeRequest(request).then(function (_a) { + var body = _a.body, headers = _a.headers, reason = _a.reason, statusCode = _a.statusCode; + var status = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["eventStatusFromHttpCode"])(statusCode); + if (headers) { + rateLimits = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["updateRateLimits"])(rateLimits, headers); + } + if (status === 'success') { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["resolvedSyncPromise"])({ status: status, reason: reason }); + } + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["rejectedSyncPromise"])({ + status: status, + reason: reason || + body || + (status === 'rate_limit' ? getRateLimitReason(rateLimits, category) : 'Unknown transport error'), + }); + }); + }; + return buffer.add(requestTask); + } + return { + send: send, + flush: flush, + }; +} +function getRateLimitReason(rateLimits, category) { + return "Too many " + category + " requests, backing off until: " + new Date(Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["disabledUntil"])(rateLimits, category)).toISOString(); +} +//# sourceMappingURL=base.js.map + /***/ }), /***/ "8gOx": @@ -56412,11 +59659,14 @@ function responsiveProperty(_ref3) { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRACEPARENT_REGEXP", function() { return TRACEPARENT_REGEXP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractTraceparentData", function() { return extractTraceparentData; }); -var TRACEPARENT_REGEXP = new RegExp('^[ \\t]*' + // whitespace +const TRACEPARENT_REGEXP = new RegExp( + '^[ \\t]*' + // whitespace '([0-9a-f]{32})?' + // trace_id '-?([0-9a-f]{16})?' + // span_id '-?([01])?' + // sampled - '[ \\t]*$'); + '[ \\t]*$', // whitespace +); + /** * Extract transaction context data from a `sentry-trace` header. * @@ -56425,25 +59675,31 @@ var TRACEPARENT_REGEXP = new RegExp('^[ \\t]*' + // whitespace * @returns Object containing data from the header, or undefined if traceparent string is malformed */ function extractTraceparentData(traceparent) { - var matches = traceparent.match(TRACEPARENT_REGEXP); - if (matches) { - var parentSampled = void 0; - if (matches[3] === '1') { - parentSampled = true; - } - else if (matches[3] === '0') { - parentSampled = false; - } - return { - traceId: matches[1], - parentSampled: parentSampled, - parentSpanId: matches[2], - }; - } + const matches = traceparent.match(TRACEPARENT_REGEXP); + + if (!traceparent || !matches) { + // empty string or no matches is invalid traceparent data return undefined; + } + + let parentSampled; + if (matches[3] === '1') { + parentSampled = true; + } else if (matches[3] === '0') { + parentSampled = false; + } + + return { + traceId: matches[1], + parentSampled, + parentSpanId: matches[2], + }; } + + //# sourceMappingURL=tracing.js.map + /***/ }), /***/ "8zEF": @@ -56581,19 +59837,17 @@ exports.decrypt = function(alg, key, cdata, props) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uuid4", function() { return uuid4; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return parseUrl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEventDescription", function() { return getEventDescription; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addExceptionTypeValue", function() { return addExceptionTypeValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addExceptionMechanism", function() { return addExceptionMechanism; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseSemver", function() { return parseSemver; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContextToFrame", function() { return addContextToFrame; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripUrlQueryAndFragment", function() { return stripUrlQueryAndFragment; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addExceptionMechanism", function() { return addExceptionMechanism; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addExceptionTypeValue", function() { return addExceptionTypeValue; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayify", function() { return arrayify; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkOrSetAlreadyCaught", function() { return checkOrSetAlreadyCaught; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("z+RT"); -/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("6PXS"); -/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("+924"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEventDescription", function() { return getEventDescription; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseSemver", function() { return parseSemver; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uuid4", function() { return uuid4; }); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("6PXS"); +/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("+924"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("rbyU"); @@ -56604,82 +59858,48 @@ __webpack_require__.r(__webpack_exports__); * @returns string Generated UUID4. */ function uuid4() { - var global = Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); - var crypto = global.crypto || global.msCrypto; - if (!(crypto === void 0) && crypto.getRandomValues) { - // Use window.crypto API if available - var arr = new Uint16Array(8); - crypto.getRandomValues(arr); - // set 4 in byte 7 - // eslint-disable-next-line no-bitwise - arr[3] = (arr[3] & 0xfff) | 0x4000; - // set 2 most significant bits of byte 9 to '10' - // eslint-disable-next-line no-bitwise - arr[4] = (arr[4] & 0x3fff) | 0x8000; - var pad = function (num) { - var v = num.toString(16); - while (v.length < 4) { - v = "0" + v; - } - return v; - }; - return (pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7])); - } - // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 - return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - // eslint-disable-next-line no-bitwise - var r = (Math.random() * 16) | 0; - // eslint-disable-next-line no-bitwise - var v = c === 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); -} -/** - * Parses string form of URL into an object - * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B - * // intentionally using regex and not <a/> href parsing trick because React Native and other - * // environments where DOM might not be available - * @returns parsed URL object - */ -function parseUrl(url) { - if (!url) { - return {}; - } - var match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); - if (!match) { - return {}; - } - // coerce to undefined values to empty string so we don't get 'undefined' - var query = match[6] || ''; - var fragment = match[8] || ''; - return { - host: match[4], - path: match[5], - protocol: match[2], - relative: match[5] + query + fragment, - }; + const gbl = _worldwide_js__WEBPACK_IMPORTED_MODULE_2__["GLOBAL_OBJ"] ; + const crypto = gbl.crypto || gbl.msCrypto; + + if (crypto && crypto.randomUUID) { + return crypto.randomUUID().replace(/-/g, ''); + } + + const getRandomByte = + crypto && crypto.getRandomValues ? () => crypto.getRandomValues(new Uint8Array(1))[0] : () => Math.random() * 16; + + // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 + // Concatenating the following numbers as strings results in '10000000100040008000100000000000' + 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] : undefined; + return event.exception && event.exception.values ? event.exception.values[0] : undefined; } + /** * Extracts either message or type+value from an event that can be used for user-facing logs * @returns event's description */ function getEventDescription(event) { - var message = event.message, eventId = event.event_id; - if (message) { - return message; - } - var firstException = getFirstException(event); - if (firstException) { - if (firstException.type && firstException.value) { - return firstException.type + ": " + firstException.value; - } - return firstException.type || firstException.value || eventId || '<unknown>'; + 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 eventId || '<unknown>'; + return firstException.type || firstException.value || eventId || '<unknown>'; + } + return eventId || '<unknown>'; } + /** * Adds exception values, type and value to an synthetic Exception. * @param event The event to modify. @@ -56688,16 +59908,17 @@ function getEventDescription(event) { * @hidden */ function addExceptionTypeValue(event, value, type) { - var exception = (event.exception = event.exception || {}); - var values = (exception.values = exception.values || []); - var firstException = (values[0] = values[0] || {}); - if (!firstException.value) { - firstException.value = value || ''; - } - if (!firstException.type) { - firstException.type = type || 'Error'; - } + 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'; + } } + /** * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed. * @@ -56706,37 +59927,47 @@ function addExceptionTypeValue(event, value, type) { * @hidden */ function addExceptionMechanism(event, newMechanism) { - var firstException = getFirstException(event); - if (!firstException) { - return; - } - var defaultMechanism = { type: 'generic', handled: true }; - var currentMechanism = firstException.mechanism; - firstException.mechanism = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, defaultMechanism), currentMechanism), newMechanism); - if (newMechanism && 'data' in newMechanism) { - var mergedData = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, (currentMechanism && currentMechanism.data)), newMechanism.data); - firstException.mechanism.data = mergedData; - } + 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; + } } + // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string -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-]+)*))?$/; +const 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-]+)*))?$/; + +/** + * Represents Semantic Versioning object + */ + /** * Parses input into a SemVer interface * @param input string representation of a semver version */ function parseSemver(input) { - var match = input.match(SEMVER_REGEXP) || []; - var major = parseInt(match[1], 10); - var minor = parseInt(match[2], 10); - var patch = parseInt(match[3], 10); - return { - buildmetadata: match[5], - major: isNaN(major) ? undefined : major, - minor: isNaN(minor) ? undefined : minor, - patch: isNaN(patch) ? undefined : patch, - prerelease: match[4], - }; + 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) ? undefined : major, + minor: isNaN(minor) ? undefined : minor, + patch: isNaN(patch) ? undefined : patch, + prerelease: match[4], + }; } + /** * This function adds context (pre/post/line) lines to the provided frame * @@ -56744,29 +59975,22 @@ function parseSemver(input) { * @param frame StackFrame that will be mutated * @param linesOfContext number of context lines we want to add pre/post */ -function addContextToFrame(lines, frame, linesOfContext) { - if (linesOfContext === void 0) { linesOfContext = 5; } - var lineno = frame.lineno || 0; - var maxLines = lines.length; - var sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0); - frame.pre_context = lines - .slice(Math.max(0, sourceLine - linesOfContext), sourceLine) - .map(function (line) { return Object(_string__WEBPACK_IMPORTED_MODULE_3__["snipLine"])(line, 0); }); - frame.context_line = Object(_string__WEBPACK_IMPORTED_MODULE_3__["snipLine"])(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0); - frame.post_context = lines - .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext) - .map(function (line) { return Object(_string__WEBPACK_IMPORTED_MODULE_3__["snipLine"])(line, 0); }); -} -/** - * Strip the query string and fragment off of a given URL or path (if present) - * - * @param urlPath Full URL or path, including possible query string and/or fragment - * @returns URL or path without query string or fragment - */ -function stripUrlQueryAndFragment(urlPath) { - // eslint-disable-next-line no-useless-escape - return urlPath.split(/[\?#]/, 1)[0]; +function addContextToFrame(lines, frame, linesOfContext = 5) { + const lineno = frame.lineno || 0; + const maxLines = lines.length; + const sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0); + + frame.pre_context = lines + .slice(Math.max(0, sourceLine - linesOfContext), sourceLine) + .map((line) => Object(_string_js__WEBPACK_IMPORTED_MODULE_1__["snipLine"])(line, 0)); + + frame.context_line = Object(_string_js__WEBPACK_IMPORTED_MODULE_1__["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) => Object(_string_js__WEBPACK_IMPORTED_MODULE_1__["snipLine"])(line, 0)); } + /** * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object * in question), and marks it captured if not. @@ -56789,22 +60013,36 @@ function stripUrlQueryAndFragment(urlPath) { * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen) */ function checkOrSetAlreadyCaught(exception) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - if (exception && exception.__sentry_captured__) { - return true; - } - try { - // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the - // `ExtraErrorData` integration - Object(_object__WEBPACK_IMPORTED_MODULE_2__["addNonEnumerableProperty"])(exception, '__sentry_captured__', true); - } - catch (err) { - // `exception` is a primitive, so we can't mark it seen - } - return false; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (exception && (exception ).__sentry_captured__) { + return true; + } + + try { + // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the + // `ExtraErrorData` integration + Object(_object_js__WEBPACK_IMPORTED_MODULE_0__["addNonEnumerableProperty"])(exception , '__sentry_captured__', true); + } catch (err) { + // `exception` is a primitive, so we can't mark it seen + } + + return false; +} + +/** + * Checks whether the given input is already an array, and if it isn't, wraps it in one. + * + * @param maybeArray Input to turn into an array, if necessary + * @returns The input, if already an array, or an array with the input as the only element, if not + */ +function arrayify(maybeArray) { + return Array.isArray(maybeArray) ? maybeArray : [maybeArray]; } + + //# sourceMappingURL=misc.js.map + /***/ }), /***/ "90/1": @@ -57318,24 +60556,23 @@ __webpack_require__.r(__webpack_exports__); "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return isError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isErrorEvent", function() { return isErrorEvent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDOMError", function() { return isDOMError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDOMException", function() { return isDOMException; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPrimitive", function() { return isPrimitive; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return isPlainObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEvent", function() { return isEvent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return isElement; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return isError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isErrorEvent", function() { return isErrorEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEvent", function() { return isEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInstanceOf", function() { return isInstanceOf; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return isNaN; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return isPlainObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPrimitive", function() { return isPrimitive; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return isRegExp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isThenable", function() { return isThenable; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSyntheticEvent", function() { return isSyntheticEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return isNaN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInstanceOf", function() { return isInstanceOf; }); -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isThenable", function() { return isThenable; }); // eslint-disable-next-line @typescript-eslint/unbound-method -var objectToString = Object.prototype.toString; +const objectToString = Object.prototype.toString; + /** * Checks whether given value's type is one of a few Error or Error-like * {@link isError}. @@ -57344,18 +60581,26 @@ var objectToString = Object.prototype.toString; * @returns A boolean representing the result. */ function isError(wat) { - switch (objectToString.call(wat)) { - case '[object Error]': - case '[object Exception]': - case '[object DOMException]': - return true; - default: - return isInstanceOf(wat, Error); - } + switch (objectToString.call(wat)) { + case '[object Error]': + case '[object Exception]': + case '[object DOMException]': + return true; + default: + return isInstanceOf(wat, Error); + } } -function isBuiltin(wat, ty) { - return objectToString.call(wat) === "[object " + ty + "]"; +/** + * Checks whether given value is an instance of the given built-in class. + * + * @param wat The value to be checked + * @param className + * @returns A boolean representing the result. + */ +function isBuiltin(wat, className) { + return objectToString.call(wat) === `[object ${className}]`; } + /** * Checks whether given value's type is ErrorEvent * {@link isErrorEvent}. @@ -57364,8 +60609,9 @@ function isBuiltin(wat, ty) { * @returns A boolean representing the result. */ function isErrorEvent(wat) { - return isBuiltin(wat, 'ErrorEvent'); + return isBuiltin(wat, 'ErrorEvent'); } + /** * Checks whether given value's type is DOMError * {@link isDOMError}. @@ -57374,8 +60620,9 @@ function isErrorEvent(wat) { * @returns A boolean representing the result. */ function isDOMError(wat) { - return isBuiltin(wat, 'DOMError'); + return isBuiltin(wat, 'DOMError'); } + /** * Checks whether given value's type is DOMException * {@link isDOMException}. @@ -57384,8 +60631,9 @@ function isDOMError(wat) { * @returns A boolean representing the result. */ function isDOMException(wat) { - return isBuiltin(wat, 'DOMException'); + return isBuiltin(wat, 'DOMException'); } + /** * Checks whether given value's type is a string * {@link isString}. @@ -57394,8 +60642,9 @@ function isDOMException(wat) { * @returns A boolean representing the result. */ function isString(wat) { - return isBuiltin(wat, 'String'); + return isBuiltin(wat, 'String'); } + /** * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol) * {@link isPrimitive}. @@ -57404,8 +60653,9 @@ function isString(wat) { * @returns A boolean representing the result. */ function isPrimitive(wat) { - return wat === null || (typeof wat !== 'object' && typeof wat !== 'function'); + return wat === null || (typeof wat !== 'object' && typeof wat !== 'function'); } + /** * Checks whether given value's type is an object literal * {@link isPlainObject}. @@ -57414,8 +60664,9 @@ function isPrimitive(wat) { * @returns A boolean representing the result. */ function isPlainObject(wat) { - return isBuiltin(wat, 'Object'); + return isBuiltin(wat, 'Object'); } + /** * Checks whether given value's type is an Event instance * {@link isEvent}. @@ -57424,8 +60675,9 @@ function isPlainObject(wat) { * @returns A boolean representing the result. */ function isEvent(wat) { - return typeof Event !== 'undefined' && isInstanceOf(wat, Event); + return typeof Event !== 'undefined' && isInstanceOf(wat, Event); } + /** * Checks whether given value's type is an Element instance * {@link isElement}. @@ -57434,8 +60686,9 @@ function isEvent(wat) { * @returns A boolean representing the result. */ function isElement(wat) { - return typeof Element !== 'undefined' && isInstanceOf(wat, Element); + return typeof Element !== 'undefined' && isInstanceOf(wat, Element); } + /** * Checks whether given value's type is an regexp * {@link isRegExp}. @@ -57444,16 +60697,18 @@ function isElement(wat) { * @returns A boolean representing the result. */ function isRegExp(wat) { - return isBuiltin(wat, 'RegExp'); + return isBuiltin(wat, 'RegExp'); } + /** * Checks whether given value has a then function. * @param wat A value to be checked. */ function isThenable(wat) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - return Boolean(wat && wat.then && typeof wat.then === 'function'); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return Boolean(wat && wat.then && typeof wat.then === 'function'); } + /** * Checks whether given value's type is a SyntheticEvent * {@link isSyntheticEvent}. @@ -57462,8 +60717,9 @@ function isThenable(wat) { * @returns A boolean representing the result. */ function isSyntheticEvent(wat) { - return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat; + return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat; } + /** * Checks whether given value is NaN * {@link isNaN}. @@ -57472,8 +60728,9 @@ function isSyntheticEvent(wat) { * @returns A boolean representing the result. */ function isNaN(wat) { - return typeof wat === 'number' && wat !== wat; + return typeof wat === 'number' && wat !== wat; } + /** * Checks whether given value's type is an instance of provided constructor. * {@link isInstanceOf}. @@ -57483,15 +60740,17 @@ function isNaN(wat) { * @returns A boolean representing the result. */ function isInstanceOf(wat, base) { - try { - return wat instanceof base; - } - catch (_e) { - return false; - } + try { + return wat instanceof base; + } catch (_e) { + return false; + } } + + //# sourceMappingURL=is.js.map + /***/ }), /***/ "9FdZ": @@ -58264,26 +61523,26 @@ module.exports = BankAccount; "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SentryError", function() { return SentryError; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("NcYE"); +/** An error emitted by Sentry SDKs and related utilities. */ +class SentryError extends Error { + /** Display name of this error instance. */ + constructor( message, logLevel = 'warn') { + super(message);this.message = message;; + + this.name = new.target.prototype.constructor.name; + // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line + // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes + // instances of `SentryError` fail `obj instanceof SentryError` checks. + Object.setPrototypeOf(this, new.target.prototype); + this.logLevel = logLevel; + } +} -/** An error emitted by Sentry SDKs and related utilities. */ -var SentryError = /** @class */ (function (_super) { - Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SentryError, _super); - function SentryError(message) { - var _newTarget = this.constructor; - var _this = _super.call(this, message) || this; - _this.message = message; - _this.name = _newTarget.prototype.constructor.name; - Object(_polyfill__WEBPACK_IMPORTED_MODULE_1__["setPrototypeOf"])(_this, _newTarget.prototype); - return _this; - } - return SentryError; -}(Error)); //# sourceMappingURL=error.js.map + /***/ }), /***/ "9R94": @@ -58792,6 +62051,131 @@ function addQuarters (dirtyDate, dirtyAmount) { module.exports = addQuarters +/***/ }), + +/***/ "9fG0": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return truncate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "snipLine", function() { return snipLine; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeJoin", function() { return safeJoin; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMatchingPattern", function() { return isMatchingPattern; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeStringForRegex", function() { return escapeStringForRegex; }); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4E6N"); + +/** + * Truncates given string to the maximum characters count + * + * @param str An object that contains serializable values + * @param max Maximum number of characters in truncated string (0 = unlimited) + * @returns string Encoded + */ +function truncate(str, max) { + if (max === void 0) { max = 0; } + if (typeof str !== 'string' || max === 0) { + return str; + } + return str.length <= max ? str : str.substr(0, max) + "..."; +} +/** + * This is basically just `trim_line` from + * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67 + * + * @param str An object that contains serializable values + * @param max Maximum number of characters in truncated string + * @returns string Encoded + */ +function snipLine(line, colno) { + var newLine = line; + var lineLength = newLine.length; + if (lineLength <= 150) { + return newLine; + } + if (colno > lineLength) { + // eslint-disable-next-line no-param-reassign + colno = lineLength; + } + var start = Math.max(colno - 60, 0); + if (start < 5) { + start = 0; + } + var 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; +} +/** + * Join values in array + * @param input array of values to be joined together + * @param delimiter string to be placed in-between values + * @returns Joined values + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function safeJoin(input, delimiter) { + if (!Array.isArray(input)) { + return ''; + } + var output = []; + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (var i = 0; i < input.length; i++) { + var value = input[i]; + try { + output.push(String(value)); + } + catch (e) { + output.push('[value cannot be serialized]'); + } + } + return output.join(delimiter); +} +/** + * Checks if the value matches a regex or includes the string + * @param value The string value to be checked against + * @param pattern Either a regex or a string that must be contained in value + */ +function isMatchingPattern(value, pattern) { + if (!Object(_is__WEBPACK_IMPORTED_MODULE_0__["isString"])(value)) { + return false; + } + if (Object(_is__WEBPACK_IMPORTED_MODULE_0__["isRegExp"])(pattern)) { + return pattern.test(value); + } + if (typeof pattern === 'string') { + return value.indexOf(pattern) !== -1; + } + return false; +} +/** + * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to + * `new RegExp()`. + * + * Based on https://github.com/sindresorhus/escape-string-regexp. Vendored to a) reduce the size by skipping the runtime + * type-checking, and b) ensure it gets down-compiled for old versions of Node (the published package only supports Node + * 12+). + * + * @param regexString The string to escape + * @returns An version of the string with all special regex characters escaped + */ +function escapeStringForRegex(regexString) { + // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems + // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20. + return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d'); +} +//# sourceMappingURL=string.js.map + /***/ }), /***/ "9fXD": @@ -58813,94 +62197,110 @@ __webpack_require__.r(__webpack_exports__); "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("PIsB"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Severity", function() { return _sentry_types__WEBPACK_IMPORTED_MODULE_0__["Severity"]; }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionToString", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["FunctionToString"]; }); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["Hub"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["addBreadcrumb"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InboundFilters", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["InboundFilters"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureException"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["SDK_VERSION"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureEvent"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["Scope"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["addBreadcrumb"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["configureScope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["addGlobalEventProcessor"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["getHubFromCarrier"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["captureEvent"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["captureException"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Hub"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["captureMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["makeMain"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["configureScope"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Scope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createTransport", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["createTransport"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Session", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Session"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["startTransaction"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["getHubFromCarrier"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["SDK_VERSION"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["makeMain"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setContext"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["setContext"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setExtra"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["setExtra"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setExtras"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["setExtras"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setTag"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["setTag"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setTags"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["setTags"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setUser"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["setUser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["withScope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["startTransaction"]; }); -/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("kWuB"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrowserClient", function() { return _client__WEBPACK_IMPORTED_MODULE_2__["BrowserClient"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_0__["withScope"]; }); -/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("vzc1"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "injectReportDialog", function() { return _helpers__WEBPACK_IMPORTED_MODULE_3__["injectReportDialog"]; }); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("vzc1"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WINDOW", function() { return _helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"]; }); -/* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("IS+8"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventFromException", function() { return _eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromException"]; }); +/* harmony import */ var _client_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("kWuB"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrowserClient", function() { return _client_js__WEBPACK_IMPORTED_MODULE_2__["BrowserClient"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventFromMessage", function() { return _eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromMessage"]; }); +/* harmony import */ var _transports_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("nXHh"); +/* harmony import */ var _stack_parsers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("xHdX"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chromeStackLineParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_4__["chromeStackLineParser"]; }); -/* harmony import */ var _sdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("3CEA"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIntegrations", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["defaultIntegrations"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultStackLineParsers", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_4__["defaultStackLineParsers"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceLoad", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["forceLoad"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultStackParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_4__["defaultStackParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "init", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["init"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geckoStackLineParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_4__["geckoStackLineParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastEventId", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["lastEventId"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "opera10StackLineParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_4__["opera10StackLineParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["onLoad"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "opera11StackLineParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_4__["opera11StackLineParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showReportDialog", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["showReportDialog"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "winjsStackLineParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_4__["winjsStackLineParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["flush"]; }); +/* harmony import */ var _sdk_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("3CEA"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "close", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_5__["close"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "close", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["close"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIntegrations", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_5__["defaultIntegrations"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["wrap"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_5__["flush"]; }); -/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("omaz"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_NAME", function() { return _version__WEBPACK_IMPORTED_MODULE_6__["SDK_NAME"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceLoad", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_5__["forceLoad"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "init", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_5__["init"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastEventId", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_5__["lastEventId"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_5__["onLoad"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showReportDialog", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_5__["showReportDialog"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_5__["wrap"]; }); +/* harmony import */ var _integrations_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("4kjc"); + + +; + +; +; //# sourceMappingURL=exports.js.map + /***/ }), /***/ "9fje": @@ -60193,6 +63593,146 @@ function isThisYear (dirtyDate) { module.exports = isThisYear +/***/ }), + +/***/ "9nR2": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "chromeStackParser", function() { return chromeStackParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "geckoStackParser", function() { return geckoStackParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "winjsStackParser", function() { return winjsStackParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "opera10StackParser", function() { return opera10StackParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "opera11StackParser", function() { return opera11StackParser; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); + +// global reference to slice +var UNKNOWN_FUNCTION = '?'; +var OPERA10_PRIORITY = 10; +var OPERA11_PRIORITY = 20; +var CHROME_PRIORITY = 30; +var WINJS_PRIORITY = 40; +var GECKO_PRIORITY = 50; +function createFrame(filename, func, lineno, colno) { + var frame = { + filename: filename, + function: func, + // All browser frames are considered in_app + in_app: true, + }; + if (lineno !== undefined) { + frame.lineno = lineno; + } + if (colno !== undefined) { + frame.colno = colno; + } + return frame; +} +// Chromium based browsers: Chrome, Brave, new Opera, new Edge +var chromeRegex = /^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; +var chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; +var chrome = function (line) { + var parts = chromeRegex.exec(line); + if (parts) { + var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line + if (isEval) { + var subMatch = chromeEvalRegex.exec(parts[2]); + if (subMatch) { + // throw out eval line/column and use top-most line/column number + parts[2] = subMatch[1]; // url + parts[3] = subMatch[2]; // line + parts[4] = subMatch[3]; // column + } + } + // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now + // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable) + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]), 2), func = _a[0], filename = _a[1]; + return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined); + } + return; +}; +var chromeStackParser = [CHROME_PRIORITY, chrome]; +// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it +// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js +// We need this specific case for now because we want no other regex to match. +var geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; +var geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; +var gecko = function (line) { + var _a; + var parts = geckoREgex.exec(line); + if (parts) { + var isEval = parts[3] && parts[3].indexOf(' > eval') > -1; + if (isEval) { + var subMatch = geckoEvalRegex.exec(parts[3]); + if (subMatch) { + // throw out eval line/column and use top-most line number + parts[1] = parts[1] || 'eval'; + parts[3] = subMatch[1]; + parts[4] = subMatch[2]; + parts[5] = ''; // no column when eval + } + } + var filename = parts[3]; + var func = parts[1] || UNKNOWN_FUNCTION; + _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(extractSafariExtensionDetails(func, filename), 2), func = _a[0], filename = _a[1]; + return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined); + } + return; +}; +var geckoStackParser = [GECKO_PRIORITY, gecko]; +var winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i; +var winjs = function (line) { + var parts = winjsRegex.exec(line); + return parts + ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) + : undefined; +}; +var winjsStackParser = [WINJS_PRIORITY, winjs]; +var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i; +var opera10 = function (line) { + var parts = opera10Regex.exec(line); + return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined; +}; +var opera10StackParser = [OPERA10_PRIORITY, opera10]; +var opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i; +var opera11 = function (line) { + var parts = opera11Regex.exec(line); + return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined; +}; +var opera11StackParser = [OPERA11_PRIORITY, opera11]; +/** + * Safari web extensions, starting version unknown, can produce "frames-only" stacktraces. + * What it means, is that instead of format like: + * + * Error: wat + * at function@url:row:col + * at function@url:row:col + * at function@url:row:col + * + * it produces something like: + * + * function@url:row:col + * function@url:row:col + * function@url:row:col + * + * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch. + * This function is extracted so that we can use it in both places without duplicating the logic. + * Unfortunately "just" changing RegExp is too complicated now and making it pass all tests + * and fix this case seems like an impossible, or at least way too time-consuming task. + */ +var extractSafariExtensionDetails = function (func, filename) { + var isSafariExtension = func.indexOf('safari-extension') !== -1; + var isSafariWebExtension = func.indexOf('safari-web-extension') !== -1; + return isSafariExtension || isSafariWebExtension + ? [ + func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION, + isSafariExtension ? "safari-extension:" + filename : "safari-web-extension:" + filename, + ] + : [func, filename]; +}; +//# sourceMappingURL=stack-parsers.js.map + /***/ }), /***/ "9om9": @@ -65040,6 +68580,108 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "AKTn": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onLCP", function() { return onLCP; }); +/* harmony import */ var _lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Fm1u"); +/* harmony import */ var _lib_getActivationStart_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tVrE"); +/* harmony import */ var _lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("hNpR"); +/* harmony import */ var _lib_initMetric_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("bjvM"); +/* harmony import */ var _lib_observe_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("MaC4"); +/* harmony import */ var _lib_onHidden_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("6mNm"); + + + + + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const reportedMetricIDs = {}; + +/** + * Calculates the [LCP](https://web.dev/lcp/) value for the current page and + * calls the `callback` function once the value is ready (along with the + * relevant `largest-contentful-paint` performance entry used to determine the + * value). The reported value is a `DOMHighResTimeStamp`. + * + * If the `reportAllChanges` configuration option is set to `true`, the + * `callback` function will be called any time a new `largest-contentful-paint` + * performance entry is dispatched, or once the final value of the metric has + * been determined. + */ +const onLCP = (onReport, opts = {}) => { + const visibilityWatcher = Object(_lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_2__["getVisibilityWatcher"])(); + const metric = Object(_lib_initMetric_js__WEBPACK_IMPORTED_MODULE_3__["initMetric"])('LCP'); + let report; + + const handleEntries = (entries) => { + const lastEntry = entries[entries.length - 1] ; + if (lastEntry) { + // The startTime attribute returns the value of the renderTime if it is + // not 0, and the value of the loadTime otherwise. The activationStart + // reference is used because LCP should be relative to page activation + // rather than navigation start if the page was prerendered. + const value = Math.max(lastEntry.startTime - Object(_lib_getActivationStart_js__WEBPACK_IMPORTED_MODULE_1__["getActivationStart"])(), 0); + + // Only report if the page wasn't hidden prior to LCP. + if (value < visibilityWatcher.firstHiddenTime) { + metric.value = value; + metric.entries = [lastEntry]; + report(); + } + } + }; + + const po = Object(_lib_observe_js__WEBPACK_IMPORTED_MODULE_4__["observe"])('largest-contentful-paint', handleEntries); + + if (po) { + report = Object(_lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_0__["bindReporter"])(onReport, metric, opts.reportAllChanges); + + const stopListening = () => { + if (!reportedMetricIDs[metric.id]) { + handleEntries(po.takeRecords() ); + po.disconnect(); + reportedMetricIDs[metric.id] = true; + report(true); + } + }; + + // Stop listening after input. Note: while scrolling is an input that + // stop LCP observation, it's unreliable since it can be programmatically + // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75 + ['keydown', 'click'].forEach(type => { + addEventListener(type, stopListening, { once: true, capture: true }); + }); + + Object(_lib_onHidden_js__WEBPACK_IMPORTED_MODULE_5__["onHidden"])(stopListening, true); + } +}; + + +//# sourceMappingURL=getLCP.js.map + + /***/ }), /***/ "AKWm": @@ -67453,6 +71095,201 @@ Icon.muiName = 'Icon'; name: 'MuiIcon' })(Icon)); +/***/ }), + +/***/ "AsUd": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return addBreadcrumb; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return captureEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return captureException; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return captureMessage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return configureScope; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return setContext; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return setExtra; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return setExtras; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return setTag; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return setTags; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return setUser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return startTransaction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return withScope; }); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GIgW"); + + +// Note: All functions in this file are typed with a return value of `ReturnType<Hub[HUB_FUNCTION]>`, +// where HUB_FUNCTION is some method on the Hub class. +// +// This is done to make sure the top level SDK methods stay in sync with the hub methods. +// Although every method here has an explicit return type, some of them (that map to void returns) do not +// contain `return` keywords. This is done to save on bundle size, as `return` is not minifiable. + +/** + * Captures an exception event and sends it to Sentry. + * + * @param exception An exception-like object. + * @param captureContext Additional scope data to apply to exception event. + * @returns The generated eventId. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types +function captureException(exception, captureContext) { + return Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().captureException(exception, { captureContext }); +} + +/** + * Captures a message event and sends it to Sentry. + * + * @param message The message to send to Sentry. + * @param Severity Define the level of the message. + * @returns The generated eventId. + */ +function captureMessage( + message, + // eslint-disable-next-line deprecation/deprecation + captureContext, +) { + // This is necessary to provide explicit scopes upgrade, without changing the original + // arity of the `captureMessage(message, level)` method. + const level = typeof captureContext === 'string' ? captureContext : undefined; + const context = typeof captureContext !== 'string' ? { captureContext } : undefined; + return Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().captureMessage(message, level, context); +} + +/** + * Captures a manually created event and sends it to Sentry. + * + * @param event The event to send to Sentry. + * @returns The generated eventId. + */ +function captureEvent(event, hint) { + return Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().captureEvent(event, hint); +} + +/** + * Callback to set context information onto the scope. + * @param callback Callback function that receives Scope. + */ +function configureScope(callback) { + Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().configureScope(callback); +} + +/** + * Records a new breadcrumb which will be attached to future events. + * + * Breadcrumbs will be added to subsequent events to provide more context on + * user's actions prior to an error or crash. + * + * @param breadcrumb The breadcrumb to record. + */ +function addBreadcrumb(breadcrumb) { + Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().addBreadcrumb(breadcrumb); +} + +/** + * Sets context data with the given name. + * @param name of the context + * @param context Any kind of data. This data will be normalized. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function setContext(name, context) { + Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().setContext(name, context); +} + +/** + * Set an object that will be merged sent as extra data with the event. + * @param extras Extras object to merge into current context. + */ +function setExtras(extras) { + Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().setExtras(extras); +} + +/** + * Set key:value that will be sent as extra data with the event. + * @param key String of extra + * @param extra Any kind of data. This data will be normalized. + */ +function setExtra(key, extra) { + Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().setExtra(key, extra); +} + +/** + * Set an object that will be merged sent as tags data with the event. + * @param tags Tags context object to merge into current context. + */ +function setTags(tags) { + Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().setTags(tags); +} + +/** + * Set key:value that will be sent as tags data with the event. + * + * Can also be used to unset a tag, by passing `undefined`. + * + * @param key String key of tag + * @param value Value of tag + */ +function setTag(key, value) { + Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().setTag(key, value); +} + +/** + * Updates user context information for future events. + * + * @param user User context object to be set in the current context. Pass `null` to unset the user. + */ +function setUser(user) { + Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().setUser(user); +} + +/** + * Creates a new scope with and executes the given operation within. + * The scope is automatically removed once the operation + * finishes or throws. + * + * This is essentially a convenience function for: + * + * pushScope(); + * callback(); + * popScope(); + * + * @param callback that will be enclosed into push/popScope. + */ +function withScope(callback) { + Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().withScope(callback); +} + +/** + * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation. + * + * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a + * new child span within the transaction or any span, call the respective `.startChild()` method. + * + * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded. + * + * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its + * finished child spans will be sent to Sentry. + * + * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call + * `startTransaction` directly on the hub. + * + * @param context Properties of the new `Transaction`. + * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent + * default values). See {@link Options.tracesSampler}. + * + * @returns The transaction which was just started + */ +function startTransaction( + context, + customSamplingContext, +) { + return Object(_hub_js__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().startTransaction({ ...context }, customSamplingContext); +} + + +//# sourceMappingURL=exports.js.map + + /***/ }), /***/ "AvRE": @@ -73728,6 +77565,56 @@ function isFlattenable(value) { module.exports = isFlattenable; +/***/ }), + +/***/ "BilH": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGlobalObject", function() { return getGlobalObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGlobalSingleton", function() { return getGlobalSingleton; }); +/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Y9XZ"); +/** + * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, + * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. + */ + +var fallbackGlobalObject = {}; +/** + * Safely get global scope object + * + * @returns Global scope object + */ +function getGlobalObject() { + return (Object(_node__WEBPACK_IMPORTED_MODULE_0__["isNodeEnv"])() + ? global + : typeof window !== 'undefined' // eslint-disable-line no-restricted-globals + ? window // eslint-disable-line no-restricted-globals + : typeof self !== 'undefined' + ? self + : fallbackGlobalObject); +} +/** + * Returns a global singleton contained in the global `__SENTRY__` object. + * + * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory + * function and added to the `__SENTRY__` object. + * + * @param name name of the global singleton on __SENTRY__ + * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__` + * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `getGlobalObject`'s return value + * @returns the singleton + */ +function getGlobalSingleton(name, creator, obj) { + var global = (obj || getGlobalObject()); + var __SENTRY__ = (global.__SENTRY__ = global.__SENTRY__ || {}); + var singleton = __SENTRY__[name] || (__SENTRY__[name] = creator()); + return singleton; +} +//# sourceMappingURL=global.js.map +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj"))) + /***/ }), /***/ "BkRI": @@ -75277,6 +79164,55 @@ function ordinal (number) { module.exports = buildFormatLocale +/***/ }), + +/***/ "CJ5d": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerBackgroundTabDetection", function() { return registerBackgroundTabDetection; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("FGHR"); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Wezb"); + + + + +/** + * Add a listener that cancels and finishes a transaction when the global + * document is hidden. + */ +function registerBackgroundTabDetection() { + if (_types_js__WEBPACK_IMPORTED_MODULE_2__["WINDOW"] && _types_js__WEBPACK_IMPORTED_MODULE_2__["WINDOW"].document) { + _types_js__WEBPACK_IMPORTED_MODULE_2__["WINDOW"].document.addEventListener('visibilitychange', () => { + const activeTransaction = Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__["getActiveTransaction"])() ; + if (_types_js__WEBPACK_IMPORTED_MODULE_2__["WINDOW"].document.hidden && activeTransaction) { + const statusType = 'cancelled'; + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log( + `[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${activeTransaction.op}`, + ); + // We should not set status if it is already set, this prevent important statuses like + // error or data loss from being overwritten on transaction. + if (!activeTransaction.status) { + activeTransaction.setStatus(statusType); + } + activeTransaction.setTag('visibilitychange', 'document.hidden'); + activeTransaction.finish(); + } + }); + } else { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('[Tracing] Could not set up background tab detection due to lack of global document'); + } +} + + +//# sourceMappingURL=backgroundtab.js.map + + /***/ }), /***/ "CJxk": @@ -76235,6 +80171,118 @@ function _iterableToArrayLimit(arr, i) { /***/ }), +/***/ "CfKo": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_RETRY_AFTER", function() { return DEFAULT_RETRY_AFTER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseRetryAfterHeader", function() { return parseRetryAfterHeader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disabledUntil", function() { return disabledUntil; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRateLimited", function() { return isRateLimited; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateRateLimits", function() { return updateRateLimits; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); + +var DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds +/** + * Extracts Retry-After value from the request header or returns default value + * @param header string representation of 'Retry-After' header + * @param now current unix timestamp + * + */ +function parseRetryAfterHeader(header, now) { + if (now === void 0) { now = Date.now(); } + var headerDelay = parseInt("" + header, 10); + if (!isNaN(headerDelay)) { + return headerDelay * 1000; + } + var headerDate = Date.parse("" + header); + if (!isNaN(headerDate)) { + return headerDate - now; + } + return DEFAULT_RETRY_AFTER; +} +/** + * Gets the time that given category is disabled until for rate limiting + */ +function disabledUntil(limits, category) { + return limits[category] || limits.all || 0; +} +/** + * Checks if a category is rate limited + */ +function isRateLimited(limits, category, now) { + if (now === void 0) { now = Date.now(); } + return disabledUntil(limits, category) > now; +} +/** + * Update ratelimits from incoming headers. + * Returns true if headers contains a non-empty rate limiting header. + */ +function updateRateLimits(limits, headers, now) { + var e_1, _a, e_2, _b; + if (now === void 0) { now = Date.now(); } + var updatedRateLimits = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, limits); + // "The name is case-insensitive." + // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get + var rateLimitHeader = headers['x-sentry-rate-limits']; + var retryAfterHeader = headers['retry-after']; + if (rateLimitHeader) { + try { + /** + * rate limit headers are of the form + * <header>,<header>,.. + * where each <header> is of the form + * <retry_after>: <categories>: <scope>: <reason_code> + * where + * <retry_after> is a delay in seconds + * <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form + * <category>;<category>;... + * <scope> is what's being limited (org, project, or key) - ignored by SDK + * <reason_code> is an arbitrary string like "org_quota" - ignored by SDK + */ + for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(rateLimitHeader.trim().split(',')), _d = _c.next(); !_d.done; _d = _c.next()) { + var limit = _d.value; + var parameters = limit.split(':', 2); + var headerDelay = parseInt(parameters[0], 10); + var delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default + if (!parameters[1]) { + updatedRateLimits.all = now + delay; + } + else { + try { + for (var _e = (e_2 = void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(parameters[1].split(';'))), _f = _e.next(); !_f.done; _f = _e.next()) { + var category = _f.value; + updatedRateLimits[category] = now + delay; + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (_f && !_f.done && (_b = _e.return)) _b.call(_e); + } + finally { if (e_2) throw e_2.error; } + } + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_d && !_d.done && (_a = _c.return)) _a.call(_c); + } + finally { if (e_1) throw e_1.error; } + } + } + else if (retryAfterHeader) { + updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now); + } + return updatedRateLimits; +} +//# sourceMappingURL=ratelimit.js.map + +/***/ }), + /***/ "Cfrj": /***/ (function(module, exports, __webpack_require__) { @@ -76250,6 +80298,237 @@ module.exports = function (it) { }; +/***/ }), + +/***/ "Chjg": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uuid4", function() { return uuid4; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return parseUrl; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEventDescription", function() { return getEventDescription; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addExceptionTypeValue", function() { return addExceptionTypeValue; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addExceptionMechanism", function() { return addExceptionMechanism; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseSemver", function() { return parseSemver; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContextToFrame", function() { return addContextToFrame; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripUrlQueryAndFragment", function() { return stripUrlQueryAndFragment; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkOrSetAlreadyCaught", function() { return checkOrSetAlreadyCaught; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("BilH"); +/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("y+lv"); +/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("/gRg"); + + + + +/** + * UUID4 generator + * + * @returns string Generated UUID4. + */ +function uuid4() { + var global = Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + var crypto = global.crypto || global.msCrypto; + if (!(crypto === void 0) && crypto.getRandomValues) { + // Use window.crypto API if available + var arr = new Uint16Array(8); + crypto.getRandomValues(arr); + // set 4 in byte 7 + // eslint-disable-next-line no-bitwise + arr[3] = (arr[3] & 0xfff) | 0x4000; + // set 2 most significant bits of byte 9 to '10' + // eslint-disable-next-line no-bitwise + arr[4] = (arr[4] & 0x3fff) | 0x8000; + var pad = function (num) { + var v = num.toString(16); + while (v.length < 4) { + v = "0" + v; + } + return v; + }; + return (pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7])); + } + // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 + return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + // eslint-disable-next-line no-bitwise + var r = (Math.random() * 16) | 0; + // eslint-disable-next-line no-bitwise + var v = c === 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); +} +/** + * Parses string form of URL into an object + * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B + * // intentionally using regex and not <a/> href parsing trick because React Native and other + * // environments where DOM might not be available + * @returns parsed URL object + */ +function parseUrl(url) { + if (!url) { + return {}; + } + var match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); + if (!match) { + return {}; + } + // coerce to undefined values to empty string so we don't get 'undefined' + var query = match[6] || ''; + var fragment = match[8] || ''; + return { + host: match[4], + path: match[5], + protocol: match[2], + relative: match[5] + query + fragment, + }; +} +function getFirstException(event) { + return event.exception && event.exception.values ? event.exception.values[0] : undefined; +} +/** + * Extracts either message or type+value from an event that can be used for user-facing logs + * @returns event's description + */ +function getEventDescription(event) { + var message = event.message, eventId = event.event_id; + if (message) { + return message; + } + var 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>'; +} +/** + * Adds exception values, type and value to an synthetic Exception. + * @param event The event to modify. + * @param value Value of the exception. + * @param type Type of the exception. + * @hidden + */ +function addExceptionTypeValue(event, value, type) { + var exception = (event.exception = event.exception || {}); + var values = (exception.values = exception.values || []); + var firstException = (values[0] = values[0] || {}); + if (!firstException.value) { + firstException.value = value || ''; + } + if (!firstException.type) { + firstException.type = type || 'Error'; + } +} +/** + * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed. + * + * @param event The event to modify. + * @param newMechanism Mechanism data to add to the event. + * @hidden + */ +function addExceptionMechanism(event, newMechanism) { + var firstException = getFirstException(event); + if (!firstException) { + return; + } + var defaultMechanism = { type: 'generic', handled: true }; + var currentMechanism = firstException.mechanism; + firstException.mechanism = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, defaultMechanism), currentMechanism), newMechanism); + if (newMechanism && 'data' in newMechanism) { + var mergedData = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, (currentMechanism && currentMechanism.data)), newMechanism.data); + firstException.mechanism.data = mergedData; + } +} +// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string +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-]+)*))?$/; +/** + * Parses input into a SemVer interface + * @param input string representation of a semver version + */ +function parseSemver(input) { + var match = input.match(SEMVER_REGEXP) || []; + var major = parseInt(match[1], 10); + var minor = parseInt(match[2], 10); + var patch = parseInt(match[3], 10); + return { + buildmetadata: match[5], + major: isNaN(major) ? undefined : major, + minor: isNaN(minor) ? undefined : minor, + patch: isNaN(patch) ? undefined : patch, + prerelease: match[4], + }; +} +/** + * This function adds context (pre/post/line) lines to the provided frame + * + * @param lines string[] containing all lines + * @param frame StackFrame that will be mutated + * @param linesOfContext number of context lines we want to add pre/post + */ +function addContextToFrame(lines, frame, linesOfContext) { + if (linesOfContext === void 0) { linesOfContext = 5; } + var lineno = frame.lineno || 0; + var maxLines = lines.length; + var sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0); + frame.pre_context = lines + .slice(Math.max(0, sourceLine - linesOfContext), sourceLine) + .map(function (line) { return Object(_string__WEBPACK_IMPORTED_MODULE_3__["snipLine"])(line, 0); }); + frame.context_line = Object(_string__WEBPACK_IMPORTED_MODULE_3__["snipLine"])(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0); + frame.post_context = lines + .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext) + .map(function (line) { return Object(_string__WEBPACK_IMPORTED_MODULE_3__["snipLine"])(line, 0); }); +} +/** + * Strip the query string and fragment off of a given URL or path (if present) + * + * @param urlPath Full URL or path, including possible query string and/or fragment + * @returns URL or path without query string or fragment + */ +function stripUrlQueryAndFragment(urlPath) { + // eslint-disable-next-line no-useless-escape + return urlPath.split(/[\?#]/, 1)[0]; +} +/** + * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object + * in question), and marks it captured if not. + * + * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and + * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so + * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because + * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not + * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This + * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we + * see it. + * + * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on + * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent + * object wrapper forms so that this check will always work. However, because we need to flag the exact object which + * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification + * must be done before the exception captured. + * + * @param A thrown exception to check or flag as having been seen + * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen) + */ +function checkOrSetAlreadyCaught(exception) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (exception && exception.__sentry_captured__) { + return true; + } + try { + // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the + // `ExtraErrorData` integration + Object(_object__WEBPACK_IMPORTED_MODULE_2__["addNonEnumerableProperty"])(exception, '__sentry_captured__', true); + } + catch (err) { + // `exception` is a primitive, so we can't mark it seen + } + return false; +} +//# sourceMappingURL=misc.js.map + /***/ }), /***/ "CiDq": @@ -76434,6 +80713,321 @@ function childMatcher(selector) { +/***/ }), + +/***/ "Cpvd": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_addTracingExtensions", function() { return _addTracingExtensions; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addExtensionMethods", function() { return addExtensionMethods; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startIdleTransaction", function() { return startIdleTransaction; }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("2bdC"); +/* harmony import */ var _idletransaction_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("MBYv"); +/* harmony import */ var _transaction_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("EldZ"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("FGHR"); + + + + + + + +/** Returns all trace headers that are currently on the top scope. */ +function traceHeaders() { + const scope = this.getScope(); + if (scope) { + const span = scope.getSpan(); + if (span) { + return { + 'sentry-trace': span.toTraceparent(), + }; + } + } + return {}; +} + +/** + * Makes a sampling decision for the given transaction and stores it on the transaction. + * + * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be + * sent to Sentry. + * + * @param transaction: The transaction needing a sampling decision + * @param options: The current client's options, so we can access `tracesSampleRate` and/or `tracesSampler` + * @param samplingContext: Default and user-provided data which may be used to help make the decision + * + * @returns The given transaction with its `sampled` value set + */ +function sample( + transaction, + options, + samplingContext, +) { + // nothing to do if tracing is not enabled + if (!Object(_utils_js__WEBPACK_IMPORTED_MODULE_5__["hasTracingEnabled"])(options)) { + transaction.sampled = false; + return transaction; + } + + // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that + if (transaction.sampled !== undefined) { + transaction.setMetadata({ + sampleRate: Number(transaction.sampled), + }); + return transaction; + } + + // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` were defined, so one of these should + // work; prefer the hook if so + let sampleRate; + if (typeof options.tracesSampler === 'function') { + sampleRate = options.tracesSampler(samplingContext); + transaction.setMetadata({ + sampleRate: Number(sampleRate), + }); + } else if (samplingContext.parentSampled !== undefined) { + sampleRate = samplingContext.parentSampled; + } else { + sampleRate = options.tracesSampleRate; + transaction.setMetadata({ + sampleRate: Number(sampleRate), + }); + } + + // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The + // only valid values are booleans or numbers between 0 and 1.) + if (!isValidSampleRate(sampleRate)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('[Tracing] Discarding transaction because of invalid sample rate.'); + transaction.sampled = false; + return transaction; + } + + // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped + if (!sampleRate) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log( + `[Tracing] Discarding transaction because ${ + typeof options.tracesSampler === 'function' + ? 'tracesSampler returned 0 or false' + : 'a negative sampling decision was inherited or tracesSampleRate is set to 0' + }`, + ); + transaction.sampled = false; + return transaction; + } + + // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is + // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false. + transaction.sampled = Math.random() < (sampleRate ); + + // if we're not going to keep it, we're done + if (!transaction.sampled) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log( + `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number( + sampleRate, + )})`, + ); + return transaction; + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log(`[Tracing] starting ${transaction.op} transaction - ${transaction.name}`); + return transaction; +} + +/** + * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1). + */ +function isValidSampleRate(rate) { + // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isNaN"])(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn( + `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( + rate, + )} of type ${JSON.stringify(typeof rate)}.`, + ); + return false; + } + + // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false + if (rate < 0 || rate > 1) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`); + return false; + } + return true; +} + +/** + * Creates a new transaction and adds a sampling decision if it doesn't yet have one. + * + * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if + * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an + * "extension method." + * + * @param this: The Hub starting the transaction + * @param transactionContext: Data used to configure the transaction + * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any) + * + * @returns The new transaction + * + * @see {@link Hub.startTransaction} + */ +function _startTransaction( + + transactionContext, + customSamplingContext, +) { + const client = this.getClient(); + const options = (client && client.getOptions()) || {}; + + const configInstrumenter = options.instrumenter || 'sentry'; + const transactionInstrumenter = transactionContext.instrumenter || 'sentry'; + + if (configInstrumenter !== transactionInstrumenter) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error( + `A transaction was started with instrumenter=\`${transactionInstrumenter}\`, but the SDK is configured with the \`${configInstrumenter}\` instrumenter. +The transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`, + ); + + transactionContext.sampled = false; + } + + let transaction = new _transaction_js__WEBPACK_IMPORTED_MODULE_4__["Transaction"](transactionContext, this); + transaction = sample(transaction, options, { + parentSampled: transactionContext.parentSampled, + transactionContext, + ...customSamplingContext, + }); + if (transaction.sampled) { + transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans )); + } + return transaction; +} + +/** + * Create new idle transaction. + */ +function startIdleTransaction( + hub, + transactionContext, + idleTimeout, + finalTimeout, + onScope, + customSamplingContext, + heartbeatInterval, +) { + const client = hub.getClient(); + const options = (client && client.getOptions()) || {}; + + let transaction = new _idletransaction_js__WEBPACK_IMPORTED_MODULE_3__["IdleTransaction"](transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope); + transaction = sample(transaction, options, { + parentSampled: transactionContext.parentSampled, + transactionContext, + ...customSamplingContext, + }); + if (transaction.sampled) { + transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans )); + } + return transaction; +} + +/** + * @private + */ +function _addTracingExtensions() { + const carrier = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getMainCarrier"])(); + if (!carrier.__SENTRY__) { + return; + } + carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {}; + if (!carrier.__SENTRY__.extensions.startTransaction) { + carrier.__SENTRY__.extensions.startTransaction = _startTransaction; + } + if (!carrier.__SENTRY__.extensions.traceHeaders) { + carrier.__SENTRY__.extensions.traceHeaders = traceHeaders; + } +} + +/** + * @private + */ +function _autoloadDatabaseIntegrations() { + const carrier = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getMainCarrier"])(); + if (!carrier.__SENTRY__) { + return; + } + + const packageToIntegrationMapping = { + mongodb() { + const integration = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dynamicRequire"])(module, './integrations/node/mongo') + +; + return new integration.Mongo(); + }, + mongoose() { + const integration = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dynamicRequire"])(module, './integrations/node/mongo') + +; + return new integration.Mongo({ mongoose: true }); + }, + mysql() { + const integration = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dynamicRequire"])(module, './integrations/node/mysql') + +; + return new integration.Mysql(); + }, + pg() { + const integration = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dynamicRequire"])(module, './integrations/node/postgres') + +; + return new integration.Postgres(); + }, + }; + + const mappedPackages = Object.keys(packageToIntegrationMapping) + .filter(moduleName => !!Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["loadModule"])(moduleName)) + .map(pkg => { + try { + return packageToIntegrationMapping[pkg](); + } catch (e) { + return undefined; + } + }) + .filter(p => p) ; + + if (mappedPackages.length > 0) { + carrier.__SENTRY__.integrations = [...(carrier.__SENTRY__.integrations || []), ...mappedPackages]; + } +} + +/** + * This patches the global object and injects the Tracing extensions methods + */ +function addExtensionMethods() { + _addTracingExtensions(); + + // Detect and automatically load specified integrations. + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isNodeEnv"])()) { + _autoloadDatabaseIntegrations(); + } + + // If an error happens globally, we should make sure transaction status is set to error. + Object(_errors_js__WEBPACK_IMPORTED_MODULE_2__["registerErrorInstrumentation"])(); +} + + +//# sourceMappingURL=hubextensions.js.map + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("3UD+")(module))) + /***/ }), /***/ "Ct04": @@ -77335,6 +81929,251 @@ var $export = __webpack_require__("XKFU"); $export($export.S, 'Math', { sign: __webpack_require__("lvtm") }); +/***/ }), + +/***/ "Czdt": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultIntegrations", function() { return defaultIntegrations; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "init", function() { return init; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showReportDialog", function() { return showReportDialog; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastEventId", function() { return lastEventId; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forceLoad", function() { return forceLoad; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return onLoad; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return flush; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "close", function() { return close; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Um2S"); +/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cOvR"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("dO1v"); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("WMn2"); +/* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("YjZj"); + + + + + + + +var defaultIntegrations = [ + new _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Integrations"].InboundFilters(), + new _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Integrations"].FunctionToString(), + new _integrations__WEBPACK_IMPORTED_MODULE_6__["TryCatch"](), + new _integrations__WEBPACK_IMPORTED_MODULE_6__["Breadcrumbs"](), + new _integrations__WEBPACK_IMPORTED_MODULE_6__["GlobalHandlers"](), + new _integrations__WEBPACK_IMPORTED_MODULE_6__["LinkedErrors"](), + new _integrations__WEBPACK_IMPORTED_MODULE_6__["Dedupe"](), + new _integrations__WEBPACK_IMPORTED_MODULE_6__["UserAgent"](), +]; +/** + * The Sentry Browser SDK Client. + * + * To use this SDK, call the {@link init} function as early as possible when + * loading the web page. To set context information or send manual events, use + * the provided methods. + * + * @example + * + * ``` + * + * import { init } from '@sentry/browser'; + * + * init({ + * dsn: '__DSN__', + * // ... + * }); + * ``` + * + * @example + * ``` + * + * import { configureScope } from '@sentry/browser'; + * configureScope((scope: Scope) => { + * scope.setExtra({ battery: 0.7 }); + * scope.setTag({ user_mode: 'admin' }); + * scope.setUser({ id: '4711' }); + * }); + * ``` + * + * @example + * ``` + * + * import { addBreadcrumb } from '@sentry/browser'; + * addBreadcrumb({ + * message: 'My Breadcrumb', + * // ... + * }); + * ``` + * + * @example + * + * ``` + * + * import * as Sentry from '@sentry/browser'; + * Sentry.captureMessage('Hello, world!'); + * Sentry.captureException(new Error('Good bye')); + * Sentry.captureEvent({ + * message: 'Manual', + * stacktrace: [ + * // ... + * ], + * }); + * ``` + * + * @see {@link BrowserOptions} for documentation on configuration options. + */ +function init(options) { + if (options === void 0) { options = {}; } + if (options.defaultIntegrations === undefined) { + options.defaultIntegrations = defaultIntegrations; + } + if (options.release === undefined) { + var window_1 = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); + // This supports the variable that sentry-webpack-plugin injects + if (window_1.SENTRY_RELEASE && window_1.SENTRY_RELEASE.id) { + options.release = window_1.SENTRY_RELEASE.id; + } + } + if (options.autoSessionTracking === undefined) { + options.autoSessionTracking = true; + } + if (options.sendClientReports === undefined) { + options.sendClientReports = true; + } + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["initAndBind"])(_client__WEBPACK_IMPORTED_MODULE_3__["BrowserClient"], options); + if (options.autoSessionTracking) { + startSessionTracking(); + } +} +/** + * Present the user with a report dialog. + * + * @param options Everything is optional, we try to fetch all info need from the global scope. + */ +function showReportDialog(options) { + if (options === void 0) { options = {}; } + var hub = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])(); + var scope = hub.getScope(); + if (scope) { + options.user = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, scope.getUser()), options.user); + } + if (!options.eventId) { + options.eventId = hub.lastEventId(); + } + var client = hub.getClient(); + if (client) { + client.showReportDialog(options); + } +} +/** + * This is the getter for lastEventId. + * + * @returns The last event id of a captured event. + */ +function lastEventId() { + return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().lastEventId(); +} +/** + * This function is here to be API compatible with the loader. + * @hidden + */ +function forceLoad() { + // Noop +} +/** + * This function is here to be API compatible with the loader. + * @hidden + */ +function onLoad(callback) { + callback(); +} +/** + * Call `flush()` on the current client, if there is one. See {@link Client.flush}. + * + * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause + * the client to wait until all events are sent before resolving the promise. + * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it + * doesn't (or if there's no client defined). + */ +function flush(timeout) { + var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().getClient(); + if (client) { + return client.flush(timeout); + } + _flags__WEBPACK_IMPORTED_MODULE_4__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Cannot flush events. No client defined.'); + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["resolvedSyncPromise"])(false); +} +/** + * Call `close()` on the current client, if there is one. See {@link Client.close}. + * + * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this + * parameter will cause the client to wait until all events are sent before disabling itself. + * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it + * doesn't (or if there's no client defined). + */ +function close(timeout) { + var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().getClient(); + if (client) { + return client.close(timeout); + } + _flags__WEBPACK_IMPORTED_MODULE_4__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Cannot flush events and disable SDK. No client defined.'); + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["resolvedSyncPromise"])(false); +} +/** + * Wrap code within a try/catch block so the SDK is able to capture errors. + * + * @param fn A function to wrap. + * + * @returns The result of wrapped function call. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function wrap(fn) { + return Object(_helpers__WEBPACK_IMPORTED_MODULE_5__["wrap"])(fn)(); +} +function startSessionOnHub(hub) { + hub.startSession({ ignoreDuration: true }); + hub.captureSession(); +} +/** + * Enable automatic Session Tracking for the initial page load. + */ +function startSessionTracking() { + var window = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); + var document = window.document; + if (typeof document === 'undefined') { + _flags__WEBPACK_IMPORTED_MODULE_4__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Session tracking in non-browser environment with @sentry/browser is not supported.'); + return; + } + var hub = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])(); + // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and + // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are + // pinned at the same version in package.json, but there are edge cases where it's possible. See + // https://github.com/getsentry/sentry-javascript/issues/3207 and + // https://github.com/getsentry/sentry-javascript/issues/3234 and + // https://github.com/getsentry/sentry-javascript/issues/3278. + if (!hub.captureSession) { + return; + } + // The session duration for browser sessions does not track a meaningful + // concept that can be used as a metric. + // Automatically captured sessions are akin to page views, and thus we + // discard their duration. + startSessionOnHub(hub); + // We want to create a session for every navigation as well + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addInstrumentationHandler"])('history', function (_a) { + var from = _a.from, to = _a.to; + // Don't create an additional session for the initial route or if the location did not change + if (!(from === undefined || from === to)) { + startSessionOnHub(Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])()); + } + }); +} +//# sourceMappingURL=sdk.js.map + /***/ }), /***/ "D/GG": @@ -80315,160 +85154,6 @@ function compareAsc (dirtyDateLeft, dirtyDateRight) { module.exports = compareAsc -/***/ }), - -/***/ "DTjN": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseTransport", function() { return BaseTransport; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TwdF"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("3Uor"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("2TjN"); - - - - - -function requestTypeToCategory(ty) { - var tyStr = ty; - return tyStr === 'event' ? 'error' : tyStr; -} -var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); -/** Base Transport class implementation */ -var BaseTransport = /** @class */ (function () { - function BaseTransport(options) { - var _this = this; - this.options = options; - /** A simple buffer holding all requests. */ - this._buffer = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["makePromiseBuffer"])(30); - /** Locks transport after receiving rate limits in a response */ - this._rateLimits = {}; - this._outcomes = {}; - this._api = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["initAPIDetails"])(options.dsn, options._metadata, options.tunnel); - // eslint-disable-next-line deprecation/deprecation - this.url = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getStoreEndpointWithUrlEncodedAuth"])(this._api.dsn); - if (this.options.sendClientReports && global.document) { - global.document.addEventListener('visibilitychange', function () { - if (global.document.visibilityState === 'hidden') { - _this._flushOutcomes(); - } - }); - } - } - /** - * @inheritDoc - */ - BaseTransport.prototype.sendEvent = function (event) { - return this._sendRequest(Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["eventToSentryRequest"])(event, this._api), event); - }; - /** - * @inheritDoc - */ - BaseTransport.prototype.sendSession = function (session) { - return this._sendRequest(Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["sessionToSentryRequest"])(session, this._api), session); - }; - /** - * @inheritDoc - */ - BaseTransport.prototype.close = function (timeout) { - return this._buffer.drain(timeout); - }; - /** - * @inheritDoc - */ - BaseTransport.prototype.recordLostEvent = function (reason, category) { - var _a; - if (!this.options.sendClientReports) { - return; - } - // We want to track each category (event, transaction, session) separately - // but still keep the distinction between different type of outcomes. - // We could use nested maps, but it's much easier to read and type this way. - // A correct type for map-based implementation if we want to go that route - // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>` - var key = requestTypeToCategory(category) + ":" + reason; - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log("Adding outcome: " + key); - this._outcomes[key] = (_a = this._outcomes[key], (_a !== null && _a !== void 0 ? _a : 0)) + 1; - }; - /** - * Send outcomes as an envelope - */ - BaseTransport.prototype._flushOutcomes = function () { - if (!this.options.sendClientReports) { - return; - } - var outcomes = this._outcomes; - this._outcomes = {}; - // Nothing to send - if (!Object.keys(outcomes).length) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log('No outcomes to flush'); - return; - } - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log("Flushing outcomes:\n" + JSON.stringify(outcomes, null, 2)); - var url = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getEnvelopeEndpointWithUrlEncodedAuth"])(this._api.dsn, this._api.tunnel); - var discardedEvents = Object.keys(outcomes).map(function (key) { - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(key.split(':'), 2), category = _a[0], reason = _a[1]; - return { - reason: reason, - category: category, - quantity: outcomes[key], - }; - // TODO: Improve types on discarded_events to get rid of cast - }); - var envelope = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["createClientReportEnvelope"])(discardedEvents, this._api.tunnel && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["dsnToString"])(this._api.dsn)); - try { - Object(_utils__WEBPACK_IMPORTED_MODULE_4__["sendReport"])(url, Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["serializeEnvelope"])(envelope)); - } - catch (e) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].error(e); - } - }; - /** - * Handle Sentry repsonse for promise-based transports. - */ - BaseTransport.prototype._handleResponse = function (_a) { - var requestType = _a.requestType, response = _a.response, headers = _a.headers, resolve = _a.resolve, reject = _a.reject; - var status = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["eventStatusFromHttpCode"])(response.status); - this._rateLimits = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["updateRateLimits"])(this._rateLimits, headers); - // eslint-disable-next-line deprecation/deprecation - if (this._isRateLimited(requestType)) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && - // eslint-disable-next-line deprecation/deprecation - _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn("Too many " + requestType + " requests, backing off until: " + this._disabledUntil(requestType)); - } - if (status === 'success') { - resolve({ status: status }); - return; - } - reject(response); - }; - /** - * Gets the time that given category is disabled until for rate limiting - * - * @deprecated Please use `disabledUntil` from @sentry/utils - */ - BaseTransport.prototype._disabledUntil = function (requestType) { - var category = requestTypeToCategory(requestType); - return new Date(Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["disabledUntil"])(this._rateLimits, category)); - }; - /** - * Checks if a category is rate limited - * - * @deprecated Please use `isRateLimited` from @sentry/utils - */ - BaseTransport.prototype._isRateLimited = function (requestType) { - var category = requestTypeToCategory(requestType); - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isRateLimited"])(this._rateLimits, category); - }; - return BaseTransport; -}()); - -//# sourceMappingURL=base.js.map - /***/ }), /***/ "DTo2": @@ -80749,6 +85434,70 @@ module.exports = { /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("tjlA").Buffer)) +/***/ }), + +/***/ "DTqw": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNumberOfUrlSegments", function() { return getNumberOfUrlSegments; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return parseUrl; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripUrlQueryAndFragment", function() { return stripUrlQueryAndFragment; }); +/** + * Parses string form of URL into an object + * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B + * // intentionally using regex and not <a/> href parsing trick because React Native and other + * // environments where DOM might not be available + * @returns parsed URL object + */ +function parseUrl(url) + + { + if (!url) { + return {}; + } + + const match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); + + if (!match) { + return {}; + } + + // coerce to undefined values to empty string so we don't get 'undefined' + const query = match[6] || ''; + const fragment = match[8] || ''; + return { + host: match[4], + path: match[5], + protocol: match[2], + relative: match[5] + query + fragment, // everything minus origin + }; +} + +/** + * Strip the query string and fragment off of a given URL or path (if present) + * + * @param urlPath Full URL or path, including possible query string and/or fragment + * @returns URL or path without query string or fragment + */ +function stripUrlQueryAndFragment(urlPath) { + // eslint-disable-next-line no-useless-escape + return urlPath.split(/[\?#]/, 1)[0]; +} + +/** + * Returns number of URL segments of a passed string URL. + */ +function getNumberOfUrlSegments(url) { + // split at '/' or at '\/' to split regex urls correctly + return url.split(/\\?\//).filter(s => s.length > 0 && s !== ',').length; +} + + +//# sourceMappingURL=url.js.map + + /***/ }), /***/ "DUzY": @@ -80801,6 +85550,82 @@ __webpack_require__("Xtr8")('freeze', function ($freeze) { }); +/***/ }), + +/***/ "DWOc": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createReduxEnhancer", function() { return createReduxEnhancer; }); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("WSEr"); + + +/* eslint-disable @typescript-eslint/no-explicit-any */ + +const ACTION_BREADCRUMB_CATEGORY = 'redux.action'; +const ACTION_BREADCRUMB_TYPE = 'info'; + +const defaultOptions = { + actionTransformer: action => action, + stateTransformer: state => state || null, +}; + +/** + * Creates an enhancer that would be passed to Redux's createStore to log actions and the latest state to Sentry. + * + * @param enhancerOptions Options to pass to the enhancer + */ +function createReduxEnhancer(enhancerOptions) { + // Note: We return an any type as to not have type conflicts. + const options = { + ...defaultOptions, + ...enhancerOptions, + }; + + return (next) => + (reducer, initialState) => { + const sentryReducer = (state, action) => { + const newState = reducer(state, action); + + Object(_sentry_browser__WEBPACK_IMPORTED_MODULE_0__["configureScope"])(scope => { + /* Action breadcrumbs */ + const transformedAction = options.actionTransformer(action); + if (typeof transformedAction !== 'undefined' && transformedAction !== null) { + scope.addBreadcrumb({ + category: ACTION_BREADCRUMB_CATEGORY, + data: transformedAction, + type: ACTION_BREADCRUMB_TYPE, + }); + } + + /* Set latest state to scope */ + const transformedState = options.stateTransformer(newState); + if (typeof transformedState !== 'undefined' && transformedState !== null) { + scope.setContext('state', { state: { type: 'redux', value: transformedState } }); + } else { + scope.setContext('state', null); + } + + /* Allow user to configure scope with latest state */ + // eslint-disable-next-line @typescript-eslint/unbound-method + const { configureScopeWithState } = options; + if (typeof configureScopeWithState === 'function') { + configureScopeWithState(scope, newState); + } + }); + + return newState; + }; + + return next(sentryReducer, initialState); + }; +} + + +//# sourceMappingURL=redux.js.map + + /***/ }), /***/ "DWeG": @@ -88943,6 +93768,268 @@ function getFuncName(func) { module.exports = getFuncName; +/***/ }), + +/***/ "ETVo": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGlobalObject", function() { return getGlobalObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGlobalSingleton", function() { return getGlobalSingleton; }); +/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("hnl7"); +/** + * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, + * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. + */ + +var fallbackGlobalObject = {}; +/** + * Safely get global scope object + * + * @returns Global scope object + */ +function getGlobalObject() { + return (Object(_node__WEBPACK_IMPORTED_MODULE_0__["isNodeEnv"])() + ? global + : typeof window !== 'undefined' // eslint-disable-line no-restricted-globals + ? window // eslint-disable-line no-restricted-globals + : typeof self !== 'undefined' + ? self + : fallbackGlobalObject); +} +/** + * Returns a global singleton contained in the global `__SENTRY__` object. + * + * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory + * function and added to the `__SENTRY__` object. + * + * @param name name of the global singleton on __SENTRY__ + * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__` + * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `getGlobalObject`'s return value + * @returns the singleton + */ +function getGlobalSingleton(name, creator, obj) { + var global = (obj || getGlobalObject()); + var __SENTRY__ = (global.__SENTRY__ = global.__SENTRY__ || {}); + var singleton = __SENTRY__[name] || (__SENTRY__[name] = creator()); + return singleton; +} +//# sourceMappingURL=global.js.map +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj"))) + +/***/ }), + +/***/ "EUks": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeToSize", function() { return normalizeToSize; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "walk", function() { return visit; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("4E6N"); +/* harmony import */ var _memo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("KpEf"); +/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("VffJ"); +/* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("5w3M"); + + + + + +/** + * Recursively normalizes the given object. + * + * - Creates a copy to prevent original input mutation + * - Skips non-enumerable properties + * - When stringifying, calls `toJSON` if implemented + * - Removes circular references + * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format + * - Translates known global objects/classes to a string representations + * - Takes care of `Error` object serialization + * - Optionally limits depth of final output + * - Optionally limits number of properties/elements included in any single object/array + * + * @param input The object to be normalized. + * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.) + * @param maxProperties The max number of elements or properties to be included in any single array or + * object in the normallized output.. + * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization. + */ +function normalize(input, depth, maxProperties) { + if (depth === void 0) { depth = +Infinity; } + if (maxProperties === void 0) { maxProperties = +Infinity; } + try { + // since we're at the outermost level, there is no key + return visit('', input, depth, maxProperties); + } + catch (err) { + return { ERROR: "**non-serializable** (" + err + ")" }; + } +} +/** JSDoc */ +function normalizeToSize(object, +// Default Node.js REPL depth +depth, +// 100kB, as 200kB is max payload size, so half sounds reasonable +maxSize) { + if (depth === void 0) { depth = 3; } + if (maxSize === void 0) { maxSize = 100 * 1024; } + var normalized = normalize(object, depth); + if (jsonSize(normalized) > maxSize) { + return normalizeToSize(object, depth - 1, maxSize); + } + return normalized; +} +/** + * Visits a node to perform normalization on it + * + * @param key The key corresponding to the given node + * @param value The node to be visited + * @param depth Optional number indicating the maximum recursion depth + * @param maxProperties Optional maximum number of properties/elements included in any single object/array + * @param memo Optional Memo class handling decycling + */ +function visit(key, value, depth, maxProperties, memo) { + if (depth === void 0) { depth = +Infinity; } + if (maxProperties === void 0) { maxProperties = +Infinity; } + if (memo === void 0) { memo = Object(_memo__WEBPACK_IMPORTED_MODULE_2__["memoBuilder"])(); } + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(memo, 2), memoize = _a[0], unmemoize = _a[1]; + // If the value has a `toJSON` method, see if we can bail and let it do the work + var valueWithToJSON = value; + if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') { + try { + return valueWithToJSON.toJSON(); + } + catch (err) { + // pass (The built-in `toJSON` failed, but we can still try to do it ourselves) + } + } + // Get the simple cases out of the way first + if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !Object(_is__WEBPACK_IMPORTED_MODULE_1__["isNaN"])(value))) { + return value; + } + var stringified = stringifyValue(key, value); + // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`. + // Everything else will have already been serialized, so if we don't see that pattern, we're done. + if (!stringified.startsWith('[object ')) { + return stringified; + } + // We're also done if we've reached the max depth + if (depth === 0) { + // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`. + return stringified.replace('object ', ''); + } + // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now. + if (memoize(value)) { + return '[Circular ~]'; + } + // 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 + // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each + // property/entry, and keep track of the number of items we add to it. + var normalized = (Array.isArray(value) ? [] : {}); + var numAdded = 0; + // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant + // properties are non-enumerable and otherwise would get missed. + var visitable = (Object(_is__WEBPACK_IMPORTED_MODULE_1__["isError"])(value) || Object(_is__WEBPACK_IMPORTED_MODULE_1__["isEvent"])(value) ? Object(_object__WEBPACK_IMPORTED_MODULE_3__["convertToPlainObject"])(value) : value); + for (var visitKey in visitable) { + // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration. + if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { + continue; + } + if (numAdded >= maxProperties) { + normalized[visitKey] = '[MaxProperties ~]'; + break; + } + // Recursively visit all the child nodes + var visitValue = visitable[visitKey]; + normalized[visitKey] = visit(visitKey, visitValue, depth - 1, maxProperties, memo); + numAdded += 1; + } + // Once we've visited all the branches, remove the parent from memo storage + unmemoize(value); + // Return accumulated values + return normalized; +} +// TODO remove this in v7 (this means the method will no longer be exported, under any name) + +/** + * Stringify the given value. Handles various known special values and types. + * + * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn + * the number 1231 into "[Object Number]", nor on `null`, as it will throw. + * + * @param value The value to stringify + * @returns A stringified representation of the given value + */ +function stringifyValue(key, +// this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for +// our internal use, it'll do +value) { + try { + if (key === 'domain' && value && typeof value === 'object' && value._events) { + return '[Domain]'; + } + if (key === 'domainEmitter') { + return '[DomainEmitter]'; + } + // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first + // which won't throw if they are not present. + if (typeof global !== 'undefined' && value === global) { + return '[Global]'; + } + // eslint-disable-next-line no-restricted-globals + if (typeof window !== 'undefined' && value === window) { + return '[Window]'; + } + // eslint-disable-next-line no-restricted-globals + if (typeof document !== 'undefined' && value === document) { + return '[Document]'; + } + // React's SyntheticEvent thingy + if (Object(_is__WEBPACK_IMPORTED_MODULE_1__["isSyntheticEvent"])(value)) { + return '[SyntheticEvent]'; + } + if (typeof value === 'number' && value !== value) { + return '[NaN]'; + } + // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own) + if (value === void 0) { + return '[undefined]'; + } + if (typeof value === 'function') { + return "[Function: " + Object(_stacktrace__WEBPACK_IMPORTED_MODULE_4__["getFunctionName"])(value) + "]"; + } + if (typeof value === 'symbol') { + return "[" + String(value) + "]"; + } + // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion + if (typeof value === 'bigint') { + return "[BigInt: " + String(value) + "]"; + } + // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting + // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as + // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class), + // we can make sure that only plain objects come out that way. + return "[object " + Object.getPrototypeOf(value).constructor.name + "]"; + } + catch (err) { + return "**non-serializable** (" + err + ")"; + } +} +/** Calculates bytes size of input string */ +function utf8Length(value) { + // eslint-disable-next-line no-bitwise + return ~-encodeURI(value).split(/%..|./).length; +} +/** Calculates bytes size of input object */ +function jsonSize(value) { + return utf8Length(JSON.stringify(value)); +} +//# sourceMappingURL=normalize.js.map +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj"))) + /***/ }), /***/ "EUnC": @@ -90005,6 +95092,18 @@ var Stepper = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["forwardRef"](func /***/ }), +/***/ "EjQr": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SDK_NAME", function() { return SDK_NAME; }); +// TODO: Remove in the next major release and rely only on @sentry/core SDK_VERSION and SdkInfo metadata +var SDK_NAME = 'sentry.javascript.browser'; +//# sourceMappingURL=version.js.map + +/***/ }), + /***/ "EjVA": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -90204,6 +95303,297 @@ function lab(start, end) { } +/***/ }), + +/***/ "EldZ": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Transaction", function() { return Transaction; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TwdF"); +/* harmony import */ var _span_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("SYqL"); + + + + + +/** JSDoc */ +class Transaction extends _span_js__WEBPACK_IMPORTED_MODULE_3__["Span"] { + + /** + * The reference to the current hub. + */ + + __init() {this._measurements = {};} + + __init2() {this._contexts = {};} + + __init3() {this._frozenDynamicSamplingContext = undefined;} + + /** + * This constructor should never be called manually. Those instrumenting tracing should use + * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`. + * @internal + * @hideconstructor + * @hidden + */ + constructor(transactionContext, hub) { + super(transactionContext);Transaction.prototype.__init.call(this);Transaction.prototype.__init2.call(this);Transaction.prototype.__init3.call(this);; + + this._hub = hub || Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])(); + + this._name = transactionContext.name || ''; + + this.metadata = { + source: 'custom', + ...transactionContext.metadata, + spanMetadata: {}, + changes: [], + propagations: 0, + }; + + this._trimEnd = transactionContext.trimEnd; + + // this is because transactions are also spans, and spans have a transaction pointer + this.transaction = this; + + // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means + // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means) + const incomingDynamicSamplingContext = this.metadata.dynamicSamplingContext; + if (incomingDynamicSamplingContext) { + // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext` + this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext }; + } + } + + /** Getter for `name` property */ + get name() { + return this._name; + } + + /** Setter for `name` property, which also sets `source` as custom */ + set name(newName) { + this.setName(newName); + } + + /** + * JSDoc + */ + setName(name, source = 'custom') { + // `source` could change without the name changing if we discover that an unparameterized route is actually + // parameterized by virtue of having no parameters in its path + if (name !== this.name || source !== this.metadata.source) { + this.metadata.changes.push({ + // log previous source + source: this.metadata.source, + timestamp: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["timestampInSeconds"])(), + propagations: this.metadata.propagations, + }); + } + + this._name = name; + this.metadata.source = source; + } + + /** + * Attaches SpanRecorder to the span itself + * @param maxlen maximum number of spans that can be recorded + */ + initSpanRecorder(maxlen = 1000) { + if (!this.spanRecorder) { + this.spanRecorder = new _span_js__WEBPACK_IMPORTED_MODULE_3__["SpanRecorder"](maxlen); + } + this.spanRecorder.add(this); + } + + /** + * @inheritDoc + */ + setContext(key, context) { + if (context === null) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this._contexts[key]; + } else { + this._contexts[key] = context; + } + } + + /** + * @inheritDoc + */ + setMeasurement(name, value, unit = '') { + this._measurements[name] = { value, unit }; + } + + /** + * @inheritDoc + */ + setMetadata(newMetadata) { + this.metadata = { ...this.metadata, ...newMetadata }; + } + + /** + * @inheritDoc + */ + finish(endTimestamp) { + // This transaction is already finished, so we should not flush it again. + if (this.endTimestamp !== undefined) { + return undefined; + } + + if (!this.name) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Transaction has no name, falling back to `<unlabeled transaction>`.'); + this.name = '<unlabeled transaction>'; + } + + // just sets the end timestamp + super.finish(endTimestamp); + + if (this.sampled !== true) { + // At this point if `sampled !== true` we want to discard the transaction. + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.'); + + const client = this._hub.getClient(); + if (client) { + client.recordDroppedEvent('sample_rate', 'transaction'); + } + + return undefined; + } + + const finishedSpans = this.spanRecorder ? this.spanRecorder.spans.filter(s => s !== this && s.endTimestamp) : []; + + if (this._trimEnd && finishedSpans.length > 0) { + this.endTimestamp = finishedSpans.reduce((prev, current) => { + if (prev.endTimestamp && current.endTimestamp) { + return prev.endTimestamp > current.endTimestamp ? prev : current; + } + return prev; + }).endTimestamp; + } + + const metadata = this.metadata; + + const transaction = { + contexts: { + ...this._contexts, + // We don't want to override trace context + trace: this.getTraceContext(), + }, + spans: finishedSpans, + start_timestamp: this.startTimestamp, + tags: this.tags, + timestamp: this.endTimestamp, + transaction: this.name, + type: 'transaction', + sdkProcessingMetadata: { + ...metadata, + dynamicSamplingContext: this.getDynamicSamplingContext(), + }, + ...(metadata.source && { + transaction_info: { + source: metadata.source, + changes: metadata.changes, + propagations: metadata.propagations, + }, + }), + }; + + const hasMeasurements = Object.keys(this._measurements).length > 0; + + if (hasMeasurements) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log( + '[Measurements] Adding measurements to transaction', + JSON.stringify(this._measurements, undefined, 2), + ); + transaction.measurements = this._measurements; + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`); + + return this._hub.captureEvent(transaction); + } + + /** + * @inheritDoc + */ + toContext() { + const spanContext = super.toContext(); + + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["dropUndefinedKeys"])({ + ...spanContext, + name: this.name, + trimEnd: this._trimEnd, + }); + } + + /** + * @inheritDoc + */ + updateWithContext(transactionContext) { + super.updateWithContext(transactionContext); + + this.name = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_nullishCoalesce"])(transactionContext.name, () => ( '')); + + this._trimEnd = transactionContext.trimEnd; + + return this; + } + + /** + * @inheritdoc + * + * @experimental + */ + getDynamicSamplingContext() { + if (this._frozenDynamicSamplingContext) { + return this._frozenDynamicSamplingContext; + } + + const hub = this._hub || Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])(); + const client = hub && hub.getClient(); + + if (!client) return {}; + + const { environment, release } = client.getOptions() || {}; + const { publicKey: public_key } = client.getDsn() || {}; + + const maybeSampleRate = this.metadata.sampleRate; + const sample_rate = maybeSampleRate !== undefined ? maybeSampleRate.toString() : undefined; + + const scope = hub.getScope(); + const { segment: user_segment } = (scope && scope.getUser()) || {}; + + const source = this.metadata.source; + + // We don't want to have a transaction name in the DSC if the source is "url" because URLs might contain PII + const transaction = source && source !== 'url' ? this.name : undefined; + + const dsc = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["dropUndefinedKeys"])({ + environment, + release, + transaction, + user_segment, + public_key, + trace_id: this.traceId, + sample_rate, + }); + + // Uncomment if we want to make DSC immutable + // this._frozenDynamicSamplingContext = dsc; + + return dsc; + } +} + + +//# sourceMappingURL=transaction.js.map + + /***/ }), /***/ "Ell7": @@ -100194,73 +105584,96 @@ module.exports = { "default": __webpack_require__("2Nb0"), __esModule: true }; "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ERROR_TRANSPORT_CATEGORY", function() { return ERROR_TRANSPORT_CATEGORY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRANSACTION_TRANSPORT_CATEGORY", function() { return TRANSACTION_TRANSPORT_CATEGORY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ATTACHMENT_TRANSPORT_CATEGORY", function() { return ATTACHMENT_TRANSPORT_CATEGORY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SESSION_TRANSPORT_CATEGORY", function() { return SESSION_TRANSPORT_CATEGORY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_TRANSPORT_BUFFER_SIZE", function() { return DEFAULT_TRANSPORT_BUFFER_SIZE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTransport", function() { return createTransport; }); /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); -var ERROR_TRANSPORT_CATEGORY = 'error'; -var TRANSACTION_TRANSPORT_CATEGORY = 'transaction'; -var ATTACHMENT_TRANSPORT_CATEGORY = 'attachment'; -var SESSION_TRANSPORT_CATEGORY = 'session'; -var DEFAULT_TRANSPORT_BUFFER_SIZE = 30; + +const DEFAULT_TRANSPORT_BUFFER_SIZE = 30; + /** - * Creates a `NewTransport` + * Creates an instance of a Sentry `Transport` * * @param options * @param makeRequest */ -function createTransport(options, makeRequest, buffer) { - if (buffer === void 0) { buffer = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makePromiseBuffer"])(options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE); } - var rateLimits = {}; - var flush = function (timeout) { return buffer.drain(timeout); }; - function send(envelope) { - var envCategory = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getEnvelopeType"])(envelope); - var category = envCategory === 'event' ? 'error' : envCategory; - var request = { - category: category, - body: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["serializeEnvelope"])(envelope), - }; - // Don't add to buffer if transport is already rate-limited - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isRateLimited"])(rateLimits, category)) { - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["rejectedSyncPromise"])({ - status: 'rate_limit', - reason: getRateLimitReason(rateLimits, category), - }); - } - var requestTask = function () { - return makeRequest(request).then(function (_a) { - var body = _a.body, headers = _a.headers, reason = _a.reason, statusCode = _a.statusCode; - var status = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["eventStatusFromHttpCode"])(statusCode); - if (headers) { - rateLimits = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["updateRateLimits"])(rateLimits, headers); - } - if (status === 'success') { - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["resolvedSyncPromise"])({ status: status, reason: reason }); - } - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["rejectedSyncPromise"])({ - status: status, - reason: reason || - body || - (status === 'rate_limit' ? getRateLimitReason(rateLimits, category) : 'Unknown transport error'), - }); - }); - }; - return buffer.add(requestTask); +function createTransport( + options, + makeRequest, + buffer = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makePromiseBuffer"])(options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE), +) { + let rateLimits = {}; + + const flush = (timeout) => buffer.drain(timeout); + + function send(envelope) { + const filteredEnvelopeItems = []; + + // Drop rate limited items from envelope + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["forEachEnvelopeItem"])(envelope, (item, type) => { + const envelopeItemDataCategory = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["envelopeItemTypeToDataCategory"])(type); + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isRateLimited"])(rateLimits, envelopeItemDataCategory)) { + options.recordDroppedEvent('ratelimit_backoff', envelopeItemDataCategory); + } else { + filteredEnvelopeItems.push(item); + } + }); + + // Skip sending if envelope is empty after filtering out rate limited events + if (filteredEnvelopeItems.length === 0) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["resolvedSyncPromise"])(); } - return { - send: send, - flush: flush, + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const filteredEnvelope = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["createEnvelope"])(envelope[0], filteredEnvelopeItems ); + + // Creates client report for each item in an envelope + const recordEnvelopeLoss = (reason) => { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["forEachEnvelopeItem"])(filteredEnvelope, (_, type) => { + options.recordDroppedEvent(reason, Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["envelopeItemTypeToDataCategory"])(type)); + }); }; + + const requestTask = () => + makeRequest({ body: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["serializeEnvelope"])(filteredEnvelope, options.textEncoder) }).then( + response => { + // We don't want to throw on NOK responses, but we want to at least log them + if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn(`Sentry responded with status code ${response.statusCode} to sent event.`); + } + + rateLimits = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["updateRateLimits"])(rateLimits, response); + }, + error => { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].error('Failed while sending event:', error); + recordEnvelopeLoss('network_error'); + }, + ); + + return buffer.add(requestTask).then( + result => result, + error => { + if (error instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SentryError"]) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].error('Skipped sending event because buffer is full.'); + recordEnvelopeLoss('queue_overflow'); + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["resolvedSyncPromise"])(); + } else { + throw error; + } + }, + ); + } + + return { + send, + flush, + }; } -function getRateLimitReason(rateLimits, category) { - return "Too many " + category + " requests, backing off until: " + new Date(Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["disabledUntil"])(rateLimits, category)).toISOString(); -} + + //# sourceMappingURL=base.js.map + /***/ }), /***/ "F2eR": @@ -100444,6 +105857,100 @@ function clipRectangle(x0, y0, x1, y1) { } +/***/ }), + +/***/ "F4Bt": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Prisma", function() { return Prisma; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("QXPM"); + + + + +function isValidPrismaClient(possibleClient) { + return possibleClient && !!(possibleClient )['$use']; +} + +/** Tracing integration for @prisma/client package */ +class Prisma { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Prisma';} + + /** + * @inheritDoc + */ + __init() {this.name = Prisma.id;} + + /** + * Prisma ORM Client Instance + */ + + /** + * @inheritDoc + */ + constructor(options = {}) {;Prisma.prototype.__init.call(this); + if (isValidPrismaClient(options.client)) { + this._client = options.client; + } else { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn( + `Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`, + ); + } + } + + /** + * @inheritDoc + */ + setupOnce(_, getCurrentHub) { + if (!this._client) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('PrismaIntegration is missing a Prisma Client Instance'); + return; + } + + if (Object(_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__["shouldDisableAutoInstrumentation"])(getCurrentHub)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('Prisma Integration is skipped because of instrumenter configuration.'); + return; + } + + this._client.$use((params, next) => { + const scope = getCurrentHub().getScope(); + const parentSpan = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]); + + const action = params.action; + const model = params.model; + + const span = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({ + description: model ? `${model} ${action}` : action, + op: 'db.sql.prisma', + })]); + + const rv = next(params); + + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isThenable"])(rv)) { + return rv.then((res) => { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]); + return res; + }); + } + + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]); + return rv; + }); + } +}Prisma.__initStatic(); + + +//# sourceMappingURL=prisma.js.map + + /***/ }), /***/ "F6+O": @@ -100946,6 +106453,68 @@ function endOfSecond (dirtyDate) { module.exports = endOfSecond +/***/ }), + +/***/ "FGHR": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActiveTransaction", function() { return getActiveTransaction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasTracingEnabled", function() { return hasTracingEnabled; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "msToSec", function() { return msToSec; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "secToMs", function() { return secToMs; }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TRACEPARENT_REGEXP", function() { return _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["TRACEPARENT_REGEXP"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractTraceparentData", function() { return _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["extractTraceparentData"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stripUrlQueryAndFragment", function() { return _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["stripUrlQueryAndFragment"]; }); + + + + +/** + * Determines if tracing is currently enabled. + * + * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config. + */ +function hasTracingEnabled( + maybeOptions, +) { + const client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().getClient(); + const options = maybeOptions || (client && client.getOptions()); + return !!options && ('tracesSampleRate' in options || 'tracesSampler' in options); +} + +/** Grabs active transaction off scope, if any */ +function getActiveTransaction(maybeHub) { + const hub = maybeHub || Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])(); + const scope = hub.getScope(); + return scope && (scope.getTransaction() ); +} + +/** + * Converts from milliseconds to seconds + * @param time time in ms + */ +function msToSec(time) { + return time / 1000; +} + +/** + * Converts from seconds to milliseconds + * @param time time in seconds + */ +function secToMs(time) { + return time * 1000; +} + + +//# sourceMappingURL=utils.js.map + + /***/ }), /***/ "FJW5": @@ -100966,6 +106535,47 @@ module.exports = __webpack_require__("nh4g") ? Object.defineProperties : functio }; +/***/ }), + +/***/ "FK2R": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRACEPARENT_REGEXP", function() { return TRACEPARENT_REGEXP; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractTraceparentData", function() { return extractTraceparentData; }); +var TRACEPARENT_REGEXP = new RegExp('^[ \\t]*' + // whitespace + '([0-9a-f]{32})?' + // trace_id + '-?([0-9a-f]{16})?' + // span_id + '-?([01])?' + // sampled + '[ \\t]*$'); +/** + * Extract transaction context data from a `sentry-trace` header. + * + * @param traceparent Traceparent string + * + * @returns Object containing data from the header, or undefined if traceparent string is malformed + */ +function extractTraceparentData(traceparent) { + var matches = traceparent.match(TRACEPARENT_REGEXP); + if (matches) { + var parentSampled = void 0; + if (matches[3] === '1') { + parentSampled = true; + } + else if (matches[3] === '0') { + parentSampled = false; + } + return { + traceId: matches[1], + parentSampled: parentSampled, + parentSpanId: matches[2], + }; + } + return undefined; +} +//# sourceMappingURL=tracing.js.map + /***/ }), /***/ "FL3X": @@ -101740,6 +107350,17 @@ __webpack_require__("7DDg")('Int16', 2, function (init) { }); +/***/ }), + +/***/ "FbLj": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SeverityLevels", function() { return SeverityLevels; }); +var SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical']; +//# sourceMappingURL=enums.js.map + /***/ }), /***/ "FbRl": @@ -102481,11 +108102,10 @@ __webpack_require__.r(__webpack_exports__); /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeToSize", function() { return normalizeToSize; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "walk", function() { return visit; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9AQC"); -/* harmony import */ var _memo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("wCA9"); -/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("6PXS"); -/* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("pRiV"); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9AQC"); +/* harmony import */ var _memo_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wCA9"); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("6PXS"); +/* harmony import */ var _stacktrace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("pRiV"); @@ -102507,34 +108127,37 @@ __webpack_require__.r(__webpack_exports__); * @param input The object to be normalized. * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.) * @param maxProperties The max number of elements or properties to be included in any single array or - * object in the normallized output.. + * object in the normallized output. * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization. */ -function normalize(input, depth, maxProperties) { - if (depth === void 0) { depth = +Infinity; } - if (maxProperties === void 0) { maxProperties = +Infinity; } - try { - // since we're at the outermost level, there is no key - return visit('', input, depth, maxProperties); - } - catch (err) { - return { ERROR: "**non-serializable** (" + err + ")" }; - } +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function normalize(input, depth = +Infinity, maxProperties = +Infinity) { + try { + // since we're at the outermost level, we don't provide a key + return visit('', input, depth, maxProperties); + } catch (err) { + return { ERROR: `**non-serializable** (${err})` }; + } } + /** JSDoc */ -function normalizeToSize(object, -// Default Node.js REPL depth -depth, -// 100kB, as 200kB is max payload size, so half sounds reasonable -maxSize) { - if (depth === void 0) { depth = 3; } - if (maxSize === void 0) { maxSize = 100 * 1024; } - var normalized = normalize(object, depth); - if (jsonSize(normalized) > maxSize) { - return normalizeToSize(object, depth - 1, maxSize); - } - return normalized; +function normalizeToSize( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + object, + // Default Node.js REPL depth + depth = 3, + // 100kB, as 200kB is max payload size, so half sounds reasonable + maxSize = 100 * 1024, +) { + const normalized = normalize(object, depth); + + if (jsonSize(normalized) > maxSize) { + return normalizeToSize(object, depth - 1, maxSize); + } + + return normalized ; } + /** * Visits a node to perform normalization on it * @@ -102544,68 +108167,94 @@ maxSize) { * @param maxProperties Optional maximum number of properties/elements included in any single object/array * @param memo Optional Memo class handling decycling */ -function visit(key, value, depth, maxProperties, memo) { - if (depth === void 0) { depth = +Infinity; } - if (maxProperties === void 0) { maxProperties = +Infinity; } - if (memo === void 0) { memo = Object(_memo__WEBPACK_IMPORTED_MODULE_2__["memoBuilder"])(); } - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(memo, 2), memoize = _a[0], unmemoize = _a[1]; - // If the value has a `toJSON` method, see if we can bail and let it do the work - var valueWithToJSON = value; - if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') { - try { - return valueWithToJSON.toJSON(); - } - catch (err) { - // pass (The built-in `toJSON` failed, but we can still try to do it ourselves) - } - } - // Get the simple cases out of the way first - if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !Object(_is__WEBPACK_IMPORTED_MODULE_1__["isNaN"])(value))) { - return value; - } - var stringified = stringifyValue(key, value); - // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`. - // Everything else will have already been serialized, so if we don't see that pattern, we're done. - if (!stringified.startsWith('[object ')) { - return stringified; - } - // We're also done if we've reached the max depth - if (depth === 0) { - // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`. - return stringified.replace('object ', ''); +function visit( + key, + value, + depth = +Infinity, + maxProperties = +Infinity, + memo = Object(_memo_js__WEBPACK_IMPORTED_MODULE_1__["memoBuilder"])(), +) { + const [memoize, unmemoize] = memo; + + // Get the simple cases out of the way first + if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isNaN"])(value))) { + return value ; + } + + const stringified = stringifyValue(key, value); + + // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`. + // Everything else will have already been serialized, so if we don't see that pattern, we're done. + if (!stringified.startsWith('[object ')) { + return stringified; + } + + // From here on, we can assert that `value` is either an object or an array. + + // Do not normalize objects that we know have already been normalized. As a general rule, the + // "__sentry_skip_normalization__" property should only be used sparingly and only should only be set on objects that + // have already been normalized. + if ((value )['__sentry_skip_normalization__']) { + return value ; + } + + // We're also done if we've reached the max depth + if (depth === 0) { + // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`. + return stringified.replace('object ', ''); + } + + // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now. + if (memoize(value)) { + return '[Circular ~]'; + } + + // If the value has a `toJSON` method, we call it to extract more information + const valueWithToJSON = value ; + if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') { + try { + const jsonValue = valueWithToJSON.toJSON(); + // We need to normalize the return value of `.toJSON()` in case it has circular references + return visit('', jsonValue, depth - 1, maxProperties, memo); + } catch (err) { + // pass (The built-in `toJSON` failed, but we can still try to do it ourselves) } - // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now. - if (memoize(value)) { - return '[Circular ~]'; + } + + // 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 + // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each + // property/entry, and keep track of the number of items we add to it. + const normalized = (Array.isArray(value) ? [] : {}) ; + let numAdded = 0; + + // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant + // properties are non-enumerable and otherwise would get missed. + const visitable = Object(_object_js__WEBPACK_IMPORTED_MODULE_2__["convertToPlainObject"])(value ); + + for (const visitKey in visitable) { + // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration. + if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { + continue; } - // 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 - // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each - // property/entry, and keep track of the number of items we add to it. - var normalized = (Array.isArray(value) ? [] : {}); - var numAdded = 0; - // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant - // properties are non-enumerable and otherwise would get missed. - var visitable = (Object(_is__WEBPACK_IMPORTED_MODULE_1__["isError"])(value) || Object(_is__WEBPACK_IMPORTED_MODULE_1__["isEvent"])(value) ? Object(_object__WEBPACK_IMPORTED_MODULE_3__["convertToPlainObject"])(value) : value); - for (var visitKey in visitable) { - // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration. - if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { - continue; - } - if (numAdded >= maxProperties) { - normalized[visitKey] = '[MaxProperties ~]'; - break; - } - // Recursively visit all the child nodes - var visitValue = visitable[visitKey]; - normalized[visitKey] = visit(visitKey, visitValue, depth - 1, maxProperties, memo); - numAdded += 1; + + if (numAdded >= maxProperties) { + normalized[visitKey] = '[MaxProperties ~]'; + break; } - // Once we've visited all the branches, remove the parent from memo storage - unmemoize(value); - // Return accumulated values - return normalized; + + // Recursively visit all the child nodes + const visitValue = visitable[visitKey]; + normalized[visitKey] = visit(visitKey, visitValue, depth - 1, maxProperties, memo); + + numAdded += 1; + } + + // Once we've visited all the branches, remove the parent from memo storage + unmemoize(value); + + // Return accumulated values + return normalized; } -// TODO remove this in v7 (this means the method will no longer be exported, under any name) /** * Stringify the given value. Handles various known special values and types. @@ -102616,71 +108265,90 @@ function visit(key, value, depth, maxProperties, memo) { * @param value The value to stringify * @returns A stringified representation of the given value */ -function stringifyValue(key, -// this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for -// our internal use, it'll do -value) { - try { - if (key === 'domain' && value && typeof value === 'object' && value._events) { - return '[Domain]'; - } - if (key === 'domainEmitter') { - return '[DomainEmitter]'; - } - // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first - // which won't throw if they are not present. - if (typeof global !== 'undefined' && value === global) { - return '[Global]'; - } - // eslint-disable-next-line no-restricted-globals - if (typeof window !== 'undefined' && value === window) { - return '[Window]'; - } - // eslint-disable-next-line no-restricted-globals - if (typeof document !== 'undefined' && value === document) { - return '[Document]'; - } - // React's SyntheticEvent thingy - if (Object(_is__WEBPACK_IMPORTED_MODULE_1__["isSyntheticEvent"])(value)) { - return '[SyntheticEvent]'; - } - if (typeof value === 'number' && value !== value) { - return '[NaN]'; - } - // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own) - if (value === void 0) { - return '[undefined]'; - } - if (typeof value === 'function') { - return "[Function: " + Object(_stacktrace__WEBPACK_IMPORTED_MODULE_4__["getFunctionName"])(value) + "]"; - } - if (typeof value === 'symbol') { - return "[" + String(value) + "]"; - } - // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion - if (typeof value === 'bigint') { - return "[BigInt: " + String(value) + "]"; - } - // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting - // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as - // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class), - // we can make sure that only plain objects come out that way. - return "[object " + Object.getPrototypeOf(value).constructor.name + "]"; +function stringifyValue( + key, + // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for + // our internal use, it'll do + value, +) { + try { + if (key === 'domain' && value && typeof value === 'object' && (value )._events) { + return '[Domain]'; } - catch (err) { - return "**non-serializable** (" + err + ")"; + + if (key === 'domainEmitter') { + return '[DomainEmitter]'; + } + + // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first + // which won't throw if they are not present. + + if (typeof global !== 'undefined' && value === global) { + return '[Global]'; + } + + // eslint-disable-next-line no-restricted-globals + if (typeof window !== 'undefined' && value === window) { + return '[Window]'; + } + + // eslint-disable-next-line no-restricted-globals + if (typeof document !== 'undefined' && value === document) { + return '[Document]'; + } + + // React's SyntheticEvent thingy + if (Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isSyntheticEvent"])(value)) { + return '[SyntheticEvent]'; + } + + if (typeof value === 'number' && value !== value) { + return '[NaN]'; + } + + // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own) + if (value === void 0) { + return '[undefined]'; + } + + if (typeof value === 'function') { + return `[Function: ${Object(_stacktrace_js__WEBPACK_IMPORTED_MODULE_3__["getFunctionName"])(value)}]`; + } + + if (typeof value === 'symbol') { + return `[${String(value)}]`; + } + + // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion + if (typeof value === 'bigint') { + return `[BigInt: ${String(value)}]`; } + + // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting + // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as + // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class), + // we can make sure that only plain objects come out that way. + return `[object ${(Object.getPrototypeOf(value) ).constructor.name}]`; + } catch (err) { + return `**non-serializable** (${err})`; + } } + /** Calculates bytes size of input string */ function utf8Length(value) { - // eslint-disable-next-line no-bitwise - return ~-encodeURI(value).split(/%..|./).length; + // eslint-disable-next-line no-bitwise + return ~-encodeURI(value).split(/%..|./).length; } + /** Calculates bytes size of input object */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any function jsonSize(value) { - return utf8Length(JSON.stringify(value)); + return utf8Length(JSON.stringify(value)); } + + //# sourceMappingURL=normalize.js.map + /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj"))) /***/ }), @@ -103138,6 +108806,44 @@ __webpack_require__("Xtr8")('isExtensible', function ($isExtensible) { }); +/***/ }), + +/***/ "Fm1u": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindReporter", function() { return bindReporter; }); +const bindReporter = ( + callback, + metric, + reportAllChanges, +) => { + let prevValue; + let delta; + return (forceReport) => { + if (metric.value >= 0) { + if (forceReport || reportAllChanges) { + delta = metric.value - (prevValue || 0); + + // Report the metric if there's a non-zero delta or if no previous + // value exists (which can happen in the case of the document becoming + // hidden when the metric value is 0). + // See: https://github.com/GoogleChrome/web-vitals/issues/14 + if (delta || prevValue === undefined) { + prevValue = metric.value; + metric.delta = delta; + callback(metric); + } + } + } + }; +}; + + +//# sourceMappingURL=bindReporter.js.map + + /***/ }), /***/ "FmoU": @@ -105747,6 +111453,133 @@ exports.default = _default; /***/ }), +/***/ "G7wx": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dsnToString", function() { return dsnToString; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeDsn", function() { return makeDsn; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("3pfK"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("yCCt"); + + + +/** Regular expression used to parse a Dsn. */ +var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/; +function isValidProtocol(protocol) { + return protocol === 'http' || protocol === 'https'; +} +/** + * Renders the string representation of this Dsn. + * + * By default, this will render the public representation without the password + * component. To get the deprecated private representation, set `withPassword` + * to true. + * + * @param withPassword When set to true, the password will be included. + */ +function dsnToString(dsn, withPassword) { + if (withPassword === void 0) { withPassword = false; } + var host = dsn.host, path = dsn.path, pass = dsn.pass, port = dsn.port, projectId = dsn.projectId, protocol = dsn.protocol, publicKey = dsn.publicKey; + return (protocol + "://" + publicKey + (withPassword && pass ? ":" + pass : '') + + ("@" + host + (port ? ":" + port : '') + "/" + (path ? path + "/" : path) + projectId)); +} +function dsnFromString(str) { + var match = DSN_REGEX.exec(str); + if (!match) { + throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: " + str); + } + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(match.slice(1), 6), protocol = _a[0], publicKey = _a[1], _b = _a[2], pass = _b === void 0 ? '' : _b, host = _a[3], _c = _a[4], port = _c === void 0 ? '' : _c, lastPath = _a[5]; + var path = ''; + var projectId = lastPath; + var split = projectId.split('/'); + if (split.length > 1) { + path = split.slice(0, -1).join('/'); + projectId = split.pop(); + } + if (projectId) { + var projectMatch = projectId.match(/^\d+/); + if (projectMatch) { + projectId = projectMatch[0]; + } + } + return dsnFromComponents({ host: host, pass: pass, path: path, projectId: projectId, port: port, protocol: protocol, publicKey: publicKey }); +} +function dsnFromComponents(components) { + // TODO this is for backwards compatibility, and can be removed in a future version + if ('user' in components && !('publicKey' in components)) { + components.publicKey = components.user; + } + return { + user: components.publicKey || '', + 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 (!_flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"]) { + return; + } + var port = dsn.port, projectId = dsn.projectId, protocol = dsn.protocol; + var requiredComponents = ['protocol', 'publicKey', 'host', 'projectId']; + requiredComponents.forEach(function (component) { + if (!dsn[component]) { + throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: " + component + " missing"); + } + }); + if (!projectId.match(/^\d+$/)) { + throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: Invalid projectId " + projectId); + } + if (!isValidProtocol(protocol)) { + throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: Invalid protocol " + protocol); + } + if (port && isNaN(parseInt(port, 10))) { + throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: Invalid port " + port); + } + return true; +} +/** The Sentry Dsn, identifying a Sentry instance and project. */ +function makeDsn(from) { + var components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from); + validateDsn(components); + return components; +} +//# sourceMappingURL=dsn.js.map + +/***/ }), + +/***/ "G8B2": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IS_DEBUG_BUILD", function() { return IS_DEBUG_BUILD; }); +/* + * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking + * for users. + * + * Debug flags need to be declared in each package individually and must not be imported across package boundaries, + * because some build tools have trouble tree-shaking imported guards. + * + * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder. + * + * Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during + * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not + * replaced. + */ +/** Flag that is true for debug builds, false otherwise. */ +var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__; +//# sourceMappingURL=flags.js.map + +/***/ }), + /***/ "G8Mo": /***/ (function(module, exports, __webpack_require__) { @@ -106374,6 +112207,571 @@ function setRef(ref, value) { } } +/***/ }), + +/***/ "GIgW": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "API_VERSION", function() { return API_VERSION; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return Hub; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return getCurrentHub; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return getHubFromCarrier; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMainCarrier", function() { return getMainCarrier; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return makeMain; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setHubOnCarrier", function() { return setHubOnCarrier; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("vOz9"); +/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("v/92"); + + + + +/** + * API compatibility version of this hub. + * + * WARNING: This number should only be increased when the global interface + * changes and new methods are introduced. + * + * @hidden + */ +const API_VERSION = 4; + +/** + * Default maximum number of breadcrumbs added to an event. Can be overwritten + * with {@link Options.maxBreadcrumbs}. + */ +const DEFAULT_BREADCRUMBS = 100; + +/** + * A layer in the process stack. + * @hidden + */ + +/** + * @inheritDoc + */ +class Hub { + /** Is a {@link Layer}[] containing the client and scope */ + __init() {this._stack = [{}];} + + /** Contains the last event id of a captured event. */ + + /** + * Creates a new instance of the hub, will push one {@link Layer} into the + * internal stack on creation. + * + * @param client bound to the hub. + * @param scope bound to the hub. + * @param version number, higher number means higher priority. + */ + constructor(client, scope = new _scope_js__WEBPACK_IMPORTED_MODULE_1__["Scope"](), _version = API_VERSION) {;this._version = _version;Hub.prototype.__init.call(this); + this.getStackTop().scope = scope; + if (client) { + this.bindClient(client); + } + } + + /** + * @inheritDoc + */ + isOlderThan(version) { + return this._version < version; + } + + /** + * @inheritDoc + */ + bindClient(client) { + const top = this.getStackTop(); + top.client = client; + if (client && client.setupIntegrations) { + client.setupIntegrations(); + } + } + + /** + * @inheritDoc + */ + pushScope() { + // We want to clone the content of prev scope + const scope = _scope_js__WEBPACK_IMPORTED_MODULE_1__["Scope"].clone(this.getScope()); + this.getStack().push({ + client: this.getClient(), + scope, + }); + return scope; + } + + /** + * @inheritDoc + */ + popScope() { + if (this.getStack().length <= 1) return false; + return !!this.getStack().pop(); + } + + /** + * @inheritDoc + */ + withScope(callback) { + const scope = this.pushScope(); + try { + callback(scope); + } finally { + this.popScope(); + } + } + + /** + * @inheritDoc + */ + getClient() { + return this.getStackTop().client ; + } + + /** Returns the scope of the top stack. */ + getScope() { + return this.getStackTop().scope; + } + + /** Returns the scope stack for domains or the process. */ + getStack() { + return this._stack; + } + + /** Returns the topmost scope layer in the order domain > local > process. */ + getStackTop() { + return this._stack[this._stack.length - 1]; + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + captureException(exception, hint) { + const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["uuid4"])()); + const syntheticException = new Error('Sentry syntheticException'); + this._withClient((client, scope) => { + client.captureException( + exception, + { + originalException: exception, + syntheticException, + ...hint, + event_id: eventId, + }, + scope, + ); + }); + return eventId; + } + + /** + * @inheritDoc + */ + captureMessage( + message, + // eslint-disable-next-line deprecation/deprecation + level, + hint, + ) { + const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["uuid4"])()); + const syntheticException = new Error(message); + this._withClient((client, scope) => { + client.captureMessage( + message, + level, + { + originalException: message, + syntheticException, + ...hint, + event_id: eventId, + }, + scope, + ); + }); + return eventId; + } + + /** + * @inheritDoc + */ + captureEvent(event, hint) { + const eventId = hint && hint.event_id ? hint.event_id : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["uuid4"])(); + if (event.type !== 'transaction') { + this._lastEventId = eventId; + } + + this._withClient((client, scope) => { + client.captureEvent(event, { ...hint, event_id: eventId }, scope); + }); + return eventId; + } + + /** + * @inheritDoc + */ + lastEventId() { + return this._lastEventId; + } + + /** + * @inheritDoc + */ + addBreadcrumb(breadcrumb, hint) { + const { scope, client } = this.getStackTop(); + + if (!scope || !client) return; + + // eslint-disable-next-line @typescript-eslint/unbound-method + const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = + (client.getOptions && client.getOptions()) || {}; + + if (maxBreadcrumbs <= 0) return; + + const timestamp = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dateTimestampInSeconds"])(); + const mergedBreadcrumb = { timestamp, ...breadcrumb }; + const finalBreadcrumb = beforeBreadcrumb + ? (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["consoleSandbox"])(() => beforeBreadcrumb(mergedBreadcrumb, hint)) ) + : mergedBreadcrumb; + + if (finalBreadcrumb === null) return; + + scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs); + } + + /** + * @inheritDoc + */ + setUser(user) { + const scope = this.getScope(); + if (scope) scope.setUser(user); + } + + /** + * @inheritDoc + */ + setTags(tags) { + const scope = this.getScope(); + if (scope) scope.setTags(tags); + } + + /** + * @inheritDoc + */ + setExtras(extras) { + const scope = this.getScope(); + if (scope) scope.setExtras(extras); + } + + /** + * @inheritDoc + */ + setTag(key, value) { + const scope = this.getScope(); + if (scope) scope.setTag(key, value); + } + + /** + * @inheritDoc + */ + setExtra(key, extra) { + const scope = this.getScope(); + if (scope) scope.setExtra(key, extra); + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + setContext(name, context) { + const scope = this.getScope(); + if (scope) scope.setContext(name, context); + } + + /** + * @inheritDoc + */ + configureScope(callback) { + const { scope, client } = this.getStackTop(); + if (scope && client) { + callback(scope); + } + } + + /** + * @inheritDoc + */ + run(callback) { + const oldHub = makeMain(this); + try { + callback(this); + } finally { + makeMain(oldHub); + } + } + + /** + * @inheritDoc + */ + getIntegration(integration) { + const client = this.getClient(); + if (!client) return null; + try { + return client.getIntegration(integration); + } catch (_oO) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn(`Cannot retrieve integration ${integration.id} from the current Hub`); + return null; + } + } + + /** + * @inheritDoc + */ + startTransaction(context, customSamplingContext) { + return this._callExtensionMethod('startTransaction', context, customSamplingContext); + } + + /** + * @inheritDoc + */ + traceHeaders() { + return this._callExtensionMethod('traceHeaders'); + } + + /** + * @inheritDoc + */ + captureSession(endSession = false) { + // both send the update and pull the session from the scope + if (endSession) { + return this.endSession(); + } + + // only send the update + this._sendSessionUpdate(); + } + + /** + * @inheritDoc + */ + endSession() { + const layer = this.getStackTop(); + const scope = layer && layer.scope; + const session = scope && scope.getSession(); + if (session) { + Object(_session_js__WEBPACK_IMPORTED_MODULE_2__["closeSession"])(session); + } + this._sendSessionUpdate(); + + // the session is over; take it off of the scope + if (scope) { + scope.setSession(); + } + } + + /** + * @inheritDoc + */ + startSession(context) { + const { scope, client } = this.getStackTop(); + const { release, environment } = (client && client.getOptions()) || {}; + + // Will fetch userAgent if called from browser sdk + const { userAgent } = _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["GLOBAL_OBJ"].navigator || {}; + + const session = Object(_session_js__WEBPACK_IMPORTED_MODULE_2__["makeSession"])({ + release, + environment, + ...(scope && { user: scope.getUser() }), + ...(userAgent && { userAgent }), + ...context, + }); + + if (scope) { + // End existing session if there's one + const currentSession = scope.getSession && scope.getSession(); + if (currentSession && currentSession.status === 'ok') { + Object(_session_js__WEBPACK_IMPORTED_MODULE_2__["updateSession"])(currentSession, { status: 'exited' }); + } + this.endSession(); + + // Afterwards we set the new session on the scope + scope.setSession(session); + } + + return session; + } + + /** + * Returns if default PII should be sent to Sentry and propagated in ourgoing requests + * when Tracing is used. + */ + shouldSendDefaultPii() { + const client = this.getClient(); + const options = client && client.getOptions(); + return Boolean(options && options.sendDefaultPii); + } + + /** + * Sends the current Session on the scope + */ + _sendSessionUpdate() { + const { scope, client } = this.getStackTop(); + if (!scope) return; + + const session = scope.getSession(); + if (session) { + if (client && client.captureSession) { + client.captureSession(session); + } + } + } + + /** + * Internal helper function to call a method on the top client if it exists. + * + * @param method The method to call on the client. + * @param args Arguments to pass to the client function. + */ + _withClient(callback) { + const { scope, client } = this.getStackTop(); + if (client) { + callback(client, scope); + } + } + + /** + * Calls global extension method and binding current instance to the function call + */ + // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + _callExtensionMethod(method, ...args) { + const carrier = getMainCarrier(); + const sentry = carrier.__SENTRY__; + if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') { + return sentry.extensions[method].apply(this, args); + } + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn(`Extension method ${method} couldn't be found, doing nothing.`); + } +} + +/** + * Returns the global shim registry. + * + * FIXME: This function is problematic, because despite always returning a valid Carrier, + * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check + * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there. + **/ +function getMainCarrier() { + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["GLOBAL_OBJ"].__SENTRY__ = _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["GLOBAL_OBJ"].__SENTRY__ || { + extensions: {}, + hub: undefined, + }; + return _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["GLOBAL_OBJ"]; +} + +/** + * Replaces the current main hub with the passed one on the global object + * + * @returns The old replaced hub + */ +function makeMain(hub) { + const registry = getMainCarrier(); + const oldHub = getHubFromCarrier(registry); + setHubOnCarrier(registry, hub); + return oldHub; +} + +/** + * Returns the default hub instance. + * + * If a hub is already registered in the global carrier but this module + * contains a more recent version, it replaces the registered version. + * Otherwise, the currently registered hub will be returned. + */ +function getCurrentHub() { + // Get main carrier (global for every environment) + const registry = getMainCarrier(); + + // If there's no hub, or its an old API, assign a new one + if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) { + setHubOnCarrier(registry, new Hub()); + } + + // Prefer domains over global if they are there (applicable only to Node environment) + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isNodeEnv"])()) { + return getHubFromActiveDomain(registry); + } + // Return hub that lives on a global object + return getHubFromCarrier(registry); +} + +/** + * Try to read the hub from an active domain, and fallback to the registry if one doesn't exist + * @returns discovered hub + */ +function getHubFromActiveDomain(registry) { + try { + const sentry = getMainCarrier().__SENTRY__; + const activeDomain = sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active; + + // If there's no active domain, just return global hub + if (!activeDomain) { + return getHubFromCarrier(registry); + } + + // If there's no hub on current domain, or it's an old API, assign a new one + if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) { + const registryHubTopStack = getHubFromCarrier(registry).getStackTop(); + setHubOnCarrier(activeDomain, new Hub(registryHubTopStack.client, _scope_js__WEBPACK_IMPORTED_MODULE_1__["Scope"].clone(registryHubTopStack.scope))); + } + + // Return hub that lives on a domain + return getHubFromCarrier(activeDomain); + } catch (_Oo) { + // Return hub that lives on a global object + return getHubFromCarrier(registry); + } +} + +/** + * This will tell whether a carrier has a hub on it or not + * @param carrier object + */ +function hasHubOnCarrier(carrier) { + return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub); +} + +/** + * This will create a new {@link Hub} and add to the passed object on + * __SENTRY__.hub. + * @param carrier object + * @hidden + */ +function getHubFromCarrier(carrier) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getGlobalSingleton"])('hub', () => new Hub(), carrier); +} + +/** + * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute + * @param carrier object + * @param hub Hub + * @returns A boolean indicating success or failure + */ +function setHubOnCarrier(carrier, hub) { + if (!carrier) return false; + const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {}); + __SENTRY__.hub = hub; + return true; +} + + +//# sourceMappingURL=hub.js.map + + /***/ }), /***/ "GIza": @@ -111914,14 +118312,25 @@ SvgIcon.muiName = 'SvgIcon'; "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolvedSyncPromise", function() { return resolvedSyncPromise; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rejectedSyncPromise", function() { return rejectedSyncPromise; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyncPromise", function() { return SyncPromise; }); -/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9AQC"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rejectedSyncPromise", function() { return rejectedSyncPromise; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolvedSyncPromise", function() { return resolvedSyncPromise; }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9AQC"); + + /* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable @typescript-eslint/typedef */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -/* eslint-disable @typescript-eslint/no-explicit-any */ + +/** SyncPromise internal states */ +var States; (function (States) { + /** Pending */ + const PENDING = 0; States[States["PENDING"] = PENDING] = "PENDING"; + /** Resolved / OK */ + const RESOLVED = 1; States[States["RESOLVED"] = RESOLVED] = "RESOLVED"; + /** Rejected / Error */ + const REJECTED = 2; States[States["REJECTED"] = REJECTED] = "REJECTED"; +})(States || (States = {})); + +// Overloads so we can call resolvedSyncPromise without arguments and generic argument /** * Creates a resolved sync promise. @@ -111930,10 +118339,11 @@ __webpack_require__.r(__webpack_exports__); * @returns the resolved sync promise */ function resolvedSyncPromise(value) { - return new SyncPromise(function (resolve) { - resolve(value); - }); + return new SyncPromise(resolve => { + resolve(value); + }); } + /** * Creates a rejected sync promise. * @@ -111941,142 +118351,164 @@ function resolvedSyncPromise(value) { * @returns the rejected sync promise */ function rejectedSyncPromise(reason) { - return new SyncPromise(function (_, reject) { - reject(reason); - }); + return new SyncPromise((_, reject) => { + reject(reason); + }); } + /** * Thenable class that behaves like a Promise and follows it's interface * but is not async internally */ -var SyncPromise = /** @class */ (function () { - function SyncPromise(executor) { - var _this = this; - this._state = 0 /* PENDING */; - this._handlers = []; - /** JSDoc */ - this._resolve = function (value) { - _this._setResult(1 /* RESOLVED */, value); - }; - /** JSDoc */ - this._reject = function (reason) { - _this._setResult(2 /* REJECTED */, reason); - }; - /** JSDoc */ - this._setResult = function (state, value) { - if (_this._state !== 0 /* PENDING */) { - return; - } - if (Object(_is__WEBPACK_IMPORTED_MODULE_0__["isThenable"])(value)) { - void value.then(_this._resolve, _this._reject); - return; +class SyncPromise { + __init() {this._state = States.PENDING;} + __init2() {this._handlers = [];} + + constructor( + executor, + ) {;SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this);SyncPromise.prototype.__init5.call(this);SyncPromise.prototype.__init6.call(this); + try { + executor(this._resolve, this._reject); + } catch (e) { + this._reject(e); + } + } + + /** JSDoc */ + then( + onfulfilled, + onrejected, + ) { + return new SyncPromise((resolve, reject) => { + this._handlers.push([ + false, + result => { + if (!onfulfilled) { + // TODO: ¯\_(ツ)_/¯ + // TODO: FIXME + resolve(result ); + } else { + try { + resolve(onfulfilled(result)); + } catch (e) { + reject(e); } - _this._state = state; - _this._value = value; - _this._executeHandlers(); - }; - /** JSDoc */ - this._executeHandlers = function () { - if (_this._state === 0 /* PENDING */) { - return; + } + }, + reason => { + if (!onrejected) { + reject(reason); + } else { + try { + resolve(onrejected(reason)); + } catch (e) { + reject(e); } - var cachedHandlers = _this._handlers.slice(); - _this._handlers = []; - cachedHandlers.forEach(function (handler) { - if (handler[0]) { - return; - } - if (_this._state === 1 /* RESOLVED */) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - handler[1](_this._value); - } - if (_this._state === 2 /* REJECTED */) { - handler[2](_this._value); - } - handler[0] = true; - }); - }; - try { - executor(this._resolve, this._reject); - } - catch (e) { - this._reject(e); + } + }, + ]); + this._executeHandlers(); + }); + } + + /** JSDoc */ + catch( + onrejected, + ) { + return this.then(val => val, onrejected); + } + + /** JSDoc */ + finally(onfinally) { + return new SyncPromise((resolve, reject) => { + let val; + let isRejected; + + return this.then( + value => { + isRejected = false; + val = value; + if (onfinally) { + onfinally(); + } + }, + reason => { + isRejected = true; + val = reason; + if (onfinally) { + onfinally(); + } + }, + ).then(() => { + if (isRejected) { + reject(val); + return; } + + resolve(val ); + }); + }); + } + + /** JSDoc */ + __init3() {this._resolve = (value) => { + this._setResult(States.RESOLVED, value); + };} + + /** JSDoc */ + __init4() {this._reject = (reason) => { + this._setResult(States.REJECTED, reason); + };} + + /** JSDoc */ + __init5() {this._setResult = (state, value) => { + if (this._state !== States.PENDING) { + return; } - /** JSDoc */ - SyncPromise.prototype.then = function (onfulfilled, onrejected) { - var _this = this; - return new SyncPromise(function (resolve, reject) { - _this._handlers.push([ - false, - function (result) { - if (!onfulfilled) { - // TODO: ¯\_(ツ)_/¯ - // TODO: FIXME - resolve(result); - } - else { - try { - resolve(onfulfilled(result)); - } - catch (e) { - reject(e); - } - } - }, - function (reason) { - if (!onrejected) { - reject(reason); - } - else { - try { - resolve(onrejected(reason)); - } - catch (e) { - reject(e); - } - } - }, - ]); - _this._executeHandlers(); - }); - }; - /** JSDoc */ - SyncPromise.prototype.catch = function (onrejected) { - return this.then(function (val) { return val; }, onrejected); - }; - /** JSDoc */ - SyncPromise.prototype.finally = function (onfinally) { - var _this = this; - return new SyncPromise(function (resolve, reject) { - var val; - var isRejected; - return _this.then(function (value) { - isRejected = false; - val = value; - if (onfinally) { - onfinally(); - } - }, function (reason) { - isRejected = true; - val = reason; - if (onfinally) { - onfinally(); - } - }).then(function () { - if (isRejected) { - reject(val); - return; - } - resolve(val); - }); - }); - }; - return SyncPromise; -}()); + + if (Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isThenable"])(value)) { + void (value ).then(this._resolve, this._reject); + return; + } + + this._state = state; + this._value = value; + + this._executeHandlers(); + };} + + /** JSDoc */ + __init6() {this._executeHandlers = () => { + if (this._state === States.PENDING) { + return; + } + + const cachedHandlers = this._handlers.slice(); + this._handlers = []; + + cachedHandlers.forEach(handler => { + if (handler[0]) { + return; + } + + if (this._state === States.RESOLVED) { + // eslint-disable-next-line @typescript-eslint/no-floating-promises + handler[1](this._value ); + } + + if (this._state === States.REJECTED) { + handler[2](this._value); + } + + handler[0] = true; + }); + };} +} + //# sourceMappingURL=syncpromise.js.map + /***/ }), /***/ "HVa0": @@ -112385,6 +118817,89 @@ __webpack_require__.r(__webpack_exports__); }); +/***/ }), + +/***/ "HbKt": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "installedIntegrations", function() { return installedIntegrations; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getIntegrationsToSetup", function() { return getIntegrationsToSetup; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setupIntegration", function() { return setupIntegration; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setupIntegrations", function() { return setupIntegrations; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("uzXi"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Um2S"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("OEZb"); + + + + +var installedIntegrations = []; +/** + * @private + */ +function filterDuplicates(integrations) { + return integrations.reduce(function (acc, integrations) { + if (acc.every(function (accIntegration) { return integrations.name !== accIntegration.name; })) { + acc.push(integrations); + } + return acc; + }, []); +} +/** Gets integration to install */ +function getIntegrationsToSetup(options) { + var defaultIntegrations = (options.defaultIntegrations && Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(options.defaultIntegrations)) || []; + var userIntegrations = options.integrations; + var integrations = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(filterDuplicates(defaultIntegrations)); + if (Array.isArray(userIntegrations)) { + // Filter out integrations that are also included in user options + integrations = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(integrations.filter(function (integrations) { + return userIntegrations.every(function (userIntegration) { return userIntegration.name !== integrations.name; }); + }), filterDuplicates(userIntegrations)); + } + else if (typeof userIntegrations === 'function') { + integrations = userIntegrations(integrations); + integrations = Array.isArray(integrations) ? integrations : [integrations]; + } + // Make sure that if present, `Debug` integration will always run last + var integrationsNames = integrations.map(function (i) { return i.name; }); + var alwaysLastToRun = 'Debug'; + if (integrationsNames.indexOf(alwaysLastToRun) !== -1) { + integrations.push.apply(integrations, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1))); + } + return integrations; +} +/** Setup given integration */ +function setupIntegration(integration) { + if (installedIntegrations.indexOf(integration.name) !== -1) { + return; + } + integration.setupOnce(_sentry_hub__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"], _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]); + installedIntegrations.push(integration.name); + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log("Integration installed: " + integration.name); +} +/** + * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default + * integrations are added unless they were already provided before. + * @param integrations array of integration instances + * @param withDefault should enable default integrations + */ +function setupIntegrations(options) { + var integrations = {}; + getIntegrationsToSetup(options).forEach(function (integration) { + integrations[integration.name] = integration; + setupIntegration(integration); + }); + // set the `initialized` flag so we don't run through the process again unecessarily; use `Object.defineProperty` + // because by default it creates a property which is nonenumerable, which we want since `initialized` shouldn't be + // considered a member of the index the way the actual integrations are + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addNonEnumerableProperty"])(integrations, 'initialized', true); + return integrations; +} +//# sourceMappingURL=integration.js.map + /***/ }), /***/ "HbXt": @@ -113456,6 +119971,37 @@ module.exports = _typeof; /***/ }), +/***/ "HoQh": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "severityFromString", function() { return severityFromString; }); +/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("PIsB"); +/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("FbLj"); + + +function isSupportedSeverity(level) { + return _enums__WEBPACK_IMPORTED_MODULE_1__["SeverityLevels"].indexOf(level) !== -1; +} +/** + * Converts a string-based level into a {@link Severity}. + * + * @param level string representation of Severity + * @returns Severity + */ +function severityFromString(level) { + if (level === 'warn') + return _sentry_types__WEBPACK_IMPORTED_MODULE_0__["Severity"].Warning; + if (isSupportedSeverity(level)) { + return level; + } + return _sentry_types__WEBPACK_IMPORTED_MODULE_0__["Severity"].Log; +} +//# sourceMappingURL=severity.js.map + +/***/ }), + /***/ "HpDs": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -113981,6 +120527,39 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "HulI": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setPrototypeOf", function() { return setPrototypeOf; }); +var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); +/** + * setPrototypeOf polyfill using __proto__ + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function setProtoOf(obj, proto) { + // @ts-ignore __proto__ does not exist on obj + obj.__proto__ = proto; + return obj; +} +/** + * setPrototypeOf polyfill using mixin + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function mixinProperties(obj, proto) { + for (var prop in proto) { + if (!Object.prototype.hasOwnProperty.call(obj, prop)) { + // @ts-ignore typescript complains about indexing so we remove + obj[prop] = proto[prop]; + } + } + return obj; +} +//# sourceMappingURL=polyfill.js.map + /***/ }), /***/ "Hvzi": @@ -114681,6 +121260,99 @@ $export($export.P + $export.F * __webpack_require__("eeVq")(function () { /***/ }), +/***/ "I7WW": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FetchTransport", function() { return FetchTransport; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Um2S"); +/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ehbI"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("6VZY"); + + + + +/** `fetch` based transport */ +var FetchTransport = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FetchTransport, _super); + function FetchTransport(options, fetchImpl) { + if (fetchImpl === void 0) { fetchImpl = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["getNativeFetchImplementation"])(); } + var _this = _super.call(this, options) || this; + _this._fetch = fetchImpl; + return _this; + } + /** + * @param sentryRequest Prepared SentryRequest to be delivered + * @param originalPayload Original payload used to create SentryRequest + */ + FetchTransport.prototype._sendRequest = function (sentryRequest, originalPayload) { + var _this = this; + // eslint-disable-next-line deprecation/deprecation + if (this._isRateLimited(sentryRequest.type)) { + this.recordLostEvent('ratelimit_backoff', sentryRequest.type); + return Promise.reject({ + event: originalPayload, + type: sentryRequest.type, + // eslint-disable-next-line deprecation/deprecation + reason: "Transport for " + sentryRequest.type + " requests locked till " + this._disabledUntil(sentryRequest.type) + " due to too many requests.", + status: 429, + }); + } + var options = { + body: sentryRequest.body, + method: 'POST', + // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default' + // (see https://caniuse.com/#feat=referrer-policy), + // it doesn't. And it throws an exception instead of ignoring this parameter... + // REF: https://github.com/getsentry/raven-js/issues/1233 + referrerPolicy: (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["supportsReferrerPolicy"])() ? 'origin' : ''), + }; + if (this.options.fetchParameters !== undefined) { + Object.assign(options, this.options.fetchParameters); + } + if (this.options.headers !== undefined) { + options.headers = this.options.headers; + } + return this._buffer + .add(function () { + return new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"](function (resolve, reject) { + void _this._fetch(sentryRequest.url, options) + .then(function (response) { + var headers = { + 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'), + 'retry-after': response.headers.get('Retry-After'), + }; + _this._handleResponse({ + requestType: sentryRequest.type, + response: response, + headers: headers, + resolve: resolve, + reject: reject, + }); + }) + .catch(reject); + }); + }) + .then(undefined, function (reason) { + // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError. + if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SentryError"]) { + _this.recordLostEvent('queue_overflow', sentryRequest.type); + } + else { + _this.recordLostEvent('network_error', sentryRequest.type); + } + throw reason; + }); + }; + return FetchTransport; +}(_base__WEBPACK_IMPORTED_MODULE_2__["BaseTransport"])); + +//# sourceMappingURL=fetch.js.map + +/***/ }), + /***/ "I8a+": /***/ (function(module, exports, __webpack_require__) { @@ -116494,229 +123166,293 @@ var CipherShareRequest = function CipherShareRequest(cipher) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exceptionFromError", function() { return exceptionFromError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromPlainObject", function() { return eventFromPlainObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromError", function() { return eventFromError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseStackFrames", function() { return parseStackFrames; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromException", function() { return eventFromException; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromMessage", function() { return eventFromMessage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromUnknownInput", function() { return eventFromUnknownInput; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromPlainObject", function() { return eventFromPlainObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromString", function() { return eventFromString; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("PIsB"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TwdF"); -/* harmony import */ var _stack_parsers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("xHdX"); - +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromUnknownInput", function() { return eventFromUnknownInput; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exceptionFromError", function() { return exceptionFromError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseStackFrames", function() { return parseStackFrames; }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); /** - * This function creates an exception from an TraceKitStackTrace - * @param stacktrace TraceKitStackTrace that will be converted to an exception - * @hidden + * This function creates an exception from a JavaScript Error */ -function exceptionFromError(ex) { - // Get the frames first since Opera can lose the stack if we touch anything else first - var frames = parseStackFrames(ex); - var exception = { - type: ex && ex.name, - value: extractMessage(ex), - }; - if (frames.length) { - exception.stacktrace = { frames: frames }; - } - if (exception.type === undefined && exception.value === '') { - exception.value = 'Unrecoverable error caught'; - } - return exception; +function exceptionFromError(stackParser, ex) { + // Get the frames first since Opera can lose the stack if we touch anything else first + const frames = parseStackFrames(stackParser, ex); + + const exception = { + type: ex && ex.name, + value: extractMessage(ex), + }; + + if (frames.length) { + exception.stacktrace = { frames }; + } + + if (exception.type === undefined && exception.value === '') { + exception.value = 'Unrecoverable error caught'; + } + + return exception; } + /** * @hidden */ -function eventFromPlainObject(exception, syntheticException, isUnhandledRejection) { - var event = { - exception: { - values: [ - { - type: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isEvent"])(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error', - value: "Non-Error " + (isUnhandledRejection ? 'promise rejection' : 'exception') + " captured with keys: " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["extractExceptionKeysForMessage"])(exception), - }, - ], - }, - extra: { - __serialized__: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeToSize"])(exception), +function eventFromPlainObject( + stackParser, + exception, + syntheticException, + isUnhandledRejection, +) { + const hub = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])(); + const client = hub.getClient(); + const normalizeDepth = client && client.getOptions().normalizeDepth; + + const event = { + exception: { + values: [ + { + type: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isEvent"])(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error', + value: `Non-Error ${ + isUnhandledRejection ? 'promise rejection' : 'exception' + } captured with keys: ${Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["extractExceptionKeysForMessage"])(exception)}`, }, - }; - if (syntheticException) { - var frames_1 = parseStackFrames(syntheticException); - if (frames_1.length) { - event.stacktrace = { frames: frames_1 }; - } + ], + }, + extra: { + __serialized__: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["normalizeToSize"])(exception, normalizeDepth), + }, + }; + + if (syntheticException) { + const frames = parseStackFrames(stackParser, syntheticException); + if (frames.length) { + // event.exception.values[0] has been set above + (event.exception ).values[0].stacktrace = { frames }; } - return event; + } + + return event; } + /** * @hidden */ -function eventFromError(ex) { - return { - exception: { - values: [exceptionFromError(ex)], - }, - }; +function eventFromError(stackParser, ex) { + return { + exception: { + values: [exceptionFromError(stackParser, ex)], + }, + }; } + /** Parses stack frames from an error */ -function parseStackFrames(ex) { - // Access and store the stacktrace property before doing ANYTHING - // else to it because Opera is not very good at providing it - // reliably in other circumstances. - var stacktrace = ex.stacktrace || ex.stack || ''; - var popSize = getPopSize(ex); - try { - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["createStackParser"])(_stack_parsers__WEBPACK_IMPORTED_MODULE_3__["opera10StackParser"], _stack_parsers__WEBPACK_IMPORTED_MODULE_3__["opera11StackParser"], _stack_parsers__WEBPACK_IMPORTED_MODULE_3__["chromeStackParser"], _stack_parsers__WEBPACK_IMPORTED_MODULE_3__["winjsStackParser"], _stack_parsers__WEBPACK_IMPORTED_MODULE_3__["geckoStackParser"])(stacktrace, popSize); - } - catch (e) { - // no-empty - } - return []; +function parseStackFrames( + stackParser, + ex, +) { + // Access and store the stacktrace property before doing ANYTHING + // else to it because Opera is not very good at providing it + // reliably in other circumstances. + const stacktrace = ex.stacktrace || ex.stack || ''; + + const popSize = getPopSize(ex); + + try { + return stackParser(stacktrace, popSize); + } catch (e) { + // no-empty + } + + return []; } + // Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108 -var reactMinifiedRegexp = /Minified React error #\d+;/i; +const reactMinifiedRegexp = /Minified React error #\d+;/i; + function getPopSize(ex) { - if (ex) { - if (typeof ex.framesToPop === 'number') { - return ex.framesToPop; - } - if (reactMinifiedRegexp.test(ex.message)) { - return 1; - } + if (ex) { + if (typeof ex.framesToPop === 'number') { + return ex.framesToPop; } - return 0; + + if (reactMinifiedRegexp.test(ex.message)) { + return 1; + } + } + + return 0; } + /** * There are cases where stacktrace.message is an Event object * https://github.com/getsentry/sentry-javascript/issues/1949 * In this specific case we try to extract stacktrace.message.error.message */ function extractMessage(ex) { - var message = ex && ex.message; - if (!message) { - return 'No error message'; - } - if (message.error && typeof message.error.message === 'string') { - return message.error.message; - } - return message; + const message = ex && ex.message; + if (!message) { + return 'No error message'; + } + if (message.error && typeof message.error.message === 'string') { + return message.error.message; + } + return message; } + /** * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. * @hidden */ -function eventFromException(exception, hint, attachStacktrace) { - var syntheticException = (hint && hint.syntheticException) || undefined; - var event = eventFromUnknownInput(exception, syntheticException, attachStacktrace); - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionMechanism"])(event); // defaults to { type: 'generic', handled: true } - event.level = _sentry_types__WEBPACK_IMPORTED_MODULE_1__["Severity"].Error; - if (hint && hint.event_id) { - event.event_id = hint.event_id; - } - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["resolvedSyncPromise"])(event); +function eventFromException( + stackParser, + exception, + hint, + attachStacktrace, +) { + const syntheticException = (hint && hint.syntheticException) || undefined; + const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addExceptionMechanism"])(event); // defaults to { type: 'generic', handled: true } + event.level = 'error'; + if (hint && hint.event_id) { + event.event_id = hint.event_id; + } + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["resolvedSyncPromise"])(event); } + /** * Builds and Event from a Message * @hidden */ -function eventFromMessage(message, level, hint, attachStacktrace) { - if (level === void 0) { level = _sentry_types__WEBPACK_IMPORTED_MODULE_1__["Severity"].Info; } - var syntheticException = (hint && hint.syntheticException) || undefined; - var event = eventFromString(message, syntheticException, attachStacktrace); - event.level = level; - if (hint && hint.event_id) { - event.event_id = hint.event_id; - } - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["resolvedSyncPromise"])(event); +function eventFromMessage( + stackParser, + message, + // eslint-disable-next-line deprecation/deprecation + level = 'info', + hint, + attachStacktrace, +) { + const syntheticException = (hint && hint.syntheticException) || undefined; + const event = eventFromString(stackParser, message, syntheticException, attachStacktrace); + event.level = level; + if (hint && hint.event_id) { + event.event_id = hint.event_id; + } + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["resolvedSyncPromise"])(event); } + /** * @hidden */ -function eventFromUnknownInput(exception, syntheticException, attachStacktrace, isUnhandledRejection) { - var event; - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isErrorEvent"])(exception) && exception.error) { - // If it is an ErrorEvent with `error` property, extract it to get actual Error - var errorEvent = exception; - return eventFromError(errorEvent.error); - } - // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name - // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be - // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`. - // - // https://developer.mozilla.org/en-US/docs/Web/API/DOMError - // https://developer.mozilla.org/en-US/docs/Web/API/DOMException - // https://webidl.spec.whatwg.org/#es-DOMException-specialness - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isDOMError"])(exception) || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isDOMException"])(exception)) { - var domException = exception; - if ('stack' in exception) { - event = eventFromError(exception); - } - else { - var name_1 = domException.name || (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isDOMError"])(domException) ? 'DOMError' : 'DOMException'); - var message = domException.message ? name_1 + ": " + domException.message : name_1; - event = eventFromString(message, syntheticException, attachStacktrace); - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionTypeValue"])(event, message); - } - if ('code' in domException) { - event.tags = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, event.tags), { 'DOMException.code': "" + domException.code }); - } - return event; - } - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isError"])(exception)) { - // we have a real Error object, do nothing - return eventFromError(exception); +function eventFromUnknownInput( + stackParser, + exception, + syntheticException, + attachStacktrace, + isUnhandledRejection, +) { + let event; + + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isErrorEvent"])(exception ) && (exception ).error) { + // If it is an ErrorEvent with `error` property, extract it to get actual Error + const errorEvent = exception ; + return eventFromError(stackParser, errorEvent.error ); + } + + // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name + // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be + // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`. + // + // https://developer.mozilla.org/en-US/docs/Web/API/DOMError + // https://developer.mozilla.org/en-US/docs/Web/API/DOMException + // https://webidl.spec.whatwg.org/#es-DOMException-specialness + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isDOMError"])(exception ) || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isDOMException"])(exception )) { + const domException = exception ; + + if ('stack' in (exception )) { + event = eventFromError(stackParser, exception ); + } else { + const name = domException.name || (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isDOMError"])(domException) ? 'DOMError' : 'DOMException'); + const message = domException.message ? `${name}: ${domException.message}` : name; + event = eventFromString(stackParser, message, syntheticException, attachStacktrace); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addExceptionTypeValue"])(event, message); } - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(exception) || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isEvent"])(exception)) { - // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize - // it manually. This will allow us to group events based on top-level keys which is much better than creating a new - // group on any key/value change. - var objectException = exception; - event = eventFromPlainObject(objectException, syntheticException, isUnhandledRejection); - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionMechanism"])(event, { - synthetic: true, - }); - return event; + if ('code' in domException) { + event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` }; } - // If none of previous checks were valid, then it means that it's not: - // - an instance of DOMError - // - an instance of DOMException - // - an instance of Event - // - an instance of Error - // - a valid ErrorEvent (one with an error property) - // - a plain Object - // - // So bail out and capture it as a simple message: - event = eventFromString(exception, syntheticException, attachStacktrace); - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionTypeValue"])(event, "" + exception, undefined); - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionMechanism"])(event, { - synthetic: true, + + return event; + } + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isError"])(exception)) { + // we have a real Error object, do nothing + return eventFromError(stackParser, exception); + } + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isPlainObject"])(exception) || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isEvent"])(exception)) { + // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize + // it manually. This will allow us to group events based on top-level keys which is much better than creating a new + // group on any key/value change. + const objectException = exception ; + event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addExceptionMechanism"])(event, { + synthetic: true, }); return event; + } + + // If none of previous checks were valid, then it means that it's not: + // - an instance of DOMError + // - an instance of DOMException + // - an instance of Event + // - an instance of Error + // - a valid ErrorEvent (one with an error property) + // - a plain Object + // + // So bail out and capture it as a simple message: + event = eventFromString(stackParser, exception , syntheticException, attachStacktrace); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addExceptionTypeValue"])(event, `${exception}`, undefined); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addExceptionMechanism"])(event, { + synthetic: true, + }); + + return event; } + /** * @hidden */ -function eventFromString(input, syntheticException, attachStacktrace) { - var event = { - message: input, - }; - if (attachStacktrace && syntheticException) { - var frames_2 = parseStackFrames(syntheticException); - if (frames_2.length) { - event.stacktrace = { frames: frames_2 }; - } +function eventFromString( + stackParser, + input, + syntheticException, + attachStacktrace, +) { + const event = { + message: input, + }; + + if (attachStacktrace && syntheticException) { + const frames = parseStackFrames(stackParser, syntheticException); + if (frames.length) { + event.exception = { + values: [{ value: input, stacktrace: { frames } }], + }; } - return event; + } + + return event; } + + //# sourceMappingURL=eventbuilder.js.map + /***/ }), /***/ "IU+Z": @@ -152386,7 +159122,7 @@ module.exports = isSameYear "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SessionFlusher", function() { return SessionFlusher; }); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("j43s"); /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("K65+"); /* harmony import */ var _hub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("lW6c"); @@ -154880,199 +161616,6 @@ function _toConsumableArray(arr) { /***/ }), -/***/ "KRiW": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSessionEnvelope", function() { return createSessionEnvelope; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sessionToSentryRequest", function() { return sessionToSentryRequest; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEventEnvelope", function() { return createEventEnvelope; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventToSentryRequest", function() { return eventToSentryRequest; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); -/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("3MsT"); - - - -/** Extract sdk info from from the API metadata */ -function getSdkMetadataForEnvelopeHeader(api) { - if (!api.metadata || !api.metadata.sdk) { - return; - } - var _a = api.metadata.sdk, name = _a.name, version = _a.version; - return { name: name, version: version }; -} -/** - * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key. - * Merge with existing data if any. - **/ -function enhanceEventWithSdkInfo(event, sdkInfo) { - if (!sdkInfo) { - return event; - } - event.sdk = event.sdk || {}; - event.sdk.name = event.sdk.name || sdkInfo.name; - event.sdk.version = event.sdk.version || sdkInfo.version; - event.sdk.integrations = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((event.sdk.integrations || []), (sdkInfo.integrations || [])); - event.sdk.packages = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((event.sdk.packages || []), (sdkInfo.packages || [])); - return event; -} -/** Creates an envelope from a Session */ -function createSessionEnvelope(session, api) { - var sdkInfo = getSdkMetadataForEnvelopeHeader(api); - var envelopeHeaders = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dsnToString"])(api.dsn) })); - // I know this is hacky but we don't want to add `sessions` to request type since it's never rate limited - var type = 'aggregates' in session ? 'sessions' : 'session'; - // TODO (v7) Have to cast type because envelope items do not accept a `SentryRequestType` - var envelopeItem = [{ type: type }, session]; - var envelope = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["createEnvelope"])(envelopeHeaders, [envelopeItem]); - return [envelope, type]; -} -/** Creates a SentryRequest from a Session. */ -function sessionToSentryRequest(session, api) { - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(createSessionEnvelope(session, api), 2), envelope = _a[0], type = _a[1]; - return { - body: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["serializeEnvelope"])(envelope), - type: type, - url: Object(_api__WEBPACK_IMPORTED_MODULE_2__["getEnvelopeEndpointWithUrlEncodedAuth"])(api.dsn, api.tunnel), - }; -} -/** - * Create an Envelope from an event. Note that this is duplicated from below, - * but on purpose as this will be refactored in v7. - */ -function createEventEnvelope(event, api) { - var sdkInfo = getSdkMetadataForEnvelopeHeader(api); - var eventType = event.type || 'event'; - var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling; - var _a = transactionSampling || {}, samplingMethod = _a.method, sampleRate = _a.rate; - // TODO: Below is a temporary hack in order to debug a serialization error - see - // https://github.com/getsentry/sentry-javascript/issues/2809, - // https://github.com/getsentry/sentry-javascript/pull/4425, and - // https://github.com/getsentry/sentry-javascript/pull/4574. - // - // TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to - // throw a circular reference error. - // - // When it's time to remove it: - // 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting - // `sdkProcessingMetadata` - // 2. Restore the original version of the request body, which is commented out - // 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the - // baseClient tests in this package - enhanceEventWithSdkInfo(event, api.metadata.sdk); - event.tags = event.tags || {}; - event.extra = event.extra || {}; - // In theory, all events should be marked as having gone through normalization and so - // we should never set this tag/extra data - if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) { - event.tags.skippedNormalization = true; - event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset'; - } - // prevent this data from being sent to sentry - // TODO: This is NOT part of the hack - DO NOT DELETE - delete event.sdkProcessingMetadata; - var envelopeHeaders = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ event_id: event.event_id, sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dsnToString"])(api.dsn) })); - var eventItem = [ - { - type: eventType, - sample_rates: [{ id: samplingMethod, rate: sampleRate }], - }, - event, - ]; - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["createEnvelope"])(envelopeHeaders, [eventItem]); -} -/** Creates a SentryRequest from an event. */ -function eventToSentryRequest(event, api) { - var sdkInfo = getSdkMetadataForEnvelopeHeader(api); - var eventType = event.type || 'event'; - var useEnvelope = eventType === 'transaction' || !!api.tunnel; - var transactionSampling = (event.sdkProcessingMetadata || {}).transactionSampling; - var _a = transactionSampling || {}, samplingMethod = _a.method, sampleRate = _a.rate; - // TODO: Below is a temporary hack in order to debug a serialization error - see - // https://github.com/getsentry/sentry-javascript/issues/2809, - // https://github.com/getsentry/sentry-javascript/pull/4425, and - // https://github.com/getsentry/sentry-javascript/pull/4574. - // - // TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to - // throw a circular reference error. - // - // When it's time to remove it: - // 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting - // `sdkProcessingMetadata` - // 2. Restore the original version of the request body, which is commented out - // 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the - // baseClient tests in this package - enhanceEventWithSdkInfo(event, api.metadata.sdk); - event.tags = event.tags || {}; - event.extra = event.extra || {}; - // In theory, all events should be marked as having gone through normalization and so - // we should never set this tag/extra data - if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) { - event.tags.skippedNormalization = true; - event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset'; - } - // prevent this data from being sent to sentry - // TODO: This is NOT part of the hack - DO NOT DELETE - delete event.sdkProcessingMetadata; - var body; - try { - // 99.9% of events should get through just fine - no change in behavior for them - body = JSON.stringify(event); - } - catch (err) { - // Record data about the error without replacing original event data, then force renormalization - event.tags.JSONStringifyError = true; - event.extra.JSONStringifyError = err; - try { - body = JSON.stringify(Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["normalize"])(event)); - } - catch (newErr) { - // At this point even renormalization hasn't worked, meaning something about the event data has gone very wrong. - // Time to cut our losses and record only the new error. With luck, even in the problematic cases we're trying to - // debug with this hack, we won't ever land here. - var innerErr = newErr; - body = JSON.stringify({ - message: 'JSON.stringify error after renormalization', - // setting `extra: { innerErr }` here for some reason results in an empty object, so unpack manually - extra: { message: innerErr.message, stack: innerErr.stack }, - }); - } - } - var req = { - // this is the relevant line of code before the hack was added, to make it easy to undo said hack once we've solved - // the mystery - // body: JSON.stringify(sdkInfo ? enhanceEventWithSdkInfo(event, api.metadata.sdk) : event), - body: body, - type: eventType, - url: useEnvelope - ? Object(_api__WEBPACK_IMPORTED_MODULE_2__["getEnvelopeEndpointWithUrlEncodedAuth"])(api.dsn, api.tunnel) - : Object(_api__WEBPACK_IMPORTED_MODULE_2__["getStoreEndpointWithUrlEncodedAuth"])(api.dsn), - }; - // https://develop.sentry.dev/sdk/envelopes/ - // Since we don't need to manipulate envelopes nor store them, there is no - // exported concept of an Envelope with operations including serialization and - // deserialization. Instead, we only implement a minimal subset of the spec to - // serialize events inline here. - if (useEnvelope) { - var envelopeHeaders = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ event_id: event.event_id, sent_at: new Date().toISOString() }, (sdkInfo && { sdk: sdkInfo })), (!!api.tunnel && { dsn: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dsnToString"])(api.dsn) })); - var eventItem = [ - { - type: eventType, - sample_rates: [{ id: samplingMethod, rate: sampleRate }], - }, - req.body, - ]; - var envelope = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["createEnvelope"])(envelopeHeaders, [eventItem]); - req.body = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["serializeEnvelope"])(envelope); - } - return req; -} -//# sourceMappingURL=request.js.map - -/***/ }), - /***/ "KUH8": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -155596,6 +162139,196 @@ exports.default = _default; /***/ }), +/***/ "KbQE": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsErrorEvent", function() { return supportsErrorEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsDOMError", function() { return supportsDOMError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsDOMException", function() { return supportsDOMException; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsFetch", function() { return supportsFetch; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNativeFetch", function() { return isNativeFetch; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsNativeFetch", function() { return supportsNativeFetch; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsReportingObserver", function() { return supportsReportingObserver; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsReferrerPolicy", function() { return supportsReferrerPolicy; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsHistory", function() { return supportsHistory; }); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("yCCt"); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("ETVo"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1WlT"); + + + +/** + * Tells whether current environment supports ErrorEvent objects + * {@link supportsErrorEvent}. + * + * @returns Answer to the given question. + */ +function supportsErrorEvent() { + try { + new ErrorEvent(''); + return true; + } + catch (e) { + return false; + } +} +/** + * Tells whether current environment supports DOMError objects + * {@link supportsDOMError}. + * + * @returns Answer to the given question. + */ +function supportsDOMError() { + try { + // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError': + // 1 argument required, but only 0 present. + // @ts-ignore It really needs 1 argument, not 0. + new DOMError(''); + return true; + } + catch (e) { + return false; + } +} +/** + * Tells whether current environment supports DOMException objects + * {@link supportsDOMException}. + * + * @returns Answer to the given question. + */ +function supportsDOMException() { + try { + new DOMException(''); + return true; + } + catch (e) { + return false; + } +} +/** + * Tells whether current environment supports Fetch API + * {@link supportsFetch}. + * + * @returns Answer to the given question. + */ +function supportsFetch() { + if (!('fetch' in Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])())) { + return false; + } + try { + new Headers(); + new Request(''); + new Response(); + return true; + } + catch (e) { + return false; + } +} +/** + * isNativeFetch checks if the given function is a native implementation of fetch() + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function isNativeFetch(func) { + return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); +} +/** + * Tells whether current environment supports Fetch API natively + * {@link supportsNativeFetch}. + * + * @returns true if `window.fetch` is natively implemented, false otherwise + */ +function supportsNativeFetch() { + if (!supportsFetch()) { + return false; + } + var global = Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + // Fast path to avoid DOM I/O + // eslint-disable-next-line @typescript-eslint/unbound-method + if (isNativeFetch(global.fetch)) { + return true; + } + // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension) + // so create a "pure" iframe to see if that has native fetch + var result = false; + var doc = global.document; + // eslint-disable-next-line deprecation/deprecation + if (doc && typeof doc.createElement === 'function') { + try { + var sandbox = doc.createElement('iframe'); + sandbox.hidden = true; + doc.head.appendChild(sandbox); + if (sandbox.contentWindow && sandbox.contentWindow.fetch) { + // eslint-disable-next-line @typescript-eslint/unbound-method + result = isNativeFetch(sandbox.contentWindow.fetch); + } + doc.head.removeChild(sandbox); + } + catch (err) { + _flags__WEBPACK_IMPORTED_MODULE_0__["IS_DEBUG_BUILD"] && + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err); + } + } + return result; +} +/** + * Tells whether current environment supports ReportingObserver API + * {@link supportsReportingObserver}. + * + * @returns Answer to the given question. + */ +function supportsReportingObserver() { + return 'ReportingObserver' in Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); +} +/** + * Tells whether current environment supports Referrer Policy API + * {@link supportsReferrerPolicy}. + * + * @returns Answer to the given question. + */ +function supportsReferrerPolicy() { + // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default' + // (see https://caniuse.com/#feat=referrer-policy), + // it doesn't. And it throws an exception instead of ignoring this parameter... + // REF: https://github.com/getsentry/raven-js/issues/1233 + if (!supportsFetch()) { + return false; + } + try { + new Request('_', { + referrerPolicy: 'origin', + }); + return true; + } + catch (e) { + return false; + } +} +/** + * Tells whether current environment supports History API + * {@link supportsHistory}. + * + * @returns Answer to the given question. + */ +function supportsHistory() { + // NOTE: in Chrome App environment, touching history.pushState, *even inside + // a try/catch block*, will cause Chrome to output an error to console.error + // borrowed from: https://github.com/angular/angular.js/pull/13945/files + var global = Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var chrome = global.chrome; + var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime; + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + var hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState; + return !isChromePackagedApp && hasHistoryApi; +} +//# sourceMappingURL=supports.js.map + +/***/ }), + /***/ "Kcim": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -156344,7 +163077,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return Scope; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return addGlobalEventProcessor; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("j43s"); /** @@ -157242,6 +163975,57 @@ function isThisQuarter (dirtyDate) { module.exports = isThisQuarter +/***/ }), + +/***/ "KpEf": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "memoBuilder", function() { return memoBuilder; }); +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** + * Helper to decycle json objects + */ +function memoBuilder() { + var hasWeakSet = typeof WeakSet === 'function'; + var inner = hasWeakSet ? new WeakSet() : []; + function memoize(obj) { + if (hasWeakSet) { + if (inner.has(obj)) { + return true; + } + inner.add(obj); + return false; + } + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (var i = 0; i < inner.length; i++) { + var value = inner[i]; + if (value === obj) { + return true; + } + } + inner.push(obj); + return false; + } + function unmemoize(obj) { + if (hasWeakSet) { + inner.delete(obj); + } + else { + for (var i = 0; i < inner.length; i++) { + if (inner[i] === obj) { + inner.splice(i, 1); + break; + } + } + } + } + return [memoize, unmemoize]; +} +//# sourceMappingURL=memo.js.map + /***/ }), /***/ "KpFn": @@ -159868,6 +166652,39 @@ module.exports = buildDistanceInWordsLocale module.exports = false; +/***/ }), + +/***/ "LQFB": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setPrototypeOf", function() { return setPrototypeOf; }); +var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); +/** + * setPrototypeOf polyfill using __proto__ + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function setProtoOf(obj, proto) { + // @ts-ignore __proto__ does not exist on obj + obj.__proto__ = proto; + return obj; +} +/** + * setPrototypeOf polyfill using mixin + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function mixinProperties(obj, proto) { + for (var prop in proto) { + if (!Object.prototype.hasOwnProperty.call(obj, prop)) { + // @ts-ignore typescript complains about indexing so we remove + obj[prop] = proto[prop]; + } + } + return obj; +} +//# sourceMappingURL=polyfill.js.map + /***/ }), /***/ "LSME": @@ -181036,6 +187853,39 @@ var useRealtime = function useRealtime(client, specs, deps) { var _default = useRealtime; exports.default = _default; +/***/ }), + +/***/ "Lw/n": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "init", function() { return init; }); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("WSEr"); + + +/** + * Inits the React SDK + */ +function init(options) { + options._metadata = options._metadata || {}; + options._metadata.sdk = options._metadata.sdk || { + name: 'sentry.javascript.react', + packages: [ + { + name: 'npm:@sentry/react', + version: _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["SDK_VERSION"], + }, + ], + version: _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["SDK_VERSION"], + }; + Object(_sentry_browser__WEBPACK_IMPORTED_MODULE_0__["init"])(options); +} + + +//# sourceMappingURL=sdk.js.map + + /***/ }), /***/ "LxoM": @@ -185363,6 +192213,324 @@ function hyphenateStyleName(name) { /* harmony default export */ __webpack_exports__["default"] = (hyphenateStyleName); +/***/ }), + +/***/ "MBYv": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_FINAL_TIMEOUT", function() { return DEFAULT_FINAL_TIMEOUT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_HEARTBEAT_INTERVAL", function() { return DEFAULT_HEARTBEAT_INTERVAL; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_IDLE_TIMEOUT", function() { return DEFAULT_IDLE_TIMEOUT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IdleTransaction", function() { return IdleTransaction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IdleTransactionSpanRecorder", function() { return IdleTransactionSpanRecorder; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _span_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("SYqL"); +/* harmony import */ var _transaction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("EldZ"); + + + + +const DEFAULT_IDLE_TIMEOUT = 1000; +const DEFAULT_FINAL_TIMEOUT = 30000; +const DEFAULT_HEARTBEAT_INTERVAL = 5000; + +/** + * @inheritDoc + */ +class IdleTransactionSpanRecorder extends _span_js__WEBPACK_IMPORTED_MODULE_1__["SpanRecorder"] { + constructor( + _pushActivity, + _popActivity, + transactionSpanId, + maxlen, + ) { + super(maxlen);this._pushActivity = _pushActivity;this._popActivity = _popActivity;this.transactionSpanId = transactionSpanId;; + } + + /** + * @inheritDoc + */ + add(span) { + // We should make sure we do not push and pop activities for + // the transaction that this span recorder belongs to. + if (span.spanId !== this.transactionSpanId) { + // We patch span.finish() to pop an activity after setting an endTimestamp. + span.finish = (endTimestamp) => { + span.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["timestampWithMs"])(); + this._popActivity(span.spanId); + }; + + // We should only push new activities if the span does not have an end timestamp. + if (span.endTimestamp === undefined) { + this._pushActivity(span.spanId); + } + } + + super.add(span); + } +} + +/** + * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities. + * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will + * put itself on the scope on creation. + */ +class IdleTransaction extends _transaction_js__WEBPACK_IMPORTED_MODULE_2__["Transaction"] { + // Activities store a list of active spans + __init() {this.activities = {};} + + // Track state of activities in previous heartbeat + + // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats. + __init2() {this._heartbeatCounter = 0;} + + // We should not use heartbeat if we finished a transaction + __init3() {this._finished = false;} + + __init4() {this._beforeFinishCallbacks = [];} + + /** + * Timer that tracks Transaction idleTimeout + */ + + constructor( + transactionContext, + _idleHub, + /** + * The time to wait in ms until the idle transaction will be finished. This timer is started each time + * there are no active spans on this transaction. + */ + _idleTimeout = DEFAULT_IDLE_TIMEOUT, + /** + * The final value in ms that a transaction cannot exceed + */ + _finalTimeout = DEFAULT_FINAL_TIMEOUT, + _heartbeatInterval = DEFAULT_HEARTBEAT_INTERVAL, + // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends + _onScope = false, + ) { + super(transactionContext, _idleHub);this._idleHub = _idleHub;this._idleTimeout = _idleTimeout;this._finalTimeout = _finalTimeout;this._heartbeatInterval = _heartbeatInterval;this._onScope = _onScope;IdleTransaction.prototype.__init.call(this);IdleTransaction.prototype.__init2.call(this);IdleTransaction.prototype.__init3.call(this);IdleTransaction.prototype.__init4.call(this);; + + if (_onScope) { + // There should only be one active transaction on the scope + clearActiveTransaction(_idleHub); + + // We set the transaction here on the scope so error events pick up the trace + // context and attach it to the error. + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(`Setting idle transaction on scope. Span ID: ${this.spanId}`); + _idleHub.configureScope(scope => scope.setSpan(this)); + } + + this._startIdleTimeout(); + setTimeout(() => { + if (!this._finished) { + this.setStatus('deadline_exceeded'); + this.finish(); + } + }, this._finalTimeout); + } + + /** {@inheritDoc} */ + finish(endTimestamp = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["timestampWithMs"])()) { + this._finished = true; + this.activities = {}; + + if (this.spanRecorder) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log('[Tracing] finishing IdleTransaction', new Date(endTimestamp * 1000).toISOString(), this.op); + + for (const callback of this._beforeFinishCallbacks) { + callback(this, endTimestamp); + } + + this.spanRecorder.spans = this.spanRecorder.spans.filter((span) => { + // If we are dealing with the transaction itself, we just return it + if (span.spanId === this.spanId) { + return true; + } + + // We cancel all pending spans with status "cancelled" to indicate the idle transaction was finished early + if (!span.endTimestamp) { + span.endTimestamp = endTimestamp; + span.setStatus('cancelled'); + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2)); + } + + const keepSpan = span.startTimestamp < endTimestamp; + if (!keepSpan) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log( + '[Tracing] discarding Span since it happened after Transaction was finished', + JSON.stringify(span, undefined, 2), + ); + } + return keepSpan; + }); + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log('[Tracing] flushing IdleTransaction'); + } else { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log('[Tracing] No active IdleTransaction'); + } + + // if `this._onScope` is `true`, the transaction put itself on the scope when it started + if (this._onScope) { + clearActiveTransaction(this._idleHub); + } + + return super.finish(endTimestamp); + } + + /** + * Register a callback function that gets excecuted before the transaction finishes. + * Useful for cleanup or if you want to add any additional spans based on current context. + * + * This is exposed because users have no other way of running something before an idle transaction + * finishes. + */ + registerBeforeFinishCallback(callback) { + this._beforeFinishCallbacks.push(callback); + } + + /** + * @inheritDoc + */ + initSpanRecorder(maxlen) { + if (!this.spanRecorder) { + const pushActivity = (id) => { + if (this._finished) { + return; + } + this._pushActivity(id); + }; + const popActivity = (id) => { + if (this._finished) { + return; + } + this._popActivity(id); + }; + + this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanId, maxlen); + + // Start heartbeat so that transactions do not run forever. + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log('Starting heartbeat'); + this._pingHeartbeat(); + } + this.spanRecorder.add(this); + } + + /** + * Cancels the existing idletimeout, if there is one + */ + _cancelIdleTimeout() { + if (this._idleTimeoutID) { + clearTimeout(this._idleTimeoutID); + this._idleTimeoutID = undefined; + } + } + + /** + * Creates an idletimeout + */ + _startIdleTimeout(endTimestamp) { + this._cancelIdleTimeout(); + this._idleTimeoutID = setTimeout(() => { + if (!this._finished && Object.keys(this.activities).length === 0) { + this.finish(endTimestamp); + } + }, this._idleTimeout); + } + + /** + * Start tracking a specific activity. + * @param spanId The span id that represents the activity + */ + _pushActivity(spanId) { + this._cancelIdleTimeout(); + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(`[Tracing] pushActivity: ${spanId}`); + this.activities[spanId] = true; + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log('[Tracing] new activities count', Object.keys(this.activities).length); + } + + /** + * Remove an activity from usage + * @param spanId The span id that represents the activity + */ + _popActivity(spanId) { + if (this.activities[spanId]) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(`[Tracing] popActivity ${spanId}`); + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this.activities[spanId]; + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log('[Tracing] new activities count', Object.keys(this.activities).length); + } + + if (Object.keys(this.activities).length === 0) { + // We need to add the timeout here to have the real endtimestamp of the transaction + // Remember timestampWithMs is in seconds, timeout is in ms + const endTimestamp = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["timestampWithMs"])() + this._idleTimeout / 1000; + this._startIdleTimeout(endTimestamp); + } + } + + /** + * Checks when entries of this.activities are not changing for 3 beats. + * If this occurs we finish the transaction. + */ + _beat() { + // We should not be running heartbeat if the idle transaction is finished. + if (this._finished) { + return; + } + + const heartbeatString = Object.keys(this.activities).join(''); + + if (heartbeatString === this._prevHeartbeatString) { + this._heartbeatCounter += 1; + } else { + this._heartbeatCounter = 1; + } + + this._prevHeartbeatString = heartbeatString; + + if (this._heartbeatCounter >= 3) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log('[Tracing] Transaction finished because of no change for 3 heart beats'); + this.setStatus('deadline_exceeded'); + this.finish(); + } else { + this._pingHeartbeat(); + } + } + + /** + * Pings the heartbeat + */ + _pingHeartbeat() { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`); + setTimeout(() => { + this._beat(); + }, this._heartbeatInterval); + } +} + +/** + * Reset transaction on scope to `undefined` + */ +function clearActiveTransaction(hub) { + const scope = hub.getScope(); + if (scope) { + const transaction = scope.getTransaction(); + if (transaction) { + scope.setSpan(undefined); + } + } +} + + +//# sourceMappingURL=idletransaction.js.map + + /***/ }), /***/ "MBlf": @@ -186223,82 +193391,107 @@ if (true) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "installedIntegrations", function() { return installedIntegrations; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getIntegrationsToSetup", function() { return getIntegrationsToSetup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setupIntegration", function() { return setupIntegration; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "installedIntegrations", function() { return installedIntegrations; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setupIntegrations", function() { return setupIntegrations; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("uzXi"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TwdF"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("yA8j"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GIgW"); +/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("vOz9"); -var installedIntegrations = []; +const installedIntegrations = []; + +/** Map of integrations assigned to a client */ + /** + * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to + * preseve the order of integrations in the array. + * * @private */ function filterDuplicates(integrations) { - return integrations.reduce(function (acc, integrations) { - if (acc.every(function (accIntegration) { return integrations.name !== accIntegration.name; })) { - acc.push(integrations); - } - return acc; - }, []); -} -/** Gets integration to install */ -function getIntegrationsToSetup(options) { - var defaultIntegrations = (options.defaultIntegrations && Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(options.defaultIntegrations)) || []; - var userIntegrations = options.integrations; - var integrations = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(filterDuplicates(defaultIntegrations)); - if (Array.isArray(userIntegrations)) { - // Filter out integrations that are also included in user options - integrations = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(integrations.filter(function (integrations) { - return userIntegrations.every(function (userIntegration) { return userIntegration.name !== integrations.name; }); - }), filterDuplicates(userIntegrations)); - } - else if (typeof userIntegrations === 'function') { - integrations = userIntegrations(integrations); - integrations = Array.isArray(integrations) ? integrations : [integrations]; - } - // Make sure that if present, `Debug` integration will always run last - var integrationsNames = integrations.map(function (i) { return i.name; }); - var alwaysLastToRun = 'Debug'; - if (integrationsNames.indexOf(alwaysLastToRun) !== -1) { - integrations.push.apply(integrations, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1))); + const integrationsByName = {}; + + integrations.forEach(currentInstance => { + const { name } = currentInstance; + + const existingInstance = integrationsByName[name]; + + // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a + // default instance to overwrite an existing user instance + if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) { + return; } - return integrations; + + integrationsByName[name] = currentInstance; + }); + + return Object.values(integrationsByName); } -/** Setup given integration */ -function setupIntegration(integration) { - if (installedIntegrations.indexOf(integration.name) !== -1) { - return; - } - integration.setupOnce(_sentry_hub__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"], _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]); - installedIntegrations.push(integration.name); - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log("Integration installed: " + integration.name); + +/** Gets integrations to install */ +function getIntegrationsToSetup(options) { + const defaultIntegrations = options.defaultIntegrations || []; + const userIntegrations = options.integrations; + + // We flag default instances, so that later we can tell them apart from any user-created instances of the same class + defaultIntegrations.forEach(integration => { + integration.isDefaultInstance = true; + }); + + let integrations; + + if (Array.isArray(userIntegrations)) { + integrations = [...defaultIntegrations, ...userIntegrations]; + } else if (typeof userIntegrations === 'function') { + integrations = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["arrayify"])(userIntegrations(defaultIntegrations)); + } else { + integrations = defaultIntegrations; + } + + const finalIntegrations = filterDuplicates(integrations); + + // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or + // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event + // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore + // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array. + const debugIndex = finalIntegrations.findIndex(integration => integration.name === 'Debug'); + if (debugIndex !== -1) { + const [debugInstance] = finalIntegrations.splice(debugIndex, 1); + finalIntegrations.push(debugInstance); + } + + return finalIntegrations; } + /** * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default * integrations are added unless they were already provided before. * @param integrations array of integration instances * @param withDefault should enable default integrations */ -function setupIntegrations(options) { - var integrations = {}; - getIntegrationsToSetup(options).forEach(function (integration) { - integrations[integration.name] = integration; - setupIntegration(integration); - }); - // set the `initialized` flag so we don't run through the process again unecessarily; use `Object.defineProperty` - // because by default it creates a property which is nonenumerable, which we want since `initialized` shouldn't be - // considered a member of the index the way the actual integrations are - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addNonEnumerableProperty"])(integrations, 'initialized', true); - return integrations; +function setupIntegrations(integrations) { + const integrationIndex = {}; + + integrations.forEach(integration => { + integrationIndex[integration.name] = integration; + + if (installedIntegrations.indexOf(integration.name) === -1) { + integration.setupOnce(_scope_js__WEBPACK_IMPORTED_MODULE_2__["addGlobalEventProcessor"], _hub_js__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]); + installedIntegrations.push(integration.name); + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(`Integration installed: ${integration.name}`); + } + }); + + return integrationIndex; } + + //# sourceMappingURL=integration.js.map + /***/ }), /***/ "MEyw": @@ -188011,74 +195204,63 @@ exports.DeprecatedDivider = DeprecatedDivider; "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XHRTransport", function() { return XHRTransport; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeXHRTransport", function() { return makeXHRTransport; }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); -/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("DTjN"); -/** `XHR` based transport */ -var XHRTransport = /** @class */ (function (_super) { - Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(XHRTransport, _super); - function XHRTransport() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * @param sentryRequest Prepared SentryRequest to be delivered - * @param originalPayload Original payload used to create SentryRequest - */ - XHRTransport.prototype._sendRequest = function (sentryRequest, originalPayload) { - var _this = this; - // eslint-disable-next-line deprecation/deprecation - if (this._isRateLimited(sentryRequest.type)) { - this.recordLostEvent('ratelimit_backoff', sentryRequest.type); - return Promise.reject({ - event: originalPayload, - type: sentryRequest.type, - // eslint-disable-next-line deprecation/deprecation - reason: "Transport for " + sentryRequest.type + " requests locked till " + this._disabledUntil(sentryRequest.type) + " due to too many requests.", - status: 429, - }); +/** + * The DONE ready state for XmlHttpRequest + * + * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined + * (e.g. during testing, it is `undefined`) + * + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState} + */ +const XHR_READYSTATE_DONE = 4; + +/** + * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry. + */ +function makeXHRTransport(options) { + function makeRequest(request) { + return new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"]((resolve, reject) => { + const xhr = new XMLHttpRequest(); + + xhr.onerror = reject; + + xhr.onreadystatechange = () => { + if (xhr.readyState === XHR_READYSTATE_DONE) { + resolve({ + statusCode: xhr.status, + headers: { + 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'), + 'retry-after': xhr.getResponseHeader('Retry-After'), + }, + }); } - return this._buffer - .add(function () { - return new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"](function (resolve, reject) { - var request = new XMLHttpRequest(); - request.onreadystatechange = function () { - if (request.readyState === 4) { - var headers = { - 'x-sentry-rate-limits': request.getResponseHeader('X-Sentry-Rate-Limits'), - 'retry-after': request.getResponseHeader('Retry-After'), - }; - _this._handleResponse({ requestType: sentryRequest.type, response: request, headers: headers, resolve: resolve, reject: reject }); - } - }; - request.open('POST', sentryRequest.url); - for (var header in _this.options.headers) { - if (Object.prototype.hasOwnProperty.call(_this.options.headers, header)) { - request.setRequestHeader(header, _this.options.headers[header]); - } - } - request.send(sentryRequest.body); - }); - }) - .then(undefined, function (reason) { - // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError. - if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SentryError"]) { - _this.recordLostEvent('queue_overflow', sentryRequest.type); - } - else { - _this.recordLostEvent('network_error', sentryRequest.type); - } - throw reason; - }); - }; - return XHRTransport; -}(_base__WEBPACK_IMPORTED_MODULE_2__["BaseTransport"])); + }; + + xhr.open('POST', options.url); + + for (const header in options.headers) { + if (Object.prototype.hasOwnProperty.call(options.headers, header)) { + xhr.setRequestHeader(header, options.headers[header]); + } + } + + xhr.send(request.body); + }); + } + + return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["createTransport"])(options, makeRequest); +} + //# sourceMappingURL=xhr.js.map + /***/ }), /***/ "MVIV": @@ -188121,6 +195303,48 @@ module.exports = _objectSpread, module.exports.__esModule = true, module.exports /***/ }), +/***/ "MVaA": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initAndBind", function() { return initAndBind; }); +/* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("uzXi"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Um2S"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("OEZb"); + + + +/** + * Internal function to create a new SDK client instance. The client is + * installed and then bound to the current scope. + * + * @param clientClass The client class to instantiate. + * @param options Options to pass to the client. + */ +function initAndBind(clientClass, options) { + if (options.debug === true) { + if (_flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"]) { + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].enable(); + } + else { + // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped + // eslint-disable-next-line no-console + console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.'); + } + } + var hub = Object(_sentry_hub__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])(); + var scope = hub.getScope(); + if (scope) { + scope.update(options.initialScope); + } + var client = new clientClass(options); + hub.bindClient(client); +} +//# sourceMappingURL=sdk.js.map + +/***/ }), + /***/ "MYAB": /***/ (function(module, exports, __webpack_require__) { @@ -188765,6 +195989,53 @@ var CozyFile = /*#__PURE__*/function (_Document) { CozyFile.doctype = 'io.cozy.files'; module.exports = CozyFile; +/***/ }), + +/***/ "MaC4": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "observe", function() { return observe; }); +/** + * Takes a performance entry type and a callback function, and creates a + * `PerformanceObserver` instance that will observe the specified entry type + * with buffering enabled and call the callback _for each entry_. + * + * This function also feature-detects entry support and wraps the logic in a + * try/catch to avoid errors in unsupporting browsers. + */ +const observe = ( + type, + callback, + opts, +) => { + try { + if (PerformanceObserver.supportedEntryTypes.includes(type)) { + const po = new PerformanceObserver(list => { + callback(list.getEntries() ); + }); + po.observe( + Object.assign( + { + type, + buffered: true, + }, + opts || {}, + ) , + ); + return po; + } + } catch (e) { + // Do nothing. + } + return; +}; + + +//# sourceMappingURL=observe.js.map + + /***/ }), /***/ "MaPn": @@ -190299,6 +197570,68 @@ function assignValue(object, key, value) { module.exports = assignValue; +/***/ }), + +/***/ "Ms9h": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _asyncNullishCoalesce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("6fQM"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_asyncNullishCoalesce", function() { return _asyncNullishCoalesce_js__WEBPACK_IMPORTED_MODULE_0__["_asyncNullishCoalesce"]; }); + +/* harmony import */ var _asyncOptionalChain_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("rusa"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_asyncOptionalChain", function() { return _asyncOptionalChain_js__WEBPACK_IMPORTED_MODULE_1__["_asyncOptionalChain"]; }); + +/* harmony import */ var _asyncOptionalChainDelete_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Ou/l"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_asyncOptionalChainDelete", function() { return _asyncOptionalChainDelete_js__WEBPACK_IMPORTED_MODULE_2__["_asyncOptionalChainDelete"]; }); + +/* harmony import */ var _createNamedExportFrom_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("dWpK"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_createNamedExportFrom", function() { return _createNamedExportFrom_js__WEBPACK_IMPORTED_MODULE_3__["_createNamedExportFrom"]; }); + +/* harmony import */ var _createStarExport_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("11UV"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_createStarExport", function() { return _createStarExport_js__WEBPACK_IMPORTED_MODULE_4__["_createStarExport"]; }); + +/* harmony import */ var _interopDefault_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("VrCg"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_interopDefault", function() { return _interopDefault_js__WEBPACK_IMPORTED_MODULE_5__["_interopDefault"]; }); + +/* harmony import */ var _interopNamespace_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("xTur"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_interopNamespace", function() { return _interopNamespace_js__WEBPACK_IMPORTED_MODULE_6__["_interopNamespace"]; }); + +/* harmony import */ var _interopNamespaceDefaultOnly_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("2Egv"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_interopNamespaceDefaultOnly", function() { return _interopNamespaceDefaultOnly_js__WEBPACK_IMPORTED_MODULE_7__["_interopNamespaceDefaultOnly"]; }); + +/* harmony import */ var _interopRequireDefault_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("xAFG"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_interopRequireDefault", function() { return _interopRequireDefault_js__WEBPACK_IMPORTED_MODULE_8__["_interopRequireDefault"]; }); + +/* harmony import */ var _interopRequireWildcard_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("bSWo"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_interopRequireWildcard", function() { return _interopRequireWildcard_js__WEBPACK_IMPORTED_MODULE_9__["_interopRequireWildcard"]; }); + +/* harmony import */ var _nullishCoalesce_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("P/f2"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_nullishCoalesce", function() { return _nullishCoalesce_js__WEBPACK_IMPORTED_MODULE_10__["_nullishCoalesce"]; }); + +/* harmony import */ var _optionalChain_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("fqQG"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_optionalChain", function() { return _optionalChain_js__WEBPACK_IMPORTED_MODULE_11__["_optionalChain"]; }); + +/* harmony import */ var _optionalChainDelete_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("rwsT"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_optionalChainDelete", function() { return _optionalChainDelete_js__WEBPACK_IMPORTED_MODULE_12__["_optionalChainDelete"]; }); + + + + + + + + + + + + + + +//# sourceMappingURL=index.js.map + + /***/ }), /***/ "MtdB": @@ -190544,6 +197877,104 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "N4D0": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONSOLE_LEVELS", function() { return CONSOLE_LEVELS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consoleSandbox", function() { return consoleSandbox; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return logger; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("G8B2"); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BilH"); + + + +// TODO: Implement different loggers for different environments +var global = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); +/** Prefix for logging strings */ +var PREFIX = 'Sentry Logger '; +var CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert']; +/** + * Temporarily disable sentry console instrumentations. + * + * @param callback The function to run against the original `console` messages + * @returns The results of the callback + */ +function consoleSandbox(callback) { + var global = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); + if (!('console' in global)) { + return callback(); + } + var originalConsole = global.console; + var wrappedLevels = {}; + // Restore all wrapped console methods + CONSOLE_LEVELS.forEach(function (level) { + // TODO(v7): Remove this check as it's only needed for Node 6 + var originalWrappedFunc = originalConsole[level] && originalConsole[level].__sentry_original__; + if (level in global.console && originalWrappedFunc) { + wrappedLevels[level] = originalConsole[level]; + originalConsole[level] = originalWrappedFunc; + } + }); + try { + return callback(); + } + finally { + // Revert restoration to wrapped state + Object.keys(wrappedLevels).forEach(function (level) { + originalConsole[level] = wrappedLevels[level]; + }); + } +} +function makeLogger() { + var enabled = false; + var logger = { + enable: function () { + enabled = true; + }, + disable: function () { + enabled = false; + }, + }; + if (_flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"]) { + CONSOLE_LEVELS.forEach(function (name) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + logger[name] = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (enabled) { + consoleSandbox(function () { + var _a; + (_a = global.console)[name].apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([PREFIX + "[" + name + "]:"], args)); + }); + } + }; + }); + } + else { + CONSOLE_LEVELS.forEach(function (name) { + logger[name] = function () { return undefined; }; + }); + } + return logger; +} +// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used +var logger; +if (_flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"]) { + logger = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalSingleton"])('logger', makeLogger); +} +else { + logger = makeLogger(); +} + +//# sourceMappingURL=logger.js.map + /***/ }), /***/ "N4bE": @@ -191115,31 +198546,6 @@ function _nonIterableSpread() { /***/ }), -/***/ "NDfa": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IS_DEBUG_BUILD", function() { return IS_DEBUG_BUILD; }); -/* - * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking - * for users. - * - * Debug flags need to be declared in each package individually and must not be imported across package boundaries, - * because some build tools have trouble tree-shaking imported guards. - * - * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder. - * - * Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during - * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not - * replaced. - */ -/** Flag that is true for debug builds, false otherwise. */ -var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__; -//# sourceMappingURL=flags.js.map - -/***/ }), - /***/ "NDwu": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -191777,39 +199183,6 @@ function defaultParentId(d) { exports.f = {}.propertyIsEnumerable; -/***/ }), - -/***/ "NcYE": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setPrototypeOf", function() { return setPrototypeOf; }); -var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); -/** - * setPrototypeOf polyfill using __proto__ - */ -// eslint-disable-next-line @typescript-eslint/ban-types -function setProtoOf(obj, proto) { - // @ts-ignore __proto__ does not exist on obj - obj.__proto__ = proto; - return obj; -} -/** - * setPrototypeOf polyfill using mixin - */ -// eslint-disable-next-line @typescript-eslint/ban-types -function mixinProperties(obj, proto) { - for (var prop in proto) { - if (!Object.prototype.hasOwnProperty.call(obj, prop)) { - // @ts-ignore typescript complains about indexing so we remove - obj[prop] = proto[prop]; - } - } - return obj; -} -//# sourceMappingURL=polyfill.js.map - /***/ }), /***/ "NdFi": @@ -194498,28 +201871,6 @@ function fromPairs(pairs) { module.exports = fromPairs; -/***/ }), - -/***/ "O8DA": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forget", function() { return forget; }); -/** - * Consumes the promise and logs the error when it rejects. - * @param promise A promise to forget. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function forget(promise) { - void promise.then(null, function (e) { - // TODO: Use a better logging mechanism - // eslint-disable-next-line no-console - console.error(e); - }); -} -//# sourceMappingURL=async.js.map - /***/ }), /***/ "O8cK": @@ -195749,6 +203100,465 @@ function baseClone(value, bitmask, customizer, key, object, stack) { module.exports = baseClone; +/***/ }), + +/***/ "OBsZ": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_addMeasureSpans", function() { return _addMeasureSpans; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_addResourceSpans", function() { return _addResourceSpans; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addPerformanceEntries", function() { return addPerformanceEntries; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startTrackingLongTasks", function() { return startTrackingLongTasks; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startTrackingWebVitals", function() { return startTrackingWebVitals; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("FGHR"); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Wezb"); +/* harmony import */ var _web_vitals_getCLS_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("SWsU"); +/* harmony import */ var _web_vitals_getFID_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("kerP"); +/* harmony import */ var _web_vitals_getLCP_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("AKTn"); +/* harmony import */ var _web_vitals_lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("hNpR"); +/* harmony import */ var _web_vitals_lib_observe_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("MaC4"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("RXEs"); + + + + + + + + + + + +function getBrowserPerformanceAPI() { + return _types_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"] && _types_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].addEventListener && _types_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].performance; +} + +let _performanceCursor = 0; + +let _measurements = {}; +let _lcpEntry; +let _clsEntry; + +/** + * Start tracking web vitals + */ +function startTrackingWebVitals(reportAllChanges = false) { + const performance = getBrowserPerformanceAPI(); + if (performance && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["browserPerformanceTimeOrigin"]) { + if (performance.mark) { + _types_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].performance.mark('sentry-tracing-init'); + } + _trackCLS(); + _trackLCP(reportAllChanges); + _trackFID(); + } +} + +/** + * Start tracking long tasks. + */ +function startTrackingLongTasks() { + const entryHandler = (entries) => { + for (const entry of entries) { + const transaction = Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["getActiveTransaction"])() ; + if (!transaction) { + return; + } + const startTime = Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])((_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["browserPerformanceTimeOrigin"] ) + entry.startTime); + const duration = Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(entry.duration); + + transaction.startChild({ + description: 'Main UI thread blocked', + op: 'ui.long-task', + startTimestamp: startTime, + endTimestamp: startTime + duration, + }); + } + }; + + Object(_web_vitals_lib_observe_js__WEBPACK_IMPORTED_MODULE_8__["observe"])('longtask', entryHandler); +} + +/** Starts tracking the Cumulative Layout Shift on the current page. */ +function _trackCLS() { + // See: + // https://web.dev/evolving-cls/ + // https://web.dev/cls-web-tooling/ + Object(_web_vitals_getCLS_js__WEBPACK_IMPORTED_MODULE_4__["onCLS"])(metric => { + const entry = metric.entries.pop(); + if (!entry) { + return; + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('[Measurements] Adding CLS'); + _measurements['cls'] = { value: metric.value, unit: '' }; + _clsEntry = entry ; + }); +} + +/** Starts tracking the Largest Contentful Paint on the current page. */ +function _trackLCP(reportAllChanges) { + Object(_web_vitals_getLCP_js__WEBPACK_IMPORTED_MODULE_6__["onLCP"])( + metric => { + const entry = metric.entries.pop(); + if (!entry) { + return; + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('[Measurements] Adding LCP'); + _measurements['lcp'] = { value: metric.value, unit: 'millisecond' }; + _lcpEntry = entry ; + }, + { reportAllChanges }, + ); +} + +/** Starts tracking the First Input Delay on the current page. */ +function _trackFID() { + Object(_web_vitals_getFID_js__WEBPACK_IMPORTED_MODULE_5__["onFID"])(metric => { + const entry = metric.entries.pop(); + if (!entry) { + return; + } + + const timeOrigin = Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["browserPerformanceTimeOrigin"] ); + const startTime = Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(entry.startTime); + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('[Measurements] Adding FID'); + _measurements['fid'] = { value: metric.value, unit: 'millisecond' }; + _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' }; + }); +} + +/** Add performance related spans to a transaction */ +function addPerformanceEntries(transaction) { + const performance = getBrowserPerformanceAPI(); + if (!performance || !_types_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].performance.getEntries || !_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["browserPerformanceTimeOrigin"]) { + // Gatekeeper if performance API not available + return; + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('[Tracing] Adding & adjusting spans using Performance API'); + const timeOrigin = Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["browserPerformanceTimeOrigin"]); + + const performanceEntries = performance.getEntries(); + + let responseStartTimestamp; + let requestStartTimestamp; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + performanceEntries.slice(_performanceCursor).forEach((entry) => { + const startTime = Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(entry.startTime); + const duration = Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(entry.duration); + + if (transaction.op === 'navigation' && timeOrigin + startTime < transaction.startTimestamp) { + return; + } + + switch (entry.entryType) { + case 'navigation': { + _addNavigationSpans(transaction, entry, timeOrigin); + responseStartTimestamp = timeOrigin + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(entry.responseStart); + requestStartTimestamp = timeOrigin + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(entry.requestStart); + break; + } + case 'mark': + case 'paint': + case 'measure': { + _addMeasureSpans(transaction, entry, startTime, duration, timeOrigin); + + // capture web vitals + const firstHidden = Object(_web_vitals_lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_7__["getVisibilityWatcher"])(); + // Only report if the page wasn't hidden prior to the web vital. + const shouldRecord = entry.startTime < firstHidden.firstHiddenTime; + + if (entry.name === 'first-paint' && shouldRecord) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('[Measurements] Adding FP'); + _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' }; + } + if (entry.name === 'first-contentful-paint' && shouldRecord) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('[Measurements] Adding FCP'); + _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' }; + } + break; + } + case 'resource': { + const resourceName = (entry.name ).replace(_types_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].location.origin, ''); + _addResourceSpans(transaction, entry, resourceName, startTime, duration, timeOrigin); + break; + } + default: + // Ignore other entry types. + } + }); + + _performanceCursor = Math.max(performanceEntries.length - 1, 0); + + _trackNavigator(transaction); + + // Measurements are only available for pageload transactions + if (transaction.op === 'pageload') { + // Generate TTFB (Time to First Byte), which measured as the time between the beginning of the transaction and the + // start of the response in milliseconds + if (typeof responseStartTimestamp === 'number') { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('[Measurements] Adding TTFB'); + _measurements['ttfb'] = { + value: (responseStartTimestamp - transaction.startTimestamp) * 1000, + unit: 'millisecond', + }; + + if (typeof requestStartTimestamp === 'number' && requestStartTimestamp <= responseStartTimestamp) { + // Capture the time spent making the request and receiving the first byte of the response. + // This is the time between the start of the request and the start of the response in milliseconds. + _measurements['ttfb.requestTime'] = { + value: (responseStartTimestamp - requestStartTimestamp) * 1000, + unit: 'millisecond', + }; + } + } + + ['fcp', 'fp', 'lcp'].forEach(name => { + if (!_measurements[name] || timeOrigin >= transaction.startTimestamp) { + return; + } + // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin. + // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need + // to be adjusted to be relative to transaction.startTimestamp. + const oldValue = _measurements[name].value; + const measurementTimestamp = timeOrigin + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(oldValue); + + // normalizedValue should be in milliseconds + const normalizedValue = Math.abs((measurementTimestamp - transaction.startTimestamp) * 1000); + const delta = normalizedValue - oldValue; + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`); + _measurements[name].value = normalizedValue; + }); + + const fidMark = _measurements['mark.fid']; + if (fidMark && _measurements['fid']) { + // create span for FID + Object(_utils_js__WEBPACK_IMPORTED_MODULE_9__["_startChild"])(transaction, { + description: 'first input delay', + endTimestamp: fidMark.value + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(_measurements['fid'].value), + op: 'ui.action', + startTimestamp: fidMark.value, + }); + + // Delete mark.fid as we don't want it to be part of final payload + delete _measurements['mark.fid']; + } + + // If FCP is not recorded we should not record the cls value + // according to the new definition of CLS. + if (!('fcp' in _measurements)) { + delete _measurements.cls; + } + + Object.keys(_measurements).forEach(measurementName => { + transaction.setMeasurement( + measurementName, + _measurements[measurementName].value, + _measurements[measurementName].unit, + ); + }); + + _tagMetricInfo(transaction); + } + + _lcpEntry = undefined; + _clsEntry = undefined; + _measurements = {}; +} + +/** Create measure related spans */ +function _addMeasureSpans( + transaction, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + entry, + startTime, + duration, + timeOrigin, +) { + const measureStartTimestamp = timeOrigin + startTime; + const measureEndTimestamp = measureStartTimestamp + duration; + + Object(_utils_js__WEBPACK_IMPORTED_MODULE_9__["_startChild"])(transaction, { + description: entry.name , + endTimestamp: measureEndTimestamp, + op: entry.entryType , + startTimestamp: measureStartTimestamp, + }); + + return measureStartTimestamp; +} + +/** Instrument navigation entries */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _addNavigationSpans(transaction, entry, timeOrigin) { + ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => { + _addPerformanceNavigationTiming(transaction, entry, event, timeOrigin); + }); + _addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd'); + _addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart'); + _addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin, 'DNS'); + _addRequest(transaction, entry, timeOrigin); +} + +/** Create performance navigation related spans */ +function _addPerformanceNavigationTiming( + transaction, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + entry, + event, + timeOrigin, + description, + eventEnd, +) { + const end = eventEnd ? (entry[eventEnd] ) : (entry[`${event}End`] ); + const start = entry[`${event}Start`] ; + if (!start || !end) { + return; + } + Object(_utils_js__WEBPACK_IMPORTED_MODULE_9__["_startChild"])(transaction, { + op: 'browser', + description: Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_nullishCoalesce"])(description, () => ( event)), + startTimestamp: timeOrigin + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(start), + endTimestamp: timeOrigin + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(end), + }); +} + +/** Create request and response related spans */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _addRequest(transaction, entry, timeOrigin) { + Object(_utils_js__WEBPACK_IMPORTED_MODULE_9__["_startChild"])(transaction, { + op: 'browser', + description: 'request', + startTimestamp: timeOrigin + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(entry.requestStart ), + endTimestamp: timeOrigin + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(entry.responseEnd ), + }); + + Object(_utils_js__WEBPACK_IMPORTED_MODULE_9__["_startChild"])(transaction, { + op: 'browser', + description: 'response', + startTimestamp: timeOrigin + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(entry.responseStart ), + endTimestamp: timeOrigin + Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__["msToSec"])(entry.responseEnd ), + }); +} + +/** Create resource-related spans */ +function _addResourceSpans( + transaction, + entry, + resourceName, + startTime, + duration, + timeOrigin, +) { + // we already instrument based on fetch and xhr, so we don't need to + // duplicate spans here. + if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') { + return; + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const data = {}; + if ('transferSize' in entry) { + data['Transfer Size'] = entry.transferSize; + } + if ('encodedBodySize' in entry) { + data['Encoded Body Size'] = entry.encodedBodySize; + } + if ('decodedBodySize' in entry) { + data['Decoded Body Size'] = entry.decodedBodySize; + } + + const startTimestamp = timeOrigin + startTime; + const endTimestamp = startTimestamp + duration; + + Object(_utils_js__WEBPACK_IMPORTED_MODULE_9__["_startChild"])(transaction, { + description: resourceName, + endTimestamp, + op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other', + startTimestamp, + data, + }); +} + +/** + * Capture the information of the user agent. + */ +function _trackNavigator(transaction) { + const navigator = _types_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].navigator ; + if (!navigator) { + return; + } + + // track network connectivity + const connection = navigator.connection; + if (connection) { + if (connection.effectiveType) { + transaction.setTag('effectiveConnectionType', connection.effectiveType); + } + + if (connection.type) { + transaction.setTag('connectionType', connection.type); + } + + if (Object(_utils_js__WEBPACK_IMPORTED_MODULE_9__["isMeasurementValue"])(connection.rtt)) { + _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' }; + } + } + + if (Object(_utils_js__WEBPACK_IMPORTED_MODULE_9__["isMeasurementValue"])(navigator.deviceMemory)) { + transaction.setTag('deviceMemory', `${navigator.deviceMemory} GB`); + } + + if (Object(_utils_js__WEBPACK_IMPORTED_MODULE_9__["isMeasurementValue"])(navigator.hardwareConcurrency)) { + transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency)); + } +} + +/** Add LCP / CLS data to transaction to allow debugging */ +function _tagMetricInfo(transaction) { + if (_lcpEntry) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('[Measurements] Adding LCP Data'); + + // Capture Properties of the LCP element that contributes to the LCP. + + if (_lcpEntry.element) { + transaction.setTag('lcp.element', Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["htmlTreeAsString"])(_lcpEntry.element)); + } + + if (_lcpEntry.id) { + transaction.setTag('lcp.id', _lcpEntry.id); + } + + if (_lcpEntry.url) { + // Trim URL to the first 200 characters. + transaction.setTag('lcp.url', _lcpEntry.url.trim().slice(0, 200)); + } + + transaction.setTag('lcp.size', _lcpEntry.size); + } + + // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift + if (_clsEntry && _clsEntry.sources) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('[Measurements] Adding CLS Data'); + _clsEntry.sources.forEach((source, index) => + transaction.setTag(`cls.source.${index + 1}`, Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["htmlTreeAsString"])(source.node)), + ); + } +} + + +//# sourceMappingURL=index.js.map + + /***/ }), /***/ "OCgW": @@ -196088,6 +203898,31 @@ function _slicedToArray(arr, i) { /***/ }), +/***/ "OEZb": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IS_DEBUG_BUILD", function() { return IS_DEBUG_BUILD; }); +/* + * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking + * for users. + * + * Debug flags need to be declared in each package individually and must not be imported across package boundaries, + * because some build tools have trouble tree-shaking imported guards. + * + * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder. + * + * Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during + * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not + * replaced. + */ +/** Flag that is true for debug builds, false otherwise. */ +var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__; +//# sourceMappingURL=flags.js.map + +/***/ }), + /***/ "OEbY": /***/ (function(module, exports, __webpack_require__) { @@ -197606,6 +205441,48 @@ module.exports = DataBuffer; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("tjlA").Buffer)) +/***/ }), + +/***/ "Ou/l": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_asyncOptionalChainDelete", function() { return _asyncOptionalChainDelete; }); +/* harmony import */ var _asyncOptionalChain_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("rusa"); + + +/** + * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, + * descriptors, and functions, in cases where the value of the expression is to be deleted. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See + * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 + * + * @param ops Array result of expression conversion + * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable + * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which + * case `false`. + */ +// eslint-disable-next-line @sentry-internal/sdk/no-async-await +async function _asyncOptionalChainDelete(ops) { + const result = (await Object(_asyncOptionalChain_js__WEBPACK_IMPORTED_MODULE_0__["_asyncOptionalChain"])(ops)) ; + // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case, + // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in + // which case we return whatever the `delete` returned, which will be a boolean. + return result == null ? true : (result ); +} + +// Sucrase version: +// async function asyncOptionalChainDelete(ops) { +// const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops); +// return result == null ? true : result; +// } + + +//# sourceMappingURL=_asyncOptionalChainDelete.js.map + + /***/ }), /***/ "Ovef": @@ -197757,6 +205634,44 @@ if (__webpack_require__("nh4g") && (!CORRECT_NEW || __webpack_require__("eeVq")( __webpack_require__("elZq")('RegExp'); +/***/ }), + +/***/ "P/f2": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_nullishCoalesce", function() { return _nullishCoalesce; }); +/** + * Polyfill for the nullish coalescing operator (`??`). + * + * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the + * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * + * @param lhs The value of the expression to the left of the `??` + * @param rhsFn A function returning the value of the expression to the right of the `??` + * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value + */ +function _nullishCoalesce(lhs, rhsFn) { + // by checking for loose equality to `null`, we catch both `null` and `undefined` + return lhs != null ? lhs : rhsFn(); +} + +// Sucrase version: +// function _nullishCoalesce(lhs, rhsFn) { +// if (lhs != null) { +// return lhs; +// } else { +// return rhsFn(); +// } +// } + + +//# sourceMappingURL=_nullishCoalesce.js.map + + /***/ }), /***/ "P0RY": @@ -198033,6 +205948,265 @@ azimuthalEqualAreaRaw.invert = Object(_azimuthal_js__WEBPACK_IMPORTED_MODULE_1__ }); +/***/ }), + +/***/ "P6zQ": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SeverityLevels", function() { return SeverityLevels; }); +var SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical']; +//# sourceMappingURL=enums.js.map + +/***/ }), + +/***/ "P7Ha": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TryCatch", function() { return TryCatch; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Um2S"); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("WMn2"); + + + +var DEFAULT_EVENT_TARGET = [ + 'EventTarget', + 'Window', + 'Node', + 'ApplicationCache', + 'AudioTrackList', + 'ChannelMergerNode', + 'CryptoOperation', + 'EventSource', + 'FileReader', + 'HTMLUnknownElement', + 'IDBDatabase', + 'IDBRequest', + 'IDBTransaction', + 'KeyOperation', + 'MediaController', + 'MessagePort', + 'ModalWindow', + 'Notification', + 'SVGElementInstance', + 'Screen', + 'TextTrack', + 'TextTrackCue', + 'TextTrackList', + 'WebSocket', + 'WebSocketWorker', + 'Worker', + 'XMLHttpRequest', + 'XMLHttpRequestEventTarget', + 'XMLHttpRequestUpload', +]; +/** Wrap timer functions and event targets to catch errors and provide better meta data */ +var TryCatch = /** @class */ (function () { + /** + * @inheritDoc + */ + function TryCatch(options) { + /** + * @inheritDoc + */ + this.name = TryCatch.id; + this._options = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ XMLHttpRequest: true, eventTarget: true, requestAnimationFrame: true, setInterval: true, setTimeout: true }, options); + } + /** + * Wrap timer functions and event targets to catch errors + * and provide better metadata. + */ + TryCatch.prototype.setupOnce = function () { + var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + if (this._options.setTimeout) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(global, 'setTimeout', _wrapTimeFunction); + } + if (this._options.setInterval) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(global, 'setInterval', _wrapTimeFunction); + } + if (this._options.requestAnimationFrame) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(global, 'requestAnimationFrame', _wrapRAF); + } + if (this._options.XMLHttpRequest && 'XMLHttpRequest' in global) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(XMLHttpRequest.prototype, 'send', _wrapXHR); + } + var eventTargetOption = this._options.eventTarget; + if (eventTargetOption) { + var eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET; + eventTarget.forEach(_wrapEventTarget); + } + }; + /** + * @inheritDoc + */ + TryCatch.id = 'TryCatch'; + return TryCatch; +}()); + +/** JSDoc */ +function _wrapTimeFunction(original) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var originalCallback = args[0]; + args[0] = Object(_helpers__WEBPACK_IMPORTED_MODULE_2__["wrap"])(originalCallback, { + mechanism: { + data: { function: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(original) }, + handled: true, + type: 'instrument', + }, + }); + return original.apply(this, args); + }; +} +/** JSDoc */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _wrapRAF(original) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function (callback) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return original.apply(this, [ + Object(_helpers__WEBPACK_IMPORTED_MODULE_2__["wrap"])(callback, { + mechanism: { + data: { + function: 'requestAnimationFrame', + handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(original), + }, + handled: true, + type: 'instrument', + }, + }), + ]); + }; +} +/** JSDoc */ +function _wrapXHR(originalSend) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + // eslint-disable-next-line @typescript-eslint/no-this-alias + var xhr = this; + var xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange']; + xmlHttpRequestProps.forEach(function (prop) { + if (prop in xhr && typeof xhr[prop] === 'function') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(xhr, prop, function (original) { + var wrapOptions = { + mechanism: { + data: { + function: prop, + handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(original), + }, + handled: true, + type: 'instrument', + }, + }; + // If Instrument integration has been called before TryCatch, get the name of original function + var originalFunction = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getOriginalFunction"])(original); + if (originalFunction) { + wrapOptions.mechanism.data.handler = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(originalFunction); + } + // Otherwise wrap directly + return Object(_helpers__WEBPACK_IMPORTED_MODULE_2__["wrap"])(original, wrapOptions); + }); + } + }); + return originalSend.apply(this, args); + }; +} +/** JSDoc */ +function _wrapEventTarget(target) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + var proto = global[target] && global[target].prototype; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins + if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { + return; + } + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(proto, 'addEventListener', function (original) { + return function (eventName, fn, options) { + try { + if (typeof fn.handleEvent === 'function') { + fn.handleEvent = Object(_helpers__WEBPACK_IMPORTED_MODULE_2__["wrap"])(fn.handleEvent.bind(fn), { + mechanism: { + data: { + function: 'handleEvent', + handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(fn), + target: target, + }, + handled: true, + type: 'instrument', + }, + }); + } + } + catch (err) { + // can sometimes get 'Permission denied to access property "handle Event' + } + return original.apply(this, [ + eventName, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Object(_helpers__WEBPACK_IMPORTED_MODULE_2__["wrap"])(fn, { + mechanism: { + data: { + function: 'addEventListener', + handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(fn), + target: target, + }, + handled: true, + type: 'instrument', + }, + }), + options, + ]); + }; + }); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(proto, 'removeEventListener', function (originalRemoveEventListener) { + return function (eventName, fn, options) { + /** + * There are 2 possible scenarios here: + * + * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified + * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function + * as a pass-through, and call original `removeEventListener` with it. + * + * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using + * our wrapped version of `addEventListener`, which internally calls `wrap` helper. + * This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it, + * in order for us to make a distinction between wrapped/non-wrapped functions possible. + * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler. + * + * When someone adds a handler prior to initialization, and then do it again, but after, + * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible + * to get rid of the initial handler and it'd stick there forever. + */ + var wrappedEventHandler = fn; + try { + var originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__; + if (originalEventHandler) { + originalRemoveEventListener.call(this, eventName, originalEventHandler, options); + } + } + catch (e) { + // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments + } + return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options); + }; + }); +} +//# sourceMappingURL=trycatch.js.map + /***/ }), /***/ "P7J5": @@ -200036,6 +208210,86 @@ __webpack_require__.r(__webpack_exports__); }); +/***/ }), + +/***/ "PjJh": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mysql", function() { return Mysql; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("QXPM"); + + + + +/** Tracing integration for node-mysql package */ +class Mysql {constructor() { Mysql.prototype.__init.call(this); } + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Mysql';} + + /** + * @inheritDoc + */ + __init() {this.name = Mysql.id;} + + /** + * @inheritDoc + */ + setupOnce(_, getCurrentHub) { + const pkg = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["loadModule"])('mysql/lib/Connection.js'); + + if (!pkg) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Mysql Integration was unable to require `mysql` package.'); + return; + } + + if (Object(_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__["shouldDisableAutoInstrumentation"])(getCurrentHub)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('Mysql Integration is skipped because of instrumenter configuration.'); + return; + } + + // The original function will have one of these signatures: + // function (callback) => void + // function (options, callback) => void + // function (options, values, callback) => void + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(pkg, 'createQuery', function (orig) { + return function ( options, values, callback) { + const scope = getCurrentHub().getScope(); + const parentSpan = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]); + const span = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({ + description: typeof options === 'string' ? options : (options ).sql, + op: 'db', + })]); + + if (typeof callback === 'function') { + return orig.call(this, options, values, function (err, result, fields) { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]); + callback(err, result, fields); + }); + } + + if (typeof values === 'function') { + return orig.call(this, options, function (err, result, fields) { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]); + values(err, result, fields); + }); + } + + return orig.call(this, options, values, callback); + }; + }); + } +}Mysql.__initStatic(); + + +//# sourceMappingURL=mysql.js.map + + /***/ }), /***/ "Pk+z": @@ -200998,8 +209252,9 @@ __webpack_require__.r(__webpack_exports__); "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createClientReportEnvelope", function() { return createClientReportEnvelope; }); -/* harmony import */ var _envelope__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("oZ5x"); -/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("kdvv"); +/* harmony import */ var _envelope_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("oZ5x"); +/* harmony import */ var _time_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("kdvv"); + /** @@ -201007,18 +209262,25 @@ __webpack_require__.r(__webpack_exports__); * @param discarded_events An array of discard events * @param dsn A DSN that can be set on the header. Optional. */ -function createClientReportEnvelope(discarded_events, dsn, timestamp) { - var clientReportItem = [ - { type: 'client_report' }, - { - timestamp: timestamp || Object(_time__WEBPACK_IMPORTED_MODULE_1__["dateTimestampInSeconds"])(), - discarded_events: discarded_events, - }, - ]; - return Object(_envelope__WEBPACK_IMPORTED_MODULE_0__["createEnvelope"])(dsn ? { dsn: dsn } : {}, [clientReportItem]); +function createClientReportEnvelope( + discarded_events, + dsn, + timestamp, +) { + const clientReportItem = [ + { type: 'client_report' }, + { + timestamp: timestamp || Object(_time_js__WEBPACK_IMPORTED_MODULE_1__["dateTimestampInSeconds"])(), + discarded_events, + }, + ]; + return Object(_envelope_js__WEBPACK_IMPORTED_MODULE_0__["createEnvelope"])(dsn ? { dsn } : {}, [clientReportItem]); } + + //# sourceMappingURL=clientreport.js.map + /***/ }), /***/ "PxQz": @@ -201533,6 +209795,37 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "QGJP": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventStatusFromHttpCode", function() { return eventStatusFromHttpCode; }); +/** + * Converts an HTTP status code to sentry status {@link EventStatus}. + * + * @param code number HTTP status code + * @returns EventStatus + */ +function eventStatusFromHttpCode(code) { + if (code >= 200 && code < 300) { + return 'success'; + } + if (code === 429) { + return 'rate_limit'; + } + if (code >= 400 && code < 500) { + return 'invalid'; + } + if (code >= 500) { + return 'failed'; + } + return 'unknown'; +} +//# sourceMappingURL=status.js.map + /***/ }), /***/ "QILm": @@ -201672,11 +209965,12 @@ module.exports = { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initAndBind", function() { return initAndBind; }); -/* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("uzXi"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("yA8j"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GIgW"); + +/** A class object that can instantiate Client objects. */ /** * Internal function to create a new SDK client instance. The client is @@ -201685,27 +209979,33 @@ __webpack_require__.r(__webpack_exports__); * @param clientClass The client class to instantiate. * @param options Options to pass to the client. */ -function initAndBind(clientClass, options) { - if (options.debug === true) { - if (_flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"]) { - _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].enable(); - } - else { - // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped - // eslint-disable-next-line no-console - console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.'); - } - } - var hub = Object(_sentry_hub__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])(); - var scope = hub.getScope(); - if (scope) { - scope.update(options.initialScope); +function initAndBind( + clientClass, + options, +) { + if (options.debug === true) { + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].enable(); + } else { + // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped + // eslint-disable-next-line no-console + console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.'); } - var client = new clientClass(options); - hub.bindClient(client); + } + const hub = Object(_hub_js__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])(); + const scope = hub.getScope(); + if (scope) { + scope.update(options.initialScope); + } + + const client = new clientClass(options); + hub.bindClient(client); } + + //# sourceMappingURL=sdk.js.map + /***/ }), /***/ "QQs6": @@ -202368,6 +210668,34 @@ var keyBy = createAggregator(function(result, value, key) { module.exports = keyBy; +/***/ }), + +/***/ "QXPM": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldDisableAutoInstrumentation", function() { return shouldDisableAutoInstrumentation; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); + + +/** + * Check if Sentry auto-instrumentation should be disabled. + * + * @param getCurrentHub A method to fetch the current hub + * @returns boolean + */ +function shouldDisableAutoInstrumentation(getCurrentHub) { + const clientOptions = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([getCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]); + const instrumenter = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([clientOptions, 'optionalAccess', _6 => _6.instrumenter]) || 'sentry'; + + return instrumenter !== 'sentry'; +} + + +//# sourceMappingURL=node-utils.js.map + + /***/ }), /***/ "QXXb": @@ -204016,40 +212344,40 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionToString", function() { return FunctionToString; }); /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); -var originalFunctionToString; + +let originalFunctionToString; + /** Patch toString calls to return proper name for wrapped functions */ -var FunctionToString = /** @class */ (function () { - function FunctionToString() { - /** - * @inheritDoc - */ - this.name = FunctionToString.id; - } - /** - * @inheritDoc - */ - FunctionToString.prototype.setupOnce = function () { - // eslint-disable-next-line @typescript-eslint/unbound-method - originalFunctionToString = Function.prototype.toString; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - Function.prototype.toString = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var context = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getOriginalFunction"])(this) || this; - return originalFunctionToString.apply(context, args); - }; +class FunctionToString {constructor() { FunctionToString.prototype.__init.call(this); } + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'FunctionToString';} + + /** + * @inheritDoc + */ + __init() {this.name = FunctionToString.id;} + + /** + * @inheritDoc + */ + setupOnce() { + // eslint-disable-next-line @typescript-eslint/unbound-method + originalFunctionToString = Function.prototype.toString; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Function.prototype.toString = function ( ...args) { + const context = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getOriginalFunction"])(this) || this; + return originalFunctionToString.apply(context, args); }; - /** - * @inheritDoc - */ - FunctionToString.id = 'FunctionToString'; - return FunctionToString; -}()); + } +} FunctionToString.__initStatic(); + //# sourceMappingURL=functiontostring.js.map + /***/ }), /***/ "REiy": @@ -204688,6 +213016,69 @@ module.exports = function (source, reviver) { }; +/***/ }), + +/***/ "RGXi": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNavigationEntry", function() { return getNavigationEntry; }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Wezb"); + + +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const getNavigationEntryFromPerformanceTiming = () => { + // eslint-disable-next-line deprecation/deprecation + const timing = _types_js__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].performance.timing; + // eslint-disable-next-line deprecation/deprecation + const type = _types_js__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].performance.navigation.type; + + const navigationEntry = { + entryType: 'navigation', + startTime: 0, + type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate', + }; + + for (const key in timing) { + if (key !== 'navigationStart' && key !== 'toJSON') { + navigationEntry[key] = Math.max((timing[key ] ) - timing.navigationStart, 0); + } + } + return navigationEntry ; +}; + +const getNavigationEntry = () => { + if (_types_js__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].__WEB_VITALS_POLYFILL__) { + return ( + _types_js__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].performance && + ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) || + getNavigationEntryFromPerformanceTiming()) + ); + } else { + return _types_js__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0]; + } +}; + + +//# sourceMappingURL=getNavigationEntry.js.map + + /***/ }), /***/ "RHQs": @@ -206239,16 +214630,20 @@ __webpack_require__.r(__webpack_exports__); * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want * users to be able to shake away expressions that it guards. */ + /** * Figures out if we're building a browser bundle. * * @returns true if this is a browser bundle build. */ function isBrowserBundle() { - return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__; + return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__; } + + //# sourceMappingURL=env.js.map + /***/ }), /***/ "RU/L": @@ -206277,6 +214672,42 @@ __webpack_require__("Xtr8")('keys', function () { }); +/***/ }), + +/***/ "RXEs": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_startChild", function() { return _startChild; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMeasurementValue", function() { return isMeasurementValue; }); +/** + * Checks if a given value is a valid measurement value. + */ +function isMeasurementValue(value) { + return typeof value === 'number' && isFinite(value); +} + +/** + * Helper function to start child on transactions. This function will make sure that the transaction will + * use the start timestamp of the created child span if it is earlier than the transactions actual + * start timestamp. + */ +function _startChild(transaction, { startTimestamp, ...ctx }) { + if (startTimestamp && transaction.startTimestamp > startTimestamp) { + transaction.startTimestamp = startTimestamp; + } + + return transaction.startChild({ + startTimestamp, + ...ctx, + }); +} + + +//# sourceMappingURL=utils.js.map + + /***/ }), /***/ "RXNQ": @@ -209952,6 +218383,246 @@ var ListItemAvatar = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["forwardRef /***/ }), +/***/ "SLkm": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Breadcrumbs", function() { return Breadcrumbs; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("PIsB"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Um2S"); + +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable max-lines */ + + + +/** + * Default Breadcrumbs instrumentations + * TODO: Deprecated - with v6, this will be renamed to `Instrument` + */ +var Breadcrumbs = /** @class */ (function () { + /** + * @inheritDoc + */ + function Breadcrumbs(options) { + /** + * @inheritDoc + */ + this.name = Breadcrumbs.id; + this._options = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ console: true, dom: true, fetch: true, history: true, sentry: true, xhr: true }, options); + } + /** + * Create a breadcrumb of `sentry` from the events themselves + */ + Breadcrumbs.prototype.addSentryBreadcrumb = function (event) { + if (!this._options.sentry) { + return; + } + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ + category: "sentry." + (event.type === 'transaction' ? 'transaction' : 'event'), + event_id: event.event_id, + level: event.level, + message: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["getEventDescription"])(event), + }, { + event: event, + }); + }; + /** + * Instrument browser built-ins w/ breadcrumb capturing + * - Console API + * - DOM API (click/typing) + * - XMLHttpRequest API + * - Fetch API + * - History API + */ + Breadcrumbs.prototype.setupOnce = function () { + if (this._options.console) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('console', _consoleBreadcrumb); + } + if (this._options.dom) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('dom', _domBreadcrumb(this._options.dom)); + } + if (this._options.xhr) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('xhr', _xhrBreadcrumb); + } + if (this._options.fetch) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('fetch', _fetchBreadcrumb); + } + if (this._options.history) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('history', _historyBreadcrumb); + } + }; + /** + * @inheritDoc + */ + Breadcrumbs.id = 'Breadcrumbs'; + return Breadcrumbs; +}()); + +/** + * A HOC that creaes a function that creates breadcrumbs from DOM API calls. + * This is a HOC so that we get access to dom options in the closure. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _domBreadcrumb(dom) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function _innerDomBreadcrumb(handlerData) { + var target; + var keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined; + if (typeof keyAttrs === 'string') { + keyAttrs = [keyAttrs]; + } + // Accessing event.target can throw (see getsentry/raven-js#838, #768) + try { + target = handlerData.event.target + ? Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["htmlTreeAsString"])(handlerData.event.target, keyAttrs) + : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["htmlTreeAsString"])(handlerData.event, keyAttrs); + } + catch (e) { + target = '<unknown>'; + } + if (target.length === 0) { + return; + } + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ + category: "ui." + handlerData.name, + message: target, + }, { + event: handlerData.event, + name: handlerData.name, + global: handlerData.global, + }); + } + return _innerDomBreadcrumb; +} +/** + * Creates breadcrumbs from console API calls + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _consoleBreadcrumb(handlerData) { + var breadcrumb = { + category: 'console', + data: { + arguments: handlerData.args, + logger: 'console', + }, + level: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["severityFromString"])(handlerData.level), + message: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["safeJoin"])(handlerData.args, ' '), + }; + if (handlerData.level === 'assert') { + if (handlerData.args[0] === false) { + breadcrumb.message = "Assertion failed: " + (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["safeJoin"])(handlerData.args.slice(1), ' ') || 'console.assert'); + breadcrumb.data.arguments = handlerData.args.slice(1); + } + else { + // Don't capture a breadcrumb for passed assertions + return; + } + } + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb(breadcrumb, { + input: handlerData.args, + level: handlerData.level, + }); +} +/** + * Creates breadcrumbs from XHR API calls + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _xhrBreadcrumb(handlerData) { + if (handlerData.endTimestamp) { + // We only capture complete, non-sentry requests + if (handlerData.xhr.__sentry_own_request__) { + return; + } + var _a = handlerData.xhr.__sentry_xhr__ || {}, method = _a.method, url = _a.url, status_code = _a.status_code, body = _a.body; + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ + category: 'xhr', + data: { + method: method, + url: url, + status_code: status_code, + }, + type: 'http', + }, { + xhr: handlerData.xhr, + input: body, + }); + return; + } +} +/** + * Creates breadcrumbs from fetch API calls + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _fetchBreadcrumb(handlerData) { + // We only capture complete fetch requests + if (!handlerData.endTimestamp) { + return; + } + if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') { + // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests) + return; + } + if (handlerData.error) { + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ + category: 'fetch', + data: handlerData.fetchData, + level: _sentry_types__WEBPACK_IMPORTED_MODULE_2__["Severity"].Error, + type: 'http', + }, { + data: handlerData.error, + input: handlerData.args, + }); + } + else { + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ + category: 'fetch', + data: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData.fetchData), { status_code: handlerData.response.status }), + type: 'http', + }, { + input: handlerData.args, + response: handlerData.response, + }); + } +} +/** + * Creates breadcrumbs from history API calls + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _historyBreadcrumb(handlerData) { + var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["getGlobalObject"])(); + var from = handlerData.from; + var to = handlerData.to; + var parsedLoc = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["parseUrl"])(global.location.href); + var parsedFrom = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["parseUrl"])(from); + var parsedTo = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["parseUrl"])(to); + // Initial pushState doesn't provide `from` information + if (!parsedFrom.path) { + parsedFrom = parsedLoc; + } + // Use only the path component of the URL if the URL matches the current + // document (almost all the time when using pushState) + if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) { + to = parsedTo.relative; + } + if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) { + from = parsedFrom.relative; + } + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().addBreadcrumb({ + category: 'navigation', + data: { + from: from, + to: to, + }, + }); +} +//# sourceMappingURL=breadcrumbs.js.map + +/***/ }), + /***/ "SMB2": /***/ (function(module, exports, __webpack_require__) { @@ -210269,6 +218940,617 @@ exports.default = void 0; var _default = {}; exports.default = _default; +/***/ }), + +/***/ "SWsU": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onCLS", function() { return onCLS; }); +/* harmony import */ var _lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Fm1u"); +/* harmony import */ var _lib_initMetric_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("bjvM"); +/* harmony import */ var _lib_observe_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("MaC4"); +/* harmony import */ var _lib_onHidden_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("6mNm"); + + + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Calculates the [CLS](https://web.dev/cls/) value for the current page and + * calls the `callback` function once the value is ready to be reported, along + * with all `layout-shift` performance entries that were used in the metric + * value calculation. The reported value is a `double` (corresponding to a + * [layout shift score](https://web.dev/cls/#layout-shift-score)). + * + * If the `reportAllChanges` configuration option is set to `true`, the + * `callback` function will be called as soon as the value is initially + * determined as well as any time the value changes throughout the page + * lifespan. + * + * _**Important:** CLS should be continually monitored for changes throughout + * the entire lifespan of a page—including if the user returns to the page after + * it's been hidden/backgrounded. However, since browsers often [will not fire + * additional callbacks once the user has backgrounded a + * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden), + * `callback` is always called when the page's visibility state changes to + * hidden. As a result, the `callback` function might be called multiple times + * during the same page load._ + */ +const onCLS = (onReport, opts = {}) => { + const metric = Object(_lib_initMetric_js__WEBPACK_IMPORTED_MODULE_1__["initMetric"])('CLS', 0); + let report; + + let sessionValue = 0; + let sessionEntries = []; + + // const handleEntries = (entries: Metric['entries']) => { + const handleEntries = (entries) => { + entries.forEach(entry => { + // Only count layout shifts without recent user input. + if (!entry.hadRecentInput) { + const firstSessionEntry = sessionEntries[0]; + const lastSessionEntry = sessionEntries[sessionEntries.length - 1]; + + // If the entry occurred less than 1 second after the previous entry and + // less than 5 seconds after the first entry in the session, include the + // entry in the current session. Otherwise, start a new session. + if ( + sessionValue && + sessionEntries.length !== 0 && + entry.startTime - lastSessionEntry.startTime < 1000 && + entry.startTime - firstSessionEntry.startTime < 5000 + ) { + sessionValue += entry.value; + sessionEntries.push(entry); + } else { + sessionValue = entry.value; + sessionEntries = [entry]; + } + + // If the current session value is larger than the current CLS value, + // update CLS and the entries contributing to it. + if (sessionValue > metric.value) { + metric.value = sessionValue; + metric.entries = sessionEntries; + if (report) { + report(); + } + } + } + }); + }; + + const po = Object(_lib_observe_js__WEBPACK_IMPORTED_MODULE_2__["observe"])('layout-shift', handleEntries); + if (po) { + report = Object(_lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_0__["bindReporter"])(onReport, metric, opts.reportAllChanges); + + Object(_lib_onHidden_js__WEBPACK_IMPORTED_MODULE_3__["onHidden"])(() => { + handleEntries(po.takeRecords() ); + report(true); + }); + } +}; + + +//# sourceMappingURL=getCLS.js.map + + +/***/ }), + +/***/ "SXEm": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Postgres", function() { return Postgres; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("QXPM"); + + + + +/** Tracing integration for node-postgres package */ +class Postgres { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Postgres';} + + /** + * @inheritDoc + */ + __init() {this.name = Postgres.id;} + + constructor(options = {}) {;Postgres.prototype.__init.call(this); + this._usePgNative = !!options.usePgNative; + } + + /** + * @inheritDoc + */ + setupOnce(_, getCurrentHub) { + const pkg = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["loadModule"])('pg'); + + if (!pkg) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Postgres Integration was unable to require `pg` package.'); + return; + } + + if (Object(_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__["shouldDisableAutoInstrumentation"])(getCurrentHub)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('Postgres Integration is skipped because of instrumenter configuration.'); + return; + } + + if (this._usePgNative && !Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([pkg, 'access', _2 => _2.native, 'optionalAccess', _3 => _3.Client])) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error("Postgres Integration was unable to access 'pg-native' bindings."); + return; + } + + const { Client } = this._usePgNative ? pkg.native : pkg; + + /** + * function (query, callback) => void + * function (query, params, callback) => void + * function (query) => Promise + * function (query, params) => Promise + * function (pg.Cursor) => pg.Cursor + */ + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(Client.prototype, 'query', function (orig) { + return function ( config, values, callback) { + const scope = getCurrentHub().getScope(); + const parentSpan = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([scope, 'optionalAccess', _4 => _4.getSpan, 'call', _5 => _5()]); + const span = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([parentSpan, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({ + description: typeof config === 'string' ? config : (config ).text, + op: 'db', + })]); + + if (typeof callback === 'function') { + return orig.call(this, config, values, function (err, result) { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]); + callback(err, result); + }); + } + + if (typeof values === 'function') { + return orig.call(this, config, function (err, result) { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _10 => _10.finish, 'call', _11 => _11()]); + values(err, result); + }); + } + + const rv = typeof values !== 'undefined' ? orig.call(this, config, values) : orig.call(this, config); + + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isThenable"])(rv)) { + return rv.then((res) => { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]); + return res; + }); + } + + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _14 => _14.finish, 'call', _15 => _15()]); + return rv; + }; + }); + } +}Postgres.__initStatic(); + + +//# sourceMappingURL=postgres.js.map + + +/***/ }), + +/***/ "SYqL": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Span", function() { return Span; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpanRecorder", function() { return SpanRecorder; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spanStatusfromHttpCode", function() { return spanStatusfromHttpCode; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); + + + +/** + * Keeps track of finished spans for a given transaction + * @internal + * @hideconstructor + * @hidden + */ +class SpanRecorder { + __init() {this.spans = [];} + + constructor(maxlen = 1000) {;SpanRecorder.prototype.__init.call(this); + this._maxlen = maxlen; + } + + /** + * This is just so that we don't run out of memory while recording a lot + * of spans. At some point we just stop and flush out the start of the + * trace tree (i.e.the first n spans with the smallest + * start_timestamp). + */ + add(span) { + if (this.spans.length > this._maxlen) { + span.spanRecorder = undefined; + } else { + this.spans.push(span); + } + } +} + +/** + * Span contains all data about a span + */ +class Span { + /** + * @inheritDoc + */ + __init2() {this.traceId = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["uuid4"])();} + + /** + * @inheritDoc + */ + __init3() {this.spanId = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["uuid4"])().substring(16);} + + /** + * @inheritDoc + */ + + /** + * Internal keeper of the status + */ + + /** + * @inheritDoc + */ + + /** + * Timestamp in seconds when the span was created. + */ + __init4() {this.startTimestamp = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["timestampWithMs"])();} + + /** + * Timestamp in seconds when the span ended. + */ + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + __init5() {this.tags = {};} + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + __init6() {this.data = {};} + + /** + * List of spans that were finalized + */ + + /** + * @inheritDoc + */ + + /** + * The instrumenter that created this span. + */ + __init7() {this.instrumenter = 'sentry';} + + /** + * You should never call the constructor manually, always use `Sentry.startTransaction()` + * or call `startChild()` on an existing span. + * @internal + * @hideconstructor + * @hidden + */ + constructor(spanContext) {;Span.prototype.__init2.call(this);Span.prototype.__init3.call(this);Span.prototype.__init4.call(this);Span.prototype.__init5.call(this);Span.prototype.__init6.call(this);Span.prototype.__init7.call(this); + if (!spanContext) { + return this; + } + if (spanContext.traceId) { + this.traceId = spanContext.traceId; + } + if (spanContext.spanId) { + this.spanId = spanContext.spanId; + } + if (spanContext.parentSpanId) { + this.parentSpanId = spanContext.parentSpanId; + } + // We want to include booleans as well here + if ('sampled' in spanContext) { + this.sampled = spanContext.sampled; + } + if (spanContext.op) { + this.op = spanContext.op; + } + if (spanContext.description) { + this.description = spanContext.description; + } + if (spanContext.data) { + this.data = spanContext.data; + } + if (spanContext.tags) { + this.tags = spanContext.tags; + } + if (spanContext.status) { + this.status = spanContext.status; + } + if (spanContext.startTimestamp) { + this.startTimestamp = spanContext.startTimestamp; + } + if (spanContext.endTimestamp) { + this.endTimestamp = spanContext.endTimestamp; + } + if (spanContext.instrumenter) { + this.instrumenter = spanContext.instrumenter; + } + } + + /** + * @inheritDoc + */ + startChild( + spanContext, + ) { + const childSpan = new Span({ + ...spanContext, + parentSpanId: this.spanId, + sampled: this.sampled, + traceId: this.traceId, + }); + + childSpan.spanRecorder = this.spanRecorder; + if (childSpan.spanRecorder) { + childSpan.spanRecorder.add(childSpan); + } + + childSpan.transaction = this.transaction; + + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && childSpan.transaction) { + const opStr = (spanContext && spanContext.op) || '< unknown op >'; + const nameStr = childSpan.transaction.name || '< unknown name >'; + const idStr = childSpan.transaction.spanId; + + const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`; + childSpan.transaction.metadata.spanMetadata[childSpan.spanId] = { logMessage }; + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log(logMessage); + } + + return childSpan; + } + + /** + * @inheritDoc + */ + setTag(key, value) { + this.tags = { ...this.tags, [key]: value }; + return this; + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + setData(key, value) { + this.data = { ...this.data, [key]: value }; + return this; + } + + /** + * @inheritDoc + */ + setStatus(value) { + this.status = value; + return this; + } + + /** + * @inheritDoc + */ + setHttpStatus(httpStatus) { + this.setTag('http.status_code', String(httpStatus)); + const spanStatus = spanStatusfromHttpCode(httpStatus); + if (spanStatus !== 'unknown_error') { + this.setStatus(spanStatus); + } + return this; + } + + /** + * @inheritDoc + */ + isSuccess() { + return this.status === 'ok'; + } + + /** + * @inheritDoc + */ + finish(endTimestamp) { + if ( + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + // Don't call this for transactions + this.transaction && + this.transaction.spanId !== this.spanId + ) { + const { logMessage } = this.transaction.metadata.spanMetadata[this.spanId]; + if (logMessage) { + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log((logMessage ).replace('Starting', 'Finishing')); + } + } + + this.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["timestampWithMs"])(); + } + + /** + * @inheritDoc + */ + toTraceparent() { + let sampledString = ''; + if (this.sampled !== undefined) { + sampledString = this.sampled ? '-1' : '-0'; + } + return `${this.traceId}-${this.spanId}${sampledString}`; + } + + /** + * @inheritDoc + */ + toContext() { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dropUndefinedKeys"])({ + data: this.data, + description: this.description, + endTimestamp: this.endTimestamp, + op: this.op, + parentSpanId: this.parentSpanId, + sampled: this.sampled, + spanId: this.spanId, + startTimestamp: this.startTimestamp, + status: this.status, + tags: this.tags, + traceId: this.traceId, + }); + } + + /** + * @inheritDoc + */ + updateWithContext(spanContext) { + this.data = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_nullishCoalesce"])(spanContext.data, () => ( {})); + this.description = spanContext.description; + this.endTimestamp = spanContext.endTimestamp; + this.op = spanContext.op; + this.parentSpanId = spanContext.parentSpanId; + this.sampled = spanContext.sampled; + this.spanId = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_nullishCoalesce"])(spanContext.spanId, () => ( this.spanId)); + this.startTimestamp = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_nullishCoalesce"])(spanContext.startTimestamp, () => ( this.startTimestamp)); + this.status = spanContext.status; + this.tags = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_nullishCoalesce"])(spanContext.tags, () => ( {})); + this.traceId = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_nullishCoalesce"])(spanContext.traceId, () => ( this.traceId)); + + return this; + } + + /** + * @inheritDoc + */ + getTraceContext() + + { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dropUndefinedKeys"])({ + data: Object.keys(this.data).length > 0 ? this.data : undefined, + description: this.description, + op: this.op, + parent_span_id: this.parentSpanId, + span_id: this.spanId, + status: this.status, + tags: Object.keys(this.tags).length > 0 ? this.tags : undefined, + trace_id: this.traceId, + }); + } + + /** + * @inheritDoc + */ + toJSON() + + { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dropUndefinedKeys"])({ + data: Object.keys(this.data).length > 0 ? this.data : undefined, + description: this.description, + op: this.op, + parent_span_id: this.parentSpanId, + span_id: this.spanId, + start_timestamp: this.startTimestamp, + status: this.status, + tags: Object.keys(this.tags).length > 0 ? this.tags : undefined, + timestamp: this.endTimestamp, + trace_id: this.traceId, + }); + } +} + +/** + * Converts a HTTP status code into a {@link SpanStatusType}. + * + * @param httpStatus The HTTP response status code. + * @returns The span status or unknown_error. + */ +function spanStatusfromHttpCode(httpStatus) { + if (httpStatus < 400 && httpStatus >= 100) { + return 'ok'; + } + + if (httpStatus >= 400 && httpStatus < 500) { + switch (httpStatus) { + case 401: + return 'unauthenticated'; + case 403: + return 'permission_denied'; + case 404: + return 'not_found'; + case 409: + return 'already_exists'; + case 413: + return 'failed_precondition'; + case 429: + return 'resource_exhausted'; + default: + return 'invalid_argument'; + } + } + + if (httpStatus >= 500 && httpStatus < 600) { + switch (httpStatus) { + case 501: + return 'unimplemented'; + case 503: + return 'unavailable'; + case 504: + return 'deadline_exceeded'; + default: + return 'internal_error'; + } + } + + return 'unknown_error'; +} + + +//# sourceMappingURL=span.js.map + + /***/ }), /***/ "SZyH": @@ -211944,6 +221226,123 @@ __webpack_require__.r(__webpack_exports__); }); +/***/ }), + +/***/ "TAEo": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "htmlTreeAsString", function() { return htmlTreeAsString; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocationHref", function() { return getLocationHref; }); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BilH"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("fUgN"); + + +/** + * Given a child DOM element, returns a query-selector statement describing that + * and its ancestors + * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz] + * @returns generated DOM path + */ +function htmlTreeAsString(elem, keyAttrs) { + // try/catch both: + // - accessing event.target (see getsentry/raven-js#838, #768) + // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly + // - can throw an exception in some circumstances. + try { + var currentElem = elem; + var MAX_TRAVERSE_HEIGHT = 5; + var MAX_OUTPUT_LEN = 80; + var out = []; + var height = 0; + var len = 0; + var separator = ' > '; + var sepLength = separator.length; + var nextStr = void 0; + // eslint-disable-next-line no-plusplus + while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { + nextStr = _htmlElementAsString(currentElem, keyAttrs); + // bail out if + // - nextStr is the 'html' element + // - the length of the string that would be created exceeds MAX_OUTPUT_LEN + // (ignore this limit if we are on the first iteration) + if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) { + break; + } + out.push(nextStr); + len += nextStr.length; + currentElem = currentElem.parentNode; + } + return out.reverse().join(separator); + } + catch (_oO) { + return '<unknown>'; + } +} +/** + * Returns a simple, query-selector representation of a DOM element + * e.g. [HTMLElement] => input#foo.btn[name=baz] + * @returns generated DOM path + */ +function _htmlElementAsString(el, keyAttrs) { + var elem = el; + var out = []; + var className; + var classes; + var key; + var attr; + var i; + if (!elem || !elem.tagName) { + return ''; + } + out.push(elem.tagName.toLowerCase()); + // Pairs of attribute keys defined in `serializeAttribute` and their values on element. + var keyAttrPairs = keyAttrs && keyAttrs.length + ? keyAttrs.filter(function (keyAttr) { return elem.getAttribute(keyAttr); }).map(function (keyAttr) { return [keyAttr, elem.getAttribute(keyAttr)]; }) + : null; + if (keyAttrPairs && keyAttrPairs.length) { + keyAttrPairs.forEach(function (keyAttrPair) { + out.push("[" + keyAttrPair[0] + "=\"" + keyAttrPair[1] + "\"]"); + }); + } + else { + if (elem.id) { + out.push("#" + elem.id); + } + // eslint-disable-next-line prefer-const + className = elem.className; + if (className && Object(_is__WEBPACK_IMPORTED_MODULE_1__["isString"])(className)) { + classes = className.split(/\s+/); + for (i = 0; i < classes.length; i++) { + out.push("." + classes[i]); + } + } + } + var allowedAttrs = ['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(''); +} +/** + * A safe form of location.href + */ +function getLocationHref() { + var global = Object(_global__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])(); + try { + return global.document.location.href; + } + catch (oO) { + return ''; + } +} +//# sourceMappingURL=browser.js.map + /***/ }), /***/ "TCOF": @@ -215516,235 +224915,273 @@ var Backdrop = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["forwardRef"](fun "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("O8DA"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forget", function() { return _async__WEBPACK_IMPORTED_MODULE_0__["forget"]; }); +/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("vFt6"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDomElement", function() { return _browser_js__WEBPACK_IMPORTED_MODULE_0__["getDomElement"]; }); -/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("vFt6"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "htmlTreeAsString", function() { return _browser__WEBPACK_IMPORTED_MODULE_1__["htmlTreeAsString"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocationHref", function() { return _browser_js__WEBPACK_IMPORTED_MODULE_0__["getLocationHref"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocationHref", function() { return _browser__WEBPACK_IMPORTED_MODULE_1__["getLocationHref"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "htmlTreeAsString", function() { return _browser_js__WEBPACK_IMPORTED_MODULE_0__["htmlTreeAsString"]; }); -/* harmony import */ var _dsn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("UJ/E"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dsnToString", function() { return _dsn__WEBPACK_IMPORTED_MODULE_2__["dsnToString"]; }); +/* harmony import */ var _dsn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("UJ/E"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dsnFromString", function() { return _dsn_js__WEBPACK_IMPORTED_MODULE_1__["dsnFromString"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeDsn", function() { return _dsn__WEBPACK_IMPORTED_MODULE_2__["makeDsn"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dsnToString", function() { return _dsn_js__WEBPACK_IMPORTED_MODULE_1__["dsnToString"]; }); -/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("+usi"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SeverityLevels", function() { return _enums__WEBPACK_IMPORTED_MODULE_3__["SeverityLevels"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeDsn", function() { return _dsn_js__WEBPACK_IMPORTED_MODULE_1__["makeDsn"]; }); -/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("9Pyj"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SentryError", function() { return _error__WEBPACK_IMPORTED_MODULE_4__["SentryError"]; }); +/* harmony import */ var _error_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("9Pyj"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SentryError", function() { return _error_js__WEBPACK_IMPORTED_MODULE_2__["SentryError"]; }); -/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("z+RT"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getGlobalObject", function() { return _global__WEBPACK_IMPORTED_MODULE_5__["getGlobalObject"]; }); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("rbyU"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GLOBAL_OBJ", function() { return _worldwide_js__WEBPACK_IMPORTED_MODULE_3__["GLOBAL_OBJ"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getGlobalSingleton", function() { return _global__WEBPACK_IMPORTED_MODULE_5__["getGlobalSingleton"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getGlobalObject", function() { return _worldwide_js__WEBPACK_IMPORTED_MODULE_3__["getGlobalObject"]; }); -/* harmony import */ var _instrument__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("6hSO"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addInstrumentationHandler", function() { return _instrument__WEBPACK_IMPORTED_MODULE_6__["addInstrumentationHandler"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getGlobalSingleton", function() { return _worldwide_js__WEBPACK_IMPORTED_MODULE_3__["getGlobalSingleton"]; }); -/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("9AQC"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isError"]; }); +/* harmony import */ var _instrument_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("6hSO"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addInstrumentationHandler", function() { return _instrument_js__WEBPACK_IMPORTED_MODULE_4__["addInstrumentationHandler"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isErrorEvent", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isErrorEvent"]; }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("9AQC"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDOMError", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isDOMError"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDOMError", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isDOMError"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDOMException", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isDOMException"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDOMException", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isDOMException"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isElement"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isString"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isError"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPrimitive", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isPrimitive"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isErrorEvent", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isErrorEvent"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isPlainObject"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEvent", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isEvent"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEvent", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isEvent"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInstanceOf", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isInstanceOf"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isElement"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isNaN"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isRegExp"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isPlainObject"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isThenable", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isThenable"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPrimitive", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isPrimitive"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSyntheticEvent", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isSyntheticEvent"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isRegExp"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isNaN"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isString"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInstanceOf", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isInstanceOf"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSyntheticEvent", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isSyntheticEvent"]; }); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("8LbN"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONSOLE_LEVELS", function() { return _logger__WEBPACK_IMPORTED_MODULE_8__["CONSOLE_LEVELS"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isThenable", function() { return _is_js__WEBPACK_IMPORTED_MODULE_5__["isThenable"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "consoleSandbox", function() { return _logger__WEBPACK_IMPORTED_MODULE_8__["consoleSandbox"]; }); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("8LbN"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONSOLE_LEVELS", function() { return _logger_js__WEBPACK_IMPORTED_MODULE_6__["CONSOLE_LEVELS"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return _logger__WEBPACK_IMPORTED_MODULE_8__["logger"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "consoleSandbox", function() { return _logger_js__WEBPACK_IMPORTED_MODULE_6__["consoleSandbox"]; }); -/* harmony import */ var _memo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("wCA9"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoBuilder", function() { return _memo__WEBPACK_IMPORTED_MODULE_9__["memoBuilder"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return _logger_js__WEBPACK_IMPORTED_MODULE_6__["logger"]; }); -/* harmony import */ var _misc__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("9/Zf"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uuid4", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["uuid4"]; }); +/* harmony import */ var _memo_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("wCA9"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoBuilder", function() { return _memo_js__WEBPACK_IMPORTED_MODULE_7__["memoBuilder"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["parseUrl"]; }); +/* harmony import */ var _misc_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("9/Zf"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addContextToFrame", function() { return _misc_js__WEBPACK_IMPORTED_MODULE_8__["addContextToFrame"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEventDescription", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["getEventDescription"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addExceptionMechanism", function() { return _misc_js__WEBPACK_IMPORTED_MODULE_8__["addExceptionMechanism"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addExceptionTypeValue", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["addExceptionTypeValue"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addExceptionTypeValue", function() { return _misc_js__WEBPACK_IMPORTED_MODULE_8__["addExceptionTypeValue"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addExceptionMechanism", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["addExceptionMechanism"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "arrayify", function() { return _misc_js__WEBPACK_IMPORTED_MODULE_8__["arrayify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseSemver", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["parseSemver"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkOrSetAlreadyCaught", function() { return _misc_js__WEBPACK_IMPORTED_MODULE_8__["checkOrSetAlreadyCaught"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addContextToFrame", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["addContextToFrame"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEventDescription", function() { return _misc_js__WEBPACK_IMPORTED_MODULE_8__["getEventDescription"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stripUrlQueryAndFragment", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["stripUrlQueryAndFragment"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseSemver", function() { return _misc_js__WEBPACK_IMPORTED_MODULE_8__["parseSemver"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkOrSetAlreadyCaught", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["checkOrSetAlreadyCaught"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uuid4", function() { return _misc_js__WEBPACK_IMPORTED_MODULE_8__["uuid4"]; }); -/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("+A1k"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNodeEnv", function() { return _node__WEBPACK_IMPORTED_MODULE_11__["isNodeEnv"]; }); +/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("+A1k"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dynamicRequire", function() { return _node_js__WEBPACK_IMPORTED_MODULE_9__["dynamicRequire"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dynamicRequire", function() { return _node__WEBPACK_IMPORTED_MODULE_11__["dynamicRequire"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNodeEnv", function() { return _node_js__WEBPACK_IMPORTED_MODULE_9__["isNodeEnv"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "loadModule", function() { return _node__WEBPACK_IMPORTED_MODULE_11__["loadModule"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "loadModule", function() { return _node_js__WEBPACK_IMPORTED_MODULE_9__["loadModule"]; }); -/* harmony import */ var _normalize__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("Fffm"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return _normalize__WEBPACK_IMPORTED_MODULE_12__["normalize"]; }); +/* harmony import */ var _normalize_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("Fffm"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return _normalize_js__WEBPACK_IMPORTED_MODULE_10__["normalize"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeToSize", function() { return _normalize__WEBPACK_IMPORTED_MODULE_12__["normalizeToSize"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeToSize", function() { return _normalize_js__WEBPACK_IMPORTED_MODULE_10__["normalizeToSize"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "walk", function() { return _normalize__WEBPACK_IMPORTED_MODULE_12__["walk"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "walk", function() { return _normalize_js__WEBPACK_IMPORTED_MODULE_10__["walk"]; }); -/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("6PXS"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["fill"]; }); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("6PXS"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addNonEnumerableProperty", function() { return _object_js__WEBPACK_IMPORTED_MODULE_11__["addNonEnumerableProperty"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addNonEnumerableProperty", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["addNonEnumerableProperty"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "convertToPlainObject", function() { return _object_js__WEBPACK_IMPORTED_MODULE_11__["convertToPlainObject"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "markFunctionWrapped", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["markFunctionWrapped"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropUndefinedKeys", function() { return _object_js__WEBPACK_IMPORTED_MODULE_11__["dropUndefinedKeys"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getOriginalFunction", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["getOriginalFunction"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractExceptionKeysForMessage", function() { return _object_js__WEBPACK_IMPORTED_MODULE_11__["extractExceptionKeysForMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlEncode", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["urlEncode"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _object_js__WEBPACK_IMPORTED_MODULE_11__["fill"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "convertToPlainObject", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["convertToPlainObject"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getOriginalFunction", function() { return _object_js__WEBPACK_IMPORTED_MODULE_11__["getOriginalFunction"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractExceptionKeysForMessage", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["extractExceptionKeysForMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "markFunctionWrapped", function() { return _object_js__WEBPACK_IMPORTED_MODULE_11__["markFunctionWrapped"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropUndefinedKeys", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["dropUndefinedKeys"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "objectify", function() { return _object_js__WEBPACK_IMPORTED_MODULE_11__["objectify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "objectify", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["objectify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlEncode", function() { return _object_js__WEBPACK_IMPORTED_MODULE_11__["urlEncode"]; }); -/* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("pZxY"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["resolve"]; }); +/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("pZxY"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return _path_js__WEBPACK_IMPORTED_MODULE_12__["basename"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["relative"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return _path_js__WEBPACK_IMPORTED_MODULE_12__["dirname"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizePath", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["normalizePath"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAbsolute", function() { return _path_js__WEBPACK_IMPORTED_MODULE_12__["isAbsolute"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAbsolute", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["isAbsolute"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _path_js__WEBPACK_IMPORTED_MODULE_12__["join"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["join"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizePath", function() { return _path_js__WEBPACK_IMPORTED_MODULE_12__["normalizePath"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["dirname"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return _path_js__WEBPACK_IMPORTED_MODULE_12__["relative"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["basename"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return _path_js__WEBPACK_IMPORTED_MODULE_12__["resolve"]; }); -/* harmony import */ var _promisebuffer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("XsXS"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makePromiseBuffer", function() { return _promisebuffer__WEBPACK_IMPORTED_MODULE_15__["makePromiseBuffer"]; }); +/* harmony import */ var _promisebuffer_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("XsXS"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makePromiseBuffer", function() { return _promisebuffer_js__WEBPACK_IMPORTED_MODULE_13__["makePromiseBuffer"]; }); -/* harmony import */ var _severity__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("xYG6"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "severityFromString", function() { return _severity__WEBPACK_IMPORTED_MODULE_16__["severityFromString"]; }); +/* harmony import */ var _requestdata_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("0YSH"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addRequestDataToEvent", function() { return _requestdata_js__WEBPACK_IMPORTED_MODULE_14__["addRequestDataToEvent"]; }); -/* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__("pRiV"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createStackParser", function() { return _stacktrace__WEBPACK_IMPORTED_MODULE_17__["createStackParser"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addRequestDataToTransaction", function() { return _requestdata_js__WEBPACK_IMPORTED_MODULE_14__["addRequestDataToTransaction"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stripSentryFramesAndReverse", function() { return _stacktrace__WEBPACK_IMPORTED_MODULE_17__["stripSentryFramesAndReverse"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractPathForTransaction", function() { return _requestdata_js__WEBPACK_IMPORTED_MODULE_14__["extractPathForTransaction"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFunctionName", function() { return _stacktrace__WEBPACK_IMPORTED_MODULE_17__["getFunctionName"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractRequestData", function() { return _requestdata_js__WEBPACK_IMPORTED_MODULE_14__["extractRequestData"]; }); -/* harmony import */ var _status__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__("z0xI"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventStatusFromHttpCode", function() { return _status__WEBPACK_IMPORTED_MODULE_18__["eventStatusFromHttpCode"]; }); +/* harmony import */ var _severity_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("xYG6"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "severityFromString", function() { return _severity_js__WEBPACK_IMPORTED_MODULE_15__["severityFromString"]; }); -/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__("+924"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["truncate"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "severityLevelFromString", function() { return _severity_js__WEBPACK_IMPORTED_MODULE_15__["severityLevelFromString"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snipLine", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["snipLine"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "validSeverityLevels", function() { return _severity_js__WEBPACK_IMPORTED_MODULE_15__["validSeverityLevels"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "safeJoin", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["safeJoin"]; }); +/* harmony import */ var _stacktrace_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("pRiV"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createStackParser", function() { return _stacktrace_js__WEBPACK_IMPORTED_MODULE_16__["createStackParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchingPattern", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["isMatchingPattern"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFunctionName", function() { return _stacktrace_js__WEBPACK_IMPORTED_MODULE_16__["getFunctionName"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeStringForRegex", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["escapeStringForRegex"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nodeStackLineParser", function() { return _stacktrace_js__WEBPACK_IMPORTED_MODULE_16__["nodeStackLineParser"]; }); -/* harmony import */ var _supports__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__("4Ssk"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsErrorEvent", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsErrorEvent"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackParserFromStackParserOptions", function() { return _stacktrace_js__WEBPACK_IMPORTED_MODULE_16__["stackParserFromStackParserOptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsDOMError", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsDOMError"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stripSentryFramesAndReverse", function() { return _stacktrace_js__WEBPACK_IMPORTED_MODULE_16__["stripSentryFramesAndReverse"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsDOMException", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsDOMException"]; }); +/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__("+924"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeStringForRegex", function() { return _string_js__WEBPACK_IMPORTED_MODULE_17__["escapeStringForRegex"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsFetch", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsFetch"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchingPattern", function() { return _string_js__WEBPACK_IMPORTED_MODULE_17__["isMatchingPattern"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNativeFetch", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["isNativeFetch"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "safeJoin", function() { return _string_js__WEBPACK_IMPORTED_MODULE_17__["safeJoin"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsNativeFetch", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsNativeFetch"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snipLine", function() { return _string_js__WEBPACK_IMPORTED_MODULE_17__["snipLine"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsReportingObserver", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsReportingObserver"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stringMatchesSomePattern", function() { return _string_js__WEBPACK_IMPORTED_MODULE_17__["stringMatchesSomePattern"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsReferrerPolicy", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsReferrerPolicy"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _string_js__WEBPACK_IMPORTED_MODULE_17__["truncate"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsHistory", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsHistory"]; }); +/* harmony import */ var _supports_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__("4Ssk"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNativeFetch", function() { return _supports_js__WEBPACK_IMPORTED_MODULE_18__["isNativeFetch"]; }); -/* harmony import */ var _syncpromise__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__("HR75"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolvedSyncPromise", function() { return _syncpromise__WEBPACK_IMPORTED_MODULE_21__["resolvedSyncPromise"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsDOMError", function() { return _supports_js__WEBPACK_IMPORTED_MODULE_18__["supportsDOMError"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rejectedSyncPromise", function() { return _syncpromise__WEBPACK_IMPORTED_MODULE_21__["rejectedSyncPromise"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsDOMException", function() { return _supports_js__WEBPACK_IMPORTED_MODULE_18__["supportsDOMException"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SyncPromise", function() { return _syncpromise__WEBPACK_IMPORTED_MODULE_21__["SyncPromise"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsErrorEvent", function() { return _supports_js__WEBPACK_IMPORTED_MODULE_18__["supportsErrorEvent"]; }); -/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__("kdvv"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dateTimestampInSeconds", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["dateTimestampInSeconds"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsFetch", function() { return _supports_js__WEBPACK_IMPORTED_MODULE_18__["supportsFetch"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestampInSeconds", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["timestampInSeconds"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsHistory", function() { return _supports_js__WEBPACK_IMPORTED_MODULE_18__["supportsHistory"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestampWithMs", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["timestampWithMs"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsNativeFetch", function() { return _supports_js__WEBPACK_IMPORTED_MODULE_18__["supportsNativeFetch"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "usingPerformanceAPI", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["usingPerformanceAPI"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsReferrerPolicy", function() { return _supports_js__WEBPACK_IMPORTED_MODULE_18__["supportsReferrerPolicy"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_browserPerformanceTimeOriginMode", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["_browserPerformanceTimeOriginMode"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsReportingObserver", function() { return _supports_js__WEBPACK_IMPORTED_MODULE_18__["supportsReportingObserver"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "browserPerformanceTimeOrigin", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["browserPerformanceTimeOrigin"]; }); +/* harmony import */ var _syncpromise_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__("HR75"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SyncPromise", function() { return _syncpromise_js__WEBPACK_IMPORTED_MODULE_19__["SyncPromise"]; }); -/* harmony import */ var _tracing__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__("8yT3"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TRACEPARENT_REGEXP", function() { return _tracing__WEBPACK_IMPORTED_MODULE_23__["TRACEPARENT_REGEXP"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rejectedSyncPromise", function() { return _syncpromise_js__WEBPACK_IMPORTED_MODULE_19__["rejectedSyncPromise"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractTraceparentData", function() { return _tracing__WEBPACK_IMPORTED_MODULE_23__["extractTraceparentData"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolvedSyncPromise", function() { return _syncpromise_js__WEBPACK_IMPORTED_MODULE_19__["resolvedSyncPromise"]; }); -/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__("RQwI"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBrowserBundle", function() { return _env__WEBPACK_IMPORTED_MODULE_24__["isBrowserBundle"]; }); +/* harmony import */ var _time_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__("kdvv"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_browserPerformanceTimeOriginMode", function() { return _time_js__WEBPACK_IMPORTED_MODULE_20__["_browserPerformanceTimeOriginMode"]; }); -/* harmony import */ var _envelope__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__("oZ5x"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createEnvelope", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["createEnvelope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "browserPerformanceTimeOrigin", function() { return _time_js__WEBPACK_IMPORTED_MODULE_20__["browserPerformanceTimeOrigin"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addItemToEnvelope", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["addItemToEnvelope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dateTimestampInSeconds", function() { return _time_js__WEBPACK_IMPORTED_MODULE_20__["dateTimestampInSeconds"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeType", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["getEnvelopeType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestampInSeconds", function() { return _time_js__WEBPACK_IMPORTED_MODULE_20__["timestampInSeconds"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "serializeEnvelope", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["serializeEnvelope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestampWithMs", function() { return _time_js__WEBPACK_IMPORTED_MODULE_20__["timestampWithMs"]; }); -/* harmony import */ var _clientreport__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__("PwEy"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createClientReportEnvelope", function() { return _clientreport__WEBPACK_IMPORTED_MODULE_26__["createClientReportEnvelope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "usingPerformanceAPI", function() { return _time_js__WEBPACK_IMPORTED_MODULE_20__["usingPerformanceAPI"]; }); -/* harmony import */ var _ratelimit__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__("jIae"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_RETRY_AFTER", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["DEFAULT_RETRY_AFTER"]; }); +/* harmony import */ var _tracing_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__("8yT3"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TRACEPARENT_REGEXP", function() { return _tracing_js__WEBPACK_IMPORTED_MODULE_21__["TRACEPARENT_REGEXP"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseRetryAfterHeader", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["parseRetryAfterHeader"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractTraceparentData", function() { return _tracing_js__WEBPACK_IMPORTED_MODULE_21__["extractTraceparentData"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disabledUntil", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["disabledUntil"]; }); +/* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__("RQwI"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBrowserBundle", function() { return _env_js__WEBPACK_IMPORTED_MODULE_22__["isBrowserBundle"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRateLimited", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["isRateLimited"]; }); +/* harmony import */ var _envelope_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__("oZ5x"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addItemToEnvelope", function() { return _envelope_js__WEBPACK_IMPORTED_MODULE_23__["addItemToEnvelope"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateRateLimits", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["updateRateLimits"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createAttachmentEnvelopeItem", function() { return _envelope_js__WEBPACK_IMPORTED_MODULE_23__["createAttachmentEnvelopeItem"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createEnvelope", function() { return _envelope_js__WEBPACK_IMPORTED_MODULE_23__["createEnvelope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "envelopeItemTypeToDataCategory", function() { return _envelope_js__WEBPACK_IMPORTED_MODULE_23__["envelopeItemTypeToDataCategory"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEachEnvelopeItem", function() { return _envelope_js__WEBPACK_IMPORTED_MODULE_23__["forEachEnvelopeItem"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "serializeEnvelope", function() { return _envelope_js__WEBPACK_IMPORTED_MODULE_23__["serializeEnvelope"]; }); + +/* harmony import */ var _clientreport_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__("PwEy"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createClientReportEnvelope", function() { return _clientreport_js__WEBPACK_IMPORTED_MODULE_24__["createClientReportEnvelope"]; }); + +/* harmony import */ var _ratelimit_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__("jIae"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_RETRY_AFTER", function() { return _ratelimit_js__WEBPACK_IMPORTED_MODULE_25__["DEFAULT_RETRY_AFTER"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disabledUntil", function() { return _ratelimit_js__WEBPACK_IMPORTED_MODULE_25__["disabledUntil"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRateLimited", function() { return _ratelimit_js__WEBPACK_IMPORTED_MODULE_25__["isRateLimited"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseRetryAfterHeader", function() { return _ratelimit_js__WEBPACK_IMPORTED_MODULE_25__["parseRetryAfterHeader"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateRateLimits", function() { return _ratelimit_js__WEBPACK_IMPORTED_MODULE_25__["updateRateLimits"]; }); + +/* harmony import */ var _baggage_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__("jXcl"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BAGGAGE_HEADER_NAME", function() { return _baggage_js__WEBPACK_IMPORTED_MODULE_26__["BAGGAGE_HEADER_NAME"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MAX_BAGGAGE_STRING_LENGTH", function() { return _baggage_js__WEBPACK_IMPORTED_MODULE_26__["MAX_BAGGAGE_STRING_LENGTH"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SENTRY_BAGGAGE_KEY_PREFIX", function() { return _baggage_js__WEBPACK_IMPORTED_MODULE_26__["SENTRY_BAGGAGE_KEY_PREFIX"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SENTRY_BAGGAGE_KEY_PREFIX_REGEX", function() { return _baggage_js__WEBPACK_IMPORTED_MODULE_26__["SENTRY_BAGGAGE_KEY_PREFIX_REGEX"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "baggageHeaderToDynamicSamplingContext", function() { return _baggage_js__WEBPACK_IMPORTED_MODULE_26__["baggageHeaderToDynamicSamplingContext"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dynamicSamplingContextToSentryBaggageHeader", function() { return _baggage_js__WEBPACK_IMPORTED_MODULE_26__["dynamicSamplingContextToSentryBaggageHeader"]; }); + +/* harmony import */ var _url_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__("DTqw"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getNumberOfUrlSegments", function() { return _url_js__WEBPACK_IMPORTED_MODULE_27__["getNumberOfUrlSegments"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return _url_js__WEBPACK_IMPORTED_MODULE_27__["parseUrl"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stripUrlQueryAndFragment", function() { return _url_js__WEBPACK_IMPORTED_MODULE_27__["stripUrlQueryAndFragment"]; }); @@ -215776,6 +225213,7 @@ __webpack_require__.r(__webpack_exports__); //# sourceMappingURL=index.js.map + /***/ }), /***/ "TxG6": @@ -217008,124 +226446,148 @@ module.exports = { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlobalHandlers", function() { return GlobalHandlers; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("PIsB"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("TwdF"); -/* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("IS+8"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("3Uor"); -/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("vzc1"); - -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _eventbuilder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("IS+8"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("vzc1"); +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /** Global handlers */ -var GlobalHandlers = /** @class */ (function () { - /** JSDoc */ - function GlobalHandlers(options) { - /** - * @inheritDoc - */ - this.name = GlobalHandlers.id; - /** - * Stores references functions to installing handlers. Will set to undefined - * after they have been run so that they are not used twice. - */ - this._installFunc = { - onerror: _installGlobalOnErrorHandler, - onunhandledrejection: _installGlobalOnUnhandledRejectionHandler, - }; - this._options = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ onerror: true, onunhandledrejection: true }, options); - } - /** - * @inheritDoc - */ - GlobalHandlers.prototype.setupOnce = function () { - Error.stackTraceLimit = 50; - var options = this._options; - // We can disable guard-for-in as we construct the options object above + do checks against - // `this._installFunc` for the property. - // eslint-disable-next-line guard-for-in - for (var key in options) { - var installFunc = this._installFunc[key]; - if (installFunc && options[key]) { - globalHandlerLog(key); - installFunc(); - this._installFunc[key] = undefined; - } - } +class GlobalHandlers { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'GlobalHandlers';} + + /** + * @inheritDoc + */ + __init() {this.name = GlobalHandlers.id;} + + /** JSDoc */ + + /** + * Stores references functions to installing handlers. Will set to undefined + * after they have been run so that they are not used twice. + */ + __init2() {this._installFunc = { + onerror: _installGlobalOnErrorHandler, + onunhandledrejection: _installGlobalOnUnhandledRejectionHandler, + };} + + /** JSDoc */ + constructor(options) {;GlobalHandlers.prototype.__init.call(this);GlobalHandlers.prototype.__init2.call(this); + this._options = { + onerror: true, + onunhandledrejection: true, + ...options, }; - /** - * @inheritDoc - */ - GlobalHandlers.id = 'GlobalHandlers'; - return GlobalHandlers; -}()); + } + /** + * @inheritDoc + */ + setupOnce() { + Error.stackTraceLimit = 50; + const options = this._options; + + // We can disable guard-for-in as we construct the options object above + do checks against + // `this._installFunc` for the property. + // eslint-disable-next-line guard-for-in + for (const key in options) { + const installFunc = this._installFunc[key ]; + if (installFunc && options[key ]) { + globalHandlerLog(key); + installFunc(); + this._installFunc[key ] = undefined; + } + } + } +} GlobalHandlers.__initStatic(); /** JSDoc */ function _installGlobalOnErrorHandler() { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('error', + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addInstrumentationHandler"])( + 'error', // eslint-disable-next-line @typescript-eslint/no-explicit-any - function (data) { - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(getHubAndAttachStacktrace(), 2), hub = _a[0], attachStacktrace = _a[1]; - if (!hub.getIntegration(GlobalHandlers)) { - return; - } - var msg = data.msg, url = data.url, line = data.line, column = data.column, error = data.error; - if (Object(_helpers__WEBPACK_IMPORTED_MODULE_6__["shouldIgnoreOnError"])() || (error && error.__sentry_own_request__)) { - return; - } - var event = error === undefined && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["isString"])(msg) - ? _eventFromIncompleteOnError(msg, url, line, column) - : _enhanceEventWithInitialFrame(Object(_eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromUnknownInput"])(error || msg, undefined, attachStacktrace, false), url, line, column); - event.level = _sentry_types__WEBPACK_IMPORTED_MODULE_2__["Severity"].Error; - addMechanismAndCapture(hub, error, event, 'onerror'); - }); + (data) => { + const [hub, stackParser, attachStacktrace] = getHubAndOptions(); + if (!hub.getIntegration(GlobalHandlers)) { + return; + } + const { msg, url, line, column, error } = data; + if (Object(_helpers_js__WEBPACK_IMPORTED_MODULE_3__["shouldIgnoreOnError"])() || (error && error.__sentry_own_request__)) { + return; + } + + const event = + error === undefined && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isString"])(msg) + ? _eventFromIncompleteOnError(msg, url, line, column) + : _enhanceEventWithInitialFrame( + Object(_eventbuilder_js__WEBPACK_IMPORTED_MODULE_2__["eventFromUnknownInput"])(stackParser, error || msg, undefined, attachStacktrace, false), + url, + line, + column, + ); + + event.level = 'error'; + + addMechanismAndCapture(hub, error, event, 'onerror'); + }, + ); } + /** JSDoc */ function _installGlobalOnUnhandledRejectionHandler() { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('unhandledrejection', + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addInstrumentationHandler"])( + 'unhandledrejection', // eslint-disable-next-line @typescript-eslint/no-explicit-any - function (e) { - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(getHubAndAttachStacktrace(), 2), hub = _a[0], attachStacktrace = _a[1]; - if (!hub.getIntegration(GlobalHandlers)) { - return; - } - var error = e; - // dig the object of the rejection out of known event types - try { - // PromiseRejectionEvents store the object of the rejection under 'reason' - // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent - if ('reason' in e) { - error = e.reason; - } - // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents - // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into - // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec - // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and - // https://github.com/getsentry/sentry-javascript/issues/2380 - else if ('detail' in e && 'reason' in e.detail) { - error = e.detail.reason; - } - } - catch (_oO) { - // no-empty - } - if (Object(_helpers__WEBPACK_IMPORTED_MODULE_6__["shouldIgnoreOnError"])() || (error && error.__sentry_own_request__)) { - return true; - } - var event = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["isPrimitive"])(error) - ? _eventFromRejectionWithPrimitive(error) - : Object(_eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromUnknownInput"])(error, undefined, attachStacktrace, true); - event.level = _sentry_types__WEBPACK_IMPORTED_MODULE_2__["Severity"].Error; - addMechanismAndCapture(hub, error, event, 'onunhandledrejection'); + (e) => { + const [hub, stackParser, attachStacktrace] = getHubAndOptions(); + if (!hub.getIntegration(GlobalHandlers)) { return; - }); + } + let error = e; + + // dig the object of the rejection out of known event types + try { + // PromiseRejectionEvents store the object of the rejection under 'reason' + // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent + if ('reason' in e) { + error = e.reason; + } + // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents + // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into + // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec + // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and + // https://github.com/getsentry/sentry-javascript/issues/2380 + else if ('detail' in e && 'reason' in e.detail) { + error = e.detail.reason; + } + } catch (_oO) { + // no-empty + } + + if (Object(_helpers_js__WEBPACK_IMPORTED_MODULE_3__["shouldIgnoreOnError"])() || (error && error.__sentry_own_request__)) { + return true; + } + + const event = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isPrimitive"])(error) + ? _eventFromRejectionWithPrimitive(error) + : Object(_eventbuilder_js__WEBPACK_IMPORTED_MODULE_2__["eventFromUnknownInput"])(stackParser, error, undefined, attachStacktrace, true); + + event.level = 'error'; + + addMechanismAndCapture(hub, error, event, 'onunhandledrejection'); + return; + }, + ); } + /** * Create an event from a promise rejection where the `reason` is a primitive. * @@ -217133,92 +226595,111 @@ function _installGlobalOnUnhandledRejectionHandler() { * @returns An Event object with an appropriate `exception` value */ function _eventFromRejectionWithPrimitive(reason) { - return { - exception: { - values: [ - { - type: 'UnhandledRejection', - // String() is needed because the Primitive type includes symbols (which can't be automatically stringified) - value: "Non-Error promise rejection captured with value: " + String(reason), - }, - ], + return { + exception: { + values: [ + { + type: 'UnhandledRejection', + // String() is needed because the Primitive type includes symbols (which can't be automatically stringified) + value: `Non-Error promise rejection captured with value: ${String(reason)}`, }, - }; + ], + }, + }; } + /** * This function creates a stack from an old, error-less onerror handler. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function _eventFromIncompleteOnError(msg, url, line, column) { - var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i; - // If 'message' is ErrorEvent, get real message from inside - var message = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["isErrorEvent"])(msg) ? msg.message : msg; - var name = 'Error'; - var groups = message.match(ERROR_TYPES_RE); - if (groups) { - name = groups[1]; - message = groups[2]; - } - var event = { - exception: { - values: [ - { - type: name, - value: message, - }, - ], + const ERROR_TYPES_RE = + /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i; + + // If 'message' is ErrorEvent, get real message from inside + let message = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isErrorEvent"])(msg) ? msg.message : msg; + let name = 'Error'; + + const groups = message.match(ERROR_TYPES_RE); + if (groups) { + name = groups[1]; + message = groups[2]; + } + + const event = { + exception: { + values: [ + { + type: name, + value: message, }, - }; - return _enhanceEventWithInitialFrame(event, url, line, column); + ], + }, + }; + + return _enhanceEventWithInitialFrame(event, url, line, column); } + /** JSDoc */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function _enhanceEventWithInitialFrame(event, url, line, column) { - // event.exception - var e = (event.exception = event.exception || {}); - // event.exception.values - var ev = (e.values = e.values || []); - // event.exception.values[0] - var ev0 = (ev[0] = ev[0] || {}); - // event.exception.values[0].stacktrace - var ev0s = (ev0.stacktrace = ev0.stacktrace || {}); - // event.exception.values[0].stacktrace.frames - var ev0sf = (ev0s.frames = ev0s.frames || []); - var colno = isNaN(parseInt(column, 10)) ? undefined : column; - var lineno = isNaN(parseInt(line, 10)) ? undefined : line; - var filename = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["isString"])(url) && url.length > 0 ? url : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["getLocationHref"])(); - // event.exception.values[0].stacktrace.frames - if (ev0sf.length === 0) { - ev0sf.push({ - colno: colno, - filename: filename, - function: '?', - in_app: true, - lineno: lineno, - }); - } - return event; + // event.exception + const e = (event.exception = event.exception || {}); + // event.exception.values + const ev = (e.values = e.values || []); + // event.exception.values[0] + const ev0 = (ev[0] = ev[0] || {}); + // event.exception.values[0].stacktrace + const ev0s = (ev0.stacktrace = ev0.stacktrace || {}); + // event.exception.values[0].stacktrace.frames + const ev0sf = (ev0s.frames = ev0s.frames || []); + + const colno = isNaN(parseInt(column, 10)) ? undefined : column; + const lineno = isNaN(parseInt(line, 10)) ? undefined : line; + const filename = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isString"])(url) && url.length > 0 ? url : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getLocationHref"])(); + + // event.exception.values[0].stacktrace.frames + if (ev0sf.length === 0) { + ev0sf.push({ + colno, + filename, + function: '?', + in_app: true, + lineno, + }); + } + + return event; } + function globalHandlerLog(type) { - _flags__WEBPACK_IMPORTED_MODULE_5__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__["logger"].log("Global Handler attached: " + type); + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log(`Global Handler attached: ${type}`); } + function addMechanismAndCapture(hub, error, event, type) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addExceptionMechanism"])(event, { - handled: false, - type: type, - }); - hub.captureEvent(event, { - originalException: error, - }); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addExceptionMechanism"])(event, { + handled: false, + type, + }); + hub.captureEvent(event, { + originalException: error, + }); } -function getHubAndAttachStacktrace() { - var hub = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])(); - var client = hub.getClient(); - var attachStacktrace = client && client.getOptions().attachStacktrace; - return [hub, attachStacktrace]; + +function getHubAndOptions() { + const hub = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])(); + const client = hub.getClient(); + const options = (client && client.getOptions()) || { + stackParser: () => [], + attachStacktrace: false, + }; + return [hub, options.stackParser, options.attachStacktrace]; } + + //# sourceMappingURL=globalhandlers.js.map + /***/ }), /***/ "UDCi": @@ -221773,19 +231254,19 @@ module.exports = function extractHostname(value) { "use strict"; __webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dsnFromString", function() { return dsnFromString; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dsnToString", function() { return dsnToString; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeDsn", function() { return makeDsn; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9Pyj"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("NDfa"); - +/* harmony import */ var _error_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9Pyj"); /** Regular expression used to parse a Dsn. */ -var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/; +const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; + function isValidProtocol(protocol) { - return protocol === 'http' || protocol === 'https'; + return protocol === 'http' || protocol === 'https'; } + /** * Renders the string representation of this Dsn. * @@ -221795,79 +231276,99 @@ function isValidProtocol(protocol) { * * @param withPassword When set to true, the password will be included. */ -function dsnToString(dsn, withPassword) { - if (withPassword === void 0) { withPassword = false; } - var host = dsn.host, path = dsn.path, pass = dsn.pass, port = dsn.port, projectId = dsn.projectId, protocol = dsn.protocol, publicKey = dsn.publicKey; - return (protocol + "://" + publicKey + (withPassword && pass ? ":" + pass : '') + - ("@" + host + (port ? ":" + port : '') + "/" + (path ? path + "/" : path) + projectId)); +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}` + ); } + +/** + * Parses a Dsn from a given string. + * + * @param str A Dsn as string + * @returns Dsn as DsnComponents + */ function dsnFromString(str) { - var match = DSN_REGEX.exec(str); - if (!match) { - throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: " + str); - } - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(match.slice(1), 6), protocol = _a[0], publicKey = _a[1], _b = _a[2], pass = _b === void 0 ? '' : _b, host = _a[3], _c = _a[4], port = _c === void 0 ? '' : _c, lastPath = _a[5]; - var path = ''; - var projectId = lastPath; - var split = projectId.split('/'); - if (split.length > 1) { - path = split.slice(0, -1).join('/'); - projectId = split.pop(); - } - if (projectId) { - var projectMatch = projectId.match(/^\d+/); - if (projectMatch) { - projectId = projectMatch[0]; - } + const match = DSN_REGEX.exec(str); + + if (!match) { + throw new _error_js__WEBPACK_IMPORTED_MODULE_0__["SentryError"](`Invalid Sentry Dsn: ${str}`); + } + + 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: host, pass: pass, path: path, projectId: projectId, port: port, protocol: protocol, publicKey: publicKey }); + } + + return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey }); } + function dsnFromComponents(components) { - // TODO this is for backwards compatibility, and can be removed in a future version - if ('user' in components && !('publicKey' in components)) { - components.publicKey = components.user; - } - return { - user: components.publicKey || '', - protocol: components.protocol, - publicKey: components.publicKey || '', - pass: components.pass || '', - host: components.host, - port: components.port || '', - path: components.path || '', - projectId: components.projectId, - }; + 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 (!_flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"]) { - return; - } - var port = dsn.port, projectId = dsn.projectId, protocol = dsn.protocol; - var requiredComponents = ['protocol', 'publicKey', 'host', 'projectId']; - requiredComponents.forEach(function (component) { - if (!dsn[component]) { - throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: " + component + " missing"); - } - }); - if (!projectId.match(/^\d+$/)) { - throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: Invalid projectId " + projectId); - } - if (!isValidProtocol(protocol)) { - throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: Invalid protocol " + protocol); - } - if (port && isNaN(parseInt(port, 10))) { - throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: Invalid port " + port); + if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + return; + } + + const { port, projectId, protocol } = dsn; + + const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId']; + requiredComponents.forEach(component => { + if (!dsn[component]) { + throw new _error_js__WEBPACK_IMPORTED_MODULE_0__["SentryError"](`Invalid Sentry Dsn: ${component} missing`); } - return true; + }); + + if (!projectId.match(/^\d+$/)) { + throw new _error_js__WEBPACK_IMPORTED_MODULE_0__["SentryError"](`Invalid Sentry Dsn: Invalid projectId ${projectId}`); + } + + if (!isValidProtocol(protocol)) { + throw new _error_js__WEBPACK_IMPORTED_MODULE_0__["SentryError"](`Invalid Sentry Dsn: Invalid protocol ${protocol}`); + } + + if (port && isNaN(parseInt(port, 10))) { + throw new _error_js__WEBPACK_IMPORTED_MODULE_0__["SentryError"](`Invalid Sentry Dsn: Invalid port ${port}`); + } + + return true; } + /** The Sentry Dsn, identifying a Sentry instance and project. */ function makeDsn(from) { - var components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from); - validateDsn(components); - return components; + const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from); + validateDsn(components); + return components; } + + //# sourceMappingURL=dsn.js.map + /***/ }), /***/ "UJJ5": @@ -226842,6 +236343,273 @@ function RadioButtonIcon(props) { /***/ }), +/***/ "Um2S": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("sdzg"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forget", function() { return _async__WEBPACK_IMPORTED_MODULE_0__["forget"]; }); + +/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TAEo"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "htmlTreeAsString", function() { return _browser__WEBPACK_IMPORTED_MODULE_1__["htmlTreeAsString"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocationHref", function() { return _browser__WEBPACK_IMPORTED_MODULE_1__["getLocationHref"]; }); + +/* harmony import */ var _dsn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("wpZj"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dsnToString", function() { return _dsn__WEBPACK_IMPORTED_MODULE_2__["dsnToString"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeDsn", function() { return _dsn__WEBPACK_IMPORTED_MODULE_2__["makeDsn"]; }); + +/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("P6zQ"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SeverityLevels", function() { return _enums__WEBPACK_IMPORTED_MODULE_3__["SeverityLevels"]; }); + +/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("ZJ+v"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SentryError", function() { return _error__WEBPACK_IMPORTED_MODULE_4__["SentryError"]; }); + +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("BilH"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getGlobalObject", function() { return _global__WEBPACK_IMPORTED_MODULE_5__["getGlobalObject"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getGlobalSingleton", function() { return _global__WEBPACK_IMPORTED_MODULE_5__["getGlobalSingleton"]; }); + +/* harmony import */ var _instrument__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("wdbR"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addInstrumentationHandler", function() { return _instrument__WEBPACK_IMPORTED_MODULE_6__["addInstrumentationHandler"]; }); + +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("fUgN"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isError"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isErrorEvent", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isErrorEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDOMError", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isDOMError"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDOMException", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isDOMException"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isString"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPrimitive", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isPrimitive"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isPlainObject"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEvent", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isElement"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isRegExp"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isThenable", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isThenable"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSyntheticEvent", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isSyntheticEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isNaN"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInstanceOf", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isInstanceOf"]; }); + +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("N4D0"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONSOLE_LEVELS", function() { return _logger__WEBPACK_IMPORTED_MODULE_8__["CONSOLE_LEVELS"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "consoleSandbox", function() { return _logger__WEBPACK_IMPORTED_MODULE_8__["consoleSandbox"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return _logger__WEBPACK_IMPORTED_MODULE_8__["logger"]; }); + +/* harmony import */ var _memo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("X1v9"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoBuilder", function() { return _memo__WEBPACK_IMPORTED_MODULE_9__["memoBuilder"]; }); + +/* harmony import */ var _misc__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("Chjg"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uuid4", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["uuid4"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["parseUrl"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEventDescription", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["getEventDescription"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addExceptionTypeValue", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["addExceptionTypeValue"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addExceptionMechanism", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["addExceptionMechanism"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseSemver", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["parseSemver"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addContextToFrame", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["addContextToFrame"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stripUrlQueryAndFragment", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["stripUrlQueryAndFragment"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkOrSetAlreadyCaught", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["checkOrSetAlreadyCaught"]; }); + +/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("Y9XZ"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNodeEnv", function() { return _node__WEBPACK_IMPORTED_MODULE_11__["isNodeEnv"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dynamicRequire", function() { return _node__WEBPACK_IMPORTED_MODULE_11__["dynamicRequire"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "loadModule", function() { return _node__WEBPACK_IMPORTED_MODULE_11__["loadModule"]; }); + +/* harmony import */ var _normalize__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("ydZW"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return _normalize__WEBPACK_IMPORTED_MODULE_12__["normalize"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeToSize", function() { return _normalize__WEBPACK_IMPORTED_MODULE_12__["normalizeToSize"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "walk", function() { return _normalize__WEBPACK_IMPORTED_MODULE_12__["walk"]; }); + +/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("y+lv"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["fill"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addNonEnumerableProperty", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["addNonEnumerableProperty"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "markFunctionWrapped", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["markFunctionWrapped"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getOriginalFunction", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["getOriginalFunction"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlEncode", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["urlEncode"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "convertToPlainObject", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["convertToPlainObject"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractExceptionKeysForMessage", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["extractExceptionKeysForMessage"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropUndefinedKeys", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["dropUndefinedKeys"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "objectify", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["objectify"]; }); + +/* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("7JmA"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["resolve"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["relative"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizePath", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["normalizePath"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAbsolute", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["isAbsolute"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["join"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["dirname"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["basename"]; }); + +/* harmony import */ var _promisebuffer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("dvB7"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makePromiseBuffer", function() { return _promisebuffer__WEBPACK_IMPORTED_MODULE_15__["makePromiseBuffer"]; }); + +/* harmony import */ var _severity__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("yE6y"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "severityFromString", function() { return _severity__WEBPACK_IMPORTED_MODULE_16__["severityFromString"]; }); + +/* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__("bXDU"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createStackParser", function() { return _stacktrace__WEBPACK_IMPORTED_MODULE_17__["createStackParser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stripSentryFramesAndReverse", function() { return _stacktrace__WEBPACK_IMPORTED_MODULE_17__["stripSentryFramesAndReverse"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFunctionName", function() { return _stacktrace__WEBPACK_IMPORTED_MODULE_17__["getFunctionName"]; }); + +/* harmony import */ var _status__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__("zUo4"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventStatusFromHttpCode", function() { return _status__WEBPACK_IMPORTED_MODULE_18__["eventStatusFromHttpCode"]; }); + +/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__("/gRg"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["truncate"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snipLine", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["snipLine"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "safeJoin", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["safeJoin"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchingPattern", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["isMatchingPattern"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeStringForRegex", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["escapeStringForRegex"]; }); + +/* harmony import */ var _supports__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__("jdz8"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsErrorEvent", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsErrorEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsDOMError", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsDOMError"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsDOMException", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsDOMException"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsFetch", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsFetch"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNativeFetch", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["isNativeFetch"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsNativeFetch", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsNativeFetch"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsReportingObserver", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsReportingObserver"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsReferrerPolicy", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsReferrerPolicy"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsHistory", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsHistory"]; }); + +/* harmony import */ var _syncpromise__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__("exQi"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolvedSyncPromise", function() { return _syncpromise__WEBPACK_IMPORTED_MODULE_21__["resolvedSyncPromise"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rejectedSyncPromise", function() { return _syncpromise__WEBPACK_IMPORTED_MODULE_21__["rejectedSyncPromise"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SyncPromise", function() { return _syncpromise__WEBPACK_IMPORTED_MODULE_21__["SyncPromise"]; }); + +/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__("slSt"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dateTimestampInSeconds", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["dateTimestampInSeconds"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestampInSeconds", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["timestampInSeconds"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestampWithMs", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["timestampWithMs"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "usingPerformanceAPI", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["usingPerformanceAPI"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_browserPerformanceTimeOriginMode", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["_browserPerformanceTimeOriginMode"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "browserPerformanceTimeOrigin", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["browserPerformanceTimeOrigin"]; }); + +/* harmony import */ var _tracing__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__("FK2R"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TRACEPARENT_REGEXP", function() { return _tracing__WEBPACK_IMPORTED_MODULE_23__["TRACEPARENT_REGEXP"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractTraceparentData", function() { return _tracing__WEBPACK_IMPORTED_MODULE_23__["extractTraceparentData"]; }); + +/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__("tAP+"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBrowserBundle", function() { return _env__WEBPACK_IMPORTED_MODULE_24__["isBrowserBundle"]; }); + +/* harmony import */ var _envelope__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__("nOZt"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createEnvelope", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["createEnvelope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addItemToEnvelope", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["addItemToEnvelope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeType", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["getEnvelopeType"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "serializeEnvelope", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["serializeEnvelope"]; }); + +/* harmony import */ var _clientreport__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__("lFE6"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createClientReportEnvelope", function() { return _clientreport__WEBPACK_IMPORTED_MODULE_26__["createClientReportEnvelope"]; }); + +/* harmony import */ var _ratelimit__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__("CfKo"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_RETRY_AFTER", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["DEFAULT_RETRY_AFTER"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseRetryAfterHeader", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["parseRetryAfterHeader"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disabledUntil", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["disabledUntil"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRateLimited", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["isRateLimited"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateRateLimits", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["updateRateLimits"]; }); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +//# sourceMappingURL=index.js.map + +/***/ }), + /***/ "UnGF": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -230012,6 +239780,240 @@ TransitionGroup.defaultProps = defaultProps; /***/ }), +/***/ "VffJ": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return fill; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addNonEnumerableProperty", function() { return addNonEnumerableProperty; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "markFunctionWrapped", function() { return markFunctionWrapped; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOriginalFunction", function() { return getOriginalFunction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlEncode", function() { return urlEncode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToPlainObject", function() { return convertToPlainObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractExceptionKeysForMessage", function() { return extractExceptionKeysForMessage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dropUndefinedKeys", function() { return dropUndefinedKeys; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "objectify", function() { return objectify; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tqCS"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("4E6N"); +/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("9fG0"); + + + + +/** + * Replace a method in an object with a wrapped version of itself. + * + * @param source An object that contains a method to be wrapped. + * @param name The name of the method to be wrapped. + * @param replacementFactory A higher-order function that takes the original version of the given method and returns a + * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to + * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other + * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`. + * @returns void + */ +function fill(source, name, replacementFactory) { + if (!(name in source)) { + return; + } + var original = source[name]; + var wrapped = replacementFactory(original); + // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work + // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" + if (typeof wrapped === 'function') { + try { + markFunctionWrapped(wrapped, original); + } + catch (_Oo) { + // This can throw if multiple fill happens on a global object like XMLHttpRequest + // Fixes https://github.com/getsentry/sentry-javascript/issues/2043 + } + } + source[name] = wrapped; +} +/** + * Defines a non-enumerable property on the given object. + * + * @param obj The object on which to set the property + * @param name The name of the property to be set + * @param value The value to which to set the property + */ +function addNonEnumerableProperty(obj, name, value) { + Object.defineProperty(obj, name, { + // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it + value: value, + writable: true, + configurable: true, + }); +} +/** + * Remembers the original function on the wrapped function and + * patches up the prototype. + * + * @param wrapped the wrapper function + * @param original the original function that gets wrapped + */ +function markFunctionWrapped(wrapped, original) { + var proto = original.prototype || {}; + wrapped.prototype = original.prototype = proto; + addNonEnumerableProperty(wrapped, '__sentry_original__', original); +} +/** + * This extracts the original function if available. See + * `markFunctionWrapped` for more information. + * + * @param func the function to unwrap + * @returns the unwrapped version of the function if available. + */ +function getOriginalFunction(func) { + return func.__sentry_original__; +} +/** + * Encodes given object into url-friendly format + * + * @param object An object that contains serializable values + * @returns string Encoded + */ +function urlEncode(object) { + return Object.keys(object) + .map(function (key) { return encodeURIComponent(key) + "=" + encodeURIComponent(object[key]); }) + .join('&'); +} +/** + * Transforms any object into an object literal with all its attributes + * attached to it. + * + * @param value Initial source that we have to transform in order for it to be usable by the serializer + */ +function convertToPlainObject(value) { + var newObj = value; + if (Object(_is__WEBPACK_IMPORTED_MODULE_2__["isError"])(value)) { + newObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ message: value.message, name: value.name, stack: value.stack }, getOwnProperties(value)); + } + else if (Object(_is__WEBPACK_IMPORTED_MODULE_2__["isEvent"])(value)) { + var event_1 = value; + newObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ type: event_1.type, target: serializeEventTarget(event_1.target), currentTarget: serializeEventTarget(event_1.currentTarget) }, getOwnProperties(event_1)); + if (typeof CustomEvent !== 'undefined' && Object(_is__WEBPACK_IMPORTED_MODULE_2__["isInstanceOf"])(value, CustomEvent)) { + newObj.detail = event_1.detail; + } + } + return newObj; +} +/** Creates a string representation of the target of an `Event` object */ +function serializeEventTarget(target) { + try { + return Object(_is__WEBPACK_IMPORTED_MODULE_2__["isElement"])(target) ? Object(_browser__WEBPACK_IMPORTED_MODULE_1__["htmlTreeAsString"])(target) : Object.prototype.toString.call(target); + } + catch (_oO) { + return '<unknown>'; + } +} +/** Filters out all but an object's own properties */ +function getOwnProperties(obj) { + var extractedProps = {}; + for (var property in obj) { + if (Object.prototype.hasOwnProperty.call(obj, property)) { + extractedProps[property] = obj[property]; + } + } + return extractedProps; +} +/** + * Given any captured exception, extract its keys and create a sorted + * and truncated list that will be used inside the event message. + * eg. `Non-error exception captured with keys: foo, bar, baz` + */ +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function extractExceptionKeysForMessage(exception, maxLength) { + if (maxLength === void 0) { maxLength = 40; } + var keys = Object.keys(convertToPlainObject(exception)); + keys.sort(); + if (!keys.length) { + return '[object has no keys]'; + } + if (keys[0].length >= maxLength) { + return Object(_string__WEBPACK_IMPORTED_MODULE_3__["truncate"])(keys[0], maxLength); + } + for (var includedKeys = keys.length; includedKeys > 0; includedKeys--) { + var serialized = keys.slice(0, includedKeys).join(', '); + if (serialized.length > maxLength) { + continue; + } + if (includedKeys === keys.length) { + return serialized; + } + return Object(_string__WEBPACK_IMPORTED_MODULE_3__["truncate"])(serialized, maxLength); + } + return ''; +} +/** + * Given any object, return the new object with removed keys that value was `undefined`. + * Works recursively on objects and arrays. + */ +function dropUndefinedKeys(val) { + var e_1, _a; + if (Object(_is__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(val)) { + var rv = {}; + try { + for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(Object.keys(val)), _c = _b.next(); !_c.done; _c = _b.next()) { + var key = _c.value; + if (typeof val[key] !== 'undefined') { + rv[key] = dropUndefinedKeys(val[key]); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } + return rv; + } + if (Array.isArray(val)) { + return val.map(dropUndefinedKeys); + } + return val; +} +/** + * Ensure that something is an object. + * + * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper + * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives. + * + * @param wat The subject of the objectification + * @returns A version of `wat` which can safely be used with `Object` class methods + */ +function objectify(wat) { + var objectified; + switch (true) { + case wat === undefined || 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 Object(_is__WEBPACK_IMPORTED_MODULE_2__["isPrimitive"])(wat): + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + 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; +} +//# sourceMappingURL=object.js.map + +/***/ }), + /***/ "Vfhj": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -231994,6 +241996,35 @@ module.exports = function getSubdomain(hostname, domain) { }; +/***/ }), + +/***/ "VrCg": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_interopDefault", function() { return _interopDefault; }); +/** + * Unwraps a module if it has been wrapped in an object under the key `default`. + * + * Adapted from Rollup (https://github.com/rollup/rollup) + * + * @param requireResult The result of calling `require` on a module + * @returns The full module, unwrapped if necessary. + */ +function _interopDefault(requireResult) { + return requireResult.__esModule ? (requireResult.default ) : requireResult; +} + +// Rollup version: +// function _interopDefault(e) { +// return e && e.__esModule ? e['default'] : e; +// } + + +//# sourceMappingURL=_interopDefault.js.map + + /***/ }), /***/ "VsWn": @@ -232607,6 +242638,170 @@ function packEnclose(circles) { }); +/***/ }), + +/***/ "W/Py": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "API", function() { return API; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initAPIDetails", function() { return initAPIDetails; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStoreEndpointWithUrlEncodedAuth", function() { return getStoreEndpointWithUrlEncodedAuth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeEndpointWithUrlEncodedAuth", function() { return getEnvelopeEndpointWithUrlEncodedAuth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRequestHeaders", function() { return getRequestHeaders; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getReportDialogEndpoint", function() { return getReportDialogEndpoint; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Um2S"); + +var SENTRY_API_VERSION = '7'; +/** + * Helper class to provide urls, headers and metadata that can be used to form + * different types of requests to Sentry endpoints. + * Supports both envelopes and regular event requests. + * + * @deprecated Please use APIDetails + **/ +var API = /** @class */ (function () { + /** Create a new instance of API */ + function API(dsn, metadata, tunnel) { + if (metadata === void 0) { metadata = {}; } + this.dsn = dsn; + this._dsnObject = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makeDsn"])(dsn); + this.metadata = metadata; + this._tunnel = tunnel; + } + /** Returns the Dsn object. */ + API.prototype.getDsn = function () { + return this._dsnObject; + }; + /** Does this transport force envelopes? */ + API.prototype.forceEnvelope = function () { + return !!this._tunnel; + }; + /** Returns the prefix to construct Sentry ingestion API endpoints. */ + API.prototype.getBaseApiEndpoint = function () { + return getBaseApiEndpoint(this._dsnObject); + }; + /** Returns the store endpoint URL. */ + API.prototype.getStoreEndpoint = function () { + return getStoreEndpoint(this._dsnObject); + }; + /** + * Returns the store endpoint URL with auth in the query string. + * + * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. + */ + API.prototype.getStoreEndpointWithUrlEncodedAuth = function () { + return getStoreEndpointWithUrlEncodedAuth(this._dsnObject); + }; + /** + * Returns the envelope endpoint URL with auth in the query string. + * + * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. + */ + API.prototype.getEnvelopeEndpointWithUrlEncodedAuth = function () { + return getEnvelopeEndpointWithUrlEncodedAuth(this._dsnObject, this._tunnel); + }; + return API; +}()); + +/** Initializes API Details */ +function initAPIDetails(dsn, metadata, tunnel) { + return { + initDsn: dsn, + metadata: metadata || {}, + dsn: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makeDsn"])(dsn), + tunnel: tunnel, + }; +} +/** Returns the prefix to construct Sentry ingestion API endpoints. */ +function getBaseApiEndpoint(dsn) { + var protocol = dsn.protocol ? dsn.protocol + ":" : ''; + var port = dsn.port ? ":" + dsn.port : ''; + return protocol + "//" + dsn.host + port + (dsn.path ? "/" + dsn.path : '') + "/api/"; +} +/** Returns the ingest API endpoint for target. */ +function _getIngestEndpoint(dsn, target) { + return "" + getBaseApiEndpoint(dsn) + dsn.projectId + "/" + target + "/"; +} +/** Returns a URL-encoded string with auth config suitable for a query string. */ +function _encodedAuth(dsn) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["urlEncode"])({ + // We send only the minimum set of required information. See + // https://github.com/getsentry/sentry-javascript/issues/2572. + sentry_key: dsn.publicKey, + sentry_version: SENTRY_API_VERSION, + }); +} +/** Returns the store endpoint URL. */ +function getStoreEndpoint(dsn) { + return _getIngestEndpoint(dsn, 'store'); +} +/** + * Returns the store endpoint URL with auth in the query string. + * + * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. + */ +function getStoreEndpointWithUrlEncodedAuth(dsn) { + return getStoreEndpoint(dsn) + "?" + _encodedAuth(dsn); +} +/** Returns the envelope endpoint URL. */ +function _getEnvelopeEndpoint(dsn) { + return _getIngestEndpoint(dsn, 'envelope'); +} +/** + * Returns the envelope endpoint URL with auth in the query string. + * + * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. + */ +function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel) { + return tunnel ? tunnel : _getEnvelopeEndpoint(dsn) + "?" + _encodedAuth(dsn); +} +/** + * Returns an object that can be used in request headers. + * This is needed for node and the old /store endpoint in sentry + */ +function getRequestHeaders(dsn, clientName, clientVersion) { + // CHANGE THIS to use metadata but keep clientName and clientVersion compatible + var header = ["Sentry sentry_version=" + SENTRY_API_VERSION]; + header.push("sentry_client=" + clientName + "/" + clientVersion); + header.push("sentry_key=" + dsn.publicKey); + if (dsn.pass) { + header.push("sentry_secret=" + dsn.pass); + } + return { + 'Content-Type': 'application/json', + 'X-Sentry-Auth': header.join(', '), + }; +} +/** Returns the url to the report dialog endpoint. */ +function getReportDialogEndpoint(dsnLike, dialogOptions) { + var dsn = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makeDsn"])(dsnLike); + var endpoint = getBaseApiEndpoint(dsn) + "embed/error-page/"; + var encodedOptions = "dsn=" + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dsnToString"])(dsn); + for (var key in dialogOptions) { + if (key === 'dsn') { + continue; + } + if (key === 'user') { + if (!dialogOptions.user) { + continue; + } + if (dialogOptions.user.name) { + encodedOptions += "&name=" + encodeURIComponent(dialogOptions.user.name); + } + if (dialogOptions.user.email) { + encodedOptions += "&email=" + encodeURIComponent(dialogOptions.user.email); + } + } + else { + encodedOptions += "&" + encodeURIComponent(key) + "=" + encodeURIComponent(dialogOptions[key]); + } + } + return endpoint + "?" + encodedOptions; +} +//# sourceMappingURL=api.js.map + /***/ }), /***/ "W070": @@ -232933,176 +243128,213 @@ module.exports = getDayOfYear __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dedupe", function() { return Dedupe; }); /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("3Uor"); /** Deduplication filter */ -var Dedupe = /** @class */ (function () { - function Dedupe() { - /** - * @inheritDoc - */ - this.name = Dedupe.id; - } - /** - * @inheritDoc - */ - Dedupe.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) { - addGlobalEventProcessor(function (currentEvent) { - var self = getCurrentHub().getIntegration(Dedupe); - if (self) { - // Juuust in case something goes wrong - try { - if (_shouldDropEvent(currentEvent, self._previousEvent)) { - _flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Event dropped due to being a duplicate of previously captured event.'); - return null; - } - } - catch (_oO) { - return (self._previousEvent = currentEvent); - } - return (self._previousEvent = currentEvent); - } - return currentEvent; - }); +class Dedupe {constructor() { Dedupe.prototype.__init.call(this); } + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Dedupe';} + + /** + * @inheritDoc + */ + __init() {this.name = Dedupe.id;} + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + setupOnce(addGlobalEventProcessor, getCurrentHub) { + const eventProcessor = currentEvent => { + const self = getCurrentHub().getIntegration(Dedupe); + if (self) { + // Juuust in case something goes wrong + try { + if (_shouldDropEvent(currentEvent, self._previousEvent)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Event dropped due to being a duplicate of previously captured event.'); + return null; + } + } catch (_oO) { + return (self._previousEvent = currentEvent); + } + + return (self._previousEvent = currentEvent); + } + return currentEvent; }; - /** - * @inheritDoc - */ - Dedupe.id = 'Dedupe'; - return Dedupe; -}()); + + eventProcessor.id = this.name; + addGlobalEventProcessor(eventProcessor); + } +} Dedupe.__initStatic(); /** JSDoc */ function _shouldDropEvent(currentEvent, previousEvent) { - if (!previousEvent) { - return false; - } - if (_isSameMessageEvent(currentEvent, previousEvent)) { - return true; - } - if (_isSameExceptionEvent(currentEvent, previousEvent)) { - return true; - } + if (!previousEvent) { return false; + } + + if (_isSameMessageEvent(currentEvent, previousEvent)) { + return true; + } + + if (_isSameExceptionEvent(currentEvent, previousEvent)) { + return true; + } + + return false; } + /** JSDoc */ function _isSameMessageEvent(currentEvent, previousEvent) { - var currentMessage = currentEvent.message; - var previousMessage = previousEvent.message; - // If neither event has a message property, they were both exceptions, so bail out - if (!currentMessage && !previousMessage) { - return false; - } - // If only one event has a stacktrace, but not the other one, they are not the same - if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) { - return false; - } - if (currentMessage !== previousMessage) { - return false; - } - if (!_isSameFingerprint(currentEvent, previousEvent)) { - return false; - } - if (!_isSameStacktrace(currentEvent, previousEvent)) { - return false; - } - return true; + const currentMessage = currentEvent.message; + const previousMessage = previousEvent.message; + + // If neither event has a message property, they were both exceptions, so bail out + if (!currentMessage && !previousMessage) { + return false; + } + + // If only one event has a stacktrace, but not the other one, they are not the same + if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) { + return false; + } + + if (currentMessage !== previousMessage) { + return false; + } + + if (!_isSameFingerprint(currentEvent, previousEvent)) { + return false; + } + + if (!_isSameStacktrace(currentEvent, previousEvent)) { + return false; + } + + return true; } + /** JSDoc */ function _isSameExceptionEvent(currentEvent, previousEvent) { - var previousException = _getExceptionFromEvent(previousEvent); - var currentException = _getExceptionFromEvent(currentEvent); - if (!previousException || !currentException) { - return false; - } - if (previousException.type !== currentException.type || previousException.value !== currentException.value) { - return false; - } - if (!_isSameFingerprint(currentEvent, previousEvent)) { - return false; - } - if (!_isSameStacktrace(currentEvent, previousEvent)) { - return false; - } - return true; + const previousException = _getExceptionFromEvent(previousEvent); + const currentException = _getExceptionFromEvent(currentEvent); + + if (!previousException || !currentException) { + return false; + } + + if (previousException.type !== currentException.type || previousException.value !== currentException.value) { + return false; + } + + if (!_isSameFingerprint(currentEvent, previousEvent)) { + return false; + } + + if (!_isSameStacktrace(currentEvent, previousEvent)) { + return false; + } + + return true; } + /** JSDoc */ function _isSameStacktrace(currentEvent, previousEvent) { - var currentFrames = _getFramesFromEvent(currentEvent); - var previousFrames = _getFramesFromEvent(previousEvent); - // If neither event has a stacktrace, they are assumed to be the same - if (!currentFrames && !previousFrames) { - return true; - } - // If only one event has a stacktrace, but not the other one, they are not the same - if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) { - return false; - } - currentFrames = currentFrames; - previousFrames = previousFrames; - // If number of frames differ, they are not the same - if (previousFrames.length !== currentFrames.length) { - return false; - } - // Otherwise, compare the two - for (var i = 0; i < previousFrames.length; i++) { - var frameA = previousFrames[i]; - var frameB = currentFrames[i]; - if (frameA.filename !== frameB.filename || - frameA.lineno !== frameB.lineno || - frameA.colno !== frameB.colno || - frameA.function !== frameB.function) { - return false; - } - } + let currentFrames = _getFramesFromEvent(currentEvent); + let previousFrames = _getFramesFromEvent(previousEvent); + + // If neither event has a stacktrace, they are assumed to be the same + if (!currentFrames && !previousFrames) { return true; + } + + // If only one event has a stacktrace, but not the other one, they are not the same + if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) { + return false; + } + + currentFrames = currentFrames ; + previousFrames = previousFrames ; + + // If number of frames differ, they are not the same + if (previousFrames.length !== currentFrames.length) { + return false; + } + + // Otherwise, compare the two + for (let i = 0; i < previousFrames.length; i++) { + const frameA = previousFrames[i]; + const frameB = currentFrames[i]; + + if ( + frameA.filename !== frameB.filename || + frameA.lineno !== frameB.lineno || + frameA.colno !== frameB.colno || + frameA.function !== frameB.function + ) { + return false; + } + } + + return true; } + /** JSDoc */ function _isSameFingerprint(currentEvent, previousEvent) { - var currentFingerprint = currentEvent.fingerprint; - var previousFingerprint = previousEvent.fingerprint; - // If neither event has a fingerprint, they are assumed to be the same - if (!currentFingerprint && !previousFingerprint) { - return true; - } - // If only one event has a fingerprint, but not the other one, they are not the same - if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) { - return false; - } - currentFingerprint = currentFingerprint; - previousFingerprint = previousFingerprint; - // Otherwise, compare the two - try { - return !!(currentFingerprint.join('') === previousFingerprint.join('')); - } - catch (_oO) { - return false; - } + let currentFingerprint = currentEvent.fingerprint; + let previousFingerprint = previousEvent.fingerprint; + + // If neither event has a fingerprint, they are assumed to be the same + if (!currentFingerprint && !previousFingerprint) { + return true; + } + + // If only one event has a fingerprint, but not the other one, they are not the same + if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) { + return false; + } + + currentFingerprint = currentFingerprint ; + previousFingerprint = previousFingerprint ; + + // Otherwise, compare the two + try { + return !!(currentFingerprint.join('') === previousFingerprint.join('')); + } catch (_oO) { + return false; + } } + /** JSDoc */ function _getExceptionFromEvent(event) { - return event.exception && event.exception.values && event.exception.values[0]; + return event.exception && event.exception.values && event.exception.values[0]; } + /** JSDoc */ function _getFramesFromEvent(event) { - var exception = event.exception; - if (exception) { - try { - // @ts-ignore Object could be undefined - return exception.values[0].stacktrace.frames; - } - catch (_oO) { - return undefined; - } - } - else if (event.stacktrace) { - return event.stacktrace.frames; + const exception = event.exception; + + if (exception) { + try { + // @ts-ignore Object could be undefined + return exception.values[0].stacktrace.frames; + } catch (_oO) { + return undefined; } - return undefined; + } + return undefined; } + + //# sourceMappingURL=dedupe.js.map + /***/ }), /***/ "WC8t": @@ -233482,6 +243714,173 @@ var $export = __webpack_require__("XKFU"); $export($export.S + $export.F * !__webpack_require__("nh4g"), 'Object', { defineProperties: __webpack_require__("FJW5") }); +/***/ }), + +/***/ "WMn2": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldIgnoreOnError", function() { return shouldIgnoreOnError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreNextOnError", function() { return ignoreNextOnError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectReportDialog", function() { return injectReportDialog; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Um2S"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("dO1v"); + + + + +var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); +var ignoreOnError = 0; +/** + * @hidden + */ +function shouldIgnoreOnError() { + return ignoreOnError > 0; +} +/** + * @hidden + */ +function ignoreNextOnError() { + // onerror should trigger before setTimeout + ignoreOnError += 1; + setTimeout(function () { + ignoreOnError -= 1; + }); +} +/** + * Instruments the given function and sends an event to Sentry every time the + * function throws an exception. + * + * @param fn A function to wrap. + * @returns The wrapped function. + * @hidden + */ +function wrap(fn, options, before) { + // for future readers what this does is wrap a function and then create + // a bi-directional wrapping between them. + // + // example: wrapped = wrap(original); + // original.__sentry_wrapped__ -> wrapped + // wrapped.__sentry_original__ -> original + if (options === void 0) { options = {}; } + if (typeof fn !== 'function') { + return fn; + } + try { + // if we're dealing with a function that was previously wrapped, return + // the original wrapper. + var wrapper = fn.__sentry_wrapped__; + if (wrapper) { + return wrapper; + } + // We don't wanna wrap it twice + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getOriginalFunction"])(fn)) { + return fn; + } + } + catch (e) { + // Just accessing custom props in some Selenium environments + // can cause a "Permission denied" exception (see raven-js#495). + // Bail on wrapping and return the function as-is (defers to window.onerror). + return fn; + } + /* eslint-disable prefer-rest-params */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var sentryWrapped = function () { + var args = Array.prototype.slice.call(arguments); + try { + if (before && typeof before === 'function') { + before.apply(this, arguments); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access + var wrappedArguments = args.map(function (arg) { return wrap(arg, options); }); + // Attempt to invoke user-land function + // NOTE: If you are a Sentry user, and you are seeing this stack frame, it + // means the sentry.javascript SDK caught an error invoking your application code. This + // is expected behavior and NOT indicative of a bug with sentry.javascript. + return fn.apply(this, wrappedArguments); + } + catch (ex) { + ignoreNextOnError(); + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["withScope"])(function (scope) { + scope.addEventProcessor(function (event) { + if (options.mechanism) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionTypeValue"])(event, undefined, undefined); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionMechanism"])(event, options.mechanism); + } + event.extra = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, event.extra), { arguments: args }); + return event; + }); + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureException"])(ex); + }); + throw ex; + } + }; + /* eslint-enable prefer-rest-params */ + // Accessing some objects may throw + // ref: https://github.com/getsentry/sentry-javascript/issues/1168 + try { + for (var property in fn) { + if (Object.prototype.hasOwnProperty.call(fn, property)) { + sentryWrapped[property] = fn[property]; + } + } + } + catch (_oO) { } // eslint-disable-line no-empty + // Signal that this function has been wrapped/filled already + // for both debugging and to prevent it to being wrapped/filled twice + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["markFunctionWrapped"])(sentryWrapped, fn); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addNonEnumerableProperty"])(fn, '__sentry_wrapped__', sentryWrapped); + // Restore original function name (not all browsers allow that) + try { + var descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name'); + if (descriptor.configurable) { + Object.defineProperty(sentryWrapped, 'name', { + get: function () { + return fn.name; + }, + }); + } + // eslint-disable-next-line no-empty + } + catch (_oO) { } + return sentryWrapped; +} +/** + * Injects the Report Dialog script + * @hidden + */ +function injectReportDialog(options) { + if (options === void 0) { options = {}; } + if (!global.document) { + return; + } + if (!options.eventId) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].error('Missing eventId option in showReportDialog call'); + return; + } + if (!options.dsn) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].error('Missing dsn option in showReportDialog call'); + return; + } + var script = global.document.createElement('script'); + script.async = true; + script.src = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getReportDialogEndpoint"])(options.dsn, options); + if (options.onLoad) { + // eslint-disable-next-line @typescript-eslint/unbound-method + script.onload = options.onLoad; + } + var injectionPoint = global.document.head || global.document.body; + if (injectionPoint) { + injectionPoint.appendChild(script); + } +} +//# sourceMappingURL=helpers.js.map + /***/ }), /***/ "WOg5": @@ -234214,101 +244613,154 @@ if (false) {} "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Integrations", function() { return INTEGRATIONS; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _exports__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9fYY"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Severity", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["Severity"]; }); +/* harmony import */ var _exports_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9fYY"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionToString", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["FunctionToString"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Hub"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["addBreadcrumb"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InboundFilters", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["InboundFilters"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["captureException"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["SDK_VERSION"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["captureEvent"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Scope"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["captureMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["addBreadcrumb"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["configureScope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["getHubFromCarrier"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureEvent"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureException"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["Hub"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["makeMain"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["configureScope"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["Scope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createTransport", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["createTransport"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Session", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["Session"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["startTransaction"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["getHubFromCarrier"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["SDK_VERSION"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["makeMain"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setContext"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setContext"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setExtra"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setExtra"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setExtras"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setExtras"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setTag"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setTag"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setTags"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setTags"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setUser"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setUser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["withScope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["startTransaction"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrowserClient", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["BrowserClient"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["withScope"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "injectReportDialog", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["injectReportDialog"]; }); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("vzc1"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WINDOW", function() { return _helpers_js__WEBPACK_IMPORTED_MODULE_2__["WINDOW"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventFromException", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["eventFromException"]; }); +/* harmony import */ var _integrations_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("4kjc"); +/* harmony import */ var _client_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("kWuB"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrowserClient", function() { return _client_js__WEBPACK_IMPORTED_MODULE_4__["BrowserClient"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventFromMessage", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["eventFromMessage"]; }); +/* harmony import */ var _transports_fetch_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("2O0U"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeFetchTransport", function() { return _transports_fetch_js__WEBPACK_IMPORTED_MODULE_5__["makeFetchTransport"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIntegrations", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["defaultIntegrations"]; }); +/* harmony import */ var _transports_xhr_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("MT+3"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeXHRTransport", function() { return _transports_xhr_js__WEBPACK_IMPORTED_MODULE_6__["makeXHRTransport"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceLoad", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["forceLoad"]; }); +/* harmony import */ var _stack_parsers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("xHdX"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chromeStackLineParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_7__["chromeStackLineParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "init", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["init"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultStackLineParsers", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_7__["defaultStackLineParsers"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastEventId", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["lastEventId"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultStackParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_7__["defaultStackParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["onLoad"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geckoStackLineParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_7__["geckoStackLineParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showReportDialog", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["showReportDialog"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "opera10StackLineParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_7__["opera10StackLineParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["flush"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "opera11StackLineParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_7__["opera11StackLineParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "close", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["close"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "winjsStackLineParser", function() { return _stack_parsers_js__WEBPACK_IMPORTED_MODULE_7__["winjsStackLineParser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["wrap"]; }); +/* harmony import */ var _sdk_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("3CEA"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "close", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_8__["close"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_NAME", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["SDK_NAME"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIntegrations", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_8__["defaultIntegrations"]; }); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("TwdF"); -/* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("4kjc"); -/* harmony import */ var _transports__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("nXHh"); -/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "Transports", function() { return _transports__WEBPACK_IMPORTED_MODULE_5__; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_8__["flush"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceLoad", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_8__["forceLoad"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "init", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_8__["init"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastEventId", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_8__["lastEventId"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_8__["onLoad"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showReportDialog", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_8__["showReportDialog"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_8__["wrap"]; }); + +/* harmony import */ var _integrations_globalhandlers_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("UBq+"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GlobalHandlers", function() { return _integrations_globalhandlers_js__WEBPACK_IMPORTED_MODULE_9__["GlobalHandlers"]; }); + +/* harmony import */ var _integrations_trycatch_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("wytX"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TryCatch", function() { return _integrations_trycatch_js__WEBPACK_IMPORTED_MODULE_10__["TryCatch"]; }); + +/* harmony import */ var _integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("/ZhC"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Breadcrumbs", function() { return _integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_11__["Breadcrumbs"]; }); + +/* harmony import */ var _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("ZAf6"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LinkedErrors", function() { return _integrations_linkederrors_js__WEBPACK_IMPORTED_MODULE_12__["LinkedErrors"]; }); + +/* harmony import */ var _integrations_httpcontext_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("fL16"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpContext", function() { return _integrations_httpcontext_js__WEBPACK_IMPORTED_MODULE_13__["HttpContext"]; }); + +/* harmony import */ var _integrations_dedupe_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("WBcU"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dedupe", function() { return _integrations_dedupe_js__WEBPACK_IMPORTED_MODULE_14__["Dedupe"]; }); + + + + + + + + + + + + + + + + + + + +let windowIntegrations = {}; -var windowIntegrations = {}; // This block is needed to add compatibility with the integrations packages when used with a CDN -var _window = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["getGlobalObject"])(); -if (_window.Sentry && _window.Sentry.Integrations) { - windowIntegrations = _window.Sentry.Integrations; +if (_helpers_js__WEBPACK_IMPORTED_MODULE_2__["WINDOW"].Sentry && _helpers_js__WEBPACK_IMPORTED_MODULE_2__["WINDOW"].Sentry.Integrations) { + windowIntegrations = _helpers_js__WEBPACK_IMPORTED_MODULE_2__["WINDOW"].Sentry.Integrations; } -var INTEGRATIONS = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, windowIntegrations), _sentry_core__WEBPACK_IMPORTED_MODULE_2__["Integrations"]), _integrations__WEBPACK_IMPORTED_MODULE_4__); + +const INTEGRATIONS = { + ...windowIntegrations, + ..._sentry_core__WEBPACK_IMPORTED_MODULE_1__["Integrations"], + ..._integrations_index_js__WEBPACK_IMPORTED_MODULE_3__, +}; + //# sourceMappingURL=index.js.map + /***/ }), /***/ "WXWk": @@ -234526,6 +244978,67 @@ function buildFormatLocale () { module.exports = buildFormatLocale +/***/ }), + +/***/ "Wezb": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WINDOW", function() { return WINDOW; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); + + +const WINDOW = _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["GLOBAL_OBJ"] ; + + +//# sourceMappingURL=types.js.map + + +/***/ }), + +/***/ "WjI+": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_express_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mvbY"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Express", function() { return _node_express_js__WEBPACK_IMPORTED_MODULE_0__["Express"]; }); + +/* harmony import */ var _node_postgres_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("SXEm"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Postgres", function() { return _node_postgres_js__WEBPACK_IMPORTED_MODULE_1__["Postgres"]; }); + +/* harmony import */ var _node_mysql_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("PjJh"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Mysql", function() { return _node_mysql_js__WEBPACK_IMPORTED_MODULE_2__["Mysql"]; }); + +/* harmony import */ var _node_mongo_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("0G76"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Mongo", function() { return _node_mongo_js__WEBPACK_IMPORTED_MODULE_3__["Mongo"]; }); + +/* harmony import */ var _node_prisma_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("F4Bt"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Prisma", function() { return _node_prisma_js__WEBPACK_IMPORTED_MODULE_4__["Prisma"]; }); + +/* harmony import */ var _node_graphql_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("mz3V"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GraphQL", function() { return _node_graphql_js__WEBPACK_IMPORTED_MODULE_5__["GraphQL"]; }); + +/* harmony import */ var _node_apollo_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("cRYb"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Apollo", function() { return _node_apollo_js__WEBPACK_IMPORTED_MODULE_6__["Apollo"]; }); + +/* harmony import */ var _browser_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("lk7i"); +/* harmony import */ var _browser_browsertracing_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("zHkj"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrowserTracing", function() { return _browser_browsertracing_js__WEBPACK_IMPORTED_MODULE_8__["BrowserTracing"]; }); + + + + + + + + + + +//# sourceMappingURL=index.js.map + + /***/ }), /***/ "Wjgk": @@ -235911,6 +246424,57 @@ module.exports = rsaes; /***/ }), +/***/ "X1v9": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "memoBuilder", function() { return memoBuilder; }); +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** + * Helper to decycle json objects + */ +function memoBuilder() { + var hasWeakSet = typeof WeakSet === 'function'; + var inner = hasWeakSet ? new WeakSet() : []; + function memoize(obj) { + if (hasWeakSet) { + if (inner.has(obj)) { + return true; + } + inner.add(obj); + return false; + } + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (var i = 0; i < inner.length; i++) { + var value = inner[i]; + if (value === obj) { + return true; + } + } + inner.push(obj); + return false; + } + function unmemoize(obj) { + if (hasWeakSet) { + inner.delete(obj); + } + else { + for (var i = 0; i < inner.length; i++) { + if (inner[i] === obj) { + inner.splice(i, 1); + break; + } + } + } + } + return [memoize, unmemoize]; +} +//# sourceMappingURL=memo.js.map + +/***/ }), + /***/ "X3w3": /***/ (function(module, exports, __webpack_require__) { @@ -238337,8 +248901,9 @@ var DeviceType; "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makePromiseBuffer", function() { return makePromiseBuffer; }); -/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9Pyj"); -/* harmony import */ var _syncpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("HR75"); +/* harmony import */ var _error_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9Pyj"); +/* harmony import */ var _syncpromise_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("HR75"); + /** @@ -238346,91 +248911,103 @@ __webpack_require__.r(__webpack_exports__); * @param limit max number of promises that can be stored in the buffer */ function makePromiseBuffer(limit) { - var buffer = []; - function isReady() { - return limit === undefined || buffer.length < limit; - } - /** - * Remove a promise from the queue. - * - * @param task Can be any PromiseLike<T> - * @returns Removed promise. - */ - function remove(task) { - return buffer.splice(buffer.indexOf(task), 1)[0]; - } - /** - * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment. - * - * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task: - * PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor - * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By - * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer - * limit check. - * @returns The original promise. - */ - function add(taskProducer) { - if (!isReady()) { - return Object(_syncpromise__WEBPACK_IMPORTED_MODULE_1__["rejectedSyncPromise"])(new _error__WEBPACK_IMPORTED_MODULE_0__["SentryError"]('Not adding Promise due to buffer limit reached.')); - } - // start the task and add its promise to the queue - var task = taskProducer(); - if (buffer.indexOf(task) === -1) { - buffer.push(task); + const buffer = []; + + function isReady() { + return limit === undefined || buffer.length < limit; + } + + /** + * Remove a promise from the queue. + * + * @param task Can be any PromiseLike<T> + * @returns Removed promise. + */ + function remove(task) { + return buffer.splice(buffer.indexOf(task), 1)[0]; + } + + /** + * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment. + * + * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task: + * PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor + * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By + * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer + * limit check. + * @returns The original promise. + */ + function add(taskProducer) { + if (!isReady()) { + return Object(_syncpromise_js__WEBPACK_IMPORTED_MODULE_1__["rejectedSyncPromise"])(new _error_js__WEBPACK_IMPORTED_MODULE_0__["SentryError"]('Not adding Promise because buffer limit was reached.')); + } + + // start the task and add its promise to the queue + const task = taskProducer(); + if (buffer.indexOf(task) === -1) { + buffer.push(task); + } + void task + .then(() => remove(task)) + // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike` + // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't + // have promises, so TS has to polyfill when down-compiling.) + .then(null, () => + remove(task).then(null, () => { + // We have to add another catch here because `remove()` starts a new promise chain. + }), + ); + return task; + } + + /** + * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or + * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to + * `true`. + * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and + * `false` otherwise + */ + function drain(timeout) { + return new _syncpromise_js__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"]((resolve, reject) => { + let counter = buffer.length; + + if (!counter) { + return resolve(true); + } + + // wait for `timeout` ms and then resolve to `false` (if not cancelled first) + const capturedSetTimeout = setTimeout(() => { + if (timeout && timeout > 0) { + resolve(false); } - void task - .then(function () { return remove(task); }) - // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike` - // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't - // have promises, so TS has to polyfill when down-compiling.) - .then(null, function () { - return remove(task).then(null, function () { - // We have to add another catch here because `remove()` starts a new promise chain. - }); - }); - return task; - } - /** - * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first. - * - * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or - * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to - * `true`. - * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and - * `false` otherwise - */ - function drain(timeout) { - return new _syncpromise__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"](function (resolve, reject) { - var counter = buffer.length; - if (!counter) { - return resolve(true); - } - // wait for `timeout` ms and then resolve to `false` (if not cancelled first) - var capturedSetTimeout = setTimeout(function () { - if (timeout && timeout > 0) { - resolve(false); - } - }, timeout); - // if all promises resolve in time, cancel the timer and resolve to `true` - buffer.forEach(function (item) { - void Object(_syncpromise__WEBPACK_IMPORTED_MODULE_1__["resolvedSyncPromise"])(item).then(function () { - // eslint-disable-next-line no-plusplus - if (!--counter) { - clearTimeout(capturedSetTimeout); - resolve(true); - } - }, reject); - }); - }); - } - return { - $: buffer, - add: add, - drain: drain, - }; + }, timeout); + + // if all promises resolve in time, cancel the timer and resolve to `true` + buffer.forEach(item => { + void Object(_syncpromise_js__WEBPACK_IMPORTED_MODULE_1__["resolvedSyncPromise"])(item).then(() => { + // eslint-disable-next-line no-plusplus + if (!--counter) { + clearTimeout(capturedSetTimeout); + resolve(true); + } + }, reject); + }); + }); + } + + return { + $: buffer, + add, + drain, + }; } + + //# sourceMappingURL=promisebuffer.js.map + /***/ }), /***/ "Xsyh": @@ -240470,6 +251047,76 @@ exports.isShortcutCreatedOnTheRecipientCozy = isShortcutCreatedOnTheRecipientCoz /***/ }), +/***/ "Y9XZ": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(process, module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeEnv", function() { return isNodeEnv; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dynamicRequire", function() { return dynamicRequire; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadModule", function() { return loadModule; }); +/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("tAP+"); +/** + * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, + * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. + */ + +/** + * Checks whether we're in the Node.js or Browser environment + * + * @returns Answer to given question + */ +function isNodeEnv() { + // explicitly check for browser bundles as those can be optimized statically + // by terser/rollup. + return (!Object(_env__WEBPACK_IMPORTED_MODULE_0__["isBrowserBundle"])() && + Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'); +} +/** + * Requires a module which is protected against bundler minification. + * + * @param request The module path to resolve + */ +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any +function dynamicRequire(mod, request) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return mod.require(request); +} +/** + * Helper for dynamically loading module that should work with linked dependencies. + * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))` + * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during + * build time. `require.resolve` is also not available in any other way, so we cannot create, + * a fake helper like we do with `dynamicRequire`. + * + * We always prefer to use local package, thus the value is not returned early from each `try/catch` block. + * That is to mimic the behavior of `require.resolve` exactly. + * + * @param moduleName module name to require + * @returns possibly required module + */ +function loadModule(moduleName) { + var mod; + try { + mod = dynamicRequire(module, moduleName); + } + catch (e) { + // no-empty + } + try { + var cwd = dynamicRequire(module, 'process').cwd; + mod = dynamicRequire(module, cwd() + "/node_modules/" + moduleName); + } + catch (e) { + // no-empty + } + return mod; +} +//# sourceMappingURL=node.js.map +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"), __webpack_require__("3UD+")(module))) + +/***/ }), + /***/ "Y9lz": /***/ (function(module, exports, __webpack_require__) { @@ -241465,6 +252112,101 @@ var Zoom = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](functio /***/ }), +/***/ "YaBN": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("PIsB"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Severity", function() { return _sentry_types__WEBPACK_IMPORTED_MODULE_0__["Severity"]; }); + +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["addBreadcrumb"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureException"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureMessage"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["configureScope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["getHubFromCarrier"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Hub"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["makeMain"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Scope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Session", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["Session"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["startTransaction"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["SDK_VERSION"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setContext"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setExtra"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setExtras"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setTag"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setTags"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["setUser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return _sentry_core__WEBPACK_IMPORTED_MODULE_1__["withScope"]; }); + +/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("cOvR"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrowserClient", function() { return _client__WEBPACK_IMPORTED_MODULE_2__["BrowserClient"]; }); + +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("WMn2"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "injectReportDialog", function() { return _helpers__WEBPACK_IMPORTED_MODULE_3__["injectReportDialog"]; }); + +/* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("rcEJ"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventFromException", function() { return _eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromException"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventFromMessage", function() { return _eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromMessage"]; }); + +/* harmony import */ var _sdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("Czdt"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIntegrations", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["defaultIntegrations"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceLoad", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["forceLoad"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "init", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["init"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastEventId", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["lastEventId"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["onLoad"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showReportDialog", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["showReportDialog"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["flush"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "close", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["close"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _sdk__WEBPACK_IMPORTED_MODULE_5__["wrap"]; }); + +/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("EjQr"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_NAME", function() { return _version__WEBPACK_IMPORTED_MODULE_6__["SDK_NAME"]; }); + + + + + + + + +//# sourceMappingURL=exports.js.map + +/***/ }), + /***/ "Yb7a": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -241673,6 +252415,39 @@ var scheme = new Array(3).concat( /* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); +/***/ }), + +/***/ "YjZj": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _globalhandlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("fFTy"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GlobalHandlers", function() { return _globalhandlers__WEBPACK_IMPORTED_MODULE_0__["GlobalHandlers"]; }); + +/* harmony import */ var _trycatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("P7Ha"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TryCatch", function() { return _trycatch__WEBPACK_IMPORTED_MODULE_1__["TryCatch"]; }); + +/* harmony import */ var _breadcrumbs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("SLkm"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Breadcrumbs", function() { return _breadcrumbs__WEBPACK_IMPORTED_MODULE_2__["Breadcrumbs"]; }); + +/* harmony import */ var _linkederrors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("jESX"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LinkedErrors", function() { return _linkederrors__WEBPACK_IMPORTED_MODULE_3__["LinkedErrors"]; }); + +/* harmony import */ var _useragent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("oJ8F"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UserAgent", function() { return _useragent__WEBPACK_IMPORTED_MODULE_4__["UserAgent"]; }); + +/* harmony import */ var _dedupe__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("wRg8"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dedupe", function() { return _dedupe__WEBPACK_IMPORTED_MODULE_5__["Dedupe"]; }); + + + + + + + +//# sourceMappingURL=index.js.map + /***/ }), /***/ "YlDu": @@ -244017,70 +254792,98 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedErrors", function() { return LinkedErrors; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_handler", function() { return _handler; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_walkErrorTree", function() { return _walkErrorTree; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TwdF"); -/* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("IS+8"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _eventbuilder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("IS+8"); -var DEFAULT_KEY = 'cause'; -var DEFAULT_LIMIT = 5; +const DEFAULT_KEY = 'cause'; +const DEFAULT_LIMIT = 5; + /** Adds SDK info to an event. */ -var LinkedErrors = /** @class */ (function () { - /** - * @inheritDoc - */ - function LinkedErrors(options) { - if (options === void 0) { options = {}; } - /** - * @inheritDoc - */ - this.name = LinkedErrors.id; - this._key = options.key || DEFAULT_KEY; - this._limit = options.limit || DEFAULT_LIMIT; +class LinkedErrors { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'LinkedErrors';} + + /** + * @inheritDoc + */ + __init() {this.name = LinkedErrors.id;} + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + + /** + * @inheritDoc + */ + constructor(options = {}) {;LinkedErrors.prototype.__init.call(this); + this._key = options.key || DEFAULT_KEY; + this._limit = options.limit || DEFAULT_LIMIT; + } + + /** + * @inheritDoc + */ + setupOnce() { + const client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().getClient(); + if (!client) { + return; } - /** - * @inheritDoc - */ - LinkedErrors.prototype.setupOnce = function () { - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"])(function (event, hint) { - var self = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().getIntegration(LinkedErrors); - return self ? _handler(self._key, self._limit, event, hint) : event; - }); - }; - /** - * @inheritDoc - */ - LinkedErrors.id = 'LinkedErrors'; - return LinkedErrors; -}()); + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["addGlobalEventProcessor"])((event, hint) => { + const self = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().getIntegration(LinkedErrors); + return self ? _handler(client.getOptions().stackParser, self._key, self._limit, event, hint) : event; + }); + } +} LinkedErrors.__initStatic(); /** * @inheritDoc */ -function _handler(key, limit, event, hint) { - if (!event.exception || !event.exception.values || !hint || !Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isInstanceOf"])(hint.originalException, Error)) { - return event; - } - var linkedErrors = _walkErrorTree(limit, hint.originalException, key); - event.exception.values = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(linkedErrors, event.exception.values); +function _handler( + parser, + key, + limit, + event, + hint, +) { + if (!event.exception || !event.exception.values || !hint || !Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isInstanceOf"])(hint.originalException, Error)) { return event; + } + const linkedErrors = _walkErrorTree(parser, limit, hint.originalException , key); + event.exception.values = [...linkedErrors, ...event.exception.values]; + return event; } + /** * JSDOC */ -function _walkErrorTree(limit, error, key, stack) { - if (stack === void 0) { stack = []; } - if (!Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isInstanceOf"])(error[key], Error) || stack.length + 1 >= limit) { - return stack; - } - var exception = Object(_eventbuilder__WEBPACK_IMPORTED_MODULE_3__["exceptionFromError"])(error[key]); - return _walkErrorTree(limit, error[key], key, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([exception], stack)); +function _walkErrorTree( + parser, + limit, + error, + key, + stack = [], +) { + if (!Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isInstanceOf"])(error[key], Error) || stack.length + 1 >= limit) { + return stack; + } + const exception = Object(_eventbuilder_js__WEBPACK_IMPORTED_MODULE_2__["exceptionFromError"])(parser, error[key]); + return _walkErrorTree(parser, limit, error[key], key, [exception, ...stack]); } + + //# sourceMappingURL=linkederrors.js.map + /***/ }), /***/ "ZB06": @@ -244644,6 +255447,34 @@ function isAdornedStart(obj) { /***/ }), +/***/ "ZJ+v": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SentryError", function() { return SentryError; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("HulI"); + + +/** An error emitted by Sentry SDKs and related utilities. */ +var SentryError = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SentryError, _super); + function SentryError(message) { + var _newTarget = this.constructor; + var _this = _super.call(this, message) || this; + _this.message = message; + _this.name = _newTarget.prototype.constructor.name; + Object(_polyfill__WEBPACK_IMPORTED_MODULE_1__["setPrototypeOf"])(_this, _newTarget.prototype); + return _this; + } + return SentryError; +}(Error)); + +//# sourceMappingURL=error.js.map + +/***/ }), + /***/ "ZKDM": /***/ (function(module, exports) { @@ -250374,6 +261205,84 @@ var StickyPasswordXmlImporter = /*#__PURE__*/function (_BaseImporter) { return StickyPasswordXmlImporter; }(_baseImporter__WEBPACK_IMPORTED_MODULE_5__["BaseImporter"]); +/***/ }), + +/***/ "aI3+": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _hubextensions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Cpvd"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addExtensionMethods", function() { return _hubextensions_js__WEBPACK_IMPORTED_MODULE_0__["addExtensionMethods"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startIdleTransaction", function() { return _hubextensions_js__WEBPACK_IMPORTED_MODULE_0__["startIdleTransaction"]; }); + +/* harmony import */ var _integrations_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("WjI+"); +/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "Integrations", function() { return _integrations_index_js__WEBPACK_IMPORTED_MODULE_1__; }); +/* harmony import */ var _browser_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("lk7i"); +/* harmony import */ var _span_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("SYqL"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Span", function() { return _span_js__WEBPACK_IMPORTED_MODULE_3__["Span"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "spanStatusfromHttpCode", function() { return _span_js__WEBPACK_IMPORTED_MODULE_3__["spanStatusfromHttpCode"]; }); + +/* harmony import */ var _spanstatus_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("bju/"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SpanStatus", function() { return _spanstatus_js__WEBPACK_IMPORTED_MODULE_4__["SpanStatus"]; }); + +/* harmony import */ var _transaction_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("EldZ"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Transaction", function() { return _transaction_js__WEBPACK_IMPORTED_MODULE_5__["Transaction"]; }); + +/* harmony import */ var _idletransaction_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("MBYv"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IdleTransaction", function() { return _idletransaction_js__WEBPACK_IMPORTED_MODULE_6__["IdleTransaction"]; }); + +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("FGHR"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getActiveTransaction", function() { return _utils_js__WEBPACK_IMPORTED_MODULE_7__["getActiveTransaction"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasTracingEnabled", function() { return _utils_js__WEBPACK_IMPORTED_MODULE_7__["hasTracingEnabled"]; }); + +/* harmony import */ var _browser_browsertracing_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("zHkj"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BROWSER_TRACING_INTEGRATION_ID", function() { return _browser_browsertracing_js__WEBPACK_IMPORTED_MODULE_8__["BROWSER_TRACING_INTEGRATION_ID"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrowserTracing", function() { return _browser_browsertracing_js__WEBPACK_IMPORTED_MODULE_8__["BrowserTracing"]; }); + +/* harmony import */ var _browser_request_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("crS0"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultRequestInstrumentationOptions", function() { return _browser_request_js__WEBPACK_IMPORTED_MODULE_9__["defaultRequestInstrumentationOptions"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "instrumentOutgoingRequests", function() { return _browser_request_js__WEBPACK_IMPORTED_MODULE_9__["instrumentOutgoingRequests"]; }); + +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("TwdF"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TRACEPARENT_REGEXP", function() { return _sentry_utils__WEBPACK_IMPORTED_MODULE_10__["TRACEPARENT_REGEXP"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractTraceparentData", function() { return _sentry_utils__WEBPACK_IMPORTED_MODULE_10__["extractTraceparentData"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stripUrlQueryAndFragment", function() { return _sentry_utils__WEBPACK_IMPORTED_MODULE_10__["stripUrlQueryAndFragment"]; }); + + + + + + + + + + + + + + + +; +; + +// Treeshakable guard to remove all code related to tracing + +// Guard for tree +if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) { + // We are patching the global object with our hub extension methods + Object(_hubextensions_js__WEBPACK_IMPORTED_MODULE_0__["addExtensionMethods"])(); +} +//# sourceMappingURL=index.js.map + + /***/ }), /***/ "aI7X": @@ -251334,6 +262243,160 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "agHs": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("WSEr"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionToString", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["FunctionToString"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["Hub"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InboundFilters", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["InboundFilters"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["SDK_VERSION"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["Scope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["addBreadcrumb"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["addGlobalEventProcessor"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["captureEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["captureException"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["captureMessage"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["configureScope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createTransport", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["createTransport"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["getHubFromCarrier"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["makeMain"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["setContext"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["setExtra"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["setExtras"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["setTag"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["setTags"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["setUser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["startTransaction"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["withScope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WINDOW", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["WINDOW"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrowserClient", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["BrowserClient"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeFetchTransport", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["makeFetchTransport"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeXHRTransport", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["makeXHRTransport"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chromeStackLineParser", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["chromeStackLineParser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultStackLineParsers", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["defaultStackLineParsers"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultStackParser", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["defaultStackParser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geckoStackLineParser", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["geckoStackLineParser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "opera10StackLineParser", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["opera10StackLineParser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "opera11StackLineParser", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["opera11StackLineParser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "winjsStackLineParser", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["winjsStackLineParser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "close", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["close"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIntegrations", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["defaultIntegrations"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["flush"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceLoad", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["forceLoad"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastEventId", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["lastEventId"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["onLoad"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showReportDialog", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["showReportDialog"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["wrap"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GlobalHandlers", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["GlobalHandlers"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TryCatch", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["TryCatch"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Breadcrumbs", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["Breadcrumbs"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LinkedErrors", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["LinkedErrors"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpContext", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["HttpContext"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dedupe", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["Dedupe"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Integrations", function() { return _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["Integrations"]; }); + +/* harmony import */ var _sdk_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Lw/n"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "init", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_1__["init"]; }); + +/* harmony import */ var _profiler_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("yiFY"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Profiler", function() { return _profiler_js__WEBPACK_IMPORTED_MODULE_2__["Profiler"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useProfiler", function() { return _profiler_js__WEBPACK_IMPORTED_MODULE_2__["useProfiler"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withProfiler", function() { return _profiler_js__WEBPACK_IMPORTED_MODULE_2__["withProfiler"]; }); + +/* harmony import */ var _errorboundary_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("8ckN"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorBoundary", function() { return _errorboundary_js__WEBPACK_IMPORTED_MODULE_3__["ErrorBoundary"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withErrorBoundary", function() { return _errorboundary_js__WEBPACK_IMPORTED_MODULE_3__["withErrorBoundary"]; }); + +/* harmony import */ var _redux_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("DWOc"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createReduxEnhancer", function() { return _redux_js__WEBPACK_IMPORTED_MODULE_4__["createReduxEnhancer"]; }); + +/* harmony import */ var _reactrouterv3_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("yL5O"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reactRouterV3Instrumentation", function() { return _reactrouterv3_js__WEBPACK_IMPORTED_MODULE_5__["reactRouterV3Instrumentation"]; }); + +/* harmony import */ var _reactrouter_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("/TIq"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reactRouterV4Instrumentation", function() { return _reactrouter_js__WEBPACK_IMPORTED_MODULE_6__["reactRouterV4Instrumentation"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reactRouterV5Instrumentation", function() { return _reactrouter_js__WEBPACK_IMPORTED_MODULE_6__["reactRouterV5Instrumentation"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withSentryRouting", function() { return _reactrouter_js__WEBPACK_IMPORTED_MODULE_6__["withSentryRouting"]; }); + +/* harmony import */ var _reactrouterv6_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("dwbj"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reactRouterV6Instrumentation", function() { return _reactrouterv6_js__WEBPACK_IMPORTED_MODULE_7__["reactRouterV6Instrumentation"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withSentryReactRouterV6Routing", function() { return _reactrouterv6_js__WEBPACK_IMPORTED_MODULE_7__["withSentryReactRouterV6Routing"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapUseRoutes", function() { return _reactrouterv6_js__WEBPACK_IMPORTED_MODULE_7__["wrapUseRoutes"]; }); + + + + + + + + + + +; +//# sourceMappingURL=index.js.map + + /***/ }), /***/ "ahmL": @@ -254649,6 +265712,119 @@ __webpack_require__.r(__webpack_exports__); }); +/***/ }), + +/***/ "bOYC": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return SDK_VERSION; }); +var SDK_VERSION = '6.19.7'; +//# sourceMappingURL=version.js.map + +/***/ }), + +/***/ "bQfG": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEnvelope", function() { return createEnvelope; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addItemToEnvelope", function() { return addItemToEnvelope; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeType", function() { return getEnvelopeType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serializeEnvelope", function() { return serializeEnvelope; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("4E6N"); + + +/** + * Creates an envelope. + * Make sure to always explicitly provide the generic to this function + * so that the envelope types resolve correctly. + */ +function createEnvelope(headers, items) { + if (items === void 0) { items = []; } + return [headers, items]; +} +/** + * Add an item to an envelope. + * Make sure to always explicitly provide the generic to this function + * so that the envelope types resolve correctly. + */ +function addItemToEnvelope(envelope, newItem) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(envelope, 2), headers = _a[0], items = _a[1]; + return [headers, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(items, [newItem])]; +} +/** + * Get the type of the envelope. Grabs the type from the first envelope item. + */ +function getEnvelopeType(envelope) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(envelope, 2), _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_a[1], 1), _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_b[0], 1), firstItemHeader = _c[0]; + return firstItemHeader.type; +} +/** + * Serializes an envelope into a string. + */ +function serializeEnvelope(envelope) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(envelope, 2), headers = _a[0], items = _a[1]; + var serializedHeaders = JSON.stringify(headers); + // Have to cast items to any here since Envelope is a union type + // Fixed in Typescript 4.2 + // TODO: Remove any[] cast when we upgrade to TS 4.2 + // https://github.com/microsoft/TypeScript/issues/36390 + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return items.reduce(function (acc, item) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(item, 2), itemHeaders = _a[0], payload = _a[1]; + // We do not serialize payloads that are primitives + var serializedPayload = Object(_is__WEBPACK_IMPORTED_MODULE_1__["isPrimitive"])(payload) ? String(payload) : JSON.stringify(payload); + return acc + "\n" + JSON.stringify(itemHeaders) + "\n" + serializedPayload; + }, serializedHeaders); +} +//# sourceMappingURL=envelope.js.map + +/***/ }), + +/***/ "bSWo": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_interopRequireWildcard", function() { return _interopRequireWildcard; }); +/** + * Adds a `default` property to CJS modules which aren't the result of transpilation from ESM modules. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * + * @param requireResult The result of calling `require` on a module + * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property + */ +function _interopRequireWildcard(requireResult) { + return requireResult.__esModule ? requireResult : { ...requireResult, default: requireResult }; +} + +// Sucrase version +// function _interopRequireWildcard(obj) { +// if (obj && obj.__esModule) { +// return obj; +// } else { +// var newObj = {}; +// if (obj != null) { +// for (var key in obj) { +// if (Object.prototype.hasOwnProperty.call(obj, key)) { +// newObj[key] = obj[key]; +// } +// } +// } +// newObj.default = obj; +// return newObj; +// } +// } + + +//# sourceMappingURL=_interopRequireWildcard.js.map + + /***/ }), /***/ "bUA0": @@ -254971,6 +266147,111 @@ $export($export.P + $export.F * !__webpack_require__("LyE8")([].map, true), 'Arr }); +/***/ }), + +/***/ "bXDU": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStackParser", function() { return createStackParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripSentryFramesAndReverse", function() { return stripSentryFramesAndReverse; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFunctionName", function() { return getFunctionName; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); + +var STACKTRACE_LIMIT = 50; +/** + * Creates a stack parser with the supplied line parsers + * + * StackFrames are returned in the correct order for Sentry Exception + * frames and with Sentry SDK internal frames removed from the top and bottom + * + */ +function createStackParser() { + var parsers = []; + for (var _i = 0; _i < arguments.length; _i++) { + parsers[_i] = arguments[_i]; + } + var sortedParsers = parsers.sort(function (a, b) { return a[0] - b[0]; }).map(function (p) { return p[1]; }); + return function (stack, skipFirst) { + var e_1, _a, e_2, _b; + if (skipFirst === void 0) { skipFirst = 0; } + var frames = []; + try { + for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(stack.split('\n').slice(skipFirst)), _d = _c.next(); !_d.done; _d = _c.next()) { + var line = _d.value; + try { + for (var sortedParsers_1 = (e_2 = void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(sortedParsers)), sortedParsers_1_1 = sortedParsers_1.next(); !sortedParsers_1_1.done; sortedParsers_1_1 = sortedParsers_1.next()) { + var parser = sortedParsers_1_1.value; + var frame = parser(line); + if (frame) { + frames.push(frame); + break; + } + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (sortedParsers_1_1 && !sortedParsers_1_1.done && (_b = sortedParsers_1.return)) _b.call(sortedParsers_1); + } + finally { if (e_2) throw e_2.error; } + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_d && !_d.done && (_a = _c.return)) _a.call(_c); + } + finally { if (e_1) throw e_1.error; } + } + return stripSentryFramesAndReverse(frames); + }; +} +/** + * @hidden + */ +function stripSentryFramesAndReverse(stack) { + if (!stack.length) { + return []; + } + var localStack = stack; + var firstFrameFunction = localStack[0].function || ''; + var lastFrameFunction = localStack[localStack.length - 1].function || ''; + // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call) + if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) { + localStack = localStack.slice(1); + } + // 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) + if (lastFrameFunction.indexOf('sentryWrapped') !== -1) { + localStack = localStack.slice(0, -1); + } + // The frame where the crash happened, should be the last entry in the array + return localStack + .slice(0, STACKTRACE_LIMIT) + .map(function (frame) { return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, frame), { filename: frame.filename || localStack[0].filename, function: frame.function || '?' })); }) + .reverse(); +} +var defaultFunctionName = '<anonymous>'; +/** + * Safely extract function name from itself + */ +function getFunctionName(fn) { + try { + if (!fn || typeof fn !== 'function') { + return defaultFunctionName; + } + return fn.name || defaultFunctionName; + } + catch (e) { + // Just accessing custom props in some Selenium environments + // can cause a "Permission denied" exception (see raven-js#495). + return defaultFunctionName; + } +} +//# sourceMappingURL=stacktrace.js.map + /***/ }), /***/ "bXiM": @@ -255430,6 +266711,120 @@ if (false) {} /* harmony default export */ __webpack_exports__["default"] = (Portal); +/***/ }), + +/***/ "bju/": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpanStatus", function() { return SpanStatus; }); +/** The status of an Span. + * + * @deprecated Use string literals - if you require type casting, cast to SpanStatusType type + */ +// eslint-disable-next-line import/export +var SpanStatus; (function (SpanStatus) { + /** The operation completed successfully. */ + const Ok = 'ok'; SpanStatus["Ok"] = Ok; + /** Deadline expired before operation could complete. */ + const DeadlineExceeded = 'deadline_exceeded'; SpanStatus["DeadlineExceeded"] = DeadlineExceeded; + /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */ + const Unauthenticated = 'unauthenticated'; SpanStatus["Unauthenticated"] = Unauthenticated; + /** 403 Forbidden */ + const PermissionDenied = 'permission_denied'; SpanStatus["PermissionDenied"] = PermissionDenied; + /** 404 Not Found. Some requested entity (file or directory) was not found. */ + const NotFound = 'not_found'; SpanStatus["NotFound"] = NotFound; + /** 429 Too Many Requests */ + const ResourceExhausted = 'resource_exhausted'; SpanStatus["ResourceExhausted"] = ResourceExhausted; + /** Client specified an invalid argument. 4xx. */ + const InvalidArgument = 'invalid_argument'; SpanStatus["InvalidArgument"] = InvalidArgument; + /** 501 Not Implemented */ + const Unimplemented = 'unimplemented'; SpanStatus["Unimplemented"] = Unimplemented; + /** 503 Service Unavailable */ + const Unavailable = 'unavailable'; SpanStatus["Unavailable"] = Unavailable; + /** Other/generic 5xx. */ + const InternalError = 'internal_error'; SpanStatus["InternalError"] = InternalError; + /** Unknown. Any non-standard HTTP status code. */ + const UnknownError = 'unknown_error'; SpanStatus["UnknownError"] = UnknownError; + /** The operation was cancelled (typically by the user). */ + const Cancelled = 'cancelled'; SpanStatus["Cancelled"] = Cancelled; + /** Already exists (409) */ + const AlreadyExists = 'already_exists'; SpanStatus["AlreadyExists"] = AlreadyExists; + /** Operation was rejected because the system is not in a state required for the operation's */ + const FailedPrecondition = 'failed_precondition'; SpanStatus["FailedPrecondition"] = FailedPrecondition; + /** The operation was aborted, typically due to a concurrency issue. */ + const Aborted = 'aborted'; SpanStatus["Aborted"] = Aborted; + /** Operation was attempted past the valid range. */ + const OutOfRange = 'out_of_range'; SpanStatus["OutOfRange"] = OutOfRange; + /** Unrecoverable data loss or corruption */ + const DataLoss = 'data_loss'; SpanStatus["DataLoss"] = DataLoss; +})(SpanStatus || (SpanStatus = {})); + + +//# sourceMappingURL=spanstatus.js.map + + +/***/ }), + +/***/ "bjvM": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initMetric", function() { return initMetric; }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Wezb"); +/* harmony import */ var _generateUniqueID_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("fJOi"); +/* harmony import */ var _getActivationStart_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("tVrE"); +/* harmony import */ var _getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("RGXi"); + + + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const initMetric = (name, value) => { + const navEntry = Object(_getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_3__["getNavigationEntry"])(); + let navigationType = 'navigate'; + + if (navEntry) { + if (_types_js__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].document.prerendering || Object(_getActivationStart_js__WEBPACK_IMPORTED_MODULE_2__["getActivationStart"])() > 0) { + navigationType = 'prerender'; + } else { + navigationType = navEntry.type.replace(/_/g, '-') ; + } + } + + return { + name, + value: typeof value === 'undefined' ? -1 : value, + rating: 'good', // Will be updated if the value changes. + delta: 0, + entries: [], + id: Object(_generateUniqueID_js__WEBPACK_IMPORTED_MODULE_1__["generateUniqueID"])(), + navigationType, + }; +}; + + +//# sourceMappingURL=initMetric.js.map + + /***/ }), /***/ "bkve": @@ -257806,6 +269201,122 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "c0vI": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SessionFlusher", function() { return SessionFlusher; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GIgW"); + + + +/** + * @inheritdoc + */ +class SessionFlusher { + __init() {this.flushTimeout = 60;} + __init2() {this._pendingAggregates = {};} + + __init3() {this._isEnabled = true;} + + constructor(client, attrs) {;SessionFlusher.prototype.__init.call(this);SessionFlusher.prototype.__init2.call(this);SessionFlusher.prototype.__init3.call(this); + this._client = client; + // Call to setInterval, so that flush is called every 60 seconds + this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000); + this._sessionAttrs = attrs; + } + + /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */ + flush() { + const sessionAggregates = this.getSessionAggregates(); + if (sessionAggregates.aggregates.length === 0) { + return; + } + this._pendingAggregates = {}; + this._client.sendSession(sessionAggregates); + } + + /** Massages the entries in `pendingAggregates` and returns aggregated sessions */ + getSessionAggregates() { + const aggregates = Object.keys(this._pendingAggregates).map((key) => { + return this._pendingAggregates[parseInt(key)]; + }); + + const sessionAggregates = { + attrs: this._sessionAttrs, + aggregates, + }; + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dropUndefinedKeys"])(sessionAggregates); + } + + /** JSDoc */ + close() { + clearInterval(this._intervalId); + this._isEnabled = false; + this.flush(); + } + + /** + * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then + * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to + * `_incrementSessionStatusCount` along with the start date + */ + incrementSessionStatusCount() { + if (!this._isEnabled) { + return; + } + const scope = Object(_hub_js__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().getScope(); + const requestSession = scope && scope.getRequestSession(); + + if (requestSession && requestSession.status) { + this._incrementSessionStatusCount(requestSession.status, new Date()); + // This is not entirely necessarily but is added as a safe guard to indicate the bounds of a request and so in + // case captureRequestSession is called more than once to prevent double count + if (scope) { + scope.setRequestSession(undefined); + } + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + } + } + + /** + * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of + * the session received + */ + _incrementSessionStatusCount(status, date) { + // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys + const sessionStartedTrunc = new Date(date).setSeconds(0, 0); + this._pendingAggregates[sessionStartedTrunc] = this._pendingAggregates[sessionStartedTrunc] || {}; + + // corresponds to aggregated sessions in one specific minute bucket + // for example, {"started":"2021-03-16T08:00:00.000Z","exited":4, "errored": 1} + const aggregationCounts = this._pendingAggregates[sessionStartedTrunc]; + if (!aggregationCounts.started) { + aggregationCounts.started = new Date(sessionStartedTrunc).toISOString(); + } + + switch (status) { + case 'errored': + aggregationCounts.errored = (aggregationCounts.errored || 0) + 1; + return aggregationCounts.errored; + case 'ok': + aggregationCounts.exited = (aggregationCounts.exited || 0) + 1; + return aggregationCounts.exited; + default: + aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1; + return aggregationCounts.crashed; + } + } +} + + +//# sourceMappingURL=sessionflusher.js.map + + /***/ }), /***/ "c2zQ": @@ -260059,6 +271570,98 @@ exports.default = _default; /***/ }), +/***/ "cOvR": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserClient", function() { return BrowserClient; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Um2S"); +/* harmony import */ var _backend__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("dBAl"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("dO1v"); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("WMn2"); +/* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("YjZj"); + + + + + + + +/** + * The Sentry Browser SDK Client. + * + * @see BrowserOptions for documentation on configuration options. + * @see SentryClient for usage documentation. + */ +var BrowserClient = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BrowserClient, _super); + /** + * Creates a new Browser SDK instance. + * + * @param options Configuration options for this SDK. + */ + function BrowserClient(options) { + if (options === void 0) { options = {}; } + var _this = this; + options._metadata = options._metadata || {}; + options._metadata.sdk = options._metadata.sdk || { + name: 'sentry.javascript.browser', + packages: [ + { + name: 'npm:@sentry/browser', + version: _sentry_core__WEBPACK_IMPORTED_MODULE_1__["SDK_VERSION"], + }, + ], + version: _sentry_core__WEBPACK_IMPORTED_MODULE_1__["SDK_VERSION"], + }; + _this = _super.call(this, _backend__WEBPACK_IMPORTED_MODULE_3__["BrowserBackend"], options) || this; + return _this; + } + /** + * Show a report dialog to the user to send feedback to a specific event. + * + * @param options Set individual options for the dialog + */ + BrowserClient.prototype.showReportDialog = function (options) { + if (options === void 0) { options = {}; } + // doesn't work without a document (React Native) + var document = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])().document; + if (!document) { + return; + } + if (!this._isEnabled()) { + _flags__WEBPACK_IMPORTED_MODULE_4__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].error('Trying to call showReportDialog with Sentry Client disabled'); + return; + } + Object(_helpers__WEBPACK_IMPORTED_MODULE_5__["injectReportDialog"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, options), { dsn: options.dsn || this.getDsn() })); + }; + /** + * @inheritDoc + */ + BrowserClient.prototype._prepareEvent = function (event, scope, hint) { + event.platform = event.platform || 'javascript'; + return _super.prototype._prepareEvent.call(this, event, scope, hint); + }; + /** + * @inheritDoc + */ + BrowserClient.prototype._sendEvent = function (event) { + var integration = this.getIntegration(_integrations__WEBPACK_IMPORTED_MODULE_6__["Breadcrumbs"]); + if (integration) { + integration.addSentryBreadcrumb(event); + } + _super.prototype._sendEvent.call(this, event); + }; + return BrowserClient; +}(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["BaseClient"])); + +//# sourceMappingURL=client.js.map + +/***/ }), + /***/ "cPJV": /***/ (function(module, exports, __webpack_require__) { @@ -260392,6 +271995,134 @@ function addLeadingZeros (number, targetLength) { module.exports = format +/***/ }), + +/***/ "cRYb": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Apollo", function() { return Apollo; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("QXPM"); + + + + +/** Tracing integration for Apollo */ +class Apollo {constructor() { Apollo.prototype.__init.call(this); } + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Apollo';} + + /** + * @inheritDoc + */ + __init() {this.name = Apollo.id;} + + /** + * @inheritDoc + */ + setupOnce(_, getCurrentHub) { + const pkg = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["loadModule"]) + +('apollo-server-core'); + + if (!pkg) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Apollo Integration was unable to require apollo-server-core package.'); + return; + } + + if (Object(_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__["shouldDisableAutoInstrumentation"])(getCurrentHub)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('Apollo Integration is skipped because of instrumenter configuration.'); + return; + } + + /** + * Iterate over resolvers of the ApolloServer instance before schemas are constructed. + */ + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(pkg.ApolloServerBase.prototype, 'constructSchema', function (orig) { + return function () { + if (!this.config.resolvers) { + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + if (this.config.schema) { + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn( + 'Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.', + ); + } else if (this.config.modules) { + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn( + 'Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property.', + ); + } + + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Skipping tracing as no resolvers found on the `ApolloServer` instance.'); + } + + return orig.call(this); + } + + const resolvers = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["arrayify"])(this.config.resolvers); + + this.config.resolvers = resolvers.map(model => { + Object.keys(model).forEach(resolverGroupName => { + Object.keys(model[resolverGroupName]).forEach(resolverName => { + if (typeof model[resolverGroupName][resolverName] !== 'function') { + return; + } + + wrapResolver(model, resolverGroupName, resolverName, getCurrentHub); + }); + }); + + return model; + }); + + return orig.call(this); + }; + }); + } +}Apollo.__initStatic(); + +/** + * Wrap a single resolver which can be a parent of other resolvers and/or db operations. + */ +function wrapResolver( + model, + resolverGroupName, + resolverName, + getCurrentHub, +) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(model[resolverGroupName], resolverName, function (orig) { + return function ( ...args) { + const scope = getCurrentHub().getScope(); + const parentSpan = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]); + const span = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({ + description: `${resolverGroupName}.${resolverName}`, + op: 'graphql.resolve', + })]); + + const rv = orig.call(this, ...args); + + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isThenable"])(rv)) { + return rv.then((res) => { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]); + return res; + }); + } + + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]); + + return rv; + }; + }); +} + + +//# sourceMappingURL=apollo.js.map + + /***/ }), /***/ "cSvM": @@ -261258,6 +272989,293 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "crS0": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_TRACE_PROPAGATION_TARGETS", function() { return DEFAULT_TRACE_PROPAGATION_TARGETS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultRequestInstrumentationOptions", function() { return defaultRequestInstrumentationOptions; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchCallback", function() { return fetchCallback; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "instrumentOutgoingRequests", function() { return instrumentOutgoingRequests; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldAttachHeaders", function() { return shouldAttachHeaders; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "xhrCallback", function() { return xhrCallback; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("FGHR"); + + + +const DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\//]; + +/** Options for Request Instrumentation */ + +const defaultRequestInstrumentationOptions = { + traceFetch: true, + traceXHR: true, + // TODO (v8): Remove this property + tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS, + tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS, +}; + +/** Registers span creators for xhr and fetch requests */ +function instrumentOutgoingRequests(_options) { + // eslint-disable-next-line deprecation/deprecation + const { traceFetch, traceXHR, tracingOrigins, tracePropagationTargets, shouldCreateSpanForRequest } = { + traceFetch: defaultRequestInstrumentationOptions.traceFetch, + traceXHR: defaultRequestInstrumentationOptions.traceXHR, + ..._options, + }; + + const shouldCreateSpan = + typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_) => true; + + const shouldAttachHeadersWithTargets = (url) => + shouldAttachHeaders(url, tracingOrigins, tracePropagationTargets); + + const spans = {}; + + if (traceFetch) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["addInstrumentationHandler"])('fetch', (handlerData) => { + fetchCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans); + }); + } + + if (traceXHR) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["addInstrumentationHandler"])('xhr', (handlerData) => { + xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans); + }); + } +} + +/** + * A function that determines whether to attach tracing headers to a request. + * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders. + * We only export this fuction for testing purposes. + * + * TODO (v8): Remove `tracingOrigins` which should drastically simplify this function. + */ +function shouldAttachHeaders( + url, + tracePropagationTargets, + tracingOrigins, +) { + // TODO (v8): Replace the entire code below with this one-liner: + // return stringMatchesSomePattern(url, tracePropagationTargets || DEFAULT_TRACE_PROPAGATION_TARGETS); + if (tracePropagationTargets || tracingOrigins) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["stringMatchesSomePattern"])(url, tracePropagationTargets || tracingOrigins); + } + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["stringMatchesSomePattern"])(url, DEFAULT_TRACE_PROPAGATION_TARGETS); +} + +/** + * Create and track fetch request spans + */ +function fetchCallback( + handlerData, + shouldCreateSpan, + shouldAttachHeaders, + spans, +) { + if (!Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__["hasTracingEnabled"])() || !(handlerData.fetchData && shouldCreateSpan(handlerData.fetchData.url))) { + return; + } + + if (handlerData.endTimestamp) { + const spanId = handlerData.fetchData.__span; + if (!spanId) return; + + const span = spans[spanId]; + if (span) { + if (handlerData.response) { + // TODO (kmclb) remove this once types PR goes through + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + span.setHttpStatus(handlerData.response.status); + } else if (handlerData.error) { + span.setStatus('internal_error'); + } + span.finish(); + + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete spans[spanId]; + } + return; + } + + const activeTransaction = Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__["getActiveTransaction"])(); + if (activeTransaction) { + const span = activeTransaction.startChild({ + data: { + ...handlerData.fetchData, + type: 'fetch', + }, + description: `${handlerData.fetchData.method} ${handlerData.fetchData.url}`, + op: 'http.client', + }); + + handlerData.fetchData.__span = span.spanId; + spans[span.spanId] = span; + + const request = handlerData.args[0]; + + // In case the user hasn't set the second argument of a fetch call we default it to `{}`. + handlerData.args[1] = handlerData.args[1] || {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const options = handlerData.args[1]; + + if (shouldAttachHeaders(handlerData.fetchData.url)) { + options.headers = addTracingHeadersToFetchRequest( + request, + activeTransaction.getDynamicSamplingContext(), + span, + options, + ); + + activeTransaction.metadata.propagations += 1; + } + } +} + +function addTracingHeadersToFetchRequest( + request, + dynamicSamplingContext, + span, + options + +, +) { + const sentryBaggageHeader = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dynamicSamplingContextToSentryBaggageHeader"])(dynamicSamplingContext); + const sentryTraceHeader = span.toTraceparent(); + + const headers = + typeof Request !== 'undefined' && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isInstanceOf"])(request, Request) ? (request ).headers : options.headers; + + if (!headers) { + return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader }; + } else if (typeof Headers !== 'undefined' && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isInstanceOf"])(headers, Headers)) { + const newHeaders = new Headers(headers ); + + newHeaders.append('sentry-trace', sentryTraceHeader); + + if (sentryBaggageHeader) { + // If the same header is appended miultiple times the browser will merge the values into a single request header. + // Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header. + newHeaders.append(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["BAGGAGE_HEADER_NAME"], sentryBaggageHeader); + } + + return newHeaders ; + } else if (Array.isArray(headers)) { + const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]]; + + if (sentryBaggageHeader) { + // If there are multiple entries with the same key, the browser will merge the values into a single request header. + // Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header. + newHeaders.push([_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["BAGGAGE_HEADER_NAME"], sentryBaggageHeader]); + } + + return newHeaders; + } else { + const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined; + const newBaggageHeaders = []; + + if (Array.isArray(existingBaggageHeader)) { + newBaggageHeaders.push(...existingBaggageHeader); + } else if (existingBaggageHeader) { + newBaggageHeaders.push(existingBaggageHeader); + } + + if (sentryBaggageHeader) { + newBaggageHeaders.push(sentryBaggageHeader); + } + + return { + ...(headers ), + 'sentry-trace': sentryTraceHeader, + baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined, + }; + } +} + +/** + * Create and track xhr request spans + */ +function xhrCallback( + handlerData, + shouldCreateSpan, + shouldAttachHeaders, + spans, +) { + if ( + !Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__["hasTracingEnabled"])() || + (handlerData.xhr && handlerData.xhr.__sentry_own_request__) || + !(handlerData.xhr && handlerData.xhr.__sentry_xhr__ && shouldCreateSpan(handlerData.xhr.__sentry_xhr__.url)) + ) { + return; + } + + const xhr = handlerData.xhr.__sentry_xhr__; + + // check first if the request has finished and is tracked by an existing span which should now end + if (handlerData.endTimestamp) { + const spanId = handlerData.xhr.__sentry_xhr_span_id__; + if (!spanId) return; + + const span = spans[spanId]; + if (span) { + span.setHttpStatus(xhr.status_code); + span.finish(); + + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete spans[spanId]; + } + return; + } + + // if not, create a new span to track it + const activeTransaction = Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__["getActiveTransaction"])(); + if (activeTransaction) { + const span = activeTransaction.startChild({ + data: { + ...xhr.data, + type: 'xhr', + method: xhr.method, + url: xhr.url, + }, + description: `${xhr.method} ${xhr.url}`, + op: 'http.client', + }); + + handlerData.xhr.__sentry_xhr_span_id__ = span.spanId; + spans[handlerData.xhr.__sentry_xhr_span_id__] = span; + + if (handlerData.xhr.setRequestHeader && shouldAttachHeaders(handlerData.xhr.__sentry_xhr__.url)) { + try { + handlerData.xhr.setRequestHeader('sentry-trace', span.toTraceparent()); + + const dynamicSamplingContext = activeTransaction.getDynamicSamplingContext(); + const sentryBaggageHeader = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dynamicSamplingContextToSentryBaggageHeader"])(dynamicSamplingContext); + + if (sentryBaggageHeader) { + // From MDN: "If this method is called several times with the same header, the values are merged into one single request header." + // We can therefore simply set a baggage header without checking what was there before + // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader + handlerData.xhr.setRequestHeader(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["BAGGAGE_HEADER_NAME"], sentryBaggageHeader); + } + + activeTransaction.metadata.propagations += 1; + } catch (_) { + // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED. + } + } + } +} + + +//# sourceMappingURL=request.js.map + + /***/ }), /***/ "crfB": @@ -264332,6 +276350,78 @@ if (true) { /***/ }), +/***/ "dBAl": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserBackend", function() { return BrowserBackend; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("PIsB"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Um2S"); +/* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("rcEJ"); +/* harmony import */ var _transports__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("o8nw"); + + + + + + +/** + * The Sentry Browser SDK Backend. + * @hidden + */ +var BrowserBackend = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BrowserBackend, _super); + function BrowserBackend() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @inheritDoc + */ + BrowserBackend.prototype.eventFromException = function (exception, hint) { + return Object(_eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromException"])(exception, hint, this._options.attachStacktrace); + }; + /** + * @inheritDoc + */ + BrowserBackend.prototype.eventFromMessage = function (message, level, hint) { + if (level === void 0) { level = _sentry_types__WEBPACK_IMPORTED_MODULE_2__["Severity"].Info; } + return Object(_eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromMessage"])(message, level, hint, this._options.attachStacktrace); + }; + /** + * @inheritDoc + */ + BrowserBackend.prototype._setupTransport = function () { + if (!this._options.dsn) { + // We return the noop transport here in case there is no Dsn. + return _super.prototype._setupTransport.call(this); + } + var transportOptions = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, this._options.transportOptions), { dsn: this._options.dsn, tunnel: this._options.tunnel, sendClientReports: this._options.sendClientReports, _metadata: this._options._metadata }); + var api = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["initAPIDetails"])(transportOptions.dsn, transportOptions._metadata, transportOptions.tunnel); + var url = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getEnvelopeEndpointWithUrlEncodedAuth"])(api.dsn, api.tunnel); + if (this._options.transport) { + return new this._options.transport(transportOptions); + } + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["supportsFetch"])()) { + var requestOptions = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, transportOptions.fetchParameters); + this._newTransport = Object(_transports__WEBPACK_IMPORTED_MODULE_5__["makeNewFetchTransport"])({ requestOptions: requestOptions, url: url }); + return new _transports__WEBPACK_IMPORTED_MODULE_5__["FetchTransport"](transportOptions); + } + this._newTransport = Object(_transports__WEBPACK_IMPORTED_MODULE_5__["makeNewXHRTransport"])({ + url: url, + headers: transportOptions.headers, + }); + return new _transports__WEBPACK_IMPORTED_MODULE_5__["XHRTransport"](transportOptions); + }; + return BrowserBackend; +}(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["BaseBackend"])); + +//# sourceMappingURL=backend.js.map + +/***/ }), + /***/ "dClt": /***/ (function(module, exports, __webpack_require__) { @@ -264808,6 +276898,31 @@ function findKey(object, predicate) { module.exports = findKey; +/***/ }), + +/***/ "dO1v": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IS_DEBUG_BUILD", function() { return IS_DEBUG_BUILD; }); +/* + * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking + * for users. + * + * Debug flags need to be declared in each package individually and must not be imported across package boundaries, + * because some build tools have trouble tree-shaking imported guards. + * + * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder. + * + * Debug flag files will contain "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during + * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not + * replaced. + */ +/** Flag that is true for debug builds, false otherwise. */ +var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__; +//# sourceMappingURL=flags.js.map + /***/ }), /***/ "dPRQ": @@ -265667,6 +277782,36 @@ __webpack_require__.r(__webpack_exports__); }); +/***/ }), + +/***/ "dWpK": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_createNamedExportFrom", function() { return _createNamedExportFrom; }); +/** + * Copy a property from the given object into `exports`, under the given name. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * + * @param obj The object containing the property to copy. + * @param localName The name under which to export the property + * @param importedName The name under which the property lives in `obj` + */ +function _createNamedExportFrom(obj, localName, importedName) { + exports[localName] = obj[importedName]; +} + +// Sucrase version: +// function _createNamedExportFrom(obj, localName, importedName) { +// Object.defineProperty(exports, localName, {enumerable: true, get: () => obj[importedName]}); +// } + + +//# sourceMappingURL=_createNamedExportFrom.js.map + + /***/ }), /***/ "dZ+Y": @@ -267983,6 +280128,108 @@ function baseExtremum(array, iteratee, comparator) { module.exports = baseExtremum; +/***/ }), + +/***/ "dvB7": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makePromiseBuffer", function() { return makePromiseBuffer; }); +/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ZJ+v"); +/* harmony import */ var _syncpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("exQi"); + + +/** + * Creates an new PromiseBuffer object with the specified limit + * @param limit max number of promises that can be stored in the buffer + */ +function makePromiseBuffer(limit) { + var buffer = []; + function isReady() { + return limit === undefined || buffer.length < limit; + } + /** + * Remove a promise from the queue. + * + * @param task Can be any PromiseLike<T> + * @returns Removed promise. + */ + function remove(task) { + return buffer.splice(buffer.indexOf(task), 1)[0]; + } + /** + * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment. + * + * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task: + * PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor + * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By + * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer + * limit check. + * @returns The original promise. + */ + function add(taskProducer) { + if (!isReady()) { + return Object(_syncpromise__WEBPACK_IMPORTED_MODULE_1__["rejectedSyncPromise"])(new _error__WEBPACK_IMPORTED_MODULE_0__["SentryError"]('Not adding Promise due to buffer limit reached.')); + } + // start the task and add its promise to the queue + var task = taskProducer(); + if (buffer.indexOf(task) === -1) { + buffer.push(task); + } + void task + .then(function () { return remove(task); }) + // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike` + // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't + // have promises, so TS has to polyfill when down-compiling.) + .then(null, function () { + return remove(task).then(null, function () { + // We have to add another catch here because `remove()` starts a new promise chain. + }); + }); + return task; + } + /** + * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or + * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to + * `true`. + * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and + * `false` otherwise + */ + function drain(timeout) { + return new _syncpromise__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"](function (resolve, reject) { + var counter = buffer.length; + if (!counter) { + return resolve(true); + } + // wait for `timeout` ms and then resolve to `false` (if not cancelled first) + var capturedSetTimeout = setTimeout(function () { + if (timeout && timeout > 0) { + resolve(false); + } + }, timeout); + // if all promises resolve in time, cancel the timer and resolve to `true` + buffer.forEach(function (item) { + void Object(_syncpromise__WEBPACK_IMPORTED_MODULE_1__["resolvedSyncPromise"])(item).then(function () { + // eslint-disable-next-line no-plusplus + if (!--counter) { + clearTimeout(capturedSetTimeout); + resolve(true); + } + }, reject); + }); + }); + } + return { + $: buffer, + add: add, + drain: drain, + }; +} +//# sourceMappingURL=promisebuffer.js.map + /***/ }), /***/ "dvhP": @@ -268002,6 +280249,258 @@ module.exports = { } +/***/ }), + +/***/ "dwbj": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reactRouterV6Instrumentation", function() { return reactRouterV6Instrumentation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withSentryReactRouterV6Routing", function() { return withSentryReactRouterV6Routing; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapUseRoutes", function() { return wrapUseRoutes; }); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("WSEr"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("2mql"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("q1tI"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); + + + + + +const _jsxFileName = "/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/reactrouterv6.tsx";// Inspired from Donnie McNeal's solution: + +let activeTransaction; + +let _useEffect; +let _useLocation; +let _useNavigationType; +let _createRoutesFromChildren; +let _matchRoutes; +let _customStartTransaction; +let _startTransactionOnLocationChange; + +const SENTRY_TAGS = { + 'routing.instrumentation': 'react-router-v6', +}; + +function reactRouterV6Instrumentation( + useEffect, + useLocation, + useNavigationType, + createRoutesFromChildren, + matchRoutes, +) { + return ( + customStartTransaction, + startTransactionOnPageLoad = true, + startTransactionOnLocationChange = true, + ) => { + const initPathName = _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["WINDOW"] && _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].location && _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].location.pathname; + if (startTransactionOnPageLoad && initPathName) { + activeTransaction = customStartTransaction({ + name: initPathName, + op: 'pageload', + tags: SENTRY_TAGS, + metadata: { + source: 'url', + }, + }); + } + + _useEffect = useEffect; + _useLocation = useLocation; + _useNavigationType = useNavigationType; + _matchRoutes = matchRoutes; + _createRoutesFromChildren = createRoutesFromChildren; + + _customStartTransaction = customStartTransaction; + _startTransactionOnLocationChange = startTransactionOnLocationChange; + }; +} + +function getNormalizedName( + routes, + location, + matchRoutes, +) { + if (!routes || routes.length === 0 || !matchRoutes) { + return [location.pathname, 'url']; + } + + const branches = matchRoutes(routes, location) ; + + let pathBuilder = ''; + if (branches) { + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let x = 0; x < branches.length; x++) { + const branch = branches[x]; + const route = branch.route; + if (route) { + // Early return if index route + if (route.index) { + return [branch.pathname, 'route']; + } + + const path = route.path; + if (path) { + const newPath = path[0] === '/' || pathBuilder[pathBuilder.length - 1] === '/' ? path : `/${path}`; + pathBuilder += newPath; + if (branch.pathname === location.pathname) { + if ( + // If the route defined on the element is something like + // <Route path="/stores/:storeId/products/:productId" element={<div>Product</div>} /> + // We should check against the branch.pathname for the number of / seperators + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getNumberOfUrlSegments"])(pathBuilder) !== Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getNumberOfUrlSegments"])(branch.pathname) && + // We should not count wildcard operators in the url segments calculation + pathBuilder.slice(-2) !== '/*' + ) { + return [newPath, 'route']; + } + return [pathBuilder, 'route']; + } + } + } + } + } + + return [location.pathname, 'url']; +} + +function updatePageloadTransaction(location, routes) { + if (activeTransaction) { + activeTransaction.setName(...getNormalizedName(routes, location, _matchRoutes)); + } +} + +function handleNavigation( + location, + routes, + navigationType, + isBaseLocation, +) { + if (isBaseLocation) { + if (activeTransaction) { + activeTransaction.finish(); + } + + return; + } + + if (_startTransactionOnLocationChange && (navigationType === 'PUSH' || navigationType === 'POP')) { + if (activeTransaction) { + activeTransaction.finish(); + } + + const [name, source] = getNormalizedName(routes, location, _matchRoutes); + activeTransaction = _customStartTransaction({ + name, + op: 'navigation', + tags: SENTRY_TAGS, + metadata: { + source, + }, + }); + } +} + +function withSentryReactRouterV6Routing(Routes) { + if ( + !_useEffect || + !_useLocation || + !_useNavigationType || + !_createRoutesFromChildren || + !_matchRoutes || + !_customStartTransaction + ) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters. + useEffect: ${_useEffect}. useLocation: ${_useLocation}. useNavigationType: ${_useNavigationType}. + createRoutesFromChildren: ${_createRoutesFromChildren}. matchRoutes: ${_matchRoutes}. customStartTransaction: ${_customStartTransaction}.`); + + return Routes; + } + + let isBaseLocation = false; + let routes; + + const SentryRoutes = (props) => { + const location = _useLocation(); + const navigationType = _useNavigationType(); + + _useEffect(() => { + // Performance concern: + // This is repeated when <Routes /> is rendered. + routes = _createRoutesFromChildren(props.children) ; + isBaseLocation = true; + + updatePageloadTransaction(location, routes); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [props.children]); + + _useEffect(() => { + handleNavigation(location, routes, navigationType, isBaseLocation); + }, [props.children, location, navigationType, isBaseLocation]); + + isBaseLocation = false; + + // @ts-ignore Setting more specific React Component typing for `R` generic above + // will break advanced type inference done by react router params + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Routes, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 249}} ); + }; + + hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2___default()(SentryRoutes, Routes); + + // @ts-ignore Setting more specific React Component typing for `R` generic above + // will break advanced type inference done by react router params + return SentryRoutes; +} + +function wrapUseRoutes(origUseRoutes) { + if (!_useEffect || !_useLocation || !_useNavigationType || !_matchRoutes || !_customStartTransaction) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn( + 'reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters.', + ); + + return origUseRoutes; + } + + let isBaseLocation = false; + + return (routes, location) => { + const SentryRoutes = (props) => { + const Routes = origUseRoutes(routes, location); + + const locationArgObject = typeof location === 'string' ? { pathname: location } : location; + const locationObject = (locationArgObject ) || _useLocation(); + const navigationType = _useNavigationType(); + + _useEffect(() => { + isBaseLocation = true; + + updatePageloadTransaction(locationObject, routes); + }, [props]); + + _useEffect(() => { + handleNavigation(locationObject, routes, navigationType, isBaseLocation); + }, [props, locationObject, navigationType, isBaseLocation]); + + isBaseLocation = false; + + return Routes; + }; + + return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(SentryRoutes, {__self: this, __source: {fileName: _jsxFileName, lineNumber: 294}} ); + }; +} + + +//# sourceMappingURL=reactrouterv6.js.map + + /***/ }), /***/ "dyZX": @@ -268015,6 +280514,40 @@ var global = module.exports = typeof window != 'undefined' && window.Math == Mat if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef +/***/ }), + +/***/ "e0PC": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoopTransport", function() { return NoopTransport; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Um2S"); + +/** Noop transport */ +var NoopTransport = /** @class */ (function () { + function NoopTransport() { + } + /** + * @inheritDoc + */ + NoopTransport.prototype.sendEvent = function (_) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["resolvedSyncPromise"])({ + reason: 'NoopTransport: Event has been skipped because no Dsn is configured.', + status: 'skipped', + }); + }; + /** + * @inheritDoc + */ + NoopTransport.prototype.close = function (_) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["resolvedSyncPromise"])(true); + }; + return NoopTransport; +}()); + +//# sourceMappingURL=noop.js.map + /***/ }), /***/ "e0ae": @@ -270820,6 +283353,160 @@ var OrganizationUserDetailsResponse = /*#__PURE__*/function (_OrganizationUserRe /***/ }), +/***/ "ehbI": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseTransport", function() { return BaseTransport; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Um2S"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("dO1v"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("6VZY"); + + + + + +function requestTypeToCategory(ty) { + var tyStr = ty; + return tyStr === 'event' ? 'error' : tyStr; +} +var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); +/** Base Transport class implementation */ +var BaseTransport = /** @class */ (function () { + function BaseTransport(options) { + var _this = this; + this.options = options; + /** A simple buffer holding all requests. */ + this._buffer = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["makePromiseBuffer"])(30); + /** Locks transport after receiving rate limits in a response */ + this._rateLimits = {}; + this._outcomes = {}; + this._api = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["initAPIDetails"])(options.dsn, options._metadata, options.tunnel); + // eslint-disable-next-line deprecation/deprecation + this.url = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getStoreEndpointWithUrlEncodedAuth"])(this._api.dsn); + if (this.options.sendClientReports && global.document) { + global.document.addEventListener('visibilitychange', function () { + if (global.document.visibilityState === 'hidden') { + _this._flushOutcomes(); + } + }); + } + } + /** + * @inheritDoc + */ + BaseTransport.prototype.sendEvent = function (event) { + return this._sendRequest(Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["eventToSentryRequest"])(event, this._api), event); + }; + /** + * @inheritDoc + */ + BaseTransport.prototype.sendSession = function (session) { + return this._sendRequest(Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["sessionToSentryRequest"])(session, this._api), session); + }; + /** + * @inheritDoc + */ + BaseTransport.prototype.close = function (timeout) { + return this._buffer.drain(timeout); + }; + /** + * @inheritDoc + */ + BaseTransport.prototype.recordLostEvent = function (reason, category) { + var _a; + if (!this.options.sendClientReports) { + return; + } + // We want to track each category (event, transaction, session) separately + // but still keep the distinction between different type of outcomes. + // We could use nested maps, but it's much easier to read and type this way. + // A correct type for map-based implementation if we want to go that route + // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>` + var key = requestTypeToCategory(category) + ":" + reason; + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log("Adding outcome: " + key); + this._outcomes[key] = (_a = this._outcomes[key], (_a !== null && _a !== void 0 ? _a : 0)) + 1; + }; + /** + * Send outcomes as an envelope + */ + BaseTransport.prototype._flushOutcomes = function () { + if (!this.options.sendClientReports) { + return; + } + var outcomes = this._outcomes; + this._outcomes = {}; + // Nothing to send + if (!Object.keys(outcomes).length) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log('No outcomes to flush'); + return; + } + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log("Flushing outcomes:\n" + JSON.stringify(outcomes, null, 2)); + var url = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getEnvelopeEndpointWithUrlEncodedAuth"])(this._api.dsn, this._api.tunnel); + var discardedEvents = Object.keys(outcomes).map(function (key) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(key.split(':'), 2), category = _a[0], reason = _a[1]; + return { + reason: reason, + category: category, + quantity: outcomes[key], + }; + // TODO: Improve types on discarded_events to get rid of cast + }); + var envelope = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["createClientReportEnvelope"])(discardedEvents, this._api.tunnel && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["dsnToString"])(this._api.dsn)); + try { + Object(_utils__WEBPACK_IMPORTED_MODULE_4__["sendReport"])(url, Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["serializeEnvelope"])(envelope)); + } + catch (e) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].error(e); + } + }; + /** + * Handle Sentry repsonse for promise-based transports. + */ + BaseTransport.prototype._handleResponse = function (_a) { + var requestType = _a.requestType, response = _a.response, headers = _a.headers, resolve = _a.resolve, reject = _a.reject; + var status = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["eventStatusFromHttpCode"])(response.status); + this._rateLimits = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["updateRateLimits"])(this._rateLimits, headers); + // eslint-disable-next-line deprecation/deprecation + if (this._isRateLimited(requestType)) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && + // eslint-disable-next-line deprecation/deprecation + _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn("Too many " + requestType + " requests, backing off until: " + this._disabledUntil(requestType)); + } + if (status === 'success') { + resolve({ status: status }); + return; + } + reject(response); + }; + /** + * Gets the time that given category is disabled until for rate limiting + * + * @deprecated Please use `disabledUntil` from @sentry/utils + */ + BaseTransport.prototype._disabledUntil = function (requestType) { + var category = requestTypeToCategory(requestType); + return new Date(Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["disabledUntil"])(this._rateLimits, category)); + }; + /** + * Checks if a category is rate limited + * + * @deprecated Please use `isRateLimited` from @sentry/utils + */ + BaseTransport.prototype._isRateLimited = function (requestType) { + var category = requestTypeToCategory(requestType); + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isRateLimited"])(this._rateLimits, category); + }; + return BaseTransport; +}()); + +//# sourceMappingURL=base.js.map + +/***/ }), + /***/ "eiff": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -271502,6 +284189,176 @@ var yellow = { /***/ }), +/***/ "exQi": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolvedSyncPromise", function() { return resolvedSyncPromise; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rejectedSyncPromise", function() { return rejectedSyncPromise; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyncPromise", function() { return SyncPromise; }); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("fUgN"); +/* eslint-disable @typescript-eslint/explicit-function-return-type */ +/* eslint-disable @typescript-eslint/typedef */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +/** + * Creates a resolved sync promise. + * + * @param value the value to resolve the promise with + * @returns the resolved sync promise + */ +function resolvedSyncPromise(value) { + return new SyncPromise(function (resolve) { + resolve(value); + }); +} +/** + * Creates a rejected sync promise. + * + * @param value the value to reject the promise with + * @returns the rejected sync promise + */ +function rejectedSyncPromise(reason) { + return new SyncPromise(function (_, reject) { + reject(reason); + }); +} +/** + * Thenable class that behaves like a Promise and follows it's interface + * but is not async internally + */ +var SyncPromise = /** @class */ (function () { + function SyncPromise(executor) { + var _this = this; + this._state = 0 /* PENDING */; + this._handlers = []; + /** JSDoc */ + this._resolve = function (value) { + _this._setResult(1 /* RESOLVED */, value); + }; + /** JSDoc */ + this._reject = function (reason) { + _this._setResult(2 /* REJECTED */, reason); + }; + /** JSDoc */ + this._setResult = function (state, value) { + if (_this._state !== 0 /* PENDING */) { + return; + } + if (Object(_is__WEBPACK_IMPORTED_MODULE_0__["isThenable"])(value)) { + void value.then(_this._resolve, _this._reject); + return; + } + _this._state = state; + _this._value = value; + _this._executeHandlers(); + }; + /** JSDoc */ + this._executeHandlers = function () { + if (_this._state === 0 /* PENDING */) { + return; + } + var cachedHandlers = _this._handlers.slice(); + _this._handlers = []; + cachedHandlers.forEach(function (handler) { + if (handler[0]) { + return; + } + if (_this._state === 1 /* RESOLVED */) { + // eslint-disable-next-line @typescript-eslint/no-floating-promises + handler[1](_this._value); + } + if (_this._state === 2 /* REJECTED */) { + handler[2](_this._value); + } + handler[0] = true; + }); + }; + try { + executor(this._resolve, this._reject); + } + catch (e) { + this._reject(e); + } + } + /** JSDoc */ + SyncPromise.prototype.then = function (onfulfilled, onrejected) { + var _this = this; + return new SyncPromise(function (resolve, reject) { + _this._handlers.push([ + false, + function (result) { + if (!onfulfilled) { + // TODO: ¯\_(ツ)_/¯ + // TODO: FIXME + resolve(result); + } + else { + try { + resolve(onfulfilled(result)); + } + catch (e) { + reject(e); + } + } + }, + function (reason) { + if (!onrejected) { + reject(reason); + } + else { + try { + resolve(onrejected(reason)); + } + catch (e) { + reject(e); + } + } + }, + ]); + _this._executeHandlers(); + }); + }; + /** JSDoc */ + SyncPromise.prototype.catch = function (onrejected) { + return this.then(function (val) { return val; }, onrejected); + }; + /** JSDoc */ + SyncPromise.prototype.finally = function (onfinally) { + var _this = this; + return new SyncPromise(function (resolve, reject) { + var val; + var isRejected; + return _this.then(function (value) { + isRejected = false; + val = value; + if (onfinally) { + onfinally(); + } + }, function (reason) { + isRejected = true; + val = reason; + if (onfinally) { + onfinally(); + } + }).then(function () { + if (isRejected) { + reject(val); + return; + } + resolve(val); + }); + }); + }; + return SyncPromise; +}()); + +//# sourceMappingURL=syncpromise.js.map + +/***/ }), + /***/ "eyMr": /***/ (function(module, exports, __webpack_require__) { @@ -272201,6 +285058,225 @@ var SendTextData = function SendTextData(data) { /***/ }), +/***/ "fFTy": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlobalHandlers", function() { return GlobalHandlers; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("PIsB"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Um2S"); +/* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("rcEJ"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("dO1v"); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("WMn2"); + +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ + + + + + + +/** Global handlers */ +var GlobalHandlers = /** @class */ (function () { + /** JSDoc */ + function GlobalHandlers(options) { + /** + * @inheritDoc + */ + this.name = GlobalHandlers.id; + /** + * Stores references functions to installing handlers. Will set to undefined + * after they have been run so that they are not used twice. + */ + this._installFunc = { + onerror: _installGlobalOnErrorHandler, + onunhandledrejection: _installGlobalOnUnhandledRejectionHandler, + }; + this._options = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ onerror: true, onunhandledrejection: true }, options); + } + /** + * @inheritDoc + */ + GlobalHandlers.prototype.setupOnce = function () { + Error.stackTraceLimit = 50; + var options = this._options; + // We can disable guard-for-in as we construct the options object above + do checks against + // `this._installFunc` for the property. + // eslint-disable-next-line guard-for-in + for (var key in options) { + var installFunc = this._installFunc[key]; + if (installFunc && options[key]) { + globalHandlerLog(key); + installFunc(); + this._installFunc[key] = undefined; + } + } + }; + /** + * @inheritDoc + */ + GlobalHandlers.id = 'GlobalHandlers'; + return GlobalHandlers; +}()); + +/** JSDoc */ +function _installGlobalOnErrorHandler() { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('error', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function (data) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(getHubAndAttachStacktrace(), 2), hub = _a[0], attachStacktrace = _a[1]; + if (!hub.getIntegration(GlobalHandlers)) { + return; + } + var msg = data.msg, url = data.url, line = data.line, column = data.column, error = data.error; + if (Object(_helpers__WEBPACK_IMPORTED_MODULE_6__["shouldIgnoreOnError"])() || (error && error.__sentry_own_request__)) { + return; + } + var event = error === undefined && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["isString"])(msg) + ? _eventFromIncompleteOnError(msg, url, line, column) + : _enhanceEventWithInitialFrame(Object(_eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromUnknownInput"])(error || msg, undefined, attachStacktrace, false), url, line, column); + event.level = _sentry_types__WEBPACK_IMPORTED_MODULE_2__["Severity"].Error; + addMechanismAndCapture(hub, error, event, 'onerror'); + }); +} +/** JSDoc */ +function _installGlobalOnUnhandledRejectionHandler() { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addInstrumentationHandler"])('unhandledrejection', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function (e) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(getHubAndAttachStacktrace(), 2), hub = _a[0], attachStacktrace = _a[1]; + if (!hub.getIntegration(GlobalHandlers)) { + return; + } + var error = e; + // dig the object of the rejection out of known event types + try { + // PromiseRejectionEvents store the object of the rejection under 'reason' + // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent + if ('reason' in e) { + error = e.reason; + } + // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents + // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into + // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec + // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and + // https://github.com/getsentry/sentry-javascript/issues/2380 + else if ('detail' in e && 'reason' in e.detail) { + error = e.detail.reason; + } + } + catch (_oO) { + // no-empty + } + if (Object(_helpers__WEBPACK_IMPORTED_MODULE_6__["shouldIgnoreOnError"])() || (error && error.__sentry_own_request__)) { + return true; + } + var event = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["isPrimitive"])(error) + ? _eventFromRejectionWithPrimitive(error) + : Object(_eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromUnknownInput"])(error, undefined, attachStacktrace, true); + event.level = _sentry_types__WEBPACK_IMPORTED_MODULE_2__["Severity"].Error; + addMechanismAndCapture(hub, error, event, 'onunhandledrejection'); + return; + }); +} +/** + * Create an event from a promise rejection where the `reason` is a primitive. + * + * @param reason: The `reason` property of the promise rejection + * @returns An Event object with an appropriate `exception` value + */ +function _eventFromRejectionWithPrimitive(reason) { + return { + exception: { + values: [ + { + type: 'UnhandledRejection', + // String() is needed because the Primitive type includes symbols (which can't be automatically stringified) + value: "Non-Error promise rejection captured with value: " + String(reason), + }, + ], + }, + }; +} +/** + * This function creates a stack from an old, error-less onerror handler. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _eventFromIncompleteOnError(msg, url, line, column) { + var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i; + // If 'message' is ErrorEvent, get real message from inside + var message = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["isErrorEvent"])(msg) ? msg.message : msg; + var name = 'Error'; + var groups = message.match(ERROR_TYPES_RE); + if (groups) { + name = groups[1]; + message = groups[2]; + } + var event = { + exception: { + values: [ + { + type: name, + value: message, + }, + ], + }, + }; + return _enhanceEventWithInitialFrame(event, url, line, column); +} +/** JSDoc */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function _enhanceEventWithInitialFrame(event, url, line, column) { + // event.exception + var e = (event.exception = event.exception || {}); + // event.exception.values + var ev = (e.values = e.values || []); + // event.exception.values[0] + var ev0 = (ev[0] = ev[0] || {}); + // event.exception.values[0].stacktrace + var ev0s = (ev0.stacktrace = ev0.stacktrace || {}); + // event.exception.values[0].stacktrace.frames + var ev0sf = (ev0s.frames = ev0s.frames || []); + var colno = isNaN(parseInt(column, 10)) ? undefined : column; + var lineno = isNaN(parseInt(line, 10)) ? undefined : line; + var filename = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["isString"])(url) && url.length > 0 ? url : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["getLocationHref"])(); + // event.exception.values[0].stacktrace.frames + if (ev0sf.length === 0) { + ev0sf.push({ + colno: colno, + filename: filename, + function: '?', + in_app: true, + lineno: lineno, + }); + } + return event; +} +function globalHandlerLog(type) { + _flags__WEBPACK_IMPORTED_MODULE_5__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_3__["logger"].log("Global Handler attached: " + type); +} +function addMechanismAndCapture(hub, error, event, type) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["addExceptionMechanism"])(event, { + handled: false, + type: type, + }); + hub.captureEvent(event, { + originalException: error, + }); +} +function getHubAndAttachStacktrace() { + var hub = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])(); + var client = hub.getClient(); + var attachStacktrace = client && client.getOptions().attachStacktrace; + return [hub, attachStacktrace]; +} +//# sourceMappingURL=globalhandlers.js.map + +/***/ }), + /***/ "fFza": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -272259,6 +285335,43 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "fJOi": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateUniqueID", function() { return generateUniqueID; }); +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Performantly generate a unique, 30-char string by combining a version + * number, the current timestamp with a 13-digit number integer. + * @return {string} + */ +const generateUniqueID = () => { + return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`; +}; + + +//# sourceMappingURL=generateUniqueID.js.map + + /***/ }), /***/ "fKYS": @@ -272414,6 +285527,65 @@ var EnpassCsvImporter = /*#__PURE__*/function (_BaseImporter) { return EnpassCsvImporter; }(_baseImporter__WEBPACK_IMPORTED_MODULE_5__["BaseImporter"]); +/***/ }), + +/***/ "fL16": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpContext", function() { return HttpContext; }); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("vzc1"); + + + +/** HttpContext integration collects information about HTTP request headers */ +class HttpContext {constructor() { HttpContext.prototype.__init.call(this); } + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'HttpContext';} + + /** + * @inheritDoc + */ + __init() {this.name = HttpContext.id;} + + /** + * @inheritDoc + */ + setupOnce() { + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["addGlobalEventProcessor"])((event) => { + if (Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().getIntegration(HttpContext)) { + // if none of the information we want exists, don't bother + if (!_helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].navigator && !_helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].location && !_helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].document) { + return event; + } + + // grab as much info as exists and add it to the event + const url = (event.request && event.request.url) || (_helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].location && _helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].location.href); + const { referrer } = _helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].document || {}; + const { userAgent } = _helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].navigator || {}; + + const headers = { + ...(event.request && event.request.headers), + ...(referrer && { Referer: referrer }), + ...(userAgent && { 'User-Agent': userAgent }), + }; + const request = { ...(url && { url }), headers }; + + return { ...event, request }; + } + return event; + }); + } +} HttpContext.__initStatic(); + + +//# sourceMappingURL=httpcontext.js.map + + /***/ }), /***/ "fN96": @@ -272464,6 +285636,23 @@ function baseGetAllKeys(object, keysFunc, symbolsFunc) { module.exports = baseGetAllKeys; +/***/ }), + +/***/ "fRnL": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _functiontostring__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("liIs"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionToString", function() { return _functiontostring__WEBPACK_IMPORTED_MODULE_0__["FunctionToString"]; }); + +/* harmony import */ var _inboundfilters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("z16J"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InboundFilters", function() { return _inboundfilters__WEBPACK_IMPORTED_MODULE_1__["InboundFilters"]; }); + + + +//# sourceMappingURL=index.js.map + /***/ }), /***/ "fSFK": @@ -272480,6 +285669,187 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "fUgN": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return isError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isErrorEvent", function() { return isErrorEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDOMError", function() { return isDOMError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDOMException", function() { return isDOMException; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPrimitive", function() { return isPrimitive; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return isPlainObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEvent", function() { return isEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return isElement; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return isRegExp; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isThenable", function() { return isThenable; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSyntheticEvent", function() { return isSyntheticEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return isNaN; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInstanceOf", function() { return isInstanceOf; }); +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +// eslint-disable-next-line @typescript-eslint/unbound-method +var objectToString = Object.prototype.toString; +/** + * Checks whether given value's type is one of a few Error or Error-like + * {@link isError}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +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, ty) { + return objectToString.call(wat) === "[object " + ty + "]"; +} +/** + * Checks whether given value's type is ErrorEvent + * {@link isErrorEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isErrorEvent(wat) { + return isBuiltin(wat, 'ErrorEvent'); +} +/** + * Checks whether given value's type is DOMError + * {@link isDOMError}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isDOMError(wat) { + return isBuiltin(wat, 'DOMError'); +} +/** + * Checks whether given value's type is DOMException + * {@link isDOMException}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isDOMException(wat) { + return isBuiltin(wat, 'DOMException'); +} +/** + * Checks whether given value's type is a string + * {@link isString}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isString(wat) { + return isBuiltin(wat, 'String'); +} +/** + * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol) + * {@link isPrimitive}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isPrimitive(wat) { + return wat === null || (typeof wat !== 'object' && typeof wat !== 'function'); +} +/** + * Checks whether given value's type is an object literal + * {@link isPlainObject}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isPlainObject(wat) { + return isBuiltin(wat, 'Object'); +} +/** + * Checks whether given value's type is an Event instance + * {@link isEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isEvent(wat) { + return typeof Event !== 'undefined' && isInstanceOf(wat, Event); +} +/** + * Checks whether given value's type is an Element instance + * {@link isElement}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isElement(wat) { + return typeof Element !== 'undefined' && isInstanceOf(wat, Element); +} +/** + * Checks whether given value's type is an regexp + * {@link isRegExp}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isRegExp(wat) { + return isBuiltin(wat, 'RegExp'); +} +/** + * Checks whether given value has a then function. + * @param wat A value to be checked. + */ +function isThenable(wat) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return Boolean(wat && wat.then && typeof wat.then === 'function'); +} +/** + * Checks whether given value's type is a SyntheticEvent + * {@link isSyntheticEvent}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isSyntheticEvent(wat) { + return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat; +} +/** + * Checks whether given value is NaN + * {@link isNaN}. + * + * @param wat A value to be checked. + * @returns A boolean representing the result. + */ +function isNaN(wat) { + return typeof wat === 'number' && wat !== wat; +} +/** + * Checks whether given value's type is an instance of provided constructor. + * {@link isInstanceOf}. + * + * @param wat A value to be checked. + * @param base A constructor to be used in a check. + * @returns A boolean representing the result. + */ +function isInstanceOf(wat, base) { + try { + return wat instanceof base; + } + catch (_e) { + return false; + } +} +//# sourceMappingURL=is.js.map + /***/ }), /***/ "fXKp": @@ -272909,6 +286279,38 @@ var RememBearCsvImporter = /*#__PURE__*/function (_BaseImporter) { /***/ }), +/***/ "febk": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserBundle", function() { return isBrowserBundle; }); +/* + * This module exists for optimizations in the build process through rollup and terser. We define some global + * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these + * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will + * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to + * `logger` and preventing node-related code from appearing in browser bundles. + * + * Attention: + * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by + * users. These fags should live in their respective packages, as we identified user tooling (specifically webpack) + * having issues tree-shaking these constants across package boundaries. + * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want + * users to be able to shake away expressions that it guards. + */ +/** + * Figures out if we're building a browser bundle. + * + * @returns true if this is a browser bundle build. + */ +function isBrowserBundle() { + return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__; +} +//# sourceMappingURL=env.js.map + +/***/ }), + /***/ "fg8p": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -273730,6 +287132,75 @@ module.exports = __webpack_require__("jmDH") ? Object.defineProperties : functio }; +/***/ }), + +/***/ "fqQG": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_optionalChain", function() { return _optionalChain; }); +/** + * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, + * descriptors, and functions. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 + * + * @param ops Array result of expression conversion + * @returns The value of the expression + */ +function _optionalChain(ops) { + let lastAccessLHS = undefined; + let value = ops[0]; + let i = 1; + while (i < ops.length) { + const op = ops[i] ; + const fn = ops[i + 1] ; + i += 2; + // by checking for loose equality to `null`, we catch both `null` and `undefined` + if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { + // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it + return; + } + if (op === 'access' || op === 'optionalAccess') { + lastAccessLHS = value; + value = fn(value); + } else if (op === 'call' || op === 'optionalCall') { + value = fn((...args) => (value ).call(lastAccessLHS, ...args)); + lastAccessLHS = undefined; + } + } + return value; +} + +// Sucrase version +// function _optionalChain(ops) { +// let lastAccessLHS = undefined; +// let value = ops[0]; +// let i = 1; +// while (i < ops.length) { +// const op = ops[i]; +// const fn = ops[i + 1]; +// i += 2; +// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { +// return undefined; +// } +// if (op === 'access' || op === 'optionalAccess') { +// lastAccessLHS = value; +// value = fn(value); +// } else if (op === 'call' || op === 'optionalCall') { +// value = fn((...args) => value.call(lastAccessLHS, ...args)); +// lastAccessLHS = undefined; +// } +// } +// return value; +// } + + +//# sourceMappingURL=_optionalChain.js.map + + /***/ }), /***/ "frGm": @@ -274095,6 +287566,169 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "fs+D": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dateTimestampInSeconds", function() { return dateTimestampInSeconds; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestampInSeconds", function() { return timestampInSeconds; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestampWithMs", function() { return timestampWithMs; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "usingPerformanceAPI", function() { return usingPerformanceAPI; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_browserPerformanceTimeOriginMode", function() { return _browserPerformanceTimeOriginMode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "browserPerformanceTimeOrigin", function() { return browserPerformanceTimeOrigin; }); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ETVo"); +/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hnl7"); + + +/** + * A TimestampSource implementation for environments that do not support the Performance Web API natively. + * + * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier + * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It + * is more obvious to explain "why does my span have negative duration" than "why my spans have zero duration". + */ +var dateTimestampSource = { + nowSeconds: function () { return Date.now() / 1000; }, +}; +/** + * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not + * support the API. + * + * Wrapping the native API works around differences in behavior from different browsers. + */ +function getBrowserPerformance() { + var performance = Object(_global__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])().performance; + if (!performance || !performance.now) { + return undefined; + } + // Replace performance.timeOrigin with our own timeOrigin based on Date.now(). + // + // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin + + // performance.now() gives a date arbitrarily in the past. + // + // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is + // undefined. + // + // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to + // interact with data coming out of performance entries. + // + // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that + // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes + // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have + // observed skews that can be as long as days, weeks or months. + // + // See https://github.com/getsentry/sentry-javascript/issues/2590. + // + // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload + // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation + // transactions of long-lived web pages. + var timeOrigin = Date.now() - performance.now(); + return { + now: function () { return performance.now(); }, + timeOrigin: timeOrigin, + }; +} +/** + * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't + * implement the API. + */ +function getNodePerformance() { + try { + var perfHooks = Object(_node__WEBPACK_IMPORTED_MODULE_1__["dynamicRequire"])(module, 'perf_hooks'); + return perfHooks.performance; + } + catch (_) { + return undefined; + } +} +/** + * The Performance API implementation for the current platform, if available. + */ +var platformPerformance = Object(_node__WEBPACK_IMPORTED_MODULE_1__["isNodeEnv"])() ? getNodePerformance() : getBrowserPerformance(); +var timestampSource = platformPerformance === undefined + ? dateTimestampSource + : { + nowSeconds: function () { return (platformPerformance.timeOrigin + platformPerformance.now()) / 1000; }, + }; +/** + * Returns a timestamp in seconds since the UNIX epoch using the Date API. + */ +var dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource); +/** + * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the + * availability of the Performance API. + * + * See `usingPerformanceAPI` to test whether the Performance API is used. + * + * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is + * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The + * skew can grow to arbitrary amounts like days, weeks or months. + * See https://github.com/getsentry/sentry-javascript/issues/2590. + */ +var timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource); +// Re-exported with an old name for backwards-compatibility. +var timestampWithMs = timestampInSeconds; +/** + * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps. + */ +var usingPerformanceAPI = platformPerformance !== undefined; +/** + * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only. + */ +var _browserPerformanceTimeOriginMode; +/** + * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the + * performance API is available. + */ +var browserPerformanceTimeOrigin = (function () { + // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or + // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin + // data as reliable if they are within a reasonable threshold of the current time. + var performance = Object(_global__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])().performance; + if (!performance || !performance.now) { + _browserPerformanceTimeOriginMode = 'none'; + return undefined; + } + var threshold = 3600 * 1000; + var performanceNow = performance.now(); + var dateNow = Date.now(); + // if timeOrigin isn't available set delta to threshold so it isn't used + var timeOriginDelta = performance.timeOrigin + ? Math.abs(performance.timeOrigin + performanceNow - dateNow) + : threshold; + var timeOriginIsReliable = timeOriginDelta < threshold; + // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin + // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. + // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always + // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the + // Date API. + // eslint-disable-next-line deprecation/deprecation + var navigationStart = performance.timing && performance.timing.navigationStart; + var hasNavigationStart = typeof navigationStart === 'number'; + // if navigationStart isn't available set delta to threshold so it isn't used + var navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; + var navigationStartIsReliable = navigationStartDelta < threshold; + if (timeOriginIsReliable || navigationStartIsReliable) { + // Use the more reliable time origin + if (timeOriginDelta <= navigationStartDelta) { + _browserPerformanceTimeOriginMode = 'timeOrigin'; + return performance.timeOrigin; + } + else { + _browserPerformanceTimeOriginMode = 'navigationStart'; + return navigationStart; + } + } + // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date. + _browserPerformanceTimeOriginMode = 'dateNow'; + return dateNow; +})(); +//# sourceMappingURL=time.js.map +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("3UD+")(module))) + /***/ }), /***/ "fsL8": @@ -275971,6 +289605,547 @@ module.exports = Object.is || function is(x, y) { }; +/***/ }), + +/***/ "g8yS": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addInstrumentationHandler", function() { return addInstrumentationHandler; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("yCCt"); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ETVo"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("4E6N"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("1WlT"); +/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("VffJ"); +/* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("5w3M"); +/* harmony import */ var _supports__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("KbQE"); + + + + + + + + +var global = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); +/** + * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc. + * - Console API + * - Fetch API + * - XHR API + * - History API + * - DOM API (click/typing) + * - Error API + * - UnhandledRejection API + */ +var handlers = {}; +var instrumented = {}; +/** Instruments given API */ +function instrument(type) { + if (instrumented[type]) { + return; + } + instrumented[type] = true; + switch (type) { + case 'console': + instrumentConsole(); + break; + case 'dom': + instrumentDOM(); + break; + case 'xhr': + instrumentXHR(); + break; + case 'fetch': + instrumentFetch(); + break; + case 'history': + instrumentHistory(); + break; + case 'error': + instrumentError(); + break; + case 'unhandledrejection': + instrumentUnhandledRejection(); + break; + default: + _flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"] && _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].warn('unknown instrumentation type:', type); + return; + } +} +/** + * Add handler that will be called when given type of instrumentation triggers. + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addInstrumentationHandler(type, callback) { + handlers[type] = handlers[type] || []; + handlers[type].push(callback); + instrument(type); +} +/** JSDoc */ +function triggerHandlers(type, data) { + var e_1, _a; + if (!type || !handlers[type]) { + return; + } + try { + for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(handlers[type] || []), _c = _b.next(); !_c.done; _c = _b.next()) { + var handler = _c.value; + try { + handler(data); + } + catch (e) { + _flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"] && + _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].error("Error while triggering instrumentation handler.\nType: " + type + "\nName: " + Object(_stacktrace__WEBPACK_IMPORTED_MODULE_6__["getFunctionName"])(handler) + "\nError:", e); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } +} +/** JSDoc */ +function instrumentConsole() { + if (!('console' in global)) { + return; + } + _logger__WEBPACK_IMPORTED_MODULE_4__["CONSOLE_LEVELS"].forEach(function (level) { + if (!(level in global.console)) { + return; + } + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global.console, level, function (originalConsoleMethod) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + triggerHandlers('console', { args: args, level: level }); + // this fails for some browsers. :( + if (originalConsoleMethod) { + originalConsoleMethod.apply(global.console, args); + } + }; + }); + }); +} +/** JSDoc */ +function instrumentFetch() { + if (!Object(_supports__WEBPACK_IMPORTED_MODULE_7__["supportsNativeFetch"])()) { + return; + } + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global, 'fetch', function (originalFetch) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var handlerData = { + args: args, + fetchData: { + method: getFetchMethod(args), + url: getFetchUrl(args), + }, + startTimestamp: Date.now(), + }; + triggerHandlers('fetch', Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData)); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return originalFetch.apply(global, args).then(function (response) { + triggerHandlers('fetch', Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData), { endTimestamp: Date.now(), response: response })); + return response; + }, function (error) { + triggerHandlers('fetch', Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData), { endTimestamp: Date.now(), error: error })); + // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the sentry.javascript SDK caught an error invoking your application code. + // This is expected behavior and NOT indicative of a bug with sentry.javascript. + throw error; + }); + }; + }); +} +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/** Extract `method` from fetch call arguments */ +function getFetchMethod(fetchArgs) { + if (fetchArgs === void 0) { fetchArgs = []; } + if ('Request' in global && Object(_is__WEBPACK_IMPORTED_MODULE_3__["isInstanceOf"])(fetchArgs[0], Request) && fetchArgs[0].method) { + return String(fetchArgs[0].method).toUpperCase(); + } + if (fetchArgs[1] && fetchArgs[1].method) { + return String(fetchArgs[1].method).toUpperCase(); + } + return 'GET'; +} +/** Extract `url` from fetch call arguments */ +function getFetchUrl(fetchArgs) { + if (fetchArgs === void 0) { fetchArgs = []; } + if (typeof fetchArgs[0] === 'string') { + return fetchArgs[0]; + } + if ('Request' in global && Object(_is__WEBPACK_IMPORTED_MODULE_3__["isInstanceOf"])(fetchArgs[0], Request)) { + return fetchArgs[0].url; + } + return String(fetchArgs[0]); +} +/* eslint-enable @typescript-eslint/no-unsafe-member-access */ +/** JSDoc */ +function instrumentXHR() { + if (!('XMLHttpRequest' in global)) { + return; + } + var xhrproto = XMLHttpRequest.prototype; + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(xhrproto, 'open', function (originalOpen) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + // eslint-disable-next-line @typescript-eslint/no-this-alias + var xhr = this; + var url = args[1]; + var xhrInfo = (xhr.__sentry_xhr__ = { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + method: Object(_is__WEBPACK_IMPORTED_MODULE_3__["isString"])(args[0]) ? args[0].toUpperCase() : args[0], + url: args[1], + }); + // if Sentry key appears in URL, don't capture it as a request + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (Object(_is__WEBPACK_IMPORTED_MODULE_3__["isString"])(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) { + xhr.__sentry_own_request__ = true; + } + var onreadystatechangeHandler = function () { + if (xhr.readyState === 4) { + try { + // touching statusCode in some platforms throws + // an exception + xhrInfo.status_code = xhr.status; + } + catch (e) { + /* do nothing */ + } + triggerHandlers('xhr', { + args: args, + endTimestamp: Date.now(), + startTimestamp: Date.now(), + xhr: xhr, + }); + } + }; + if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') { + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(xhr, 'onreadystatechange', function (original) { + return function () { + var readyStateArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + readyStateArgs[_i] = arguments[_i]; + } + onreadystatechangeHandler(); + return original.apply(xhr, readyStateArgs); + }; + }); + } + else { + xhr.addEventListener('readystatechange', onreadystatechangeHandler); + } + return originalOpen.apply(xhr, args); + }; + }); + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(xhrproto, 'send', function (originalSend) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (this.__sentry_xhr__ && args[0] !== undefined) { + this.__sentry_xhr__.body = args[0]; + } + triggerHandlers('xhr', { + args: args, + startTimestamp: Date.now(), + xhr: this, + }); + return originalSend.apply(this, args); + }; + }); +} +var lastHref; +/** JSDoc */ +function instrumentHistory() { + if (!Object(_supports__WEBPACK_IMPORTED_MODULE_7__["supportsHistory"])()) { + return; + } + var oldOnPopState = global.onpopstate; + global.onpopstate = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var to = global.location.href; + // keep track of the current URL state, as we always receive only the updated state + var from = lastHref; + lastHref = to; + triggerHandlers('history', { + from: from, + to: to, + }); + if (oldOnPopState) { + // Apparently this can throw in Firefox when incorrectly implemented plugin is installed. + // https://github.com/getsentry/sentry-javascript/issues/3344 + // https://github.com/bugsnag/bugsnag-js/issues/469 + try { + return oldOnPopState.apply(this, args); + } + catch (_oO) { + // no-empty + } + } + }; + /** @hidden */ + function historyReplacementFunction(originalHistoryFunction) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var url = args.length > 2 ? args[2] : undefined; + if (url) { + // coerce to string (this is what pushState does) + var from = lastHref; + var to = String(url); + // keep track of the current URL state, as we always receive only the updated state + lastHref = to; + triggerHandlers('history', { + from: from, + to: to, + }); + } + return originalHistoryFunction.apply(this, args); + }; + } + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global.history, 'pushState', historyReplacementFunction); + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global.history, 'replaceState', historyReplacementFunction); +} +var debounceDuration = 1000; +var debounceTimerID; +var lastCapturedEvent; +/** + * Decide whether the current event should finish the debounce of previously captured one. + * @param previous previously captured event + * @param current event to be captured + */ +function shouldShortcircuitPreviousDebounce(previous, current) { + // If there was no previous event, it should always be swapped for the new one. + if (!previous) { + return true; + } + // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress. + if (previous.type !== current.type) { + return true; + } + try { + // If both events have the same type, it's still possible that actions were performed on different targets. + // e.g. 2 clicks on different buttons. + if (previous.target !== current.target) { + return true; + } + } + catch (e) { + // just accessing `target` property can throw an exception in some rare circumstances + // see: https://github.com/getsentry/sentry-javascript/issues/838 + } + // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_ + // to which an event listener was attached), we treat them as the same action, as we want to capture + // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box. + return false; +} +/** + * Decide whether an event should be captured. + * @param event event to be captured + */ +function shouldSkipDOMEvent(event) { + // We are only interested in filtering `keypress` events for now. + if (event.type !== 'keypress') { + return false; + } + try { + var target = event.target; + if (!target || !target.tagName) { + return true; + } + // Only consider keypress events on actual input elements. This will disregard keypresses targeting body + // e.g.tabbing through elements, hotkeys, etc. + if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) { + return false; + } + } + catch (e) { + // just accessing `target` property can throw an exception in some rare circumstances + // see: https://github.com/getsentry/sentry-javascript/issues/838 + } + return true; +} +/** + * Wraps addEventListener to capture UI breadcrumbs + * @param handler function that will be triggered + * @param globalListener indicates whether event was captured by the global event listener + * @returns wrapped breadcrumb events handler + * @hidden + */ +function makeDOMEventHandler(handler, globalListener) { + if (globalListener === void 0) { globalListener = false; } + return function (event) { + // It's possible this handler might trigger multiple times for the same + // event (e.g. event propagation through node ancestors). + // Ignore if we've already captured that event. + if (!event || lastCapturedEvent === event) { + return; + } + // We always want to skip _some_ events. + if (shouldSkipDOMEvent(event)) { + return; + } + var name = event.type === 'keypress' ? 'input' : event.type; + // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons. + if (debounceTimerID === undefined) { + handler({ + event: event, + name: name, + global: globalListener, + }); + lastCapturedEvent = event; + } + // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one. + // If that's the case, emit the previous event and store locally the newly-captured DOM event. + else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) { + handler({ + event: event, + name: name, + global: globalListener, + }); + lastCapturedEvent = event; + } + // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together. + clearTimeout(debounceTimerID); + debounceTimerID = global.setTimeout(function () { + debounceTimerID = undefined; + }, debounceDuration); + }; +} +/** JSDoc */ +function instrumentDOM() { + if (!('document' in global)) { + return; + } + // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom + // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before + // we instrument `addEventListener` so that we don't end up attaching this handler twice. + var triggerDOMHandler = triggerHandlers.bind(null, 'dom'); + var globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true); + global.document.addEventListener('click', globalDOMEventHandler, false); + global.document.addEventListener('keypress', globalDOMEventHandler, false); + // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled + // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That + // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler + // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still + // guaranteed to fire at least once.) + ['EventTarget', 'Node'].forEach(function (target) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + var proto = global[target] && global[target].prototype; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins + if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { + return; + } + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(proto, 'addEventListener', function (originalAddEventListener) { + return function (type, listener, options) { + if (type === 'click' || type == 'keypress') { + try { + var el = this; + var handlers_1 = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {}); + var handlerForType = (handlers_1[type] = handlers_1[type] || { refCount: 0 }); + if (!handlerForType.handler) { + var handler = makeDOMEventHandler(triggerDOMHandler); + handlerForType.handler = handler; + originalAddEventListener.call(this, type, handler, options); + } + handlerForType.refCount += 1; + } + catch (e) { + // Accessing dom properties is always fragile. + // Also allows us to skip `addEventListenrs` calls with no proper `this` context. + } + } + return originalAddEventListener.call(this, type, listener, options); + }; + }); + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(proto, 'removeEventListener', function (originalRemoveEventListener) { + return function (type, listener, options) { + if (type === 'click' || type == 'keypress') { + try { + var el = this; + var handlers_2 = el.__sentry_instrumentation_handlers__ || {}; + var handlerForType = handlers_2[type]; + if (handlerForType) { + handlerForType.refCount -= 1; + // If there are no longer any custom handlers of the current type on this element, we can remove ours, too. + if (handlerForType.refCount <= 0) { + originalRemoveEventListener.call(this, type, handlerForType.handler, options); + handlerForType.handler = undefined; + delete handlers_2[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete + } + // If there are no longer any custom handlers of any type on this element, cleanup everything. + if (Object.keys(handlers_2).length === 0) { + delete el.__sentry_instrumentation_handlers__; + } + } + } + catch (e) { + // Accessing dom properties is always fragile. + // Also allows us to skip `addEventListenrs` calls with no proper `this` context. + } + } + return originalRemoveEventListener.call(this, type, listener, options); + }; + }); + }); +} +var _oldOnErrorHandler = null; +/** JSDoc */ +function instrumentError() { + _oldOnErrorHandler = global.onerror; + global.onerror = function (msg, url, line, column, error) { + triggerHandlers('error', { + column: column, + error: error, + line: line, + msg: msg, + url: url, + }); + if (_oldOnErrorHandler) { + // eslint-disable-next-line prefer-rest-params + return _oldOnErrorHandler.apply(this, arguments); + } + return false; + }; +} +var _oldOnUnhandledRejectionHandler = null; +/** JSDoc */ +function instrumentUnhandledRejection() { + _oldOnUnhandledRejectionHandler = global.onunhandledrejection; + global.onunhandledrejection = function (e) { + triggerHandlers('unhandledrejection', e); + if (_oldOnUnhandledRejectionHandler) { + // eslint-disable-next-line prefer-rest-params + return _oldOnUnhandledRejectionHandler.apply(this, arguments); + } + return true; + }; +} +//# sourceMappingURL=instrument.js.map + /***/ }), /***/ "g99f": @@ -276244,6 +290419,118 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "gPYe": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_RETRY_AFTER", function() { return DEFAULT_RETRY_AFTER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseRetryAfterHeader", function() { return parseRetryAfterHeader; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disabledUntil", function() { return disabledUntil; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRateLimited", function() { return isRateLimited; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateRateLimits", function() { return updateRateLimits; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); + +var DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds +/** + * Extracts Retry-After value from the request header or returns default value + * @param header string representation of 'Retry-After' header + * @param now current unix timestamp + * + */ +function parseRetryAfterHeader(header, now) { + if (now === void 0) { now = Date.now(); } + var headerDelay = parseInt("" + header, 10); + if (!isNaN(headerDelay)) { + return headerDelay * 1000; + } + var headerDate = Date.parse("" + header); + if (!isNaN(headerDate)) { + return headerDate - now; + } + return DEFAULT_RETRY_AFTER; +} +/** + * Gets the time that given category is disabled until for rate limiting + */ +function disabledUntil(limits, category) { + return limits[category] || limits.all || 0; +} +/** + * Checks if a category is rate limited + */ +function isRateLimited(limits, category, now) { + if (now === void 0) { now = Date.now(); } + return disabledUntil(limits, category) > now; +} +/** + * Update ratelimits from incoming headers. + * Returns true if headers contains a non-empty rate limiting header. + */ +function updateRateLimits(limits, headers, now) { + var e_1, _a, e_2, _b; + if (now === void 0) { now = Date.now(); } + var updatedRateLimits = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, limits); + // "The name is case-insensitive." + // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get + var rateLimitHeader = headers['x-sentry-rate-limits']; + var retryAfterHeader = headers['retry-after']; + if (rateLimitHeader) { + try { + /** + * rate limit headers are of the form + * <header>,<header>,.. + * where each <header> is of the form + * <retry_after>: <categories>: <scope>: <reason_code> + * where + * <retry_after> is a delay in seconds + * <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form + * <category>;<category>;... + * <scope> is what's being limited (org, project, or key) - ignored by SDK + * <reason_code> is an arbitrary string like "org_quota" - ignored by SDK + */ + for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(rateLimitHeader.trim().split(',')), _d = _c.next(); !_d.done; _d = _c.next()) { + var limit = _d.value; + var parameters = limit.split(':', 2); + var headerDelay = parseInt(parameters[0], 10); + var delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default + if (!parameters[1]) { + updatedRateLimits.all = now + delay; + } + else { + try { + for (var _e = (e_2 = void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(parameters[1].split(';'))), _f = _e.next(); !_f.done; _f = _e.next()) { + var category = _f.value; + updatedRateLimits[category] = now + delay; + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (_f && !_f.done && (_b = _e.return)) _b.call(_e); + } + finally { if (e_2) throw e_2.error; } + } + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_d && !_d.done && (_a = _c.return)) _a.call(_c); + } + finally { if (e_1) throw e_1.error; } + } + } + else if (retryAfterHeader) { + updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now); + } + return updatedRateLimits; +} +//# sourceMappingURL=ratelimit.js.map + /***/ }), /***/ "gQ/p": @@ -279748,6 +294035,115 @@ function differenceInCalendarISOWeeks (dirtyDateLeft, dirtyDateRight) { module.exports = differenceInCalendarISOWeeks +/***/ }), + +/***/ "gu//": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseBackend", function() { return BaseBackend; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Um2S"); +/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("W/Py"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("OEZb"); +/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("4YnS"); +/* harmony import */ var _transports_noop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("e0PC"); + + + + + + +/** + * This is the base implemention of a Backend. + * @hidden + */ +var BaseBackend = /** @class */ (function () { + /** Creates a new backend instance. */ + function BaseBackend(options) { + this._options = options; + if (!this._options.dsn) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('No DSN provided, backend will not do anything.'); + } + this._transport = this._setupTransport(); + } + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + BaseBackend.prototype.eventFromException = function (_exception, _hint) { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SentryError"]('Backend has to implement `eventFromException` method'); + }; + /** + * @inheritDoc + */ + BaseBackend.prototype.eventFromMessage = function (_message, _level, _hint) { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SentryError"]('Backend has to implement `eventFromMessage` method'); + }; + /** + * @inheritDoc + */ + BaseBackend.prototype.sendEvent = function (event) { + // TODO(v7): Remove the if-else + if (this._newTransport && + this._options.dsn && + this._options._experiments && + this._options._experiments.newTransport) { + var api = Object(_api__WEBPACK_IMPORTED_MODULE_2__["initAPIDetails"])(this._options.dsn, this._options._metadata, this._options.tunnel); + var env = Object(_request__WEBPACK_IMPORTED_MODULE_4__["createEventEnvelope"])(event, api); + void this._newTransport.send(env).then(null, function (reason) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Error while sending event:', reason); + }); + } + else { + void this._transport.sendEvent(event).then(null, function (reason) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Error while sending event:', reason); + }); + } + }; + /** + * @inheritDoc + */ + BaseBackend.prototype.sendSession = function (session) { + if (!this._transport.sendSession) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn("Dropping session because custom transport doesn't implement sendSession"); + return; + } + // TODO(v7): Remove the if-else + if (this._newTransport && + this._options.dsn && + this._options._experiments && + this._options._experiments.newTransport) { + var api = Object(_api__WEBPACK_IMPORTED_MODULE_2__["initAPIDetails"])(this._options.dsn, this._options._metadata, this._options.tunnel); + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(Object(_request__WEBPACK_IMPORTED_MODULE_4__["createSessionEnvelope"])(session, api), 1), env = _a[0]; + void this._newTransport.send(env).then(null, function (reason) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Error while sending session:', reason); + }); + } + else { + void this._transport.sendSession(session).then(null, function (reason) { + _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Error while sending session:', reason); + }); + } + }; + /** + * @inheritDoc + */ + BaseBackend.prototype.getTransport = function () { + return this._transport; + }; + /** + * Sets up the transport so it can be used later to send requests. + */ + BaseBackend.prototype._setupTransport = function () { + return new _transports_noop__WEBPACK_IMPORTED_MODULE_5__["NoopTransport"](); + }; + return BaseBackend; +}()); + +//# sourceMappingURL=basebackend.js.map + /***/ }), /***/ "gub1": @@ -281026,6 +295422,72 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "hNpR": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVisibilityWatcher", function() { return getVisibilityWatcher; }); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Wezb"); +/* harmony import */ var _onHidden_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("6mNm"); + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +let firstHiddenTime = -1; + +const initHiddenTime = () => { + // If the document is hidden and not prerendering, assume it was always + // hidden and the page was loaded in the background. + return _types_js__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].document.visibilityState === 'hidden' && !_types_js__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].document.prerendering ? 0 : Infinity; +}; + +const trackChanges = () => { + // Update the time if/when the document becomes hidden. + Object(_onHidden_js__WEBPACK_IMPORTED_MODULE_1__["onHidden"])(({ timeStamp }) => { + firstHiddenTime = timeStamp; + }, true); +}; + +const getVisibilityWatcher = ( + +) => { + if (firstHiddenTime < 0) { + // If the document is hidden when this code runs, assume it was hidden + // since navigation start. This isn't a perfect heuristic, but it's the + // best we can do until an API is available to support querying past + // visibilityState. + firstHiddenTime = initHiddenTime(); + trackChanges(); + } + return { + get firstHiddenTime() { + return firstHiddenTime; + }, + }; +}; + + +//# sourceMappingURL=getVisibilityWatcher.js.map + + /***/ }), /***/ "hPIQ": @@ -284844,6 +299306,76 @@ module.exports = { } +/***/ }), + +/***/ "hnl7": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(process, module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeEnv", function() { return isNodeEnv; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dynamicRequire", function() { return dynamicRequire; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadModule", function() { return loadModule; }); +/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("febk"); +/** + * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, + * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. + */ + +/** + * Checks whether we're in the Node.js or Browser environment + * + * @returns Answer to given question + */ +function isNodeEnv() { + // explicitly check for browser bundles as those can be optimized statically + // by terser/rollup. + return (!Object(_env__WEBPACK_IMPORTED_MODULE_0__["isBrowserBundle"])() && + Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'); +} +/** + * Requires a module which is protected against bundler minification. + * + * @param request The module path to resolve + */ +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any +function dynamicRequire(mod, request) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return mod.require(request); +} +/** + * Helper for dynamically loading module that should work with linked dependencies. + * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))` + * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during + * build time. `require.resolve` is also not available in any other way, so we cannot create, + * a fake helper like we do with `dynamicRequire`. + * + * We always prefer to use local package, thus the value is not returned early from each `try/catch` block. + * That is to mimic the behavior of `require.resolve` exactly. + * + * @param moduleName module name to require + * @returns possibly required module + */ +function loadModule(moduleName) { + var mod; + try { + mod = dynamicRequire(module, moduleName); + } + catch (e) { + // no-empty + } + try { + var cwd = dynamicRequire(module, 'process').cwd; + mod = dynamicRequire(module, cwd() + "/node_modules/" + moduleName); + } + catch (e) { + // no-empty + } + return mod; +} +//# sourceMappingURL=node.js.map +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB"), __webpack_require__("3UD+")(module))) + /***/ }), /***/ "ho19": @@ -286085,61 +300617,6 @@ exports.default = _default; /***/ }), -/***/ "i1K8": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeNewXHRTransport", function() { return makeNewXHRTransport; }); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); - - -/** - * The DONE ready state for XmlHttpRequest - * - * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined - * (e.g. during testing, it is `undefined`) - * - * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState} - */ -var XHR_READYSTATE_DONE = 4; -/** - * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry. - */ -function makeNewXHRTransport(options) { - function makeRequest(request) { - return new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"](function (resolve, _reject) { - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = function () { - if (xhr.readyState === XHR_READYSTATE_DONE) { - var response = { - body: xhr.response, - headers: { - 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'), - 'retry-after': xhr.getResponseHeader('Retry-After'), - }, - reason: xhr.statusText, - statusCode: xhr.status, - }; - resolve(response); - } - }; - xhr.open('POST', options.url); - for (var header in options.headers) { - if (Object.prototype.hasOwnProperty.call(options.headers, header)) { - xhr.setRequestHeader(header, options.headers[header]); - } - } - xhr.send(request.body); - }); - } - return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["createTransport"])({ bufferSize: options.bufferSize }, makeRequest); -} -//# sourceMappingURL=new-xhr.js.map - -/***/ }), - /***/ "i1Lo": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -287128,6 +301605,108 @@ $export($export.S + $export.F * __webpack_require__("eeVq")(function () { }); +/***/ }), + +/***/ "iMtC": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makePromiseBuffer", function() { return makePromiseBuffer; }); +/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("3pfK"); +/* harmony import */ var _syncpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("88Rr"); + + +/** + * Creates an new PromiseBuffer object with the specified limit + * @param limit max number of promises that can be stored in the buffer + */ +function makePromiseBuffer(limit) { + var buffer = []; + function isReady() { + return limit === undefined || buffer.length < limit; + } + /** + * Remove a promise from the queue. + * + * @param task Can be any PromiseLike<T> + * @returns Removed promise. + */ + function remove(task) { + return buffer.splice(buffer.indexOf(task), 1)[0]; + } + /** + * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment. + * + * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task: + * PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor + * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By + * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer + * limit check. + * @returns The original promise. + */ + function add(taskProducer) { + if (!isReady()) { + return Object(_syncpromise__WEBPACK_IMPORTED_MODULE_1__["rejectedSyncPromise"])(new _error__WEBPACK_IMPORTED_MODULE_0__["SentryError"]('Not adding Promise due to buffer limit reached.')); + } + // start the task and add its promise to the queue + var task = taskProducer(); + if (buffer.indexOf(task) === -1) { + buffer.push(task); + } + void task + .then(function () { return remove(task); }) + // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike` + // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't + // have promises, so TS has to polyfill when down-compiling.) + .then(null, function () { + return remove(task).then(null, function () { + // We have to add another catch here because `remove()` starts a new promise chain. + }); + }); + return task; + } + /** + * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or + * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to + * `true`. + * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and + * `false` otherwise + */ + function drain(timeout) { + return new _syncpromise__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"](function (resolve, reject) { + var counter = buffer.length; + if (!counter) { + return resolve(true); + } + // wait for `timeout` ms and then resolve to `false` (if not cancelled first) + var capturedSetTimeout = setTimeout(function () { + if (timeout && timeout > 0) { + resolve(false); + } + }, timeout); + // if all promises resolve in time, cancel the timer and resolve to `true` + buffer.forEach(function (item) { + void Object(_syncpromise__WEBPACK_IMPORTED_MODULE_1__["resolvedSyncPromise"])(item).then(function () { + // eslint-disable-next-line no-plusplus + if (!--counter) { + clearTimeout(capturedSetTimeout); + resolve(true); + } + }, reject); + }); + }); + } + return { + $: buffer, + add: add, + drain: drain, + }; +} +//# sourceMappingURL=promisebuffer.js.map + /***/ }), /***/ "iPFw": @@ -289256,6 +303835,81 @@ PathContext.prototype = { }; +/***/ }), + +/***/ "im3G": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XHRTransport", function() { return XHRTransport; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Um2S"); +/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ehbI"); + + + +/** `XHR` based transport */ +var XHRTransport = /** @class */ (function (_super) { + Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(XHRTransport, _super); + function XHRTransport() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @param sentryRequest Prepared SentryRequest to be delivered + * @param originalPayload Original payload used to create SentryRequest + */ + XHRTransport.prototype._sendRequest = function (sentryRequest, originalPayload) { + var _this = this; + // eslint-disable-next-line deprecation/deprecation + if (this._isRateLimited(sentryRequest.type)) { + this.recordLostEvent('ratelimit_backoff', sentryRequest.type); + return Promise.reject({ + event: originalPayload, + type: sentryRequest.type, + // eslint-disable-next-line deprecation/deprecation + reason: "Transport for " + sentryRequest.type + " requests locked till " + this._disabledUntil(sentryRequest.type) + " due to too many requests.", + status: 429, + }); + } + return this._buffer + .add(function () { + return new _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SyncPromise"](function (resolve, reject) { + var request = new XMLHttpRequest(); + request.onreadystatechange = function () { + if (request.readyState === 4) { + var headers = { + 'x-sentry-rate-limits': request.getResponseHeader('X-Sentry-Rate-Limits'), + 'retry-after': request.getResponseHeader('Retry-After'), + }; + _this._handleResponse({ requestType: sentryRequest.type, response: request, headers: headers, resolve: resolve, reject: reject }); + } + }; + request.open('POST', sentryRequest.url); + for (var header in _this.options.headers) { + if (Object.prototype.hasOwnProperty.call(_this.options.headers, header)) { + request.setRequestHeader(header, _this.options.headers[header]); + } + } + request.send(sentryRequest.body); + }); + }) + .then(undefined, function (reason) { + // It's either buffer rejection or any other xhr/fetch error, which are treated as NetworkError. + if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["SentryError"]) { + _this.recordLostEvent('queue_overflow', sentryRequest.type); + } + else { + _this.recordLostEvent('network_error', sentryRequest.type); + } + throw reason; + }); + }; + return XHRTransport; +}(_base__WEBPACK_IMPORTED_MODULE_2__["BaseTransport"])); + +//# sourceMappingURL=xhr.js.map + /***/ }), /***/ "inTe": @@ -289696,6 +304350,109 @@ function animate(property, element, to) { /***/ }), +/***/ "irNY": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Integrations", function() { return INTEGRATIONS; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _exports__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("YaBN"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Severity", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["Severity"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["addBreadcrumb"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["captureException"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["captureEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["captureMessage"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["configureScope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["getHubFromCarrier"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["Hub"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["makeMain"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["Scope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Session", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["Session"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["startTransaction"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["SDK_VERSION"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setContext"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setExtra"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setExtras"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setTag"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setTags"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["setUser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["withScope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrowserClient", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["BrowserClient"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "injectReportDialog", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["injectReportDialog"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventFromException", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["eventFromException"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventFromMessage", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["eventFromMessage"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIntegrations", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["defaultIntegrations"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceLoad", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["forceLoad"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "init", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["init"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastEventId", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["lastEventId"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["onLoad"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showReportDialog", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["showReportDialog"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["flush"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "close", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["close"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["wrap"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_NAME", function() { return _exports__WEBPACK_IMPORTED_MODULE_1__["SDK_NAME"]; }); + +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("Um2S"); +/* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("YjZj"); +/* harmony import */ var _transports__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("o8nw"); +/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "Transports", function() { return _transports__WEBPACK_IMPORTED_MODULE_5__; }); + + + + + + +var windowIntegrations = {}; +// This block is needed to add compatibility with the integrations packages when used with a CDN +var _window = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["getGlobalObject"])(); +if (_window.Sentry && _window.Sentry.Integrations) { + windowIntegrations = _window.Sentry.Integrations; +} +var INTEGRATIONS = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, windowIntegrations), _sentry_core__WEBPACK_IMPORTED_MODULE_2__["Integrations"]), _integrations__WEBPACK_IMPORTED_MODULE_4__); + +//# sourceMappingURL=index.js.map + +/***/ }), + /***/ "isx8": /***/ (function(module, exports, __webpack_require__) { @@ -290195,6 +304952,273 @@ module.exports = function (Constructor, NAME, next) { }; +/***/ }), + +/***/ "j43s": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("pKsO"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forget", function() { return _async__WEBPACK_IMPORTED_MODULE_0__["forget"]; }); + +/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("tqCS"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "htmlTreeAsString", function() { return _browser__WEBPACK_IMPORTED_MODULE_1__["htmlTreeAsString"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocationHref", function() { return _browser__WEBPACK_IMPORTED_MODULE_1__["getLocationHref"]; }); + +/* harmony import */ var _dsn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("G7wx"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dsnToString", function() { return _dsn__WEBPACK_IMPORTED_MODULE_2__["dsnToString"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeDsn", function() { return _dsn__WEBPACK_IMPORTED_MODULE_2__["makeDsn"]; }); + +/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("FbLj"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SeverityLevels", function() { return _enums__WEBPACK_IMPORTED_MODULE_3__["SeverityLevels"]; }); + +/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("3pfK"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SentryError", function() { return _error__WEBPACK_IMPORTED_MODULE_4__["SentryError"]; }); + +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("ETVo"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getGlobalObject", function() { return _global__WEBPACK_IMPORTED_MODULE_5__["getGlobalObject"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getGlobalSingleton", function() { return _global__WEBPACK_IMPORTED_MODULE_5__["getGlobalSingleton"]; }); + +/* harmony import */ var _instrument__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("g8yS"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addInstrumentationHandler", function() { return _instrument__WEBPACK_IMPORTED_MODULE_6__["addInstrumentationHandler"]; }); + +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("4E6N"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isError"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isErrorEvent", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isErrorEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDOMError", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isDOMError"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDOMException", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isDOMException"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isString"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPrimitive", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isPrimitive"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isPlainObject"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEvent", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isElement"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isRegExp"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isThenable", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isThenable"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSyntheticEvent", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isSyntheticEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isNaN"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInstanceOf", function() { return _is__WEBPACK_IMPORTED_MODULE_7__["isInstanceOf"]; }); + +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("1WlT"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CONSOLE_LEVELS", function() { return _logger__WEBPACK_IMPORTED_MODULE_8__["CONSOLE_LEVELS"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "consoleSandbox", function() { return _logger__WEBPACK_IMPORTED_MODULE_8__["consoleSandbox"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return _logger__WEBPACK_IMPORTED_MODULE_8__["logger"]; }); + +/* harmony import */ var _memo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("KpEf"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoBuilder", function() { return _memo__WEBPACK_IMPORTED_MODULE_9__["memoBuilder"]; }); + +/* harmony import */ var _misc__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("lkNu"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uuid4", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["uuid4"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["parseUrl"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEventDescription", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["getEventDescription"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addExceptionTypeValue", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["addExceptionTypeValue"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addExceptionMechanism", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["addExceptionMechanism"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseSemver", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["parseSemver"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addContextToFrame", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["addContextToFrame"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stripUrlQueryAndFragment", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["stripUrlQueryAndFragment"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "checkOrSetAlreadyCaught", function() { return _misc__WEBPACK_IMPORTED_MODULE_10__["checkOrSetAlreadyCaught"]; }); + +/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("hnl7"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNodeEnv", function() { return _node__WEBPACK_IMPORTED_MODULE_11__["isNodeEnv"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dynamicRequire", function() { return _node__WEBPACK_IMPORTED_MODULE_11__["dynamicRequire"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "loadModule", function() { return _node__WEBPACK_IMPORTED_MODULE_11__["loadModule"]; }); + +/* harmony import */ var _normalize__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("EUks"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return _normalize__WEBPACK_IMPORTED_MODULE_12__["normalize"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeToSize", function() { return _normalize__WEBPACK_IMPORTED_MODULE_12__["normalizeToSize"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "walk", function() { return _normalize__WEBPACK_IMPORTED_MODULE_12__["walk"]; }); + +/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("VffJ"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["fill"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addNonEnumerableProperty", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["addNonEnumerableProperty"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "markFunctionWrapped", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["markFunctionWrapped"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getOriginalFunction", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["getOriginalFunction"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "urlEncode", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["urlEncode"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "convertToPlainObject", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["convertToPlainObject"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractExceptionKeysForMessage", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["extractExceptionKeysForMessage"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropUndefinedKeys", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["dropUndefinedKeys"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "objectify", function() { return _object__WEBPACK_IMPORTED_MODULE_13__["objectify"]; }); + +/* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("4HQh"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["resolve"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["relative"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizePath", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["normalizePath"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAbsolute", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["isAbsolute"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["join"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["dirname"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return _path__WEBPACK_IMPORTED_MODULE_14__["basename"]; }); + +/* harmony import */ var _promisebuffer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("iMtC"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makePromiseBuffer", function() { return _promisebuffer__WEBPACK_IMPORTED_MODULE_15__["makePromiseBuffer"]; }); + +/* harmony import */ var _severity__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("HoQh"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "severityFromString", function() { return _severity__WEBPACK_IMPORTED_MODULE_16__["severityFromString"]; }); + +/* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__("5w3M"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createStackParser", function() { return _stacktrace__WEBPACK_IMPORTED_MODULE_17__["createStackParser"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stripSentryFramesAndReverse", function() { return _stacktrace__WEBPACK_IMPORTED_MODULE_17__["stripSentryFramesAndReverse"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFunctionName", function() { return _stacktrace__WEBPACK_IMPORTED_MODULE_17__["getFunctionName"]; }); + +/* harmony import */ var _status__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__("QGJP"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventStatusFromHttpCode", function() { return _status__WEBPACK_IMPORTED_MODULE_18__["eventStatusFromHttpCode"]; }); + +/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__("9fG0"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["truncate"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snipLine", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["snipLine"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "safeJoin", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["safeJoin"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchingPattern", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["isMatchingPattern"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeStringForRegex", function() { return _string__WEBPACK_IMPORTED_MODULE_19__["escapeStringForRegex"]; }); + +/* harmony import */ var _supports__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__("KbQE"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsErrorEvent", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsErrorEvent"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsDOMError", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsDOMError"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsDOMException", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsDOMException"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsFetch", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsFetch"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNativeFetch", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["isNativeFetch"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsNativeFetch", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsNativeFetch"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsReportingObserver", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsReportingObserver"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsReferrerPolicy", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsReferrerPolicy"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportsHistory", function() { return _supports__WEBPACK_IMPORTED_MODULE_20__["supportsHistory"]; }); + +/* harmony import */ var _syncpromise__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__("88Rr"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resolvedSyncPromise", function() { return _syncpromise__WEBPACK_IMPORTED_MODULE_21__["resolvedSyncPromise"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rejectedSyncPromise", function() { return _syncpromise__WEBPACK_IMPORTED_MODULE_21__["rejectedSyncPromise"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SyncPromise", function() { return _syncpromise__WEBPACK_IMPORTED_MODULE_21__["SyncPromise"]; }); + +/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__("fs+D"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dateTimestampInSeconds", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["dateTimestampInSeconds"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestampInSeconds", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["timestampInSeconds"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestampWithMs", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["timestampWithMs"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "usingPerformanceAPI", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["usingPerformanceAPI"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_browserPerformanceTimeOriginMode", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["_browserPerformanceTimeOriginMode"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "browserPerformanceTimeOrigin", function() { return _time__WEBPACK_IMPORTED_MODULE_22__["browserPerformanceTimeOrigin"]; }); + +/* harmony import */ var _tracing__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__("2vUq"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TRACEPARENT_REGEXP", function() { return _tracing__WEBPACK_IMPORTED_MODULE_23__["TRACEPARENT_REGEXP"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractTraceparentData", function() { return _tracing__WEBPACK_IMPORTED_MODULE_23__["extractTraceparentData"]; }); + +/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__("febk"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBrowserBundle", function() { return _env__WEBPACK_IMPORTED_MODULE_24__["isBrowserBundle"]; }); + +/* harmony import */ var _envelope__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__("bQfG"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createEnvelope", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["createEnvelope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addItemToEnvelope", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["addItemToEnvelope"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeType", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["getEnvelopeType"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "serializeEnvelope", function() { return _envelope__WEBPACK_IMPORTED_MODULE_25__["serializeEnvelope"]; }); + +/* harmony import */ var _clientreport__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__("nY+F"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createClientReportEnvelope", function() { return _clientreport__WEBPACK_IMPORTED_MODULE_26__["createClientReportEnvelope"]; }); + +/* harmony import */ var _ratelimit__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__("gPYe"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_RETRY_AFTER", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["DEFAULT_RETRY_AFTER"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseRetryAfterHeader", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["parseRetryAfterHeader"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disabledUntil", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["disabledUntil"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRateLimited", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["isRateLimited"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateRateLimits", function() { return _ratelimit__WEBPACK_IMPORTED_MODULE_27__["updateRateLimits"]; }); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +//# sourceMappingURL=index.js.map + /***/ }), /***/ "j8A2": @@ -290524,6 +305548,80 @@ Layout.defaultProps = { /***/ }), +/***/ "jESX": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedErrors", function() { return LinkedErrors; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_handler", function() { return _handler; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_walkErrorTree", function() { return _walkErrorTree; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Um2S"); +/* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("rcEJ"); + + + + +var DEFAULT_KEY = 'cause'; +var DEFAULT_LIMIT = 5; +/** Adds SDK info to an event. */ +var LinkedErrors = /** @class */ (function () { + /** + * @inheritDoc + */ + function LinkedErrors(options) { + if (options === void 0) { options = {}; } + /** + * @inheritDoc + */ + this.name = LinkedErrors.id; + this._key = options.key || DEFAULT_KEY; + this._limit = options.limit || DEFAULT_LIMIT; + } + /** + * @inheritDoc + */ + LinkedErrors.prototype.setupOnce = function () { + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"])(function (event, hint) { + var self = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().getIntegration(LinkedErrors); + return self ? _handler(self._key, self._limit, event, hint) : event; + }); + }; + /** + * @inheritDoc + */ + LinkedErrors.id = 'LinkedErrors'; + return LinkedErrors; +}()); + +/** + * @inheritDoc + */ +function _handler(key, limit, event, hint) { + if (!event.exception || !event.exception.values || !hint || !Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isInstanceOf"])(hint.originalException, Error)) { + return event; + } + var linkedErrors = _walkErrorTree(limit, hint.originalException, key); + event.exception.values = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(linkedErrors, event.exception.values); + return event; +} +/** + * JSDOC + */ +function _walkErrorTree(limit, error, key, stack) { + if (stack === void 0) { stack = []; } + if (!Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isInstanceOf"])(error[key], Error) || stack.length + 1 >= limit) { + return stack; + } + var exception = Object(_eventbuilder__WEBPACK_IMPORTED_MODULE_3__["exceptionFromError"])(error[key]); + return _walkErrorTree(limit, error[key], key, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])([exception], stack)); +} +//# sourceMappingURL=linkederrors.js.map + +/***/ }), + /***/ "jGhE": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -291557,110 +306655,104 @@ module.exports = getMilliseconds "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_RETRY_AFTER", function() { return DEFAULT_RETRY_AFTER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseRetryAfterHeader", function() { return parseRetryAfterHeader; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disabledUntil", function() { return disabledUntil; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRateLimited", function() { return isRateLimited; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseRetryAfterHeader", function() { return parseRetryAfterHeader; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateRateLimits", function() { return updateRateLimits; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend + +const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds -var DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds /** * Extracts Retry-After value from the request header or returns default value * @param header string representation of 'Retry-After' header * @param now current unix timestamp * */ -function parseRetryAfterHeader(header, now) { - if (now === void 0) { now = Date.now(); } - var headerDelay = parseInt("" + header, 10); - if (!isNaN(headerDelay)) { - return headerDelay * 1000; - } - var headerDate = Date.parse("" + header); - if (!isNaN(headerDate)) { - return headerDate - now; - } - return DEFAULT_RETRY_AFTER; +function parseRetryAfterHeader(header, now = Date.now()) { + const headerDelay = parseInt(`${header}`, 10); + if (!isNaN(headerDelay)) { + return headerDelay * 1000; + } + + const headerDate = Date.parse(`${header}`); + if (!isNaN(headerDate)) { + return headerDate - now; + } + + return DEFAULT_RETRY_AFTER; } + /** * Gets the time that given category is disabled until for rate limiting */ function disabledUntil(limits, category) { - return limits[category] || limits.all || 0; + return limits[category] || limits.all || 0; } + /** * Checks if a category is rate limited */ -function isRateLimited(limits, category, now) { - if (now === void 0) { now = Date.now(); } - return disabledUntil(limits, category) > now; +function isRateLimited(limits, category, now = Date.now()) { + return disabledUntil(limits, category) > now; } + /** * Update ratelimits from incoming headers. * Returns true if headers contains a non-empty rate limiting header. */ -function updateRateLimits(limits, headers, now) { - var e_1, _a, e_2, _b; - if (now === void 0) { now = Date.now(); } - var updatedRateLimits = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, limits); - // "The name is case-insensitive." - // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get - var rateLimitHeader = headers['x-sentry-rate-limits']; - var retryAfterHeader = headers['retry-after']; - if (rateLimitHeader) { - try { - /** - * rate limit headers are of the form - * <header>,<header>,.. - * where each <header> is of the form - * <retry_after>: <categories>: <scope>: <reason_code> - * where - * <retry_after> is a delay in seconds - * <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form - * <category>;<category>;... - * <scope> is what's being limited (org, project, or key) - ignored by SDK - * <reason_code> is an arbitrary string like "org_quota" - ignored by SDK - */ - for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(rateLimitHeader.trim().split(',')), _d = _c.next(); !_d.done; _d = _c.next()) { - var limit = _d.value; - var parameters = limit.split(':', 2); - var headerDelay = parseInt(parameters[0], 10); - var delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default - if (!parameters[1]) { - updatedRateLimits.all = now + delay; - } - else { - try { - for (var _e = (e_2 = void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(parameters[1].split(';'))), _f = _e.next(); !_f.done; _f = _e.next()) { - var category = _f.value; - updatedRateLimits[category] = now + delay; - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_f && !_f.done && (_b = _e.return)) _b.call(_e); - } - finally { if (e_2) throw e_2.error; } - } - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_1) throw e_1.error; } +function updateRateLimits( + limits, + { statusCode, headers }, + now = Date.now(), +) { + const updatedRateLimits = { + ...limits, + }; + + // "The name is case-insensitive." + // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get + const rateLimitHeader = headers && headers['x-sentry-rate-limits']; + const retryAfterHeader = headers && headers['retry-after']; + + if (rateLimitHeader) { + /** + * rate limit headers are of the form + * <header>,<header>,.. + * where each <header> is of the form + * <retry_after>: <categories>: <scope>: <reason_code> + * where + * <retry_after> is a delay in seconds + * <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form + * <category>;<category>;... + * <scope> is what's being limited (org, project, or key) - ignored by SDK + * <reason_code> is an arbitrary string like "org_quota" - ignored by SDK + */ + for (const limit of rateLimitHeader.trim().split(',')) { + const [retryAfter, categories] = limit.split(':', 2); + const headerDelay = parseInt(retryAfter, 10); + const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default + if (!categories) { + updatedRateLimits.all = now + delay; + } else { + for (const category of categories.split(';')) { + updatedRateLimits[category] = now + delay; } + } } - else if (retryAfterHeader) { - updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now); - } - return updatedRateLimits; + } else if (retryAfterHeader) { + updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now); + } else if (statusCode === 429) { + updatedRateLimits.all = now + 60 * 1000; + } + + return updatedRateLimits; } + + //# sourceMappingURL=ratelimit.js.map + /***/ }), /***/ "jIxI": @@ -292264,6 +307356,168 @@ function baseTrim(string) { module.exports = baseTrim; +/***/ }), + +/***/ "jXcl": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BAGGAGE_HEADER_NAME", function() { return BAGGAGE_HEADER_NAME; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_BAGGAGE_STRING_LENGTH", function() { return MAX_BAGGAGE_STRING_LENGTH; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SENTRY_BAGGAGE_KEY_PREFIX", function() { return SENTRY_BAGGAGE_KEY_PREFIX; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SENTRY_BAGGAGE_KEY_PREFIX_REGEX", function() { return SENTRY_BAGGAGE_KEY_PREFIX_REGEX; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "baggageHeaderToDynamicSamplingContext", function() { return baggageHeaderToDynamicSamplingContext; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dynamicSamplingContextToSentryBaggageHeader", function() { return dynamicSamplingContextToSentryBaggageHeader; }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9AQC"); +/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("8LbN"); + + + +const BAGGAGE_HEADER_NAME = 'baggage'; + +const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-'; + +const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/; + +/** + * Max length of a serialized baggage string + * + * https://www.w3.org/TR/baggage/#limits + */ +const MAX_BAGGAGE_STRING_LENGTH = 8192; + +/** + * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values + * from it. + * + * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks. + * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise. + */ +function baggageHeaderToDynamicSamplingContext( + // Very liberal definition of what any incoming header might look like + baggageHeader, +) { + if (!Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isString"])(baggageHeader) && !Array.isArray(baggageHeader)) { + return undefined; + } + + // Intermediary object to store baggage key value pairs of incoming baggage headers on. + // It is later used to read Sentry-DSC-values from. + let baggageObject = {}; + + if (Array.isArray(baggageHeader)) { + // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it + baggageObject = baggageHeader.reduce((acc, curr) => { + const currBaggageObject = baggageHeaderToObject(curr); + return { + ...acc, + ...currBaggageObject, + }; + }, {}); + } else { + // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but + // this is how we choose to handle it) + if (!baggageHeader) { + return undefined; + } + + baggageObject = baggageHeaderToObject(baggageHeader); + } + + // Read all "sentry-" prefixed values out of the baggage object and put it onto a dynamic sampling context object. + const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => { + if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) { + const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length); + acc[nonPrefixedKey] = value; + } + return acc; + }, {}); + + // Only return a dynamic sampling context object if there are keys in it. + // A keyless object means there were no sentry values on the header, which means that there is no DSC. + if (Object.keys(dynamicSamplingContext).length > 0) { + return dynamicSamplingContext ; + } else { + return undefined; + } +} + +/** + * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry-". + * + * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility + * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is + * `undefined` the function will return `undefined`. + * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext` + * was `undefined`, or if `dynamicSamplingContext` didn't contain any values. + */ +function dynamicSamplingContextToSentryBaggageHeader( + // this also takes undefined for convenience and bundle size in other places + dynamicSamplingContext, +) { + // Prefix all DSC keys with "sentry-" and put them into a new object + const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce( + (acc, [dscKey, dscValue]) => { + if (dscValue) { + acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue; + } + return acc; + }, + {}, + ); + + return objectToBaggageHeader(sentryPrefixedDSC); +} + +/** + * Will parse a baggage header, which is a simple key-value map, into a flat object. + * + * @param baggageHeader The baggage header to parse. + * @returns a flat object containing all the key-value pairs from `baggageHeader`. + */ +function baggageHeaderToObject(baggageHeader) { + return baggageHeader + .split(',') + .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim()))) + .reduce((acc, [key, value]) => { + acc[key] = value; + return acc; + }, {}); +} + +/** + * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs. + * + * @param object The object to turn into a baggage header. + * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header + * is not spec compliant. + */ +function objectToBaggageHeader(object) { + if (Object.keys(object).length === 0) { + // An empty baggage header is not spec compliant: We return undefined. + return undefined; + } + + return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => { + const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`; + const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`; + if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _logger_js__WEBPACK_IMPORTED_MODULE_1__["logger"].warn( + `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`, + ); + return baggageHeader; + } else { + return newBaggageHeader; + } + }, ''); +} + + +//# sourceMappingURL=baggage.js.map + + /***/ }), /***/ "jbM+": @@ -292288,6 +307542,196 @@ function arrayIncludes(array, value) { module.exports = arrayIncludes; +/***/ }), + +/***/ "jdz8": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsErrorEvent", function() { return supportsErrorEvent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsDOMError", function() { return supportsDOMError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsDOMException", function() { return supportsDOMException; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsFetch", function() { return supportsFetch; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNativeFetch", function() { return isNativeFetch; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsNativeFetch", function() { return supportsNativeFetch; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsReportingObserver", function() { return supportsReportingObserver; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsReferrerPolicy", function() { return supportsReferrerPolicy; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsHistory", function() { return supportsHistory; }); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("G8B2"); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("BilH"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("N4D0"); + + + +/** + * Tells whether current environment supports ErrorEvent objects + * {@link supportsErrorEvent}. + * + * @returns Answer to the given question. + */ +function supportsErrorEvent() { + try { + new ErrorEvent(''); + return true; + } + catch (e) { + return false; + } +} +/** + * Tells whether current environment supports DOMError objects + * {@link supportsDOMError}. + * + * @returns Answer to the given question. + */ +function supportsDOMError() { + try { + // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError': + // 1 argument required, but only 0 present. + // @ts-ignore It really needs 1 argument, not 0. + new DOMError(''); + return true; + } + catch (e) { + return false; + } +} +/** + * Tells whether current environment supports DOMException objects + * {@link supportsDOMException}. + * + * @returns Answer to the given question. + */ +function supportsDOMException() { + try { + new DOMException(''); + return true; + } + catch (e) { + return false; + } +} +/** + * Tells whether current environment supports Fetch API + * {@link supportsFetch}. + * + * @returns Answer to the given question. + */ +function supportsFetch() { + if (!('fetch' in Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])())) { + return false; + } + try { + new Headers(); + new Request(''); + new Response(); + return true; + } + catch (e) { + return false; + } +} +/** + * isNativeFetch checks if the given function is a native implementation of fetch() + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function isNativeFetch(func) { + return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); +} +/** + * Tells whether current environment supports Fetch API natively + * {@link supportsNativeFetch}. + * + * @returns true if `window.fetch` is natively implemented, false otherwise + */ +function supportsNativeFetch() { + if (!supportsFetch()) { + return false; + } + var global = Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + // Fast path to avoid DOM I/O + // eslint-disable-next-line @typescript-eslint/unbound-method + if (isNativeFetch(global.fetch)) { + return true; + } + // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension) + // so create a "pure" iframe to see if that has native fetch + var result = false; + var doc = global.document; + // eslint-disable-next-line deprecation/deprecation + if (doc && typeof doc.createElement === 'function') { + try { + var sandbox = doc.createElement('iframe'); + sandbox.hidden = true; + doc.head.appendChild(sandbox); + if (sandbox.contentWindow && sandbox.contentWindow.fetch) { + // eslint-disable-next-line @typescript-eslint/unbound-method + result = isNativeFetch(sandbox.contentWindow.fetch); + } + doc.head.removeChild(sandbox); + } + catch (err) { + _flags__WEBPACK_IMPORTED_MODULE_0__["IS_DEBUG_BUILD"] && + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err); + } + } + return result; +} +/** + * Tells whether current environment supports ReportingObserver API + * {@link supportsReportingObserver}. + * + * @returns Answer to the given question. + */ +function supportsReportingObserver() { + return 'ReportingObserver' in Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); +} +/** + * Tells whether current environment supports Referrer Policy API + * {@link supportsReferrerPolicy}. + * + * @returns Answer to the given question. + */ +function supportsReferrerPolicy() { + // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default' + // (see https://caniuse.com/#feat=referrer-policy), + // it doesn't. And it throws an exception instead of ignoring this parameter... + // REF: https://github.com/getsentry/raven-js/issues/1233 + if (!supportsFetch()) { + return false; + } + try { + new Request('_', { + referrerPolicy: 'origin', + }); + return true; + } + catch (e) { + return false; + } +} +/** + * Tells whether current environment supports History API + * {@link supportsHistory}. + * + * @returns Answer to the given question. + */ +function supportsHistory() { + // NOTE: in Chrome App environment, touching history.pushState, *even inside + // a try/catch block*, will cause Chrome to output an error to console.error + // borrowed from: https://github.com/angular/angular.js/pull/13945/files + var global = Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var chrome = global.chrome; + var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime; + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + var hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState; + return !isChromePackagedApp && hasHistoryApi; +} +//# sourceMappingURL=supports.js.map + /***/ }), /***/ "jeLo": @@ -296045,14 +311489,11 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserClient", function() { return BrowserClient; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TwdF"); -/* harmony import */ var _backend__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("y/t4"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("3Uor"); -/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("vzc1"); -/* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("4kjc"); - +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _eventbuilder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("IS+8"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("vzc1"); +/* harmony import */ var _integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("/ZhC"); @@ -296065,70 +311506,142 @@ __webpack_require__.r(__webpack_exports__); * @see BrowserOptions for documentation on configuration options. * @see SentryClient for usage documentation. */ -var BrowserClient = /** @class */ (function (_super) { - Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BrowserClient, _super); - /** - * Creates a new Browser SDK instance. - * - * @param options Configuration options for this SDK. - */ - function BrowserClient(options) { - if (options === void 0) { options = {}; } - var _this = this; - options._metadata = options._metadata || {}; - options._metadata.sdk = options._metadata.sdk || { - name: 'sentry.javascript.browser', - packages: [ - { - name: 'npm:@sentry/browser', - version: _sentry_core__WEBPACK_IMPORTED_MODULE_1__["SDK_VERSION"], - }, - ], - version: _sentry_core__WEBPACK_IMPORTED_MODULE_1__["SDK_VERSION"], - }; - _this = _super.call(this, _backend__WEBPACK_IMPORTED_MODULE_3__["BrowserBackend"], options) || this; - return _this; - } - /** - * Show a report dialog to the user to send feedback to a specific event. - * - * @param options Set individual options for the dialog - */ - BrowserClient.prototype.showReportDialog = function (options) { - if (options === void 0) { options = {}; } - // doesn't work without a document (React Native) - var document = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])().document; - if (!document) { - return; - } - if (!this._isEnabled()) { - _flags__WEBPACK_IMPORTED_MODULE_4__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].error('Trying to call showReportDialog with Sentry Client disabled'); - return; - } - Object(_helpers__WEBPACK_IMPORTED_MODULE_5__["injectReportDialog"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, options), { dsn: options.dsn || this.getDsn() })); - }; - /** - * @inheritDoc - */ - BrowserClient.prototype._prepareEvent = function (event, scope, hint) { - event.platform = event.platform || 'javascript'; - return _super.prototype._prepareEvent.call(this, event, scope, hint); +class BrowserClient extends _sentry_core__WEBPACK_IMPORTED_MODULE_0__["BaseClient"] { + /** + * Creates a new Browser SDK instance. + * + * @param options Configuration options for this SDK. + */ + constructor(options) { + options._metadata = options._metadata || {}; + options._metadata.sdk = options._metadata.sdk || { + name: 'sentry.javascript.browser', + packages: [ + { + name: 'npm:@sentry/browser', + version: _sentry_core__WEBPACK_IMPORTED_MODULE_0__["SDK_VERSION"], + }, + ], + version: _sentry_core__WEBPACK_IMPORTED_MODULE_0__["SDK_VERSION"], }; - /** - * @inheritDoc - */ - BrowserClient.prototype._sendEvent = function (event) { - var integration = this.getIntegration(_integrations__WEBPACK_IMPORTED_MODULE_6__["Breadcrumbs"]); - if (integration) { - integration.addSentryBreadcrumb(event); + + super(options); + + if (options.sendClientReports && _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].document) { + _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].document.addEventListener('visibilitychange', () => { + if (_helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].document.visibilityState === 'hidden') { + this._flushOutcomes(); } - _super.prototype._sendEvent.call(this, event); - }; - return BrowserClient; -}(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["BaseClient"])); + }); + } + } + + /** + * @inheritDoc + */ + eventFromException(exception, hint) { + return Object(_eventbuilder_js__WEBPACK_IMPORTED_MODULE_2__["eventFromException"])(this._options.stackParser, exception, hint, this._options.attachStacktrace); + } + + /** + * @inheritDoc + */ + eventFromMessage( + message, + // eslint-disable-next-line deprecation/deprecation + level = 'info', + hint, + ) { + return Object(_eventbuilder_js__WEBPACK_IMPORTED_MODULE_2__["eventFromMessage"])(this._options.stackParser, message, level, hint, this._options.attachStacktrace); + } + + /** + * @inheritDoc + */ + sendEvent(event, hint) { + // We only want to add the sentry event breadcrumb when the user has the breadcrumb integration installed and + // activated its `sentry` option. + // We also do not want to use the `Breadcrumbs` class here directly, because we do not want it to be included in + // bundles, if it is not used by the SDK. + // This all sadly is a bit ugly, but we currently don't have a "pre-send" hook on the integrations so we do it this + // way for now. + const breadcrumbIntegration = this.getIntegrationById(_integrations_breadcrumbs_js__WEBPACK_IMPORTED_MODULE_4__["BREADCRUMB_INTEGRATION_ID"]) ; + if ( + breadcrumbIntegration && + // We check for definedness of `options`, even though it is not strictly necessary, because that access to + // `.sentry` below does not throw, in case users provided their own integration with id "Breadcrumbs" that does + // not have an`options` field + breadcrumbIntegration.options && + breadcrumbIntegration.options.sentry + ) { + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])().addBreadcrumb( + { + category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`, + event_id: event.event_id, + level: event.level, + message: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event), + }, + { + event, + }, + ); + } + + super.sendEvent(event, hint); + } + + /** + * @inheritDoc + */ + _prepareEvent(event, hint, scope) { + event.platform = event.platform || 'javascript'; + return super._prepareEvent(event, hint, scope); + } + + /** + * Sends client reports as an envelope. + */ + _flushOutcomes() { + const outcomes = this._clearOutcomes(); + + if (outcomes.length === 0) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('No outcomes to send'); + return; + } + + if (!this._dsn) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('No dsn provided, will not send outcomes'); + return; + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('Sending outcomes:', outcomes); + + const url = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["getEnvelopeEndpointWithUrlEncodedAuth"])(this._dsn, this._options); + const envelope = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["createClientReportEnvelope"])(outcomes, this._options.tunnel && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["dsnToString"])(this._dsn)); + + try { + const isRealNavigator = Object.prototype.toString.call(_helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"] && _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].navigator) === '[object Navigator]'; + const hasSendBeacon = isRealNavigator && typeof _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].navigator.sendBeacon === 'function'; + // Make sure beacon is not used if user configures custom transport options + if (hasSendBeacon && !this._options.transportOptions) { + // Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch + const sendBeacon = _helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].navigator.sendBeacon.bind(_helpers_js__WEBPACK_IMPORTED_MODULE_3__["WINDOW"].navigator); + sendBeacon(url, Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["serializeEnvelope"])(envelope)); + } else { + // If beacon is not supported or if they are using the tunnel option + // use our regular transport to send client reports to Sentry. + this._sendEnvelope(envelope); + } + } catch (e) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error(e); + } + } +} + //# sourceMappingURL=client.js.map + /***/ }), /***/ "kaRY": @@ -296315,16 +311828,24 @@ __webpack_require__.r(__webpack_exports__); "use strict"; __webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dateTimestampInSeconds", function() { return dateTimestampInSeconds; }); +/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_browserPerformanceTimeOriginMode", function() { return _browserPerformanceTimeOriginMode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "browserPerformanceTimeOrigin", function() { return browserPerformanceTimeOrigin; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dateTimestampInSeconds", function() { return dateTimestampInSeconds; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestampInSeconds", function() { return timestampInSeconds; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestampWithMs", function() { return timestampWithMs; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "usingPerformanceAPI", function() { return usingPerformanceAPI; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_browserPerformanceTimeOriginMode", function() { return _browserPerformanceTimeOriginMode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "browserPerformanceTimeOrigin", function() { return browserPerformanceTimeOrigin; }); -/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("z+RT"); -/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("+A1k"); +/* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("+A1k"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("rbyU"); + +// eslint-disable-next-line deprecation/deprecation +const WINDOW = Object(_worldwide_js__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + +/** + * An object that can return the current timestamp in seconds since the UNIX epoch. + */ + /** * A TimestampSource implementation for environments that do not support the Performance Web API natively. * @@ -296332,9 +311853,15 @@ __webpack_require__.r(__webpack_exports__); * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It * is more obvious to explain "why does my span have negative duration" than "why my spans have zero duration". */ -var dateTimestampSource = { - nowSeconds: function () { return Date.now() / 1000; }, +const dateTimestampSource = { + nowSeconds: () => Date.now() / 1000, }; + +/** + * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance} + * for accessing a high-resolution monotonic clock. + */ + /** * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not * support the API. @@ -296342,63 +311869,70 @@ var dateTimestampSource = { * Wrapping the native API works around differences in behavior from different browsers. */ function getBrowserPerformance() { - var performance = Object(_global__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])().performance; - if (!performance || !performance.now) { - return undefined; - } - // Replace performance.timeOrigin with our own timeOrigin based on Date.now(). - // - // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin + - // performance.now() gives a date arbitrarily in the past. - // - // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is - // undefined. - // - // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to - // interact with data coming out of performance entries. - // - // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that - // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes - // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have - // observed skews that can be as long as days, weeks or months. - // - // See https://github.com/getsentry/sentry-javascript/issues/2590. - // - // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload - // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation - // transactions of long-lived web pages. - var timeOrigin = Date.now() - performance.now(); - return { - now: function () { return performance.now(); }, - timeOrigin: timeOrigin, - }; + const { performance } = WINDOW; + if (!performance || !performance.now) { + return undefined; + } + + // Replace performance.timeOrigin with our own timeOrigin based on Date.now(). + // + // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin + + // performance.now() gives a date arbitrarily in the past. + // + // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is + // undefined. + // + // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to + // interact with data coming out of performance entries. + // + // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that + // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes + // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have + // observed skews that can be as long as days, weeks or months. + // + // See https://github.com/getsentry/sentry-javascript/issues/2590. + // + // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload + // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation + // transactions of long-lived web pages. + const timeOrigin = Date.now() - performance.now(); + + return { + now: () => performance.now(), + timeOrigin, + }; } + /** * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't * implement the API. */ function getNodePerformance() { - try { - var perfHooks = Object(_node__WEBPACK_IMPORTED_MODULE_1__["dynamicRequire"])(module, 'perf_hooks'); - return perfHooks.performance; - } - catch (_) { - return undefined; - } + try { + const perfHooks = Object(_node_js__WEBPACK_IMPORTED_MODULE_0__["dynamicRequire"])(module, 'perf_hooks') ; + return perfHooks.performance; + } catch (_) { + return undefined; + } } + /** * The Performance API implementation for the current platform, if available. */ -var platformPerformance = Object(_node__WEBPACK_IMPORTED_MODULE_1__["isNodeEnv"])() ? getNodePerformance() : getBrowserPerformance(); -var timestampSource = platformPerformance === undefined +const platformPerformance = Object(_node_js__WEBPACK_IMPORTED_MODULE_0__["isNodeEnv"])() ? getNodePerformance() : getBrowserPerformance(); + +const timestampSource = + platformPerformance === undefined ? dateTimestampSource : { - nowSeconds: function () { return (platformPerformance.timeOrigin + platformPerformance.now()) / 1000; }, - }; + nowSeconds: () => (platformPerformance.timeOrigin + platformPerformance.now()) / 1000, + }; + /** * Returns a timestamp in seconds since the UNIX epoch using the Date API. */ -var dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource); +const dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource); + /** * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the * availability of the Performance API. @@ -296410,65 +311944,77 @@ var dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSo * skew can grow to arbitrary amounts like days, weeks or months. * See https://github.com/getsentry/sentry-javascript/issues/2590. */ -var timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource); +const timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource); + // Re-exported with an old name for backwards-compatibility. -var timestampWithMs = timestampInSeconds; +const timestampWithMs = timestampInSeconds; + /** * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps. */ -var usingPerformanceAPI = platformPerformance !== undefined; +const usingPerformanceAPI = platformPerformance !== undefined; + /** * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only. */ -var _browserPerformanceTimeOriginMode; +let _browserPerformanceTimeOriginMode; + /** * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the * performance API is available. */ -var browserPerformanceTimeOrigin = (function () { - // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or - // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin - // data as reliable if they are within a reasonable threshold of the current time. - var performance = Object(_global__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])().performance; - if (!performance || !performance.now) { - _browserPerformanceTimeOriginMode = 'none'; - return undefined; - } - var threshold = 3600 * 1000; - var performanceNow = performance.now(); - var dateNow = Date.now(); - // if timeOrigin isn't available set delta to threshold so it isn't used - var timeOriginDelta = performance.timeOrigin - ? Math.abs(performance.timeOrigin + performanceNow - dateNow) - : threshold; - var timeOriginIsReliable = timeOriginDelta < threshold; - // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin - // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. - // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always - // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the - // Date API. - // eslint-disable-next-line deprecation/deprecation - var navigationStart = performance.timing && performance.timing.navigationStart; - var hasNavigationStart = typeof navigationStart === 'number'; - // if navigationStart isn't available set delta to threshold so it isn't used - var navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; - var navigationStartIsReliable = navigationStartDelta < threshold; - if (timeOriginIsReliable || navigationStartIsReliable) { - // Use the more reliable time origin - if (timeOriginDelta <= navigationStartDelta) { - _browserPerformanceTimeOriginMode = 'timeOrigin'; - return performance.timeOrigin; - } - else { - _browserPerformanceTimeOriginMode = 'navigationStart'; - return navigationStart; - } +const browserPerformanceTimeOrigin = (() => { + // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or + // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin + // data as reliable if they are within a reasonable threshold of the current time. + + const { performance } = WINDOW; + if (!performance || !performance.now) { + _browserPerformanceTimeOriginMode = 'none'; + return undefined; + } + + const threshold = 3600 * 1000; + const performanceNow = performance.now(); + const dateNow = Date.now(); + + // if timeOrigin isn't available set delta to threshold so it isn't used + const timeOriginDelta = performance.timeOrigin + ? Math.abs(performance.timeOrigin + performanceNow - dateNow) + : threshold; + const timeOriginIsReliable = timeOriginDelta < threshold; + + // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin + // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. + // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always + // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the + // Date API. + // eslint-disable-next-line deprecation/deprecation + const navigationStart = performance.timing && performance.timing.navigationStart; + const hasNavigationStart = typeof navigationStart === 'number'; + // if navigationStart isn't available set delta to threshold so it isn't used + const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; + const navigationStartIsReliable = navigationStartDelta < threshold; + + if (timeOriginIsReliable || navigationStartIsReliable) { + // Use the more reliable time origin + if (timeOriginDelta <= navigationStartDelta) { + _browserPerformanceTimeOriginMode = 'timeOrigin'; + return performance.timeOrigin; + } else { + _browserPerformanceTimeOriginMode = 'navigationStart'; + return navigationStart; } - // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date. - _browserPerformanceTimeOriginMode = 'dateNow'; - return dateNow; + } + + // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date. + _browserPerformanceTimeOriginMode = 'dateNow'; + return dateNow; })(); + + //# sourceMappingURL=time.js.map + /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("3UD+")(module))) /***/ }), @@ -296511,6 +312057,84 @@ function overArg(func, transform) { module.exports = overArg; +/***/ }), + +/***/ "kerP": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onFID", function() { return onFID; }); +/* harmony import */ var _lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Fm1u"); +/* harmony import */ var _lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hNpR"); +/* harmony import */ var _lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("bjvM"); +/* harmony import */ var _lib_observe_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("MaC4"); +/* harmony import */ var _lib_onHidden_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("6mNm"); + + + + + + +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Calculates the [FID](https://web.dev/fid/) value for the current page and + * calls the `callback` function once the value is ready, along with the + * relevant `first-input` performance entry used to determine the value. The + * reported value is a `DOMHighResTimeStamp`. + * + * _**Important:** since FID is only reported after the user interacts with the + * page, it's possible that it will not be reported for some page loads._ + */ +const onFID = (onReport, opts = {}) => { + const visibilityWatcher = Object(_lib_getVisibilityWatcher_js__WEBPACK_IMPORTED_MODULE_1__["getVisibilityWatcher"])(); + const metric = Object(_lib_initMetric_js__WEBPACK_IMPORTED_MODULE_2__["initMetric"])('FID'); + // eslint-disable-next-line prefer-const + let report; + + const handleEntry = (entry) => { + // Only report if the page wasn't hidden prior to the first input. + if (entry.startTime < visibilityWatcher.firstHiddenTime) { + metric.value = entry.processingStart - entry.startTime; + metric.entries.push(entry); + report(true); + } + }; + + const handleEntries = (entries) => { + (entries ).forEach(handleEntry); + }; + + const po = Object(_lib_observe_js__WEBPACK_IMPORTED_MODULE_3__["observe"])('first-input', handleEntries); + report = Object(_lib_bindReporter_js__WEBPACK_IMPORTED_MODULE_0__["bindReporter"])(onReport, metric, opts.reportAllChanges); + + if (po) { + Object(_lib_onHidden_js__WEBPACK_IMPORTED_MODULE_4__["onHidden"])(() => { + handleEntries(po.takeRecords() ); + po.disconnect(); + }, true); + } +}; + + +//# sourceMappingURL=getFID.js.map + + /***/ }), /***/ "kfFl": @@ -300313,6 +315937,35 @@ __webpack_require__.r(__webpack_exports__); /* harmony default export */ __webpack_exports__["default"] = (x => () => x); +/***/ }), + +/***/ "lFE6": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createClientReportEnvelope", function() { return createClientReportEnvelope; }); +/* harmony import */ var _envelope__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("nOZt"); +/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("slSt"); + + +/** + * Creates client report envelope + * @param discarded_events An array of discard events + * @param dsn A DSN that can be set on the header. Optional. + */ +function createClientReportEnvelope(discarded_events, dsn, timestamp) { + var clientReportItem = [ + { type: 'client_report' }, + { + timestamp: timestamp || Object(_time__WEBPACK_IMPORTED_MODULE_1__["dateTimestampInSeconds"])(), + discarded_events: discarded_events, + }, + ]; + return Object(_envelope__WEBPACK_IMPORTED_MODULE_0__["createEnvelope"])(dsn ? { dsn: dsn } : {}, [clientReportItem]); +} +//# sourceMappingURL=clientreport.js.map + /***/ }), /***/ "lFIR": @@ -322372,7 +338025,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return getHubFromCarrier; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setHubOnCarrier", function() { return setHubOnCarrier; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("j43s"); /* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("K65+"); /* harmony import */ var _scope__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("KjyA"); /* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("xS++"); @@ -323179,168 +338832,189 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InboundFilters", function() { return InboundFilters; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_mergeOptions", function() { return _mergeOptions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_shouldDropEvent", function() { return _shouldDropEvent; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("yA8j"); - +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); // "Script error." is hard coded into browsers for errors that it can't read. // this is the result of a script being pulled in from an external domain and CORS. -var DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/]; +const DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/]; + +/** Options for the InboundFilters integration */ + /** Inbound filters configurable by the user */ -var InboundFilters = /** @class */ (function () { - function InboundFilters(_options) { - if (_options === void 0) { _options = {}; } - this._options = _options; - /** - * @inheritDoc - */ - this.name = InboundFilters.id; - } - /** - * @inheritDoc - */ - InboundFilters.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) { - addGlobalEventProcessor(function (event) { - var hub = getCurrentHub(); - if (hub) { - var self_1 = hub.getIntegration(InboundFilters); - if (self_1) { - var client = hub.getClient(); - var clientOptions = client ? client.getOptions() : {}; - var options = _mergeOptions(self_1._options, clientOptions); - return _shouldDropEvent(event, options) ? null : event; - } - } - return event; - }); +class InboundFilters { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'InboundFilters';} + + /** + * @inheritDoc + */ + __init() {this.name = InboundFilters.id;} + + constructor( _options = {}) {;this._options = _options;InboundFilters.prototype.__init.call(this);} + + /** + * @inheritDoc + */ + setupOnce(addGlobalEventProcessor, getCurrentHub) { + const eventProcess = (event) => { + const hub = getCurrentHub(); + if (hub) { + const self = hub.getIntegration(InboundFilters); + if (self) { + const client = hub.getClient(); + const clientOptions = client ? client.getOptions() : {}; + const options = _mergeOptions(self._options, clientOptions); + return _shouldDropEvent(event, options) ? null : event; + } + } + return event; }; - /** - * @inheritDoc - */ - InboundFilters.id = 'InboundFilters'; - return InboundFilters; -}()); + + eventProcess.id = this.name; + addGlobalEventProcessor(eventProcess); + } +} InboundFilters.__initStatic(); /** JSDoc */ -function _mergeOptions(internalOptions, clientOptions) { - if (internalOptions === void 0) { internalOptions = {}; } - if (clientOptions === void 0) { clientOptions = {}; } - return { - allowUrls: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((internalOptions.whitelistUrls || []), (internalOptions.allowUrls || []), (clientOptions.whitelistUrls || []), (clientOptions.allowUrls || [])), - denyUrls: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((internalOptions.blacklistUrls || []), (internalOptions.denyUrls || []), (clientOptions.blacklistUrls || []), (clientOptions.denyUrls || [])), - ignoreErrors: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((internalOptions.ignoreErrors || []), (clientOptions.ignoreErrors || []), DEFAULT_IGNORE_ERRORS), - ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true, - }; +function _mergeOptions( + internalOptions = {}, + clientOptions = {}, +) { + return { + allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])], + denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])], + ignoreErrors: [ + ...(internalOptions.ignoreErrors || []), + ...(clientOptions.ignoreErrors || []), + ...DEFAULT_IGNORE_ERRORS, + ], + ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true, + }; } + /** JSDoc */ function _shouldDropEvent(event, options) { - if (options.ignoreInternal && _isSentryError(event)) { - _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && - _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn("Event dropped due to being internal Sentry Error.\nEvent: " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event)); - return true; - } - if (_isIgnoredError(event, options.ignoreErrors)) { - _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && - _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event)); - return true; - } - if (_isDeniedUrl(event, options.denyUrls)) { - _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && - _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn("Event dropped due to being matched by `denyUrls` option.\nEvent: " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event) + ".\nUrl: " + _getEventFilterUrl(event)); - return true; - } - if (!_isAllowedUrl(event, options.allowUrls)) { - _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && - _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event) + ".\nUrl: " + _getEventFilterUrl(event)); - return true; - } - return false; + if (options.ignoreInternal && _isSentryError(event)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getEventDescription"])(event)}`); + return true; + } + if (_isIgnoredError(event, options.ignoreErrors)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn( + `Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getEventDescription"])(event)}`, + ); + return true; + } + if (_isDeniedUrl(event, options.denyUrls)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn( + `Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getEventDescription"])( + event, + )}.\nUrl: ${_getEventFilterUrl(event)}`, + ); + return true; + } + if (!_isAllowedUrl(event, options.allowUrls)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn( + `Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getEventDescription"])( + event, + )}.\nUrl: ${_getEventFilterUrl(event)}`, + ); + return true; + } + return false; } + function _isIgnoredError(event, ignoreErrors) { - if (!ignoreErrors || !ignoreErrors.length) { - return false; - } - return _getPossibleEventMessages(event).some(function (message) { - return ignoreErrors.some(function (pattern) { return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isMatchingPattern"])(message, pattern); }); - }); + if (!ignoreErrors || !ignoreErrors.length) { + return false; + } + + return _getPossibleEventMessages(event).some(message => Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["stringMatchesSomePattern"])(message, ignoreErrors)); } + function _isDeniedUrl(event, denyUrls) { - // TODO: Use Glob instead? - if (!denyUrls || !denyUrls.length) { - return false; - } - var url = _getEventFilterUrl(event); - return !url ? false : denyUrls.some(function (pattern) { return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isMatchingPattern"])(url, pattern); }); + // TODO: Use Glob instead? + if (!denyUrls || !denyUrls.length) { + return false; + } + const url = _getEventFilterUrl(event); + return !url ? false : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["stringMatchesSomePattern"])(url, denyUrls); } + function _isAllowedUrl(event, allowUrls) { - // TODO: Use Glob instead? - if (!allowUrls || !allowUrls.length) { - return true; - } - var url = _getEventFilterUrl(event); - return !url ? true : allowUrls.some(function (pattern) { return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isMatchingPattern"])(url, pattern); }); + // TODO: Use Glob instead? + if (!allowUrls || !allowUrls.length) { + return true; + } + const url = _getEventFilterUrl(event); + return !url ? true : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["stringMatchesSomePattern"])(url, allowUrls); } + function _getPossibleEventMessages(event) { - if (event.message) { - return [event.message]; - } - if (event.exception) { - try { - var _a = (event.exception.values && event.exception.values[0]) || {}, _b = _a.type, type = _b === void 0 ? '' : _b, _c = _a.value, value = _c === void 0 ? '' : _c; - return ["" + value, type + ": " + value]; - } - catch (oO) { - _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error("Cannot extract message for event " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event)); - return []; - } + if (event.message) { + return [event.message]; + } + if (event.exception) { + try { + const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {}; + return [`${value}`, `${type}: ${value}`]; + } catch (oO) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].error(`Cannot extract message for event ${Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getEventDescription"])(event)}`); + return []; } - return []; + } + return []; } + function _isSentryError(event) { - try { - // @ts-ignore can't be a sentry error if undefined - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - return event.exception.values[0].type === 'SentryError'; - } - catch (e) { - // ignore - } - return false; + try { + // @ts-ignore can't be a sentry error if undefined + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return event.exception.values[0].type === 'SentryError'; + } catch (e) { + // ignore + } + return false; } -function _getLastValidUrl(frames) { - if (frames === void 0) { frames = []; } - for (var i = frames.length - 1; i >= 0; i--) { - var frame = frames[i]; - if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') { - return frame.filename || null; - } + +function _getLastValidUrl(frames = []) { + for (let i = frames.length - 1; i >= 0; i--) { + const frame = frames[i]; + + if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') { + return frame.filename || null; } - return null; + } + + return null; } + function _getEventFilterUrl(event) { + try { + let frames; try { - if (event.stacktrace) { - return _getLastValidUrl(event.stacktrace.frames); - } - var frames_1; - try { - // @ts-ignore we only care about frames if the whole thing here is defined - frames_1 = event.exception.values[0].stacktrace.frames; - } - catch (e) { - // ignore - } - return frames_1 ? _getLastValidUrl(frames_1) : null; - } - catch (oO) { - _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error("Cannot extract url for event " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event)); - return null; + // @ts-ignore we only care about frames if the whole thing here is defined + frames = event.exception.values[0].stacktrace.frames; + } catch (e) { + // ignore } + return frames ? _getLastValidUrl(frames) : null; + } catch (oO) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].error(`Cannot extract url for event ${Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getEventDescription"])(event)}`); + return null; + } } + + //# sourceMappingURL=inboundfilters.js.map + /***/ }), /***/ "leoV": @@ -323673,6 +339347,50 @@ function ZoomEvent(type, { } +/***/ }), + +/***/ "liIs": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionToString", function() { return FunctionToString; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Um2S"); + +var originalFunctionToString; +/** Patch toString calls to return proper name for wrapped functions */ +var FunctionToString = /** @class */ (function () { + function FunctionToString() { + /** + * @inheritDoc + */ + this.name = FunctionToString.id; + } + /** + * @inheritDoc + */ + FunctionToString.prototype.setupOnce = function () { + // eslint-disable-next-line @typescript-eslint/unbound-method + originalFunctionToString = Function.prototype.toString; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Function.prototype.toString = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var context = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getOriginalFunction"])(this) || this; + return originalFunctionToString.apply(context, args); + }; + }; + /** + * @inheritDoc + */ + FunctionToString.id = 'FunctionToString'; + return FunctionToString; +}()); + +//# sourceMappingURL=functiontostring.js.map + /***/ }), /***/ "ljhN": @@ -323717,6 +339435,261 @@ function eq(value, other) { module.exports = eq; +/***/ }), + +/***/ "lk7i": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _browsertracing_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("zHkj"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BROWSER_TRACING_INTEGRATION_ID", function() { return _browsertracing_js__WEBPACK_IMPORTED_MODULE_0__["BROWSER_TRACING_INTEGRATION_ID"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrowserTracing", function() { return _browsertracing_js__WEBPACK_IMPORTED_MODULE_0__["BrowserTracing"]; }); + +/* harmony import */ var _request_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("crS0"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultRequestInstrumentationOptions", function() { return _request_js__WEBPACK_IMPORTED_MODULE_1__["defaultRequestInstrumentationOptions"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "instrumentOutgoingRequests", function() { return _request_js__WEBPACK_IMPORTED_MODULE_1__["instrumentOutgoingRequests"]; }); + + + + +; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ "lkNu": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uuid4", function() { return uuid4; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return parseUrl; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEventDescription", function() { return getEventDescription; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addExceptionTypeValue", function() { return addExceptionTypeValue; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addExceptionMechanism", function() { return addExceptionMechanism; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseSemver", function() { return parseSemver; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContextToFrame", function() { return addContextToFrame; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripUrlQueryAndFragment", function() { return stripUrlQueryAndFragment; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkOrSetAlreadyCaught", function() { return checkOrSetAlreadyCaught; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("ETVo"); +/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("VffJ"); +/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("9fG0"); + + + + +/** + * UUID4 generator + * + * @returns string Generated UUID4. + */ +function uuid4() { + var global = Object(_global__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + var crypto = global.crypto || global.msCrypto; + if (!(crypto === void 0) && crypto.getRandomValues) { + // Use window.crypto API if available + var arr = new Uint16Array(8); + crypto.getRandomValues(arr); + // set 4 in byte 7 + // eslint-disable-next-line no-bitwise + arr[3] = (arr[3] & 0xfff) | 0x4000; + // set 2 most significant bits of byte 9 to '10' + // eslint-disable-next-line no-bitwise + arr[4] = (arr[4] & 0x3fff) | 0x8000; + var pad = function (num) { + var v = num.toString(16); + while (v.length < 4) { + v = "0" + v; + } + return v; + }; + return (pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7])); + } + // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 + return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + // eslint-disable-next-line no-bitwise + var r = (Math.random() * 16) | 0; + // eslint-disable-next-line no-bitwise + var v = c === 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); +} +/** + * Parses string form of URL into an object + * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B + * // intentionally using regex and not <a/> href parsing trick because React Native and other + * // environments where DOM might not be available + * @returns parsed URL object + */ +function parseUrl(url) { + if (!url) { + return {}; + } + var match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); + if (!match) { + return {}; + } + // coerce to undefined values to empty string so we don't get 'undefined' + var query = match[6] || ''; + var fragment = match[8] || ''; + return { + host: match[4], + path: match[5], + protocol: match[2], + relative: match[5] + query + fragment, + }; +} +function getFirstException(event) { + return event.exception && event.exception.values ? event.exception.values[0] : undefined; +} +/** + * Extracts either message or type+value from an event that can be used for user-facing logs + * @returns event's description + */ +function getEventDescription(event) { + var message = event.message, eventId = event.event_id; + if (message) { + return message; + } + var 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>'; +} +/** + * Adds exception values, type and value to an synthetic Exception. + * @param event The event to modify. + * @param value Value of the exception. + * @param type Type of the exception. + * @hidden + */ +function addExceptionTypeValue(event, value, type) { + var exception = (event.exception = event.exception || {}); + var values = (exception.values = exception.values || []); + var firstException = (values[0] = values[0] || {}); + if (!firstException.value) { + firstException.value = value || ''; + } + if (!firstException.type) { + firstException.type = type || 'Error'; + } +} +/** + * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed. + * + * @param event The event to modify. + * @param newMechanism Mechanism data to add to the event. + * @hidden + */ +function addExceptionMechanism(event, newMechanism) { + var firstException = getFirstException(event); + if (!firstException) { + return; + } + var defaultMechanism = { type: 'generic', handled: true }; + var currentMechanism = firstException.mechanism; + firstException.mechanism = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, defaultMechanism), currentMechanism), newMechanism); + if (newMechanism && 'data' in newMechanism) { + var mergedData = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, (currentMechanism && currentMechanism.data)), newMechanism.data); + firstException.mechanism.data = mergedData; + } +} +// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string +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-]+)*))?$/; +/** + * Parses input into a SemVer interface + * @param input string representation of a semver version + */ +function parseSemver(input) { + var match = input.match(SEMVER_REGEXP) || []; + var major = parseInt(match[1], 10); + var minor = parseInt(match[2], 10); + var patch = parseInt(match[3], 10); + return { + buildmetadata: match[5], + major: isNaN(major) ? undefined : major, + minor: isNaN(minor) ? undefined : minor, + patch: isNaN(patch) ? undefined : patch, + prerelease: match[4], + }; +} +/** + * This function adds context (pre/post/line) lines to the provided frame + * + * @param lines string[] containing all lines + * @param frame StackFrame that will be mutated + * @param linesOfContext number of context lines we want to add pre/post + */ +function addContextToFrame(lines, frame, linesOfContext) { + if (linesOfContext === void 0) { linesOfContext = 5; } + var lineno = frame.lineno || 0; + var maxLines = lines.length; + var sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0); + frame.pre_context = lines + .slice(Math.max(0, sourceLine - linesOfContext), sourceLine) + .map(function (line) { return Object(_string__WEBPACK_IMPORTED_MODULE_3__["snipLine"])(line, 0); }); + frame.context_line = Object(_string__WEBPACK_IMPORTED_MODULE_3__["snipLine"])(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0); + frame.post_context = lines + .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext) + .map(function (line) { return Object(_string__WEBPACK_IMPORTED_MODULE_3__["snipLine"])(line, 0); }); +} +/** + * Strip the query string and fragment off of a given URL or path (if present) + * + * @param urlPath Full URL or path, including possible query string and/or fragment + * @returns URL or path without query string or fragment + */ +function stripUrlQueryAndFragment(urlPath) { + // eslint-disable-next-line no-useless-escape + return urlPath.split(/[\?#]/, 1)[0]; +} +/** + * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object + * in question), and marks it captured if not. + * + * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and + * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so + * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because + * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not + * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This + * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we + * see it. + * + * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on + * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent + * object wrapper forms so that this check will always work. However, because we need to flag the exact object which + * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification + * must be done before the exception captured. + * + * @param A thrown exception to check or flag as having been seen + * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen) + */ +function checkOrSetAlreadyCaught(exception) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (exception && exception.__sentry_captured__) { + return true; + } + try { + // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the + // `ExtraErrorData` integration + Object(_object__WEBPACK_IMPORTED_MODULE_2__["addNonEnumerableProperty"])(exception, '__sentry_captured__', true); + } + catch (err) { + // `exception` is a primitive, so we can't mark it seen + } + return false; +} +//# sourceMappingURL=misc.js.map + /***/ }), /***/ "lm/5": @@ -328581,6 +344554,26 @@ BasisClosed.prototype = { }); +/***/ }), + +/***/ "muh5": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "REACT_MOUNT_OP", function() { return REACT_MOUNT_OP; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "REACT_RENDER_OP", function() { return REACT_RENDER_OP; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "REACT_UPDATE_OP", function() { return REACT_UPDATE_OP; }); +const REACT_RENDER_OP = 'ui.react.render'; + +const REACT_UPDATE_OP = 'ui.react.update'; + +const REACT_MOUNT_OP = 'ui.react.mount'; + + +//# sourceMappingURL=constants.js.map + + /***/ }), /***/ "mura": @@ -328634,6 +344627,347 @@ function isIterateeCall(value, index, object) { module.exports = isIterateeCall; +/***/ }), + +/***/ "mvbY": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Express", function() { return Express; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("QXPM"); + + + + +/** + * Express integration + * + * Provides an request and error handler for Express framework as well as tracing capabilities + */ +class Express { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'Express';} + + /** + * @inheritDoc + */ + __init() {this.name = Express.id;} + + /** + * Express App instance + */ + + /** + * @inheritDoc + */ + constructor(options = {}) {;Express.prototype.__init.call(this); + this._router = options.router || options.app; + this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use'); + } + + /** + * @inheritDoc + */ + setupOnce(_, getCurrentHub) { + if (!this._router) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('ExpressIntegration is missing an Express instance'); + return; + } + + if (Object(_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__["shouldDisableAutoInstrumentation"])(getCurrentHub)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('Express Integration is skipped because of instrumenter configuration.'); + return; + } + + instrumentMiddlewares(this._router, this._methods); + instrumentRouter(this._router ); + } +}Express.__initStatic(); + +/** + * Wraps original middleware function in a tracing call, which stores the info about the call as a span, + * and finishes it once the middleware is done invoking. + * + * Express middlewares have 3 various forms, thus we have to take care of all of them: + * // sync + * app.use(function (req, res) { ... }) + * // async + * app.use(function (req, res, next) { ... }) + * // error handler + * app.use(function (err, req, res, next) { ... }) + * + * They all internally delegate to the `router[method]` of the given application instance. + */ +// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any +function wrap(fn, method) { + const arity = fn.length; + + switch (arity) { + case 2: { + return function ( req, res) { + const transaction = res.__sentry_transaction; + if (transaction) { + const span = transaction.startChild({ + description: fn.name, + op: `middleware.express.${method}`, + }); + res.once('finish', () => { + span.finish(); + }); + } + return fn.call(this, req, res); + }; + } + case 3: { + return function ( + + req, + res, + next, + ) { + const transaction = res.__sentry_transaction; + const span = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([transaction, 'optionalAccess', _2 => _2.startChild, 'call', _3 => _3({ + description: fn.name, + op: `middleware.express.${method}`, + })]); + fn.call(this, req, res, function ( ...args) { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _4 => _4.finish, 'call', _5 => _5()]); + next.call(this, ...args); + }); + }; + } + case 4: { + return function ( + + err, + req, + res, + next, + ) { + const transaction = res.__sentry_transaction; + const span = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([transaction, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({ + description: fn.name, + op: `middleware.express.${method}`, + })]); + fn.call(this, err, req, res, function ( ...args) { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]); + next.call(this, ...args); + }); + }; + } + default: { + throw new Error(`Express middleware takes 2-4 arguments. Got: ${arity}`); + } + } +} + +/** + * Takes all the function arguments passed to the original `app` or `router` method, eg. `app.use` or `router.use` + * and wraps every function, as well as array of functions with a call to our `wrap` method. + * We have to take care of the arrays as well as iterate over all of the arguments, + * as `app.use` can accept middlewares in few various forms. + * + * app.use([<path>], <fn>) + * app.use([<path>], <fn>, ...<fn>) + * app.use([<path>], ...<fn>[]) + */ +function wrapMiddlewareArgs(args, method) { + return args.map((arg) => { + if (typeof arg === 'function') { + return wrap(arg, method); + } + + if (Array.isArray(arg)) { + return arg.map((a) => { + if (typeof a === 'function') { + return wrap(a, method); + } + return a; + }); + } + + return arg; + }); +} + +/** + * Patches original router to utilize our tracing functionality + */ +function patchMiddleware(router, method) { + const originalCallback = router[method]; + + router[method] = function (...args) { + return originalCallback.call(this, ...wrapMiddlewareArgs(args, method)); + }; + + return router; +} + +/** + * Patches original router methods + */ +function instrumentMiddlewares(router, methods = []) { + methods.forEach((method) => patchMiddleware(router, method)); +} + +/** + * Patches the prototype of Express.Router to accumulate the resolved route + * if a layer instance's `match` function was called and it returned a successful match. + * + * @see https://github.com/expressjs/express/blob/master/lib/router/index.js + * + * @param appOrRouter the router instance which can either be an app (i.e. top-level) or a (nested) router. + */ +function instrumentRouter(appOrRouter) { + // This is how we can distinguish between app and routers + const isApp = 'settings' in appOrRouter; + + // In case the app's top-level router hasn't been initialized yet, we have to do it now + if (isApp && appOrRouter._router === undefined && appOrRouter.lazyrouter) { + appOrRouter.lazyrouter(); + } + + const router = isApp ? appOrRouter._router : appOrRouter; + + if (!router) { + /* + If we end up here, this means likely that this integration is used with Express 3 or Express 5. + For now, we don't support these versions (3 is very old and 5 is still in beta). To support Express 5, + we'd need to make more changes to the routing instrumentation because the router is no longer part of + the Express core package but maintained in its own package. The new router has different function + signatures and works slightly differently, demanding more changes than just taking the router from + `app.router` instead of `app._router`. + @see https://github.com/pillarjs/router + + TODO: Proper Express 5 support + */ + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Cannot instrument router for URL Parameterization (did not find a valid router).'); + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Routing instrumentation is currently only supported in Express 4.'); + return; + } + + const routerProto = Object.getPrototypeOf(router) ; + + const originalProcessParams = routerProto.process_params; + routerProto.process_params = function process_params( + layer, + called, + req, + res, + done, + ) { + // Base case: We're in the first part of the URL (thus we start with the root '/') + if (!req._reconstructedRoute) { + req._reconstructedRoute = ''; + } + + // If the layer's partial route has params, is a regex or an array, the route is stored in layer.route. + const { layerRoutePath, isRegex, isArray, numExtraSegments } = getLayerRoutePathInfo(layer); + + // Otherwise, the hardcoded path (i.e. a partial route without params) is stored in layer.path + const partialRoute = layerRoutePath || layer.path || ''; + + // Normalize the partial route so that it doesn't contain leading or trailing slashes + // and exclude empty or '*' wildcard routes. + // The exclusion of '*' routes is our best effort to not "pollute" the transaction name + // with interim handlers (e.g. ones that check authentication or do other middleware stuff). + // We want to end up with the parameterized URL of the incoming request without any extraneous path segments. + const finalPartialRoute = partialRoute + .split('/') + .filter(segment => segment.length > 0 && (isRegex || isArray || !segment.includes('*'))) + .join('/'); + + // If we found a valid partial URL, we append it to the reconstructed route + if (finalPartialRoute && finalPartialRoute.length > 0) { + // If the partial route is from a regex route, we append a '/' to close the regex + req._reconstructedRoute += `/${finalPartialRoute}${isRegex ? '/' : ''}`; + } + + // Now we check if we are in the "last" part of the route. We determine this by comparing the + // number of URL segments from the original URL to that of our reconstructed parameterized URL. + // If we've reached our final destination, we update the transaction name. + const urlLength = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getNumberOfUrlSegments"])(req.originalUrl || '') + numExtraSegments; + const routeLength = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getNumberOfUrlSegments"])(req._reconstructedRoute); + + if (urlLength === routeLength) { + const transaction = res.__sentry_transaction; + if (transaction && transaction.metadata.source !== 'custom') { + // If the request URL is '/' or empty, the reconstructed route will be empty. + // Therefore, we fall back to setting the final route to '/' in this case. + const finalRoute = req._reconstructedRoute || '/'; + + transaction.setName(...Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["extractPathForTransaction"])(req, { path: true, method: true, customRoute: finalRoute })); + } + } + + return originalProcessParams.call(this, layer, called, req, res, done); + }; +} + +/** + * Extracts and stringifies the layer's route which can either be a string with parameters (`users/:id`), + * a RegEx (`/test/`) or an array of strings and regexes (`['/path1', /\/path[2-5]/, /path/:id]`). Additionally + * returns extra information about the route, such as if the route is defined as regex or as an array. + * + * @param layer the layer to extract the stringified route from + * + * @returns an object containing the stringified route, a flag determining if the route was a regex + * and the number of extra segments to the matched path that are additionally in the route, + * if the route was an array (defaults to 0). + */ +function getLayerRoutePathInfo(layer) { + const lrp = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([layer, 'access', _10 => _10.route, 'optionalAccess', _11 => _11.path]); + + const isRegex = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isRegExp"])(lrp); + const isArray = Array.isArray(lrp); + + if (!lrp) { + return { isRegex, isArray, numExtraSegments: 0 }; + } + + const numExtraSegments = isArray + ? Math.max(getNumberOfArrayUrlSegments(lrp ) - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getNumberOfUrlSegments"])(layer.path || ''), 0) + : 0; + + const layerRoutePath = getLayerRoutePathString(isArray, lrp); + + return { layerRoutePath, isRegex, isArray, numExtraSegments }; +} + +/** + * Returns the number of URL segments in an array of routes + * + * Example: ['/api/test', /\/api\/post[0-9]/, '/users/:id/details`] -> 7 + */ +function getNumberOfArrayUrlSegments(routesArray) { + return routesArray.reduce((accNumSegments, currentRoute) => { + // array members can be a RegEx -> convert them toString + return accNumSegments + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getNumberOfUrlSegments"])(currentRoute.toString()); + }, 0); +} + +/** + * Extracts and returns the stringified version of the layers route path + * Handles route arrays (by joining the paths together) as well as RegExp and normal + * string values (in the latter case the toString conversion is technically unnecessary but + * it doesn't hurt us either). + */ +function getLayerRoutePathString(isArray, lrp) { + if (isArray) { + return (lrp ).map(r => r.toString()).join(','); + } + return lrp && lrp.toString(); +} + + +//# sourceMappingURL=express.js.map + + /***/ }), /***/ "mwIZ": @@ -328706,6 +345040,86 @@ __webpack_require__.r(__webpack_exports__); d: "M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z" }), 'KeyboardArrowRight')); +/***/ }), + +/***/ "mz3V": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GraphQL", function() { return GraphQL; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("QXPM"); + + + + +/** Tracing integration for graphql package */ +class GraphQL {constructor() { GraphQL.prototype.__init.call(this); } + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'GraphQL';} + + /** + * @inheritDoc + */ + __init() {this.name = GraphQL.id;} + + /** + * @inheritDoc + */ + setupOnce(_, getCurrentHub) { + const pkg = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["loadModule"]) + +('graphql/execution/execute.js'); + + if (!pkg) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error('GraphQL Integration was unable to require graphql/execution package.'); + return; + } + + if (Object(_utils_node_utils_js__WEBPACK_IMPORTED_MODULE_2__["shouldDisableAutoInstrumentation"])(getCurrentHub)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log('GraphQL Integration is skipped because of instrumenter configuration.'); + return; + } + + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(pkg, 'execute', function (orig) { + return function ( ...args) { + const scope = getCurrentHub().getScope(); + const parentSpan = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]); + + const span = Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({ + description: 'execute', + op: 'graphql.execute', + })]); + + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([scope, 'optionalAccess', _6 => _6.setSpan, 'call', _7 => _7(span)]); + + const rv = orig.call(this, ...args); + + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isThenable"])(rv)) { + return rv.then((res) => { + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]); + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([scope, 'optionalAccess', _10 => _10.setSpan, 'call', _11 => _11(parentSpan)]); + + return res; + }); + } + + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]); + Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([scope, 'optionalAccess', _14 => _14.setSpan, 'call', _15 => _15(parentSpan)]); + return rv; + }; + }); + } +}GraphQL.__initStatic(); + + +//# sourceMappingURL=graphql.js.map + + /***/ }), /***/ "mzRO": @@ -329943,6 +346357,66 @@ function buildFormatLocale () { module.exports = buildFormatLocale +/***/ }), + +/***/ "nOZt": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEnvelope", function() { return createEnvelope; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addItemToEnvelope", function() { return addItemToEnvelope; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeType", function() { return getEnvelopeType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serializeEnvelope", function() { return serializeEnvelope; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("fUgN"); + + +/** + * Creates an envelope. + * Make sure to always explicitly provide the generic to this function + * so that the envelope types resolve correctly. + */ +function createEnvelope(headers, items) { + if (items === void 0) { items = []; } + return [headers, items]; +} +/** + * Add an item to an envelope. + * Make sure to always explicitly provide the generic to this function + * so that the envelope types resolve correctly. + */ +function addItemToEnvelope(envelope, newItem) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(envelope, 2), headers = _a[0], items = _a[1]; + return [headers, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(items, [newItem])]; +} +/** + * Get the type of the envelope. Grabs the type from the first envelope item. + */ +function getEnvelopeType(envelope) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(envelope, 2), _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_a[1], 1), _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_b[0], 1), firstItemHeader = _c[0]; + return firstItemHeader.type; +} +/** + * Serializes an envelope into a string. + */ +function serializeEnvelope(envelope) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(envelope, 2), headers = _a[0], items = _a[1]; + var serializedHeaders = JSON.stringify(headers); + // Have to cast items to any here since Envelope is a union type + // Fixed in Typescript 4.2 + // TODO: Remove any[] cast when we upgrade to TS 4.2 + // https://github.com/microsoft/TypeScript/issues/36390 + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return items.reduce(function (acc, item) { + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(item, 2), itemHeaders = _a[0], payload = _a[1]; + // We do not serialize payloads that are primitives + var serializedPayload = Object(_is__WEBPACK_IMPORTED_MODULE_1__["isPrimitive"])(payload) ? String(payload) : JSON.stringify(payload); + return acc + "\n" + JSON.stringify(itemHeaders) + "\n" + serializedPayload; + }, serializedHeaders); +} +//# sourceMappingURL=envelope.js.map + /***/ }), /***/ "nRNh": @@ -330144,28 +346618,17 @@ function responseJson(response) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("DTjN"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseTransport", function() { return _base__WEBPACK_IMPORTED_MODULE_0__["BaseTransport"]; }); - -/* harmony import */ var _fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("2O0U"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FetchTransport", function() { return _fetch__WEBPACK_IMPORTED_MODULE_1__["FetchTransport"]; }); - -/* harmony import */ var _xhr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("MT+3"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XHRTransport", function() { return _xhr__WEBPACK_IMPORTED_MODULE_2__["XHRTransport"]; }); - -/* harmony import */ var _new_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("0bfL"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeNewFetchTransport", function() { return _new_fetch__WEBPACK_IMPORTED_MODULE_3__["makeNewFetchTransport"]; }); - -/* harmony import */ var _new_xhr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("i1K8"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeNewXHRTransport", function() { return _new_xhr__WEBPACK_IMPORTED_MODULE_4__["makeNewXHRTransport"]; }); - - +/* harmony import */ var _fetch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2O0U"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeFetchTransport", function() { return _fetch_js__WEBPACK_IMPORTED_MODULE_0__["makeFetchTransport"]; }); +/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("MT+3"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeXHRTransport", function() { return _xhr_js__WEBPACK_IMPORTED_MODULE_1__["makeXHRTransport"]; }); //# sourceMappingURL=index.js.map + /***/ }), /***/ "nXVj": @@ -330207,6 +346670,35 @@ var pink = { /***/ }), +/***/ "nY+F": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createClientReportEnvelope", function() { return createClientReportEnvelope; }); +/* harmony import */ var _envelope__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("bQfG"); +/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("fs+D"); + + +/** + * Creates client report envelope + * @param discarded_events An array of discard events + * @param dsn A DSN that can be set on the header. Optional. + */ +function createClientReportEnvelope(discarded_events, dsn, timestamp) { + var clientReportItem = [ + { type: 'client_report' }, + { + timestamp: timestamp || Object(_time__WEBPACK_IMPORTED_MODULE_1__["dateTimestampInSeconds"])(), + discarded_events: discarded_events, + }, + ]; + return Object(_envelope__WEBPACK_IMPORTED_MODULE_0__["createEnvelope"])(dsn ? { dsn: dsn } : {}, [clientReportItem]); +} +//# sourceMappingURL=clientreport.js.map + +/***/ }), + /***/ "nd1P": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -336031,59 +352523,6 @@ exports.inflateUndermine = inflateUndermine; */ -/***/ }), - -/***/ "nmNn": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UserAgent", function() { return UserAgent; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TwdF"); - - - -var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); -/** UserAgent */ -var UserAgent = /** @class */ (function () { - function UserAgent() { - /** - * @inheritDoc - */ - this.name = UserAgent.id; - } - /** - * @inheritDoc - */ - UserAgent.prototype.setupOnce = function () { - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"])(function (event) { - if (Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().getIntegration(UserAgent)) { - // if none of the information we want exists, don't bother - if (!global.navigator && !global.location && !global.document) { - return event; - } - // grab as much info as exists and add it to the event - var url = (event.request && event.request.url) || (global.location && global.location.href); - var referrer = (global.document || {}).referrer; - var userAgent = (global.navigator || {}).userAgent; - var headers = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, (event.request && event.request.headers)), (referrer && { Referer: referrer })), (userAgent && { 'User-Agent': userAgent })); - var request = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, (url && { url: url })), { headers: headers }); - return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, event), { request: request }); - } - return event; - }); - }; - /** - * @inheritDoc - */ - UserAgent.id = 'UserAgent'; - return UserAgent; -}()); - -//# sourceMappingURL=useragent.js.map - /***/ }), /***/ "nmnc": @@ -339279,6 +355718,35 @@ var Divider = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["forwardRef"](func /***/ }), +/***/ "o8nw": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ehbI"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseTransport", function() { return _base__WEBPACK_IMPORTED_MODULE_0__["BaseTransport"]; }); + +/* harmony import */ var _fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("I7WW"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FetchTransport", function() { return _fetch__WEBPACK_IMPORTED_MODULE_1__["FetchTransport"]; }); + +/* harmony import */ var _xhr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("im3G"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XHRTransport", function() { return _xhr__WEBPACK_IMPORTED_MODULE_2__["XHRTransport"]; }); + +/* harmony import */ var _new_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("y34A"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeNewFetchTransport", function() { return _new_fetch__WEBPACK_IMPORTED_MODULE_3__["makeNewFetchTransport"]; }); + +/* harmony import */ var _new_xhr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("7QCm"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeNewXHRTransport", function() { return _new_xhr__WEBPACK_IMPORTED_MODULE_4__["makeNewXHRTransport"]; }); + + + + + + +//# sourceMappingURL=index.js.map + +/***/ }), + /***/ "oAyw": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -339806,6 +356274,59 @@ exports.default = _default; /***/ }), +/***/ "oJ8F": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UserAgent", function() { return UserAgent; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Um2S"); + + + +var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); +/** UserAgent */ +var UserAgent = /** @class */ (function () { + function UserAgent() { + /** + * @inheritDoc + */ + this.name = UserAgent.id; + } + /** + * @inheritDoc + */ + UserAgent.prototype.setupOnce = function () { + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"])(function (event) { + if (Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"])().getIntegration(UserAgent)) { + // if none of the information we want exists, don't bother + if (!global.navigator && !global.location && !global.document) { + return event; + } + // grab as much info as exists and add it to the event + var url = (event.request && event.request.url) || (global.location && global.location.href); + var referrer = (global.document || {}).referrer; + var userAgent = (global.navigator || {}).userAgent; + var headers = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, (event.request && event.request.headers)), (referrer && { Referer: referrer })), (userAgent && { 'User-Agent': userAgent })); + var request = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, (url && { url: url })), { headers: headers }); + return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, event), { request: request }); + } + return event; + }); + }; + /** + * @inheritDoc + */ + UserAgent.id = 'UserAgent'; + return UserAgent; +}()); + +//# sourceMappingURL=useragent.js.map + +/***/ }), + /***/ "oJCR": /***/ (function(module, exports, __webpack_require__) { @@ -340172,32 +356693,34 @@ module.exports = arrayAggregator; "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseClient", function() { return BaseClient; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("uzXi"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TwdF"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("yA8j"); -/* harmony import */ var _integration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("METY"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("3MsT"); +/* harmony import */ var _envelope_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("wdqR"); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("METY"); +/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("vOz9"); +/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("v/92"); -/* eslint-disable max-lines */ -var ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; + + +const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; + /** * Base implementation for all JavaScript SDK clients. * - * Call the constructor with the corresponding backend constructor and options + * Call the constructor with the corresponding options * specific to the client subclass. To access these options later, use - * {@link Client.getOptions}. Also, the Backend instance is available via - * {@link Client.getBackend}. + * {@link Client.getOptions}. * * If a Dsn is specified in the options, it will be parsed and stored. Use * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is * invalid, the constructor will throw a {@link SentryException}. Note that * without a valid Dsn, the SDK will not send any events to Sentry. * - * Before sending an event via the backend, it is passed through + * Before sending an event, it is passed through * {@link BaseClient._prepareEvent} to add SDK information and scope data * (breadcrumbs and context). To add more custom information, override this * method and extend the resulting prepared event. @@ -340208,495 +356731,722 @@ var ALREADY_SEEN_ERROR = "Not capturing exception because it's already been capt * {@link Client.addBreadcrumb}. * * @example - * class NodeClient extends BaseClient<NodeBackend, NodeOptions> { + * class NodeClient extends BaseClient<NodeOptions> { * public constructor(options: NodeOptions) { - * super(NodeBackend, options); + * super(options); * } * * // ... * } */ -var BaseClient = /** @class */ (function () { - /** - * Initializes this client instance. - * - * @param backendClass A constructor function to create the backend. - * @param options Options for the client. - */ - function BaseClient(backendClass, options) { - /** Array of used integrations. */ - this._integrations = {}; - /** Number of calls being processed */ - this._numProcessing = 0; - this._backend = new backendClass(options); - this._options = options; - if (options.dsn) { - this._dsn = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["makeDsn"])(options.dsn); - } +class BaseClient { + /** Options passed to the SDK. */ + + /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */ + + /** Array of set up integrations. */ + __init() {this._integrations = {};} + + /** Indicates whether this client's integrations have been set up. */ + __init2() {this._integrationsInitialized = false;} + + /** Number of calls being processed */ + __init3() {this._numProcessing = 0;} + + /** Holds flushable */ + __init4() {this._outcomes = {};} + + /** + * Initializes this client instance. + * + * @param options Options for the client. + */ + constructor(options) {;BaseClient.prototype.__init.call(this);BaseClient.prototype.__init2.call(this);BaseClient.prototype.__init3.call(this);BaseClient.prototype.__init4.call(this); + this._options = options; + if (options.dsn) { + this._dsn = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["makeDsn"])(options.dsn); + const url = Object(_api_js__WEBPACK_IMPORTED_MODULE_1__["getEnvelopeEndpointWithUrlEncodedAuth"])(this._dsn, options); + this._transport = options.transport({ + recordDroppedEvent: this.recordDroppedEvent.bind(this), + ...options.transportOptions, + url, + }); + } else { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('No DSN provided, client will not do anything.'); } - /** - * @inheritDoc - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types - BaseClient.prototype.captureException = function (exception, hint, scope) { - var _this = this; - // ensure we haven't captured this very object before - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["checkOrSetAlreadyCaught"])(exception)) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log(ALREADY_SEEN_ERROR); - return; - } - var eventId = hint && hint.event_id; - this._process(this._getBackend() - .eventFromException(exception, hint) - .then(function (event) { return _this._captureEvent(event, hint, scope); }) - .then(function (result) { - eventId = result; - })); - return eventId; - }; - /** - * @inheritDoc - */ - BaseClient.prototype.captureMessage = function (message, level, hint, scope) { - var _this = this; - var eventId = hint && hint.event_id; - var promisedEvent = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isPrimitive"])(message) - ? this._getBackend().eventFromMessage(String(message), level, hint) - : this._getBackend().eventFromException(message, hint); - this._process(promisedEvent - .then(function (event) { return _this._captureEvent(event, hint, scope); }) - .then(function (result) { - eventId = result; - })); - return eventId; - }; - /** - * @inheritDoc - */ - BaseClient.prototype.captureEvent = function (event, hint, scope) { - // ensure we haven't captured this very object before - if (hint && hint.originalException && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["checkOrSetAlreadyCaught"])(hint.originalException)) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].log(ALREADY_SEEN_ERROR); - return; - } - var eventId = hint && hint.event_id; - this._process(this._captureEvent(event, hint, scope).then(function (result) { - eventId = result; - })); - return eventId; - }; - /** - * @inheritDoc - */ - BaseClient.prototype.captureSession = function (session) { - if (!this._isEnabled()) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('SDK not enabled, will not capture session.'); - return; - } - if (!(typeof session.release === 'string')) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn('Discarded session because of missing or non-string release'); - } - else { - this._sendSession(session); - // After sending, we set init false to indicate it's not the first occurrence - session.update({ init: false }); - } - }; - /** - * @inheritDoc - */ - BaseClient.prototype.getDsn = function () { - return this._dsn; - }; - /** - * @inheritDoc - */ - BaseClient.prototype.getOptions = function () { - return this._options; - }; - /** - * @inheritDoc - */ - BaseClient.prototype.getTransport = function () { - return this._getBackend().getTransport(); - }; - /** - * @inheritDoc - */ - BaseClient.prototype.flush = function (timeout) { - var _this = this; - return this._isClientDoneProcessing(timeout).then(function (clientFinished) { - return _this.getTransport() - .close(timeout) - .then(function (transportFlushed) { return clientFinished && transportFlushed; }); - }); - }; - /** - * @inheritDoc - */ - BaseClient.prototype.close = function (timeout) { - var _this = this; - return this.flush(timeout).then(function (result) { - _this.getOptions().enabled = false; - return result; - }); - }; - /** - * Sets up the integrations - */ - BaseClient.prototype.setupIntegrations = function () { - if (this._isEnabled() && !this._integrations.initialized) { - this._integrations = Object(_integration__WEBPACK_IMPORTED_MODULE_4__["setupIntegrations"])(this._options); - } - }; - /** - * @inheritDoc - */ - BaseClient.prototype.getIntegration = function (integration) { - try { - return this._integrations[integration.id] || null; - } - catch (_oO) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].warn("Cannot retrieve integration " + integration.id + " from the current Client"); - return null; - } - }; - /** Updates existing session based on the provided event */ - BaseClient.prototype._updateSessionFromEvent = function (session, event) { - var e_1, _a; - var crashed = false; - var errored = false; - var exceptions = event.exception && event.exception.values; - if (exceptions) { - errored = true; - try { - for (var exceptions_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(exceptions), exceptions_1_1 = exceptions_1.next(); !exceptions_1_1.done; exceptions_1_1 = exceptions_1.next()) { - var ex = exceptions_1_1.value; - var mechanism = ex.mechanism; - if (mechanism && mechanism.handled === false) { - crashed = true; - break; - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (exceptions_1_1 && !exceptions_1_1.done && (_a = exceptions_1.return)) _a.call(exceptions_1); - } - finally { if (e_1) throw e_1.error; } - } - } - // A session is updated and that session update is sent in only one of the two following scenarios: - // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update - // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update - var sessionNonTerminal = session.status === 'ok'; - var shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed); - if (shouldUpdateAndSend) { - session.update(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, (crashed && { status: 'crashed' })), { errors: session.errors || Number(errored || crashed) })); - this.captureSession(session); - } - }; - /** Deliver captured session to Sentry */ - BaseClient.prototype._sendSession = function (session) { - this._getBackend().sendSession(session); - }; - /** - * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying - * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. - * - * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not - * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to - * `true`. - * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and - * `false` otherwise - */ - BaseClient.prototype._isClientDoneProcessing = function (timeout) { - var _this = this; - return new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SyncPromise"](function (resolve) { - var ticked = 0; - var tick = 1; - var interval = setInterval(function () { - if (_this._numProcessing == 0) { - clearInterval(interval); - resolve(true); - } - else { - ticked += tick; - if (timeout && ticked >= timeout) { - clearInterval(interval); - resolve(false); - } - } - }, tick); - }); - }; - /** Returns the current backend. */ - BaseClient.prototype._getBackend = function () { - return this._backend; - }; - /** Determines whether this SDK is enabled and a valid Dsn is present. */ - BaseClient.prototype._isEnabled = function () { - return this.getOptions().enabled !== false && this._dsn !== undefined; - }; - /** - * Adds common information to events. - * - * The information includes release and environment from `options`, - * breadcrumbs and context (extra, tags and user) from the scope. - * - * Information that is already present in the event is never overwritten. For - * nested objects, such as the context, keys are merged. - * - * @param event The original event. - * @param hint May contain additional information about the original exception. - * @param scope A scope containing event metadata. - * @returns A new event with more information. - */ - BaseClient.prototype._prepareEvent = function (event, scope, hint) { - var _this = this; - var _a = this.getOptions(), _b = _a.normalizeDepth, normalizeDepth = _b === void 0 ? 3 : _b, _c = _a.normalizeMaxBreadth, normalizeMaxBreadth = _c === void 0 ? 1000 : _c; - var prepared = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, event), { event_id: event.event_id || (hint && hint.event_id ? hint.event_id : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["uuid4"])()), timestamp: event.timestamp || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["dateTimestampInSeconds"])() }); - this._applyClientOptions(prepared); - this._applyIntegrationsMetadata(prepared); - // If we have scope given to us, use it as the base for further modifications. - // This allows us to prevent unnecessary copying of data if `captureContext` is not provided. - var finalScope = scope; - if (hint && hint.captureContext) { - finalScope = _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["Scope"].clone(finalScope).update(hint.captureContext); + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + captureException(exception, hint, scope) { + // ensure we haven't captured this very object before + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["checkOrSetAlreadyCaught"])(exception)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(ALREADY_SEEN_ERROR); + return; + } + + let eventId = hint && hint.event_id; + + this._process( + this.eventFromException(exception, hint) + .then(event => this._captureEvent(event, hint, scope)) + .then(result => { + eventId = result; + }), + ); + + return eventId; + } + + /** + * @inheritDoc + */ + captureMessage( + message, + // eslint-disable-next-line deprecation/deprecation + level, + hint, + scope, + ) { + let eventId = hint && hint.event_id; + + const promisedEvent = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isPrimitive"])(message) + ? this.eventFromMessage(String(message), level, hint) + : this.eventFromException(message, hint); + + this._process( + promisedEvent + .then(event => this._captureEvent(event, hint, scope)) + .then(result => { + eventId = result; + }), + ); + + return eventId; + } + + /** + * @inheritDoc + */ + captureEvent(event, hint, scope) { + // ensure we haven't captured this very object before + if (hint && hint.originalException && Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["checkOrSetAlreadyCaught"])(hint.originalException)) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(ALREADY_SEEN_ERROR); + return; + } + + let eventId = hint && hint.event_id; + + this._process( + this._captureEvent(event, hint, scope).then(result => { + eventId = result; + }), + ); + + return eventId; + } + + /** + * @inheritDoc + */ + captureSession(session) { + if (!this._isEnabled()) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('SDK not enabled, will not capture session.'); + return; + } + + if (!(typeof session.release === 'string')) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Discarded session because of missing or non-string release'); + } else { + this.sendSession(session); + // After sending, we set init false to indicate it's not the first occurrence + Object(_session_js__WEBPACK_IMPORTED_MODULE_5__["updateSession"])(session, { init: false }); + } + } + + /** + * @inheritDoc + */ + getDsn() { + return this._dsn; + } + + /** + * @inheritDoc + */ + getOptions() { + return this._options; + } + + /** + * @inheritDoc + */ + getTransport() { + return this._transport; + } + + /** + * @inheritDoc + */ + flush(timeout) { + const transport = this._transport; + if (transport) { + return this._isClientDoneProcessing(timeout).then(clientFinished => { + return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed); + }); + } else { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["resolvedSyncPromise"])(true); + } + } + + /** + * @inheritDoc + */ + close(timeout) { + return this.flush(timeout).then(result => { + this.getOptions().enabled = false; + return result; + }); + } + + /** + * Sets up the integrations + */ + setupIntegrations() { + if (this._isEnabled() && !this._integrationsInitialized) { + this._integrations = Object(_integration_js__WEBPACK_IMPORTED_MODULE_3__["setupIntegrations"])(this._options.integrations); + this._integrationsInitialized = true; + } + } + + /** + * Gets an installed integration by its `id`. + * + * @returns The installed integration or `undefined` if no integration with that `id` was installed. + */ + getIntegrationById(integrationId) { + return this._integrations[integrationId]; + } + + /** + * @inheritDoc + */ + getIntegration(integration) { + try { + return (this._integrations[integration.id] ) || null; + } catch (_oO) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn(`Cannot retrieve integration ${integration.id} from the current Client`); + return null; + } + } + + /** + * @inheritDoc + */ + sendEvent(event, hint = {}) { + if (this._dsn) { + let env = Object(_envelope_js__WEBPACK_IMPORTED_MODULE_2__["createEventEnvelope"])(event, this._dsn, this._options._metadata, this._options.tunnel); + + for (const attachment of hint.attachments || []) { + env = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["addItemToEnvelope"])( + env, + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["createAttachmentEnvelopeItem"])( + attachment, + this._options.transportOptions && this._options.transportOptions.textEncoder, + ), + ); + } + + this._sendEnvelope(env); + } + } + + /** + * @inheritDoc + */ + sendSession(session) { + if (this._dsn) { + const env = Object(_envelope_js__WEBPACK_IMPORTED_MODULE_2__["createSessionEnvelope"])(session, this._dsn, this._options._metadata, this._options.tunnel); + this._sendEnvelope(env); + } + } + + /** + * @inheritDoc + */ + recordDroppedEvent(reason, category) { + if (this._options.sendClientReports) { + // We want to track each category (error, transaction, session) separately + // but still keep the distinction between different type of outcomes. + // We could use nested maps, but it's much easier to read and type this way. + // A correct type for map-based implementation if we want to go that route + // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>` + // With typescript 4.1 we could even use template literal types + const key = `${reason}:${category}`; + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(`Adding outcome: "${key}"`); + + // The following works because undefined + 1 === NaN and NaN is falsy + this._outcomes[key] = this._outcomes[key] + 1 || 1; + } + } + + /** Updates existing session based on the provided event */ + _updateSessionFromEvent(session, event) { + let crashed = false; + let errored = false; + const exceptions = event.exception && event.exception.values; + + if (exceptions) { + errored = true; + + for (const ex of exceptions) { + const mechanism = ex.mechanism; + if (mechanism && mechanism.handled === false) { + crashed = true; + break; } - // We prepare the result here with a resolved Event. - var result = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["resolvedSyncPromise"])(prepared); - // This should be the last thing called, since we want that - // {@link Hub.addEventProcessor} gets the finished prepared event. - if (finalScope) { - // In case we have a hub we reassign it. - result = finalScope.applyToEvent(prepared, hint); + } + } + + // A session is updated and that session update is sent in only one of the two following scenarios: + // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update + // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update + const sessionNonTerminal = session.status === 'ok'; + const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed); + + if (shouldUpdateAndSend) { + Object(_session_js__WEBPACK_IMPORTED_MODULE_5__["updateSession"])(session, { + ...(crashed && { status: 'crashed' }), + errors: session.errors || Number(errored || crashed), + }); + this.captureSession(session); + } + } + + /** + * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying + * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. + * + * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not + * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to + * `true`. + * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and + * `false` otherwise + */ + _isClientDoneProcessing(timeout) { + return new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SyncPromise"](resolve => { + let ticked = 0; + const tick = 1; + + const interval = setInterval(() => { + if (this._numProcessing == 0) { + clearInterval(interval); + resolve(true); + } else { + ticked += tick; + if (timeout && ticked >= timeout) { + clearInterval(interval); + resolve(false); + } } - return result.then(function (evt) { - if (evt) { - // TODO this is more of the hack trying to solve https://github.com/getsentry/sentry-javascript/issues/2809 - // it is only attached as extra data to the event if the event somehow skips being normalized - evt.sdkProcessingMetadata = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, evt.sdkProcessingMetadata), { normalizeDepth: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalize"])(normalizeDepth) + " (" + typeof normalizeDepth + ")" }); - } - if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { - return _this._normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); - } - return evt; - }); + }, tick); + }); + } + + /** Determines whether this SDK is enabled and a valid Dsn is present. */ + _isEnabled() { + return this.getOptions().enabled !== false && this._dsn !== undefined; + } + + /** + * Adds common information to events. + * + * The information includes release and environment from `options`, + * breadcrumbs and context (extra, tags and user) from the scope. + * + * Information that is already present in the event is never overwritten. For + * nested objects, such as the context, keys are merged. + * + * @param event The original event. + * @param hint May contain additional information about the original exception. + * @param scope A scope containing event metadata. + * @returns A new event with more information. + */ + _prepareEvent(event, hint, scope) { + const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = this.getOptions(); + const prepared = { + ...event, + event_id: event.event_id || hint.event_id || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["uuid4"])(), + timestamp: event.timestamp || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dateTimestampInSeconds"])(), }; - /** - * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. - * Normalized keys: - * - `breadcrumbs.data` - * - `user` - * - `contexts` - * - `extra` - * @param event Event - * @returns Normalized event - */ - BaseClient.prototype._normalizeEvent = function (event, depth, maxBreadth) { - if (!event) { - return null; - } - var normalized = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, event), (event.breadcrumbs && { - breadcrumbs: event.breadcrumbs.map(function (b) { return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, b), (b.data && { - data: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalize"])(b.data, depth, maxBreadth), - }))); }), - })), (event.user && { - user: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalize"])(event.user, depth, maxBreadth), - })), (event.contexts && { - contexts: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalize"])(event.contexts, depth, maxBreadth), - })), (event.extra && { - extra: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalize"])(event.extra, depth, maxBreadth), - })); - // event.contexts.trace stores information about a Transaction. Similarly, - // event.spans[] stores information about child Spans. Given that a - // Transaction is conceptually a Span, normalization should apply to both - // Transactions and Spans consistently. - // For now the decision is to skip normalization of Transactions and Spans, - // so this block overwrites the normalized event to add back the original - // Transaction information prior to normalization. - if (event.contexts && event.contexts.trace) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - normalized.contexts.trace = event.contexts.trace; - } - normalized.sdkProcessingMetadata = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, normalized.sdkProcessingMetadata), { baseClientNormalized: true }); - return normalized; + + this._applyClientOptions(prepared); + this._applyIntegrationsMetadata(prepared); + + // If we have scope given to us, use it as the base for further modifications. + // This allows us to prevent unnecessary copying of data if `captureContext` is not provided. + let finalScope = scope; + if (hint.captureContext) { + finalScope = _scope_js__WEBPACK_IMPORTED_MODULE_4__["Scope"].clone(finalScope).update(hint.captureContext); + } + + // We prepare the result here with a resolved Event. + let result = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["resolvedSyncPromise"])(prepared); + + // This should be the last thing called, since we want that + // {@link Hub.addEventProcessor} gets the finished prepared event. + if (finalScope) { + // Collect attachments from the hint and scope + const attachments = [...(hint.attachments || []), ...finalScope.getAttachments()]; + + if (attachments.length) { + hint.attachments = attachments; + } + + // In case we have a hub we reassign it. + result = finalScope.applyToEvent(prepared, hint); + } + + return result.then(evt => { + if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { + return this._normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); + } + return evt; + }); + } + + /** + * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. + * Normalized keys: + * - `breadcrumbs.data` + * - `user` + * - `contexts` + * - `extra` + * @param event Event + * @returns Normalized event + */ + _normalizeEvent(event, depth, maxBreadth) { + if (!event) { + return null; + } + + const normalized = { + ...event, + ...(event.breadcrumbs && { + breadcrumbs: event.breadcrumbs.map(b => ({ + ...b, + ...(b.data && { + data: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["normalize"])(b.data, depth, maxBreadth), + }), + })), + }), + ...(event.user && { + user: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["normalize"])(event.user, depth, maxBreadth), + }), + ...(event.contexts && { + contexts: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["normalize"])(event.contexts, depth, maxBreadth), + }), + ...(event.extra && { + extra: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["normalize"])(event.extra, depth, maxBreadth), + }), }; - /** - * Enhances event using the client configuration. - * It takes care of all "static" values like environment, release and `dist`, - * as well as truncating overly long values. - * @param event event instance to be enhanced - */ - BaseClient.prototype._applyClientOptions = function (event) { - var options = this.getOptions(); - var environment = options.environment, release = options.release, dist = options.dist, _a = options.maxValueLength, maxValueLength = _a === void 0 ? 250 : _a; - if (!('environment' in event)) { - event.environment = 'environment' in options ? environment : 'production'; - } - if (event.release === undefined && release !== undefined) { - event.release = release; - } - if (event.dist === undefined && dist !== undefined) { - event.dist = dist; + + // event.contexts.trace stores information about a Transaction. Similarly, + // event.spans[] stores information about child Spans. Given that a + // Transaction is conceptually a Span, normalization should apply to both + // Transactions and Spans consistently. + // For now the decision is to skip normalization of Transactions and Spans, + // so this block overwrites the normalized event to add back the original + // Transaction information prior to normalization. + if (event.contexts && event.contexts.trace && normalized.contexts) { + normalized.contexts.trace = event.contexts.trace; + + // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it + if (event.contexts.trace.data) { + normalized.contexts.trace.data = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["normalize"])(event.contexts.trace.data, depth, maxBreadth); + } + } + + // event.spans[].data may contain circular/dangerous data so we need to normalize it + if (event.spans) { + normalized.spans = event.spans.map(span => { + // We cannot use the spread operator here because `toJSON` on `span` is non-enumerable + if (span.data) { + span.data = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["normalize"])(span.data, depth, maxBreadth); } - if (event.message) { - event.message = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["truncate"])(event.message, maxValueLength); + return span; + }); + } + + return normalized; + } + + /** + * Enhances event using the client configuration. + * It takes care of all "static" values like environment, release and `dist`, + * as well as truncating overly long values. + * @param event event instance to be enhanced + */ + _applyClientOptions(event) { + const options = this.getOptions(); + const { environment, release, dist, maxValueLength = 250 } = options; + + if (!('environment' in event)) { + event.environment = 'environment' in options ? environment : 'production'; + } + + if (event.release === undefined && release !== undefined) { + event.release = release; + } + + if (event.dist === undefined && dist !== undefined) { + event.dist = dist; + } + + if (event.message) { + event.message = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["truncate"])(event.message, maxValueLength); + } + + const exception = event.exception && event.exception.values && event.exception.values[0]; + if (exception && exception.value) { + exception.value = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["truncate"])(exception.value, maxValueLength); + } + + const request = event.request; + if (request && request.url) { + request.url = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["truncate"])(request.url, maxValueLength); + } + } + + /** + * This function adds all used integrations to the SDK info in the event. + * @param event The event that will be filled with all integrations. + */ + _applyIntegrationsMetadata(event) { + const integrationsArray = Object.keys(this._integrations); + if (integrationsArray.length > 0) { + event.sdk = event.sdk || {}; + event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationsArray]; + } + } + + /** + * Processes the event and logs an error in case of rejection + * @param event + * @param hint + * @param scope + */ + _captureEvent(event, hint = {}, scope) { + return this._processEvent(event, hint, scope).then( + finalEvent => { + return finalEvent.event_id; + }, + reason => { + if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) { + // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for + // control flow, log just the message (no stack) as a log-level log. + const sentryError = reason ; + if (sentryError.logLevel === 'log') { + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(sentryError.message); + } else { + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn(sentryError); + } } - var exception = event.exception && event.exception.values && event.exception.values[0]; - if (exception && exception.value) { - exception.value = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["truncate"])(exception.value, maxValueLength); + return undefined; + }, + ); + } + + /** + * Processes an event (either error or message) and sends it to Sentry. + * + * This also adds breadcrumbs and context information to the event. However, + * platform specific meta data (such as the User's IP address) must be added + * by the SDK implementor. + * + * + * @param event The event to send to Sentry. + * @param hint May contain additional information about the original exception. + * @param scope A scope containing event metadata. + * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. + */ + _processEvent(event, hint, scope) { + const options = this.getOptions(); + const { sampleRate } = options; + + if (!this._isEnabled()) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["rejectedSyncPromise"])(new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SentryError"]('SDK not enabled, will not capture event.', 'log')); + } + + const isTransaction = event.type === 'transaction'; + const beforeSendProcessorName = isTransaction ? 'beforeSendTransaction' : 'beforeSend'; + const beforeSendProcessor = options[beforeSendProcessorName]; + + // 1.0 === 100% events are sent + // 0.0 === 0% events are sent + // Sampling for transaction happens somewhere else + if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) { + this.recordDroppedEvent('sample_rate', 'error'); + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["rejectedSyncPromise"])( + new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SentryError"]( + `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`, + 'log', + ), + ); + } + + return this._prepareEvent(event, hint, scope) + .then(prepared => { + if (prepared === null) { + this.recordDroppedEvent('event_processor', event.type || 'error'); + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SentryError"]('An event processor returned `null`, will not send event.', 'log'); } - var request = event.request; - if (request && request.url) { - request.url = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["truncate"])(request.url, maxValueLength); + + const isInternalException = hint.data && (hint.data ).__sentry__ === true; + if (isInternalException || !beforeSendProcessor) { + return prepared; } - }; - /** - * This function adds all used integrations to the SDK info in the event. - * @param event The event that will be filled with all integrations. - */ - BaseClient.prototype._applyIntegrationsMetadata = function (event) { - var integrationsArray = Object.keys(this._integrations); - if (integrationsArray.length > 0) { - event.sdk = event.sdk || {}; - event.sdk.integrations = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((event.sdk.integrations || []), integrationsArray); + + const beforeSendResult = beforeSendProcessor(prepared, hint); + return _validateBeforeSendResult(beforeSendResult, beforeSendProcessorName); + }) + .then(processedEvent => { + if (processedEvent === null) { + this.recordDroppedEvent('before_send', event.type || 'error'); + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SentryError"](`\`${beforeSendProcessorName}\` returned \`null\`, will not send event.`, 'log'); } - }; - /** - * Tells the backend to send this event - * @param event The Sentry event to send - */ - BaseClient.prototype._sendEvent = function (event) { - this._getBackend().sendEvent(event); - }; - /** - * Processes the event and logs an error in case of rejection - * @param event - * @param hint - * @param scope - */ - BaseClient.prototype._captureEvent = function (event, hint, scope) { - return this._processEvent(event, hint, scope).then(function (finalEvent) { - return finalEvent.event_id; - }, function (reason) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].error(reason); - return undefined; - }); - }; - /** - * Processes an event (either error or message) and sends it to Sentry. - * - * This also adds breadcrumbs and context information to the event. However, - * platform specific meta data (such as the User's IP address) must be added - * by the SDK implementor. - * - * - * @param event The event to send to Sentry. - * @param hint May contain additional information about the original exception. - * @param scope A scope containing event metadata. - * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. - */ - BaseClient.prototype._processEvent = function (event, hint, scope) { - var _this = this; - // eslint-disable-next-line @typescript-eslint/unbound-method - var _a = this.getOptions(), beforeSend = _a.beforeSend, sampleRate = _a.sampleRate; - var transport = this.getTransport(); - function recordLostEvent(outcome, category) { - if (transport.recordLostEvent) { - transport.recordLostEvent(outcome, category); - } + + const session = scope && scope.getSession(); + if (!isTransaction && session) { + this._updateSessionFromEvent(session, processedEvent); } - if (!this._isEnabled()) { - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["rejectedSyncPromise"])(new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]('SDK not enabled, will not capture event.')); + + // None of the Sentry built event processor will update transaction name, + // so if the transaction name has been changed by an event processor, we know + // it has to come from custom event processor added by a user + const transactionInfo = processedEvent.transaction_info; + if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) { + const source = 'custom'; + processedEvent.transaction_info = { + ...transactionInfo, + source, + changes: [ + ...transactionInfo.changes, + { + source, + // use the same timestamp as the processed event. + timestamp: processedEvent.timestamp , + propagations: transactionInfo.propagations, + }, + ], + }; } - var isTransaction = event.type === 'transaction'; - // 1.0 === 100% events are sent - // 0.0 === 0% events are sent - // Sampling for transaction happens somewhere else - if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) { - recordLostEvent('sample_rate', 'event'); - return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["rejectedSyncPromise"])(new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]("Discarding event because it's not included in the random sample (sampling rate = " + sampleRate + ")")); + + this.sendEvent(processedEvent, hint); + return processedEvent; + }) + .then(null, reason => { + if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SentryError"]) { + throw reason; } - return this._prepareEvent(event, scope, hint) - .then(function (prepared) { - if (prepared === null) { - recordLostEvent('event_processor', event.type || 'event'); - throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]('An event processor returned null, will not send event.'); - } - var isInternalException = hint && hint.data && hint.data.__sentry__ === true; - if (isInternalException || isTransaction || !beforeSend) { - return prepared; - } - var beforeSendResult = beforeSend(prepared, hint); - return _ensureBeforeSendRv(beforeSendResult); - }) - .then(function (processedEvent) { - if (processedEvent === null) { - recordLostEvent('before_send', event.type || 'event'); - throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]('`beforeSend` returned `null`, will not send event.'); - } - var session = scope && scope.getSession && scope.getSession(); - if (!isTransaction && session) { - _this._updateSessionFromEvent(session, processedEvent); - } - _this._sendEvent(processedEvent); - return processedEvent; - }) - .then(null, function (reason) { - if (reason instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]) { - throw reason; - } - _this.captureException(reason, { - data: { - __sentry__: true, - }, - originalException: reason, - }); - throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: " + reason); - }); - }; - /** - * Occupies the client with processing and event - */ - BaseClient.prototype._process = function (promise) { - var _this = this; - this._numProcessing += 1; - void promise.then(function (value) { - _this._numProcessing -= 1; - return value; - }, function (reason) { - _this._numProcessing -= 1; - return reason; + + this.captureException(reason, { + data: { + __sentry__: true, + }, + originalException: reason , }); - }; - return BaseClient; -}()); + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SentryError"]( + `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`, + ); + }); + } + + /** + * Occupies the client with processing and event + */ + _process(promise) { + this._numProcessing += 1; + void promise.then( + value => { + this._numProcessing -= 1; + return value; + }, + reason => { + this._numProcessing -= 1; + return reason; + }, + ); + } + + /** + * @inheritdoc + */ + _sendEnvelope(envelope) { + if (this._transport && this._dsn) { + this._transport.send(envelope).then(null, reason => { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].error('Error while sending event:', reason); + }); + } else { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].error('Transport disabled'); + } + } + + /** + * Clears outcomes on this client and returns them. + */ + _clearOutcomes() { + const outcomes = this._outcomes; + this._outcomes = {}; + return Object.keys(outcomes).map(key => { + const [reason, category] = key.split(':') ; + return { + reason, + category, + quantity: outcomes[key], + }; + }); + } + + /** + * @inheritDoc + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + +} /** - * Verifies that return value of configured `beforeSend` is of expected type. + * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so. */ -function _ensureBeforeSendRv(rv) { - var nullErr = '`beforeSend` method has to return `null` or a valid event.'; - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isThenable"])(rv)) { - return rv.then(function (event) { - if (!(Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(event) || event === null)) { - throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"](nullErr); - } - return event; - }, function (e) { - throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"]("beforeSend rejected with " + e); - }); - } - else if (!(Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(rv) || rv === null)) { - throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["SentryError"](nullErr); - } - return rv; +function _validateBeforeSendResult( + beforeSendResult, + beforeSendProcessorName, +) { + const invalidValueError = `\`${beforeSendProcessorName}\` must return \`null\` or a valid event.`; + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isThenable"])(beforeSendResult)) { + return beforeSendResult.then( + event => { + if (!Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])(event) && event !== null) { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SentryError"](invalidValueError); + } + return event; + }, + e => { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SentryError"](`\`${beforeSendProcessorName}\` rejected with ${e}`); + }, + ); + } else if (!Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])(beforeSendResult) && beforeSendResult !== null) { + throw new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SentryError"](invalidValueError); + } + return beforeSendResult; } + + //# sourceMappingURL=baseclient.js.map + /***/ }), /***/ "oMw+": @@ -343406,12 +360156,15 @@ $export($export.S, 'Reflect', { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEnvelope", function() { return createEnvelope; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addItemToEnvelope", function() { return addItemToEnvelope; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeType", function() { return getEnvelopeType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAttachmentEnvelopeItem", function() { return createAttachmentEnvelopeItem; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEnvelope", function() { return createEnvelope; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "envelopeItemTypeToDataCategory", function() { return envelopeItemTypeToDataCategory; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEachEnvelopeItem", function() { return forEachEnvelopeItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serializeEnvelope", function() { return serializeEnvelope; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9AQC"); +/* harmony import */ var _normalize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Fffm"); +/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("6PXS"); + /** @@ -343419,46 +360172,136 @@ __webpack_require__.r(__webpack_exports__); * Make sure to always explicitly provide the generic to this function * so that the envelope types resolve correctly. */ -function createEnvelope(headers, items) { - if (items === void 0) { items = []; } - return [headers, items]; +function createEnvelope(headers, items = []) { + return [headers, items] ; } + /** * Add an item to an envelope. * Make sure to always explicitly provide the generic to this function * so that the envelope types resolve correctly. */ function addItemToEnvelope(envelope, newItem) { - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(envelope, 2), headers = _a[0], items = _a[1]; - return [headers, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])(items, [newItem])]; + const [headers, items] = envelope; + return [headers, [...items, newItem]] ; } + /** - * Get the type of the envelope. Grabs the type from the first envelope item. + * Convenience function to loop through the items and item types of an envelope. + * (This function was mostly created because working with envelope types is painful at the moment) */ -function getEnvelopeType(envelope) { - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(envelope, 2), _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_a[1], 1), _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(_b[0], 1), firstItemHeader = _c[0]; - return firstItemHeader.type; +function forEachEnvelopeItem( + envelope, + callback, +) { + const envelopeItems = envelope[1]; + envelopeItems.forEach((envelopeItem) => { + const envelopeItemType = envelopeItem[0].type; + callback(envelopeItem, envelopeItemType); + }); } + +function encodeUTF8(input, textEncoder) { + const utf8 = textEncoder || new TextEncoder(); + return utf8.encode(input); +} + /** - * Serializes an envelope into a string. + * Serializes an envelope. */ -function serializeEnvelope(envelope) { - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(envelope, 2), headers = _a[0], items = _a[1]; - var serializedHeaders = JSON.stringify(headers); - // Have to cast items to any here since Envelope is a union type - // Fixed in Typescript 4.2 - // TODO: Remove any[] cast when we upgrade to TS 4.2 - // https://github.com/microsoft/TypeScript/issues/36390 - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return items.reduce(function (acc, item) { - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(item, 2), itemHeaders = _a[0], payload = _a[1]; - // We do not serialize payloads that are primitives - var serializedPayload = Object(_is__WEBPACK_IMPORTED_MODULE_1__["isPrimitive"])(payload) ? String(payload) : JSON.stringify(payload); - return acc + "\n" + JSON.stringify(itemHeaders) + "\n" + serializedPayload; - }, serializedHeaders); +function serializeEnvelope(envelope, textEncoder) { + const [envHeaders, items] = envelope; + + // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data + let parts = JSON.stringify(envHeaders); + + function append(next) { + if (typeof parts === 'string') { + parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next]; + } else { + parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next); + } + } + + for (const item of items) { + const [itemHeaders, payload] = item; + + append(`\n${JSON.stringify(itemHeaders)}\n`); + + if (typeof payload === 'string' || payload instanceof Uint8Array) { + append(payload); + } else { + let stringifiedPayload; + try { + stringifiedPayload = JSON.stringify(payload); + } catch (e) { + // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still + // fails, we try again after normalizing it again with infinite normalization depth. This of course has a + // performance impact but in this case a performance hit is better than throwing. + stringifiedPayload = JSON.stringify(Object(_normalize_js__WEBPACK_IMPORTED_MODULE_0__["normalize"])(payload)); + } + append(stringifiedPayload); + } + } + + return typeof parts === 'string' ? parts : concatBuffers(parts); +} + +function concatBuffers(buffers) { + const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0); + + const merged = new Uint8Array(totalLength); + let offset = 0; + for (const buffer of buffers) { + merged.set(buffer, offset); + offset += buffer.length; + } + + return merged; } + +/** + * Creates attachment envelope items + */ +function createAttachmentEnvelopeItem( + attachment, + textEncoder, +) { + const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data; + + return [ + Object(_object_js__WEBPACK_IMPORTED_MODULE_1__["dropUndefinedKeys"])({ + type: 'attachment', + length: buffer.length, + filename: attachment.filename, + content_type: attachment.contentType, + attachment_type: attachment.attachmentType, + }), + buffer, + ]; +} + +const ITEM_TYPE_TO_DATA_CATEGORY_MAP = { + session: 'session', + sessions: 'session', + attachment: 'attachment', + transaction: 'transaction', + event: 'error', + client_report: 'internal', + user_report: 'default', +}; + +/** + * Maps the type of an envelope item to a data category. + */ +function envelopeItemTypeToDataCategory(type) { + return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type]; +} + + //# sourceMappingURL=envelope.js.map + /***/ }), /***/ "oZUv": @@ -344486,18 +361329,6 @@ var Stepper = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["forwardRef"](func /***/ }), -/***/ "omaz": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SDK_NAME", function() { return SDK_NAME; }); -// TODO: Remove in the next major release and rely only on @sentry/core SDK_VERSION and SdkInfo metadata -var SDK_NAME = 'sentry.javascript.browser'; -//# sourceMappingURL=version.js.map - -/***/ }), - /***/ "onNx": /***/ (function(module, exports, __webpack_require__) { @@ -345648,16 +362479,17 @@ var FolderView = function FolderView(f) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _functiontostring__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("RDap"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionToString", function() { return _functiontostring__WEBPACK_IMPORTED_MODULE_0__["FunctionToString"]; }); +/* harmony import */ var _functiontostring_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("RDap"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionToString", function() { return _functiontostring_js__WEBPACK_IMPORTED_MODULE_0__["FunctionToString"]; }); -/* harmony import */ var _inboundfilters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("lddD"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InboundFilters", function() { return _inboundfilters__WEBPACK_IMPORTED_MODULE_1__["InboundFilters"]; }); +/* harmony import */ var _inboundfilters_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("lddD"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InboundFilters", function() { return _inboundfilters_js__WEBPACK_IMPORTED_MODULE_1__["InboundFilters"]; }); //# sourceMappingURL=index.js.map + /***/ }), /***/ "oxeV": @@ -349714,6 +366546,28 @@ __webpack_require__("IU+Z")('replace', 2, function (defined, REPLACE, $replace, }); +/***/ }), + +/***/ "pKsO": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forget", function() { return forget; }); +/** + * Consumes the promise and logs the error when it rejects. + * @param promise A promise to forget. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function forget(promise) { + void promise.then(null, function (e) { + // TODO: Use a better logging mechanism + // eslint-disable-next-line no-console + console.error(e); + }); +} +//# sourceMappingURL=async.js.map + /***/ }), /***/ "pL0w": @@ -350378,11 +367232,15 @@ function RemoveScrollSideCar(props) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStackParser", function() { return createStackParser; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripSentryFramesAndReverse", function() { return stripSentryFramesAndReverse; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFunctionName", function() { return getFunctionName; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nodeStackLineParser", function() { return nodeStackLineParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stackParserFromStackParserOptions", function() { return stackParserFromStackParserOptions; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripSentryFramesAndReverse", function() { return stripSentryFramesAndReverse; }); +/* harmony import */ var _buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); + + +const STACKTRACE_LIMIT = 50; -var STACKTRACE_LIMIT = 50; /** * Creates a stack parser with the supplied line parsers * @@ -350390,91 +367248,191 @@ var STACKTRACE_LIMIT = 50; * frames and with Sentry SDK internal frames removed from the top and bottom * */ -function createStackParser() { - var parsers = []; - for (var _i = 0; _i < arguments.length; _i++) { - parsers[_i] = arguments[_i]; - } - var sortedParsers = parsers.sort(function (a, b) { return a[0] - b[0]; }).map(function (p) { return p[1]; }); - return function (stack, skipFirst) { - var e_1, _a, e_2, _b; - if (skipFirst === void 0) { skipFirst = 0; } - var frames = []; - try { - for (var _c = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(stack.split('\n').slice(skipFirst)), _d = _c.next(); !_d.done; _d = _c.next()) { - var line = _d.value; - try { - for (var sortedParsers_1 = (e_2 = void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(sortedParsers)), sortedParsers_1_1 = sortedParsers_1.next(); !sortedParsers_1_1.done; sortedParsers_1_1 = sortedParsers_1.next()) { - var parser = sortedParsers_1_1.value; - var frame = parser(line); - if (frame) { - frames.push(frame); - break; - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (sortedParsers_1_1 && !sortedParsers_1_1.done && (_b = sortedParsers_1.return)) _b.call(sortedParsers_1); - } - finally { if (e_2) throw e_2.error; } - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_1) throw e_1.error; } +function createStackParser(...parsers) { + const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]); + + return (stack, skipFirst = 0) => { + const frames = []; + + for (const line of stack.split('\n').slice(skipFirst)) { + // https://github.com/getsentry/sentry-javascript/issues/5459 + // Remove webpack (error: *) wrappers + const cleanedLine = line.replace(/\(error: (.*)\)/, '$1'); + + for (const parser of sortedParsers) { + const frame = parser(cleanedLine); + + if (frame) { + frames.push(frame); + break; } - return stripSentryFramesAndReverse(frames); - }; + } + } + + return stripSentryFramesAndReverse(frames); + }; +} + +/** + * Gets a stack parser implementation from Options.stackParser + * @see Options + * + * If options contains an array of line parsers, it is converted into a parser + */ +function stackParserFromStackParserOptions(stackParser) { + if (Array.isArray(stackParser)) { + return createStackParser(...stackParser); + } + return stackParser; } + /** * @hidden */ function stripSentryFramesAndReverse(stack) { - if (!stack.length) { - return []; - } - var localStack = stack; - var firstFrameFunction = localStack[0].function || ''; - var lastFrameFunction = localStack[localStack.length - 1].function || ''; - // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call) - if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) { - localStack = localStack.slice(1); - } - // 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) - if (lastFrameFunction.indexOf('sentryWrapped') !== -1) { - localStack = localStack.slice(0, -1); - } - // The frame where the crash happened, should be the last entry in the array - return localStack - .slice(0, STACKTRACE_LIMIT) - .map(function (frame) { return (Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, frame), { filename: frame.filename || localStack[0].filename, function: frame.function || '?' })); }) - .reverse(); + if (!stack.length) { + return []; + } + + let localStack = stack; + + const firstFrameFunction = localStack[0].function || ''; + const lastFrameFunction = localStack[localStack.length - 1].function || ''; + + // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call) + if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) { + localStack = localStack.slice(1); + } + + // 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) + if (lastFrameFunction.indexOf('sentryWrapped') !== -1) { + localStack = localStack.slice(0, -1); + } + + // The frame where the crash happened, should be the last entry in the array + return localStack + .slice(0, STACKTRACE_LIMIT) + .map(frame => ({ + ...frame, + filename: frame.filename || localStack[0].filename, + function: frame.function || '?', + })) + .reverse(); } -var defaultFunctionName = '<anonymous>'; + +const defaultFunctionName = '<anonymous>'; + /** * Safely extract function name from itself */ function getFunctionName(fn) { - try { - if (!fn || typeof fn !== 'function') { - return defaultFunctionName; + try { + if (!fn || typeof fn !== 'function') { + return defaultFunctionName; + } + return fn.name || defaultFunctionName; + } catch (e) { + // Just accessing custom props in some Selenium environments + // can cause a "Permission denied" exception (see raven-js#495). + return defaultFunctionName; + } +} + +// eslint-disable-next-line complexity +function node(getModule) { + const FILENAME_MATCH = /^\s*[-]{4,}$/; + const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/; + + // eslint-disable-next-line complexity + return (line) => { + if (line.match(FILENAME_MATCH)) { + return { + filename: line, + }; + } + + const lineMatch = line.match(FULL_MATCH); + if (!lineMatch) { + return undefined; + } + + let object; + let method; + let functionName; + let typeName; + let methodName; + + if (lineMatch[1]) { + functionName = lineMatch[1]; + + let methodStart = functionName.lastIndexOf('.'); + if (functionName[methodStart - 1] === '.') { + // eslint-disable-next-line no-plusplus + methodStart--; + } + + if (methodStart > 0) { + object = functionName.substr(0, methodStart); + method = functionName.substr(methodStart + 1); + const objectEnd = object.indexOf('.Module'); + if (objectEnd > 0) { + functionName = functionName.substr(objectEnd + 1); + object = object.substr(0, objectEnd); } - return fn.name || defaultFunctionName; + } + typeName = undefined; } - catch (e) { - // Just accessing custom props in some Selenium environments - // can cause a "Permission denied" exception (see raven-js#495). - return defaultFunctionName; + + if (method) { + typeName = object; + methodName = method; } + + if (method === '<anonymous>') { + methodName = undefined; + functionName = undefined; + } + + if (functionName === undefined) { + methodName = methodName || '<anonymous>'; + functionName = typeName ? `${typeName}.${methodName}` : methodName; + } + + const filename = Object(_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([lineMatch, 'access', _ => _[2], 'optionalAccess', _2 => _2.startsWith, 'call', _3 => _3('file://')]) ? lineMatch[2].substr(7) : lineMatch[2]; + const isNative = lineMatch[5] === 'native'; + const isInternal = + isNative || (filename && !filename.startsWith('/') && !filename.startsWith('.') && filename.indexOf(':\\') !== 1); + + // in_app is all that's not an internal Node function or a module within node_modules + // note that isNative appears to return true even for node core libraries + // see https://github.com/getsentry/raven-node/issues/176 + const in_app = !isInternal && filename !== undefined && !filename.includes('node_modules/'); + + return { + filename, + module: Object(_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([getModule, 'optionalCall', _4 => _4(filename)]), + function: functionName, + lineno: parseInt(lineMatch[3], 10) || undefined, + colno: parseInt(lineMatch[4], 10) || undefined, + in_app, + }; + }; } + +/** + * Node.js stack line parser + * + * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. + * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain + */ +function nodeStackLineParser(getModule) { + return [90, node(getModule)]; +} + + //# sourceMappingURL=stacktrace.js.map + /***/ }), /***/ "pRlH": @@ -351332,176 +368290,206 @@ module.exports = head; "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return resolve; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return relative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizePath", function() { return normalizePath; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return basename; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return dirname; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAbsolute", function() { return isAbsolute; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "join", function() { return join; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return dirname; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return basename; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizePath", function() { return normalizePath; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return relative; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return resolve; }); // Slightly modified (no IE8 support, ES6) and transcribed to TypeScript // https://raw.githubusercontent.com/calvinmetcalf/rollup-plugin-node-builtins/master/src/es6/path.js + /** JSDoc */ function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } - else if (last === '..') { - parts.splice(i, 1); - // eslint-disable-next-line no-plusplus - up++; - } - else if (up) { - parts.splice(i, 1); - // eslint-disable-next-line no-plusplus - up--; - } + // if the path tries to go above the root, `up` ends up > 0 + let up = 0; + for (let i = parts.length - 1; i >= 0; i--) { + const last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + // eslint-disable-next-line no-plusplus + up++; + } else if (up) { + parts.splice(i, 1); + // eslint-disable-next-line no-plusplus + up--; } - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - // eslint-disable-next-line no-plusplus - for (; up--; up) { - parts.unshift('..'); - } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + // eslint-disable-next-line no-plusplus + for (; up--; up) { + parts.unshift('..'); } - return parts; + } + + return parts; } + // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. -var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/; +const splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/; /** JSDoc */ function splitPath(filename) { - var parts = splitPathRe.exec(filename); - return parts ? parts.slice(1) : []; + const parts = splitPathRe.exec(filename); + return parts ? parts.slice(1) : []; } + // path.resolve([from ...], to) // posix version /** JSDoc */ -function resolve() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var resolvedPath = ''; - var resolvedAbsolute = false; - for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = i >= 0 ? args[i] : '/'; - // Skip empty entries - if (!path) { - continue; - } - resolvedPath = path + "/" + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; +function resolve(...args) { + let resolvedPath = ''; + let resolvedAbsolute = false; + + for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { + const path = i >= 0 ? args[i] : '/'; + + // Skip empty entries + if (!path) { + continue; } - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - // Normalize the path - resolvedPath = normalizeArray(resolvedPath.split('/').filter(function (p) { return !!p; }), !resolvedAbsolute).join('/'); - return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; + + resolvedPath = `${path}/${resolvedPath}`; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray( + resolvedPath.split('/').filter(p => !!p), + !resolvedAbsolute, + ).join('/'); + + return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; } + /** JSDoc */ function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') { - break; - } - } - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') { - break; - } + let start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') { + break; } - if (start > end) { - return []; + } + + let end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') { + break; } - return arr.slice(start, end - start + 1); + } + + if (start > end) { + return []; + } + return arr.slice(start, end - start + 1); } + // path.relative(from, to) // posix version /** JSDoc */ function relative(from, to) { - /* eslint-disable no-param-reassign */ - from = resolve(from).substr(1); - to = resolve(to).substr(1); - /* eslint-enable no-param-reassign */ - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); + /* eslint-disable no-param-reassign */ + from = resolve(from).substr(1); + to = resolve(to).substr(1); + /* eslint-enable no-param-reassign */ + + const fromParts = trim(from.split('/')); + const toParts = trim(to.split('/')); + + const length = Math.min(fromParts.length, toParts.length); + let samePartsLength = length; + for (let i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; } - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - return outputParts.join('/'); + } + + let outputParts = []; + for (let i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); } + // path.normalize(path) // posix version /** JSDoc */ function normalizePath(path) { - var isPathAbsolute = isAbsolute(path); - var trailingSlash = path.substr(-1) === '/'; - // Normalize the path - var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/'); - if (!normalizedPath && !isPathAbsolute) { - normalizedPath = '.'; - } - if (normalizedPath && trailingSlash) { - normalizedPath += '/'; - } - return (isPathAbsolute ? '/' : '') + normalizedPath; + const isPathAbsolute = isAbsolute(path); + const trailingSlash = path.substr(-1) === '/'; + + // Normalize the path + let normalizedPath = normalizeArray( + path.split('/').filter(p => !!p), + !isPathAbsolute, + ).join('/'); + + if (!normalizedPath && !isPathAbsolute) { + normalizedPath = '.'; + } + if (normalizedPath && trailingSlash) { + normalizedPath += '/'; + } + + return (isPathAbsolute ? '/' : '') + normalizedPath; } + // posix version /** JSDoc */ function isAbsolute(path) { - return path.charAt(0) === '/'; + return path.charAt(0) === '/'; } + // posix version /** JSDoc */ -function join() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return normalizePath(args.join('/')); +function join(...args) { + return normalizePath(args.join('/')); } + /** JSDoc */ function dirname(path) { - var result = splitPath(path); - var root = result[0]; - var dir = result[1]; - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - return root + dir; + const result = splitPath(path); + const root = result[0]; + let dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; } + /** JSDoc */ function basename(path, ext) { - var f = splitPath(path)[2]; - if (ext && f.substr(ext.length * -1) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; + let f = splitPath(path)[2]; + if (ext && f.substr(ext.length * -1) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; } + + //# sourceMappingURL=path.js.map + /***/ }), /***/ "pb3N": @@ -360527,6 +377515,319 @@ function indexOf(xs, x) { /***/ }), +/***/ "rbyU": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GLOBAL_OBJ", function() { return GLOBAL_OBJ; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGlobalObject", function() { return getGlobalObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGlobalSingleton", function() { return getGlobalSingleton; }); +/** Internal global with common properties and Sentry extensions */ + +// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification +// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js +// core-js has the following licence: +// +// Copyright (c) 2014-2022 Denis Pushkarev +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +/** Returns 'obj' if it's the global object, otherwise returns undefined */ +function isGlobalObj(obj) { + return obj && obj.Math == Math ? obj : undefined; +} + +/** Get's the global object for the current JavaScript runtime */ +const 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; + })() || + {}; + +/** + * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8 + */ +function getGlobalObject() { + return GLOBAL_OBJ ; +} + +/** + * Returns a global singleton contained in the global `__SENTRY__` object. + * + * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory + * function and added to the `__SENTRY__` object. + * + * @param name name of the global singleton on __SENTRY__ + * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__` + * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value + * @returns the singleton + */ +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; +} + + +//# sourceMappingURL=worldwide.js.map + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj"))) + +/***/ }), + +/***/ "rcEJ": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exceptionFromError", function() { return exceptionFromError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromPlainObject", function() { return eventFromPlainObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromError", function() { return eventFromError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseStackFrames", function() { return parseStackFrames; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromException", function() { return eventFromException; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromMessage", function() { return eventFromMessage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromUnknownInput", function() { return eventFromUnknownInput; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventFromString", function() { return eventFromString; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("PIsB"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Um2S"); +/* harmony import */ var _stack_parsers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("9nR2"); + + + + +/** + * This function creates an exception from an TraceKitStackTrace + * @param stacktrace TraceKitStackTrace that will be converted to an exception + * @hidden + */ +function exceptionFromError(ex) { + // Get the frames first since Opera can lose the stack if we touch anything else first + var frames = parseStackFrames(ex); + var exception = { + type: ex && ex.name, + value: extractMessage(ex), + }; + if (frames.length) { + exception.stacktrace = { frames: frames }; + } + if (exception.type === undefined && exception.value === '') { + exception.value = 'Unrecoverable error caught'; + } + return exception; +} +/** + * @hidden + */ +function eventFromPlainObject(exception, syntheticException, isUnhandledRejection) { + var event = { + exception: { + values: [ + { + type: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isEvent"])(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error', + value: "Non-Error " + (isUnhandledRejection ? 'promise rejection' : 'exception') + " captured with keys: " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["extractExceptionKeysForMessage"])(exception), + }, + ], + }, + extra: { + __serialized__: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeToSize"])(exception), + }, + }; + if (syntheticException) { + var frames_1 = parseStackFrames(syntheticException); + if (frames_1.length) { + event.stacktrace = { frames: frames_1 }; + } + } + return event; +} +/** + * @hidden + */ +function eventFromError(ex) { + return { + exception: { + values: [exceptionFromError(ex)], + }, + }; +} +/** Parses stack frames from an error */ +function parseStackFrames(ex) { + // Access and store the stacktrace property before doing ANYTHING + // else to it because Opera is not very good at providing it + // reliably in other circumstances. + var stacktrace = ex.stacktrace || ex.stack || ''; + var popSize = getPopSize(ex); + try { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["createStackParser"])(_stack_parsers__WEBPACK_IMPORTED_MODULE_3__["opera10StackParser"], _stack_parsers__WEBPACK_IMPORTED_MODULE_3__["opera11StackParser"], _stack_parsers__WEBPACK_IMPORTED_MODULE_3__["chromeStackParser"], _stack_parsers__WEBPACK_IMPORTED_MODULE_3__["winjsStackParser"], _stack_parsers__WEBPACK_IMPORTED_MODULE_3__["geckoStackParser"])(stacktrace, popSize); + } + catch (e) { + // no-empty + } + return []; +} +// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108 +var reactMinifiedRegexp = /Minified React error #\d+;/i; +function getPopSize(ex) { + if (ex) { + if (typeof ex.framesToPop === 'number') { + return ex.framesToPop; + } + if (reactMinifiedRegexp.test(ex.message)) { + return 1; + } + } + return 0; +} +/** + * There are cases where stacktrace.message is an Event object + * https://github.com/getsentry/sentry-javascript/issues/1949 + * In this specific case we try to extract stacktrace.message.error.message + */ +function extractMessage(ex) { + var message = ex && ex.message; + if (!message) { + return 'No error message'; + } + if (message.error && typeof message.error.message === 'string') { + return message.error.message; + } + return message; +} +/** + * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. + * @hidden + */ +function eventFromException(exception, hint, attachStacktrace) { + var syntheticException = (hint && hint.syntheticException) || undefined; + var event = eventFromUnknownInput(exception, syntheticException, attachStacktrace); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionMechanism"])(event); // defaults to { type: 'generic', handled: true } + event.level = _sentry_types__WEBPACK_IMPORTED_MODULE_1__["Severity"].Error; + if (hint && hint.event_id) { + event.event_id = hint.event_id; + } + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["resolvedSyncPromise"])(event); +} +/** + * Builds and Event from a Message + * @hidden + */ +function eventFromMessage(message, level, hint, attachStacktrace) { + if (level === void 0) { level = _sentry_types__WEBPACK_IMPORTED_MODULE_1__["Severity"].Info; } + var syntheticException = (hint && hint.syntheticException) || undefined; + var event = eventFromString(message, syntheticException, attachStacktrace); + event.level = level; + if (hint && hint.event_id) { + event.event_id = hint.event_id; + } + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["resolvedSyncPromise"])(event); +} +/** + * @hidden + */ +function eventFromUnknownInput(exception, syntheticException, attachStacktrace, isUnhandledRejection) { + var event; + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isErrorEvent"])(exception) && exception.error) { + // If it is an ErrorEvent with `error` property, extract it to get actual Error + var errorEvent = exception; + return eventFromError(errorEvent.error); + } + // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name + // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be + // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`. + // + // https://developer.mozilla.org/en-US/docs/Web/API/DOMError + // https://developer.mozilla.org/en-US/docs/Web/API/DOMException + // https://webidl.spec.whatwg.org/#es-DOMException-specialness + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isDOMError"])(exception) || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isDOMException"])(exception)) { + var domException = exception; + if ('stack' in exception) { + event = eventFromError(exception); + } + else { + var name_1 = domException.name || (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isDOMError"])(domException) ? 'DOMError' : 'DOMException'); + var message = domException.message ? name_1 + ": " + domException.message : name_1; + event = eventFromString(message, syntheticException, attachStacktrace); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionTypeValue"])(event, message); + } + if ('code' in domException) { + event.tags = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, event.tags), { 'DOMException.code': "" + domException.code }); + } + return event; + } + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isError"])(exception)) { + // we have a real Error object, do nothing + return eventFromError(exception); + } + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(exception) || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["isEvent"])(exception)) { + // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize + // it manually. This will allow us to group events based on top-level keys which is much better than creating a new + // group on any key/value change. + var objectException = exception; + event = eventFromPlainObject(objectException, syntheticException, isUnhandledRejection); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionMechanism"])(event, { + synthetic: true, + }); + return event; + } + // If none of previous checks were valid, then it means that it's not: + // - an instance of DOMError + // - an instance of DOMException + // - an instance of Event + // - an instance of Error + // - a valid ErrorEvent (one with an error property) + // - a plain Object + // + // So bail out and capture it as a simple message: + event = eventFromString(exception, syntheticException, attachStacktrace); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionTypeValue"])(event, "" + exception, undefined); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionMechanism"])(event, { + synthetic: true, + }); + return event; +} +/** + * @hidden + */ +function eventFromString(input, syntheticException, attachStacktrace) { + var event = { + message: input, + }; + if (attachStacktrace && syntheticException) { + var frames_2 = parseStackFrames(syntheticException); + if (frames_2.length) { + event.stacktrace = { frames: frames_2 }; + } + } + return event; +} +//# sourceMappingURL=eventbuilder.js.map + +/***/ }), + /***/ "rdqn": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -362794,6 +380095,76 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "rusa": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_asyncOptionalChain", function() { return _asyncOptionalChain; }); +/** + * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, + * descriptors, and functions, for situations in which at least one part of the expression is async. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See + * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 + * + * @param ops Array result of expression conversion + * @returns The value of the expression + */ +// eslint-disable-next-line @sentry-internal/sdk/no-async-await +async function _asyncOptionalChain(ops) { + let lastAccessLHS = undefined; + let value = ops[0]; + let i = 1; + while (i < ops.length) { + const op = ops[i] ; + const fn = ops[i + 1] ; + i += 2; + // by checking for loose equality to `null`, we catch both `null` and `undefined` + if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { + // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it + return; + } + if (op === 'access' || op === 'optionalAccess') { + lastAccessLHS = value; + value = await fn(value); + } else if (op === 'call' || op === 'optionalCall') { + value = await fn((...args) => (value ).call(lastAccessLHS, ...args)); + lastAccessLHS = undefined; + } + } + return value; +} + +// Sucrase version: +// async function _asyncOptionalChain(ops) { +// let lastAccessLHS = undefined; +// let value = ops[0]; +// let i = 1; +// while (i < ops.length) { +// const op = ops[i]; +// const fn = ops[i + 1]; +// i += 2; +// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { +// return undefined; +// } +// if (op === 'access' || op === 'optionalAccess') { +// lastAccessLHS = value; +// value = await fn(value); +// } else if (op === 'call' || op === 'optionalCall') { +// value = await fn((...args) => value.call(lastAccessLHS, ...args)); +// lastAccessLHS = undefined; +// } +// } +// return value; +// } + + +//# sourceMappingURL=_asyncOptionalChain.js.map + + /***/ }), /***/ "rvZc": @@ -362822,6 +380193,48 @@ $export($export.P + $export.F * __webpack_require__("UUeW")(ENDS_WITH), 'String' }); +/***/ }), + +/***/ "rwsT": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_optionalChainDelete", function() { return _optionalChainDelete; }); +/* harmony import */ var _optionalChain_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("fqQG"); + + +/** + * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, + * descriptors, and functions, in cases where the value of the expression is to be deleted. + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See + * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 + * + * @param ops Array result of expression conversion + * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable + * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which + * case `false`. + */ +function _optionalChainDelete(ops) { + const result = Object(_optionalChain_js__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])(ops) ; + // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case, + // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in + // which case we return whatever the `delete` returned, which will be a boolean. + return result == null ? true : result; +} + +// Sucrase version: +// function _optionalChainDelete(ops) { +// const result = _optionalChain(ops); +// // by checking for loose equality to `null`, we catch both `null` and `undefined` +// return result == null ? true : result; +// } + + +//# sourceMappingURL=_optionalChainDelete.js.map + + /***/ }), /***/ "rwtN": @@ -368456,6 +385869,28 @@ util.estimateCores = function(options, callback) { /***/ }), +/***/ "sdzg": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forget", function() { return forget; }); +/** + * Consumes the promise and logs the error when it rejects. + * @param promise A promise to forget. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function forget(promise) { + void promise.then(null, function (e) { + // TODO: Use a better logging mechanism + // eslint-disable-next-line no-console + console.error(e); + }); +} +//# sourceMappingURL=async.js.map + +/***/ }), + /***/ "seXi": /***/ (function(module, exports, __webpack_require__) { @@ -368958,6 +386393,169 @@ Gcm.prototype.zeroBlock = function() { /***/ }), +/***/ "slSt": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dateTimestampInSeconds", function() { return dateTimestampInSeconds; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestampInSeconds", function() { return timestampInSeconds; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestampWithMs", function() { return timestampWithMs; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "usingPerformanceAPI", function() { return usingPerformanceAPI; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_browserPerformanceTimeOriginMode", function() { return _browserPerformanceTimeOriginMode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "browserPerformanceTimeOrigin", function() { return browserPerformanceTimeOrigin; }); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BilH"); +/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Y9XZ"); + + +/** + * A TimestampSource implementation for environments that do not support the Performance Web API natively. + * + * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier + * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It + * is more obvious to explain "why does my span have negative duration" than "why my spans have zero duration". + */ +var dateTimestampSource = { + nowSeconds: function () { return Date.now() / 1000; }, +}; +/** + * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not + * support the API. + * + * Wrapping the native API works around differences in behavior from different browsers. + */ +function getBrowserPerformance() { + var performance = Object(_global__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])().performance; + if (!performance || !performance.now) { + return undefined; + } + // Replace performance.timeOrigin with our own timeOrigin based on Date.now(). + // + // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin + + // performance.now() gives a date arbitrarily in the past. + // + // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is + // undefined. + // + // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to + // interact with data coming out of performance entries. + // + // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that + // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes + // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have + // observed skews that can be as long as days, weeks or months. + // + // See https://github.com/getsentry/sentry-javascript/issues/2590. + // + // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload + // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation + // transactions of long-lived web pages. + var timeOrigin = Date.now() - performance.now(); + return { + now: function () { return performance.now(); }, + timeOrigin: timeOrigin, + }; +} +/** + * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't + * implement the API. + */ +function getNodePerformance() { + try { + var perfHooks = Object(_node__WEBPACK_IMPORTED_MODULE_1__["dynamicRequire"])(module, 'perf_hooks'); + return perfHooks.performance; + } + catch (_) { + return undefined; + } +} +/** + * The Performance API implementation for the current platform, if available. + */ +var platformPerformance = Object(_node__WEBPACK_IMPORTED_MODULE_1__["isNodeEnv"])() ? getNodePerformance() : getBrowserPerformance(); +var timestampSource = platformPerformance === undefined + ? dateTimestampSource + : { + nowSeconds: function () { return (platformPerformance.timeOrigin + platformPerformance.now()) / 1000; }, + }; +/** + * Returns a timestamp in seconds since the UNIX epoch using the Date API. + */ +var dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource); +/** + * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the + * availability of the Performance API. + * + * See `usingPerformanceAPI` to test whether the Performance API is used. + * + * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is + * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The + * skew can grow to arbitrary amounts like days, weeks or months. + * See https://github.com/getsentry/sentry-javascript/issues/2590. + */ +var timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource); +// Re-exported with an old name for backwards-compatibility. +var timestampWithMs = timestampInSeconds; +/** + * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps. + */ +var usingPerformanceAPI = platformPerformance !== undefined; +/** + * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only. + */ +var _browserPerformanceTimeOriginMode; +/** + * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the + * performance API is available. + */ +var browserPerformanceTimeOrigin = (function () { + // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or + // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin + // data as reliable if they are within a reasonable threshold of the current time. + var performance = Object(_global__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])().performance; + if (!performance || !performance.now) { + _browserPerformanceTimeOriginMode = 'none'; + return undefined; + } + var threshold = 3600 * 1000; + var performanceNow = performance.now(); + var dateNow = Date.now(); + // if timeOrigin isn't available set delta to threshold so it isn't used + var timeOriginDelta = performance.timeOrigin + ? Math.abs(performance.timeOrigin + performanceNow - dateNow) + : threshold; + var timeOriginIsReliable = timeOriginDelta < threshold; + // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin + // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. + // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always + // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the + // Date API. + // eslint-disable-next-line deprecation/deprecation + var navigationStart = performance.timing && performance.timing.navigationStart; + var hasNavigationStart = typeof navigationStart === 'number'; + // if navigationStart isn't available set delta to threshold so it isn't used + var navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; + var navigationStartIsReliable = navigationStartDelta < threshold; + if (timeOriginIsReliable || navigationStartIsReliable) { + // Use the more reliable time origin + if (timeOriginDelta <= navigationStartDelta) { + _browserPerformanceTimeOriginMode = 'timeOrigin'; + return performance.timeOrigin; + } + else { + _browserPerformanceTimeOriginMode = 'navigationStart'; + return navigationStart; + } + } + // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date. + _browserPerformanceTimeOriginMode = 'dateNow'; + return dateNow; +})(); +//# sourceMappingURL=time.js.map +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("3UD+")(module))) + +/***/ }), + /***/ "sn8G": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -370848,6 +388446,38 @@ function least(values, compare = _ascending_js__WEBPACK_IMPORTED_MODULE_0__["def } +/***/ }), + +/***/ "tAP+": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserBundle", function() { return isBrowserBundle; }); +/* + * This module exists for optimizations in the build process through rollup and terser. We define some global + * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these + * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will + * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to + * `logger` and preventing node-related code from appearing in browser bundles. + * + * Attention: + * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by + * users. These fags should live in their respective packages, as we identified user tooling (specifically webpack) + * having issues tree-shaking these constants across package boundaries. + * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want + * users to be able to shake away expressions that it guards. + */ +/** + * Figures out if we're building a browser bundle. + * + * @returns true if this is a browser bundle build. + */ +function isBrowserBundle() { + return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__; +} +//# sourceMappingURL=env.js.map + /***/ }), /***/ "tAaO": @@ -373411,6 +391041,42 @@ var ListItem = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["forwardRef"](fun name: 'MuiListItem' })(ListItem)); +/***/ }), + +/***/ "tVrE": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActivationStart", function() { return getActivationStart; }); +/* harmony import */ var _getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("RGXi"); + + +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const getActivationStart = () => { + const navEntry = Object(_getNavigationEntry_js__WEBPACK_IMPORTED_MODULE_0__["getNavigationEntry"])(); + return (navEntry && navEntry.activationStart) || 0; +}; + + +//# sourceMappingURL=getActivationStart.js.map + + /***/ }), /***/ "tXSP": @@ -375935,6 +393601,123 @@ module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2V4Y2VwdGlvbi5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxJQUFNLFVBQVUsR0FBRyxDQUNqQixhQUFhLEVBQ2IsVUFBVSxFQUNWLFlBQVksRUFDWixlQUFlLEVBQ2YsU0FBUyxFQUNULE1BQU0sRUFDTixRQUFRLEVBQ1IsT0FBTyxDQUNSLENBQUM7O0FBRUYsU0FBUyxTQUFTLENBQUMsT0FBTyxFQUFFLElBQUksRUFBRTtBQUNoQyxNQUFJLEdBQUcsR0FBRyxJQUFJLElBQUksSUFBSSxDQUFDLEdBQUc7TUFDeEIsSUFBSSxZQUFBO01BQ0osYUFBYSxZQUFBO01BQ2IsTUFBTSxZQUFBO01BQ04sU0FBUyxZQUFBLENBQUM7O0FBRVosTUFBSSxHQUFHLEVBQUU7QUFDUCxRQUFJLEdBQUcsR0FBRyxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUM7QUFDdEIsaUJBQWEsR0FBRyxHQUFHLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQztBQUM3QixVQUFNLEdBQUcsR0FBRyxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUM7QUFDMUIsYUFBUyxHQUFHLEdBQUcsQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDOztBQUUzQixXQUFPLElBQUksS0FBSyxHQUFHLElBQUksR0FBRyxHQUFHLEdBQUcsTUFBTSxDQUFDO0dBQ3hDOztBQUVELE1BQUksR0FBRyxHQUFHLEtBQUssQ0FBQyxTQUFTLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLENBQUM7OztBQUcxRCxPQUFLLElBQUksR0FBRyxHQUFHLENBQUMsRUFBRSxHQUFHLEdBQUcsVUFBVSxDQUFDLE1BQU0sRUFBRSxHQUFHLEVBQUUsRUFBRTtBQUNoRCxRQUFJLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEdBQUcsR0FBRyxDQUFDLFVBQVUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO0dBQzlDOzs7QUFHRCxNQUFJLEtBQUssQ0FBQyxpQkFBaUIsRUFBRTtBQUMzQixTQUFLLENBQUMsaUJBQWlCLENBQUMsSUFBSSxFQUFFLFNBQVMsQ0FBQyxDQUFDO0dBQzFDOztBQUVELE1BQUk7QUFDRixRQUFJLEdBQUcsRUFBRTtBQUNQLFVBQUksQ0FBQyxVQUFVLEdBQUcsSUFBSSxDQUFDO0FBQ3ZCLFVBQUksQ0FBQyxhQUFhLEdBQUcsYUFBYSxDQUFDOzs7O0FBSW5DLFVBQUksTUFBTSxDQUFDLGNBQWMsRUFBRTtBQUN6QixjQUFNLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxRQUFRLEVBQUU7QUFDcEMsZUFBSyxFQUFFLE1BQU07QUFDYixvQkFBVSxFQUFFLElBQUk7U0FDakIsQ0FBQyxDQUFDO0FBQ0gsY0FBTSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEVBQUUsV0FBVyxFQUFFO0FBQ3ZDLGVBQUssRUFBRSxTQUFTO0FBQ2hCLG9CQUFVLEVBQUUsSUFBSTtTQUNqQixDQUFDLENBQUM7T0FDSixNQUFNO0FBQ0wsWUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7QUFDckIsWUFBSSxDQUFDLFNBQVMsR0FBRyxTQUFTLENBQUM7T0FDNUI7S0FDRjtHQUNGLENBQUMsT0FBTyxHQUFHLEVBQUU7O0dBRWI7Q0FDRjs7QUFFRCxTQUFTLENBQUMsU0FBUyxHQUFHLElBQUksS0FBSyxFQUFFLENBQUM7O3FCQUVuQixTQUFTIiwiZmlsZSI6ImV4Y2VwdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbImNvbnN0IGVycm9yUHJvcHMgPSBbXG4gICdkZXNjcmlwdGlvbicsXG4gICdmaWxlTmFtZScsXG4gICdsaW5lTnVtYmVyJyxcbiAgJ2VuZExpbmVOdW1iZXInLFxuICAnbWVzc2FnZScsXG4gICduYW1lJyxcbiAgJ251bWJlcicsXG4gICdzdGFjaydcbl07XG5cbmZ1bmN0aW9uIEV4Y2VwdGlvbihtZXNzYWdlLCBub2RlKSB7XG4gIGxldCBsb2MgPSBub2RlICYmIG5vZGUubG9jLFxuICAgIGxpbmUsXG4gICAgZW5kTGluZU51bWJlcixcbiAgICBjb2x1bW4sXG4gICAgZW5kQ29sdW1uO1xuXG4gIGlmIChsb2MpIHtcbiAgICBsaW5lID0gbG9jLnN0YXJ0LmxpbmU7XG4gICAgZW5kTGluZU51bWJlciA9IGxvYy5lbmQubGluZTtcbiAgICBjb2x1bW4gPSBsb2Muc3RhcnQuY29sdW1uO1xuICAgIGVuZENvbHVtbiA9IGxvYy5lbmQuY29sdW1uO1xuXG4gICAgbWVzc2FnZSArPSAnIC0gJyArIGxpbmUgKyAnOicgKyBjb2x1bW47XG4gIH1cblxuICBsZXQgdG1wID0gRXJyb3IucHJvdG90eXBlLmNvbnN0cnVjdG9yLmNhbGwodGhpcywgbWVzc2FnZSk7XG5cbiAgLy8gVW5mb3J0dW5hdGVseSBlcnJvcnMgYXJlIG5vdCBlbnVtZXJhYmxlIGluIENocm9tZSAoYXQgbGVhc3QpLCBzbyBgZm9yIHByb3AgaW4gdG1wYCBkb2Vzbid0IHdvcmsuXG4gIGZvciAobGV0IGlkeCA9IDA7IGlkeCA8IGVycm9yUHJvcHMubGVuZ3RoOyBpZHgrKykge1xuICAgIHRoaXNbZXJyb3JQcm9wc1tpZHhdXSA9IHRtcFtlcnJvclByb3BzW2lkeF1dO1xuICB9XG5cbiAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgaWYgKEVycm9yLmNhcHR1cmVTdGFja1RyYWNlKSB7XG4gICAgRXJyb3IuY2FwdHVyZVN0YWNrVHJhY2UodGhpcywgRXhjZXB0aW9uKTtcbiAgfVxuXG4gIHRyeSB7XG4gICAgaWYgKGxvYykge1xuICAgICAgdGhpcy5saW5lTnVtYmVyID0gbGluZTtcbiAgICAgIHRoaXMuZW5kTGluZU51bWJlciA9IGVuZExpbmVOdW1iZXI7XG5cbiAgICAgIC8vIFdvcmsgYXJvdW5kIGlzc3VlIHVuZGVyIHNhZmFyaSB3aGVyZSB3ZSBjYW4ndCBkaXJlY3RseSBzZXQgdGhlIGNvbHVtbiB2YWx1ZVxuICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgIGlmIChPYmplY3QuZGVmaW5lUHJvcGVydHkpIHtcbiAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRoaXMsICdjb2x1bW4nLCB7XG4gICAgICAgICAgdmFsdWU6IGNvbHVtbixcbiAgICAgICAgICBlbnVtZXJhYmxlOiB0cnVlXG4gICAgICAgIH0pO1xuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ2VuZENvbHVtbicsIHtcbiAgICAgICAgICB2YWx1ZTogZW5kQ29sdW1uLFxuICAgICAgICAgIGVudW1lcmFibGU6IHRydWVcbiAgICAgICAgfSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLmNvbHVtbiA9IGNvbHVtbjtcbiAgICAgICAgdGhpcy5lbmRDb2x1bW4gPSBlbmRDb2x1bW47XG4gICAgICB9XG4gICAgfVxuICB9IGNhdGNoIChub3ApIHtcbiAgICAvKiBJZ25vcmUgaWYgdGhlIGJyb3dzZXIgaXMgdmVyeSBwYXJ0aWN1bGFyICovXG4gIH1cbn1cblxuRXhjZXB0aW9uLnByb3RvdHlwZSA9IG5ldyBFcnJvcigpO1xuXG5leHBvcnQgZGVmYXVsdCBFeGNlcHRpb247XG4iXX0= +/***/ }), + +/***/ "tqCS": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "htmlTreeAsString", function() { return htmlTreeAsString; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocationHref", function() { return getLocationHref; }); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ETVo"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("4E6N"); + + +/** + * Given a child DOM element, returns a query-selector statement describing that + * and its ancestors + * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz] + * @returns generated DOM path + */ +function htmlTreeAsString(elem, keyAttrs) { + // try/catch both: + // - accessing event.target (see getsentry/raven-js#838, #768) + // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly + // - can throw an exception in some circumstances. + try { + var currentElem = elem; + var MAX_TRAVERSE_HEIGHT = 5; + var MAX_OUTPUT_LEN = 80; + var out = []; + var height = 0; + var len = 0; + var separator = ' > '; + var sepLength = separator.length; + var nextStr = void 0; + // eslint-disable-next-line no-plusplus + while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { + nextStr = _htmlElementAsString(currentElem, keyAttrs); + // bail out if + // - nextStr is the 'html' element + // - the length of the string that would be created exceeds MAX_OUTPUT_LEN + // (ignore this limit if we are on the first iteration) + if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) { + break; + } + out.push(nextStr); + len += nextStr.length; + currentElem = currentElem.parentNode; + } + return out.reverse().join(separator); + } + catch (_oO) { + return '<unknown>'; + } +} +/** + * Returns a simple, query-selector representation of a DOM element + * e.g. [HTMLElement] => input#foo.btn[name=baz] + * @returns generated DOM path + */ +function _htmlElementAsString(el, keyAttrs) { + var elem = el; + var out = []; + var className; + var classes; + var key; + var attr; + var i; + if (!elem || !elem.tagName) { + return ''; + } + out.push(elem.tagName.toLowerCase()); + // Pairs of attribute keys defined in `serializeAttribute` and their values on element. + var keyAttrPairs = keyAttrs && keyAttrs.length + ? keyAttrs.filter(function (keyAttr) { return elem.getAttribute(keyAttr); }).map(function (keyAttr) { return [keyAttr, elem.getAttribute(keyAttr)]; }) + : null; + if (keyAttrPairs && keyAttrPairs.length) { + keyAttrPairs.forEach(function (keyAttrPair) { + out.push("[" + keyAttrPair[0] + "=\"" + keyAttrPair[1] + "\"]"); + }); + } + else { + if (elem.id) { + out.push("#" + elem.id); + } + // eslint-disable-next-line prefer-const + className = elem.className; + if (className && Object(_is__WEBPACK_IMPORTED_MODULE_1__["isString"])(className)) { + classes = className.split(/\s+/); + for (i = 0; i < classes.length; i++) { + out.push("." + classes[i]); + } + } + } + var allowedAttrs = ['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(''); +} +/** + * A safe form of location.href + */ +function getLocationHref() { + var global = Object(_global__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])(); + try { + return global.document.location.href; + } + catch (oO) { + return ''; + } +} +//# sourceMappingURL=browser.js.map + /***/ }), /***/ "tr08": @@ -380900,6 +398683,174 @@ __webpack_require__.r(__webpack_exports__); //# sourceMappingURL=index.js.map +/***/ }), + +/***/ "v/92": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closeSession", function() { return closeSession; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSession", function() { return makeSession; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateSession", function() { return updateSession; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); + + +/** + * Creates a new `Session` object by setting certain default parameters. If optional @param context + * is passed, the passed properties are applied to the session object. + * + * @param context (optional) additional properties to be applied to the returned session object + * + * @returns a new `Session` object + */ +function makeSession(context) { + // Both timestamp and started are in seconds since the UNIX epoch. + const startingTime = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["timestampInSeconds"])(); + + const session = { + sid: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["uuid4"])(), + init: true, + timestamp: startingTime, + started: startingTime, + duration: 0, + status: 'ok', + errors: 0, + ignoreDuration: false, + toJSON: () => sessionToJSON(session), + }; + + if (context) { + updateSession(session, context); + } + + return session; +} + +/** + * Updates a session object with the properties passed in the context. + * + * Note that this function mutates the passed object and returns void. + * (Had to do this instead of returning a new and updated session because closing and sending a session + * makes an update to the session after it was passed to the sending logic. + * @see BaseClient.captureSession ) + * + * @param session the `Session` to update + * @param context the `SessionContext` holding the properties that should be updated in @param session + */ +// eslint-disable-next-line complexity +function updateSession(session, context = {}) { + if (context.user) { + if (!session.ipAddress && context.user.ip_address) { + session.ipAddress = context.user.ip_address; + } + + if (!session.did && !context.did) { + session.did = context.user.id || context.user.email || context.user.username; + } + } + + session.timestamp = context.timestamp || Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["timestampInSeconds"])(); + + if (context.ignoreDuration) { + session.ignoreDuration = context.ignoreDuration; + } + if (context.sid) { + // Good enough uuid validation. — Kamil + session.sid = context.sid.length === 32 ? context.sid : Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["uuid4"])(); + } + if (context.init !== undefined) { + session.init = context.init; + } + if (!session.did && context.did) { + session.did = `${context.did}`; + } + if (typeof context.started === 'number') { + session.started = context.started; + } + if (session.ignoreDuration) { + session.duration = undefined; + } else if (typeof context.duration === 'number') { + session.duration = context.duration; + } else { + const duration = session.timestamp - session.started; + session.duration = duration >= 0 ? duration : 0; + } + if (context.release) { + session.release = context.release; + } + if (context.environment) { + session.environment = context.environment; + } + if (!session.ipAddress && context.ipAddress) { + session.ipAddress = context.ipAddress; + } + if (!session.userAgent && context.userAgent) { + session.userAgent = context.userAgent; + } + if (typeof context.errors === 'number') { + session.errors = context.errors; + } + if (context.status) { + session.status = context.status; + } +} + +/** + * Closes a session by setting its status and updating the session object with it. + * Internally calls `updateSession` to update the passed session object. + * + * Note that this function mutates the passed session (@see updateSession for explanation). + * + * @param session the `Session` object to be closed + * @param status the `SessionStatus` with which the session was closed. If you don't pass a status, + * this function will keep the previously set status, unless it was `'ok'` in which case + * it is changed to `'exited'`. + */ +function closeSession(session, status) { + let context = {}; + if (status) { + context = { status }; + } else if (session.status === 'ok') { + context = { status: 'exited' }; + } + + updateSession(session, context); +} + +/** + * Serializes a passed session object to a JSON object with a slightly different structure. + * This is necessary because the Sentry backend requires a slightly different schema of a session + * than the one the JS SDKs use internally. + * + * @param session the session to be converted + * + * @returns a JSON object of the passed session + */ +function sessionToJSON(session) { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dropUndefinedKeys"])({ + sid: `${session.sid}`, + init: session.init, + // Make sure that sec is converted to ms for date constructor + started: new Date(session.started * 1000).toISOString(), + timestamp: new Date(session.timestamp * 1000).toISOString(), + status: session.status, + errors: session.errors, + did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined, + duration: session.duration, + attrs: { + release: session.release, + environment: session.environment, + ip_address: session.ipAddress, + user_agent: session.userAgent, + }, + }); +} + + +//# sourceMappingURL=session.js.map + + /***/ }), /***/ "v/rI": @@ -381548,12 +399499,17 @@ __webpack_require__.r(__webpack_exports__); "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "htmlTreeAsString", function() { return htmlTreeAsString; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDomElement", function() { return getDomElement; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocationHref", function() { return getLocationHref; }); -/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("z+RT"); -/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9AQC"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "htmlTreeAsString", function() { return htmlTreeAsString; }); +/* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9AQC"); +/* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("rbyU"); + +// eslint-disable-next-line deprecation/deprecation +const WINDOW = Object(_worldwide_js__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); + /** * Given a child DOM element, returns a query-selector statement describing that * and its ancestors @@ -381561,103 +399517,142 @@ __webpack_require__.r(__webpack_exports__); * @returns generated DOM path */ function htmlTreeAsString(elem, keyAttrs) { - // try/catch both: - // - accessing event.target (see getsentry/raven-js#838, #768) - // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly - // - can throw an exception in some circumstances. - try { - var currentElem = elem; - var MAX_TRAVERSE_HEIGHT = 5; - var MAX_OUTPUT_LEN = 80; - var out = []; - var height = 0; - var len = 0; - var separator = ' > '; - var sepLength = separator.length; - var nextStr = void 0; - // eslint-disable-next-line no-plusplus - while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { - nextStr = _htmlElementAsString(currentElem, keyAttrs); - // bail out if - // - nextStr is the 'html' element - // - the length of the string that would be created exceeds MAX_OUTPUT_LEN - // (ignore this limit if we are on the first iteration) - if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) { - break; - } - out.push(nextStr); - len += nextStr.length; - currentElem = currentElem.parentNode; - } - return out.reverse().join(separator); - } - catch (_oO) { - return '<unknown>'; + + // try/catch both: + // - accessing event.target (see getsentry/raven-js#838, #768) + // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly + // - can throw an exception in some circumstances. + try { + let currentElem = elem ; + const MAX_TRAVERSE_HEIGHT = 5; + const MAX_OUTPUT_LEN = 80; + const out = []; + let height = 0; + let len = 0; + const separator = ' > '; + const sepLength = separator.length; + let nextStr; + + // eslint-disable-next-line no-plusplus + while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { + nextStr = _htmlElementAsString(currentElem, keyAttrs); + // bail out if + // - nextStr is the 'html' element + // - the length of the string that would be created exceeds MAX_OUTPUT_LEN + // (ignore this limit if we are on the first iteration) + if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) { + break; + } + + out.push(nextStr); + + len += nextStr.length; + currentElem = currentElem.parentNode; } + + return out.reverse().join(separator); + } catch (_oO) { + return '<unknown>'; + } } + /** * Returns a simple, query-selector representation of a DOM element * e.g. [HTMLElement] => input#foo.btn[name=baz] * @returns generated DOM path */ function _htmlElementAsString(el, keyAttrs) { - var elem = el; - var out = []; - var className; - var classes; - var key; - var attr; - var i; - if (!elem || !elem.tagName) { - return ''; - } - out.push(elem.tagName.toLowerCase()); - // Pairs of attribute keys defined in `serializeAttribute` and their values on element. - var keyAttrPairs = keyAttrs && keyAttrs.length - ? keyAttrs.filter(function (keyAttr) { return elem.getAttribute(keyAttr); }).map(function (keyAttr) { return [keyAttr, elem.getAttribute(keyAttr)]; }) - : null; - if (keyAttrPairs && keyAttrPairs.length) { - keyAttrPairs.forEach(function (keyAttrPair) { - out.push("[" + keyAttrPair[0] + "=\"" + keyAttrPair[1] + "\"]"); - }); + const elem = el + +; + + const out = []; + let className; + let classes; + let key; + let attr; + let i; + + if (!elem || !elem.tagName) { + return ''; + } + + out.push(elem.tagName.toLowerCase()); + + // Pairs of attribute keys defined in `serializeAttribute` and their values on element. + 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}`); } - else { - if (elem.id) { - out.push("#" + elem.id); - } - // eslint-disable-next-line prefer-const - className = elem.className; - if (className && Object(_is__WEBPACK_IMPORTED_MODULE_1__["isString"])(className)) { - classes = className.split(/\s+/); - for (i = 0; i < classes.length; i++) { - out.push("." + classes[i]); - } - } + + // eslint-disable-next-line prefer-const + className = elem.className; + if (className && Object(_is_js__WEBPACK_IMPORTED_MODULE_0__["isString"])(className)) { + classes = className.split(/\s+/); + for (i = 0; i < classes.length; i++) { + out.push(`.${classes[i]}`); + } } - var allowedAttrs = ['type', 'name', 'title', 'alt']; - for (i = 0; i < allowedAttrs.length; i++) { - key = allowedAttrs[i]; - attr = elem.getAttribute(key); - if (attr) { - out.push("[" + key + "=\"" + attr + "\"]"); - } + } + const allowedAttrs = ['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(''); + } + return out.join(''); } + /** * A safe form of location.href */ function getLocationHref() { - var global = Object(_global__WEBPACK_IMPORTED_MODULE_0__["getGlobalObject"])(); - try { - return global.document.location.href; - } - catch (oO) { - return ''; - } + try { + return WINDOW.document.location.href; + } catch (oO) { + return ''; + } } + +/** + * Gets a DOM element by using document.querySelector. + * + * This wrapper will first check for the existance of the function before + * actually calling it so that we don't have to take care of this check, + * every time we want to access the DOM. + * + * Reason: DOM/querySelector is not available in all environments. + * + * We have to cast to any because utils can be consumed by a variety of environments, + * and we don't want to break TS users. If you know what element will be selected by + * `document.querySelector`, specify it as part of the generic call. For example, + * `const element = getDomElement<Element>('selector');` + * + * @param selector the selector string passed on to document.querySelector + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function getDomElement(selector) { + if (WINDOW.document && WINDOW.document.querySelector) { + return WINDOW.document.querySelector(selector) ; + } + return null; +} + + //# sourceMappingURL=browser.js.map + /***/ }), /***/ "vHEj": @@ -382053,6 +400048,560 @@ function circleRadius(cosRadius, point) { }); +/***/ }), + +/***/ "vOz9": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return Scope; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return addGlobalEventProcessor; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("v/92"); + + + +/** + * Default value for maximum number of breadcrumbs added to an event. + */ +const DEFAULT_MAX_BREADCRUMBS = 100; + +/** + * Holds additional event information. {@link Scope.applyToEvent} will be + * called by the client before an event will be sent. + */ +class Scope { + /** Flag if notifying is happening. */ + + /** Callback for client to receive scope changes. */ + + /** Callback list that will be called after {@link applyToEvent}. */ + + /** Array of breadcrumbs. */ + + /** User */ + + /** Tags */ + + /** Extra */ + + /** Contexts */ + + /** Attachments */ + + /** + * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get + * sent to Sentry + */ + + /** Fingerprint */ + + /** Severity */ + // eslint-disable-next-line deprecation/deprecation + + /** Transaction Name */ + + /** Span */ + + /** Session */ + + /** Request Mode Session Status */ + + // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. + + constructor() { + this._notifyingListeners = false; + this._scopeListeners = []; + this._eventProcessors = []; + this._breadcrumbs = []; + this._attachments = []; + this._user = {}; + this._tags = {}; + this._extra = {}; + this._contexts = {}; + this._sdkProcessingMetadata = {}; + } + + /** + * Inherit values from the parent scope. + * @param scope to clone. + */ + static clone(scope) { + const newScope = new Scope(); + if (scope) { + newScope._breadcrumbs = [...scope._breadcrumbs]; + newScope._tags = { ...scope._tags }; + newScope._extra = { ...scope._extra }; + newScope._contexts = { ...scope._contexts }; + newScope._user = scope._user; + newScope._level = scope._level; + newScope._span = scope._span; + newScope._session = scope._session; + newScope._transactionName = scope._transactionName; + newScope._fingerprint = scope._fingerprint; + newScope._eventProcessors = [...scope._eventProcessors]; + newScope._requestSession = scope._requestSession; + newScope._attachments = [...scope._attachments]; + newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata }; + } + return newScope; + } + + /** + * Add internal on change listener. Used for sub SDKs that need to store the scope. + * @hidden + */ + addScopeListener(callback) { + this._scopeListeners.push(callback); + } + + /** + * @inheritDoc + */ + addEventProcessor(callback) { + this._eventProcessors.push(callback); + return this; + } + + /** + * @inheritDoc + */ + setUser(user) { + this._user = user || {}; + if (this._session) { + Object(_session_js__WEBPACK_IMPORTED_MODULE_1__["updateSession"])(this._session, { user }); + } + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + getUser() { + return this._user; + } + + /** + * @inheritDoc + */ + getRequestSession() { + return this._requestSession; + } + + /** + * @inheritDoc + */ + setRequestSession(requestSession) { + this._requestSession = requestSession; + return this; + } + + /** + * @inheritDoc + */ + setTags(tags) { + this._tags = { + ...this._tags, + ...tags, + }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setTag(key, value) { + this._tags = { ...this._tags, [key]: value }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setExtras(extras) { + this._extra = { + ...this._extra, + ...extras, + }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setExtra(key, extra) { + this._extra = { ...this._extra, [key]: extra }; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setFingerprint(fingerprint) { + this._fingerprint = fingerprint; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setLevel( + // eslint-disable-next-line deprecation/deprecation + level, + ) { + this._level = level; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setTransactionName(name) { + this._transactionName = name; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setContext(key, context) { + if (context === null) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this._contexts[key]; + } else { + this._contexts[key] = context; + } + + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + setSpan(span) { + this._span = span; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + getSpan() { + return this._span; + } + + /** + * @inheritDoc + */ + getTransaction() { + // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will + // have a pointer to the currently-active transaction. + const span = this.getSpan(); + return span && span.transaction; + } + + /** + * @inheritDoc + */ + setSession(session) { + if (!session) { + delete this._session; + } else { + this._session = session; + } + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + getSession() { + return this._session; + } + + /** + * @inheritDoc + */ + update(captureContext) { + if (!captureContext) { + return this; + } + + if (typeof captureContext === 'function') { + const updatedScope = (captureContext )(this); + return updatedScope instanceof Scope ? updatedScope : this; + } + + if (captureContext instanceof Scope) { + this._tags = { ...this._tags, ...captureContext._tags }; + this._extra = { ...this._extra, ...captureContext._extra }; + this._contexts = { ...this._contexts, ...captureContext._contexts }; + if (captureContext._user && Object.keys(captureContext._user).length) { + this._user = captureContext._user; + } + if (captureContext._level) { + this._level = captureContext._level; + } + if (captureContext._fingerprint) { + this._fingerprint = captureContext._fingerprint; + } + if (captureContext._requestSession) { + this._requestSession = captureContext._requestSession; + } + } else if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])(captureContext)) { + // eslint-disable-next-line no-param-reassign + captureContext = captureContext ; + this._tags = { ...this._tags, ...captureContext.tags }; + this._extra = { ...this._extra, ...captureContext.extra }; + this._contexts = { ...this._contexts, ...captureContext.contexts }; + if (captureContext.user) { + this._user = captureContext.user; + } + if (captureContext.level) { + this._level = captureContext.level; + } + if (captureContext.fingerprint) { + this._fingerprint = captureContext.fingerprint; + } + if (captureContext.requestSession) { + this._requestSession = captureContext.requestSession; + } + } + + return this; + } + + /** + * @inheritDoc + */ + clear() { + this._breadcrumbs = []; + this._tags = {}; + this._extra = {}; + this._user = {}; + this._contexts = {}; + this._level = undefined; + this._transactionName = undefined; + this._fingerprint = undefined; + this._requestSession = undefined; + this._span = undefined; + this._session = undefined; + this._notifyScopeListeners(); + this._attachments = []; + return this; + } + + /** + * @inheritDoc + */ + addBreadcrumb(breadcrumb, maxBreadcrumbs) { + const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS; + + // No data has been changed, so don't notify scope listeners + if (maxCrumbs <= 0) { + return this; + } + + const mergedBreadcrumb = { + timestamp: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dateTimestampInSeconds"])(), + ...breadcrumb, + }; + this._breadcrumbs = [...this._breadcrumbs, mergedBreadcrumb].slice(-maxCrumbs); + this._notifyScopeListeners(); + + return this; + } + + /** + * @inheritDoc + */ + clearBreadcrumbs() { + this._breadcrumbs = []; + this._notifyScopeListeners(); + return this; + } + + /** + * @inheritDoc + */ + addAttachment(attachment) { + this._attachments.push(attachment); + return this; + } + + /** + * @inheritDoc + */ + getAttachments() { + return this._attachments; + } + + /** + * @inheritDoc + */ + clearAttachments() { + this._attachments = []; + return this; + } + + /** + * Applies data from the scope to the event and runs all event processors on it. + * + * @param event Event + * @param hint Object containing additional information about the original exception, for use by the event processors. + * @hidden + */ + applyToEvent(event, hint = {}) { + if (this._extra && Object.keys(this._extra).length) { + event.extra = { ...this._extra, ...event.extra }; + } + if (this._tags && Object.keys(this._tags).length) { + event.tags = { ...this._tags, ...event.tags }; + } + if (this._user && Object.keys(this._user).length) { + event.user = { ...this._user, ...event.user }; + } + if (this._contexts && Object.keys(this._contexts).length) { + event.contexts = { ...this._contexts, ...event.contexts }; + } + if (this._level) { + event.level = this._level; + } + if (this._transactionName) { + event.transaction = this._transactionName; + } + + // We want to set the trace context for normal events only if there isn't already + // a trace context on the event. There is a product feature in place where we link + // errors with transaction and it relies on that. + if (this._span) { + event.contexts = { trace: this._span.getTraceContext(), ...event.contexts }; + const transactionName = this._span.transaction && this._span.transaction.name; + if (transactionName) { + event.tags = { transaction: transactionName, ...event.tags }; + } + } + + this._applyFingerprint(event); + + event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs]; + event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined; + + event.sdkProcessingMetadata = { ...event.sdkProcessingMetadata, ...this._sdkProcessingMetadata }; + + return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint); + } + + /** + * Add data which will be accessible during event processing but won't get sent to Sentry + */ + setSDKProcessingMetadata(newData) { + this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData }; + + return this; + } + + /** + * This will be called after {@link applyToEvent} is finished. + */ + _notifyEventProcessors( + processors, + event, + hint, + index = 0, + ) { + return new _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["SyncPromise"]((resolve, reject) => { + const processor = processors[index]; + if (event === null || typeof processor !== 'function') { + resolve(event); + } else { + const result = processor({ ...event }, hint) ; + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + processor.id && + result === null && + _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(`Event processor "${processor.id}" dropped event`); + + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["isThenable"])(result)) { + void result + .then(final => this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve)) + .then(null, reject); + } else { + void this._notifyEventProcessors(processors, result, hint, index + 1) + .then(resolve) + .then(null, reject); + } + } + }); + } + + /** + * This will be called on every set call. + */ + _notifyScopeListeners() { + // We need this check for this._notifyingListeners to be able to work on scope during updates + // If this check is not here we'll produce endless recursion when something is done with the scope + // during the callback. + if (!this._notifyingListeners) { + this._notifyingListeners = true; + this._scopeListeners.forEach(callback => { + callback(this); + }); + this._notifyingListeners = false; + } + } + + /** + * Applies fingerprint from the scope to the event if there's one, + * uses message if there's one instead or get rid of empty fingerprint + */ + _applyFingerprint(event) { + // Make sure it's an array first and we actually have something in place + event.fingerprint = event.fingerprint ? Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["arrayify"])(event.fingerprint) : []; + + // If we have something on the scope, then merge it with event + if (this._fingerprint) { + event.fingerprint = event.fingerprint.concat(this._fingerprint); + } + + // If we have no data at all, remove empty array default + if (event.fingerprint && !event.fingerprint.length) { + delete event.fingerprint; + } + } +} + +/** + * Returns the global event processors. + */ +function getGlobalEventProcessors() { + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getGlobalSingleton"])('globalEventProcessors', () => []); +} + +/** + * Add a EventProcessor to be kept globally. + * @param callback EventProcessor to add + */ +function addGlobalEventProcessor(callback) { + getGlobalEventProcessors().push(callback); +} + + +//# sourceMappingURL=scope.js.map + + /***/ }), /***/ "vRGJ": @@ -384602,166 +403151,168 @@ exports.getQualification = getQualification; "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldIgnoreOnError", function() { return shouldIgnoreOnError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WINDOW", function() { return WINDOW; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreNextOnError", function() { return ignoreNextOnError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldIgnoreOnError", function() { return shouldIgnoreOnError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectReportDialog", function() { return injectReportDialog; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TwdF"); -/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("3Uor"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("wBhU"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +const WINDOW = _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["GLOBAL_OBJ"] ; + +let ignoreOnError = 0; -var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); -var ignoreOnError = 0; /** * @hidden */ function shouldIgnoreOnError() { - return ignoreOnError > 0; + return ignoreOnError > 0; } + /** * @hidden */ function ignoreNextOnError() { - // onerror should trigger before setTimeout - ignoreOnError += 1; - setTimeout(function () { - ignoreOnError -= 1; - }); + // onerror should trigger before setTimeout + ignoreOnError += 1; + setTimeout(() => { + ignoreOnError -= 1; + }); } + /** * Instruments the given function and sends an event to Sentry every time the * function throws an exception. * - * @param fn A function to wrap. + * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always + * has a correct `this` context. * @returns The wrapped function. * @hidden */ -function wrap(fn, options, before) { - // for future readers what this does is wrap a function and then create - // a bi-directional wrapping between them. - // - // example: wrapped = wrap(original); - // original.__sentry_wrapped__ -> wrapped - // wrapped.__sentry_original__ -> original - if (options === void 0) { options = {}; } - if (typeof fn !== 'function') { - return fn; - } - try { - // if we're dealing with a function that was previously wrapped, return - // the original wrapper. - var wrapper = fn.__sentry_wrapped__; - if (wrapper) { - return wrapper; - } - // We don't wanna wrap it twice - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["getOriginalFunction"])(fn)) { - return fn; - } +function wrap( + fn, + options + + = {}, + before, + // eslint-disable-next-line @typescript-eslint/no-explicit-any +) { + // for future readers what this does is wrap a function and then create + // a bi-directional wrapping between them. + // + // example: wrapped = wrap(original); + // original.__sentry_wrapped__ -> wrapped + // wrapped.__sentry_original__ -> original + + if (typeof fn !== 'function') { + return fn; + } + + try { + // if we're dealing with a function that was previously wrapped, return + // the original wrapper. + const wrapper = fn.__sentry_wrapped__; + if (wrapper) { + return wrapper; } - catch (e) { - // Just accessing custom props in some Selenium environments - // can cause a "Permission denied" exception (see raven-js#495). - // Bail on wrapping and return the function as-is (defers to window.onerror). - return fn; + + // We don't wanna wrap it twice + if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getOriginalFunction"])(fn)) { + return fn; } - /* eslint-disable prefer-rest-params */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var sentryWrapped = function () { - var args = Array.prototype.slice.call(arguments); - try { - if (before && typeof before === 'function') { - before.apply(this, arguments); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access - var wrappedArguments = args.map(function (arg) { return wrap(arg, options); }); - // Attempt to invoke user-land function - // NOTE: If you are a Sentry user, and you are seeing this stack frame, it - // means the sentry.javascript SDK caught an error invoking your application code. This - // is expected behavior and NOT indicative of a bug with sentry.javascript. - return fn.apply(this, wrappedArguments); - } - catch (ex) { - ignoreNextOnError(); - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["withScope"])(function (scope) { - scope.addEventProcessor(function (event) { - if (options.mechanism) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionTypeValue"])(event, undefined, undefined); - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addExceptionMechanism"])(event, options.mechanism); - } - event.extra = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, event.extra), { arguments: args }); - return event; - }); - Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["captureException"])(ex); - }); - throw ex; - } - }; - /* eslint-enable prefer-rest-params */ - // Accessing some objects may throw - // ref: https://github.com/getsentry/sentry-javascript/issues/1168 + } catch (e) { + // Just accessing custom props in some Selenium environments + // can cause a "Permission denied" exception (see raven-js#495). + // Bail on wrapping and return the function as-is (defers to window.onerror). + return fn; + } + + /* eslint-disable prefer-rest-params */ + // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this` + const sentryWrapped = function () { + const args = Array.prototype.slice.call(arguments); + try { - for (var property in fn) { - if (Object.prototype.hasOwnProperty.call(fn, property)) { - sentryWrapped[property] = fn[property]; - } - } + if (before && typeof before === 'function') { + before.apply(this, arguments); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access + const wrappedArguments = args.map((arg) => wrap(arg, options)); + + // Attempt to invoke user-land function + // NOTE: If you are a Sentry user, and you are seeing this stack frame, it + // means the sentry.javascript SDK caught an error invoking your application code. This + // is expected behavior and NOT indicative of a bug with sentry.javascript. + return fn.apply(this, wrappedArguments); + } catch (ex) { + ignoreNextOnError(); + + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["withScope"])((scope) => { + scope.addEventProcessor((event) => { + if (options.mechanism) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addExceptionTypeValue"])(event, undefined, undefined); + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addExceptionMechanism"])(event, options.mechanism); + } + + event.extra = { + ...event.extra, + arguments: args, + }; + + return event; + }); + + Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__["captureException"])(ex); + }); + + throw ex; } - catch (_oO) { } // eslint-disable-line no-empty - // Signal that this function has been wrapped/filled already - // for both debugging and to prevent it to being wrapped/filled twice - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["markFunctionWrapped"])(sentryWrapped, fn); - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_2__["addNonEnumerableProperty"])(fn, '__sentry_wrapped__', sentryWrapped); - // Restore original function name (not all browsers allow that) - try { - var descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name'); - if (descriptor.configurable) { - Object.defineProperty(sentryWrapped, 'name', { - get: function () { - return fn.name; - }, - }); - } - // eslint-disable-next-line no-empty + }; + /* eslint-enable prefer-rest-params */ + + // Accessing some objects may throw + // ref: https://github.com/getsentry/sentry-javascript/issues/1168 + try { + for (const property in fn) { + if (Object.prototype.hasOwnProperty.call(fn, property)) { + sentryWrapped[property] = fn[property]; + } } - catch (_oO) { } - return sentryWrapped; + } catch (_oO) {} // eslint-disable-line no-empty + + // Signal that this function has been wrapped/filled already + // for both debugging and to prevent it to being wrapped/filled twice + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["markFunctionWrapped"])(sentryWrapped, fn); + + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["addNonEnumerableProperty"])(fn, '__sentry_wrapped__', sentryWrapped); + + // Restore original function name (not all browsers allow that) + try { + const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') ; + if (descriptor.configurable) { + Object.defineProperty(sentryWrapped, 'name', { + get() { + return fn.name; + }, + }); + } + // eslint-disable-next-line no-empty + } catch (_oO) {} + + return sentryWrapped; } + /** - * Injects the Report Dialog script - * @hidden + * All properties the report dialog supports */ -function injectReportDialog(options) { - if (options === void 0) { options = {}; } - if (!global.document) { - return; - } - if (!options.eventId) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].error('Missing eventId option in showReportDialog call'); - return; - } - if (!options.dsn) { - _flags__WEBPACK_IMPORTED_MODULE_3__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_2__["logger"].error('Missing dsn option in showReportDialog call'); - return; - } - var script = global.document.createElement('script'); - script.async = true; - script.src = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getReportDialogEndpoint"])(options.dsn, options); - if (options.onLoad) { - // eslint-disable-next-line @typescript-eslint/unbound-method - script.onload = options.onLoad; - } - var injectionPoint = global.document.head || global.document.body; - if (injectionPoint) { - injectionPoint.appendChild(script); - } -} + + //# sourceMappingURL=helpers.js.map + /***/ }), /***/ "w+nw": @@ -385536,86 +404087,91 @@ function createChainedFunction() { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("gtzJ"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["addBreadcrumb"]; }); +/* harmony import */ var _exports_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("AsUd"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBreadcrumb", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["addBreadcrumb"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["captureException"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["captureEvent"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureEvent", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["captureEvent"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureException", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["captureException"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["captureMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "captureMessage", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["captureMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["configureScope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "configureScope", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["configureScope"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["startTransaction"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["setContext"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setContext"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["setExtra"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtra", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setExtra"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["setExtras"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setExtras", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setExtras"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["setTag"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTag", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setTag"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["setTags"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTags", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setTags"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["setUser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setUser", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["setUser"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startTransaction", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["startTransaction"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return _sentry_minimal__WEBPACK_IMPORTED_MODULE_0__["withScope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withScope", function() { return _exports_js__WEBPACK_IMPORTED_MODULE_0__["withScope"]; }); -/* harmony import */ var _sentry_hub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("uzXi"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["addGlobalEventProcessor"]; }); +/* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("GIgW"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return _hub_js__WEBPACK_IMPORTED_MODULE_1__["Hub"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCurrentHub", function() { return _hub_js__WEBPACK_IMPORTED_MODULE_1__["getCurrentHub"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["getHubFromCarrier"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getHubFromCarrier", function() { return _hub_js__WEBPACK_IMPORTED_MODULE_1__["getHubFromCarrier"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hub", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["Hub"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMainCarrier", function() { return _hub_js__WEBPACK_IMPORTED_MODULE_1__["getMainCarrier"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["makeMain"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeMain", function() { return _hub_js__WEBPACK_IMPORTED_MODULE_1__["makeMain"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["Scope"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setHubOnCarrier", function() { return _hub_js__WEBPACK_IMPORTED_MODULE_1__["setHubOnCarrier"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Session", function() { return _sentry_hub__WEBPACK_IMPORTED_MODULE_1__["Session"]; }); +/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("v/92"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "closeSession", function() { return _session_js__WEBPACK_IMPORTED_MODULE_2__["closeSession"]; }); -/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("3MsT"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "API", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["API"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSession", function() { return _session_js__WEBPACK_IMPORTED_MODULE_2__["makeSession"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeEndpointWithUrlEncodedAuth", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["getEnvelopeEndpointWithUrlEncodedAuth"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateSession", function() { return _session_js__WEBPACK_IMPORTED_MODULE_2__["updateSession"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStoreEndpointWithUrlEncodedAuth", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["getStoreEndpointWithUrlEncodedAuth"]; }); +/* harmony import */ var _sessionflusher_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("c0vI"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SessionFlusher", function() { return _sessionflusher_js__WEBPACK_IMPORTED_MODULE_3__["SessionFlusher"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRequestHeaders", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["getRequestHeaders"]; }); +/* harmony import */ var _scope_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("vOz9"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return _scope_js__WEBPACK_IMPORTED_MODULE_4__["Scope"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initAPIDetails", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["initAPIDetails"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalEventProcessor", function() { return _scope_js__WEBPACK_IMPORTED_MODULE_4__["addGlobalEventProcessor"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getReportDialogEndpoint", function() { return _api__WEBPACK_IMPORTED_MODULE_2__["getReportDialogEndpoint"]; }); +/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("3MsT"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvelopeEndpointWithUrlEncodedAuth", function() { return _api_js__WEBPACK_IMPORTED_MODULE_5__["getEnvelopeEndpointWithUrlEncodedAuth"]; }); -/* harmony import */ var _baseclient__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("oMcV"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseClient", function() { return _baseclient__WEBPACK_IMPORTED_MODULE_3__["BaseClient"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getReportDialogEndpoint", function() { return _api_js__WEBPACK_IMPORTED_MODULE_5__["getReportDialogEndpoint"]; }); -/* harmony import */ var _basebackend__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("/3cH"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseBackend", function() { return _basebackend__WEBPACK_IMPORTED_MODULE_4__["BaseBackend"]; }); +/* harmony import */ var _baseclient_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("oMcV"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseClient", function() { return _baseclient_js__WEBPACK_IMPORTED_MODULE_6__["BaseClient"]; }); -/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("KRiW"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventToSentryRequest", function() { return _request__WEBPACK_IMPORTED_MODULE_5__["eventToSentryRequest"]; }); +/* harmony import */ var _sdk_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("QQmx"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initAndBind", function() { return _sdk_js__WEBPACK_IMPORTED_MODULE_7__["initAndBind"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sessionToSentryRequest", function() { return _request__WEBPACK_IMPORTED_MODULE_5__["sessionToSentryRequest"]; }); +/* harmony import */ var _transports_base_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("F+4+"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createTransport", function() { return _transports_base_js__WEBPACK_IMPORTED_MODULE_8__["createTransport"]; }); -/* harmony import */ var _sdk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("QQmx"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initAndBind", function() { return _sdk__WEBPACK_IMPORTED_MODULE_6__["initAndBind"]; }); +/* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("+KVS"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return _version_js__WEBPACK_IMPORTED_MODULE_9__["SDK_VERSION"]; }); -/* harmony import */ var _transports_noop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("31uO"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NoopTransport", function() { return _transports_noop__WEBPACK_IMPORTED_MODULE_7__["NoopTransport"]; }); +/* harmony import */ var _integration_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("METY"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getIntegrationsToSetup", function() { return _integration_js__WEBPACK_IMPORTED_MODULE_10__["getIntegrationsToSetup"]; }); + +/* harmony import */ var _integrations_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("ox7Z"); +/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "Integrations", function() { return _integrations_index_js__WEBPACK_IMPORTED_MODULE_11__; }); +/* harmony import */ var _integrations_functiontostring_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("RDap"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionToString", function() { return _integrations_functiontostring_js__WEBPACK_IMPORTED_MODULE_12__["FunctionToString"]; }); + +/* harmony import */ var _integrations_inboundfilters_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("lddD"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InboundFilters", function() { return _integrations_inboundfilters_js__WEBPACK_IMPORTED_MODULE_13__["InboundFilters"]; }); -/* harmony import */ var _transports_base__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("F+4+"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createTransport", function() { return _transports_base__WEBPACK_IMPORTED_MODULE_8__["createTransport"]; }); -/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("+KVS"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SDK_VERSION", function() { return _version__WEBPACK_IMPORTED_MODULE_9__["SDK_VERSION"]; }); -/* harmony import */ var _integrations__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("ox7Z"); -/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "Integrations", function() { return _integrations__WEBPACK_IMPORTED_MODULE_10__; }); @@ -385628,8 +404184,13 @@ __webpack_require__.r(__webpack_exports__); + + +; +; //# sourceMappingURL=index.js.map + /***/ }), /***/ "wC0G": @@ -385689,47 +404250,51 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "memoBuilder", function() { return memoBuilder; }); /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-explicit-any */ + /** * Helper to decycle json objects */ function memoBuilder() { - var hasWeakSet = typeof WeakSet === 'function'; - var inner = hasWeakSet ? new WeakSet() : []; - function memoize(obj) { - if (hasWeakSet) { - if (inner.has(obj)) { - return true; - } - inner.add(obj); - return false; - } - // eslint-disable-next-line @typescript-eslint/prefer-for-of - for (var i = 0; i < inner.length; i++) { - var value = inner[i]; - if (value === obj) { - return true; - } - } - inner.push(obj); - return false; + const hasWeakSet = typeof WeakSet === 'function'; + const inner = hasWeakSet ? new WeakSet() : []; + function memoize(obj) { + if (hasWeakSet) { + if (inner.has(obj)) { + return true; + } + inner.add(obj); + return false; } - function unmemoize(obj) { - if (hasWeakSet) { - inner.delete(obj); - } - else { - for (var i = 0; i < inner.length; i++) { - if (inner[i] === obj) { - inner.splice(i, 1); - break; - } - } + // eslint-disable-next-line @typescript-eslint/prefer-for-of + for (let i = 0; i < inner.length; i++) { + const value = inner[i]; + if (value === obj) { + return true; + } + } + inner.push(obj); + return false; + } + + function unmemoize(obj) { + if (hasWeakSet) { + inner.delete(obj); + } else { + for (let i = 0; i < inner.length; i++) { + if (inner[i] === obj) { + inner.splice(i, 1); + break; } + } } - return [memoize, unmemoize]; + } + return [memoize, unmemoize]; } + + //# sourceMappingURL=memo.js.map + /***/ }), /***/ "wCsR": @@ -386407,6 +404972,185 @@ __webpack_require__.r(__webpack_exports__); }); +/***/ }), + +/***/ "wRg8": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dedupe", function() { return Dedupe; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Um2S"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("dO1v"); + + +/** Deduplication filter */ +var Dedupe = /** @class */ (function () { + function Dedupe() { + /** + * @inheritDoc + */ + this.name = Dedupe.id; + } + /** + * @inheritDoc + */ + Dedupe.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) { + addGlobalEventProcessor(function (currentEvent) { + var self = getCurrentHub().getIntegration(Dedupe); + if (self) { + // Juuust in case something goes wrong + try { + if (_shouldDropEvent(currentEvent, self._previousEvent)) { + _flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Event dropped due to being a duplicate of previously captured event.'); + return null; + } + } + catch (_oO) { + return (self._previousEvent = currentEvent); + } + return (self._previousEvent = currentEvent); + } + return currentEvent; + }); + }; + /** + * @inheritDoc + */ + Dedupe.id = 'Dedupe'; + return Dedupe; +}()); + +/** JSDoc */ +function _shouldDropEvent(currentEvent, previousEvent) { + if (!previousEvent) { + return false; + } + if (_isSameMessageEvent(currentEvent, previousEvent)) { + return true; + } + if (_isSameExceptionEvent(currentEvent, previousEvent)) { + return true; + } + return false; +} +/** JSDoc */ +function _isSameMessageEvent(currentEvent, previousEvent) { + var currentMessage = currentEvent.message; + var previousMessage = previousEvent.message; + // If neither event has a message property, they were both exceptions, so bail out + if (!currentMessage && !previousMessage) { + return false; + } + // If only one event has a stacktrace, but not the other one, they are not the same + if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) { + return false; + } + if (currentMessage !== previousMessage) { + return false; + } + if (!_isSameFingerprint(currentEvent, previousEvent)) { + return false; + } + if (!_isSameStacktrace(currentEvent, previousEvent)) { + return false; + } + return true; +} +/** JSDoc */ +function _isSameExceptionEvent(currentEvent, previousEvent) { + var previousException = _getExceptionFromEvent(previousEvent); + var currentException = _getExceptionFromEvent(currentEvent); + if (!previousException || !currentException) { + return false; + } + if (previousException.type !== currentException.type || previousException.value !== currentException.value) { + return false; + } + if (!_isSameFingerprint(currentEvent, previousEvent)) { + return false; + } + if (!_isSameStacktrace(currentEvent, previousEvent)) { + return false; + } + return true; +} +/** JSDoc */ +function _isSameStacktrace(currentEvent, previousEvent) { + var currentFrames = _getFramesFromEvent(currentEvent); + var previousFrames = _getFramesFromEvent(previousEvent); + // If neither event has a stacktrace, they are assumed to be the same + if (!currentFrames && !previousFrames) { + return true; + } + // If only one event has a stacktrace, but not the other one, they are not the same + if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) { + return false; + } + currentFrames = currentFrames; + previousFrames = previousFrames; + // If number of frames differ, they are not the same + if (previousFrames.length !== currentFrames.length) { + return false; + } + // Otherwise, compare the two + for (var i = 0; i < previousFrames.length; i++) { + var frameA = previousFrames[i]; + var frameB = currentFrames[i]; + if (frameA.filename !== frameB.filename || + frameA.lineno !== frameB.lineno || + frameA.colno !== frameB.colno || + frameA.function !== frameB.function) { + return false; + } + } + return true; +} +/** JSDoc */ +function _isSameFingerprint(currentEvent, previousEvent) { + var currentFingerprint = currentEvent.fingerprint; + var previousFingerprint = previousEvent.fingerprint; + // If neither event has a fingerprint, they are assumed to be the same + if (!currentFingerprint && !previousFingerprint) { + return true; + } + // If only one event has a fingerprint, but not the other one, they are not the same + if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) { + return false; + } + currentFingerprint = currentFingerprint; + previousFingerprint = previousFingerprint; + // Otherwise, compare the two + try { + return !!(currentFingerprint.join('') === previousFingerprint.join('')); + } + catch (_oO) { + return false; + } +} +/** JSDoc */ +function _getExceptionFromEvent(event) { + return event.exception && event.exception.values && event.exception.values[0]; +} +/** JSDoc */ +function _getFramesFromEvent(event) { + var exception = event.exception; + if (exception) { + try { + // @ts-ignore Object could be undefined + return exception.values[0].stacktrace.frames; + } + catch (_oO) { + return undefined; + } + } + else if (event.stacktrace) { + return event.stacktrace.frames; + } + return undefined; +} +//# sourceMappingURL=dedupe.js.map + /***/ }), /***/ "wRgb": @@ -388043,6 +406787,654 @@ var setToString = shortOut(baseSetToString); module.exports = setToString; +/***/ }), + +/***/ "wdbR": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addInstrumentationHandler", function() { return addInstrumentationHandler; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("G8B2"); +/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("BilH"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("fUgN"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("N4D0"); +/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("y+lv"); +/* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("bXDU"); +/* harmony import */ var _supports__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("jdz8"); + + + + + + + + +var global = Object(_global__WEBPACK_IMPORTED_MODULE_2__["getGlobalObject"])(); +/** + * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc. + * - Console API + * - Fetch API + * - XHR API + * - History API + * - DOM API (click/typing) + * - Error API + * - UnhandledRejection API + */ +var handlers = {}; +var instrumented = {}; +/** Instruments given API */ +function instrument(type) { + if (instrumented[type]) { + return; + } + instrumented[type] = true; + switch (type) { + case 'console': + instrumentConsole(); + break; + case 'dom': + instrumentDOM(); + break; + case 'xhr': + instrumentXHR(); + break; + case 'fetch': + instrumentFetch(); + break; + case 'history': + instrumentHistory(); + break; + case 'error': + instrumentError(); + break; + case 'unhandledrejection': + instrumentUnhandledRejection(); + break; + default: + _flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"] && _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].warn('unknown instrumentation type:', type); + return; + } +} +/** + * Add handler that will be called when given type of instrumentation triggers. + * Use at your own risk, this might break without changelog notice, only used internally. + * @hidden + */ +function addInstrumentationHandler(type, callback) { + handlers[type] = handlers[type] || []; + handlers[type].push(callback); + instrument(type); +} +/** JSDoc */ +function triggerHandlers(type, data) { + var e_1, _a; + if (!type || !handlers[type]) { + return; + } + try { + for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(handlers[type] || []), _c = _b.next(); !_c.done; _c = _b.next()) { + var handler = _c.value; + try { + handler(data); + } + catch (e) { + _flags__WEBPACK_IMPORTED_MODULE_1__["IS_DEBUG_BUILD"] && + _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].error("Error while triggering instrumentation handler.\nType: " + type + "\nName: " + Object(_stacktrace__WEBPACK_IMPORTED_MODULE_6__["getFunctionName"])(handler) + "\nError:", e); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } +} +/** JSDoc */ +function instrumentConsole() { + if (!('console' in global)) { + return; + } + _logger__WEBPACK_IMPORTED_MODULE_4__["CONSOLE_LEVELS"].forEach(function (level) { + if (!(level in global.console)) { + return; + } + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global.console, level, function (originalConsoleMethod) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + triggerHandlers('console', { args: args, level: level }); + // this fails for some browsers. :( + if (originalConsoleMethod) { + originalConsoleMethod.apply(global.console, args); + } + }; + }); + }); +} +/** JSDoc */ +function instrumentFetch() { + if (!Object(_supports__WEBPACK_IMPORTED_MODULE_7__["supportsNativeFetch"])()) { + return; + } + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global, 'fetch', function (originalFetch) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var handlerData = { + args: args, + fetchData: { + method: getFetchMethod(args), + url: getFetchUrl(args), + }, + startTimestamp: Date.now(), + }; + triggerHandlers('fetch', Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData)); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return originalFetch.apply(global, args).then(function (response) { + triggerHandlers('fetch', Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData), { endTimestamp: Date.now(), response: response })); + return response; + }, function (error) { + triggerHandlers('fetch', Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, handlerData), { endTimestamp: Date.now(), error: error })); + // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the sentry.javascript SDK caught an error invoking your application code. + // This is expected behavior and NOT indicative of a bug with sentry.javascript. + throw error; + }); + }; + }); +} +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/** Extract `method` from fetch call arguments */ +function getFetchMethod(fetchArgs) { + if (fetchArgs === void 0) { fetchArgs = []; } + if ('Request' in global && Object(_is__WEBPACK_IMPORTED_MODULE_3__["isInstanceOf"])(fetchArgs[0], Request) && fetchArgs[0].method) { + return String(fetchArgs[0].method).toUpperCase(); + } + if (fetchArgs[1] && fetchArgs[1].method) { + return String(fetchArgs[1].method).toUpperCase(); + } + return 'GET'; +} +/** Extract `url` from fetch call arguments */ +function getFetchUrl(fetchArgs) { + if (fetchArgs === void 0) { fetchArgs = []; } + if (typeof fetchArgs[0] === 'string') { + return fetchArgs[0]; + } + if ('Request' in global && Object(_is__WEBPACK_IMPORTED_MODULE_3__["isInstanceOf"])(fetchArgs[0], Request)) { + return fetchArgs[0].url; + } + return String(fetchArgs[0]); +} +/* eslint-enable @typescript-eslint/no-unsafe-member-access */ +/** JSDoc */ +function instrumentXHR() { + if (!('XMLHttpRequest' in global)) { + return; + } + var xhrproto = XMLHttpRequest.prototype; + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(xhrproto, 'open', function (originalOpen) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + // eslint-disable-next-line @typescript-eslint/no-this-alias + var xhr = this; + var url = args[1]; + var xhrInfo = (xhr.__sentry_xhr__ = { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + method: Object(_is__WEBPACK_IMPORTED_MODULE_3__["isString"])(args[0]) ? args[0].toUpperCase() : args[0], + url: args[1], + }); + // if Sentry key appears in URL, don't capture it as a request + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (Object(_is__WEBPACK_IMPORTED_MODULE_3__["isString"])(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) { + xhr.__sentry_own_request__ = true; + } + var onreadystatechangeHandler = function () { + if (xhr.readyState === 4) { + try { + // touching statusCode in some platforms throws + // an exception + xhrInfo.status_code = xhr.status; + } + catch (e) { + /* do nothing */ + } + triggerHandlers('xhr', { + args: args, + endTimestamp: Date.now(), + startTimestamp: Date.now(), + xhr: xhr, + }); + } + }; + if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') { + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(xhr, 'onreadystatechange', function (original) { + return function () { + var readyStateArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + readyStateArgs[_i] = arguments[_i]; + } + onreadystatechangeHandler(); + return original.apply(xhr, readyStateArgs); + }; + }); + } + else { + xhr.addEventListener('readystatechange', onreadystatechangeHandler); + } + return originalOpen.apply(xhr, args); + }; + }); + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(xhrproto, 'send', function (originalSend) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (this.__sentry_xhr__ && args[0] !== undefined) { + this.__sentry_xhr__.body = args[0]; + } + triggerHandlers('xhr', { + args: args, + startTimestamp: Date.now(), + xhr: this, + }); + return originalSend.apply(this, args); + }; + }); +} +var lastHref; +/** JSDoc */ +function instrumentHistory() { + if (!Object(_supports__WEBPACK_IMPORTED_MODULE_7__["supportsHistory"])()) { + return; + } + var oldOnPopState = global.onpopstate; + global.onpopstate = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var to = global.location.href; + // keep track of the current URL state, as we always receive only the updated state + var from = lastHref; + lastHref = to; + triggerHandlers('history', { + from: from, + to: to, + }); + if (oldOnPopState) { + // Apparently this can throw in Firefox when incorrectly implemented plugin is installed. + // https://github.com/getsentry/sentry-javascript/issues/3344 + // https://github.com/bugsnag/bugsnag-js/issues/469 + try { + return oldOnPopState.apply(this, args); + } + catch (_oO) { + // no-empty + } + } + }; + /** @hidden */ + function historyReplacementFunction(originalHistoryFunction) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var url = args.length > 2 ? args[2] : undefined; + if (url) { + // coerce to string (this is what pushState does) + var from = lastHref; + var to = String(url); + // keep track of the current URL state, as we always receive only the updated state + lastHref = to; + triggerHandlers('history', { + from: from, + to: to, + }); + } + return originalHistoryFunction.apply(this, args); + }; + } + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global.history, 'pushState', historyReplacementFunction); + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(global.history, 'replaceState', historyReplacementFunction); +} +var debounceDuration = 1000; +var debounceTimerID; +var lastCapturedEvent; +/** + * Decide whether the current event should finish the debounce of previously captured one. + * @param previous previously captured event + * @param current event to be captured + */ +function shouldShortcircuitPreviousDebounce(previous, current) { + // If there was no previous event, it should always be swapped for the new one. + if (!previous) { + return true; + } + // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress. + if (previous.type !== current.type) { + return true; + } + try { + // If both events have the same type, it's still possible that actions were performed on different targets. + // e.g. 2 clicks on different buttons. + if (previous.target !== current.target) { + return true; + } + } + catch (e) { + // just accessing `target` property can throw an exception in some rare circumstances + // see: https://github.com/getsentry/sentry-javascript/issues/838 + } + // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_ + // to which an event listener was attached), we treat them as the same action, as we want to capture + // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box. + return false; +} +/** + * Decide whether an event should be captured. + * @param event event to be captured + */ +function shouldSkipDOMEvent(event) { + // We are only interested in filtering `keypress` events for now. + if (event.type !== 'keypress') { + return false; + } + try { + var target = event.target; + if (!target || !target.tagName) { + return true; + } + // Only consider keypress events on actual input elements. This will disregard keypresses targeting body + // e.g.tabbing through elements, hotkeys, etc. + if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) { + return false; + } + } + catch (e) { + // just accessing `target` property can throw an exception in some rare circumstances + // see: https://github.com/getsentry/sentry-javascript/issues/838 + } + return true; +} +/** + * Wraps addEventListener to capture UI breadcrumbs + * @param handler function that will be triggered + * @param globalListener indicates whether event was captured by the global event listener + * @returns wrapped breadcrumb events handler + * @hidden + */ +function makeDOMEventHandler(handler, globalListener) { + if (globalListener === void 0) { globalListener = false; } + return function (event) { + // It's possible this handler might trigger multiple times for the same + // event (e.g. event propagation through node ancestors). + // Ignore if we've already captured that event. + if (!event || lastCapturedEvent === event) { + return; + } + // We always want to skip _some_ events. + if (shouldSkipDOMEvent(event)) { + return; + } + var name = event.type === 'keypress' ? 'input' : event.type; + // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons. + if (debounceTimerID === undefined) { + handler({ + event: event, + name: name, + global: globalListener, + }); + lastCapturedEvent = event; + } + // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one. + // If that's the case, emit the previous event and store locally the newly-captured DOM event. + else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) { + handler({ + event: event, + name: name, + global: globalListener, + }); + lastCapturedEvent = event; + } + // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together. + clearTimeout(debounceTimerID); + debounceTimerID = global.setTimeout(function () { + debounceTimerID = undefined; + }, debounceDuration); + }; +} +/** JSDoc */ +function instrumentDOM() { + if (!('document' in global)) { + return; + } + // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom + // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before + // we instrument `addEventListener` so that we don't end up attaching this handler twice. + var triggerDOMHandler = triggerHandlers.bind(null, 'dom'); + var globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true); + global.document.addEventListener('click', globalDOMEventHandler, false); + global.document.addEventListener('keypress', globalDOMEventHandler, false); + // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled + // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That + // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler + // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still + // guaranteed to fire at least once.) + ['EventTarget', 'Node'].forEach(function (target) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + var proto = global[target] && global[target].prototype; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins + if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { + return; + } + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(proto, 'addEventListener', function (originalAddEventListener) { + return function (type, listener, options) { + if (type === 'click' || type == 'keypress') { + try { + var el = this; + var handlers_1 = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {}); + var handlerForType = (handlers_1[type] = handlers_1[type] || { refCount: 0 }); + if (!handlerForType.handler) { + var handler = makeDOMEventHandler(triggerDOMHandler); + handlerForType.handler = handler; + originalAddEventListener.call(this, type, handler, options); + } + handlerForType.refCount += 1; + } + catch (e) { + // Accessing dom properties is always fragile. + // Also allows us to skip `addEventListenrs` calls with no proper `this` context. + } + } + return originalAddEventListener.call(this, type, listener, options); + }; + }); + Object(_object__WEBPACK_IMPORTED_MODULE_5__["fill"])(proto, 'removeEventListener', function (originalRemoveEventListener) { + return function (type, listener, options) { + if (type === 'click' || type == 'keypress') { + try { + var el = this; + var handlers_2 = el.__sentry_instrumentation_handlers__ || {}; + var handlerForType = handlers_2[type]; + if (handlerForType) { + handlerForType.refCount -= 1; + // If there are no longer any custom handlers of the current type on this element, we can remove ours, too. + if (handlerForType.refCount <= 0) { + originalRemoveEventListener.call(this, type, handlerForType.handler, options); + handlerForType.handler = undefined; + delete handlers_2[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete + } + // If there are no longer any custom handlers of any type on this element, cleanup everything. + if (Object.keys(handlers_2).length === 0) { + delete el.__sentry_instrumentation_handlers__; + } + } + } + catch (e) { + // Accessing dom properties is always fragile. + // Also allows us to skip `addEventListenrs` calls with no proper `this` context. + } + } + return originalRemoveEventListener.call(this, type, listener, options); + }; + }); + }); +} +var _oldOnErrorHandler = null; +/** JSDoc */ +function instrumentError() { + _oldOnErrorHandler = global.onerror; + global.onerror = function (msg, url, line, column, error) { + triggerHandlers('error', { + column: column, + error: error, + line: line, + msg: msg, + url: url, + }); + if (_oldOnErrorHandler) { + // eslint-disable-next-line prefer-rest-params + return _oldOnErrorHandler.apply(this, arguments); + } + return false; + }; +} +var _oldOnUnhandledRejectionHandler = null; +/** JSDoc */ +function instrumentUnhandledRejection() { + _oldOnUnhandledRejectionHandler = global.onunhandledrejection; + global.onunhandledrejection = function (e) { + triggerHandlers('unhandledrejection', e); + if (_oldOnUnhandledRejectionHandler) { + // eslint-disable-next-line prefer-rest-params + return _oldOnUnhandledRejectionHandler.apply(this, arguments); + } + return true; + }; +} +//# sourceMappingURL=instrument.js.map + +/***/ }), + +/***/ "wdqR": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEventEnvelope", function() { return createEventEnvelope; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSessionEnvelope", function() { return createSessionEnvelope; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); + + +/** Extract sdk info from from the API metadata */ +function getSdkMetadataForEnvelopeHeader(metadata) { + if (!metadata || !metadata.sdk) { + return; + } + const { name, version } = metadata.sdk; + return { name, version }; +} + +/** + * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key. + * Merge with existing data if any. + **/ +function enhanceEventWithSdkInfo(event, sdkInfo) { + if (!sdkInfo) { + return event; + } + event.sdk = event.sdk || {}; + event.sdk.name = event.sdk.name || sdkInfo.name; + event.sdk.version = event.sdk.version || sdkInfo.version; + event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])]; + event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])]; + return event; +} + +/** Creates an envelope from a Session */ +function createSessionEnvelope( + session, + dsn, + metadata, + tunnel, +) { + const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata); + const envelopeHeaders = { + sent_at: new Date().toISOString(), + ...(sdkInfo && { sdk: sdkInfo }), + ...(!!tunnel && { dsn: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dsnToString"])(dsn) }), + }; + + const envelopeItem = + 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session]; + + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["createEnvelope"])(envelopeHeaders, [envelopeItem]); +} + +/** + * Create an Envelope from an event. + */ +function createEventEnvelope( + event, + dsn, + metadata, + tunnel, +) { + const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata); + const eventType = event.type || 'event'; + + enhanceEventWithSdkInfo(event, metadata && metadata.sdk); + + const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn); + + // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to + // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may + // 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 + // of this `delete`, lest we miss putting it back in the next time the property is in use.) + delete event.sdkProcessingMetadata; + + const eventItem = [{ type: eventType }, event]; + return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["createEnvelope"])(envelopeHeaders, [eventItem]); +} + +function createEventEnvelopeHeaders( + event, + sdkInfo, + tunnel, + dsn, +) { + const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext; + + return { + event_id: event.event_id , + sent_at: new Date().toISOString(), + ...(sdkInfo && { sdk: sdkInfo }), + ...(!!tunnel && { dsn: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dsnToString"])(dsn) }), + ...(event.type === 'transaction' && + dynamicSamplingContext && { + trace: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["dropUndefinedKeys"])({ ...dynamicSamplingContext }), + }), + }; +} + + +//# sourceMappingURL=envelope.js.map + + /***/ }), /***/ "wfBp": @@ -388530,6 +407922,108 @@ function formatMs(milliseconds) { /***/ }), +/***/ "wpZj": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dsnToString", function() { return dsnToString; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeDsn", function() { return makeDsn; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("ZJ+v"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("G8B2"); + + + +/** Regular expression used to parse a Dsn. */ +var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/; +function isValidProtocol(protocol) { + return protocol === 'http' || protocol === 'https'; +} +/** + * Renders the string representation of this Dsn. + * + * By default, this will render the public representation without the password + * component. To get the deprecated private representation, set `withPassword` + * to true. + * + * @param withPassword When set to true, the password will be included. + */ +function dsnToString(dsn, withPassword) { + if (withPassword === void 0) { withPassword = false; } + var host = dsn.host, path = dsn.path, pass = dsn.pass, port = dsn.port, projectId = dsn.projectId, protocol = dsn.protocol, publicKey = dsn.publicKey; + return (protocol + "://" + publicKey + (withPassword && pass ? ":" + pass : '') + + ("@" + host + (port ? ":" + port : '') + "/" + (path ? path + "/" : path) + projectId)); +} +function dsnFromString(str) { + var match = DSN_REGEX.exec(str); + if (!match) { + throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: " + str); + } + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(match.slice(1), 6), protocol = _a[0], publicKey = _a[1], _b = _a[2], pass = _b === void 0 ? '' : _b, host = _a[3], _c = _a[4], port = _c === void 0 ? '' : _c, lastPath = _a[5]; + var path = ''; + var projectId = lastPath; + var split = projectId.split('/'); + if (split.length > 1) { + path = split.slice(0, -1).join('/'); + projectId = split.pop(); + } + if (projectId) { + var projectMatch = projectId.match(/^\d+/); + if (projectMatch) { + projectId = projectMatch[0]; + } + } + return dsnFromComponents({ host: host, pass: pass, path: path, projectId: projectId, port: port, protocol: protocol, publicKey: publicKey }); +} +function dsnFromComponents(components) { + // TODO this is for backwards compatibility, and can be removed in a future version + if ('user' in components && !('publicKey' in components)) { + components.publicKey = components.user; + } + return { + user: components.publicKey || '', + 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 (!_flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"]) { + return; + } + var port = dsn.port, projectId = dsn.projectId, protocol = dsn.protocol; + var requiredComponents = ['protocol', 'publicKey', 'host', 'projectId']; + requiredComponents.forEach(function (component) { + if (!dsn[component]) { + throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: " + component + " missing"); + } + }); + if (!projectId.match(/^\d+$/)) { + throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: Invalid projectId " + projectId); + } + if (!isValidProtocol(protocol)) { + throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: Invalid protocol " + protocol); + } + if (port && isNaN(parseInt(port, 10))) { + throw new _error__WEBPACK_IMPORTED_MODULE_1__["SentryError"]("Invalid Sentry Dsn: Invalid port " + port); + } + return true; +} +/** The Sentry Dsn, identifying a Sentry instance and project. */ +function makeDsn(from) { + var components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from); + validateDsn(components); + return components; +} +//# sourceMappingURL=dsn.js.map + +/***/ }), + /***/ "wq4j": /***/ (function(module, exports, __webpack_require__) { @@ -388938,246 +408432,291 @@ function HiddenCss(props) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TryCatch", function() { return TryCatch; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); -/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("vzc1"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("vzc1"); + + + +const DEFAULT_EVENT_TARGET = [ + 'EventTarget', + 'Window', + 'Node', + 'ApplicationCache', + 'AudioTrackList', + 'ChannelMergerNode', + 'CryptoOperation', + 'EventSource', + 'FileReader', + 'HTMLUnknownElement', + 'IDBDatabase', + 'IDBRequest', + 'IDBTransaction', + 'KeyOperation', + 'MediaController', + 'MessagePort', + 'ModalWindow', + 'Notification', + 'SVGElementInstance', + 'Screen', + 'TextTrack', + 'TextTrackCue', + 'TextTrackList', + 'WebSocket', + 'WebSocketWorker', + 'Worker', + 'XMLHttpRequest', + 'XMLHttpRequestEventTarget', + 'XMLHttpRequestUpload', +]; +/** Wrap timer functions and event targets to catch errors and provide better meta data */ +class TryCatch { + /** + * @inheritDoc + */ + static __initStatic() {this.id = 'TryCatch';} + /** + * @inheritDoc + */ + __init() {this.name = TryCatch.id;} -var DEFAULT_EVENT_TARGET = [ - 'EventTarget', - 'Window', - 'Node', - 'ApplicationCache', - 'AudioTrackList', - 'ChannelMergerNode', - 'CryptoOperation', - 'EventSource', - 'FileReader', - 'HTMLUnknownElement', - 'IDBDatabase', - 'IDBRequest', - 'IDBTransaction', - 'KeyOperation', - 'MediaController', - 'MessagePort', - 'ModalWindow', - 'Notification', - 'SVGElementInstance', - 'Screen', - 'TextTrack', - 'TextTrackCue', - 'TextTrackList', - 'WebSocket', - 'WebSocketWorker', - 'Worker', - 'XMLHttpRequest', - 'XMLHttpRequestEventTarget', - 'XMLHttpRequestUpload', -]; -/** Wrap timer functions and event targets to catch errors and provide better meta data */ -var TryCatch = /** @class */ (function () { - /** - * @inheritDoc - */ - function TryCatch(options) { - /** - * @inheritDoc - */ - this.name = TryCatch.id; - this._options = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ XMLHttpRequest: true, eventTarget: true, requestAnimationFrame: true, setInterval: true, setTimeout: true }, options); - } - /** - * Wrap timer functions and event targets to catch errors - * and provide better metadata. - */ - TryCatch.prototype.setupOnce = function () { - var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); - if (this._options.setTimeout) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(global, 'setTimeout', _wrapTimeFunction); - } - if (this._options.setInterval) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(global, 'setInterval', _wrapTimeFunction); - } - if (this._options.requestAnimationFrame) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(global, 'requestAnimationFrame', _wrapRAF); - } - if (this._options.XMLHttpRequest && 'XMLHttpRequest' in global) { - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(XMLHttpRequest.prototype, 'send', _wrapXHR); - } - var eventTargetOption = this._options.eventTarget; - if (eventTargetOption) { - var eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET; - eventTarget.forEach(_wrapEventTarget); - } + /** JSDoc */ + + /** + * @inheritDoc + */ + constructor(options) {;TryCatch.prototype.__init.call(this); + this._options = { + XMLHttpRequest: true, + eventTarget: true, + requestAnimationFrame: true, + setInterval: true, + setTimeout: true, + ...options, }; - /** - * @inheritDoc - */ - TryCatch.id = 'TryCatch'; - return TryCatch; -}()); + } + + /** + * Wrap timer functions and event targets to catch errors + * and provide better metadata. + */ + setupOnce() { + if (this._options.setTimeout) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["fill"])(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"], 'setTimeout', _wrapTimeFunction); + } + + if (this._options.setInterval) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["fill"])(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"], 'setInterval', _wrapTimeFunction); + } + + if (this._options.requestAnimationFrame) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["fill"])(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"], 'requestAnimationFrame', _wrapRAF); + } + + if (this._options.XMLHttpRequest && 'XMLHttpRequest' in _helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"]) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["fill"])(XMLHttpRequest.prototype, 'send', _wrapXHR); + } + + const eventTargetOption = this._options.eventTarget; + if (eventTargetOption) { + const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET; + eventTarget.forEach(_wrapEventTarget); + } + } +} TryCatch.__initStatic(); /** JSDoc */ function _wrapTimeFunction(original) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var originalCallback = args[0]; - args[0] = Object(_helpers__WEBPACK_IMPORTED_MODULE_2__["wrap"])(originalCallback, { - mechanism: { - data: { function: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(original) }, - handled: true, - type: 'instrument', - }, - }); - return original.apply(this, args); - }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function ( ...args) { + const originalCallback = args[0]; + args[0] = Object(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["wrap"])(originalCallback, { + mechanism: { + data: { function: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getFunctionName"])(original) }, + handled: true, + type: 'instrument', + }, + }); + return original.apply(this, args); + }; } + /** JSDoc */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function _wrapRAF(original) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function (callback) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - return original.apply(this, [ - Object(_helpers__WEBPACK_IMPORTED_MODULE_2__["wrap"])(callback, { - mechanism: { - data: { - function: 'requestAnimationFrame', - handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(original), - }, - handled: true, - type: 'instrument', - }, - }), - ]); - }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function ( callback) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return original.apply(this, [ + Object(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["wrap"])(callback, { + mechanism: { + data: { + function: 'requestAnimationFrame', + handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getFunctionName"])(original), + }, + handled: true, + type: 'instrument', + }, + }), + ]); + }; } + /** JSDoc */ function _wrapXHR(originalSend) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - // eslint-disable-next-line @typescript-eslint/no-this-alias - var xhr = this; - var xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange']; - xmlHttpRequestProps.forEach(function (prop) { - if (prop in xhr && typeof xhr[prop] === 'function') { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(xhr, prop, function (original) { - var wrapOptions = { - mechanism: { - data: { - function: prop, - handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(original), - }, - handled: true, - type: 'instrument', - }, - }; - // If Instrument integration has been called before TryCatch, get the name of original function - var originalFunction = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getOriginalFunction"])(original); - if (originalFunction) { - wrapOptions.mechanism.data.handler = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(originalFunction); - } - // Otherwise wrap directly - return Object(_helpers__WEBPACK_IMPORTED_MODULE_2__["wrap"])(original, wrapOptions); - }); - } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function ( ...args) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const xhr = this; + const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange']; + + xmlHttpRequestProps.forEach(prop => { + if (prop in xhr && typeof xhr[prop] === 'function') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["fill"])(xhr, prop, function (original) { + const wrapOptions = { + mechanism: { + data: { + function: prop, + handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getFunctionName"])(original), + }, + handled: true, + type: 'instrument', + }, + }; + + // If Instrument integration has been called before TryCatch, get the name of original function + const originalFunction = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getOriginalFunction"])(original); + if (originalFunction) { + wrapOptions.mechanism.data.handler = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getFunctionName"])(originalFunction); + } + + // Otherwise wrap directly + return Object(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["wrap"])(original, wrapOptions); }); - return originalSend.apply(this, args); - }; + } + }); + + return originalSend.apply(this, args); + }; } + /** JSDoc */ function _wrapEventTarget(target) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - var global = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getGlobalObject"])(); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - var proto = global[target] && global[target].prototype; - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins - if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { - return; - } - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(proto, 'addEventListener', function (original) { - return function (eventName, fn, options) { - try { - if (typeof fn.handleEvent === 'function') { - fn.handleEvent = Object(_helpers__WEBPACK_IMPORTED_MODULE_2__["wrap"])(fn.handleEvent.bind(fn), { - mechanism: { - data: { - function: 'handleEvent', - handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(fn), - target: target, - }, - handled: true, - type: 'instrument', - }, - }); - } - } - catch (err) { - // can sometimes get 'Permission denied to access property "handle Event' - } - return original.apply(this, [ - eventName, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - Object(_helpers__WEBPACK_IMPORTED_MODULE_2__["wrap"])(fn, { - mechanism: { - data: { - function: 'addEventListener', - handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getFunctionName"])(fn), - target: target, - }, - handled: true, - type: 'instrument', - }, - }), - options, - ]); - }; - }); - Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["fill"])(proto, 'removeEventListener', function (originalRemoveEventListener) { - return function (eventName, fn, options) { - /** - * There are 2 possible scenarios here: - * - * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified - * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function - * as a pass-through, and call original `removeEventListener` with it. - * - * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using - * our wrapped version of `addEventListener`, which internally calls `wrap` helper. - * This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it, - * in order for us to make a distinction between wrapped/non-wrapped functions possible. - * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler. - * - * When someone adds a handler prior to initialization, and then do it again, but after, - * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible - * to get rid of the initial handler and it'd stick there forever. - */ - var wrappedEventHandler = fn; - try { - var originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__; - if (originalEventHandler) { - originalRemoveEventListener.call(this, eventName, originalEventHandler, options); - } - } - catch (e) { - // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments - } - return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options); - }; - }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const globalObject = _helpers_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"] ; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + const proto = globalObject[target] && globalObject[target].prototype; + + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins + if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { + return; + } + + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["fill"])(proto, 'addEventListener', function (original) + + { + return function ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + eventName, + fn, + options, + ) { + try { + if (typeof fn.handleEvent === 'function') { + // ESlint disable explanation: + // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would + // introduce a bug here, because bind returns a new function that doesn't have our + // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping. + // Without those flags, every call to addEventListener wraps the function again, causing a memory leak. + // eslint-disable-next-line @typescript-eslint/unbound-method + fn.handleEvent = Object(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["wrap"])(fn.handleEvent, { + mechanism: { + data: { + function: 'handleEvent', + handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getFunctionName"])(fn), + target, + }, + handled: true, + type: 'instrument', + }, + }); + } + } catch (err) { + // can sometimes get 'Permission denied to access property "handle Event' + } + + return original.apply(this, [ + eventName, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Object(_helpers_js__WEBPACK_IMPORTED_MODULE_1__["wrap"])(fn , { + mechanism: { + data: { + function: 'addEventListener', + handler: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["getFunctionName"])(fn), + target, + }, + handled: true, + type: 'instrument', + }, + }), + options, + ]); + }; + }); + + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["fill"])( + proto, + 'removeEventListener', + function ( + originalRemoveEventListener, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ) { + return function ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + eventName, + fn, + options, + ) { + /** + * There are 2 possible scenarios here: + * + * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified + * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function + * as a pass-through, and call original `removeEventListener` with it. + * + * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using + * our wrapped version of `addEventListener`, which internally calls `wrap` helper. + * This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it, + * in order for us to make a distinction between wrapped/non-wrapped functions possible. + * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler. + * + * When someone adds a handler prior to initialization, and then do it again, but after, + * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible + * to get rid of the initial handler and it'd stick there forever. + */ + const wrappedEventHandler = fn ; + try { + const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__; + if (originalEventHandler) { + originalRemoveEventListener.call(this, eventName, originalEventHandler, options); + } + } catch (e) { + // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments + } + return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options); + }; + }, + ); } + + //# sourceMappingURL=trycatch.js.map + /***/ }), /***/ "wz8V": @@ -390125,6 +409664,35 @@ var KeePass2XmlImporter = /*#__PURE__*/function (_BaseImporter) { return KeePass2XmlImporter; }(_baseImporter__WEBPACK_IMPORTED_MODULE_5__["BaseImporter"]); +/***/ }), + +/***/ "xAFG": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_interopRequireDefault", function() { return _interopRequireDefault; }); +/** + * Wraps modules which aren't the result of transpiling an ESM module in an object under the key `default` + * + * Adapted from Sucrase (https://github.com/alangpierce/sucrase) + * + * @param requireResult The result of calling `require` on a module + * @returns `requireResult` or `requireResult` wrapped in an object, keyed as `default` + */ +function _interopRequireDefault(requireResult) { + return requireResult.__esModule ? requireResult : { default: requireResult }; +} + +// Sucrase version +// function _interopRequireDefault(obj) { +// return obj && obj.__esModule ? obj : { default: obj }; +// } + + +//# sourceMappingURL=_interopRequireDefault.js.map + + /***/ }), /***/ "xAT6": @@ -390423,107 +409991,150 @@ module.exports = wrapperClone; "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "chromeStackParser", function() { return chromeStackParser; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "geckoStackParser", function() { return geckoStackParser; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "winjsStackParser", function() { return winjsStackParser; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "opera10StackParser", function() { return opera10StackParser; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "opera11StackParser", function() { return opera11StackParser; }); -/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "chromeStackLineParser", function() { return chromeStackLineParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultStackLineParsers", function() { return defaultStackLineParsers; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultStackParser", function() { return defaultStackParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "geckoStackLineParser", function() { return geckoStackLineParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "opera10StackLineParser", function() { return opera10StackLineParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "opera11StackLineParser", function() { return opera11StackLineParser; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "winjsStackLineParser", function() { return winjsStackLineParser; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); + // global reference to slice -var UNKNOWN_FUNCTION = '?'; -var OPERA10_PRIORITY = 10; -var OPERA11_PRIORITY = 20; -var CHROME_PRIORITY = 30; -var WINJS_PRIORITY = 40; -var GECKO_PRIORITY = 50; +const UNKNOWN_FUNCTION = '?'; + +const OPERA10_PRIORITY = 10; +const OPERA11_PRIORITY = 20; +const CHROME_PRIORITY = 30; +const WINJS_PRIORITY = 40; +const GECKO_PRIORITY = 50; + function createFrame(filename, func, lineno, colno) { - var frame = { - filename: filename, - function: func, - // All browser frames are considered in_app - in_app: true, - }; - if (lineno !== undefined) { - frame.lineno = lineno; - } - if (colno !== undefined) { - frame.colno = colno; - } - return frame; + const frame = { + filename, + function: func, + // All browser frames are considered in_app + in_app: true, + }; + + if (lineno !== undefined) { + frame.lineno = lineno; + } + + if (colno !== undefined) { + frame.colno = colno; + } + + return frame; } + // Chromium based browsers: Chrome, Brave, new Opera, new Edge -var chromeRegex = /^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; -var chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; -var chrome = function (line) { - var parts = chromeRegex.exec(line); - if (parts) { - var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line - if (isEval) { - var subMatch = chromeEvalRegex.exec(parts[2]); - if (subMatch) { - // throw out eval line/column and use top-most line/column number - parts[2] = subMatch[1]; // url - parts[3] = subMatch[2]; // line - parts[4] = subMatch[3]; // column - } - } - // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now - // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable) - var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]), 2), func = _a[0], filename = _a[1]; - return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined); +const chromeRegex = + /^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; +const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; + +const chrome = line => { + const parts = chromeRegex.exec(line); + + if (parts) { + const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line + + if (isEval) { + const subMatch = chromeEvalRegex.exec(parts[2]); + + if (subMatch) { + // throw out eval line/column and use top-most line/column number + parts[2] = subMatch[1]; // url + parts[3] = subMatch[2]; // line + parts[4] = subMatch[3]; // column + } } - return; + + // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now + // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable) + const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]); + + return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined); + } + + return; }; -var chromeStackParser = [CHROME_PRIORITY, chrome]; + +const chromeStackLineParser = [CHROME_PRIORITY, chrome]; + // gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it // generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js // We need this specific case for now because we want no other regex to match. -var geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; -var geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; -var gecko = function (line) { - var _a; - var parts = geckoREgex.exec(line); - if (parts) { - var isEval = parts[3] && parts[3].indexOf(' > eval') > -1; - if (isEval) { - var subMatch = geckoEvalRegex.exec(parts[3]); - if (subMatch) { - // throw out eval line/column and use top-most line number - parts[1] = parts[1] || 'eval'; - parts[3] = subMatch[1]; - parts[4] = subMatch[2]; - parts[5] = ''; // no column when eval - } - } - var filename = parts[3]; - var func = parts[1] || UNKNOWN_FUNCTION; - _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(extractSafariExtensionDetails(func, filename), 2), func = _a[0], filename = _a[1]; - return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined); +const geckoREgex = + /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; +const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; + +const gecko = line => { + const parts = geckoREgex.exec(line); + + if (parts) { + const isEval = parts[3] && parts[3].indexOf(' > eval') > -1; + if (isEval) { + const subMatch = geckoEvalRegex.exec(parts[3]); + + if (subMatch) { + // throw out eval line/column and use top-most line number + parts[1] = parts[1] || 'eval'; + parts[3] = subMatch[1]; + parts[4] = subMatch[2]; + parts[5] = ''; // no column when eval + } } - return; + + let filename = parts[3]; + let func = parts[1] || UNKNOWN_FUNCTION; + [func, filename] = extractSafariExtensionDetails(func, filename); + + return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined); + } + + return; }; -var geckoStackParser = [GECKO_PRIORITY, gecko]; -var winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i; -var winjs = function (line) { - var parts = winjsRegex.exec(line); - return parts - ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) - : undefined; + +const geckoStackLineParser = [GECKO_PRIORITY, gecko]; + +const winjsRegex = + /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i; + +const winjs = line => { + const parts = winjsRegex.exec(line); + + return parts + ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) + : undefined; }; -var winjsStackParser = [WINJS_PRIORITY, winjs]; -var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i; -var opera10 = function (line) { - var parts = opera10Regex.exec(line); - return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined; + +const winjsStackLineParser = [WINJS_PRIORITY, winjs]; + +const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i; + +const opera10 = line => { + const parts = opera10Regex.exec(line); + return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined; }; -var opera10StackParser = [OPERA10_PRIORITY, opera10]; -var opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i; -var opera11 = function (line) { - var parts = opera11Regex.exec(line); - return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined; + +const opera10StackLineParser = [OPERA10_PRIORITY, opera10]; + +const opera11Regex = + / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i; + +const opera11 = line => { + const parts = opera11Regex.exec(line); + return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined; }; -var opera11StackParser = [OPERA11_PRIORITY, opera11]; + +const opera11StackLineParser = [OPERA11_PRIORITY, opera11]; + +const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser]; + +const defaultStackParser = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["createStackParser"])(...defaultStackLineParsers); + /** * Safari web extensions, starting version unknown, can produce "frames-only" stacktraces. * What it means, is that instead of format like: @@ -390544,18 +410155,22 @@ var opera11StackParser = [OPERA11_PRIORITY, opera11]; * Unfortunately "just" changing RegExp is too complicated now and making it pass all tests * and fix this case seems like an impossible, or at least way too time-consuming task. */ -var extractSafariExtensionDetails = function (func, filename) { - var isSafariExtension = func.indexOf('safari-extension') !== -1; - var isSafariWebExtension = func.indexOf('safari-web-extension') !== -1; - return isSafariExtension || isSafariWebExtension - ? [ - func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION, - isSafariExtension ? "safari-extension:" + filename : "safari-web-extension:" + filename, - ] - : [func, filename]; +const extractSafariExtensionDetails = (func, filename) => { + const isSafariExtension = func.indexOf('safari-extension') !== -1; + const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1; + + return isSafariExtension || isSafariWebExtension + ? [ + func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION, + isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`, + ] + : [func, filename]; }; + + //# sourceMappingURL=stack-parsers.js.map + /***/ }), /***/ "xIbs": @@ -391124,7 +410739,7 @@ module.exports = isYesterday "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Session", function() { return Session; }); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("j43s"); /** * @inheritdoc @@ -391480,6 +411095,43 @@ __webpack_require__.r(__webpack_exports__); +/***/ }), + +/***/ "xTur": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_interopNamespace", function() { return _interopNamespace; }); +/** + * Adds a self-referential `default` property to CJS modules which aren't the result of transpilation from ESM modules. + * + * Adapted from Rollup (https://github.com/rollup/rollup) + * + * @param requireResult The result of calling `require` on a module + * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property + */ +function _interopNamespace(requireResult) { + return requireResult.__esModule ? requireResult : { ...requireResult, default: requireResult }; +} + +// Rollup version (with `output.externalLiveBindings` and `output.freeze` both set to false) +// function _interopNamespace(e) { +// if (e && e.__esModule) return e; +// var n = Object.create(null); +// if (e) { +// for (var k in e) { +// n[k] = e[k]; +// } +// } +// n["default"] = e; +// return n; +// } + + +//# sourceMappingURL=_interopNamespace.js.map + + /***/ }), /***/ "xXfy": @@ -391640,29 +411292,46 @@ var Link = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["forwardRef"](functio "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "severityFromString", function() { return severityFromString; }); -/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("PIsB"); -/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("+usi"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "severityLevelFromString", function() { return severityLevelFromString; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validSeverityLevels", function() { return validSeverityLevels; }); +// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either +// +// a) moving `validSeverityLevels` to `@sentry/types`, +// b) moving the`SeverityLevel` type here, or +// c) importing `validSeverityLevels` from here into `@sentry/types`. +// +// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would +// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the +// type, reminding anyone who changes it to change this list also, will have to do. +const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug']; -function isSupportedSeverity(level) { - return _enums__WEBPACK_IMPORTED_MODULE_1__["SeverityLevels"].indexOf(level) !== -1; -} /** - * Converts a string-based level into a {@link Severity}. + * Converts a string-based level into a member of the deprecated {@link Severity} enum. * - * @param level string representation of Severity + * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead. + * + * @param level String representation of Severity * @returns Severity */ function severityFromString(level) { - if (level === 'warn') - return _sentry_types__WEBPACK_IMPORTED_MODULE_0__["Severity"].Warning; - if (isSupportedSeverity(level)) { - return level; - } - return _sentry_types__WEBPACK_IMPORTED_MODULE_0__["Severity"].Log; + return severityLevelFromString(level) ; } + +/** + * Converts a string-based level into a `SeverityLevel`, normalizing it along the way. + * + * @param level String representation of desired `SeverityLevel`. + * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level. + */ +function severityLevelFromString(level) { + return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') ; +} + + //# sourceMappingURL=severity.js.map + /***/ }), /***/ "xYSL": @@ -394414,6 +414083,80 @@ mgf1.create = function(md) { }; +/***/ }), + +/***/ "xpBP": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "instrumentRoutingWithDefaults", function() { return instrumentRoutingWithDefaults; }); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("TwdF"); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Wezb"); + + + +/** + * Default function implementing pageload and navigation transactions + */ +function instrumentRoutingWithDefaults( + customStartTransaction, + startTransactionOnPageLoad = true, + startTransactionOnLocationChange = true, +) { + if (!_types_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"] || !_types_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].location) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Could not initialize routing instrumentation due to invalid location'); + return; + } + + let startingUrl = _types_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].location.href; + + let activeTransaction; + if (startTransactionOnPageLoad) { + activeTransaction = customStartTransaction({ + name: _types_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].location.pathname, + op: 'pageload', + metadata: { source: 'url' }, + }); + } + + if (startTransactionOnLocationChange) { + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_0__["addInstrumentationHandler"])('history', ({ to, from }) => { + /** + * This early return is there to account for some cases where a navigation transaction starts right after + * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't + * create an uneccessary navigation transaction. + * + * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also + * only be caused in certain development environments where the usage of a hot module reloader is causing + * errors. + */ + if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) { + startingUrl = undefined; + return; + } + + if (from !== to) { + startingUrl = undefined; + if (activeTransaction) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_0__["logger"].log(`[Tracing] Finishing current transaction with op: ${activeTransaction.op}`); + // If there's an open transaction on the scope, we need to finish it before creating an new one. + activeTransaction.finish(); + } + activeTransaction = customStartTransaction({ + name: _types_js__WEBPACK_IMPORTED_MODULE_1__["WINDOW"].location.pathname, + op: 'navigation', + metadata: { source: 'url' }, + }); + } + }); + } +} + + +//# sourceMappingURL=router.js.map + + /***/ }), /***/ "xpiv": @@ -395075,92 +414818,254 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/***/ "y/6f": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConfig", function() { return setConfig; }); -var config = { - onError: function (e) { return console.error(e); }, -}; -var setConfig = function (conf) { - Object.assign(config, conf); -}; - - -/***/ }), - -/***/ "y/t4": +/***/ "y+lv": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserBackend", function() { return BrowserBackend; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return fill; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addNonEnumerableProperty", function() { return addNonEnumerableProperty; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "markFunctionWrapped", function() { return markFunctionWrapped; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOriginalFunction", function() { return getOriginalFunction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "urlEncode", function() { return urlEncode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToPlainObject", function() { return convertToPlainObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractExceptionKeysForMessage", function() { return extractExceptionKeysForMessage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dropUndefinedKeys", function() { return dropUndefinedKeys; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "objectify", function() { return objectify; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); -/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("wBhU"); -/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("PIsB"); -/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("TwdF"); -/* harmony import */ var _eventbuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("IS+8"); -/* harmony import */ var _transports__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("nXHh"); - - +/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TAEo"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("fUgN"); +/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("/gRg"); /** - * The Sentry Browser SDK Backend. - * @hidden + * Replace a method in an object with a wrapped version of itself. + * + * @param source An object that contains a method to be wrapped. + * @param name The name of the method to be wrapped. + * @param replacementFactory A higher-order function that takes the original version of the given method and returns a + * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to + * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other + * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`. + * @returns void */ -var BrowserBackend = /** @class */ (function (_super) { - Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BrowserBackend, _super); - function BrowserBackend() { - return _super !== null && _super.apply(this, arguments) || this; +function fill(source, name, replacementFactory) { + if (!(name in source)) { + return; } - /** - * @inheritDoc - */ - BrowserBackend.prototype.eventFromException = function (exception, hint) { - return Object(_eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromException"])(exception, hint, this._options.attachStacktrace); - }; - /** - * @inheritDoc - */ - BrowserBackend.prototype.eventFromMessage = function (message, level, hint) { - if (level === void 0) { level = _sentry_types__WEBPACK_IMPORTED_MODULE_2__["Severity"].Info; } - return Object(_eventbuilder__WEBPACK_IMPORTED_MODULE_4__["eventFromMessage"])(message, level, hint, this._options.attachStacktrace); - }; - /** - * @inheritDoc - */ - BrowserBackend.prototype._setupTransport = function () { - if (!this._options.dsn) { - // We return the noop transport here in case there is no Dsn. - return _super.prototype._setupTransport.call(this); + var original = source[name]; + var wrapped = replacementFactory(original); + // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work + // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" + if (typeof wrapped === 'function') { + try { + markFunctionWrapped(wrapped, original); } - var transportOptions = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, this._options.transportOptions), { dsn: this._options.dsn, tunnel: this._options.tunnel, sendClientReports: this._options.sendClientReports, _metadata: this._options._metadata }); - var api = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["initAPIDetails"])(transportOptions.dsn, transportOptions._metadata, transportOptions.tunnel); - var url = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["getEnvelopeEndpointWithUrlEncodedAuth"])(api.dsn, api.tunnel); - if (this._options.transport) { - return new this._options.transport(transportOptions); + catch (_Oo) { + // This can throw if multiple fill happens on a global object like XMLHttpRequest + // Fixes https://github.com/getsentry/sentry-javascript/issues/2043 } - if (Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_3__["supportsFetch"])()) { - var requestOptions = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, transportOptions.fetchParameters); - this._newTransport = Object(_transports__WEBPACK_IMPORTED_MODULE_5__["makeNewFetchTransport"])({ requestOptions: requestOptions, url: url }); - return new _transports__WEBPACK_IMPORTED_MODULE_5__["FetchTransport"](transportOptions); + } + source[name] = wrapped; +} +/** + * Defines a non-enumerable property on the given object. + * + * @param obj The object on which to set the property + * @param name The name of the property to be set + * @param value The value to which to set the property + */ +function addNonEnumerableProperty(obj, name, value) { + Object.defineProperty(obj, name, { + // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it + value: value, + writable: true, + configurable: true, + }); +} +/** + * Remembers the original function on the wrapped function and + * patches up the prototype. + * + * @param wrapped the wrapper function + * @param original the original function that gets wrapped + */ +function markFunctionWrapped(wrapped, original) { + var proto = original.prototype || {}; + wrapped.prototype = original.prototype = proto; + addNonEnumerableProperty(wrapped, '__sentry_original__', original); +} +/** + * This extracts the original function if available. See + * `markFunctionWrapped` for more information. + * + * @param func the function to unwrap + * @returns the unwrapped version of the function if available. + */ +function getOriginalFunction(func) { + return func.__sentry_original__; +} +/** + * Encodes given object into url-friendly format + * + * @param object An object that contains serializable values + * @returns string Encoded + */ +function urlEncode(object) { + return Object.keys(object) + .map(function (key) { return encodeURIComponent(key) + "=" + encodeURIComponent(object[key]); }) + .join('&'); +} +/** + * Transforms any object into an object literal with all its attributes + * attached to it. + * + * @param value Initial source that we have to transform in order for it to be usable by the serializer + */ +function convertToPlainObject(value) { + var newObj = value; + if (Object(_is__WEBPACK_IMPORTED_MODULE_2__["isError"])(value)) { + newObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ message: value.message, name: value.name, stack: value.stack }, getOwnProperties(value)); + } + else if (Object(_is__WEBPACK_IMPORTED_MODULE_2__["isEvent"])(value)) { + var event_1 = value; + newObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ type: event_1.type, target: serializeEventTarget(event_1.target), currentTarget: serializeEventTarget(event_1.currentTarget) }, getOwnProperties(event_1)); + if (typeof CustomEvent !== 'undefined' && Object(_is__WEBPACK_IMPORTED_MODULE_2__["isInstanceOf"])(value, CustomEvent)) { + newObj.detail = event_1.detail; } - this._newTransport = Object(_transports__WEBPACK_IMPORTED_MODULE_5__["makeNewXHRTransport"])({ - url: url, - headers: transportOptions.headers, - }); - return new _transports__WEBPACK_IMPORTED_MODULE_5__["XHRTransport"](transportOptions); - }; - return BrowserBackend; -}(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["BaseBackend"])); + } + return newObj; +} +/** Creates a string representation of the target of an `Event` object */ +function serializeEventTarget(target) { + try { + return Object(_is__WEBPACK_IMPORTED_MODULE_2__["isElement"])(target) ? Object(_browser__WEBPACK_IMPORTED_MODULE_1__["htmlTreeAsString"])(target) : Object.prototype.toString.call(target); + } + catch (_oO) { + return '<unknown>'; + } +} +/** Filters out all but an object's own properties */ +function getOwnProperties(obj) { + var extractedProps = {}; + for (var property in obj) { + if (Object.prototype.hasOwnProperty.call(obj, property)) { + extractedProps[property] = obj[property]; + } + } + return extractedProps; +} +/** + * Given any captured exception, extract its keys and create a sorted + * and truncated list that will be used inside the event message. + * eg. `Non-error exception captured with keys: foo, bar, baz` + */ +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function extractExceptionKeysForMessage(exception, maxLength) { + if (maxLength === void 0) { maxLength = 40; } + var keys = Object.keys(convertToPlainObject(exception)); + keys.sort(); + if (!keys.length) { + return '[object has no keys]'; + } + if (keys[0].length >= maxLength) { + return Object(_string__WEBPACK_IMPORTED_MODULE_3__["truncate"])(keys[0], maxLength); + } + for (var includedKeys = keys.length; includedKeys > 0; includedKeys--) { + var serialized = keys.slice(0, includedKeys).join(', '); + if (serialized.length > maxLength) { + continue; + } + if (includedKeys === keys.length) { + return serialized; + } + return Object(_string__WEBPACK_IMPORTED_MODULE_3__["truncate"])(serialized, maxLength); + } + return ''; +} +/** + * Given any object, return the new object with removed keys that value was `undefined`. + * Works recursively on objects and arrays. + */ +function dropUndefinedKeys(val) { + var e_1, _a; + if (Object(_is__WEBPACK_IMPORTED_MODULE_2__["isPlainObject"])(val)) { + var rv = {}; + try { + for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(Object.keys(val)), _c = _b.next(); !_c.done; _c = _b.next()) { + var key = _c.value; + if (typeof val[key] !== 'undefined') { + rv[key] = dropUndefinedKeys(val[key]); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } + return rv; + } + if (Array.isArray(val)) { + return val.map(dropUndefinedKeys); + } + return val; +} +/** + * Ensure that something is an object. + * + * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper + * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives. + * + * @param wat The subject of the objectification + * @returns A version of `wat` which can safely be used with `Object` class methods + */ +function objectify(wat) { + var objectified; + switch (true) { + case wat === undefined || 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 Object(_is__WEBPACK_IMPORTED_MODULE_2__["isPrimitive"])(wat): + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + 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; +} +//# sourceMappingURL=object.js.map + +/***/ }), + +/***/ "y/6f": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConfig", function() { return setConfig; }); +var config = { + onError: function (e) { return console.error(e); }, +}; +var setConfig = function (conf) { + Object.assign(config, conf); +}; -//# sourceMappingURL=backend.js.map /***/ }), @@ -395190,6 +415095,43 @@ function assocIndexOf(array, key) { module.exports = assocIndexOf; +/***/ }), + +/***/ "y34A": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeNewFetchTransport", function() { return makeNewFetchTransport; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5K7t"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("6VZY"); + + + +/** + * Creates a Transport that uses the Fetch API to send events to Sentry. + */ +function makeNewFetchTransport(options, nativeFetch) { + if (nativeFetch === void 0) { nativeFetch = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getNativeFetchImplementation"])(); } + function makeRequest(request) { + var requestOptions = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ body: request.body, method: 'POST', referrerPolicy: 'origin' }, options.requestOptions); + return nativeFetch(options.url, requestOptions).then(function (response) { + return response.text().then(function (body) { return ({ + body: body, + headers: { + 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'), + 'retry-after': response.headers.get('Retry-After'), + }, + reason: response.statusText, + statusCode: response.status, + }); }); + }); + } + return Object(_sentry_core__WEBPACK_IMPORTED_MODULE_1__["createTransport"])({ bufferSize: options.bufferSize }, makeRequest); +} +//# sourceMappingURL=new-fetch.js.map + /***/ }), /***/ "y3w9": @@ -395470,7 +415412,21 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/***/ "yA8j": +/***/ "yAGa": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = (function(value) { + return arguments.length + ? this.property("__data__", value) + : this.node().__data__; +}); + + +/***/ }), + +/***/ "yCCt": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -395493,20 +415449,6 @@ __webpack_require__.r(__webpack_exports__); var IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__; //# sourceMappingURL=flags.js.map -/***/ }), - -/***/ "yAGa": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony default export */ __webpack_exports__["default"] = (function(value) { - return arguments.length - ? this.property("__data__", value) - : this.node().__data__; -}); - - /***/ }), /***/ "yCxk": @@ -395627,6 +415569,37 @@ __webpack_require__.r(__webpack_exports__); }); +/***/ }), + +/***/ "yE6y": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "severityFromString", function() { return severityFromString; }); +/* harmony import */ var _sentry_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("PIsB"); +/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("P6zQ"); + + +function isSupportedSeverity(level) { + return _enums__WEBPACK_IMPORTED_MODULE_1__["SeverityLevels"].indexOf(level) !== -1; +} +/** + * Converts a string-based level into a {@link Severity}. + * + * @param level string representation of Severity + * @returns Severity + */ +function severityFromString(level) { + if (level === 'warn') + return _sentry_types__WEBPACK_IMPORTED_MODULE_0__["Severity"].Warning; + if (isSupportedSeverity(level)) { + return level; + } + return _sentry_types__WEBPACK_IMPORTED_MODULE_0__["Severity"].Log; +} +//# sourceMappingURL=severity.js.map + /***/ }), /***/ "yEp2": @@ -396073,6 +416046,153 @@ __webpack_require__.r(__webpack_exports__); + + +/***/ }), + +/***/ "yL5O": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reactRouterV3Instrumentation", function() { return reactRouterV3Instrumentation; }); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("WSEr"); + + +// Many of the types below had to be mocked out to prevent typescript issues +// these types are required for correct functionality. + +/** + * Creates routing instrumentation for React Router v3 + * Works for React Router >= 3.2.0 and < 4.0.0 + * + * @param history object from the `history` library + * @param routes a list of all routes, should be + * @param match `Router.match` utility + */ +function reactRouterV3Instrumentation( + history, + routes, + match, +) { + return ( + startTransaction, + startTransactionOnPageLoad = true, + startTransactionOnLocationChange = true, + ) => { + let activeTransaction; + let prevName; + + // Have to use window.location because history.location might not be defined. + if (startTransactionOnPageLoad && _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["WINDOW"] && _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].location) { + normalizeTransactionName( + routes, + _sentry_browser__WEBPACK_IMPORTED_MODULE_0__["WINDOW"].location , + match, + (localName, source = 'url') => { + prevName = localName; + activeTransaction = startTransaction({ + name: prevName, + op: 'pageload', + tags: { + 'routing.instrumentation': 'react-router-v3', + }, + metadata: { + source, + }, + }); + }, + ); + } + + if (startTransactionOnLocationChange && history.listen) { + history.listen(location => { + if (location.action === 'PUSH' || location.action === 'POP') { + if (activeTransaction) { + activeTransaction.finish(); + } + const tags = { + 'routing.instrumentation': 'react-router-v3', + }; + if (prevName) { + tags.from = prevName; + } + normalizeTransactionName(routes, location, match, (localName, source = 'url') => { + prevName = localName; + activeTransaction = startTransaction({ + name: prevName, + op: 'navigation', + tags, + metadata: { + source, + }, + }); + }); + } + }); + } + }; +} + +/** + * Normalize transaction names using `Router.match` + */ +function normalizeTransactionName( + appRoutes, + location, + match, + callback, +) { + let name = location.pathname; + match( + { + location, + routes: appRoutes, + }, + (error, _redirectLocation, renderProps) => { + if (error || !renderProps) { + return callback(name); + } + + const routePath = getRouteStringFromRoutes(renderProps.routes || []); + if (routePath.length === 0 || routePath === '/*') { + return callback(name); + } + + name = routePath; + return callback(name, 'route'); + }, + ); +} + +/** + * Generate route name from array of routes + */ +function getRouteStringFromRoutes(routes) { + if (!Array.isArray(routes) || routes.length === 0) { + return ''; + } + + const routesWithPaths = routes.filter((route) => !!route.path); + + let index = -1; + for (let x = routesWithPaths.length - 1; x >= 0; x--) { + const route = routesWithPaths[x]; + if (route.path && route.path.startsWith('/')) { + index = x; + break; + } + } + + return routesWithPaths + .slice(index) + .filter(({ path }) => !!path) + .map(({ path }) => path) + .join(''); +} + + +//# sourceMappingURL=reactrouterv3.js.map /***/ }), @@ -397205,6 +417325,218 @@ var asciiSize = baseProperty('length'); module.exports = asciiSize; +/***/ }), + +/***/ "ydZW": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeToSize", function() { return normalizeToSize; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "walk", function() { return visit; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("fUgN"); +/* harmony import */ var _memo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("X1v9"); +/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("y+lv"); +/* harmony import */ var _stacktrace__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("bXDU"); + + + + + +/** + * Recursively normalizes the given object. + * + * - Creates a copy to prevent original input mutation + * - Skips non-enumerable properties + * - When stringifying, calls `toJSON` if implemented + * - Removes circular references + * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format + * - Translates known global objects/classes to a string representations + * - Takes care of `Error` object serialization + * - Optionally limits depth of final output + * - Optionally limits number of properties/elements included in any single object/array + * + * @param input The object to be normalized. + * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.) + * @param maxProperties The max number of elements or properties to be included in any single array or + * object in the normallized output.. + * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization. + */ +function normalize(input, depth, maxProperties) { + if (depth === void 0) { depth = +Infinity; } + if (maxProperties === void 0) { maxProperties = +Infinity; } + try { + // since we're at the outermost level, there is no key + return visit('', input, depth, maxProperties); + } + catch (err) { + return { ERROR: "**non-serializable** (" + err + ")" }; + } +} +/** JSDoc */ +function normalizeToSize(object, +// Default Node.js REPL depth +depth, +// 100kB, as 200kB is max payload size, so half sounds reasonable +maxSize) { + if (depth === void 0) { depth = 3; } + if (maxSize === void 0) { maxSize = 100 * 1024; } + var normalized = normalize(object, depth); + if (jsonSize(normalized) > maxSize) { + return normalizeToSize(object, depth - 1, maxSize); + } + return normalized; +} +/** + * Visits a node to perform normalization on it + * + * @param key The key corresponding to the given node + * @param value The node to be visited + * @param depth Optional number indicating the maximum recursion depth + * @param maxProperties Optional maximum number of properties/elements included in any single object/array + * @param memo Optional Memo class handling decycling + */ +function visit(key, value, depth, maxProperties, memo) { + if (depth === void 0) { depth = +Infinity; } + if (maxProperties === void 0) { maxProperties = +Infinity; } + if (memo === void 0) { memo = Object(_memo__WEBPACK_IMPORTED_MODULE_2__["memoBuilder"])(); } + var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(memo, 2), memoize = _a[0], unmemoize = _a[1]; + // If the value has a `toJSON` method, see if we can bail and let it do the work + var valueWithToJSON = value; + if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') { + try { + return valueWithToJSON.toJSON(); + } + catch (err) { + // pass (The built-in `toJSON` failed, but we can still try to do it ourselves) + } + } + // Get the simple cases out of the way first + if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !Object(_is__WEBPACK_IMPORTED_MODULE_1__["isNaN"])(value))) { + return value; + } + var stringified = stringifyValue(key, value); + // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`. + // Everything else will have already been serialized, so if we don't see that pattern, we're done. + if (!stringified.startsWith('[object ')) { + return stringified; + } + // We're also done if we've reached the max depth + if (depth === 0) { + // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`. + return stringified.replace('object ', ''); + } + // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now. + if (memoize(value)) { + return '[Circular ~]'; + } + // 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 + // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each + // property/entry, and keep track of the number of items we add to it. + var normalized = (Array.isArray(value) ? [] : {}); + var numAdded = 0; + // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant + // properties are non-enumerable and otherwise would get missed. + var visitable = (Object(_is__WEBPACK_IMPORTED_MODULE_1__["isError"])(value) || Object(_is__WEBPACK_IMPORTED_MODULE_1__["isEvent"])(value) ? Object(_object__WEBPACK_IMPORTED_MODULE_3__["convertToPlainObject"])(value) : value); + for (var visitKey in visitable) { + // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration. + if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { + continue; + } + if (numAdded >= maxProperties) { + normalized[visitKey] = '[MaxProperties ~]'; + break; + } + // Recursively visit all the child nodes + var visitValue = visitable[visitKey]; + normalized[visitKey] = visit(visitKey, visitValue, depth - 1, maxProperties, memo); + numAdded += 1; + } + // Once we've visited all the branches, remove the parent from memo storage + unmemoize(value); + // Return accumulated values + return normalized; +} +// TODO remove this in v7 (this means the method will no longer be exported, under any name) + +/** + * Stringify the given value. Handles various known special values and types. + * + * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn + * the number 1231 into "[Object Number]", nor on `null`, as it will throw. + * + * @param value The value to stringify + * @returns A stringified representation of the given value + */ +function stringifyValue(key, +// this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for +// our internal use, it'll do +value) { + try { + if (key === 'domain' && value && typeof value === 'object' && value._events) { + return '[Domain]'; + } + if (key === 'domainEmitter') { + return '[DomainEmitter]'; + } + // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first + // which won't throw if they are not present. + if (typeof global !== 'undefined' && value === global) { + return '[Global]'; + } + // eslint-disable-next-line no-restricted-globals + if (typeof window !== 'undefined' && value === window) { + return '[Window]'; + } + // eslint-disable-next-line no-restricted-globals + if (typeof document !== 'undefined' && value === document) { + return '[Document]'; + } + // React's SyntheticEvent thingy + if (Object(_is__WEBPACK_IMPORTED_MODULE_1__["isSyntheticEvent"])(value)) { + return '[SyntheticEvent]'; + } + if (typeof value === 'number' && value !== value) { + return '[NaN]'; + } + // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own) + if (value === void 0) { + return '[undefined]'; + } + if (typeof value === 'function') { + return "[Function: " + Object(_stacktrace__WEBPACK_IMPORTED_MODULE_4__["getFunctionName"])(value) + "]"; + } + if (typeof value === 'symbol') { + return "[" + String(value) + "]"; + } + // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion + if (typeof value === 'bigint') { + return "[BigInt: " + String(value) + "]"; + } + // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting + // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as + // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class), + // we can make sure that only plain objects come out that way. + return "[object " + Object.getPrototypeOf(value).constructor.name + "]"; + } + catch (err) { + return "**non-serializable** (" + err + ")"; + } +} +/** Calculates bytes size of input string */ +function utf8Length(value) { + // eslint-disable-next-line no-bitwise + return ~-encodeURI(value).split(/%..|./).length; +} +/** Calculates bytes size of input object */ +function jsonSize(value) { + return utf8Length(JSON.stringify(value)); +} +//# sourceMappingURL=normalize.js.map +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj"))) + /***/ }), /***/ "ye/S": @@ -397861,6 +418193,230 @@ var OnePassword1PifImporter = /*#__PURE__*/function (_BaseImporter) { return OnePassword1PifImporter; }(_baseImporter__WEBPACK_IMPORTED_MODULE_5__["BaseImporter"]); +/***/ }), + +/***/ "yiFY": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Profiler", function() { return Profiler; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNKNOWN_COMPONENT", function() { return UNKNOWN_COMPONENT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActiveTransaction", function() { return getActiveTransaction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useProfiler", function() { return useProfiler; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withProfiler", function() { return withProfiler; }); +/* harmony import */ var _sentry_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("WSEr"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("2mql"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("q1tI"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("muh5"); + + + + + + +const _jsxFileName = "/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/profiler.tsx";/* eslint-disable @typescript-eslint/no-unsafe-member-access */ + +const UNKNOWN_COMPONENT = 'unknown'; + +/** + * The Profiler component leverages Sentry's Tracing integration to generate + * spans based on component lifecycles. + */ +class Profiler extends react__WEBPACK_IMPORTED_MODULE_3__["Component"] { + /** + * The span of the mount activity + * Made protected for the React Native SDK to access + */ + __init() {this._mountSpan = undefined;} + /** + * The span that represents the duration of time between shouldComponentUpdate and componentDidUpdate + */ + __init2() {this._updateSpan = undefined;} + + // eslint-disable-next-line @typescript-eslint/member-ordering + static __initStatic() {this.defaultProps = { + disabled: false, + includeRender: true, + includeUpdates: true, + };} + + constructor(props) { + super(props);Profiler.prototype.__init.call(this);Profiler.prototype.__init2.call(this);; + const { name, disabled = false } = this.props; + + if (disabled) { + return; + } + + const activeTransaction = getActiveTransaction(); + if (activeTransaction) { + this._mountSpan = activeTransaction.startChild({ + description: `<${name}>`, + op: _constants_js__WEBPACK_IMPORTED_MODULE_4__["REACT_MOUNT_OP"], + }); + } + } + + // If a component mounted, we can finish the mount activity. + componentDidMount() { + if (this._mountSpan) { + this._mountSpan.finish(); + } + } + + shouldComponentUpdate({ updateProps, includeUpdates = true }) { + // Only generate an update span if includeUpdates is true, if there is a valid mountSpan, + // and if the updateProps have changed. It is ok to not do a deep equality check here as it is expensive. + // We are just trying to give baseline clues for further investigation. + if (includeUpdates && this._mountSpan && updateProps !== this.props.updateProps) { + // See what props haved changed between the previous props, and the current props. This is + // set as data on the span. We just store the prop keys as the values could be potenially very large. + const changedProps = Object.keys(updateProps).filter(k => updateProps[k] !== this.props.updateProps[k]); + if (changedProps.length > 0) { + const now = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["timestampWithMs"])(); + this._updateSpan = this._mountSpan.startChild({ + data: { + changedProps, + }, + description: `<${this.props.name}>`, + op: _constants_js__WEBPACK_IMPORTED_MODULE_4__["REACT_UPDATE_OP"], + startTimestamp: now, + }); + } + } + + return true; + } + + componentDidUpdate() { + if (this._updateSpan) { + this._updateSpan.finish(); + this._updateSpan = undefined; + } + } + + // If a component is unmounted, we can say it is no longer on the screen. + // This means we can finish the span representing the component render. + componentWillUnmount() { + const { name, includeRender = true } = this.props; + + if (this._mountSpan && includeRender) { + // If we were able to obtain the spanId of the mount activity, we should set the + // next activity as a child to the component mount activity. + this._mountSpan.startChild({ + description: `<${name}>`, + endTimestamp: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["timestampWithMs"])(), + op: _constants_js__WEBPACK_IMPORTED_MODULE_4__["REACT_RENDER_OP"], + startTimestamp: this._mountSpan.endTimestamp, + }); + } + } + + render() { + return this.props.children; + } +} Profiler.__initStatic(); + +/** + * withProfiler is a higher order component that wraps a + * component in a {@link Profiler} component. It is recommended that + * the higher order component be used over the regular {@link Profiler} component. + * + * @param WrappedComponent component that is wrapped by Profiler + * @param options the {@link ProfilerProps} you can pass into the Profiler + */ +function withProfiler( + WrappedComponent, + // We do not want to have `updateProps` given in options, it is instead filled through the HOC. + options, +) { + const componentDisplayName = + (options && options.name) || WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT; + + const Wrapped = (props) => ( + react__WEBPACK_IMPORTED_MODULE_3__["createElement"](Profiler, { ...options, name: componentDisplayName, updateProps: props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 143}} + , react__WEBPACK_IMPORTED_MODULE_3__["createElement"](WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 144}} ) + ) + ); + + Wrapped.displayName = `profiler(${componentDisplayName})`; + + // Copy over static methods from Wrapped component to Profiler HOC + // See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over + hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_2___default()(Wrapped, WrappedComponent); + return Wrapped; +} + +/** + * + * `useProfiler` is a React hook that profiles a React component. + * + * Requires React 16.8 or above. + * @param name displayName of component being profiled + */ +function useProfiler( + name, + options = { + disabled: false, + hasRenderSpan: true, + }, +) { + const [mountSpan] = react__WEBPACK_IMPORTED_MODULE_3__["useState"](() => { + if (options && options.disabled) { + return undefined; + } + + const activeTransaction = getActiveTransaction(); + if (activeTransaction) { + return activeTransaction.startChild({ + description: `<${name}>`, + op: _constants_js__WEBPACK_IMPORTED_MODULE_4__["REACT_MOUNT_OP"], + }); + } + + return undefined; + }); + + react__WEBPACK_IMPORTED_MODULE_3__["useEffect"](() => { + if (mountSpan) { + mountSpan.finish(); + } + + return () => { + if (mountSpan && options.hasRenderSpan) { + mountSpan.startChild({ + description: `<${name}>`, + endTimestamp: Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["timestampWithMs"])(), + op: _constants_js__WEBPACK_IMPORTED_MODULE_4__["REACT_RENDER_OP"], + startTimestamp: mountSpan.endTimestamp, + }); + } + }; + // We only want this to run once. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); +} + +/** Grabs active transaction off scope */ +function getActiveTransaction(hub = Object(_sentry_browser__WEBPACK_IMPORTED_MODULE_0__["getCurrentHub"])()) { + if (hub) { + const scope = hub.getScope(); + if (scope) { + return scope.getTransaction() ; + } + } + + return undefined; +} + + +//# sourceMappingURL=profiler.js.map + + /***/ }), /***/ "yjT0": @@ -399920,102 +420476,193 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/***/ "z+RT": +/***/ "z1/N": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGlobalObject", function() { return getGlobalObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGlobalSingleton", function() { return getGlobalSingleton; }); -/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("+A1k"); -/** - * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, - * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. - */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CipherBulkMoveRequest", function() { return CipherBulkMoveRequest; }); +/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("lwsE"); +/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); -var fallbackGlobalObject = {}; -/** - * Safely get global scope object - * - * @returns Global scope object - */ -function getGlobalObject() { - return (Object(_node__WEBPACK_IMPORTED_MODULE_0__["isNodeEnv"])() - ? global - : typeof window !== 'undefined' // eslint-disable-line no-restricted-globals - ? window // eslint-disable-line no-restricted-globals - : typeof self !== 'undefined' - ? self - : fallbackGlobalObject); -} -/** - * Returns a global singleton contained in the global `__SENTRY__` object. - * - * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory - * function and added to the `__SENTRY__` object. - * - * @param name name of the global singleton on __SENTRY__ - * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__` - * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `getGlobalObject`'s return value - * @returns the singleton - */ -function getGlobalSingleton(name, creator, obj) { - var global = (obj || getGlobalObject()); - var __SENTRY__ = (global.__SENTRY__ = global.__SENTRY__ || {}); - var singleton = __SENTRY__[name] || (__SENTRY__[name] = creator()); - return singleton; -} -//# sourceMappingURL=global.js.map -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj"))) +var CipherBulkMoveRequest = function CipherBulkMoveRequest(ids, folderId) { + _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CipherBulkMoveRequest); + + this.ids = ids == null ? [] : ids; + this.folderId = folderId; +}; /***/ }), -/***/ "z0xI": +/***/ "z16J": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventStatusFromHttpCode", function() { return eventStatusFromHttpCode; }); -/** - * Converts an HTTP status code to sentry status {@link EventStatus}. - * - * @param code number HTTP status code - * @returns EventStatus - */ -function eventStatusFromHttpCode(code) { - if (code >= 200 && code < 300) { - return 'success'; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InboundFilters", function() { return InboundFilters; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_mergeOptions", function() { return _mergeOptions; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_shouldDropEvent", function() { return _shouldDropEvent; }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("mrSG"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Um2S"); +/* harmony import */ var _flags__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("OEZb"); + + + +// "Script error." is hard coded into browsers for errors that it can't read. +// this is the result of a script being pulled in from an external domain and CORS. +var DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/]; +/** Inbound filters configurable by the user */ +var InboundFilters = /** @class */ (function () { + function InboundFilters(_options) { + if (_options === void 0) { _options = {}; } + this._options = _options; + /** + * @inheritDoc + */ + this.name = InboundFilters.id; } - if (code === 429) { - return 'rate_limit'; + /** + * @inheritDoc + */ + InboundFilters.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) { + addGlobalEventProcessor(function (event) { + var hub = getCurrentHub(); + if (hub) { + var self_1 = hub.getIntegration(InboundFilters); + if (self_1) { + var client = hub.getClient(); + var clientOptions = client ? client.getOptions() : {}; + var options = _mergeOptions(self_1._options, clientOptions); + return _shouldDropEvent(event, options) ? null : event; + } + } + return event; + }); + }; + /** + * @inheritDoc + */ + InboundFilters.id = 'InboundFilters'; + return InboundFilters; +}()); + +/** JSDoc */ +function _mergeOptions(internalOptions, clientOptions) { + if (internalOptions === void 0) { internalOptions = {}; } + if (clientOptions === void 0) { clientOptions = {}; } + return { + allowUrls: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((internalOptions.whitelistUrls || []), (internalOptions.allowUrls || []), (clientOptions.whitelistUrls || []), (clientOptions.allowUrls || [])), + denyUrls: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((internalOptions.blacklistUrls || []), (internalOptions.denyUrls || []), (clientOptions.blacklistUrls || []), (clientOptions.denyUrls || [])), + ignoreErrors: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spread"])((internalOptions.ignoreErrors || []), (clientOptions.ignoreErrors || []), DEFAULT_IGNORE_ERRORS), + ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true, + }; +} +/** JSDoc */ +function _shouldDropEvent(event, options) { + if (options.ignoreInternal && _isSentryError(event)) { + _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn("Event dropped due to being internal Sentry Error.\nEvent: " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event)); + return true; } - if (code >= 400 && code < 500) { - return 'invalid'; + if (_isIgnoredError(event, options.ignoreErrors)) { + _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event)); + return true; } - if (code >= 500) { - return 'failed'; + if (_isDeniedUrl(event, options.denyUrls)) { + _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn("Event dropped due to being matched by `denyUrls` option.\nEvent: " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event) + ".\nUrl: " + _getEventFilterUrl(event)); + return true; } - return 'unknown'; + if (!_isAllowedUrl(event, options.allowUrls)) { + _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event) + ".\nUrl: " + _getEventFilterUrl(event)); + return true; + } + return false; } -//# sourceMappingURL=status.js.map - -/***/ }), - -/***/ "z1/N": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CipherBulkMoveRequest", function() { return CipherBulkMoveRequest; }); -/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("lwsE"); -/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__); - -var CipherBulkMoveRequest = function CipherBulkMoveRequest(ids, folderId) { - _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CipherBulkMoveRequest); - - this.ids = ids == null ? [] : ids; - this.folderId = folderId; -}; +function _isIgnoredError(event, ignoreErrors) { + if (!ignoreErrors || !ignoreErrors.length) { + return false; + } + return _getPossibleEventMessages(event).some(function (message) { + return ignoreErrors.some(function (pattern) { return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isMatchingPattern"])(message, pattern); }); + }); +} +function _isDeniedUrl(event, denyUrls) { + // TODO: Use Glob instead? + if (!denyUrls || !denyUrls.length) { + return false; + } + var url = _getEventFilterUrl(event); + return !url ? false : denyUrls.some(function (pattern) { return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isMatchingPattern"])(url, pattern); }); +} +function _isAllowedUrl(event, allowUrls) { + // TODO: Use Glob instead? + if (!allowUrls || !allowUrls.length) { + return true; + } + var url = _getEventFilterUrl(event); + return !url ? true : allowUrls.some(function (pattern) { return Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["isMatchingPattern"])(url, pattern); }); +} +function _getPossibleEventMessages(event) { + if (event.message) { + return [event.message]; + } + if (event.exception) { + try { + var _a = (event.exception.values && event.exception.values[0]) || {}, _b = _a.type, type = _b === void 0 ? '' : _b, _c = _a.value, value = _c === void 0 ? '' : _c; + return ["" + value, type + ": " + value]; + } + catch (oO) { + _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error("Cannot extract message for event " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event)); + return []; + } + } + return []; +} +function _isSentryError(event) { + try { + // @ts-ignore can't be a sentry error if undefined + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return event.exception.values[0].type === 'SentryError'; + } + catch (e) { + // ignore + } + return false; +} +function _getLastValidUrl(frames) { + if (frames === void 0) { frames = []; } + for (var i = frames.length - 1; i >= 0; i--) { + var frame = frames[i]; + if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') { + return frame.filename || null; + } + } + return null; +} +function _getEventFilterUrl(event) { + try { + if (event.stacktrace) { + return _getLastValidUrl(event.stacktrace.frames); + } + var frames_1; + try { + // @ts-ignore we only care about frames if the whole thing here is defined + frames_1 = event.exception.values[0].stacktrace.frames; + } + catch (e) { + // ignore + } + return frames_1 ? _getLastValidUrl(frames_1) : null; + } + catch (oO) { + _flags__WEBPACK_IMPORTED_MODULE_2__["IS_DEBUG_BUILD"] && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].error("Cannot extract url for event " + Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getEventDescription"])(event)); + return null; + } +} +//# sourceMappingURL=inboundfilters.js.map /***/ }), @@ -400316,6 +420963,206 @@ function isThisISOWeek (dirtyDate) { module.exports = isThisISOWeek +/***/ }), + +/***/ "zHkj": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BROWSER_TRACING_INTEGRATION_ID", function() { return BROWSER_TRACING_INTEGRATION_ID; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserTracing", function() { return BrowserTracing; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMetaContent", function() { return getMetaContent; }); +/* harmony import */ var _sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ms9h"); +/* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("TwdF"); +/* harmony import */ var _hubextensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Cpvd"); +/* harmony import */ var _idletransaction_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("MBYv"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("FGHR"); +/* harmony import */ var _backgroundtab_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("CJ5d"); +/* harmony import */ var _metrics_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("OBsZ"); +/* harmony import */ var _request_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("crS0"); +/* harmony import */ var _router_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("xpBP"); +/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("Wezb"); + + + + + + + + + + + +const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing'; + +/** Options for Browser Tracing integration */ + +const DEFAULT_BROWSER_TRACING_OPTIONS = { + idleTimeout: _idletransaction_js__WEBPACK_IMPORTED_MODULE_3__["DEFAULT_IDLE_TIMEOUT"], + finalTimeout: _idletransaction_js__WEBPACK_IMPORTED_MODULE_3__["DEFAULT_FINAL_TIMEOUT"], + heartbeatInterval: _idletransaction_js__WEBPACK_IMPORTED_MODULE_3__["DEFAULT_HEARTBEAT_INTERVAL"], + markBackgroundTransactions: true, + routingInstrumentation: _router_js__WEBPACK_IMPORTED_MODULE_8__["instrumentRoutingWithDefaults"], + startTransactionOnLocationChange: true, + startTransactionOnPageLoad: true, + _experiments: { enableLongTask: true }, + ..._request_js__WEBPACK_IMPORTED_MODULE_7__["defaultRequestInstrumentationOptions"], +}; + +/** + * The Browser Tracing integration automatically instruments browser pageload/navigation + * actions as transactions, and captures requests, metrics and errors as spans. + * + * The integration can be configured with a variety of options, and can be extended to use + * any routing library. This integration uses {@see IdleTransaction} to create transactions. + */ +class BrowserTracing { + // This class currently doesn't have a static `id` field like the other integration classes, because it prevented + // @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects. + // TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all + // integrations. + + /** Browser Tracing integration options */ + + /** + * @inheritDoc + */ + __init() {this.name = BROWSER_TRACING_INTEGRATION_ID;} + + constructor(_options) {;BrowserTracing.prototype.__init.call(this); + this.options = { + ...DEFAULT_BROWSER_TRACING_OPTIONS, + ..._options, + }; + + const { _metricOptions } = this.options; + Object(_metrics_index_js__WEBPACK_IMPORTED_MODULE_6__["startTrackingWebVitals"])(_metricOptions && _metricOptions._reportAllChanges); + if (Object(_sentry_utils_esm_buildPolyfills__WEBPACK_IMPORTED_MODULE_0__["_optionalChain"])([this, 'access', _2 => _2.options, 'access', _3 => _3._experiments, 'optionalAccess', _4 => _4.enableLongTask])) { + Object(_metrics_index_js__WEBPACK_IMPORTED_MODULE_6__["startTrackingLongTasks"])(); + } + } + + /** + * @inheritDoc + */ + setupOnce(_, getCurrentHub) { + this._getCurrentHub = getCurrentHub; + + // eslint-disable-next-line @typescript-eslint/unbound-method + const { + routingInstrumentation: instrumentRouting, + startTransactionOnLocationChange, + startTransactionOnPageLoad, + markBackgroundTransactions, + traceFetch, + traceXHR, + // eslint-disable-next-line deprecation/deprecation + tracingOrigins, + shouldCreateSpanForRequest, + } = this.options; + + instrumentRouting( + (context) => this._createRouteTransaction(context), + startTransactionOnPageLoad, + startTransactionOnLocationChange, + ); + + if (markBackgroundTransactions) { + Object(_backgroundtab_js__WEBPACK_IMPORTED_MODULE_5__["registerBackgroundTabDetection"])(); + } + + Object(_request_js__WEBPACK_IMPORTED_MODULE_7__["instrumentOutgoingRequests"])({ traceFetch, traceXHR, tracingOrigins, shouldCreateSpanForRequest }); + } + + /** Create routing idle transaction. */ + _createRouteTransaction(context) { + if (!this._getCurrentHub) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].warn(`[Tracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`); + return undefined; + } + + // eslint-disable-next-line @typescript-eslint/unbound-method + const { beforeNavigate, idleTimeout, finalTimeout, heartbeatInterval } = this.options; + + const isPageloadTransaction = context.op === 'pageload'; + + const sentryTraceMetaTagValue = isPageloadTransaction ? getMetaContent('sentry-trace') : null; + const baggageMetaTagValue = isPageloadTransaction ? getMetaContent('baggage') : null; + + const traceParentData = sentryTraceMetaTagValue ? Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["extractTraceparentData"])(sentryTraceMetaTagValue) : undefined; + const dynamicSamplingContext = baggageMetaTagValue + ? Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["baggageHeaderToDynamicSamplingContext"])(baggageMetaTagValue) + : undefined; + + const expandedContext = { + ...context, + ...traceParentData, + metadata: { + ...context.metadata, + dynamicSamplingContext: traceParentData && !dynamicSamplingContext ? {} : dynamicSamplingContext, + }, + trimEnd: true, + }; + + const modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext; + + // For backwards compatibility reasons, beforeNavigate can return undefined to "drop" the transaction (prevent it + // from being sent to Sentry). + const finalContext = modifiedContext === undefined ? { ...expandedContext, sampled: false } : modifiedContext; + + // If `beforeNavigate` set a custom name, record that fact + finalContext.metadata = + finalContext.name !== expandedContext.name + ? { ...finalContext.metadata, source: 'custom' } + : finalContext.metadata; + + if (finalContext.sampled === false) { + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && + _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`); + } + + (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_1__["logger"].log(`[Tracing] Starting ${finalContext.op} transaction on scope`); + + const hub = this._getCurrentHub(); + const { location } = _types_js__WEBPACK_IMPORTED_MODULE_9__["WINDOW"]; + + const idleTransaction = Object(_hubextensions_js__WEBPACK_IMPORTED_MODULE_2__["startIdleTransaction"])( + hub, + finalContext, + idleTimeout, + finalTimeout, + true, + { location }, // for use in the tracesSampler + heartbeatInterval, + ); + idleTransaction.registerBeforeFinishCallback(transaction => { + Object(_metrics_index_js__WEBPACK_IMPORTED_MODULE_6__["addPerformanceEntries"])(transaction); + transaction.setTag( + 'sentry_reportAllChanges', + Boolean(this.options._metricOptions && this.options._metricOptions._reportAllChanges), + ); + }); + + return idleTransaction ; + } +} + +/** Returns the value of a meta tag */ +function getMetaContent(metaName) { + // Can't specify generic to `getDomElement` because tracing can be used + // in a variety of environments, have to disable `no-unsafe-member-access` + // as a result. + const metaTag = Object(_sentry_utils__WEBPACK_IMPORTED_MODULE_1__["getDomElement"])(`meta[name=${metaName}]`); + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return metaTag ? metaTag.getAttribute('content') : null; +} + + +//# sourceMappingURL=browsertracing.js.map + + /***/ }), /***/ "zKZ8": @@ -400621,6 +421468,37 @@ function ordinal (number) { module.exports = buildFormatLocale +/***/ }), + +/***/ "zUo4": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventStatusFromHttpCode", function() { return eventStatusFromHttpCode; }); +/** + * Converts an HTTP status code to sentry status {@link EventStatus}. + * + * @param code number HTTP status code + * @returns EventStatus + */ +function eventStatusFromHttpCode(code) { + if (code >= 200 && code < 300) { + return 'success'; + } + if (code === 429) { + return 'rate_limit'; + } + if (code >= 400 && code < 500) { + return 'invalid'; + } + if (code >= 500) { + return 'failed'; + } + return 'unknown'; +} +//# sourceMappingURL=status.js.map + /***/ }), /***/ "zVMV":