Files
discord-decomp/_bundle/Module1094.js
T
2026-11-01 12:12:55 +02:00

55 lines
2.1 KiB
JavaScript

// Metro module 1094 (f1095).
import { DEBUG_BUILD } from "./Module1072";
import { defineIntegration, debug, serializeEnvelope } from "./Module817";
import { getNativeImplementation } from "./Module1033";
function $mk68056() {
return ({ description }) => description == null ? void 0 : description.includes("#sentry-spotlight");
}
Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module"
});
const name = "SpotlightBrowser";
const r17 = defineIntegration(function(r1 = {}) {
let c12790_0 = r1.sidecarUrl || "http://localhost:8969/stream";
return {
name,
setup: () => {
if (DEBUG_BUILD) {
debug.log("Using Sidecar URL", c12790_0);
}
},
processEvent: (a0) => Boolean(a0.type === "transaction" && a0.spans && a0.contexts?.trace && a0.contexts.trace.op === "ui.action.click" && a0.spans.some($mk68056())) ? null : a0,
afterAllSetup: (a0) => {
let c24190_0 = c12790_0;
const nativeImplementation = getNativeImplementation("fetch");
let c24190_2 = 0;
a0.on("beforeEnvelope", (a0) => {
if (c24190_2 > 3) {
debug.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:", c24190_2);
} else {
nativeImplementation(c24190_0, {
method: "POST",
body: serializeEnvelope(a0),
headers: {
"Content-Type": "application/x-sentry-envelope"
},
mode: "cors"
}).then((result) => {
if (result.status >= 200 && result.status < 400) {
c24190_2 = 0;
}
}, (a0) => {
c24190_2 = c24190_2 + 1;
debug.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/", a0);
});
}
});
}
};
});
export const INTEGRATION_NAME = "SpotlightBrowser";
export function isSpotlightInteraction(a0) {
return Boolean(a0.type === "transaction" && a0.spans && a0.contexts?.trace && a0.contexts.trace.op === "ui.action.click" && a0.spans.some($mk68056()));
}
export { r17 as spotlightBrowserIntegration };