@sailfish-ai/recorder 1.10.7 → 1.10.9
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-BuEZW3N4.js → chunkSerializer-B_szIq8O.js} +1 -1
- package/dist/chunks/chunkSerializer-B_szIq8O.js.br +0 -0
- package/dist/chunks/chunkSerializer-B_szIq8O.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-DM9muyGb.js → chunkSerializer-DdlgLmEH.js} +1 -1
- package/dist/chunks/chunkSerializer-DdlgLmEH.js.br +0 -0
- package/dist/chunks/chunkSerializer-DdlgLmEH.js.gz +0 -0
- package/dist/chunks/{index-soHaKXF4.js → index-B8gnDRst.js} +254 -236
- package/dist/chunks/index-B8gnDRst.js.br +0 -0
- package/dist/chunks/index-B8gnDRst.js.gz +0 -0
- package/dist/chunks/{index-BlPJWz9y.js → index-w2Ted1rp.js} +451 -376
- package/dist/chunks/index-w2Ted1rp.js.br +0 -0
- package/dist/chunks/index-w2Ted1rp.js.gz +0 -0
- package/dist/inAppReportIssueModal/index.js +106 -42
- package/dist/inAppReportIssueModal/integrations.js +0 -3
- package/dist/inAppReportIssueModal/types.js +1 -0
- package/dist/inAppReportIssueModal/ui.js +15 -8
- package/dist/index.js +15 -4
- package/dist/recorder.cjs +2 -2
- package/dist/recorder.js +12 -11
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/types/inAppReportIssueModal/index.d.ts +5 -1
- package/dist/types/inAppReportIssueModal/types.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/websocket.d.ts +4 -0
- package/dist/websocket.js +11 -0
- package/package.json +1 -1
- package/dist/chunks/chunkSerializer-BuEZW3N4.js.br +0 -0
- package/dist/chunks/chunkSerializer-BuEZW3N4.js.gz +0 -0
- package/dist/chunks/chunkSerializer-DM9muyGb.js.br +0 -0
- package/dist/chunks/chunkSerializer-DM9muyGb.js.gz +0 -0
- package/dist/chunks/index-BlPJWz9y.js.br +0 -0
- package/dist/chunks/index-BlPJWz9y.js.gz +0 -0
- package/dist/chunks/index-soHaKXF4.js.br +0 -0
- package/dist/chunks/index-soHaKXF4.js.gz +0 -0
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
const e = require("reconnecting-websocket"), t = require("@sailfish-rrweb/types");
|
|
1
|
+
import e from "reconnecting-websocket";
|
|
2
|
+
import { EventType as t } from "@sailfish-rrweb/types";
|
|
25
3
|
function readDebugFlag() {
|
|
26
4
|
var _a;
|
|
27
5
|
try {
|
|
@@ -151,7 +129,7 @@ function getOrSetSessionId() {
|
|
|
151
129
|
}
|
|
152
130
|
return t2;
|
|
153
131
|
}
|
|
154
|
-
let
|
|
132
|
+
let w = false;
|
|
155
133
|
function buildBatches(e2, t2, n2) {
|
|
156
134
|
const i2 = {};
|
|
157
135
|
for (const t3 of e2) {
|
|
@@ -173,19 +151,28 @@ function buildBatches(e2, t2, n2) {
|
|
|
173
151
|
function eventSize(e2) {
|
|
174
152
|
return JSON.stringify(e2).length;
|
|
175
153
|
}
|
|
154
|
+
let v = Date.now;
|
|
176
155
|
function withAppUrlMetadata(e2) {
|
|
177
156
|
var _a;
|
|
178
157
|
return { ...e2 ?? {}, appUrl: (e2 == null ? void 0 : e2.appUrl) ?? ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.href) };
|
|
179
158
|
}
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
let
|
|
159
|
+
/[1-9][0-9]{12}/.test(Date.now().toString()) || (v = () => (/* @__PURE__ */ new Date()).getTime());
|
|
160
|
+
const S = readDebugFlag(), k = "per_session";
|
|
161
|
+
let x = null, I = null, T = false, E = null, C = null, $ = "", F = "", M = false;
|
|
162
|
+
const L = [];
|
|
163
|
+
function onNavigationChange(e2) {
|
|
164
|
+
L.push(e2);
|
|
165
|
+
}
|
|
183
166
|
function _updateHrefCache() {
|
|
184
|
-
|
|
167
|
+
$ = window.location.href, F = window.location.origin + window.location.pathname;
|
|
168
|
+
for (const e2 of L) try {
|
|
169
|
+
e2();
|
|
170
|
+
} catch (e3) {
|
|
171
|
+
}
|
|
185
172
|
}
|
|
186
173
|
function ensureHrefCache() {
|
|
187
|
-
if (
|
|
188
|
-
|
|
174
|
+
if (M || "undefined" == typeof window) return;
|
|
175
|
+
M = true, _updateHrefCache(), window.addEventListener("popstate", _updateHrefCache), window.addEventListener("hashchange", _updateHrefCache);
|
|
189
176
|
const e2 = history.pushState;
|
|
190
177
|
history.pushState = function(...t3) {
|
|
191
178
|
e2.apply(this, t3), _updateHrefCache();
|
|
@@ -196,48 +183,48 @@ function ensureHrefCache() {
|
|
|
196
183
|
};
|
|
197
184
|
}
|
|
198
185
|
function getCachedHref() {
|
|
199
|
-
return
|
|
186
|
+
return $ || ("undefined" != typeof window ? window.location.href : "");
|
|
200
187
|
}
|
|
201
188
|
function getCachedHrefNoQuery() {
|
|
202
|
-
return
|
|
189
|
+
return F || ("undefined" != typeof window ? window.location.origin + window.location.pathname : "");
|
|
203
190
|
}
|
|
204
|
-
const
|
|
205
|
-
let
|
|
191
|
+
const A = [];
|
|
192
|
+
let D = null;
|
|
206
193
|
function queueEventForIDB(e2) {
|
|
207
|
-
|
|
194
|
+
A.push(e2), A.length >= 50 ? _flushIDBQueue() : D || (D = setTimeout(_flushIDBQueue, 100));
|
|
208
195
|
}
|
|
209
196
|
function _flushIDBQueue() {
|
|
210
|
-
if (
|
|
197
|
+
if (D && (clearTimeout(D), D = null), 0 === A.length) return;
|
|
211
198
|
!(async function saveEventsToIDB(e2) {
|
|
212
199
|
await withStore$1("readwrite", async (t2) => {
|
|
213
200
|
for (const n2 of e2) t2.add({ timestamp: Date.now(), data: n2 });
|
|
214
201
|
});
|
|
215
|
-
})(
|
|
202
|
+
})(A.splice(0));
|
|
216
203
|
}
|
|
217
|
-
let
|
|
218
|
-
const
|
|
204
|
+
let R = false, P = null, _ = null, B = false;
|
|
205
|
+
const j = "sailfish_funcspan_global_state";
|
|
219
206
|
function wsSendPayload(e2) {
|
|
220
|
-
if (!isWebSocketOpen(
|
|
221
|
-
if (
|
|
222
|
-
return
|
|
207
|
+
if (!isWebSocketOpen(I)) return false;
|
|
208
|
+
if (x) try {
|
|
209
|
+
return x.postMessage({ type: "send", payload: e2 }), true;
|
|
223
210
|
} catch {
|
|
224
211
|
return false;
|
|
225
212
|
}
|
|
226
213
|
try {
|
|
227
|
-
return
|
|
214
|
+
return I.send(JSON.stringify(e2)), true;
|
|
228
215
|
} catch {
|
|
229
216
|
return false;
|
|
230
217
|
}
|
|
231
218
|
}
|
|
232
219
|
function wsSendRaw(e2) {
|
|
233
|
-
if (!isWebSocketOpen(
|
|
234
|
-
if (
|
|
235
|
-
return
|
|
220
|
+
if (!isWebSocketOpen(I)) return false;
|
|
221
|
+
if (x) try {
|
|
222
|
+
return x.postMessage({ type: "sendRaw", payload: e2 }), true;
|
|
236
223
|
} catch {
|
|
237
224
|
return false;
|
|
238
225
|
}
|
|
239
226
|
try {
|
|
240
|
-
return
|
|
227
|
+
return I.send(e2), true;
|
|
241
228
|
} catch {
|
|
242
229
|
return false;
|
|
243
230
|
}
|
|
@@ -246,40 +233,40 @@ function saveGlobalFuncSpanState(e2, t2) {
|
|
|
246
233
|
try {
|
|
247
234
|
if ("undefined" == typeof localStorage) return;
|
|
248
235
|
const n2 = { enabled: e2, expirationTimestampMs: t2, savedAt: Date.now() };
|
|
249
|
-
localStorage.setItem(
|
|
236
|
+
localStorage.setItem(j, JSON.stringify(n2)), S && console.log("[Sailfish] Saved funcSpan state to localStorage:", n2);
|
|
250
237
|
} catch (e3) {
|
|
251
|
-
|
|
238
|
+
S && console.warn("[Sailfish] Failed to save funcSpan state to localStorage:", e3);
|
|
252
239
|
}
|
|
253
240
|
}
|
|
254
241
|
function clearGlobalFuncSpanState() {
|
|
255
242
|
try {
|
|
256
243
|
if ("undefined" == typeof localStorage) return;
|
|
257
|
-
localStorage.removeItem(
|
|
244
|
+
localStorage.removeItem(j), S && console.log("[Sailfish] Cleared funcSpan state from localStorage");
|
|
258
245
|
} catch (e2) {
|
|
259
|
-
|
|
246
|
+
S && console.warn("[Sailfish] Failed to clear funcSpan state from localStorage:", e2);
|
|
260
247
|
}
|
|
261
248
|
}
|
|
262
249
|
function clearStaleFuncSpanState() {
|
|
263
|
-
|
|
250
|
+
R = false, _ = null, B = false, clearGlobalFuncSpanState(), S && console.log("[Sailfish] Cleared stale function span tracking state (backend validation failed)");
|
|
264
251
|
}
|
|
265
|
-
let
|
|
252
|
+
let z = false;
|
|
266
253
|
function restoreFuncSpanState() {
|
|
267
|
-
if (
|
|
268
|
-
|
|
254
|
+
if (z) return;
|
|
255
|
+
z = true;
|
|
269
256
|
const e2 = (function loadGlobalFuncSpanState() {
|
|
270
257
|
try {
|
|
271
258
|
if ("undefined" == typeof localStorage) return null;
|
|
272
|
-
const e3 = localStorage.getItem(
|
|
259
|
+
const e3 = localStorage.getItem(j);
|
|
273
260
|
if (!e3) return null;
|
|
274
261
|
const t2 = JSON.parse(e3);
|
|
275
|
-
return
|
|
262
|
+
return S && console.log("[Sailfish] Loaded funcSpan state from localStorage:", t2), t2;
|
|
276
263
|
} catch (e3) {
|
|
277
|
-
return
|
|
264
|
+
return S && console.warn("[Sailfish] Failed to load funcSpan state from localStorage:", e3), null;
|
|
278
265
|
}
|
|
279
266
|
})();
|
|
280
|
-
if (e2 && e2.enabled) if (
|
|
281
|
-
Date.now() >=
|
|
282
|
-
} else
|
|
267
|
+
if (e2 && e2.enabled) if (R = true, _ = e2.expirationTimestampMs, B = false, S && console.log("[Sailfish] Restored global function span tracking from localStorage:", { enabled: true, expirationTime: _ }), null !== _) {
|
|
268
|
+
Date.now() >= _ ? (R = false, _ = null, clearGlobalFuncSpanState(), S && console.log("[Sailfish] Persisted tracking already expired, cleared state")) : S && console.log("[Sailfish] Function span tracking is active and valid (temporary until WebSocket confirms)");
|
|
269
|
+
} else S && console.log("[Sailfish] Function span tracking is active (no expiration, temporary until WebSocket confirms)");
|
|
283
270
|
}
|
|
284
271
|
function isWebSocketOpen(e2) {
|
|
285
272
|
return (e2 == null ? void 0 : e2.readyState) === WebSocket.OPEN;
|
|
@@ -291,7 +278,7 @@ async function flushNotifyQueue() {
|
|
|
291
278
|
n2.onsuccess = () => t2(n2.result), n2.onerror = () => t2([]);
|
|
292
279
|
})) ?? [];
|
|
293
280
|
})();
|
|
294
|
-
if (isWebSocketOpen(
|
|
281
|
+
if (isWebSocketOpen(I)) try {
|
|
295
282
|
for (const t2 of e2) {
|
|
296
283
|
if (!wsSendRaw(t2.value)) break;
|
|
297
284
|
await deleteNotifyMessageById(t2.id);
|
|
@@ -300,9 +287,9 @@ async function flushNotifyQueue() {
|
|
|
300
287
|
}
|
|
301
288
|
}
|
|
302
289
|
async function flushBufferedEvents() {
|
|
303
|
-
if (isWebSocketOpen(
|
|
290
|
+
if (isWebSocketOpen(I)) if (E) await E;
|
|
304
291
|
else {
|
|
305
|
-
|
|
292
|
+
E = (async () => {
|
|
306
293
|
var _a, _b;
|
|
307
294
|
const e2 = await (async function getAllIndexedEvents() {
|
|
308
295
|
return await withStore$1("readonly", (e3) => new Promise((t3) => {
|
|
@@ -317,7 +304,7 @@ async function flushBufferedEvents() {
|
|
|
317
304
|
for (const e3 of Object.values(t2)) {
|
|
318
305
|
const t3 = buildBatches(e3, (e4) => eventSize(e4.data), 52428800);
|
|
319
306
|
for (const e4 of t3) {
|
|
320
|
-
if (!isWebSocketOpen(
|
|
307
|
+
if (!isWebSocketOpen(I)) break;
|
|
321
308
|
const t4 = e4.map((e5) => (e5.data.appUrl || (e5.data.appUrl = getCachedHref()), e5.data)), n2 = e4.map((e5) => e5.id).filter((e5) => null != e5);
|
|
322
309
|
try {
|
|
323
310
|
wsSendPayload({ type: "events", events: t4, mapUuid: window.sfMapUuid }) && await deleteEventsByIds(n2);
|
|
@@ -327,53 +314,53 @@ async function flushBufferedEvents() {
|
|
|
327
314
|
}
|
|
328
315
|
})();
|
|
329
316
|
try {
|
|
330
|
-
await
|
|
317
|
+
await E;
|
|
331
318
|
} finally {
|
|
332
|
-
|
|
319
|
+
E = null;
|
|
333
320
|
}
|
|
334
321
|
}
|
|
335
322
|
}
|
|
336
323
|
function sendEvent(e2) {
|
|
337
|
-
e2.app_url || (e2.app_url = getCachedHref()), !
|
|
324
|
+
e2.app_url || (e2.app_url = getCachedHref()), !T && isWebSocketOpen(I) && wsSendPayload({ type: "event", event: e2, mapUuid: window.sfMapUuid }) || queueEventForIDB(e2);
|
|
338
325
|
}
|
|
339
326
|
function handleWsOpen() {
|
|
340
|
-
|
|
327
|
+
S && (console.log("[Sailfish] WebSocket connection opened"), console.log("[Sailfish] Function span tracking state: " + (R ? "ENABLED" : "DISABLED"))), (async () => {
|
|
341
328
|
try {
|
|
342
|
-
|
|
329
|
+
T = true, await flushNotifyQueue(), await flushBufferedEvents();
|
|
343
330
|
} finally {
|
|
344
|
-
|
|
331
|
+
T = false;
|
|
345
332
|
}
|
|
346
|
-
null !=
|
|
333
|
+
null != C && clearInterval(C), C = window.setInterval(() => {
|
|
347
334
|
flushBufferedEvents();
|
|
348
335
|
}, 2e3);
|
|
349
336
|
})();
|
|
350
337
|
}
|
|
351
338
|
function handleWsClose() {
|
|
352
|
-
null !=
|
|
339
|
+
null != C && (clearInterval(C), C = null), S && console.log("[Sailfish] WebSocket closed");
|
|
353
340
|
}
|
|
354
341
|
function handleWsMessage(e2) {
|
|
355
342
|
try {
|
|
356
343
|
const t2 = JSON.parse(e2);
|
|
357
|
-
if ("funcSpanTrackingControl" === t2.type) if (
|
|
344
|
+
if ("funcSpanTrackingControl" === t2.type) if (S && console.log("[Sailfish] Received funcSpanTrackingControl message:", { enabled: t2.enabled, timeoutSeconds: t2.timeoutSeconds, expirationTimestampMs: t2.expirationTimestampMs }), null !== P && (window.clearTimeout(P), P = null), R = t2.enabled, B = false, S && console.log("[Sailfish] Function span tracking " + (t2.enabled ? "ENABLED (GLOBAL)" : "DISABLED (GLOBAL)")), t2.enabled) {
|
|
358
345
|
if (t2.expirationTimestampMs) {
|
|
359
|
-
|
|
360
|
-
const e3 = Date.now(), n2 =
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}, n2)) : (
|
|
346
|
+
_ = t2.expirationTimestampMs;
|
|
347
|
+
const e3 = Date.now(), n2 = _ - e3;
|
|
348
|
+
S && console.log(`[Sailfish] Server expiration timestamp: ${_}, ms until expiration: ${n2}`), n2 > 0 ? (saveGlobalFuncSpanState(true, _), P = window.setTimeout(() => {
|
|
349
|
+
B || (R = false, _ = null, clearGlobalFuncSpanState(), S && console.log("[Sailfish] GLOBAL function span tracking auto-disabled at server expiration time"), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), S && console.log("[Sailfish] Notified backend that function span tracking expired"));
|
|
350
|
+
}, n2)) : (R = false, _ = null, clearGlobalFuncSpanState(), S && console.log("[Sailfish] Tracking already expired, not enabling"));
|
|
364
351
|
} else {
|
|
365
352
|
const e3 = t2.timeoutSeconds || 3600;
|
|
366
|
-
e3 > 0 && (
|
|
367
|
-
|
|
353
|
+
e3 > 0 && (_ = Date.now() + 1e3 * e3, saveGlobalFuncSpanState(true, _), P = window.setTimeout(() => {
|
|
354
|
+
B || (R = false, _ = null, clearGlobalFuncSpanState(), S && console.log(`[Sailfish] GLOBAL function span tracking auto-disabled after ${e3}s (legacy)`), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), S && console.log("[Sailfish] Notified backend that function span tracking expired (legacy timeout)"));
|
|
368
355
|
}, 1e3 * e3));
|
|
369
356
|
}
|
|
370
357
|
try {
|
|
371
358
|
const e3 = getOrSetSessionId();
|
|
372
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }),
|
|
359
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }), S && console.log(`[Sailfish] GLOBAL tracking session report sent for session: ${e3}`);
|
|
373
360
|
} catch (e3) {
|
|
374
|
-
|
|
361
|
+
S && console.warn("[Sailfish] Failed to send GLOBAL tracking session report:", e3);
|
|
375
362
|
}
|
|
376
|
-
} else
|
|
363
|
+
} else _ = null, clearGlobalFuncSpanState();
|
|
377
364
|
} catch (e3) {
|
|
378
365
|
}
|
|
379
366
|
}
|
|
@@ -383,8 +370,8 @@ function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
|
383
370
|
const t3 = new URL(e2);
|
|
384
371
|
return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
|
|
385
372
|
})(t2);
|
|
386
|
-
let r2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${a2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.10.
|
|
387
|
-
if (o2 && (r2 += `&envValue=${encodeURIComponent(o2)}`),
|
|
373
|
+
let r2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${a2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.10.9`;
|
|
374
|
+
if (o2 && (r2 += `&envValue=${encodeURIComponent(o2)}`), x = s2 ? (function tryCreateWsWorker() {
|
|
388
375
|
if ("undefined" == typeof Worker) return null;
|
|
389
376
|
try {
|
|
390
377
|
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);
|
|
@@ -392,85 +379,96 @@ function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
|
392
379
|
} catch {
|
|
393
380
|
return null;
|
|
394
381
|
}
|
|
395
|
-
})() : null,
|
|
396
|
-
const e2 =
|
|
397
|
-
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(),
|
|
382
|
+
})() : null, x) {
|
|
383
|
+
const e2 = x, t3 = { readyState: WebSocket.CONNECTING, close: () => {
|
|
384
|
+
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(), x = null, null != C && (clearInterval(C), C = null);
|
|
398
385
|
} };
|
|
399
|
-
return
|
|
386
|
+
return I = t3, x.onmessage = (e3) => {
|
|
400
387
|
const n3 = e3.data;
|
|
401
388
|
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, handleWsClose()) : "message" === n3.type && handleWsMessage(n3.data);
|
|
402
|
-
},
|
|
403
|
-
|
|
404
|
-
},
|
|
389
|
+
}, x.onerror = () => {
|
|
390
|
+
S && console.warn("[Sailfish] WebSocket worker error");
|
|
391
|
+
}, x.postMessage({ type: "init", wsUrl: r2 }), S && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
|
|
405
392
|
}
|
|
406
|
-
|
|
393
|
+
S && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
|
|
407
394
|
const l2 = new e(r2, [], { connectionTimeout: 3e4 }), c2 = { get readyState() {
|
|
408
395
|
return l2.readyState;
|
|
409
396
|
}, close: () => {
|
|
410
|
-
l2.close(), null !=
|
|
397
|
+
l2.close(), null != C && (clearInterval(C), C = null);
|
|
411
398
|
} };
|
|
412
|
-
return
|
|
399
|
+
return I = c2, l2.addEventListener("open", () => handleWsOpen()), l2.addEventListener("close", () => handleWsClose()), l2.addEventListener("message", (e2) => handleWsMessage(e2.data)), c2;
|
|
413
400
|
}
|
|
414
401
|
function sendMessage(e2) {
|
|
415
|
-
"sessionId" in e2 || (e2.sessionId = getOrSetSessionId()), e2.app_url || (e2.app_url = getCachedHref()),
|
|
402
|
+
"sessionId" in e2 || (e2.sessionId = getOrSetSessionId()), e2.app_url || (e2.app_url = getCachedHref()), T || !isWebSocketOpen(I) ? saveNotifyMessageToIDB(JSON.stringify(e2)) : wsSendPayload(e2) || saveNotifyMessageToIDB(JSON.stringify(e2));
|
|
416
403
|
}
|
|
417
404
|
function enableFunctionSpanTracking() {
|
|
418
|
-
if (
|
|
419
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType:
|
|
420
|
-
} else
|
|
405
|
+
if (S && console.log("[Sailfish] enableFunctionSpanTracking() called - Report Issue recording started (LOCAL MODE)"), R = true, B = true, _ = null, null !== P && (window.clearTimeout(P), P = null), isWebSocketOpen(I)) {
|
|
406
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType: k });
|
|
407
|
+
} else S && console.warn("[Sailfish] WebSocket not open, cannot report LOCAL tracking session");
|
|
421
408
|
}
|
|
422
409
|
function disableFunctionSpanTracking() {
|
|
423
|
-
if (
|
|
424
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType:
|
|
410
|
+
if (S && console.log("[Sailfish] disableFunctionSpanTracking() called - Report Issue recording stopped"), isWebSocketOpen(I)) {
|
|
411
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType: k });
|
|
425
412
|
} else console.warn("[FUNCSPAN STOP] ✗ WebSocket not open, cannot notify tracking end");
|
|
426
|
-
|
|
413
|
+
B && (R = false, B = false, _ = null, S && console.log("[Sailfish] LOCAL tracking mode disabled")), null !== P && (window.clearTimeout(P), P = null);
|
|
427
414
|
}
|
|
428
415
|
function isFunctionSpanTrackingEnabled() {
|
|
429
|
-
return
|
|
416
|
+
return R;
|
|
430
417
|
}
|
|
431
418
|
function initializeFunctionSpanTrackingFromApi(e2) {
|
|
432
|
-
e2 && !
|
|
419
|
+
e2 && !R ? (R = true, B = false, _ = null, S && console.log("[Sailfish] Function span tracking initialized as ENABLED from API check")) : !e2 && R && (R = false, B = false, _ = null, S && console.log("[Sailfish] Function span tracking initialized as DISABLED from API check"));
|
|
433
420
|
}
|
|
434
421
|
function getFuncSpanHeader() {
|
|
435
|
-
if (!
|
|
436
|
-
if (null !==
|
|
437
|
-
if (Date.now() >=
|
|
422
|
+
if (!R) return null;
|
|
423
|
+
if (null !== _) {
|
|
424
|
+
if (Date.now() >= _) return R = false, _ = null, clearGlobalFuncSpanState(), S && console.log("[Sailfish] Function span tracking expired on header check - disabling now"), null;
|
|
438
425
|
}
|
|
439
426
|
return { name: "X-Sf3-FunctionSpanCaptureOverride", value: "1-1-10-10-1-1.0-1-0-0" };
|
|
440
427
|
}
|
|
441
|
-
const
|
|
442
|
-
let
|
|
443
|
-
|
|
444
|
-
const
|
|
428
|
+
const O = 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" }));
|
|
429
|
+
let U = null, H = null;
|
|
430
|
+
function identify(e2, t2 = {}, n2 = false) {
|
|
431
|
+
const i2 = { type: "identify", userId: e2, traits: t2 };
|
|
432
|
+
U && U.userId === e2 && JSON.stringify(U.traits) === JSON.stringify(t2) || (U = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
|
|
433
|
+
}
|
|
434
|
+
function addOrUpdateMetadata(e2) {
|
|
435
|
+
const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
436
|
+
H && JSON.stringify(H) === JSON.stringify(e2) || (H = e2, sendMessage(t2));
|
|
437
|
+
}
|
|
438
|
+
function trackingEvent(e2) {
|
|
439
|
+
sendMessage({ type: "trackingEvent", trackingData: e2, timestamp: v() });
|
|
440
|
+
}
|
|
441
|
+
let N = null;
|
|
442
|
+
const q = ["https://api.ipify.org?format=json", "https://api.ip.sb/jsonip", "https://api4.my-ip.io/ip.json"];
|
|
445
443
|
function fetchAndSendIp(e2) {
|
|
446
|
-
|
|
447
|
-
for (const e3 of
|
|
444
|
+
N !== e2 && (N = e2, (async () => {
|
|
445
|
+
for (const e3 of q) try {
|
|
448
446
|
const t2 = new AbortController(), n2 = setTimeout(() => t2.abort(), 5e3), i2 = await fetch(e3, { signal: t2.signal });
|
|
449
447
|
if (clearTimeout(n2), !i2.ok) continue;
|
|
450
448
|
const o2 = await i2.json(), s2 = o2.ip || o2.origin || null;
|
|
451
|
-
if (s2 && "string" == typeof s2 && s2.length <= 45) return void sendMessage({ type: "visitorIp", ip: s2, timestamp:
|
|
449
|
+
if (s2 && "string" == typeof s2 && s2.length <= 45) return void sendMessage({ type: "visitorIp", ip: s2, timestamp: v() });
|
|
452
450
|
} catch {
|
|
453
451
|
}
|
|
454
|
-
|
|
452
|
+
N = null;
|
|
455
453
|
})().catch(() => {
|
|
456
|
-
|
|
454
|
+
N = null;
|
|
457
455
|
}));
|
|
458
456
|
}
|
|
459
|
-
let
|
|
457
|
+
let W = null;
|
|
460
458
|
async function getSourceMapModule() {
|
|
461
|
-
return
|
|
459
|
+
return W || (W = await import("source-map-js")), W;
|
|
462
460
|
}
|
|
463
|
-
const
|
|
461
|
+
const K = /* @__PURE__ */ new Map(), G = /(?:\(|\s|^)(https?:\/\/[^)\s]+|\/[^)\s]+|[^)\s]+)?\/?([^/]+\.js)(?:\?[^:)]*)?:(\d+):(\d+)/;
|
|
464
462
|
async function getConsumerFor(e2, t2) {
|
|
465
463
|
const n2 = (e2 || `/assets/${t2}`).split("?")[0], i2 = [`${n2}.map`, n2.replace(/\.js$/, ".js.map"), `/assets/${t2}.map`], { SourceMapConsumer: o2 } = await getSourceMapModule();
|
|
466
464
|
for (const e3 of i2) try {
|
|
467
|
-
if (
|
|
465
|
+
if (K.has(e3)) return K.get(e3);
|
|
468
466
|
const t3 = await fetch(e3);
|
|
469
467
|
if (!t3.ok) continue;
|
|
470
468
|
const n3 = await t3.json();
|
|
471
469
|
if (!n3 || !n3.mappings || !n3.sources) continue;
|
|
472
470
|
const i3 = await new o2(n3);
|
|
473
|
-
return
|
|
471
|
+
return K.set(e3, i3), i3;
|
|
474
472
|
} catch {
|
|
475
473
|
}
|
|
476
474
|
return null;
|
|
@@ -482,7 +480,7 @@ async function captureError(e2, t2 = false) {
|
|
|
482
480
|
if (!e3) return ["No stack trace available"];
|
|
483
481
|
const t3 = Array.isArray(e3) ? e3 : e3.split("\n"), n3 = [];
|
|
484
482
|
for (const e4 of t3) {
|
|
485
|
-
const t4 = e4.match(
|
|
483
|
+
const t4 = e4.match(G);
|
|
486
484
|
if (!t4) {
|
|
487
485
|
n3.push(e4);
|
|
488
486
|
continue;
|
|
@@ -509,11 +507,11 @@ async function captureError(e2, t2 = false) {
|
|
|
509
507
|
})(i2), s2 = o2.filter((e3) => !e3.includes("chunk-") && !e3.includes("react-dom")), a2 = s2.length > 0 ? s2 : o2, r2 = Date.now();
|
|
510
508
|
sendMessage({ type: "event", event: { type: 6, timestamp: r2, data: { payload: { message: n2, stack: i2, trace: a2, filteredStack: s2, userAgent: navigator.userAgent, url: window.location.href, timestamp: r2, level: "error" } } } });
|
|
511
509
|
}
|
|
512
|
-
const
|
|
513
|
-
const
|
|
510
|
+
const V = readDebugFlag();
|
|
511
|
+
const Q = readDebugFlag();
|
|
514
512
|
function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3, s2 = 2) {
|
|
515
513
|
const a2 = `${n2.backendApi}/graphql/?apiKey=${n2.apiKey}`;
|
|
516
|
-
return
|
|
514
|
+
return Q && console.log(`Initial GraphQL request for ${e2} at ${a2}`), (function exponentialBackoff(e3, t3, n3 = 5, i3 = 2e3, o3 = 2) {
|
|
517
515
|
let s3 = 0;
|
|
518
516
|
const attemptRequest = async () => {
|
|
519
517
|
try {
|
|
@@ -521,12 +519,12 @@ function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3, s2 = 2) {
|
|
|
521
519
|
} catch (e4) {
|
|
522
520
|
if (s3++, s3 > n3) throw e4;
|
|
523
521
|
const a3 = i3 * Math.pow(o3, s3 - 1);
|
|
524
|
-
return
|
|
522
|
+
return V && console.log(`Attempt ${s3} failed: ${t3}; Retrying in ${a3}ms...`), await new Promise((e5) => setTimeout(e5, a3)), attemptRequest();
|
|
525
523
|
}
|
|
526
524
|
};
|
|
527
525
|
return attemptRequest();
|
|
528
526
|
})(() => fetch(a2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ operationName: e2, query: t2, variables: n2 }) }).then((e3) => {
|
|
529
|
-
if (
|
|
527
|
+
if (Q && console.log(`Received response with status: ${e3.status}`), !e3.ok) throw new Error(`GraphQL request failed with status ${e3.status}`);
|
|
530
528
|
return e3.json();
|
|
531
529
|
}), "Sending GraphQL request to Sailfish AI", i2, o2, s2);
|
|
532
530
|
}
|
|
@@ -551,9 +549,9 @@ function fetchEngineeringTicketPlatformIntegrations(e2, t2) {
|
|
|
551
549
|
function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2, s2, a2, r2, l2, c2, d2, u2, p2, f2, g2) {
|
|
552
550
|
return sendGraphQLRequest("CreateTriageAndIssueFromRecorder", "mutation CreateTriageAndIssueFromRecorder(\n $apiKey: String!,\n $recordingSessionId: String!,\n $timestampStart: String!,\n $timestampEnd: String!,\n $description: String,\n $issueName: String,\n $issueDescription: String,\n $createEngineeringTicket: Boolean,\n $teamId: String,\n $projectId: String,\n $priority: Int,\n $labels: [String!],\n $issueType: String,\n $customFields: JSON\n ) {\n createTriageAndIssueFromRecorder(\n apiKey: $apiKey,\n recordingSessionId: $recordingSessionId,\n timestampStart: $timestampStart,\n timestampEnd: $timestampEnd,\n description: $description,\n issueName: $issueName,\n issueDescription: $issueDescription,\n createEngineeringTicket: $createEngineeringTicket,\n teamId: $teamId,\n projectId: $projectId,\n priority: $priority,\n labels: $labels,\n issueType: $issueType,\n customFields: $customFields\n ) {\n id\n title\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description: s2, issueName: a2, issueDescription: r2, createEngineeringTicket: l2, teamId: c2, projectId: d2, priority: u2, labels: p2, issueType: f2, customFields: g2, backendApi: t2 });
|
|
553
551
|
}
|
|
554
|
-
const
|
|
552
|
+
const J = ["/node_modules/", "/@sailfish-ai/", "/@sailfish-rrweb/", "/dist/", "/webpack/", "/vite/", "/__vite", "/react-dom/", "/react/", "/scheduler/", "/<", "/chrome-extension://", "/extensions/"];
|
|
555
553
|
function shouldSkipFrame(e2) {
|
|
556
|
-
return
|
|
554
|
+
return J.some((t2) => e2.includes(t2));
|
|
557
555
|
}
|
|
558
556
|
function normalizeFilePath(e2) {
|
|
559
557
|
let t2 = e2;
|
|
@@ -619,8 +617,8 @@ function yieldToMain() {
|
|
|
619
617
|
var _a;
|
|
620
618
|
return "undefined" != typeof globalThis && ((_a = globalThis.scheduler) == null ? void 0 : _a.yield) ? globalThis.scheduler.yield() : new Promise((e2) => setTimeout(e2, 0));
|
|
621
619
|
}
|
|
622
|
-
let
|
|
623
|
-
const
|
|
620
|
+
let X = null;
|
|
621
|
+
const Z = "sailfishSanitize", Y = "zendesk_chat", ee = "Zendesk";
|
|
624
622
|
function zE_safe(...e2) {
|
|
625
623
|
try {
|
|
626
624
|
if ((function hasZendesk() {
|
|
@@ -636,13 +634,13 @@ function maskInputFn(e2, t2) {
|
|
|
636
634
|
const n2 = { creditCard: /\b(?:\d[ -]*?){13,16}\b/, ssn: /\b\d{3}-\d{2}-\d{4}\b/ };
|
|
637
635
|
return t2.closest(".mask") ? "*".repeat(e2.length) : t2.hasAttribute("data-cc") || ((_a = t2.getAttribute("autocomplete")) == null ? void 0 : _a.startsWith("cc-")) || n2.creditCard.test(e2) ? "**** **** **** " + e2.slice(-4) : t2.hasAttribute("data-ssn") || n2.ssn.test(e2) ? "***-**-" + e2.slice(-4) : t2.hasAttribute("data-dob") ? "**/**/" + e2.slice(-4) : e2;
|
|
638
636
|
}
|
|
639
|
-
let
|
|
637
|
+
let te = true, ne = null, ie = null, oe = null, se = null;
|
|
640
638
|
function invalidateUrlCache() {
|
|
641
|
-
|
|
639
|
+
te = true;
|
|
642
640
|
}
|
|
643
|
-
const getUrlAndStoredUuids = () => (
|
|
644
|
-
|
|
645
|
-
})(), { page_visit_uuid:
|
|
641
|
+
const getUrlAndStoredUuids = () => (te && (function _refreshSessionStorageCache() {
|
|
642
|
+
ne = sessionStorage.getItem("pageVisitUUID"), ie = sessionStorage.getItem("prevPageVisitUUID"), oe = sessionStorage.getItem("tabVisibilityChanged"), se = sessionStorage.getItem("tabVisibilityState"), te = false;
|
|
643
|
+
})(), { page_visit_uuid: ne, prev_page_visit_uuid: ie, href: getCachedHrefNoQuery(), tabVisibilityChanged: oe, tabVisibilityState: se });
|
|
646
644
|
function initializeDomContentEvents(e2) {
|
|
647
645
|
document.addEventListener("readystatechange", () => {
|
|
648
646
|
const t2 = { type: 24, data: { source: 0, info: "" }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() };
|
|
@@ -668,7 +666,7 @@ async function initializeConsolePlugin(e2, n2) {
|
|
|
668
666
|
const { name: o2, observer: s2 } = i2(e2);
|
|
669
667
|
s2((e3) => {
|
|
670
668
|
const i3 = e3, [s3, a2] = getCallerLocationFromTrace(i3 == null ? void 0 : i3.trace, 0), [r2, l2] = getCallerLocation(2), c2 = s3 ?? r2, d2 = a2 ?? l2, u2 = { ...i3, sourceFile: c2, sourceLine: d2 };
|
|
671
|
-
sendEvent({ type: t.
|
|
669
|
+
sendEvent({ type: t.Plugin, timestamp: Date.now(), data: { plugin: o2, payload: u2 }, sessionId: n2, ...getUrlAndStoredUuids() });
|
|
672
670
|
}, window, e2);
|
|
673
671
|
}
|
|
674
672
|
async function initializeRecording(e2, n2, i2, o2, s2, a2 = true, r2 = false, l2 = false) {
|
|
@@ -698,28 +696,28 @@ async function initializeRecording(e2, n2, i2, o2, s2, a2 = true, r2 = false, l2
|
|
|
698
696
|
Object.assign(e3, getUrlAndStoredUuids()), e3.sessionId = o2, n3.emit(e3);
|
|
699
697
|
}, startHeavyWork = async () => {
|
|
700
698
|
if (true === e2.enableFiberTracking) try {
|
|
701
|
-
const { installFiberHook: e3, processExistingTree: t2 } = await
|
|
699
|
+
const { installFiberHook: e3, processExistingTree: t2 } = await import("./fiberHook-DGANQ2ma.js");
|
|
702
700
|
e3(), t2(), console.log("[Sailfish] React Fiber tracking enabled");
|
|
703
701
|
} catch (e3) {
|
|
704
702
|
console.warn("[Sailfish] Failed to enable Fiber tracking:", e3);
|
|
705
703
|
}
|
|
706
704
|
const { record: n4 } = await import("@sailfish-rrweb/rrweb-record-only");
|
|
707
|
-
if (
|
|
708
|
-
const { chunkedSnapshot: i3 } = await
|
|
705
|
+
if (X = n4, await yieldToMain(), l2) {
|
|
706
|
+
const { chunkedSnapshot: i3 } = await import("./chunkSerializer-B_szIq8O.js"), o3 = n4.mirror;
|
|
709
707
|
let s3 = true;
|
|
710
708
|
const a3 = [];
|
|
711
709
|
n4({ emit(e3) {
|
|
712
710
|
s3 ? a3.push(e3) : emitWithContext(e3);
|
|
713
|
-
}, maskInputOptions: { text: true }, maskInputFn, maskTextClass:
|
|
714
|
-
const r3 = Date.now(), l3 = await i3(document, o3, { chunkSize: 500, maxChunkMs: 16, blockClass: e2.blockClass, blockSelector: e2.blockSelector, maskTextClass: e2.maskTextClass ??
|
|
711
|
+
}, maskInputOptions: { text: true }, maskInputFn, maskTextClass: Z, ...e2, recordDOM: false });
|
|
712
|
+
const r3 = Date.now(), l3 = await i3(document, o3, { chunkSize: 500, maxChunkMs: 16, blockClass: e2.blockClass, blockSelector: e2.blockSelector, maskTextClass: e2.maskTextClass ?? Z, maskTextSelector: e2.maskTextSelector });
|
|
715
713
|
if (l3) {
|
|
716
|
-
emitWithContext({ type: t.
|
|
714
|
+
emitWithContext({ type: t.Meta, data: { href: window.location.href, width: document.documentElement.clientWidth || document.body.clientWidth, height: document.documentElement.clientHeight || document.body.clientHeight }, timestamp: r3 }), emitWithContext({ type: t.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: r3 });
|
|
717
715
|
for (const e3 of a3) emitWithContext(e3);
|
|
718
716
|
s3 = false;
|
|
719
717
|
} else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"), s3 = false;
|
|
720
718
|
} else n4({ emit(e3) {
|
|
721
719
|
emitWithContext(e3);
|
|
722
|
-
}, maskInputOptions: { text: true }, maskInputFn, maskTextClass:
|
|
720
|
+
}, maskInputOptions: { text: true }, maskInputFn, maskTextClass: Z, ...e2 });
|
|
723
721
|
};
|
|
724
722
|
if (a2) {
|
|
725
723
|
let e3 = false;
|
|
@@ -751,11 +749,11 @@ async function initializeRecording(e2, n2, i2, o2, s2, a2 = true, r2 = false, l2
|
|
|
751
749
|
zE_safe("messenger:set", "conversationTags", [`sailfish-session-${o2}`]);
|
|
752
750
|
});
|
|
753
751
|
const handleWidgetOpen = () => {
|
|
754
|
-
|
|
752
|
+
X == null ? void 0 : X.addSailfishEvent(t.SailfishCustom, { action: "customer support chat opened", element_id: Y, provider: ee });
|
|
755
753
|
}, handleWidgetClose = () => {
|
|
756
|
-
|
|
754
|
+
X == null ? void 0 : X.addSailfishEvent(t.SailfishCustom, { action: "customer support chat closed", element_id: Y, provider: ee });
|
|
757
755
|
}, handleUnreadMessages = (e3) => {
|
|
758
|
-
|
|
756
|
+
X == null ? void 0 : X.addSailfishEvent(t.SailfishCustom, { action: "zendesk unreadmessages", element_id: Y, provider: ee });
|
|
759
757
|
};
|
|
760
758
|
suppressConsoleLogsDuringCall(() => {
|
|
761
759
|
zE_safe("messenger:on", "open", handleWidgetOpen), zE_safe("messenger:on", "close", handleWidgetClose), zE_safe("messenger:on", "unreadMessages", handleUnreadMessages);
|
|
@@ -766,40 +764,40 @@ async function initializeRecording(e2, n2, i2, o2, s2, a2 = true, r2 = false, l2
|
|
|
766
764
|
}
|
|
767
765
|
return c2;
|
|
768
766
|
}
|
|
769
|
-
const
|
|
770
|
-
let
|
|
771
|
-
const
|
|
767
|
+
const ae = ["jira", "linear", "zendesk"];
|
|
768
|
+
let re = null;
|
|
769
|
+
const le = /* @__PURE__ */ new Map();
|
|
772
770
|
function getIntegrationData() {
|
|
773
|
-
return
|
|
771
|
+
return re;
|
|
774
772
|
}
|
|
775
773
|
function hasValidIntegration() {
|
|
776
|
-
return null !==
|
|
774
|
+
return null !== re && true === re.installed;
|
|
777
775
|
}
|
|
778
776
|
function resolveIntegration(e2) {
|
|
779
777
|
var _a;
|
|
780
778
|
if ((e2 == null ? void 0 : e2.errors) && e2.errors.length > 0) return console.error("GraphQL errors fetching integrations:", e2.errors), null;
|
|
781
779
|
const t2 = (_a = e2 == null ? void 0 : e2.data) == null ? void 0 : _a.getEngineeringTicketPlatformIntegrationsFromApiKey, n2 = (t2 || []).filter((e3) => {
|
|
782
780
|
var _a2;
|
|
783
|
-
return
|
|
781
|
+
return ae.includes(((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase()) || "") && true === e3.installed;
|
|
784
782
|
});
|
|
785
783
|
if (0 === n2.length) return console.warn("No valid installed integrations found"), null;
|
|
786
784
|
const i2 = n2.find((e3) => {
|
|
787
785
|
var _a2;
|
|
788
786
|
return "jira" === ((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase());
|
|
789
787
|
}) || n2[0];
|
|
790
|
-
return (i2 == null ? void 0 : i2.primaryCloudId) &&
|
|
788
|
+
return (i2 == null ? void 0 : i2.primaryCloudId) && le.set(i2.primaryCloudId, i2), i2;
|
|
791
789
|
}
|
|
792
790
|
async function refreshIntegrationData(e2, t2) {
|
|
793
791
|
try {
|
|
794
792
|
const n2 = resolveIntegration(await fetchEngineeringTicketPlatformIntegrations(e2, t2));
|
|
795
|
-
return
|
|
793
|
+
return re = n2, n2;
|
|
796
794
|
} catch (e3) {
|
|
797
|
-
return console.error("Error refreshing integration data:", e3),
|
|
795
|
+
return console.error("Error refreshing integration data:", e3), re;
|
|
798
796
|
}
|
|
799
797
|
}
|
|
800
798
|
function populateSelectOptions(e2, t2, n2) {
|
|
801
799
|
const i2 = document.createElement("option");
|
|
802
|
-
i2.value = "", i2.
|
|
800
|
+
i2.value = "", i2.selected = !n2, i2.textContent = "Select...", i2.style.color = "#9ca3af", e2.innerHTML = "", e2.appendChild(i2), t2.forEach((t3) => {
|
|
803
801
|
const n3 = document.createElement("option");
|
|
804
802
|
n3.value = t3.id || t3.value || t3, n3.textContent = t3.name || t3.label || t3, e2.appendChild(n3);
|
|
805
803
|
}), n2 ? (e2.value = n2, e2.style.color = "") : e2.style.color = "#9ca3af";
|
|
@@ -822,15 +820,15 @@ function populatePriorityOptions(e2, t2, n2) {
|
|
|
822
820
|
function populateSprintOptions(e2, t2, n2) {
|
|
823
821
|
e2.innerHTML = "";
|
|
824
822
|
const i2 = document.createElement("option");
|
|
825
|
-
i2.value = "", i2.
|
|
823
|
+
i2.value = "", i2.selected = !n2, i2.textContent = "Select sprint...", i2.style.color = "#9ca3af", e2.appendChild(i2);
|
|
826
824
|
(t2 || []).filter((e3) => "active" === e3.state || "future" === e3.state).forEach((t3) => {
|
|
827
825
|
const n3 = document.createElement("option");
|
|
828
826
|
n3.value = String(t3.id), n3.textContent = t3.name || t3.id, e2.appendChild(n3);
|
|
829
827
|
}), n2 && (e2.value = n2);
|
|
830
828
|
}
|
|
831
829
|
function getSprintFieldId() {
|
|
832
|
-
if (!(
|
|
833
|
-
const e2 = Array.isArray(
|
|
830
|
+
if (!(re == null ? void 0 : re.fieldConfigurations)) return "customfield_10020";
|
|
831
|
+
const e2 = Array.isArray(re.fieldConfigurations) ? re.fieldConfigurations : [];
|
|
834
832
|
for (const t2 of e2) {
|
|
835
833
|
const e3 = (t2.fields || []).find((e4) => {
|
|
836
834
|
var _a;
|
|
@@ -842,12 +840,12 @@ function getSprintFieldId() {
|
|
|
842
840
|
}
|
|
843
841
|
function updateIssueTypeOptions(e2, t2) {
|
|
844
842
|
var _a;
|
|
845
|
-
if (!(
|
|
843
|
+
if (!(re == null ? void 0 : re.projects) || !t2) {
|
|
846
844
|
e2.innerHTML = "";
|
|
847
845
|
const t3 = document.createElement("option");
|
|
848
846
|
return t3.value = "", t3.disabled = true, t3.selected = true, t3.textContent = "Select project first...", t3.style.color = "#9ca3af", e2.appendChild(t3), void (e2.style.color = "#9ca3af");
|
|
849
847
|
}
|
|
850
|
-
const n2 =
|
|
848
|
+
const n2 = re.projects.find((e3) => e3.id === t2);
|
|
851
849
|
if (!n2 || !n2.issue_types) {
|
|
852
850
|
e2.innerHTML = "";
|
|
853
851
|
const t3 = document.createElement("option");
|
|
@@ -856,7 +854,7 @@ function updateIssueTypeOptions(e2, t2) {
|
|
|
856
854
|
const i2 = n2.issue_types || [];
|
|
857
855
|
e2.innerHTML = "";
|
|
858
856
|
const o2 = document.createElement("option");
|
|
859
|
-
if (o2.value = "", o2.
|
|
857
|
+
if (o2.value = "", o2.textContent = "Select...", o2.style.color = "#9ca3af", e2.appendChild(o2), i2.forEach((t3) => {
|
|
860
858
|
const n3 = document.createElement("option");
|
|
861
859
|
n3.value = t3.id || t3.value || t3, n3.textContent = t3.name || t3.label || t3, e2.appendChild(n3);
|
|
862
860
|
}), i2.length > 0) {
|
|
@@ -871,70 +869,75 @@ function updateIssueTypeOptions(e2, t2) {
|
|
|
871
869
|
}
|
|
872
870
|
}
|
|
873
871
|
function getFieldsForProject(e2, t2) {
|
|
874
|
-
if (!(
|
|
875
|
-
const n2 = Array.isArray(
|
|
872
|
+
if (!(re == null ? void 0 : re.fieldConfigurations) || !e2) return [];
|
|
873
|
+
const n2 = Array.isArray(re.fieldConfigurations) ? re.fieldConfigurations.find((n3) => n3.project_key === e2 && (!t2 || n3.issue_type_id === t2)) : re.fieldConfigurations[e2];
|
|
876
874
|
return n2 && n2.fields ? n2.fields : [];
|
|
877
875
|
}
|
|
878
876
|
function getUsers() {
|
|
879
|
-
return (
|
|
877
|
+
return (re == null ? void 0 : re.users) ? re.users : [];
|
|
880
878
|
}
|
|
881
879
|
function getProjectsForTeam(e2) {
|
|
882
|
-
if (!
|
|
883
|
-
const t2 =
|
|
880
|
+
if (!re) return [];
|
|
881
|
+
const t2 = re.teams && Array.isArray(re.teams) && re.teams.length > 0;
|
|
884
882
|
if (t2 && e2) {
|
|
885
|
-
const t3 =
|
|
883
|
+
const t3 = re.teams.find((t4) => t4.id === e2);
|
|
886
884
|
return (t3 == null ? void 0 : t3.projects) || [];
|
|
887
885
|
}
|
|
888
|
-
return !t2 &&
|
|
886
|
+
return !t2 && re.projects ? re.projects : [];
|
|
889
887
|
}
|
|
890
888
|
function updateFormWithIntegrationData(e2) {
|
|
891
889
|
var _a;
|
|
892
|
-
if (!
|
|
893
|
-
const t2 =
|
|
894
|
-
n2 && t2 && (populateSelectOptions(n2,
|
|
890
|
+
if (!re) return e2;
|
|
891
|
+
const t2 = re.teams && Array.isArray(re.teams) && re.teams.length > 0, n2 = document.getElementById("sf-eng-ticket-team");
|
|
892
|
+
n2 && t2 && (populateSelectOptions(n2, re.teams, re.defaultTeam), e2.engTicketTeam ? n2.value = e2.engTicketTeam : e2.engTicketTeam = n2.value);
|
|
895
893
|
const i2 = document.getElementById("sf-eng-ticket-project");
|
|
896
894
|
if (i2) {
|
|
897
|
-
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) :
|
|
895
|
+
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) : re.projects || [], re.defaultProject), e2.engTicketProject ? i2.value = e2.engTicketProject : e2.engTicketProject = i2.value;
|
|
898
896
|
}
|
|
899
897
|
const o2 = document.getElementById("sf-eng-ticket-priority");
|
|
900
|
-
o2 && (populatePriorityOptions(o2,
|
|
901
|
-
const s2 = document.getElementById("sf-eng-ticket-sprint"), a2 = "jira" === ((_a =
|
|
902
|
-
s2 && a2 &&
|
|
898
|
+
o2 && (populatePriorityOptions(o2, re.provider || "", re.defaultPriority), e2.engTicketPriority ? o2.value = String(e2.engTicketPriority) : e2.engTicketPriority = Number(o2.value));
|
|
899
|
+
const s2 = document.getElementById("sf-eng-ticket-sprint"), a2 = "jira" === ((_a = re.provider) == null ? void 0 : _a.toLowerCase());
|
|
900
|
+
s2 && a2 && re.sprints && populateSprintOptions(s2, re.sprints, e2.engTicketSprint || void 0);
|
|
903
901
|
const r2 = document.getElementById("sf-eng-ticket-type");
|
|
904
902
|
return r2 && a2 && e2.engTicketProject && (updateIssueTypeOptions(r2, e2.engTicketProject), e2.engTicketIssueType ? (r2.value = e2.engTicketIssueType, r2.style.color = "#000") : r2.value && (e2.engTicketIssueType = r2.value)), e2;
|
|
905
903
|
}
|
|
906
|
-
const
|
|
907
|
-
if (!
|
|
904
|
+
const ce = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrationData: async function fetchIntegrationData(e2, t2) {
|
|
905
|
+
if (!re) try {
|
|
908
906
|
const n2 = await fetchEngineeringTicketPlatformIntegrations(e2, t2);
|
|
909
|
-
|
|
907
|
+
re = resolveIntegration(n2);
|
|
910
908
|
} catch (e3) {
|
|
911
|
-
console.error("Error fetching integration data:", e3),
|
|
909
|
+
console.error("Error fetching integration data:", e3), re = null;
|
|
912
910
|
}
|
|
913
|
-
}, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSprintFieldId, getUsers, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" })),
|
|
911
|
+
}, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSprintFieldId, getUsers, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" })), de = "sf-create-issue-preference", ue = "sf-create-eng-ticket-preference";
|
|
914
912
|
function getInitialState() {
|
|
915
913
|
const e2 = (function loadUserPreferences() {
|
|
916
|
-
return { createIssue: g && "true" === localStorage.getItem(
|
|
914
|
+
return { createIssue: g && "true" === localStorage.getItem(de), createEngTicket: g && "true" === localStorage.getItem(ue) };
|
|
917
915
|
})();
|
|
918
916
|
return { mode: "lookback", description: "", occurredInThisTab: true, createIssue: e2.createIssue, issueName: "", issueDescription: "", createEngTicket: e2.createEngTicket, engTicketTeam: "", engTicketProject: "", engTicketPriority: 0, engTicketLabels: [], engTicketSprint: "", engTicketIssueType: "", engTicketCustomFields: {} };
|
|
919
917
|
}
|
|
920
|
-
let
|
|
918
|
+
let pe = getInitialState(), fe = null, ge = null, me = null, he = false;
|
|
921
919
|
function setTimerInterval(e2) {
|
|
922
|
-
|
|
920
|
+
me = e2;
|
|
923
921
|
}
|
|
924
922
|
function setIsRecording(e2) {
|
|
925
|
-
|
|
923
|
+
he = e2;
|
|
926
924
|
}
|
|
927
925
|
function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
|
|
928
|
-
const s2 = o2 ? '<span style="color:#ef4444;">*</span>' : "", a2 = n2.filter((e3) => i2.includes(e3.id || e3.value || e3.name || e3)).map((e3) => e3.name || e3.value || e3).join(", ");
|
|
929
926
|
return `
|
|
930
927
|
<div style="position:relative;">
|
|
931
928
|
<label for="${e2}" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
|
|
932
|
-
${t2} ${
|
|
929
|
+
${t2} ${o2 ? '<span style="color:#ef4444;">*</span>' : ""}
|
|
933
930
|
</label>
|
|
934
931
|
<div class="sf-custom-multiselect" id="${e2}-container" data-field-id="${e2}" style="position:relative;">
|
|
935
|
-
<div class="sf-multiselect-input" style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; background-color:white; cursor:pointer; min-height:38px; display:flex; align-items:center;" onclick="document.getElementById('${e2}-dropdown').style.display = document.getElementById('${e2}-dropdown').style.display === 'none' ? 'block' : 'none';">
|
|
936
|
-
<span
|
|
937
|
-
|
|
932
|
+
<div class="sf-multiselect-input" style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; background-color:white; cursor:pointer; min-height:38px; display:flex; align-items:center; flex-wrap:wrap; gap:4px;" onclick="document.getElementById('${e2}-dropdown').style.display = document.getElementById('${e2}-dropdown').style.display === 'none' ? 'block' : 'none';">
|
|
933
|
+
<span class="sf-multiselect-chips" style="display:flex; flex-wrap:wrap; gap:4px; flex:1;">${n2.filter((e3) => i2.includes(e3.id || e3.value || e3.name || e3)).map((e3) => {
|
|
934
|
+
const t3 = e3.id || e3.value || e3.name || e3;
|
|
935
|
+
return `<span class="sf-multiselect-chip" data-value="${t3}" style="display:inline-flex; align-items:center; gap:4px; background:#e5e7eb; color:#374151; padding:2px 8px; border-radius:16px; font-size:13px; white-space:nowrap;">
|
|
936
|
+
${e3.name || e3.value || e3}
|
|
937
|
+
<span class="sf-multiselect-chip-remove" data-value="${t3}" style="cursor:pointer; display:inline-flex; align-items:center; font-size:16px; line-height:1; color:#6b7280;" onclick="event.stopPropagation();">×</span>
|
|
938
|
+
</span>`;
|
|
939
|
+
}).join("") || '<span style="color:#9ca3af;">Select...</span>'}</span>
|
|
940
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" style="margin-left:8px; flex-shrink:0;">
|
|
938
941
|
<path d="M4 6L8 10L12 6" stroke="#64748B" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
939
942
|
</svg>
|
|
940
943
|
</div>
|
|
@@ -952,26 +955,47 @@ function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
|
|
|
952
955
|
</div>
|
|
953
956
|
`;
|
|
954
957
|
}
|
|
955
|
-
const
|
|
956
|
-
}, integrationData: null };
|
|
957
|
-
let
|
|
958
|
+
const ye = { enabled: false, openModalExistingMode: { key: "e", requireCmdCtrl: false }, openModalCaptureNewMode: { key: "n", requireCmdCtrl: false }, closeModal: { key: "escape", requireCmdCtrl: false }, submitReport: { key: "enter", requireCmdCtrl: true }, startRecording: { key: "r", requireCmdCtrl: false }, stopRecording: { key: "escape", requireCmdCtrl: true } }, be = { shortcuts: { ...ye }, resolveSessionId: null, apiKey: null, backendApi: null, triageBaseUrl: "https://app.sailfishqa.com", deactivateIsolation: () => {
|
|
959
|
+
}, integrationData: null, showEngTicketFieldsDefault: false };
|
|
960
|
+
let we = null, ve = false;
|
|
958
961
|
function setupCustomMultiSelectListeners(e2, t2) {
|
|
959
962
|
const n2 = document.getElementById(`${e2}-container`), i2 = document.getElementById(`${e2}-dropdown`);
|
|
960
963
|
if (!n2 || !i2) return;
|
|
961
|
-
|
|
962
|
-
e3
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
964
|
+
function updateChipsDisplay() {
|
|
965
|
+
const e3 = [], o2 = [];
|
|
966
|
+
i2.querySelectorAll(".sf-multiselect-option").forEach((t3) => {
|
|
967
|
+
var _a;
|
|
968
|
+
const n3 = t3;
|
|
969
|
+
if ("true" === n3.dataset.selected) {
|
|
970
|
+
const t4 = n3.dataset.value || "", i3 = ((_a = n3.textContent) == null ? void 0 : _a.trim()) || "";
|
|
971
|
+
e3.push(t4), o2.push(`<span class="sf-multiselect-chip" data-value="${t4}" style="display:inline-flex; align-items:center; gap:4px; background:#e5e7eb; color:#374151; padding:2px 8px; border-radius:16px; font-size:13px; white-space:nowrap;">
|
|
972
|
+
${i3}
|
|
973
|
+
<span class="sf-multiselect-chip-remove" data-value="${t4}" style="cursor:pointer; display:inline-flex; align-items:center; font-size:16px; line-height:1; color:#6b7280;" onclick="event.stopPropagation();">×</span>
|
|
974
|
+
</span>`);
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
const s2 = n2.querySelector(".sf-multiselect-chips");
|
|
978
|
+
return s2 && (s2.innerHTML = o2.join("") || '<span style="color:#9ca3af;">Select...</span>', s2.querySelectorAll(".sf-multiselect-chip-remove").forEach((e4) => {
|
|
979
|
+
e4.addEventListener("click", (n3) => {
|
|
980
|
+
n3.stopPropagation();
|
|
981
|
+
const o3 = e4.dataset.value || "", s3 = i2.querySelector(`.sf-multiselect-option[data-value="${o3}"]`);
|
|
982
|
+
s3 && (s3.dataset.selected = "false", s3.style.backgroundColor = ""), updateChipsDisplay();
|
|
983
|
+
const a2 = [];
|
|
984
|
+
i2.querySelectorAll(".sf-multiselect-option").forEach((e5) => {
|
|
985
|
+
"true" === e5.dataset.selected && a2.push(e5.dataset.value || "");
|
|
986
|
+
}), t2(a2);
|
|
970
987
|
});
|
|
971
|
-
|
|
972
|
-
|
|
988
|
+
})), e3;
|
|
989
|
+
}
|
|
990
|
+
i2.querySelectorAll(".sf-multiselect-option").forEach((e3) => {
|
|
991
|
+
e3.addEventListener("click", (n3) => {
|
|
992
|
+
n3.stopPropagation();
|
|
993
|
+
const i3 = e3, o2 = "true" === i3.dataset.selected;
|
|
994
|
+
i3.dataset.selected = String(!o2), i3.style.backgroundColor = o2 ? "" : "#e0f2fe";
|
|
995
|
+
const s2 = updateChipsDisplay();
|
|
996
|
+
t2(s2);
|
|
973
997
|
});
|
|
974
|
-
}), document.addEventListener("click", (e3) => {
|
|
998
|
+
}), updateChipsDisplay(), document.addEventListener("click", (e3) => {
|
|
975
999
|
const t3 = e3.target;
|
|
976
1000
|
n2.contains(t3) || (i2.style.display = "none");
|
|
977
1001
|
});
|
|
@@ -1074,7 +1098,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1074
1098
|
style="${p2} appearance:none; cursor:pointer; background-color: white; ${s4 ? "" : "color: #9ca3af;"}"
|
|
1075
1099
|
${l2 ? "required" : ""}
|
|
1076
1100
|
>
|
|
1077
|
-
<option value=""
|
|
1101
|
+
<option value="" ${s4 ? "" : "selected"} style="color: #9ca3af;">Select ${o3.toLowerCase()}...</option>
|
|
1078
1102
|
${e5}
|
|
1079
1103
|
</select>
|
|
1080
1104
|
</div>
|
|
@@ -1099,7 +1123,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1099
1123
|
style="${p2} appearance:none; cursor:pointer; background-color: white; ${n4 ? "" : "color: #9ca3af;"}"
|
|
1100
1124
|
${l2 ? "required" : ""}
|
|
1101
1125
|
>
|
|
1102
|
-
<option value=""
|
|
1126
|
+
<option value="" ${n4 ? "" : "selected"} style="color: #9ca3af;">Select ${o3.toLowerCase()}...</option>
|
|
1103
1127
|
${e5}
|
|
1104
1128
|
</select>
|
|
1105
1129
|
</div>
|
|
@@ -1146,22 +1170,22 @@ function renderDynamicFields(e2, t2) {
|
|
|
1146
1170
|
</div>
|
|
1147
1171
|
` : null;
|
|
1148
1172
|
}
|
|
1149
|
-
})(e3,
|
|
1173
|
+
})(e3, pe.engTicketCustomFields[e3.fieldId || e3.key], o2)).filter(Boolean).join("");
|
|
1150
1174
|
n2.innerHTML = s2 || "", i2.forEach((e3) => {
|
|
1151
1175
|
var _a;
|
|
1152
1176
|
const t3 = e3.fieldId || e3.key, n3 = (_a = e3.schema) == null ? void 0 : _a.type, i3 = e3.allowedValues;
|
|
1153
1177
|
"array" === n3 && i3 && i3.length > 0 && setupCustomMultiSelectListeners(t3, (e4) => {
|
|
1154
|
-
|
|
1178
|
+
pe.engTicketCustomFields[t3] = e4;
|
|
1155
1179
|
});
|
|
1156
1180
|
});
|
|
1157
1181
|
}
|
|
1158
1182
|
function generateEngTicketFieldsHTML() {
|
|
1159
1183
|
var _a;
|
|
1160
|
-
const e2 =
|
|
1184
|
+
const e2 = be.integrationData;
|
|
1161
1185
|
if (!e2) return "";
|
|
1162
1186
|
const t2 = "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase());
|
|
1163
1187
|
let n2 = "<div style='display:flex; flex-direction:column; gap:12px;'>";
|
|
1164
|
-
return e2.teams && Array.isArray(e2.teams) && e2.teams.length > 0 && (n2 += '\n <div>\n <label for="sf-eng-ticket-team" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Team\n </label>\n <select id="sf-eng-ticket-team"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value=""
|
|
1188
|
+
return e2.teams && Array.isArray(e2.teams) && e2.teams.length > 0 && (n2 += '\n <div>\n <label for="sf-eng-ticket-team" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Team\n </label>\n <select id="sf-eng-ticket-team"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select team...</option>\n </select>\n </div>\n '), n2 += '\n <div>\n <label for="sf-eng-ticket-project" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Project\n </label>\n <select id="sf-eng-ticket-project"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select project...</option>\n </select>\n </div>\n ', t2 && (n2 += '\n <div>\n <label for="sf-eng-ticket-type" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Issue Type\n </label>\n <select id="sf-eng-ticket-type"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select project first...</option>\n </select>\n </div>\n '), n2 += '\n <div>\n <label for="sf-eng-ticket-priority" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Priority\n </label>\n <select id="sf-eng-ticket-priority"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white;">\n </select>\n </div>\n ', e2.labels && Array.isArray(e2.labels) && e2.labels.length > 0 && (n2 += renderCustomMultiSelect("sf-eng-ticket-labels", "Labels", e2.labels, pe.engTicketLabels, false)), t2 && e2.sprints && Array.isArray(e2.sprints) && e2.sprints.length > 0 && (n2 += '\n <div>\n <label for="sf-eng-ticket-sprint" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Sprint\n </label>\n <select id="sf-eng-ticket-sprint"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select sprint...</option>\n </select>\n </div>\n '), n2 += '\n <div id="sf-dynamic-fields-container" style="display: flex; flex-direction: column; gap: 12px;"></div>\n ', n2 += "</div>", n2;
|
|
1165
1189
|
}
|
|
1166
1190
|
function getShortcutKeyCmdCtrlLabel() {
|
|
1167
1191
|
return (function isMacPlatform() {
|
|
@@ -1175,19 +1199,19 @@ function getShortcutLabelFromContext(e2) {
|
|
|
1175
1199
|
return e3.requireCmdCtrl && t2.push(getShortcutKeyCmdCtrlLabel()), t2.push((function formatShortcutKeyLabel(e4) {
|
|
1176
1200
|
return ({ escape: "esc" }[e4.toLowerCase()] || e4).toUpperCase();
|
|
1177
1201
|
})(e3.key)), t2.map((e4) => `<span style="background: #F1F5F9; border:1px solid #cbd5e1; border-radius: 4px; padding: 0 4px; font-weight: 500; font-size: 12px; color: #94A3B8; line-height: 16px;">${e4}</span>`).join(e3.requireCmdCtrl ? " + " : "");
|
|
1178
|
-
})(
|
|
1202
|
+
})(be.shortcuts[e2]);
|
|
1179
1203
|
}
|
|
1180
1204
|
function getSessionIdSafely() {
|
|
1181
|
-
if (!
|
|
1182
|
-
return
|
|
1205
|
+
if (!be.resolveSessionId) throw new Error("getSessionId not defined");
|
|
1206
|
+
return be.resolveSessionId();
|
|
1183
1207
|
}
|
|
1184
|
-
function openReportIssueModal() {
|
|
1185
|
-
|
|
1208
|
+
function openReportIssueModal(e2) {
|
|
1209
|
+
he ? stopRecording() : (ve = (e2 == null ? void 0 : e2.showEngTicketFields) ?? be.showEngTicketFieldsDefault, injectModalHTML(), we && document.body.appendChild(we));
|
|
1186
1210
|
}
|
|
1187
1211
|
function closeModal() {
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
})(),
|
|
1212
|
+
be.deactivateIsolation(), document.activeElement instanceof HTMLElement && document.activeElement.blur(), (we == null ? void 0 : we.parentNode) && we.parentNode.removeChild(we), we = null, he || (function resetState() {
|
|
1213
|
+
pe = getInitialState(), fe = null, ge = null;
|
|
1214
|
+
})(), me && (clearInterval(me), setTimerInterval(null));
|
|
1191
1215
|
}
|
|
1192
1216
|
function activateModalIsolation(e2) {
|
|
1193
1217
|
e2.setAttribute("role", "dialog"), e2.setAttribute("aria-modal", "true"), e2.hasAttribute("tabindex") || e2.setAttribute("tabindex", "-1");
|
|
@@ -1246,9 +1270,9 @@ function activateModalIsolation(e2) {
|
|
|
1246
1270
|
};
|
|
1247
1271
|
}
|
|
1248
1272
|
function injectModalHTML(e2 = "lookback") {
|
|
1249
|
-
|
|
1273
|
+
we && (we.remove(), we = null), we = document.createElement("div"), we.id = "sf-report-issue-modal";
|
|
1250
1274
|
const t2 = "startnow" === e2;
|
|
1251
|
-
|
|
1275
|
+
we.innerHTML = `
|
|
1252
1276
|
<div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
|
|
1253
1277
|
<div style="position:fixed; top:50%; left:50%; transform:translate(-50%, -50%);
|
|
1254
1278
|
background:#fff; border-radius:12px;
|
|
@@ -1303,7 +1327,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1303
1327
|
<textarea id="sf-issue-description" placeholder="Add description here"
|
|
1304
1328
|
style="width:100%; height:80px; padding:8px 12px; font-size:14px;
|
|
1305
1329
|
border:1px solid #cbd5e1; border-radius:6px; margin-bottom:20px;
|
|
1306
|
-
resize:none; outline:none;">${
|
|
1330
|
+
resize:none; outline:none;">${pe.description}</textarea>
|
|
1307
1331
|
|
|
1308
1332
|
<!-- When did this happen Section -->
|
|
1309
1333
|
<div id="sf-lookback-container" style="display:${t2 ? "none" : "block"}; margin-bottom:20px;">
|
|
@@ -1369,34 +1393,34 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1369
1393
|
<!-- Checkboxes on same line -->
|
|
1370
1394
|
<div style="display:flex; align-items:center; gap:24px; margin-bottom:16px;">
|
|
1371
1395
|
<label style="display:flex; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
|
|
1372
|
-
<input type="checkbox" id="sf-create-issue-checkbox" ${
|
|
1396
|
+
<input type="checkbox" id="sf-create-issue-checkbox" ${pe.createIssue ? "checked" : ""}
|
|
1373
1397
|
style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;">
|
|
1374
1398
|
Create an Issue
|
|
1375
1399
|
</label>
|
|
1376
1400
|
|
|
1377
|
-
<label id="sf-create-eng-ticket-label" style="display:${
|
|
1378
|
-
<input type="checkbox" id="sf-create-eng-ticket-checkbox" ${
|
|
1401
|
+
<label id="sf-create-eng-ticket-label" style="display:${be.integrationData && ve ? "flex" : "none"}; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
|
|
1402
|
+
<input type="checkbox" id="sf-create-eng-ticket-checkbox" ${pe.createEngTicket ? "checked" : ""}
|
|
1379
1403
|
style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;">
|
|
1380
1404
|
Create an Eng Ticket
|
|
1381
1405
|
</label>
|
|
1382
1406
|
</div>
|
|
1383
1407
|
|
|
1384
1408
|
<!-- Issue Title Field (always shown when create issue is checked) -->
|
|
1385
|
-
<div id="sf-issue-fields-container" style="display:${
|
|
1409
|
+
<div id="sf-issue-fields-container" style="display:${pe.createIssue ? "block" : "none"};">
|
|
1386
1410
|
<div style="display:flex; flex-direction:column; gap:12px;">
|
|
1387
1411
|
<div>
|
|
1388
1412
|
<label for="sf-issue-name" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
|
|
1389
1413
|
Title <span style="color:#ef4444;">*</span>
|
|
1390
1414
|
</label>
|
|
1391
1415
|
<input type="text" id="sf-issue-name" placeholder="Enter title"
|
|
1392
|
-
value="${
|
|
1416
|
+
value="${pe.issueName}"
|
|
1393
1417
|
style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none;">
|
|
1394
1418
|
</div>
|
|
1395
1419
|
</div>
|
|
1396
1420
|
</div>
|
|
1397
1421
|
|
|
1398
1422
|
<!-- Engineering Ticket Fields (shown when create eng ticket is checked) -->
|
|
1399
|
-
<div id="sf-eng-ticket-fields-container" style="display:${
|
|
1423
|
+
<div id="sf-eng-ticket-fields-container" style="display:${pe.createEngTicket && be.integrationData ? "block" : "none"}; margin-top: ${pe.createIssue ? "12px" : "0"};">
|
|
1400
1424
|
${generateEngTicketFieldsHTML()}
|
|
1401
1425
|
</div>
|
|
1402
1426
|
</div>
|
|
@@ -1439,8 +1463,8 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1439
1463
|
</div>
|
|
1440
1464
|
</div>
|
|
1441
1465
|
</div>
|
|
1442
|
-
`,
|
|
1443
|
-
const e3 =
|
|
1466
|
+
`, pe.mode = e2, document.body.appendChild(we), (function bindListeners() {
|
|
1467
|
+
const e3 = we == null ? void 0 : we.querySelectorAll(".sf-issue-tab"), t3 = document.getElementById("sf-start-recording-btn"), n2 = document.getElementById("sf-modal-close-btn"), i2 = document.getElementById("sf-issue-submit-btn"), o2 = document.getElementById("sf-lookback-minutes");
|
|
1444
1468
|
e3 == null ? void 0 : e3.forEach((e4) => {
|
|
1445
1469
|
e4.addEventListener("click", (e5) => {
|
|
1446
1470
|
const t4 = e5.currentTarget.dataset.mode;
|
|
@@ -1448,9 +1472,9 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1448
1472
|
});
|
|
1449
1473
|
}), n2 && (n2.onclick = closeModal);
|
|
1450
1474
|
o2 && o2.addEventListener("change", () => {
|
|
1451
|
-
"lookback" ===
|
|
1475
|
+
"lookback" === pe.mode && (i2.disabled = false, i2.style.opacity = "1", i2.style.cursor = "pointer");
|
|
1452
1476
|
});
|
|
1453
|
-
const s2 =
|
|
1477
|
+
const s2 = we == null ? void 0 : we.querySelectorAll(".sf-collapsible-header");
|
|
1454
1478
|
s2 == null ? void 0 : s2.forEach((e4) => {
|
|
1455
1479
|
e4.addEventListener("click", (e5) => {
|
|
1456
1480
|
const t4 = e5.currentTarget, n3 = t4.dataset.target, i3 = document.getElementById(n3), o3 = t4.querySelector(".sf-chevron");
|
|
@@ -1465,17 +1489,17 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1465
1489
|
const a2 = document.getElementById("sf-create-issue-checkbox"), r2 = document.getElementById("sf-issue-fields-container"), l2 = document.getElementById("sf-create-eng-ticket-checkbox"), c2 = document.getElementById("sf-eng-ticket-fields-container");
|
|
1466
1490
|
a2 && a2.addEventListener("change", () => {
|
|
1467
1491
|
const e4 = a2.checked;
|
|
1468
|
-
|
|
1492
|
+
pe.createIssue = e4, localStorage.setItem(de, String(e4)), r2 && (r2.style.display = e4 ? "block" : "none"), !e4 && l2 && (l2.checked = false, pe.createEngTicket = false, localStorage.setItem(ue, "false"), c2 && (c2.style.display = "none"));
|
|
1469
1493
|
});
|
|
1470
1494
|
l2 && l2.addEventListener("change", async () => {
|
|
1471
1495
|
var _a;
|
|
1472
1496
|
const e4 = l2.checked;
|
|
1473
|
-
if (
|
|
1474
|
-
if (!hasValidIntegration()) return l2.checked = false,
|
|
1497
|
+
if (pe.createEngTicket = e4, localStorage.setItem(ue, String(e4)), e4 && !pe.createIssue && (pe.createIssue = true, localStorage.setItem(de, "true"), a2 && (a2.checked = true), r2 && (r2.style.display = "block")), c2 && (c2.style.display = e4 ? "block" : "none"), e4) {
|
|
1498
|
+
if (!hasValidIntegration()) return l2.checked = false, pe.createEngTicket = false, localStorage.setItem(ue, "false"), c2 && (c2.style.display = "none"), void alert("No engineering ticket integration found. Please install and configure an integration (Jira, Linear, or Zendesk) first.");
|
|
1475
1499
|
const e5 = getIntegrationData();
|
|
1476
1500
|
if (e5) {
|
|
1477
|
-
if (!
|
|
1478
|
-
getFieldsForProject(
|
|
1501
|
+
if (!pe.engTicketTeam && e5.defaultTeam && (pe.engTicketTeam = e5.defaultTeam), !pe.engTicketProject && e5.defaultProject && (pe.engTicketProject = e5.defaultProject), !pe.engTicketPriority && e5.defaultPriority && (pe.engTicketPriority = e5.defaultPriority), updateFormWithIntegrationData(pe), "jira" === ((_a = e5.provider) == null ? void 0 : _a.toLowerCase()) && e5.jiraReporterAccountId && pe.engTicketProject) {
|
|
1502
|
+
getFieldsForProject(pe.engTicketProject, pe.engTicketIssueType).find((e6) => "reporter" === e6.fieldId) && !pe.engTicketCustomFields.reporter && (pe.engTicketCustomFields.reporter = e5.jiraReporterAccountId);
|
|
1479
1503
|
}
|
|
1480
1504
|
const t4 = document.getElementById("sf-eng-ticket-project"), n3 = document.getElementById("sf-eng-ticket-type");
|
|
1481
1505
|
t4 && t4.value && renderDynamicFields(t4.value, n3 == null ? void 0 : n3.value);
|
|
@@ -1484,11 +1508,11 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1484
1508
|
});
|
|
1485
1509
|
const d2 = document.getElementById("sf-issue-name");
|
|
1486
1510
|
d2 && d2.addEventListener("input", () => {
|
|
1487
|
-
|
|
1511
|
+
pe.issueName = d2.value;
|
|
1488
1512
|
});
|
|
1489
1513
|
bindEngTicketListeners(), t3 && (t3.onclick = () => {
|
|
1490
1514
|
const e4 = document.getElementById("sf-issue-description");
|
|
1491
|
-
e4 && (
|
|
1515
|
+
e4 && (pe.description = e4.value), (function startCountdownThenRecord() {
|
|
1492
1516
|
if (document.getElementById("sf-countdown-overlay")) return;
|
|
1493
1517
|
const e5 = document.createElement("div");
|
|
1494
1518
|
e5.id = "sf-countdown-overlay", e5.style.cssText = "\n position: fixed;\n inset: 0;\n background: rgba(0,0,0,0.6);\n z-index: 10001;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 80px;\n font-weight: bold;\n color: white;\n font-family: sans-serif;\n ";
|
|
@@ -1498,10 +1522,10 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1498
1522
|
if (t4--, t4 > 0) e5.textContent = t4.toString();
|
|
1499
1523
|
else {
|
|
1500
1524
|
clearInterval(n3), document.body.removeChild(e5), (function setRecordingStartTime(e6) {
|
|
1501
|
-
|
|
1525
|
+
fe = e6;
|
|
1502
1526
|
})(Date.now()), setIsRecording(true);
|
|
1503
1527
|
try {
|
|
1504
|
-
const { enableFunctionSpanTracking: e6 } = await Promise.resolve().then(() =>
|
|
1528
|
+
const { enableFunctionSpanTracking: e6 } = await Promise.resolve().then(() => O);
|
|
1505
1529
|
e6();
|
|
1506
1530
|
} catch (e6) {
|
|
1507
1531
|
console.error("[Report Issue] Failed to enable function span tracking:", e6);
|
|
@@ -1528,7 +1552,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1528
1552
|
const t5 = e6.querySelector("#sf-recording-timer");
|
|
1529
1553
|
if (!t5) return;
|
|
1530
1554
|
const n4 = setInterval(() => {
|
|
1531
|
-
const e7 = Date.now() - (
|
|
1555
|
+
const e7 = Date.now() - (fe ?? Date.now()), n5 = Math.floor(e7 / 6e4).toString().padStart(2, "0"), i3 = Math.floor(e7 % 6e4 / 1e3).toString().padStart(2, "0");
|
|
1532
1556
|
t5.textContent = `${n5}:${i3}`;
|
|
1533
1557
|
}, 1e3);
|
|
1534
1558
|
setTimerInterval(n4);
|
|
@@ -1537,84 +1561,96 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1537
1561
|
}, 1e3);
|
|
1538
1562
|
})();
|
|
1539
1563
|
});
|
|
1540
|
-
|
|
1564
|
+
we == null ? void 0 : we.addEventListener("click", (e4) => {
|
|
1541
1565
|
var _a;
|
|
1542
1566
|
if (e4.target.closest("#sf-issue-submit-btn")) {
|
|
1543
|
-
const e5 = ((_a = document.getElementById("sf-issue-description")) == null ? void 0 : _a.value) || "", t4 =
|
|
1544
|
-
if (
|
|
1567
|
+
const e5 = ((_a = document.getElementById("sf-issue-description")) == null ? void 0 : _a.value) || "", t4 = pe.mode;
|
|
1568
|
+
if (pe.description = e5, pe.createIssue && !pe.issueName.trim()) return void alert("Issue title is required when creating an issue.");
|
|
1545
1569
|
let n3, i3;
|
|
1546
|
-
if ("startnow" === t4) n3 =
|
|
1570
|
+
if ("startnow" === t4) n3 = fe ?? Date.now() - 3e5, i3 = ge ?? Date.now();
|
|
1547
1571
|
else {
|
|
1548
1572
|
const e6 = 60 * Number((o2 == null ? void 0 : o2.value) || "2") * 1e3;
|
|
1549
1573
|
i3 = Date.now(), n3 = i3 - e6;
|
|
1550
1574
|
}
|
|
1551
|
-
if (
|
|
1552
|
-
const t5 = document.getElementById("sf-issue-name"), o3 = document.getElementById("sf-eng-ticket-team"), s3 = document.getElementById("sf-eng-ticket-project"), a3 = document.getElementById("sf-eng-ticket-priority"), r3 = document.getElementById("sf-eng-ticket-type"), l3 = (t5 == null ? void 0 : t5.value) || "", c3 = e5, d3 = (o3 == null ? void 0 : o3.value) || "", u2 = (s3 == null ? void 0 : s3.value) || "", p2 = a3 ? Number(a3.value) : 0, f2 =
|
|
1575
|
+
if (pe.createIssue) {
|
|
1576
|
+
const t5 = document.getElementById("sf-issue-name"), o3 = document.getElementById("sf-eng-ticket-team"), s3 = document.getElementById("sf-eng-ticket-project"), a3 = document.getElementById("sf-eng-ticket-priority"), r3 = document.getElementById("sf-eng-ticket-type"), l3 = (t5 == null ? void 0 : t5.value) || "", c3 = e5, d3 = (o3 == null ? void 0 : o3.value) || "", u2 = (s3 == null ? void 0 : s3.value) || "", p2 = a3 ? Number(a3.value) : 0, f2 = pe.engTicketLabels, g2 = (r3 == null ? void 0 : r3.value) || "", m2 = { ...pe.engTicketCustomFields };
|
|
1553
1577
|
document.querySelectorAll(".sf-dynamic-field").forEach((e6) => {
|
|
1554
1578
|
const t6 = e6, n4 = t6.dataset.fieldId;
|
|
1555
1579
|
n4 && ("checkbox" === t6.type ? m2[n4] = t6.checked : "number" === t6.type ? m2[n4] = parseFloat(t6.value) || null : t6.classList.contains("sf-custom-multiselect") || (m2[n4] = t6.value));
|
|
1556
1580
|
});
|
|
1557
|
-
const h2 = document.getElementById("sf-eng-ticket-sprint"), y2 = (h2 == null ? void 0 : h2.value) ||
|
|
1581
|
+
const h2 = document.getElementById("sf-eng-ticket-sprint"), y2 = (h2 == null ? void 0 : h2.value) || pe.engTicketSprint;
|
|
1558
1582
|
if (y2) {
|
|
1559
1583
|
const e6 = getSprintFieldId();
|
|
1560
1584
|
m2[e6] = parseInt(y2, 10);
|
|
1561
1585
|
}
|
|
1562
1586
|
closeModal(), (async function createTriageAndIssue(e6, t6, n4, i4, o4, s4, a4, r4, l4, c4, d4, u3) {
|
|
1563
|
-
var _a2, _b;
|
|
1587
|
+
var _a2, _b, _c;
|
|
1564
1588
|
try {
|
|
1565
1589
|
showStatusModal(true);
|
|
1566
|
-
const p3 = await createTriageAndIssueFromRecorder(
|
|
1567
|
-
|
|
1590
|
+
const p3 = await createTriageAndIssueFromRecorder(be.apiKey, be.backendApi, getSessionIdSafely(), e6, t6, n4, i4, o4, s4, a4, r4, l4, c4, d4, u3);
|
|
1591
|
+
if ((_a2 = p3 == null ? void 0 : p3.errors) == null ? void 0 : _a2.length) {
|
|
1592
|
+
const e7 = p3.errors.map((e8) => e8.message).join("; ");
|
|
1593
|
+
return console.error("GraphQL error creating triage and issue:", e7), void showStatusModal(false, null, e7);
|
|
1594
|
+
}
|
|
1595
|
+
const f3 = (_c = (_b = p3 == null ? void 0 : p3.data) == null ? void 0 : _b.createTriageAndIssueFromRecorder) == null ? void 0 : _c.id;
|
|
1596
|
+
f3 ? showStatusModal(false, { type: "issue", id: f3 }) : (console.error("No Issue ID returned from backend."), showStatusModal(false, null, "No issue was created. Please try again."));
|
|
1568
1597
|
} catch (e7) {
|
|
1569
|
-
console.error("Error creating triage and issue:", e7), showStatusModal(false, null);
|
|
1598
|
+
console.error("Error creating triage and issue:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
|
|
1570
1599
|
}
|
|
1571
|
-
})(`${n3}`, `${i3}`, e5, l3, c3,
|
|
1600
|
+
})(`${n3}`, `${i3}`, e5, l3, c3, pe.createEngTicket, d3, u2, p2, f2, g2, m2);
|
|
1572
1601
|
} else closeModal(), (async function createTriage(e6, t5, n4) {
|
|
1573
|
-
var _a2, _b;
|
|
1602
|
+
var _a2, _b, _c;
|
|
1574
1603
|
try {
|
|
1575
1604
|
showStatusModal(true);
|
|
1576
|
-
const i4 = await createTriageFromRecorder(
|
|
1577
|
-
|
|
1605
|
+
const i4 = await createTriageFromRecorder(be.apiKey, be.backendApi, getSessionIdSafely(), e6, t5, n4);
|
|
1606
|
+
if ((_a2 = i4 == null ? void 0 : i4.errors) == null ? void 0 : _a2.length) {
|
|
1607
|
+
const e7 = i4.errors.map((e8) => e8.message).join("; ");
|
|
1608
|
+
return console.error("GraphQL error creating triage:", e7), void showStatusModal(false, null, e7);
|
|
1609
|
+
}
|
|
1610
|
+
const o3 = (_c = (_b = i4 == null ? void 0 : i4.data) == null ? void 0 : _b.createTriageFromRecorder) == null ? void 0 : _c.id;
|
|
1611
|
+
o3 ? showStatusModal(false, { type: "triage", id: o3 }) : (console.error("No Triage ID returned from backend."), showStatusModal(false, null, "No triage was created. Please try again."));
|
|
1578
1612
|
} catch (e7) {
|
|
1579
|
-
console.error("Error creating triage:", e7), showStatusModal(false, null);
|
|
1613
|
+
console.error("Error creating triage:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
|
|
1580
1614
|
}
|
|
1581
1615
|
})(`${n3}`, `${i3}`, e5);
|
|
1582
1616
|
}
|
|
1583
1617
|
});
|
|
1584
|
-
})(),
|
|
1618
|
+
})(), be.deactivateIsolation = activateModalIsolation(we), be.integrationData && pe.createEngTicket ? initializeEngTicketForm() : be.integrationData || (pe.createEngTicket = false), be.apiKey && be.backendApi && refreshIntegrationData(be.apiKey, be.backendApi).then((e3) => {
|
|
1585
1619
|
if (!e3 || !document.getElementById("sf-report-issue-modal")) return;
|
|
1586
|
-
|
|
1620
|
+
be.integrationData = e3;
|
|
1587
1621
|
const t3 = document.getElementById("sf-eng-ticket-fields-container");
|
|
1588
1622
|
if (t3) {
|
|
1589
1623
|
const e4 = generateEngTicketFieldsHTML();
|
|
1590
|
-
e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(
|
|
1624
|
+
e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(pe), renderDynamicFields(pe.engTicketProject, pe.engTicketIssueType));
|
|
1625
|
+
}
|
|
1626
|
+
if (ve) {
|
|
1627
|
+
const e4 = document.getElementById("sf-create-eng-ticket-label");
|
|
1628
|
+
e4 && (e4.style.display = "flex");
|
|
1591
1629
|
}
|
|
1592
|
-
const n2 = document.getElementById("sf-create-eng-ticket-label");
|
|
1593
|
-
n2 && (n2.style.display = "flex");
|
|
1594
1630
|
});
|
|
1595
1631
|
}
|
|
1596
1632
|
function initializeEngTicketForm() {
|
|
1597
1633
|
var _a;
|
|
1598
|
-
const e2 =
|
|
1634
|
+
const e2 = be.integrationData;
|
|
1599
1635
|
if (e2) {
|
|
1600
|
-
if (!
|
|
1601
|
-
getFieldsForProject(
|
|
1636
|
+
if (!pe.engTicketTeam && e2.defaultTeam && (pe.engTicketTeam = e2.defaultTeam), !pe.engTicketProject && e2.defaultProject && (pe.engTicketProject = e2.defaultProject), !pe.engTicketPriority && e2.defaultPriority && (pe.engTicketPriority = e2.defaultPriority), updateFormWithIntegrationData(pe), "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase()) && e2.jiraReporterAccountId && pe.engTicketProject) {
|
|
1637
|
+
getFieldsForProject(pe.engTicketProject, pe.engTicketIssueType).find((e3) => "reporter" === e3.fieldId) && !pe.engTicketCustomFields.reporter && (pe.engTicketCustomFields.reporter = e2.jiraReporterAccountId);
|
|
1602
1638
|
}
|
|
1603
|
-
|
|
1639
|
+
pe.engTicketProject && renderDynamicFields(pe.engTicketProject, pe.engTicketIssueType);
|
|
1604
1640
|
}
|
|
1605
1641
|
}
|
|
1606
1642
|
function setActiveTab(e2) {
|
|
1607
|
-
|
|
1608
|
-
const t2 =
|
|
1643
|
+
pe.mode = e2;
|
|
1644
|
+
const t2 = we == null ? void 0 : we.querySelector("#sf-tab-lookback"), n2 = we == null ? void 0 : we.querySelector("#sf-tab-startnow");
|
|
1609
1645
|
"lookback" === e2 ? (t2.style.background = "white", t2.style.color = "#0F172A", n2.style.background = "transparent", n2.style.color = "#64748B") : (n2.style.background = "white", n2.style.color = "#0F172A", t2.style.background = "transparent", t2.style.color = "#64748B");
|
|
1610
1646
|
}
|
|
1611
1647
|
function updateModeSpecificUI(e2) {
|
|
1612
1648
|
const t2 = document.querySelector("#sf-issue-mode-info div"), n2 = document.getElementById("sf-issue-submit-btn"), i2 = document.getElementById("sf-record-button-container"), o2 = document.getElementById("sf-recording-timer-label"), s2 = document.getElementById("sf-recording-timer-display"), a2 = document.getElementById("sf-modal-footer"), r2 = document.getElementById("sf-lookback-container");
|
|
1613
1649
|
if (t2 && n2 && i2 && o2 && s2 && a2 && r2) if ("startnow" === e2) {
|
|
1614
1650
|
i2.style.display = "block", r2.style.display = "none", a2.style.justifyContent = "space-between", t2.textContent = "I want to reproduce the issue right now.";
|
|
1615
|
-
const e3 = null !==
|
|
1616
|
-
if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed",
|
|
1617
|
-
const e4 = Math.floor((
|
|
1651
|
+
const e3 = null !== fe && null !== ge;
|
|
1652
|
+
if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed", fe && ge) {
|
|
1653
|
+
const e4 = Math.floor((ge - fe) / 1e3), t3 = String(Math.floor(e4 / 60)).padStart(2, "0"), n3 = String(e4 % 60).padStart(2, "0");
|
|
1618
1654
|
o2.style.display = "block", s2.textContent = `${t3}:${n3}`;
|
|
1619
1655
|
} else o2.style.display = "none";
|
|
1620
1656
|
} else i2.style.display = "none", o2.style.display = "none", r2.style.display = "block", a2.style.justifyContent = "flex-end", t2.textContent = "Something already happened. Capture the past few minutes.", n2.disabled = false, n2.style.opacity = "1", n2.style.cursor = "pointer";
|
|
@@ -1622,10 +1658,10 @@ function updateModeSpecificUI(e2) {
|
|
|
1622
1658
|
function bindEngTicketListeners() {
|
|
1623
1659
|
const e2 = document.getElementById("sf-eng-ticket-team"), t2 = document.getElementById("sf-eng-ticket-project"), n2 = document.getElementById("sf-eng-ticket-priority"), i2 = document.getElementById("sf-eng-ticket-labels-container"), o2 = document.getElementById("sf-eng-ticket-type"), s2 = document.getElementById("sf-eng-ticket-sprint");
|
|
1624
1660
|
e2 && e2.addEventListener("change", () => {
|
|
1625
|
-
|
|
1661
|
+
pe.engTicketTeam = e2.value, e2.style.color = e2.value ? "" : "#9ca3af";
|
|
1626
1662
|
const t3 = document.getElementById("sf-eng-ticket-project");
|
|
1627
1663
|
if (t3) {
|
|
1628
|
-
|
|
1664
|
+
pe.engTicketProject = "", pe.engTicketCustomFields = {};
|
|
1629
1665
|
const n3 = getProjectsForTeam(e2.value);
|
|
1630
1666
|
t3.innerHTML = '<option value="">Select project...</option>', n3.forEach((e3) => {
|
|
1631
1667
|
const n4 = document.createElement("option");
|
|
@@ -1634,24 +1670,24 @@ function bindEngTicketListeners() {
|
|
|
1634
1670
|
}
|
|
1635
1671
|
}), t2 && t2.addEventListener("change", () => {
|
|
1636
1672
|
var _a;
|
|
1637
|
-
|
|
1673
|
+
pe.engTicketProject = t2.value, t2.style.color = t2.value ? "" : "#9ca3af", pe.engTicketCustomFields = {};
|
|
1638
1674
|
const e3 = getIntegrationData();
|
|
1639
|
-
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value),
|
|
1640
|
-
getFieldsForProject(t2.value,
|
|
1675
|
+
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value), pe.engTicketIssueType = o2.value), e3 && "jira" === ((_a = e3.provider) == null ? void 0 : _a.toLowerCase()) && e3.jiraReporterAccountId && t2.value) {
|
|
1676
|
+
getFieldsForProject(t2.value, pe.engTicketIssueType).find((e4) => "reporter" === e4.fieldId) && (pe.engTicketCustomFields.reporter = e3.jiraReporterAccountId);
|
|
1641
1677
|
}
|
|
1642
|
-
renderDynamicFields(t2.value,
|
|
1678
|
+
renderDynamicFields(t2.value, pe.engTicketIssueType);
|
|
1643
1679
|
}), s2 && s2.addEventListener("change", () => {
|
|
1644
|
-
|
|
1680
|
+
pe.engTicketSprint = s2.value, s2.style.color = s2.value ? "" : "#9ca3af";
|
|
1645
1681
|
}), n2 && n2.addEventListener("change", () => {
|
|
1646
|
-
|
|
1682
|
+
pe.engTicketPriority = Number(n2.value);
|
|
1647
1683
|
}), i2 && setupCustomMultiSelectListeners("sf-eng-ticket-labels", (e3) => {
|
|
1648
|
-
|
|
1684
|
+
pe.engTicketLabels = e3;
|
|
1649
1685
|
}), o2 && o2.addEventListener("change", () => {
|
|
1650
|
-
|
|
1686
|
+
pe.engTicketIssueType = o2.value, o2.style.color = o2.value ? "" : "#9ca3af";
|
|
1651
1687
|
const e3 = document.getElementById("sf-eng-ticket-project");
|
|
1652
1688
|
if (e3 && e3.value) {
|
|
1653
|
-
const t3 =
|
|
1654
|
-
|
|
1689
|
+
const t3 = pe.engTicketCustomFields.reporter;
|
|
1690
|
+
pe.engTicketCustomFields = {}, t3 && (pe.engTicketCustomFields.reporter = t3), renderDynamicFields(e3.value, o2.value);
|
|
1655
1691
|
}
|
|
1656
1692
|
});
|
|
1657
1693
|
const a2 = document.getElementById("sf-dynamic-fields-container");
|
|
@@ -1659,13 +1695,13 @@ function bindEngTicketListeners() {
|
|
|
1659
1695
|
const t3 = e3.target;
|
|
1660
1696
|
if (t3.classList.contains("sf-dynamic-field")) {
|
|
1661
1697
|
const e4 = t3.dataset.fieldId;
|
|
1662
|
-
e4 && ("checkbox" === t3.type ?
|
|
1698
|
+
e4 && ("checkbox" === t3.type ? pe.engTicketCustomFields[e4] = t3.checked : "number" === t3.type ? pe.engTicketCustomFields[e4] = parseFloat(t3.value) || null : pe.engTicketCustomFields[e4] = t3.value);
|
|
1663
1699
|
}
|
|
1664
1700
|
}), a2.addEventListener("change", (e3) => {
|
|
1665
1701
|
const t3 = e3.target;
|
|
1666
1702
|
if (t3.classList.contains("sf-dynamic-field")) {
|
|
1667
1703
|
const e4 = t3.dataset.fieldId;
|
|
1668
|
-
if (e4 && (
|
|
1704
|
+
if (e4 && (pe.engTicketCustomFields[e4] = t3.value), "SELECT" === t3.tagName) {
|
|
1669
1705
|
const e5 = t3;
|
|
1670
1706
|
e5.style.color = e5.value ? "" : "#9ca3af";
|
|
1671
1707
|
}
|
|
@@ -1675,10 +1711,10 @@ function bindEngTicketListeners() {
|
|
|
1675
1711
|
async function stopRecording() {
|
|
1676
1712
|
var _a;
|
|
1677
1713
|
!(function setRecordingEndTime(e2) {
|
|
1678
|
-
|
|
1679
|
-
})(Date.now()), setIsRecording(false),
|
|
1714
|
+
ge = e2;
|
|
1715
|
+
})(Date.now()), setIsRecording(false), me && (clearInterval(me), setTimerInterval(null)), (_a = document.getElementById("sf-recording-indicator")) == null ? void 0 : _a.remove();
|
|
1680
1716
|
try {
|
|
1681
|
-
const { disableFunctionSpanTracking: e2 } = await Promise.resolve().then(() =>
|
|
1717
|
+
const { disableFunctionSpanTracking: e2 } = await Promise.resolve().then(() => O);
|
|
1682
1718
|
e2();
|
|
1683
1719
|
} catch (e2) {
|
|
1684
1720
|
console.error("[Report Issue] Failed to disable function span tracking:", e2);
|
|
@@ -1691,40 +1727,40 @@ async function stopRecording() {
|
|
|
1691
1727
|
t3 && (t3.textContent = "Re-record");
|
|
1692
1728
|
}
|
|
1693
1729
|
const t2 = document.getElementById("sf-recording-timer-label"), n2 = document.getElementById("sf-recording-timer-display");
|
|
1694
|
-
if (t2 && n2 &&
|
|
1695
|
-
const e3 = Math.floor((
|
|
1730
|
+
if (t2 && n2 && fe && ge) {
|
|
1731
|
+
const e3 = Math.floor((ge - fe) / 1e3), i3 = Math.floor(e3 / 60).toString().padStart(2, "0"), o3 = (e3 % 60).toString().padStart(2, "0");
|
|
1696
1732
|
n2.textContent = `${i3}:${o3}`, t2.style.display = "block";
|
|
1697
1733
|
}
|
|
1698
1734
|
const i2 = document.getElementById("sf-issue-description");
|
|
1699
|
-
i2 && (i2.value =
|
|
1735
|
+
i2 && (i2.value = pe.description);
|
|
1700
1736
|
const o2 = document.querySelector('input[value="startnow"]');
|
|
1701
1737
|
o2 && (o2.checked = true);
|
|
1702
1738
|
const s2 = document.getElementById("sf-inline-record-chip"), a2 = document.getElementById("sf-inline-record-timer");
|
|
1703
1739
|
if (s2 && a2) {
|
|
1704
|
-
const e3 = Math.floor(((
|
|
1740
|
+
const e3 = Math.floor(((ge ?? 0) - (fe ?? 0)) / 1e3), t3 = Math.floor(e3 / 60).toString().padStart(2, "0"), n3 = Math.floor(e3 % 60).toString().padStart(2, "0");
|
|
1705
1741
|
a2.textContent = `${t3}:${n3}`, a2.style.color = "black", s2.style.display = "flex";
|
|
1706
1742
|
}
|
|
1707
1743
|
const r2 = document.getElementById("sf-issue-submit-btn");
|
|
1708
1744
|
r2.disabled = false, r2.style.opacity = "1", r2.style.cursor = "pointer";
|
|
1709
1745
|
})();
|
|
1710
1746
|
}
|
|
1711
|
-
function showStatusModal(e2, t2) {
|
|
1712
|
-
!(function showTriageStatusModal(e3, t3,
|
|
1747
|
+
function showStatusModal(e2, t2, n2) {
|
|
1748
|
+
!(function showTriageStatusModal(e3, t3, n3, i2) {
|
|
1713
1749
|
var _a;
|
|
1714
1750
|
!(function removeExistingModals() {
|
|
1715
1751
|
var _a2, _b;
|
|
1716
1752
|
(_a2 = document.getElementById("sf-report-issue-modal")) == null ? void 0 : _a2.remove(), (_b = document.getElementById("sf-triage-status-modal")) == null ? void 0 : _b.remove();
|
|
1717
1753
|
})();
|
|
1718
|
-
const i2 =
|
|
1719
|
-
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1754
|
+
const o2 = !e3 && i2, s2 = n3 ? `${be.triageBaseUrl}/issues/${n3}?from=inAppReportIssue` : t3 ? `${be.triageBaseUrl}/triage/${t3}?from=inAppReportIssue` : "", a2 = document.createElement("div");
|
|
1755
|
+
a2.id = "sf-triage-status-modal", Object.assign(a2.style, { position: "fixed", inset: "0", zIndex: "9998", display: "flex", alignItems: "center", justifyContent: "center" });
|
|
1756
|
+
const r2 = e3 ? "Reporting Issue..." : o2 ? "Failed to report issue" : "Issue reported!", l2 = e3 ? '<p style="font-size:14px; color:#64748b; line-height:20px;">This may take ~10 seconds</p>' : o2 ? `<p style="font-size:14px; color:#ef4444; line-height:20px;">${i2}</p>` : "", c2 = e3 ? '<div style="display:flex; justify-content:center; align-items:center; padding: 40px 0;">\n <div style="width:24px; height:24px; border:2px solid #295dbf; border-top:2px solid white; border-radius:50%; animation:spin 1s linear infinite;"></div>\n </div>' : "", d2 = e3 ? "" : '<div id="sf-copied-status" style="display:none; font-size:12px; font-weight:500; color:white;\n background-color:#22c55e; padding:4px 8px; border-radius:6px; white-space:nowrap; align-items:center; gap:6px;">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M21 7.5L9 19.5L3 13.5L5.25 11.25L9 15L18.75 5.25L21 7.5Z" fill="white"/>\n </svg>\n Copied\n </div>';
|
|
1757
|
+
a2.innerHTML = `
|
|
1722
1758
|
<div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
|
|
1723
1759
|
<div id="sf-triage-card"
|
|
1724
1760
|
style="position:relative; background:#fff; padding:24px; border-radius:12px; width:300px; max-width:90%;
|
|
1725
1761
|
font-family:sans-serif; box-shadow:0 4px 20px rgba(0,0,0,0.15);
|
|
1726
1762
|
z-index:9999; opacity:1; transition:opacity 300ms ease;">
|
|
1727
|
-
<div style="position:absolute; top:24px; right:48px;">${
|
|
1763
|
+
<div style="position:absolute; top:24px; right:48px;">${d2}</div>
|
|
1728
1764
|
|
|
1729
1765
|
<button id="sf-triage-modal-close"
|
|
1730
1766
|
style="position:absolute; top:24px; right:16px; background:none; border:none; cursor:pointer;">
|
|
@@ -1734,11 +1770,11 @@ function showStatusModal(e2, t2) {
|
|
|
1734
1770
|
</svg>
|
|
1735
1771
|
</button>
|
|
1736
1772
|
|
|
1737
|
-
<h2 style="font-size:18px; font-weight:600; margin-bottom:${e3 ? 8 : 40}px; line-height:28px;">${
|
|
1738
|
-
${
|
|
1739
|
-
${
|
|
1773
|
+
<h2 style="font-size:18px; font-weight:600; margin-bottom:${e3 || o2 ? 8 : 40}px; line-height:28px;">${r2}</h2>
|
|
1774
|
+
${l2}
|
|
1775
|
+
${c2}
|
|
1740
1776
|
|
|
1741
|
-
<div style="display:flex; justify-content:flex-end; align-items:center; gap:8px;">
|
|
1777
|
+
<div style="display:${o2 ? "none" : "flex"}; justify-content:flex-end; align-items:center; gap:8px;">
|
|
1742
1778
|
<button id="sf-copy-triage-link"
|
|
1743
1779
|
style="background:white; border:1px solid #e2e8f0; padding:8px 16px; border-radius:6px;
|
|
1744
1780
|
font-size:14px; color: #0f172a; cursor:pointer;">
|
|
@@ -1759,28 +1795,28 @@ function showStatusModal(e2, t2) {
|
|
|
1759
1795
|
<style>
|
|
1760
1796
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
1761
1797
|
</style>
|
|
1762
|
-
`, document.body.appendChild(
|
|
1763
|
-
const
|
|
1798
|
+
`, document.body.appendChild(a2);
|
|
1799
|
+
const u2 = a2.querySelector("#sf-triage-card");
|
|
1764
1800
|
(_a = document.getElementById("sf-triage-modal-close")) == null ? void 0 : _a.addEventListener("click", () => {
|
|
1765
|
-
fadeCardAndRemove(
|
|
1801
|
+
fadeCardAndRemove(a2, u2, 300);
|
|
1766
1802
|
});
|
|
1767
|
-
const
|
|
1768
|
-
e3 ? (
|
|
1769
|
-
navigator.clipboard.writeText(
|
|
1803
|
+
const p2 = document.getElementById("sf-copy-triage-link"), f2 = document.getElementById("sf-view-triage-btn");
|
|
1804
|
+
e3 ? (p2.disabled = true, p2.style.opacity = "0.4", p2.style.cursor = "not-allowed", f2.disabled = true, f2.style.opacity = "0.4", f2.style.cursor = "not-allowed") : (p2.disabled = false, p2.addEventListener("click", () => {
|
|
1805
|
+
navigator.clipboard.writeText(s2).then(() => {
|
|
1770
1806
|
const e4 = document.getElementById("sf-copied-status");
|
|
1771
1807
|
e4 && (e4.style.display = "flex");
|
|
1772
1808
|
});
|
|
1773
|
-
}),
|
|
1774
|
-
(t3 ||
|
|
1775
|
-
}), setTimeout(() => fadeCardAndRemove(
|
|
1776
|
-
})(e2, "triage" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, "issue" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0);
|
|
1809
|
+
}), f2.disabled = false, f2.addEventListener("click", () => {
|
|
1810
|
+
(t3 || n3) && window.open(s2, "_blank");
|
|
1811
|
+
}), o2 || setTimeout(() => fadeCardAndRemove(a2, u2, 300), 1e4));
|
|
1812
|
+
})(e2, "triage" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, "issue" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, n2);
|
|
1777
1813
|
}
|
|
1778
1814
|
function fadeCardAndRemove(e2, t2, n2 = 300) {
|
|
1779
1815
|
t2.style.opacity = "0", t2.addEventListener("transitionend", () => e2.remove(), { once: true }), setTimeout(() => e2.remove(), n2 + 100);
|
|
1780
1816
|
}
|
|
1781
|
-
const
|
|
1782
|
-
|
|
1783
|
-
const t3 = { ...
|
|
1817
|
+
const Se = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueContext: be, openReportIssueModal, setupIssueReporting: function setupIssueReporting(e2) {
|
|
1818
|
+
be.apiKey = e2.apiKey, be.backendApi = e2.backendApi, be.resolveSessionId = e2.getSessionId, be.integrationData = e2.integrationData || null, be.showEngTicketFieldsDefault = e2.showEngTicketFieldsInReportIssueModalDefault ?? false, e2.customBaseUrl && (be.triageBaseUrl = e2.customBaseUrl), be.shortcuts = (function mergeShortcutsConfig(e3) {
|
|
1819
|
+
const t3 = { ...ye };
|
|
1784
1820
|
if (!e3) return t3;
|
|
1785
1821
|
"boolean" == typeof e3.enabled && (t3.enabled = e3.enabled);
|
|
1786
1822
|
const n2 = ["openModalExistingMode", "openModalCaptureNewMode", "closeModal", "submitReport", "startRecording", "stopRecording"];
|
|
@@ -1790,7 +1826,7 @@ const be = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueCon
|
|
|
1790
1826
|
}
|
|
1791
1827
|
return t3;
|
|
1792
1828
|
})(e2.shortcuts);
|
|
1793
|
-
const { shortcuts: t2 } =
|
|
1829
|
+
const { shortcuts: t2 } = be;
|
|
1794
1830
|
window.addEventListener("keydown", (e3) => {
|
|
1795
1831
|
const n2 = (function isTypingInInput() {
|
|
1796
1832
|
const e4 = document.activeElement;
|
|
@@ -1800,26 +1836,26 @@ const be = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueCon
|
|
|
1800
1836
|
} : injectModalHTML;
|
|
1801
1837
|
if (a2 && shortcutUsed("openModalExistingMode")) return e3.preventDefault(), void r2("lookback");
|
|
1802
1838
|
if (a2 && shortcutUsed("openModalCaptureNewMode")) return e3.preventDefault(), void r2("startnow");
|
|
1803
|
-
if (s2 && !
|
|
1839
|
+
if (s2 && !he && shortcutUsed("closeModal")) return e3.preventDefault(), void closeModal();
|
|
1804
1840
|
if (s2 && shortcutUsed("submitReport")) {
|
|
1805
1841
|
const t3 = document.getElementById("sf-issue-submit-btn");
|
|
1806
1842
|
return void (t3 && !t3.disabled && (e3.preventDefault(), t3.click()));
|
|
1807
1843
|
}
|
|
1808
|
-
if (
|
|
1809
|
-
if (s2 && "startnow" ===
|
|
1844
|
+
if (he && i2 === t2.stopRecording.key && o2 === t2.stopRecording.requireCmdCtrl) return e3.preventDefault(), void stopRecording();
|
|
1845
|
+
if (s2 && "startnow" === pe.mode && i2 === t2.startRecording.key && o2 === t2.startRecording.requireCmdCtrl && !n2) {
|
|
1810
1846
|
const t3 = document.getElementById("sf-start-recording-btn");
|
|
1811
1847
|
return void (t3 && (e3.preventDefault(), t3.click()));
|
|
1812
1848
|
}
|
|
1813
1849
|
});
|
|
1814
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
1850
|
+
} }, Symbol.toStringTag, { value: "Module" })), ke = readDebugFlag(), xe = /* @__PURE__ */ new Map();
|
|
1815
1851
|
function getCachedRegex(e2, t2) {
|
|
1816
1852
|
const n2 = `${e2}|${t2}`;
|
|
1817
|
-
let i2 =
|
|
1818
|
-
return i2 || (i2 = new RegExp(e2, t2),
|
|
1853
|
+
let i2 = xe.get(n2);
|
|
1854
|
+
return i2 || (i2 = new RegExp(e2, t2), xe.set(n2, i2)), i2;
|
|
1819
1855
|
}
|
|
1820
|
-
const
|
|
1856
|
+
const Ie = new Set([".js", ".mjs", ".cjs", ".ts", ".css", ".scss", ".sass", ".less", ".styl", ".stylus", ".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".avif", ".bmp", ".ico", ".tiff", ".tif", ".heic", ".woff", ".woff2", ".ttf", ".otf", ".eot", ".mp4", ".webm", ".ogv", ".mp3", ".wav", ".flac", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".csv", ".json", ".xml", ".txt", ".zip", ".rar", ".gz", ".tar", ".7z", ".map", ".webmanifest"].map((e2) => e2.toLowerCase())), Te = ["t.co", "*.twitter.com", "*.gravatar.com", "*.googleapis.com", "*.amazonaws.com", "*.smooch.io", "*.zendesk.com", "*.zdassets.com"], Ee = [400, 403], Ce = "CORS", $e = 1, Fe = "authorization", Me = "Authorization", Le = { recordCanvas: false, recordCrossOriginIframes: false, collectFonts: false, inlineImages: false, recordPassword: false, recordRealName: true, recordCreditCardInfo: false, recordSsn: false, recordDob: false, sampling: {}, enableFiberTracking: false }, Ae = { level: ["info", "log", "warn", "error"], lengthThreshold: 1e4, stringifyOptions: { stringLengthLimit: 1e3, numOfKeysLimit: 20, depthOfLimit: 4 }, logger: "console" };
|
|
1821
1857
|
function maskAuthorizationHeader(e2) {
|
|
1822
|
-
const t2 = e2[
|
|
1858
|
+
const t2 = e2[Fe] ? Fe : e2[Me] ? Me : null;
|
|
1823
1859
|
if (!t2) return;
|
|
1824
1860
|
const n2 = e2[t2], i2 = n2.indexOf(" ");
|
|
1825
1861
|
if (-1 !== i2) {
|
|
@@ -1835,7 +1871,7 @@ function trackDomainChangesOnce() {
|
|
|
1835
1871
|
const n3 = window.location.href.split("?")[0];
|
|
1836
1872
|
if (e3 || n3 !== t2) {
|
|
1837
1873
|
t2 = n3;
|
|
1838
|
-
const e4 = uuidv4(), i2 = sessionStorage.getItem("pageVisitUUID");
|
|
1874
|
+
const e4 = uuidv4(), i2 = sessionStorage.getItem("pageVisitUUID") ?? "";
|
|
1839
1875
|
sessionStorage.setItem("pageVisitUUID", e4), sessionStorage.setItem("prevPageVisitUUID", i2), invalidateUrlCache();
|
|
1840
1876
|
sendMessage({ type: "routeChange", data: { url: n3, timestamp: Date.now(), page_visit_uuid: e4, prev_page_visit_uuid: i2 } });
|
|
1841
1877
|
}
|
|
@@ -1845,7 +1881,7 @@ function trackDomainChangesOnce() {
|
|
|
1845
1881
|
clearTimeout(n3), n3 = setTimeout(() => e3(...i2), t3);
|
|
1846
1882
|
};
|
|
1847
1883
|
})(() => checkDomainChange(), 500);
|
|
1848
|
-
checkDomainChange(true), e2.routeWatcherIntervalId = window.setInterval(n2, 1e3);
|
|
1884
|
+
onNavigationChange(() => checkDomainChange()), checkDomainChange(true), e2.routeWatcherIntervalId = window.setInterval(n2, 1e3);
|
|
1849
1885
|
}
|
|
1850
1886
|
function sendUserDeviceUuid() {
|
|
1851
1887
|
sendMessage({ type: "userDeviceUuid", userDeviceUuid: (function getOrSetUserDeviceUuid() {
|
|
@@ -1868,7 +1904,7 @@ function handleVisibilityChange() {
|
|
|
1868
1904
|
const e2 = document.visibilityState, t2 = Date.now();
|
|
1869
1905
|
"visible" === e2 && getOrSetSessionId();
|
|
1870
1906
|
try {
|
|
1871
|
-
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }),
|
|
1907
|
+
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }), ke && console.log(`[Sailfish] Tab became ${e2}, sent visibility change event`);
|
|
1872
1908
|
} catch (e3) {
|
|
1873
1909
|
console.warn("[Sailfish] Failed to send visibility change event:", e3);
|
|
1874
1910
|
}
|
|
@@ -1877,10 +1913,10 @@ function handleVisibilityChange() {
|
|
|
1877
1913
|
function clearPageVisitDataFromSessionStorage() {
|
|
1878
1914
|
m && (sessionStorage.removeItem("pageVisitUUID"), sessionStorage.removeItem("prevPageVisitUUID"), sessionStorage.removeItem("tabVisibilityChanged"), sessionStorage.removeItem("tabVisibilityState"), invalidateUrlCache());
|
|
1879
1915
|
}
|
|
1880
|
-
let
|
|
1916
|
+
let De = false;
|
|
1881
1917
|
function _ensureModuleSideEffects() {
|
|
1882
|
-
|
|
1883
|
-
|
|
1918
|
+
De || (De = true, restoreFuncSpanState(), (function ensureSessionListeners() {
|
|
1919
|
+
w || (w = true, p && window.addEventListener("beforeunload", () => {
|
|
1884
1920
|
window.name = y + window.name;
|
|
1885
1921
|
}));
|
|
1886
1922
|
})(), p && (sendUserDeviceUuid(), (function sendTimeZone() {
|
|
@@ -1923,7 +1959,7 @@ function matchUrlWithWildcard(e2, t2) {
|
|
|
1923
1959
|
});
|
|
1924
1960
|
}
|
|
1925
1961
|
function createSkipHeadersPropagationChecker(e2 = []) {
|
|
1926
|
-
const t2 = [...
|
|
1962
|
+
const t2 = [...Te, ...e2];
|
|
1927
1963
|
return function shouldSkipHeadersPropagation(e3) {
|
|
1928
1964
|
let n2;
|
|
1929
1965
|
try {
|
|
@@ -1932,7 +1968,7 @@ function createSkipHeadersPropagationChecker(e2 = []) {
|
|
|
1932
1968
|
return true;
|
|
1933
1969
|
}
|
|
1934
1970
|
const i2 = n2.pathname.toLowerCase(), o2 = i2.lastIndexOf(".");
|
|
1935
|
-
return !(-1 === o2 || !
|
|
1971
|
+
return !(-1 === o2 || !Ie.has(i2.slice(o2))) || !!matchUrlWithWildcard(e3, t2);
|
|
1936
1972
|
};
|
|
1937
1973
|
}
|
|
1938
1974
|
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }) {
|
|
@@ -1967,29 +2003,29 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
1967
2003
|
h2[e5] = t3;
|
|
1968
2004
|
}) : h2 = { ...l3.headers }), m2 = l3.body;
|
|
1969
2005
|
} catch (e5) {
|
|
1970
|
-
|
|
2006
|
+
ke && console.warn("[Sailfish] Failed to capture request data:", e5);
|
|
1971
2007
|
}
|
|
1972
2008
|
delete h2[n];
|
|
1973
2009
|
const b2 = getFuncSpanHeader();
|
|
1974
2010
|
b2 && delete h2[b2.name];
|
|
1975
|
-
const
|
|
1976
|
-
h2[n] =
|
|
2011
|
+
const w2 = `${c3}/${p2.page_visit_uuid}/${u3}`;
|
|
2012
|
+
h2[n] = w2, b2 && (h2[b2.name] = b2.value);
|
|
1977
2013
|
maskAuthorizationHeader(h2);
|
|
1978
2014
|
try {
|
|
1979
2015
|
let b3 = await (async function injectHeader(e5, t3, i5, o4, s4, a3, r3) {
|
|
1980
2016
|
const l4 = getFuncSpanHeader();
|
|
1981
2017
|
if (i5 instanceof Request) {
|
|
1982
2018
|
const c4 = i5.clone(), d4 = new Headers(c4.headers);
|
|
1983
|
-
d4.set(n, `${s4}/${a3}/${r3}`), l4 && (d4.set(l4.name, l4.value),
|
|
2019
|
+
d4.set(n, `${s4}/${a3}/${r3}`), l4 && (d4.set(l4.name, l4.value), ke && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: i5.url, header: l4.name }));
|
|
1984
2020
|
const u4 = new Request(c4, { headers: d4 });
|
|
1985
2021
|
return await e5.call(t3, u4, o4);
|
|
1986
2022
|
}
|
|
1987
2023
|
{
|
|
1988
2024
|
const c4 = { ...o4 }, d4 = new Headers(o4.headers || {});
|
|
1989
|
-
return d4.set(n, `${s4}/${a3}/${r3}`), l4 && (d4.set(l4.name, l4.value),
|
|
2025
|
+
return d4.set(n, `${s4}/${a3}/${r3}`), l4 && (d4.set(l4.name, l4.value), ke && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof i5 ? i5 : i5.href, header: l4.name })), c4.headers = d4, await e5.call(t3, i5, c4);
|
|
1990
2026
|
}
|
|
1991
|
-
})(e4, i4, s3, l3, c3, p2.page_visit_uuid, u3),
|
|
1992
|
-
|
|
2027
|
+
})(e4, i4, s3, l3, c3, p2.page_visit_uuid, u3), w3 = false;
|
|
2028
|
+
Ee.includes(b3.status) && (ke && console.log("Perform retry as status was fail:", b3), delete h2[n], b3 = await (async function retryWithoutPropagateHeaders(e5, t3, i5, o4) {
|
|
1993
2029
|
try {
|
|
1994
2030
|
let o5 = i5[0], s4 = i5[1] || {};
|
|
1995
2031
|
if ("string" == typeof o5 || o5 instanceof URL) {
|
|
@@ -2005,19 +2041,19 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2005
2041
|
}
|
|
2006
2042
|
return e5.apply(t3, i5);
|
|
2007
2043
|
} catch (e6) {
|
|
2008
|
-
throw
|
|
2044
|
+
throw ke && console.log(`Retry without ${n} for ${o4} also failed:`, e6), e6;
|
|
2009
2045
|
}
|
|
2010
|
-
})(e4, i4, o3, d3),
|
|
2011
|
-
const
|
|
2046
|
+
})(e4, i4, o3, d3), w3 = true);
|
|
2047
|
+
const v2 = Date.now(), S2 = b3.status, k2 = b3.ok, x2 = k2 ? "" : `Request Error: ${b3.statusText}`;
|
|
2012
2048
|
let I2 = null;
|
|
2013
2049
|
try {
|
|
2014
2050
|
I2 = {}, b3.headers.forEach((e5, t3) => {
|
|
2015
2051
|
I2[t3] = e5;
|
|
2016
2052
|
});
|
|
2017
2053
|
} catch (e5) {
|
|
2018
|
-
|
|
2054
|
+
ke && console.warn("[Sailfish] Failed to capture response headers:", e5), I2 = null;
|
|
2019
2055
|
}
|
|
2020
|
-
const T2 = { type: 27, timestamp:
|
|
2056
|
+
const T2 = { type: 27, timestamp: v2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: v2, response_code: S2, success: k2, error: x2, method: f2, url: d3, retry_without_trace_id: w3, request_headers: h2, request_body: m2, response_headers: I2, response_body: null }, ...p2 }, sendEventWithBody = (e5) => {
|
|
2021
2057
|
T2.data.response_body = e5, y2 ? y2.text().then((e6) => {
|
|
2022
2058
|
T2.data.request_body = e6, sendEvent(T2);
|
|
2023
2059
|
}, () => {
|
|
@@ -2093,7 +2129,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2093
2129
|
return b3;
|
|
2094
2130
|
} catch (t3) {
|
|
2095
2131
|
const n2 = Date.now(), s4 = false, a3 = ((_a = t3.response) == null ? void 0 : _a.status) || 500, r3 = t3.message || "Fetch request failed";
|
|
2096
|
-
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(
|
|
2132
|
+
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(Ce.toLowerCase()))) return e4.apply(i4, o3);
|
|
2097
2133
|
let l4 = m2;
|
|
2098
2134
|
if (y2) try {
|
|
2099
2135
|
l4 = await y2.text();
|
|
@@ -2105,12 +2141,12 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2105
2141
|
})(e3, i3, l2, d2, u2, o2, c2);
|
|
2106
2142
|
} });
|
|
2107
2143
|
}
|
|
2108
|
-
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = [], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: a2, gitSha: r2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: g2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: b2, useWsWorker:
|
|
2144
|
+
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = [], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: a2, gitSha: r2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: g2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: b2, useWsWorker: w2 = true }) {
|
|
2109
2145
|
var _a, _b;
|
|
2110
|
-
const
|
|
2111
|
-
if (k2.sessionId =
|
|
2146
|
+
const v2 = h2 ?? y2 ?? true, S2 = getOrSetSessionId(), k2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
2147
|
+
if (k2.sessionId = S2, k2.apiKey = e2, k2.backendApi = t2, k2.serviceAdditionalMetadata = l2, k2.initialized && k2.sessionId === S2 && k2.ws && 1 === k2.ws.readyState) return void trackDomainChangesOnce();
|
|
2112
2148
|
const x2 = { captureStreamingResponseBody: d2, captureResponseBodyMaxMb: u2, captureStreamPrefixKb: p2, captureStreamTimeoutMs: f2 };
|
|
2113
|
-
k2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }) {
|
|
2149
|
+
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), k2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }) {
|
|
2114
2150
|
const i3 = XMLHttpRequest.prototype.open, o3 = XMLHttpRequest.prototype.send, s3 = XMLHttpRequest.prototype.setRequestHeader, a3 = getOrSetSessionId(), r3 = createSkipHeadersPropagationChecker(e3);
|
|
2115
2151
|
XMLHttpRequest.prototype.setRequestHeader = function(e4, t4) {
|
|
2116
2152
|
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, s3.call(this, e4, t4);
|
|
@@ -2128,9 +2164,9 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2128
2164
|
}
|
|
2129
2165
|
const d3 = getFuncSpanHeader();
|
|
2130
2166
|
if (d3) try {
|
|
2131
|
-
this.setRequestHeader(d3.name, d3.value),
|
|
2167
|
+
this.setRequestHeader(d3.name, d3.value), ke && console.log("[Sailfish] Added funcspan header to XMLHttpRequest:", { url: i4, header: d3.name });
|
|
2132
2168
|
} catch (e5) {
|
|
2133
|
-
|
|
2169
|
+
ke && console.warn(`[Sailfish] Could not set funcspan header for ${i4}`, e5);
|
|
2134
2170
|
}
|
|
2135
2171
|
const u3 = Date.now();
|
|
2136
2172
|
let p3 = false;
|
|
@@ -2163,7 +2199,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2163
2199
|
2 === t4.length && (i5[t4[0]] = t4[1]);
|
|
2164
2200
|
});
|
|
2165
2201
|
} catch (e6) {
|
|
2166
|
-
|
|
2202
|
+
ke && console.warn("[Sailfish] Failed to capture XHR response headers:", e6), i5 = null;
|
|
2167
2203
|
}
|
|
2168
2204
|
if (e5 >= 200 && e5 < 300) emitFinished(true, e5, "", n2, i5);
|
|
2169
2205
|
else {
|
|
@@ -2175,7 +2211,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2175
2211
|
emitFinished(false, e5, t4);
|
|
2176
2212
|
}, { once: true }), o3.apply(this, e4);
|
|
2177
2213
|
};
|
|
2178
|
-
})(o2, x2), k2.xhrPatched = true),
|
|
2214
|
+
})(o2, x2), k2.xhrPatched = true), k2.fetchPatched || (setupFetchInterceptor(o2, x2), k2.fetchPatched = true), await yieldToMain(), k2.domEventsInit || (initializeDomContentEvents(S2), k2.domEventsInit = true), await yieldToMain(), k2.consoleInit || (initializeConsolePlugin(Ae, S2), k2.consoleInit = true), await yieldToMain(), k2.errorInit || (!(function initializeErrorInterceptor() {
|
|
2179
2215
|
window.addEventListener("error", (e3) => {
|
|
2180
2216
|
captureError(e3.error || e3.message);
|
|
2181
2217
|
}), window.addEventListener("unhandledrejection", (e3) => {
|
|
@@ -2185,12 +2221,12 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2185
2221
|
m && (sessionStorage.setItem("sailfishApiKey", e3), sessionStorage.setItem("sailfishBackendApi", t3));
|
|
2186
2222
|
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() || k2.ws && 1 === k2.ws.readyState || fetchFunctionSpanTrackingEnabled(e2, t2).then((e3) => {
|
|
2187
2223
|
var _a2;
|
|
2188
|
-
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ?
|
|
2224
|
+
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? ke && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), ke && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
|
|
2189
2225
|
}).catch((e3) => {
|
|
2190
|
-
|
|
2191
|
-
}), k2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e2, [...o2, ...
|
|
2226
|
+
ke && console.warn("[Sailfish] Failed to validate function span tracking status with backend:", e3);
|
|
2227
|
+
}), k2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e2, [...o2, ...Te], t2).catch((e3) => console.error("Failed to send domains to not propagate header to:", e3)), k2.sentDoNotPropagateOnce = true), (async function gatherAndCacheDeviceInfo() {
|
|
2192
2228
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: { language: navigator.language, userAgent: navigator.userAgent } } });
|
|
2193
|
-
})(), c2 && fetchAndSendIp(
|
|
2229
|
+
})(), c2 && fetchAndSendIp(S2);
|
|
2194
2230
|
try {
|
|
2195
2231
|
const n2 = r2 ?? (function readGitSha() {
|
|
2196
2232
|
var _a2;
|
|
@@ -2217,12 +2253,12 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2217
2253
|
}
|
|
2218
2254
|
})(), u3 = withAppUrlMetadata(l2);
|
|
2219
2255
|
await yieldToMain();
|
|
2220
|
-
const [p3, f3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2,
|
|
2256
|
+
const [p3, f3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, S2, t2, i3, o3, d3, n2, c3, u3)]), m2 = { ...Le, ...(_a = p3.data) == null ? void 0 : _a.captureSettingsFromApiKey, enableFiberTracking: g2 };
|
|
2221
2257
|
if (k2.ws && 1 === k2.ws.readyState) return;
|
|
2222
2258
|
if ((_b = f3.data) == null ? void 0 : _b.startRecordingSession) {
|
|
2223
2259
|
const n3 = (l2 == null ? void 0 : l2.env) || (l2 == null ? void 0 : l2.environment);
|
|
2224
2260
|
await yieldToMain();
|
|
2225
|
-
const i4 = await initializeRecording(m2, t2, e2,
|
|
2261
|
+
const i4 = await initializeRecording(m2, t2, e2, S2, n3, v2, w2, b2 ?? false);
|
|
2226
2262
|
k2.ws = i4, k2.initialized = true, trackDomainChangesOnce(), k2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
|
|
2227
2263
|
window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
|
|
2228
2264
|
})(a2, s2), k2.sentMapUuidOnce = true);
|
|
@@ -2231,29 +2267,68 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2231
2267
|
console.error("Error starting recording:", e3);
|
|
2232
2268
|
}
|
|
2233
2269
|
}
|
|
2234
|
-
|
|
2235
|
-
const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
2236
|
-
z && JSON.stringify(z) === JSON.stringify(e2) || (z = e2, sendMessage(t2));
|
|
2237
|
-
}, exports.buildBatches = buildBatches, exports.clearStaleFuncSpanState = clearStaleFuncSpanState, 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) {
|
|
2238
|
-
const i2 = { type: "identify", userId: e2, traits: t2 };
|
|
2239
|
-
O && O.userId === e2 && JSON.stringify(O.traits) === JSON.stringify(t2) || (O = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
|
|
2240
|
-
}, exports.initRecorder = async (e2) => {
|
|
2270
|
+
const initRecorder = async (e2) => {
|
|
2241
2271
|
if ("undefined" == typeof window) return;
|
|
2242
2272
|
const t2 = window.__sailfish_recorder || (window.__sailfish_recorder = {}), n2 = getOrSetSessionId();
|
|
2243
2273
|
return clearPageVisitDataFromSessionStorage(), t2.initialized && t2.sessionId === n2 && t2.ws && 1 === t2.ws.readyState ? void 0 : (t2.initPromise || (t2.initPromise = (async () => {
|
|
2244
2274
|
if (t2.hasLoggedInitOnce || (console.log("Initializing Sailfish Recorder (first run) …"), t2.hasLoggedInitOnce = true), await startRecording(e2), !t2.issueReportingInit) {
|
|
2245
|
-
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() =>
|
|
2275
|
+
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() => Se), Promise.resolve().then(() => ce)]);
|
|
2246
2276
|
let a2 = null;
|
|
2247
2277
|
try {
|
|
2248
2278
|
await o2(e2.apiKey, n3), a2 = s2();
|
|
2249
2279
|
} catch (e3) {
|
|
2250
2280
|
console.warn("[Sailfish] Failed to fetch integration data for issue reporting:", e3);
|
|
2251
2281
|
}
|
|
2252
|
-
i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData: a2 }), t2.issueReportingInit = true;
|
|
2282
|
+
i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData: a2, showEngTicketFieldsInReportIssueModalDefault: e2.showEngTicketFieldsInReportIssueModalDefault }), t2.issueReportingInit = true;
|
|
2253
2283
|
}
|
|
2254
2284
|
})().finally(() => {
|
|
2255
2285
|
delete t2.initPromise;
|
|
2256
2286
|
})), t2.initPromise);
|
|
2257
|
-
}
|
|
2258
|
-
|
|
2259
|
-
|
|
2287
|
+
};
|
|
2288
|
+
export {
|
|
2289
|
+
initializeRecording as A,
|
|
2290
|
+
initializeWebSocket as B,
|
|
2291
|
+
invalidateUrlCache as C,
|
|
2292
|
+
Le as D,
|
|
2293
|
+
isFunctionSpanTrackingEnabled as E,
|
|
2294
|
+
matchUrlWithWildcard as F,
|
|
2295
|
+
v as G,
|
|
2296
|
+
onNavigationChange as H,
|
|
2297
|
+
openReportIssueModal as I,
|
|
2298
|
+
restoreFuncSpanState as J,
|
|
2299
|
+
sendDomainsToNotPropagateHeaderTo as K,
|
|
2300
|
+
sendEvent as L,
|
|
2301
|
+
sendGraphQLRequest as M,
|
|
2302
|
+
sendMessage as N,
|
|
2303
|
+
startRecording as O,
|
|
2304
|
+
startRecordingSession as P,
|
|
2305
|
+
trackingEvent as Q,
|
|
2306
|
+
withAppUrlMetadata as R,
|
|
2307
|
+
$e as S,
|
|
2308
|
+
Ae as a,
|
|
2309
|
+
addOrUpdateMetadata as b,
|
|
2310
|
+
buildBatches as c,
|
|
2311
|
+
clearStaleFuncSpanState as d,
|
|
2312
|
+
createTriageAndIssueFromRecorder as e,
|
|
2313
|
+
createTriageFromRecorder as f,
|
|
2314
|
+
disableFunctionSpanTracking as g,
|
|
2315
|
+
enableFunctionSpanTracking as h,
|
|
2316
|
+
ensureHrefCache as i,
|
|
2317
|
+
eventSize as j,
|
|
2318
|
+
fetchAndSendIp as k,
|
|
2319
|
+
fetchCaptureSettings as l,
|
|
2320
|
+
fetchEngineeringTicketPlatformIntegrations as m,
|
|
2321
|
+
fetchFunctionSpanTrackingEnabled as n,
|
|
2322
|
+
flushBufferedEvents as o,
|
|
2323
|
+
getCachedHref as p,
|
|
2324
|
+
getCachedHrefNoQuery as q,
|
|
2325
|
+
getFuncSpanHeader as r,
|
|
2326
|
+
getOrSetSessionId as s,
|
|
2327
|
+
getUrlAndStoredUuids as t,
|
|
2328
|
+
identify as u,
|
|
2329
|
+
initRecorder as v,
|
|
2330
|
+
initializeConsolePlugin as w,
|
|
2331
|
+
initializeDomContentEvents as x,
|
|
2332
|
+
yieldToMain as y,
|
|
2333
|
+
initializeFunctionSpanTrackingFromApi as z
|
|
2334
|
+
};
|