@sailfish-ai/recorder 1.11.0 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{chunkSerializer-ZzIoYlP2.js → chunkSerializer-BiemuRlf.js} +1 -1
- package/dist/chunks/chunkSerializer-BiemuRlf.js.br +0 -0
- package/dist/chunks/chunkSerializer-BiemuRlf.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-CRDpgzTs.js → chunkSerializer-CJQCxiLD.js} +1 -1
- package/dist/chunks/chunkSerializer-CJQCxiLD.js.br +0 -0
- package/dist/chunks/chunkSerializer-CJQCxiLD.js.gz +0 -0
- package/dist/chunks/{index-BQn1Q-2-.js → index-Cfj4Epfd.js} +120 -94
- package/dist/chunks/index-Cfj4Epfd.js.br +0 -0
- package/dist/chunks/index-Cfj4Epfd.js.gz +0 -0
- package/dist/chunks/{index-Dq_tjmkZ.js → index-CuXHImrI.js} +114 -86
- package/dist/chunks/index-CuXHImrI.js.br +0 -0
- package/dist/chunks/index-CuXHImrI.js.gz +0 -0
- package/dist/inAppReportIssueModal/index.js +15 -14
- package/dist/inAppReportIssueModal/index.js.br +0 -0
- package/dist/inAppReportIssueModal/index.js.gz +0 -0
- package/dist/inAppReportIssueModal/integrations.js +56 -4
- package/dist/inAppReportIssueModal/integrations.js.br +0 -0
- package/dist/inAppReportIssueModal/integrations.js.gz +0 -0
- package/dist/index.js +55 -40
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/recorder.cjs +2 -2
- package/dist/recorder.cjs.br +0 -0
- package/dist/recorder.cjs.gz +0 -0
- package/dist/recorder.js +26 -25
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/recorder.umd.cjs +287 -261
- package/dist/recorder.umd.cjs.br +0 -0
- package/dist/recorder.umd.cjs.gz +0 -0
- package/dist/recording.js +2 -2
- package/dist/recording.js.br +0 -0
- package/dist/recording.js.gz +0 -0
- package/dist/sendSailfishMessages.js +4 -0
- package/dist/sendSailfishMessages.js.br +0 -0
- package/dist/sendSailfishMessages.js.gz +0 -0
- package/dist/snippet-auto-init.js +147 -18
- package/dist/snippet-auto-init.js.br +0 -0
- package/dist/snippet-auto-init.js.gz +0 -0
- package/dist/types/inAppReportIssueModal/integrations.d.ts +7 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/sendSailfishMessages.d.ts +4 -0
- package/dist/types/snippet-auto-init.d.ts +30 -0
- package/dist/types/types.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/chunkSerializer-CRDpgzTs.js.br +0 -0
- package/dist/chunks/chunkSerializer-CRDpgzTs.js.gz +0 -0
- package/dist/chunks/chunkSerializer-ZzIoYlP2.js.br +0 -0
- package/dist/chunks/chunkSerializer-ZzIoYlP2.js.gz +0 -0
- package/dist/chunks/index-BQn1Q-2-.js.br +0 -0
- package/dist/chunks/index-BQn1Q-2-.js.gz +0 -0
- package/dist/chunks/index-Dq_tjmkZ.js.br +0 -0
- package/dist/chunks/index-Dq_tjmkZ.js.gz +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as e } from "./index-
|
|
1
|
+
import { y as e } from "./index-CuXHImrI.js";
|
|
2
2
|
async function chunkedSnapshot(t, n, o = {}) {
|
|
3
3
|
const s = o.chunkSize ?? 500, r = o.maxChunkMs ?? 16, { blockClass: c, blockSelector: a, maskTextClass: i, maskTextSelector: d } = o;
|
|
4
4
|
let u = 100001, l = 0, N = performance.now();
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const e = require("./index-
|
|
3
|
+
const e = require("./index-Cfj4Epfd.js");
|
|
4
4
|
exports.chunkedSnapshot = async function chunkedSnapshot(t, n, o = {}) {
|
|
5
5
|
const s = o.chunkSize ?? 500, r = o.maxChunkMs ?? 16, { blockClass: c, blockSelector: a, maskTextClass: i, maskTextSelector: d } = o;
|
|
6
6
|
let u = 100001, l = 0, N = performance.now();
|
|
Binary file
|
|
Binary file
|
|
@@ -178,8 +178,8 @@ function withAppUrlMetadata(e2) {
|
|
|
178
178
|
return { ...e2 ?? {}, appUrl: (e2 == null ? void 0 : e2.appUrl) ?? ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.href) };
|
|
179
179
|
}
|
|
180
180
|
exports.nowTimestamp = Date.now, /[1-9][0-9]{12}/.test(Date.now().toString()) || (exports.nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime());
|
|
181
|
-
const S = readDebugFlag(),
|
|
182
|
-
let
|
|
181
|
+
const S = readDebugFlag(), w = "per_session";
|
|
182
|
+
let v = null, k = null, x = false, I = null, T = null, E = "", C = "", $ = false;
|
|
183
183
|
const F = [];
|
|
184
184
|
function onNavigationChange(e2) {
|
|
185
185
|
F.push(e2);
|
|
@@ -226,8 +226,8 @@ let A = false, R = null, D = null, _ = false;
|
|
|
226
226
|
const P = "sailfish_funcspan_global_state";
|
|
227
227
|
function wsSendPayload(e2) {
|
|
228
228
|
if (!isWebSocketOpen(k)) return false;
|
|
229
|
-
if (
|
|
230
|
-
return
|
|
229
|
+
if (v) try {
|
|
230
|
+
return v.postMessage({ type: "send", payload: e2 }), true;
|
|
231
231
|
} catch {
|
|
232
232
|
return false;
|
|
233
233
|
}
|
|
@@ -239,8 +239,8 @@ function wsSendPayload(e2) {
|
|
|
239
239
|
}
|
|
240
240
|
function wsSendRaw(e2) {
|
|
241
241
|
if (!isWebSocketOpen(k)) return false;
|
|
242
|
-
if (
|
|
243
|
-
return
|
|
242
|
+
if (v) try {
|
|
243
|
+
return v.postMessage({ type: "sendRaw", payload: e2 }), true;
|
|
244
244
|
} catch {
|
|
245
245
|
return false;
|
|
246
246
|
}
|
|
@@ -391,8 +391,8 @@ function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
|
391
391
|
const t3 = new URL(e2);
|
|
392
392
|
return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
|
|
393
393
|
})(t2);
|
|
394
|
-
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${r2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.11.
|
|
395
|
-
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`),
|
|
394
|
+
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${r2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.11.1`;
|
|
395
|
+
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), v = s2 ? (function tryCreateWsWorker() {
|
|
396
396
|
if ("undefined" == typeof Worker) return null;
|
|
397
397
|
try {
|
|
398
398
|
const e2 = new Blob(['\nvar ws = null;\nvar wsUrl = "";\nvar reconnectTimer = null;\nvar reconnectDelay = 1000;\nvar MAX_RECONNECT_DELAY = 30000;\nvar CONNECTION_TIMEOUT = 30000;\nvar queue = [];\nvar MAX_QUEUE = 500;\n\nfunction enqueue(str) {\n if (queue.length >= MAX_QUEUE) queue.shift();\n queue.push(str);\n}\n\nfunction drain() {\n while (queue.length > 0) {\n if (!ws || ws.readyState !== 1) break;\n try { ws.send(queue.shift()); } catch (e) { break; }\n }\n}\n\nfunction connect() {\n if (ws && (ws.readyState === 0 || ws.readyState === 1)) return;\n try { ws = new WebSocket(wsUrl); } catch (e) { scheduleReconnect(); return; }\n var tid = setTimeout(function() { if (ws && ws.readyState === 0) ws.close(); }, CONNECTION_TIMEOUT);\n ws.onopen = function() {\n clearTimeout(tid);\n reconnectDelay = 1000;\n drain();\n postMessage({ type: "open" });\n };\n ws.onclose = function() {\n clearTimeout(tid);\n ws = null;\n postMessage({ type: "close" });\n scheduleReconnect();\n };\n ws.onerror = function() {};\n ws.onmessage = function(e) {\n postMessage({ type: "message", data: e.data });\n };\n}\n\nfunction scheduleReconnect() {\n if (reconnectTimer) return;\n reconnectTimer = setTimeout(function() {\n reconnectTimer = null;\n reconnectDelay = Math.min(reconnectDelay * 1.5, MAX_RECONNECT_DELAY);\n connect();\n }, reconnectDelay);\n}\n\nself.onmessage = function(e) {\n var msg = e.data;\n if (msg.type === "init") {\n wsUrl = msg.wsUrl;\n connect();\n } else if (msg.type === "send") {\n try {\n var s = JSON.stringify(msg.payload);\n if (ws && ws.readyState === 1) { ws.send(s); }\n else { enqueue(s); }\n } catch (e) {}\n } else if (msg.type === "sendRaw") {\n if (ws && ws.readyState === 1) {\n try { ws.send(msg.payload); } catch (e) { enqueue(msg.payload); }\n } else { enqueue(msg.payload); }\n } else if (msg.type === "close") {\n if (reconnectTimer) { clearTimeout(reconnectTimer); reconnectTimer = null; }\n if (ws) { ws.close(); ws = null; }\n }\n};\n'], { type: "application/javascript" }), t3 = URL.createObjectURL(e2), n3 = new Worker(t3);
|
|
@@ -400,16 +400,16 @@ function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
|
400
400
|
} catch {
|
|
401
401
|
return null;
|
|
402
402
|
}
|
|
403
|
-
})() : null,
|
|
404
|
-
const e2 =
|
|
405
|
-
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(),
|
|
403
|
+
})() : null, v) {
|
|
404
|
+
const e2 = v, t3 = { readyState: WebSocket.CONNECTING, close: () => {
|
|
405
|
+
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(), v = null, null != T && (clearInterval(T), T = null);
|
|
406
406
|
} };
|
|
407
|
-
return k = t3,
|
|
407
|
+
return k = t3, v.onmessage = (e3) => {
|
|
408
408
|
const n3 = e3.data;
|
|
409
409
|
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, handleWsClose()) : "message" === n3.type && handleWsMessage(n3.data);
|
|
410
|
-
},
|
|
410
|
+
}, v.onerror = () => {
|
|
411
411
|
S && console.warn("[Sailfish] WebSocket worker error");
|
|
412
|
-
},
|
|
412
|
+
}, v.postMessage({ type: "init", wsUrl: a2 }), S && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
|
|
413
413
|
}
|
|
414
414
|
S && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
|
|
415
415
|
const l2 = new e(a2, [], { connectionTimeout: 3e4 }), c2 = { get readyState() {
|
|
@@ -424,12 +424,12 @@ function sendMessage(e2) {
|
|
|
424
424
|
}
|
|
425
425
|
function enableFunctionSpanTracking() {
|
|
426
426
|
if (S && console.log("[Sailfish] enableFunctionSpanTracking() called - Report Issue recording started (LOCAL MODE)"), A = true, _ = true, D = null, null !== R && (window.clearTimeout(R), R = null), isWebSocketOpen(k)) {
|
|
427
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType:
|
|
427
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType: w });
|
|
428
428
|
} else S && console.warn("[Sailfish] WebSocket not open, cannot report LOCAL tracking session");
|
|
429
429
|
}
|
|
430
430
|
function disableFunctionSpanTracking() {
|
|
431
431
|
if (S && console.log("[Sailfish] disableFunctionSpanTracking() called - Report Issue recording stopped"), isWebSocketOpen(k)) {
|
|
432
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType:
|
|
432
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType: w });
|
|
433
433
|
} else console.warn("[FUNCSPAN STOP] ✗ WebSocket not open, cannot notify tracking end");
|
|
434
434
|
_ && (A = false, _ = false, D = null, S && console.log("[Sailfish] LOCAL tracking mode disabled")), null !== R && (window.clearTimeout(R), R = null);
|
|
435
435
|
}
|
|
@@ -447,26 +447,29 @@ function getFuncSpanHeader() {
|
|
|
447
447
|
return { name: "X-Sf3-FunctionSpanCaptureOverride", value: "1-1-10-10-1-1.0-1-0-0" };
|
|
448
448
|
}
|
|
449
449
|
const j = Object.freeze(Object.defineProperty({ __proto__: null, clearStaleFuncSpanState, disableFunctionSpanTracking, enableFunctionSpanTracking, ensureHrefCache, flushBufferedEvents, getCachedHref, getCachedHrefNoQuery, getFuncSpanHeader, initializeFunctionSpanTrackingFromApi, initializeWebSocket, isFunctionSpanTrackingEnabled, onNavigationChange, restoreFuncSpanState, sendEvent, sendMessage }, Symbol.toStringTag, { value: "Module" }));
|
|
450
|
-
let O = null,
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
let O = null, U = null;
|
|
451
|
+
function getIdentifiedUser() {
|
|
452
|
+
return O;
|
|
453
|
+
}
|
|
454
|
+
let z = null;
|
|
455
|
+
const N = ["https://api.ipify.org?format=json", "https://api.ip.sb/jsonip", "https://api4.my-ip.io/ip.json"];
|
|
453
456
|
function fetchAndSendIp(e2) {
|
|
454
|
-
|
|
455
|
-
for (const e3 of
|
|
457
|
+
z !== e2 && (z = e2, (async () => {
|
|
458
|
+
for (const e3 of N) try {
|
|
456
459
|
const t2 = new AbortController(), n2 = setTimeout(() => t2.abort(), 5e3), i2 = await fetch(e3, { signal: t2.signal });
|
|
457
460
|
if (clearTimeout(n2), !i2.ok) continue;
|
|
458
461
|
const o2 = await i2.json(), s2 = o2.ip || o2.origin || null;
|
|
459
462
|
if (s2 && "string" == typeof s2 && s2.length <= 45) return void sendMessage({ type: "visitorIp", ip: s2, timestamp: exports.nowTimestamp() });
|
|
460
463
|
} catch {
|
|
461
464
|
}
|
|
462
|
-
|
|
465
|
+
z = null;
|
|
463
466
|
})().catch(() => {
|
|
464
|
-
|
|
467
|
+
z = null;
|
|
465
468
|
}));
|
|
466
469
|
}
|
|
467
|
-
let
|
|
470
|
+
let H = null;
|
|
468
471
|
async function getSourceMapModule() {
|
|
469
|
-
return
|
|
472
|
+
return H || (H = await import("source-map-js")), H;
|
|
470
473
|
}
|
|
471
474
|
const q = /* @__PURE__ */ new Map(), W = /(?:\(|\s|^)(https?:\/\/[^)\s]+|\/[^)\s]+|[^)\s]+)?\/?([^/]+\.js)(?:\?[^:)]*)?:(\d+):(\d+)/;
|
|
472
475
|
async function getConsumerFor(e2, t2) {
|
|
@@ -711,12 +714,12 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
711
714
|
}
|
|
712
715
|
const { record: n4 } = await import("@sailfish-rrweb/rrweb-record-only");
|
|
713
716
|
if (Q = n4, await yieldToMain(), l2) {
|
|
714
|
-
const { chunkedSnapshot: i3 } = await Promise.resolve().then(() => require("./chunkSerializer-
|
|
717
|
+
const { chunkedSnapshot: i3 } = await Promise.resolve().then(() => require("./chunkSerializer-CJQCxiLD.js")), o3 = n4.mirror;
|
|
715
718
|
let s3 = true;
|
|
716
719
|
const r3 = [];
|
|
717
720
|
n4({ emit(e3) {
|
|
718
721
|
s3 ? r3.push(e3) : emitWithContext(e3);
|
|
719
|
-
}, maskInputOptions: { text: true }, maskInputFn, maskTextClass: J,
|
|
722
|
+
}, maskInputOptions: { text: true }, maskInputFn, ...e2, maskTextClass: e2.maskTextClass ?? J, recordDOM: false });
|
|
720
723
|
const a3 = Date.now(), l3 = await i3(document, o3, { chunkSize: 500, maxChunkMs: 16, blockClass: e2.blockClass, blockSelector: e2.blockSelector, maskTextClass: e2.maskTextClass ?? J, maskTextSelector: e2.maskTextSelector });
|
|
721
724
|
if (l3) {
|
|
722
725
|
emitWithContext({ type: t.EventType.Meta, data: { href: window.location.href, width: document.documentElement.clientWidth || document.body.clientWidth, height: document.documentElement.clientHeight || document.body.clientHeight }, timestamp: a3 }), emitWithContext({ type: t.EventType.FullSnapshot, data: { node: l3, initialOffset: { left: void 0 !== window.pageXOffset ? window.pageXOffset : document.documentElement.scrollLeft, top: void 0 !== window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop } }, timestamp: a3 });
|
|
@@ -725,7 +728,7 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
725
728
|
} else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"), s3 = false;
|
|
726
729
|
} else n4({ emit(e3) {
|
|
727
730
|
emitWithContext(e3);
|
|
728
|
-
}, maskInputOptions: { text: true }, maskInputFn, maskTextClass: J
|
|
731
|
+
}, maskInputOptions: { text: true }, maskInputFn, ...e2, maskTextClass: e2.maskTextClass ?? J });
|
|
729
732
|
};
|
|
730
733
|
if (r2) {
|
|
731
734
|
let e3 = false;
|
|
@@ -940,12 +943,26 @@ function updateIssueTypeOptions(e2, t2) {
|
|
|
940
943
|
}
|
|
941
944
|
function getFieldsForProject(e2, t2) {
|
|
942
945
|
if (!(re == null ? void 0 : re.fieldConfigurations) || !e2) return [];
|
|
943
|
-
const n2 = Array.isArray(re.fieldConfigurations) ? re.fieldConfigurations.find((n3) => n3.project_key
|
|
946
|
+
const n2 = Array.isArray(re.fieldConfigurations) ? re.fieldConfigurations.find((n3) => !(n3.project_key !== e2 && String(n3.project_id) !== String(e2) || t2 && String(n3.issue_type_id) !== String(t2))) : re.fieldConfigurations[e2];
|
|
944
947
|
return n2 && n2.fields ? n2.fields : [];
|
|
945
948
|
}
|
|
946
949
|
function getUsers() {
|
|
947
950
|
return (re == null ? void 0 : re.users) ? re.users : [];
|
|
948
951
|
}
|
|
952
|
+
function getDefaultReporterAccountId() {
|
|
953
|
+
const e2 = getUsers(), t2 = getIdentifiedUser();
|
|
954
|
+
if (!e2.length || !t2) return null;
|
|
955
|
+
const n2 = t2.traits || {}, i2 = (n2.email || t2.userId || "").toLowerCase().trim(), o2 = (n2.name || n2.displayName || n2.fullName || n2.full_name || (n2.firstName || n2.first_name ? `${n2.firstName || n2.first_name} ${n2.lastName || n2.last_name || ""}`.trim() : "") || "").toLowerCase().trim(), findUnique = (t3) => {
|
|
956
|
+
const n3 = e2.filter(t3);
|
|
957
|
+
return 1 === n3.length ? n3[0] : null;
|
|
958
|
+
};
|
|
959
|
+
let s2 = i2 ? findUnique((e3) => (e3.email || e3.emailAddress || "").toLowerCase().trim() === i2) : null;
|
|
960
|
+
if (!s2 && o2 && (s2 = findUnique((e3) => (e3.name || e3.displayName || "").toLowerCase().trim() === o2)), !s2 && i2) {
|
|
961
|
+
const e3 = i2.split("@")[0];
|
|
962
|
+
e3.length >= 3 && (s2 = findUnique((t3) => (t3.name || t3.displayName || "").toLowerCase().trim().includes(e3)));
|
|
963
|
+
}
|
|
964
|
+
return s2 && (s2.id || s2.accountId) || null;
|
|
965
|
+
}
|
|
949
966
|
function getProjectsForTeam(e2) {
|
|
950
967
|
if (!re) return [];
|
|
951
968
|
const t2 = re.teams && Array.isArray(re.teams) && re.teams.length > 0;
|
|
@@ -978,7 +995,7 @@ const le = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrati
|
|
|
978
995
|
} catch (e3) {
|
|
979
996
|
console.error("Error fetching integration data:", e3), re = null;
|
|
980
997
|
}
|
|
981
|
-
}, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSprintFieldId, getUsers, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" })), ce = "sf-create-issue-preference", de = "sf-create-eng-ticket-preference";
|
|
998
|
+
}, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSprintFieldId, getUsers, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" })), ce = "sf-create-issue-preference", de = "sf-create-eng-ticket-preference";
|
|
982
999
|
function getInitialState() {
|
|
983
1000
|
const e2 = (function loadUserPreferences() {
|
|
984
1001
|
return { createIssue: f && "true" === localStorage.getItem(ce), createEngTicket: f && "true" === localStorage.getItem(de) };
|
|
@@ -1568,8 +1585,11 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1568
1585
|
if (!hasValidIntegration()) return l2.checked = false, ue.createEngTicket = false, localStorage.setItem(de, "false"), c2 && (c2.style.display = "none"), void alert("No engineering ticket integration found. Please install and configure an integration (Jira, Linear, or Zendesk) first.");
|
|
1569
1586
|
const e5 = getIntegrationData();
|
|
1570
1587
|
if (e5) {
|
|
1571
|
-
if (!ue.engTicketTeam && e5.defaultTeam && (ue.engTicketTeam = e5.defaultTeam), !ue.engTicketProject && e5.defaultProject && (ue.engTicketProject = e5.defaultProject), !ue.engTicketPriority && e5.defaultPriority && (ue.engTicketPriority = e5.defaultPriority), updateFormWithIntegrationData(ue), "jira" === ((_a = e5.provider) == null ? void 0 : _a.toLowerCase()) &&
|
|
1572
|
-
getFieldsForProject(ue.engTicketProject, ue.engTicketIssueType).find((e6) => "reporter" === e6.fieldId)
|
|
1588
|
+
if (!ue.engTicketTeam && e5.defaultTeam && (ue.engTicketTeam = e5.defaultTeam), !ue.engTicketProject && e5.defaultProject && (ue.engTicketProject = e5.defaultProject), !ue.engTicketPriority && e5.defaultPriority && (ue.engTicketPriority = e5.defaultPriority), updateFormWithIntegrationData(ue), "jira" === ((_a = e5.provider) == null ? void 0 : _a.toLowerCase()) && ue.engTicketProject && !ue.engTicketCustomFields.reporter) {
|
|
1589
|
+
if (getFieldsForProject(ue.engTicketProject, ue.engTicketIssueType).find((e6) => "reporter" === e6.fieldId)) {
|
|
1590
|
+
const t5 = getDefaultReporterAccountId();
|
|
1591
|
+
ue.engTicketCustomFields.reporter = t5 || e5.jiraReporterAccountId || "";
|
|
1592
|
+
}
|
|
1573
1593
|
}
|
|
1574
1594
|
const t4 = document.getElementById("sf-eng-ticket-project"), n3 = document.getElementById("sf-eng-ticket-type");
|
|
1575
1595
|
t4 && t4.value && renderDynamicFields(t4.value, n3 == null ? void 0 : n3.value);
|
|
@@ -1703,8 +1723,11 @@ function initializeEngTicketForm() {
|
|
|
1703
1723
|
var _a;
|
|
1704
1724
|
const e2 = ye.integrationData;
|
|
1705
1725
|
if (e2) {
|
|
1706
|
-
if (!ue.engTicketTeam && e2.defaultTeam && (ue.engTicketTeam = e2.defaultTeam), !ue.engTicketProject && e2.defaultProject && (ue.engTicketProject = e2.defaultProject), !ue.engTicketPriority && e2.defaultPriority && (ue.engTicketPriority = e2.defaultPriority), updateFormWithIntegrationData(ue), "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase()) &&
|
|
1707
|
-
getFieldsForProject(ue.engTicketProject, ue.engTicketIssueType).find((e3) => "reporter" === e3.fieldId)
|
|
1726
|
+
if (!ue.engTicketTeam && e2.defaultTeam && (ue.engTicketTeam = e2.defaultTeam), !ue.engTicketProject && e2.defaultProject && (ue.engTicketProject = e2.defaultProject), !ue.engTicketPriority && e2.defaultPriority && (ue.engTicketPriority = e2.defaultPriority), updateFormWithIntegrationData(ue), "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase()) && ue.engTicketProject && !ue.engTicketCustomFields.reporter) {
|
|
1727
|
+
if (getFieldsForProject(ue.engTicketProject, ue.engTicketIssueType).find((e3) => "reporter" === e3.fieldId)) {
|
|
1728
|
+
const t2 = getDefaultReporterAccountId();
|
|
1729
|
+
ue.engTicketCustomFields.reporter = t2 || e2.jiraReporterAccountId || "";
|
|
1730
|
+
}
|
|
1708
1731
|
}
|
|
1709
1732
|
ue.engTicketProject && renderDynamicFields(ue.engTicketProject, ue.engTicketIssueType);
|
|
1710
1733
|
}
|
|
@@ -1742,8 +1765,11 @@ function bindEngTicketListeners() {
|
|
|
1742
1765
|
var _a;
|
|
1743
1766
|
ue.engTicketProject = t2.value, t2.style.color = t2.value ? "" : "#9ca3af", ue.engTicketCustomFields = {};
|
|
1744
1767
|
const e3 = getIntegrationData();
|
|
1745
|
-
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value), ue.engTicketIssueType = o2.value), e3 && "jira" === ((_a = e3.provider) == null ? void 0 : _a.toLowerCase()) &&
|
|
1746
|
-
getFieldsForProject(t2.value, ue.engTicketIssueType).find((e4) => "reporter" === e4.fieldId)
|
|
1768
|
+
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value), ue.engTicketIssueType = o2.value), e3 && "jira" === ((_a = e3.provider) == null ? void 0 : _a.toLowerCase()) && t2.value) {
|
|
1769
|
+
if (getFieldsForProject(t2.value, ue.engTicketIssueType).find((e4) => "reporter" === e4.fieldId)) {
|
|
1770
|
+
const t3 = getDefaultReporterAccountId();
|
|
1771
|
+
ue.engTicketCustomFields.reporter = t3 || e3.jiraReporterAccountId || "";
|
|
1772
|
+
}
|
|
1747
1773
|
}
|
|
1748
1774
|
renderDynamicFields(t2.value, ue.engTicketIssueType);
|
|
1749
1775
|
}), s2 && s2.addEventListener("change", () => {
|
|
@@ -1884,7 +1910,7 @@ function showStatusModal(e2, t2, n2) {
|
|
|
1884
1910
|
function fadeCardAndRemove(e2, t2, n2 = 300) {
|
|
1885
1911
|
t2.style.opacity = "0", t2.addEventListener("transitionend", () => e2.remove(), { once: true }), setTimeout(() => e2.remove(), n2 + 100);
|
|
1886
1912
|
}
|
|
1887
|
-
const
|
|
1913
|
+
const we = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueContext: ye, openReportIssueModal, setupIssueReporting: function setupIssueReporting(e2) {
|
|
1888
1914
|
ye.apiKey = e2.apiKey, ye.backendApi = e2.backendApi, ye.resolveSessionId = e2.getSessionId, ye.integrationData = e2.integrationData || null, ye.showEngTicketFieldsDefault = e2.showEngTicketFieldsInReportIssueModalDefault ?? false, e2.customBaseUrl && (ye.triageBaseUrl = e2.customBaseUrl), ye.shortcuts = (function mergeShortcutsConfig(e3) {
|
|
1889
1915
|
const t3 = { ...he };
|
|
1890
1916
|
if (!e3) return t3;
|
|
@@ -1917,7 +1943,7 @@ const ve = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueCon
|
|
|
1917
1943
|
return void (t3 && (e3.preventDefault(), t3.click()));
|
|
1918
1944
|
}
|
|
1919
1945
|
});
|
|
1920
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
1946
|
+
} }, Symbol.toStringTag, { value: "Module" })), ve = readDebugFlag(), ke = /* @__PURE__ */ new Map();
|
|
1921
1947
|
function getCachedRegex(e2, t2) {
|
|
1922
1948
|
const n2 = `${e2}|${t2}`;
|
|
1923
1949
|
let i2 = ke.get(n2);
|
|
@@ -1974,7 +2000,7 @@ function handleVisibilityChange() {
|
|
|
1974
2000
|
const e2 = document.visibilityState, t2 = Date.now();
|
|
1975
2001
|
"visible" === e2 && getOrSetSessionId();
|
|
1976
2002
|
try {
|
|
1977
|
-
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }),
|
|
2003
|
+
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }), ve && console.log(`[Sailfish] Tab became ${e2}, sent visibility change event`);
|
|
1978
2004
|
} catch (e3) {
|
|
1979
2005
|
console.warn("[Sailfish] Failed to send visibility change event:", e3);
|
|
1980
2006
|
}
|
|
@@ -1995,35 +2021,25 @@ function _ensureModuleSideEffects() {
|
|
|
1995
2021
|
clearPageVisitDataFromSessionStorage();
|
|
1996
2022
|
}));
|
|
1997
2023
|
}
|
|
1998
|
-
function
|
|
1999
|
-
|
|
2000
|
-
if ("string" == typeof e2 ? n2 = e2 : "undefined" != typeof URL && e2 instanceof URL ? n2 = e2.href : "undefined" != typeof Request && e2 instanceof Request ? n2 = e2.url : null != e2 && "function" == typeof e2.toString && (n2 = e2.toString()), !n2) return false;
|
|
2001
|
-
try {
|
|
2002
|
-
const e3 = "undefined" != typeof window ? window.location.href : "http://localhost/";
|
|
2003
|
-
i2 = new URL(n2, e3);
|
|
2004
|
-
} catch {
|
|
2005
|
-
return false;
|
|
2006
|
-
}
|
|
2007
|
-
const { hostname: o2, pathname: s2, port: r2, protocol: a2 } = i2;
|
|
2008
|
-
if (!/^https?:$/.test(a2)) return false;
|
|
2009
|
-
const l2 = o2.startsWith("www.") ? o2.slice(4).toLowerCase() : o2.toLowerCase();
|
|
2024
|
+
function matchParsedUrlAgainstPatterns(e2, t2) {
|
|
2025
|
+
const { hostname: n2, pathname: i2, port: o2 } = e2, s2 = n2.startsWith("www.") ? n2.slice(4).toLowerCase() : n2.toLowerCase();
|
|
2010
2026
|
return t2.some((e3) => {
|
|
2011
2027
|
const t3 = String(e3 || "").replace(/^[a-zA-Z]+:\/\//, "");
|
|
2012
|
-
let [n3,
|
|
2013
|
-
n3.includes(":") && ([n3,
|
|
2014
|
-
const
|
|
2015
|
-
if (
|
|
2028
|
+
let [n3, r2] = t3.split("/", 2), a2 = "";
|
|
2029
|
+
n3.includes(":") && ([n3, a2] = n3.split(":"));
|
|
2030
|
+
const l2 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), c2 = s2.startsWith("www.") ? s2.slice(4) : s2;
|
|
2031
|
+
if (a2 && "*" !== a2 && o2 !== a2) return false;
|
|
2016
2032
|
if (n3.startsWith("*.")) {
|
|
2017
2033
|
const e4 = n3.slice(2).toLowerCase();
|
|
2018
|
-
if (!(
|
|
2019
|
-
if (
|
|
2020
|
-
return getCachedRegex(`^/${
|
|
2034
|
+
if (!(s2 === e4 || c2 === e4 || s2.endsWith("." + e4))) return false;
|
|
2035
|
+
if (r2) {
|
|
2036
|
+
return getCachedRegex(`^/${r2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
|
|
2021
2037
|
}
|
|
2022
2038
|
return true;
|
|
2023
2039
|
}
|
|
2024
|
-
if (!
|
|
2025
|
-
if (
|
|
2026
|
-
return getCachedRegex(`^/${
|
|
2040
|
+
if (!l2.test(c2) && !l2.test(s2)) return false;
|
|
2041
|
+
if (r2) {
|
|
2042
|
+
return getCachedRegex(`^/${r2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
|
|
2027
2043
|
}
|
|
2028
2044
|
return true;
|
|
2029
2045
|
});
|
|
@@ -2038,7 +2054,7 @@ function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
|
2038
2054
|
return true;
|
|
2039
2055
|
}
|
|
2040
2056
|
const s2 = o2.pathname.toLowerCase(), r2 = s2.lastIndexOf(".");
|
|
2041
|
-
return !(-1 === r2 || !xe.has(s2.slice(r2))) || (!(!i2 ||
|
|
2057
|
+
return !(-1 === r2 || !xe.has(s2.slice(r2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
|
|
2042
2058
|
};
|
|
2043
2059
|
}
|
|
2044
2060
|
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i2 = []) {
|
|
@@ -2073,7 +2089,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2073
2089
|
h2[e5] = t3;
|
|
2074
2090
|
}) : h2 = { ...r3.headers }), m2 = r3.body;
|
|
2075
2091
|
} catch (e5) {
|
|
2076
|
-
|
|
2092
|
+
ve && console.warn("[Sailfish] Failed to capture request data:", e5);
|
|
2077
2093
|
}
|
|
2078
2094
|
delete h2[n];
|
|
2079
2095
|
const b2 = getFuncSpanHeader();
|
|
@@ -2086,16 +2102,16 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2086
2102
|
const l3 = getFuncSpanHeader();
|
|
2087
2103
|
if (i5 instanceof Request) {
|
|
2088
2104
|
const c4 = i5.clone(), d4 = new Headers(c4.headers);
|
|
2089
|
-
d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value),
|
|
2105
|
+
d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value), ve && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: i5.url, header: l3.name }));
|
|
2090
2106
|
const u4 = new Request(c4, { headers: d4 });
|
|
2091
2107
|
return await e5.call(t3, u4, o5);
|
|
2092
2108
|
}
|
|
2093
2109
|
{
|
|
2094
2110
|
const c4 = { ...o5 }, d4 = new Headers(o5.headers || {});
|
|
2095
|
-
return d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value),
|
|
2111
|
+
return d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value), ve && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof i5 ? i5 : i5.href, header: l3.name })), c4.headers = d4, await e5.call(t3, i5, c4);
|
|
2096
2112
|
}
|
|
2097
2113
|
})(e4, i4, s3, r3, c3, p2.page_visit_uuid, u3), S3 = false;
|
|
2098
|
-
Te.includes(b3.status) && (
|
|
2114
|
+
Te.includes(b3.status) && (ve && console.log("Perform retry as status was fail:", b3), delete h2[n], b3 = await (async function retryWithoutPropagateHeaders(e5, t3, i5, o5) {
|
|
2099
2115
|
try {
|
|
2100
2116
|
let o6 = i5[0], s4 = i5[1] || {};
|
|
2101
2117
|
if ("string" == typeof o6 || o6 instanceof URL) {
|
|
@@ -2111,19 +2127,19 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2111
2127
|
}
|
|
2112
2128
|
return e5.apply(t3, i5);
|
|
2113
2129
|
} catch (e6) {
|
|
2114
|
-
throw
|
|
2130
|
+
throw ve && console.log(`Retry without ${n} for ${o5} also failed:`, e6), e6;
|
|
2115
2131
|
}
|
|
2116
2132
|
})(e4, i4, o4, d3), S3 = true);
|
|
2117
|
-
const
|
|
2133
|
+
const w2 = Date.now(), v2 = b3.status, k2 = b3.ok, x2 = k2 ? "" : `Request Error: ${b3.statusText}`;
|
|
2118
2134
|
let I2 = null;
|
|
2119
2135
|
try {
|
|
2120
2136
|
I2 = {}, b3.headers.forEach((e5, t3) => {
|
|
2121
2137
|
I2[t3] = e5;
|
|
2122
2138
|
});
|
|
2123
2139
|
} catch (e5) {
|
|
2124
|
-
|
|
2140
|
+
ve && console.warn("[Sailfish] Failed to capture response headers:", e5), I2 = null;
|
|
2125
2141
|
}
|
|
2126
|
-
const T2 = { type: 27, timestamp:
|
|
2142
|
+
const T2 = { type: 27, timestamp: w2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: w2, response_code: v2, success: k2, error: x2, method: f2, url: d3, retry_without_trace_id: S3, request_headers: h2, request_body: m2, response_headers: I2, response_body: null }, ...p2 }, sendEventWithBody = (e5) => {
|
|
2127
2143
|
T2.data.response_body = e5, y2 ? y2.text().then((e6) => {
|
|
2128
2144
|
T2.data.request_body = e6, sendEvent(T2);
|
|
2129
2145
|
}, () => {
|
|
@@ -2211,7 +2227,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2211
2227
|
})(e3, i3, o3, d2, u2, s2, c2);
|
|
2212
2228
|
} });
|
|
2213
2229
|
}
|
|
2214
|
-
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = [], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: r2, gitSha: a2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: b2, useWsWorker: S2 = true, library: v2 }) {
|
|
2230
|
+
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = ["*"], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: r2, gitSha: a2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: b2, useWsWorker: S2 = true, maskTextClass: w2, library: v2 }) {
|
|
2215
2231
|
var _a, _b;
|
|
2216
2232
|
if ((function isHeadlessOrLighthouse() {
|
|
2217
2233
|
try {
|
|
@@ -2224,10 +2240,10 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2224
2240
|
return false;
|
|
2225
2241
|
}
|
|
2226
2242
|
})()) return;
|
|
2227
|
-
const
|
|
2228
|
-
if (
|
|
2229
|
-
const
|
|
2230
|
-
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()),
|
|
2243
|
+
const k2 = h2 ?? y2 ?? true, x2 = getOrSetSessionId(), I2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
2244
|
+
if (I2.sessionId = x2, I2.apiKey = e2, I2.backendApi = t2, I2.serviceAdditionalMetadata = l2, I2.initialized && I2.sessionId === x2 && I2.ws && 1 === I2.ws.readyState) return void trackDomainChangesOnce();
|
|
2245
|
+
const T2 = { captureStreamingResponseBody: d2, captureResponseBodyMaxMb: u2, captureStreamPrefixKb: p2, captureStreamTimeoutMs: f2 };
|
|
2246
|
+
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), I2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i3 = []) {
|
|
2231
2247
|
const o3 = XMLHttpRequest.prototype.open, s3 = XMLHttpRequest.prototype.send, r3 = XMLHttpRequest.prototype.setRequestHeader, a3 = getOrSetSessionId(), l3 = createSkipHeadersPropagationChecker(e3, i3);
|
|
2232
2248
|
XMLHttpRequest.prototype.setRequestHeader = function(e4, t4) {
|
|
2233
2249
|
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, r3.call(this, e4, t4);
|
|
@@ -2245,9 +2261,9 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2245
2261
|
}
|
|
2246
2262
|
const d3 = getFuncSpanHeader();
|
|
2247
2263
|
if (d3) try {
|
|
2248
|
-
this.setRequestHeader(d3.name, d3.value),
|
|
2264
|
+
this.setRequestHeader(d3.name, d3.value), ve && console.log("[Sailfish] Added funcspan header to XMLHttpRequest:", { url: i4, header: d3.name });
|
|
2249
2265
|
} catch (e5) {
|
|
2250
|
-
|
|
2266
|
+
ve && console.warn(`[Sailfish] Could not set funcspan header for ${i4}`, e5);
|
|
2251
2267
|
}
|
|
2252
2268
|
const u3 = Date.now();
|
|
2253
2269
|
let p3 = false;
|
|
@@ -2280,7 +2296,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2280
2296
|
2 === t4.length && (i5[t4[0]] = t4[1]);
|
|
2281
2297
|
});
|
|
2282
2298
|
} catch (e6) {
|
|
2283
|
-
|
|
2299
|
+
ve && console.warn("[Sailfish] Failed to capture XHR response headers:", e6), i5 = null;
|
|
2284
2300
|
}
|
|
2285
2301
|
if (e5 >= 200 && e5 < 300) emitFinished(true, e5, "", n2, i5);
|
|
2286
2302
|
else {
|
|
@@ -2292,22 +2308,22 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2292
2308
|
emitFinished(false, e5, t4);
|
|
2293
2309
|
}, { once: true }), s3.apply(this, e4);
|
|
2294
2310
|
};
|
|
2295
|
-
})(o2,
|
|
2311
|
+
})(o2, T2, i2), I2.xhrPatched = true), I2.fetchPatched || (setupFetchInterceptor(o2, T2, i2), I2.fetchPatched = true), await yieldToMain(), I2.domEventsInit || (initializeDomContentEvents(x2), I2.domEventsInit = true), await yieldToMain(), I2.consoleInit || (initializeConsolePlugin(Le, x2), I2.consoleInit = true), await yieldToMain(), I2.errorInit || (!(function initializeErrorInterceptor() {
|
|
2296
2312
|
window.addEventListener("error", (e3) => {
|
|
2297
2313
|
captureError(e3.error || e3.message);
|
|
2298
2314
|
}), window.addEventListener("unhandledrejection", (e3) => {
|
|
2299
2315
|
captureError(e3.reason, true);
|
|
2300
2316
|
});
|
|
2301
|
-
})(),
|
|
2317
|
+
})(), I2.errorInit = true), await yieldToMain(), _ensureModuleSideEffects(), (function storeCredentialsAndConnection({ apiKey: e3, backendApi: t3 }) {
|
|
2302
2318
|
g && (sessionStorage.setItem("sailfishApiKey", e3), sessionStorage.setItem("sailfishBackendApi", t3));
|
|
2303
|
-
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() ||
|
|
2319
|
+
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() || I2.ws && 1 === I2.ws.readyState || fetchFunctionSpanTrackingEnabled(e2, t2).then((e3) => {
|
|
2304
2320
|
var _a2;
|
|
2305
|
-
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ?
|
|
2321
|
+
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? ve && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), ve && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
|
|
2306
2322
|
}).catch((e3) => {
|
|
2307
|
-
|
|
2308
|
-
}),
|
|
2323
|
+
ve && console.warn("[Sailfish] Failed to validate function span tracking status with backend:", e3);
|
|
2324
|
+
}), I2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e2, [...o2, ...Ie], t2).catch((e3) => console.error("Failed to send domains to not propagate header to:", e3)), I2.sentDoNotPropagateOnce = true), (async function gatherAndCacheDeviceInfo() {
|
|
2309
2325
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: { language: navigator.language, userAgent: navigator.userAgent } } });
|
|
2310
|
-
})(), c2 && fetchAndSendIp(
|
|
2326
|
+
})(), c2 && fetchAndSendIp(x2);
|
|
2311
2327
|
try {
|
|
2312
2328
|
const n2 = a2 ?? (function readGitSha() {
|
|
2313
2329
|
var _a2;
|
|
@@ -2346,15 +2362,15 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2346
2362
|
return { framework: i4[0] ?? null, additionalFrameworks: i4.slice(1), serviceRole: "frontend" };
|
|
2347
2363
|
})(), f3 = { ...u3, serviceRole: p3.serviceRole, ...null !== p3.framework && { framework: p3.framework }, ...p3.additionalFrameworks.length > 0 && { additionalFrameworks: p3.additionalFrameworks } };
|
|
2348
2364
|
await yieldToMain();
|
|
2349
|
-
const [g2, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2,
|
|
2350
|
-
if (
|
|
2365
|
+
const [g2, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, x2, t2, i3, o3, d3, n2, c3, f3)]), y3 = { ...Fe, ...(_a = g2.data) == null ? void 0 : _a.captureSettingsFromApiKey, enableFiberTracking: m2, ...void 0 !== w2 ? { maskTextClass: w2 } : {} };
|
|
2366
|
+
if (I2.ws && 1 === I2.ws.readyState) return;
|
|
2351
2367
|
if ((_b = h3.data) == null ? void 0 : _b.startRecordingSession) {
|
|
2352
2368
|
const n3 = (l2 == null ? void 0 : l2.env) || (l2 == null ? void 0 : l2.environment);
|
|
2353
2369
|
await yieldToMain();
|
|
2354
|
-
const i4 = await initializeRecording(y3, t2, e2,
|
|
2355
|
-
|
|
2370
|
+
const i4 = await initializeRecording(y3, t2, e2, x2, n3, k2, S2, b2 ?? false);
|
|
2371
|
+
I2.ws = i4, I2.initialized = true, trackDomainChangesOnce(), I2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
|
|
2356
2372
|
window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
|
|
2357
|
-
})(r2, s2),
|
|
2373
|
+
})(r2, s2), I2.sentMapUuidOnce = true);
|
|
2358
2374
|
} else console.error("Failed to start recording session:", h3.errors || h3);
|
|
2359
2375
|
} catch (e3) {
|
|
2360
2376
|
console.error("Error starting recording:", e3);
|
|
@@ -2362,8 +2378,8 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2362
2378
|
}
|
|
2363
2379
|
exports.DEFAULT_CAPTURE_SETTINGS = Fe, exports.DEFAULT_CONSOLE_RECORDING_SETTINGS = Le, exports.STORAGE_VERSION = 1, exports.addOrUpdateMetadata = function addOrUpdateMetadata(e2) {
|
|
2364
2380
|
const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
2365
|
-
|
|
2366
|
-
}, exports.buildBatches = buildBatches, exports.clearStaleFuncSpanState = clearStaleFuncSpanState, exports.createSkipHeadersPropagationChecker = createSkipHeadersPropagationChecker, exports.createTriageAndIssueFromRecorder = createTriageAndIssueFromRecorder, exports.createTriageFromRecorder = createTriageFromRecorder, exports.disableFunctionSpanTracking = disableFunctionSpanTracking, exports.enableFunctionSpanTracking = enableFunctionSpanTracking, exports.ensureHrefCache = ensureHrefCache, exports.eventSize = eventSize, exports.fetchAndSendIp = fetchAndSendIp, exports.fetchCaptureSettings = fetchCaptureSettings, exports.fetchEngineeringTicketPlatformIntegrations = fetchEngineeringTicketPlatformIntegrations, exports.fetchFunctionSpanTrackingEnabled = fetchFunctionSpanTrackingEnabled, exports.flushBufferedEvents = flushBufferedEvents, exports.getCachedHref = getCachedHref, exports.getCachedHrefNoQuery = getCachedHrefNoQuery, exports.getFuncSpanHeader = getFuncSpanHeader, exports.getOrSetSessionId = getOrSetSessionId, exports.getUrlAndStoredUuids = getUrlAndStoredUuids, exports.identify = function identify(e2, t2 = {}, n2 = false) {
|
|
2381
|
+
U && JSON.stringify(U) === JSON.stringify(e2) || (U = e2, sendMessage(t2));
|
|
2382
|
+
}, exports.buildBatches = buildBatches, exports.clearStaleFuncSpanState = clearStaleFuncSpanState, exports.createSkipHeadersPropagationChecker = createSkipHeadersPropagationChecker, exports.createTriageAndIssueFromRecorder = createTriageAndIssueFromRecorder, exports.createTriageFromRecorder = createTriageFromRecorder, exports.disableFunctionSpanTracking = disableFunctionSpanTracking, exports.enableFunctionSpanTracking = enableFunctionSpanTracking, exports.ensureHrefCache = ensureHrefCache, exports.eventSize = eventSize, exports.fetchAndSendIp = fetchAndSendIp, exports.fetchCaptureSettings = fetchCaptureSettings, exports.fetchEngineeringTicketPlatformIntegrations = fetchEngineeringTicketPlatformIntegrations, exports.fetchFunctionSpanTrackingEnabled = fetchFunctionSpanTrackingEnabled, exports.flushBufferedEvents = flushBufferedEvents, exports.getCachedHref = getCachedHref, exports.getCachedHrefNoQuery = getCachedHrefNoQuery, exports.getFuncSpanHeader = getFuncSpanHeader, exports.getIdentifiedUser = getIdentifiedUser, exports.getOrSetSessionId = getOrSetSessionId, exports.getUrlAndStoredUuids = getUrlAndStoredUuids, exports.identify = function identify(e2, t2 = {}, n2 = false) {
|
|
2367
2383
|
const i2 = { type: "identify", userId: e2, traits: t2 };
|
|
2368
2384
|
O && O.userId === e2 && JSON.stringify(O.traits) === JSON.stringify(t2) || (O = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
|
|
2369
2385
|
}, exports.initRecorder = async (e2) => {
|
|
@@ -2372,7 +2388,7 @@ exports.DEFAULT_CAPTURE_SETTINGS = Fe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
2372
2388
|
return clearPageVisitDataFromSessionStorage(), t2.initialized && t2.sessionId === n2 && t2.ws && 1 === t2.ws.readyState ? void 0 : (t2.initPromise || (t2.initPromise = (async () => {
|
|
2373
2389
|
try {
|
|
2374
2390
|
if (t2.hasLoggedInitOnce || (console.log("Initializing Sailfish Recorder (first run) …"), t2.hasLoggedInitOnce = true), await startRecording(e2), !t2.issueReportingInit) {
|
|
2375
|
-
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() =>
|
|
2391
|
+
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() => we), Promise.resolve().then(() => le)]);
|
|
2376
2392
|
let r2 = null;
|
|
2377
2393
|
try {
|
|
2378
2394
|
await o2(e2.apiKey, n3), r2 = s2();
|
|
@@ -2387,6 +2403,16 @@ exports.DEFAULT_CAPTURE_SETTINGS = Fe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
2387
2403
|
})().finally(() => {
|
|
2388
2404
|
delete t2.initPromise;
|
|
2389
2405
|
})), t2.initPromise);
|
|
2390
|
-
}, exports.initializeConsolePlugin = initializeConsolePlugin, exports.initializeDomContentEvents = initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = initializeFunctionSpanTrackingFromApi, exports.initializeRecording = initializeRecording, exports.initializeWebSocket = initializeWebSocket, exports.invalidateUrlCache = invalidateUrlCache, exports.isFunctionSpanTrackingEnabled = isFunctionSpanTrackingEnabled, exports.matchUrlWithWildcard =
|
|
2406
|
+
}, exports.initializeConsolePlugin = initializeConsolePlugin, exports.initializeDomContentEvents = initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = initializeFunctionSpanTrackingFromApi, exports.initializeRecording = initializeRecording, exports.initializeWebSocket = initializeWebSocket, exports.invalidateUrlCache = invalidateUrlCache, exports.isFunctionSpanTrackingEnabled = isFunctionSpanTrackingEnabled, exports.matchUrlWithWildcard = function matchUrlWithWildcard(e2, t2) {
|
|
2407
|
+
let n2, i2;
|
|
2408
|
+
if ("string" == typeof e2 ? n2 = e2 : "undefined" != typeof URL && e2 instanceof URL ? n2 = e2.href : "undefined" != typeof Request && e2 instanceof Request ? n2 = e2.url : null != e2 && "function" == typeof e2.toString && (n2 = e2.toString()), !n2) return false;
|
|
2409
|
+
try {
|
|
2410
|
+
const e3 = "undefined" != typeof window ? window.location.href : "http://localhost/";
|
|
2411
|
+
i2 = new URL(n2, e3);
|
|
2412
|
+
} catch {
|
|
2413
|
+
return false;
|
|
2414
|
+
}
|
|
2415
|
+
return matchParsedUrlAgainstPatterns(i2, t2);
|
|
2416
|
+
}, exports.onNavigationChange = onNavigationChange, exports.openReportIssueModal = openReportIssueModal, exports.restoreFuncSpanState = restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, exports.sendEvent = sendEvent, exports.sendGraphQLRequest = sendGraphQLRequest, exports.sendMessage = sendMessage, exports.startRecording = startRecording, exports.startRecordingSession = startRecordingSession, exports.trackingEvent = function trackingEvent(e2) {
|
|
2391
2417
|
sendMessage({ type: "trackingEvent", trackingData: e2, timestamp: exports.nowTimestamp() });
|
|
2392
2418
|
}, exports.withAppUrlMetadata = withAppUrlMetadata, exports.yieldToMain = yieldToMain;
|
|
Binary file
|
|
Binary file
|