@sailfish-ai/recorder 1.12.5 → 1.12.7
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/README.md +8 -0
- package/dist/canvas/adapters.js +382 -0
- package/dist/canvas/adapters.js.br +0 -0
- package/dist/canvas/adapters.js.gz +0 -0
- package/dist/canvas/canvasManager.js +1949 -0
- package/dist/canvas/canvasManager.js.br +0 -0
- package/dist/canvas/canvasManager.js.gz +0 -0
- package/dist/canvas/canvasPrivacy.js +233 -0
- package/dist/canvas/canvasPrivacy.js.br +0 -0
- package/dist/canvas/canvasPrivacy.js.gz +0 -0
- package/dist/canvas/codec.js +314 -0
- package/dist/canvas/codec.js.br +0 -0
- package/dist/canvas/codec.js.gz +0 -0
- package/dist/canvas/deviceClass.js +67 -0
- package/dist/canvas/deviceClass.js.br +0 -0
- package/dist/canvas/deviceClass.js.gz +0 -0
- package/dist/canvas/encodeWorker.js +284 -0
- package/dist/canvas/encodeWorker.js.br +0 -0
- package/dist/canvas/encodeWorker.js.gz +0 -0
- package/dist/canvas/governor.js +79 -0
- package/dist/canvas/governor.js.br +0 -0
- package/dist/canvas/governor.js.gz +0 -0
- package/dist/canvas/keyframes.js +183 -0
- package/dist/canvas/keyframes.js.br +0 -0
- package/dist/canvas/keyframes.js.gz +0 -0
- package/dist/canvas/mediaRecorderCapture.js +257 -0
- package/dist/canvas/mediaRecorderCapture.js.br +0 -0
- package/dist/canvas/mediaRecorderCapture.js.gz +0 -0
- package/dist/canvas/objectLog.js +150 -0
- package/dist/canvas/objectLog.js.br +0 -0
- package/dist/canvas/objectLog.js.gz +0 -0
- package/dist/canvas/patch2d.js +1302 -0
- package/dist/canvas/patch2d.js.br +0 -0
- package/dist/canvas/patch2d.js.gz +0 -0
- package/dist/canvas/patchGL.js +371 -0
- package/dist/canvas/patchGL.js.br +0 -0
- package/dist/canvas/patchGL.js.gz +0 -0
- package/dist/canvas/patchWebGPU.js +361 -0
- package/dist/canvas/patchWebGPU.js.br +0 -0
- package/dist/canvas/patchWebGPU.js.gz +0 -0
- package/dist/canvas/piiDetect.js +155 -0
- package/dist/canvas/piiDetect.js.br +0 -0
- package/dist/canvas/piiDetect.js.gz +0 -0
- package/dist/canvas/protocol.js +122 -0
- package/dist/canvas/protocol.js.br +0 -0
- package/dist/canvas/protocol.js.gz +0 -0
- package/dist/canvas/videoCapture.js +252 -0
- package/dist/canvas/videoCapture.js.br +0 -0
- package/dist/canvas/videoCapture.js.gz +0 -0
- package/dist/canvas/workerRelay.js +99 -0
- package/dist/canvas/workerRelay.js.br +0 -0
- package/dist/canvas/workerRelay.js.gz +0 -0
- package/dist/canvas/workerShim.js +227 -0
- package/dist/canvas/workerShim.js.br +0 -0
- package/dist/canvas/workerShim.js.gz +0 -0
- package/dist/canvas-worker.cjs +74 -0
- package/dist/canvas-worker.cjs.br +0 -0
- package/dist/canvas-worker.cjs.gz +0 -0
- package/dist/canvas-worker.js +78 -0
- package/dist/canvas-worker.js.br +0 -0
- package/dist/canvas-worker.js.gz +0 -0
- package/dist/canvasFrameStore.js +198 -0
- package/dist/canvasFrameStore.js.br +0 -0
- package/dist/canvasFrameStore.js.gz +0 -0
- package/dist/chunks/canvasManager-B9uQ-PFS.js +1456 -0
- package/dist/chunks/canvasManager-B9uQ-PFS.js.br +0 -0
- package/dist/chunks/canvasManager-B9uQ-PFS.js.gz +0 -0
- package/dist/chunks/canvasManager-Ce7vazTt.js +1440 -0
- package/dist/chunks/canvasManager-Ce7vazTt.js.br +0 -0
- package/dist/chunks/canvasManager-Ce7vazTt.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-pkpgT-FH.js → chunkSerializer-B-z7p0r-.js} +1 -1
- package/dist/chunks/chunkSerializer-B-z7p0r-.js.br +0 -0
- package/dist/chunks/chunkSerializer-B-z7p0r-.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-Cd8y9tID.js → chunkSerializer-C1knjCQ5.js} +1 -1
- package/dist/chunks/chunkSerializer-C1knjCQ5.js.br +0 -0
- package/dist/chunks/chunkSerializer-C1knjCQ5.js.gz +0 -0
- package/dist/chunks/{index-CXvHbLRT.js → index-BMHQ-0NY.js} +1115 -724
- package/dist/chunks/index-BMHQ-0NY.js.br +0 -0
- package/dist/chunks/index-BMHQ-0NY.js.gz +0 -0
- package/dist/chunks/{index-Bvd8oTpV.js → index-qgM1hFXO.js} +1025 -655
- package/dist/chunks/index-qgM1hFXO.js.br +0 -0
- package/dist/chunks/index-qgM1hFXO.js.gz +0 -0
- package/dist/chunks/patch2d-9voowhJ_.js +816 -0
- package/dist/chunks/patch2d-9voowhJ_.js.br +0 -0
- package/dist/chunks/patch2d-9voowhJ_.js.gz +0 -0
- package/dist/chunks/patch2d-PQxcaE6r.js +886 -0
- package/dist/chunks/patch2d-PQxcaE6r.js.br +0 -0
- package/dist/chunks/patch2d-PQxcaE6r.js.gz +0 -0
- package/dist/graphql.js +12 -1
- package/dist/graphql.js.br +0 -0
- package/dist/graphql.js.gz +0 -0
- package/dist/inAppReportIssueModal/index.js +10 -1
- package/dist/inAppReportIssueModal/index.js.br +0 -0
- package/dist/inAppReportIssueModal/index.js.gz +0 -0
- package/dist/index.js +144 -2
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/recorder.cjs +2 -2
- package/dist/recorder.cjs.br +0 -0
- package/dist/recorder.cjs.gz +0 -0
- package/dist/recorder.js +52 -41
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/recorder.umd.cjs +4842 -2215
- package/dist/recorder.umd.cjs.br +0 -0
- package/dist/recorder.umd.cjs.gz +0 -0
- package/dist/recording.js +119 -10
- package/dist/recording.js.br +0 -0
- package/dist/recording.js.gz +0 -0
- package/dist/types/canvas/adapters.d.ts +71 -0
- package/dist/types/canvas/canvasManager.d.ts +273 -0
- package/dist/types/canvas/canvasPrivacy.d.ts +184 -0
- package/dist/types/canvas/codec.d.ts +27 -0
- package/dist/types/canvas/deviceClass.d.ts +40 -0
- package/dist/types/canvas/encodeWorker.d.ts +54 -0
- package/dist/types/canvas/governor.d.ts +44 -0
- package/dist/types/canvas/keyframes.d.ts +81 -0
- package/dist/types/canvas/mediaRecorderCapture.d.ts +91 -0
- package/dist/types/canvas/objectLog.d.ts +75 -0
- package/dist/types/canvas/patch2d.d.ts +339 -0
- package/dist/types/canvas/patchGL.d.ts +74 -0
- package/dist/types/canvas/patchWebGPU.d.ts +37 -0
- package/dist/types/canvas/piiDetect.d.ts +60 -0
- package/dist/types/canvas/protocol.d.ts +176 -0
- package/dist/types/canvas/videoCapture.d.ts +67 -0
- package/dist/types/canvas/workerRelay.d.ts +29 -0
- package/dist/types/canvas/workerShim.d.ts +10 -0
- package/dist/types/canvasFrameStore.d.ts +23 -0
- package/dist/types/graphql.d.ts +1 -1
- package/dist/types/index.d.ts +99 -1
- package/dist/types/types.d.ts +40 -0
- package/dist/types/websocket.d.ts +19 -0
- package/dist/websocket.js +210 -0
- package/dist/websocket.js.br +0 -0
- package/dist/websocket.js.gz +0 -0
- package/package.json +7 -1
- package/dist/chunks/chunkSerializer-Cd8y9tID.js.br +0 -0
- package/dist/chunks/chunkSerializer-Cd8y9tID.js.gz +0 -0
- package/dist/chunks/chunkSerializer-pkpgT-FH.js.br +0 -0
- package/dist/chunks/chunkSerializer-pkpgT-FH.js.gz +0 -0
- package/dist/chunks/index-Bvd8oTpV.js.br +0 -0
- package/dist/chunks/index-Bvd8oTpV.js.gz +0 -0
- package/dist/chunks/index-CXvHbLRT.js.br +0 -0
- package/dist/chunks/index-CXvHbLRT.js.gz +0 -0
|
@@ -3,6 +3,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import e from "reconnecting-websocket";
|
|
5
5
|
import { EventType as t } from "@sailfish-rrweb/types";
|
|
6
|
+
import { b as n, m as i, l as o, c as r, e as s, f as a, g as c, h as l, n as d, i as u, j as p } from "./patch2d-PQxcaE6r.js";
|
|
6
7
|
function readDebugFlag() {
|
|
7
8
|
var _a;
|
|
8
9
|
try {
|
|
@@ -38,12 +39,12 @@ function uuidv4() {
|
|
|
38
39
|
return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16);
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
|
-
const
|
|
42
|
+
const f = "X-Sf3-Rid", g = 0, m = 1, h = 2, y = 4, b = "undefined" != typeof performance && "function" == typeof performance.now;
|
|
42
43
|
function monotonicNow() {
|
|
43
|
-
return
|
|
44
|
+
return b ? performance.now() : Date.now();
|
|
44
45
|
}
|
|
45
46
|
function timeOriginMs() {
|
|
46
|
-
return
|
|
47
|
+
return b ? performance.timeOrigin : 0;
|
|
47
48
|
}
|
|
48
49
|
class ClockSyncManager {
|
|
49
50
|
constructor() {
|
|
@@ -66,8 +67,8 @@ class ClockSyncManager {
|
|
|
66
67
|
this.pending.delete(e2.requestId);
|
|
67
68
|
const n2 = monotonicNow(), i2 = n2 - t2.clientSendMonoMs;
|
|
68
69
|
if (i2 < 0 || !isFinite(i2)) return null;
|
|
69
|
-
const o2 = (t2.clientSendMonoMs + n2) / 2,
|
|
70
|
-
return this.samples.push(
|
|
70
|
+
const o2 = (t2.clientSendMonoMs + n2) / 2, r2 = (e2.serverReceivedAtMs + e2.serverSentAtMs) / 2 - o2, s2 = { clientSendMonoMs: t2.clientSendMonoMs, clientReceiveMonoMs: n2, serverReceiveWallMs: e2.serverReceivedAtMs, serverSendWallMs: e2.serverSentAtMs, rttMs: i2, estimatedOffsetMs: r2, browserWallAtSyncMs: Date.now() };
|
|
71
|
+
return this.samples.push(s2), this.pruneSamples(n2), this.recompute(n2), s2;
|
|
71
72
|
}
|
|
72
73
|
estimateServerTime(e2) {
|
|
73
74
|
return null == this.estimatedOffsetMs ? null : this.estimatedOffsetMs + e2;
|
|
@@ -96,38 +97,72 @@ class ClockSyncManager {
|
|
|
96
97
|
this.estimatedOffsetMs = n2[Math.floor(n2.length / 2)], this.bestRttMs = t2[0].rttMs, this.lastSyncMonoMs = e2;
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
|
-
let
|
|
100
|
+
let v = null;
|
|
100
101
|
function getClockSyncManager() {
|
|
101
|
-
return
|
|
102
|
+
return v || (v = new ClockSyncManager()), v;
|
|
102
103
|
}
|
|
103
104
|
function buildEventTimeEnvelope(e2, t2) {
|
|
104
105
|
const n2 = getClockSyncManager(), i2 = n2.getSyncMetadata(), o2 = n2.estimateServerTime(e2);
|
|
105
106
|
return { client: { wallTimeMs: t2, monotonicMs: e2, timeOriginMs: timeOriginMs() }, serverEstimated: { eventTimeMs: o2, offsetMs: i2.offsetMs, rttMs: i2.rttMs, syncAgeMs: i2.syncAgeMs } };
|
|
106
107
|
}
|
|
107
|
-
const
|
|
108
|
-
let
|
|
109
|
-
function openDb$
|
|
110
|
-
return (function hasIndexedDB$
|
|
108
|
+
const S = "recordingEvents";
|
|
109
|
+
let w = null;
|
|
110
|
+
function openDb$2() {
|
|
111
|
+
return (function hasIndexedDB$2() {
|
|
111
112
|
return "undefined" != typeof globalThis && !!globalThis.indexedDB;
|
|
112
|
-
})() ?
|
|
113
|
+
})() ? w || (w = new Promise((e2) => {
|
|
113
114
|
try {
|
|
114
115
|
const t2 = globalThis.indexedDB.open("leapsEventDB", 1);
|
|
115
116
|
t2.onupgradeneeded = () => {
|
|
116
117
|
const e3 = t2.result;
|
|
117
|
-
e3.objectStoreNames.contains(
|
|
118
|
+
e3.objectStoreNames.contains(S) || e3.createObjectStore(S, { keyPath: "id", autoIncrement: true });
|
|
118
119
|
}, t2.onsuccess = () => e2(t2.result), t2.onerror = () => e2(null), t2.onblocked = () => {
|
|
119
120
|
e2(null);
|
|
120
121
|
};
|
|
121
122
|
} catch {
|
|
122
123
|
e2(null);
|
|
123
124
|
}
|
|
124
|
-
}),
|
|
125
|
+
}), w) : Promise.resolve(null);
|
|
126
|
+
}
|
|
127
|
+
function withStore$2(e2, t2) {
|
|
128
|
+
return openDb$2().then((n2) => n2 ? new Promise((i2) => {
|
|
129
|
+
try {
|
|
130
|
+
const o2 = n2.transaction(S, e2), r2 = o2.objectStore(S);
|
|
131
|
+
Promise.resolve(t2(r2)).then((e3) => {
|
|
132
|
+
o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
|
|
133
|
+
}).catch(() => i2(null));
|
|
134
|
+
} catch {
|
|
135
|
+
i2(null);
|
|
136
|
+
}
|
|
137
|
+
}) : null);
|
|
138
|
+
}
|
|
139
|
+
async function deleteEventsByIds(e2) {
|
|
140
|
+
await withStore$2("readwrite", async (t2) => {
|
|
141
|
+
for (const n2 of e2) t2.delete(n2);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
const k = "canvasFrames", x = 67108864;
|
|
145
|
+
let I = null;
|
|
146
|
+
function openDb$1() {
|
|
147
|
+
return (function hasIndexedDB$1() {
|
|
148
|
+
return "undefined" != typeof globalThis && !!globalThis.indexedDB;
|
|
149
|
+
})() ? I || (I = new Promise((e2) => {
|
|
150
|
+
try {
|
|
151
|
+
const t2 = globalThis.indexedDB.open("leapsCanvasFrameDB", 1);
|
|
152
|
+
t2.onupgradeneeded = () => {
|
|
153
|
+
const e3 = t2.result;
|
|
154
|
+
e3.objectStoreNames.contains(k) || e3.createObjectStore(k, { keyPath: "id", autoIncrement: true });
|
|
155
|
+
}, t2.onsuccess = () => e2(t2.result), t2.onerror = () => e2(null), t2.onblocked = () => e2(null);
|
|
156
|
+
} catch {
|
|
157
|
+
e2(null);
|
|
158
|
+
}
|
|
159
|
+
}), I) : Promise.resolve(null);
|
|
125
160
|
}
|
|
126
161
|
function withStore$1(e2, t2) {
|
|
127
162
|
return openDb$1().then((n2) => n2 ? new Promise((i2) => {
|
|
128
163
|
try {
|
|
129
|
-
const o2 = n2.transaction(
|
|
130
|
-
Promise.resolve(t2(
|
|
164
|
+
const o2 = n2.transaction(k, e2), r2 = o2.objectStore(k);
|
|
165
|
+
Promise.resolve(t2(r2)).then((e3) => {
|
|
131
166
|
o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
|
|
132
167
|
}).catch(() => i2(null));
|
|
133
168
|
} catch {
|
|
@@ -135,34 +170,58 @@ function withStore$1(e2, t2) {
|
|
|
135
170
|
}
|
|
136
171
|
}) : null);
|
|
137
172
|
}
|
|
138
|
-
async function
|
|
139
|
-
await withStore$1("readwrite",
|
|
173
|
+
async function persistCanvasFrame(e2) {
|
|
174
|
+
const t2 = await withStore$1("readwrite", (t3) => (t3.add({ timestamp: Date.now(), bytes: e2.byteLength, buf: e2 }), true));
|
|
175
|
+
return t2 && (async function pruneToBudget() {
|
|
176
|
+
await withStore$1("readwrite", (e3) => new Promise((t3) => {
|
|
177
|
+
let n2 = 0;
|
|
178
|
+
const i2 = [], o2 = e3.openCursor();
|
|
179
|
+
o2.onsuccess = () => {
|
|
180
|
+
const r2 = o2.result;
|
|
181
|
+
if (r2) {
|
|
182
|
+
const e4 = r2.value, t4 = "number" == typeof (e4 == null ? void 0 : e4.bytes) ? e4.bytes : 0;
|
|
183
|
+
return n2 += t4, "number" == typeof (e4 == null ? void 0 : e4.id) && i2.push({ id: e4.id, bytes: t4 }), void r2.continue();
|
|
184
|
+
}
|
|
185
|
+
let s2 = n2 - x;
|
|
186
|
+
if (s2 <= 0) return t3();
|
|
187
|
+
for (const t4 of i2) {
|
|
188
|
+
if (s2 <= 0) break;
|
|
189
|
+
e3.delete(t4.id), s2 -= t4.bytes;
|
|
190
|
+
}
|
|
191
|
+
t3();
|
|
192
|
+
}, o2.onerror = () => t3();
|
|
193
|
+
}));
|
|
194
|
+
})().catch(() => {
|
|
195
|
+
}), true === t2;
|
|
196
|
+
}
|
|
197
|
+
async function deleteCanvasFramesByIds(e2) {
|
|
198
|
+
0 !== e2.length && await withStore$1("readwrite", (t2) => {
|
|
140
199
|
for (const n2 of e2) t2.delete(n2);
|
|
141
200
|
});
|
|
142
201
|
}
|
|
143
|
-
const
|
|
144
|
-
let
|
|
202
|
+
const T = "notifyMessages";
|
|
203
|
+
let E = null;
|
|
145
204
|
function openDb() {
|
|
146
205
|
return (function hasIndexedDB() {
|
|
147
206
|
return "undefined" != typeof globalThis && !!globalThis.indexedDB;
|
|
148
|
-
})() ?
|
|
207
|
+
})() ? E || (E = new Promise((e2) => {
|
|
149
208
|
try {
|
|
150
209
|
const t2 = globalThis.indexedDB.open("leapsNotifyDB", 1);
|
|
151
210
|
t2.onupgradeneeded = () => {
|
|
152
211
|
const e3 = t2.result;
|
|
153
|
-
e3.objectStoreNames.contains(
|
|
212
|
+
e3.objectStoreNames.contains(T) || e3.createObjectStore(T, { keyPath: "id", autoIncrement: true });
|
|
154
213
|
}, t2.onsuccess = () => e2(t2.result), t2.onerror = () => e2(null), t2.onblocked = () => e2(null);
|
|
155
214
|
} catch {
|
|
156
215
|
e2(null);
|
|
157
216
|
}
|
|
158
|
-
}),
|
|
217
|
+
}), E) : Promise.resolve(null);
|
|
159
218
|
}
|
|
160
219
|
async function withStore(e2, t2) {
|
|
161
220
|
const n2 = await openDb();
|
|
162
221
|
return n2 ? new Promise((i2) => {
|
|
163
222
|
try {
|
|
164
|
-
const o2 = n2.transaction(
|
|
165
|
-
Promise.resolve(t2(
|
|
223
|
+
const o2 = n2.transaction(T, e2), r2 = o2.objectStore(T);
|
|
224
|
+
Promise.resolve(t2(r2)).then((e3) => {
|
|
166
225
|
o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
|
|
167
226
|
}).catch(() => i2(null));
|
|
168
227
|
} catch {
|
|
@@ -180,25 +239,25 @@ async function deleteNotifyMessageById(e2) {
|
|
|
180
239
|
t2.delete(e2);
|
|
181
240
|
});
|
|
182
241
|
}
|
|
183
|
-
const
|
|
184
|
-
let
|
|
242
|
+
const C = "undefined" != typeof globalThis && void 0 !== globalThis.window, M = "undefined" != typeof globalThis && void 0 !== globalThis.document, $ = "undefined" != typeof globalThis && "localStorage" in globalThis, A = "undefined" != typeof globalThis && "sessionStorage" in globalThis, F = "sailfishSessionId", L = "__sailfish_refresh__";
|
|
243
|
+
let R = null;
|
|
185
244
|
function getOrSetSessionId() {
|
|
186
|
-
if (!
|
|
187
|
-
if (
|
|
188
|
-
const e2 = window.name.startsWith(
|
|
245
|
+
if (!C) return uuidv4();
|
|
246
|
+
if (R) return R;
|
|
247
|
+
const e2 = window.name.startsWith(L);
|
|
189
248
|
if (e2 && (window.name = window.name.substring(20)), e2) {
|
|
190
|
-
const e3 = window.sessionStorage.getItem(
|
|
191
|
-
if (e3) return
|
|
249
|
+
const e3 = window.sessionStorage.getItem(F);
|
|
250
|
+
if (e3) return R = e3, e3;
|
|
192
251
|
}
|
|
193
252
|
const t2 = uuidv4();
|
|
194
|
-
|
|
253
|
+
R = t2;
|
|
195
254
|
try {
|
|
196
|
-
window.sessionStorage.setItem(
|
|
255
|
+
window.sessionStorage.setItem(F, t2);
|
|
197
256
|
} catch (e3) {
|
|
198
257
|
}
|
|
199
258
|
return t2;
|
|
200
259
|
}
|
|
201
|
-
let
|
|
260
|
+
let D = false;
|
|
202
261
|
function buildBatches(e2, t2, n2) {
|
|
203
262
|
const i2 = {};
|
|
204
263
|
for (const t3 of e2) {
|
|
@@ -207,32 +266,107 @@ function buildBatches(e2, t2, n2) {
|
|
|
207
266
|
}
|
|
208
267
|
const o2 = [];
|
|
209
268
|
for (const e3 in i2) {
|
|
210
|
-
const
|
|
211
|
-
let
|
|
212
|
-
for (const e4 of
|
|
269
|
+
const r2 = i2[e3];
|
|
270
|
+
let s2 = [], a2 = 0;
|
|
271
|
+
for (const e4 of r2) {
|
|
213
272
|
const i3 = t2(e4);
|
|
214
|
-
a2 + i3 > n2 && (
|
|
273
|
+
a2 + i3 > n2 && (s2.length > 0 && (o2.push(s2), s2 = [], a2 = 0), i3 > n2) || (s2.push(e4), a2 += i3);
|
|
215
274
|
}
|
|
216
|
-
|
|
275
|
+
s2.length > 0 && o2.push(s2);
|
|
217
276
|
}
|
|
218
277
|
return o2;
|
|
219
278
|
}
|
|
220
279
|
function eventSize(e2) {
|
|
221
280
|
return JSON.stringify(e2).length;
|
|
222
281
|
}
|
|
223
|
-
let
|
|
282
|
+
let B = Date.now;
|
|
224
283
|
function withAppUrlMetadata(e2) {
|
|
225
284
|
var _a;
|
|
226
285
|
return { ...e2 ?? {}, appUrl: (e2 == null ? void 0 : e2.appUrl) ?? ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.href) };
|
|
227
286
|
}
|
|
228
|
-
/[1-9][0-9]{12}/.test(Date.now().toString()) || (
|
|
229
|
-
const
|
|
230
|
-
let
|
|
231
|
-
|
|
287
|
+
/[1-9][0-9]{12}/.test(Date.now().toString()) || (B = () => (/* @__PURE__ */ new Date()).getTime());
|
|
288
|
+
const P = readDebugFlag(), _ = "per_session";
|
|
289
|
+
let O = null, j = null, U = null, N = null, q = 0, z = false, H = null, W = null;
|
|
290
|
+
const K = [];
|
|
291
|
+
let V = 0, G = 0, Q = false;
|
|
292
|
+
function pushBinaryRing(e2) {
|
|
293
|
+
for (K.push(e2), V += e2.byteLength; V > 8388608 && K.length > 0; ) {
|
|
294
|
+
const e3 = K.shift();
|
|
295
|
+
V -= e3.byteLength, G++;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
async function flushPersistedBinary() {
|
|
299
|
+
if (!isWebSocketOpen(j)) return;
|
|
300
|
+
const e2 = await (async function readAllCanvasFrames() {
|
|
301
|
+
const e3 = await withStore$1("readonly", (e4) => new Promise((t4) => {
|
|
302
|
+
const n3 = e4.getAll();
|
|
303
|
+
n3.onsuccess = () => t4(n3.result), n3.onerror = () => t4([]);
|
|
304
|
+
})) ?? [], t3 = Date.now(), n2 = [], i2 = [];
|
|
305
|
+
for (const o2 of e3) "number" == typeof (o2 == null ? void 0 : o2.timestamp) && t3 - o2.timestamp >= 864e5 ? "number" == typeof o2.id && i2.push(o2.id) : n2.push(o2);
|
|
306
|
+
return i2.length > 0 && deleteCanvasFramesByIds(i2).catch(() => {
|
|
307
|
+
}), n2.sort((e4, t4) => (e4.id ?? 0) - (t4.id ?? 0)), n2;
|
|
308
|
+
})();
|
|
309
|
+
if (0 === e2.length) return;
|
|
310
|
+
const t2 = [];
|
|
311
|
+
for (const n2 of e2) {
|
|
312
|
+
if (!isWebSocketOpen(j)) break;
|
|
313
|
+
if (!_wsSendBinaryNow(n2.buf)) break;
|
|
314
|
+
"number" == typeof n2.id && t2.push(n2.id);
|
|
315
|
+
}
|
|
316
|
+
t2.length > 0 && deleteCanvasFramesByIds(t2).catch(() => {
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
async function flushBinaryBacklog() {
|
|
320
|
+
!(function flushBinaryRing() {
|
|
321
|
+
for (; K.length > 0 && isWebSocketOpen(j); ) {
|
|
322
|
+
const e2 = K.shift();
|
|
323
|
+
if (V -= e2.byteLength, !_wsSendBinaryNow(e2)) {
|
|
324
|
+
K.unshift(e2), V += e2.byteLength;
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
})(), await flushPersistedBinary();
|
|
329
|
+
}
|
|
330
|
+
function getBinaryDropCount() {
|
|
331
|
+
return G;
|
|
332
|
+
}
|
|
333
|
+
function getBufferedAmount() {
|
|
334
|
+
if (O) return q;
|
|
335
|
+
if (N && isWebSocketOpen(j)) try {
|
|
336
|
+
return N();
|
|
337
|
+
} catch {
|
|
338
|
+
return 0;
|
|
339
|
+
}
|
|
340
|
+
return 0;
|
|
341
|
+
}
|
|
342
|
+
function isTransportSaturated() {
|
|
343
|
+
return getBufferedAmount() > 16777216;
|
|
344
|
+
}
|
|
345
|
+
function bufferBinaryOffline(e2) {
|
|
346
|
+
Q = true, persistCanvasFrame(e2).then((t2) => {
|
|
347
|
+
t2 || pushBinaryRing(e2);
|
|
348
|
+
}).catch(() => pushBinaryRing(e2));
|
|
349
|
+
}
|
|
350
|
+
function _wsSendBinaryNow(e2) {
|
|
351
|
+
if (O) try {
|
|
352
|
+
return O.postMessage({ type: "sendBinary", payload: e2 }, [e2]), true;
|
|
353
|
+
} catch {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
try {
|
|
357
|
+
return U ? (U(e2), true) : (j.send(e2), true);
|
|
358
|
+
} catch {
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
function wsSendBinary(e2) {
|
|
363
|
+
return z || !isWebSocketOpen(j) ? (bufferBinaryOffline(e2), false) : !!_wsSendBinaryNow(e2) || (bufferBinaryOffline(e2), false);
|
|
364
|
+
}
|
|
365
|
+
let X = null, J = 0;
|
|
232
366
|
function requestTimeSync() {
|
|
233
|
-
if (!isWebSocketOpen(
|
|
367
|
+
if (!isWebSocketOpen(j)) return;
|
|
234
368
|
const e2 = getClockSyncManager(), t2 = (function makeTimeSyncRequestId() {
|
|
235
|
-
return
|
|
369
|
+
return J += 1, `ts-${J}-${Math.random().toString(36).slice(2, 10)}`;
|
|
236
370
|
})();
|
|
237
371
|
e2.beginSync(t2);
|
|
238
372
|
wsSendPayload({ type: "time-sync-request", requestId: t2, clientSentAtMs: Date.now() }) || e2.abandonSync(t2);
|
|
@@ -247,21 +381,21 @@ function enrichEventWithTimeSync(e2) {
|
|
|
247
381
|
const t2 = buildEventTimeEnvelope(monotonicNow(), Date.now());
|
|
248
382
|
e2.client = t2.client, e2.serverEstimated = t2.serverEstimated;
|
|
249
383
|
}
|
|
250
|
-
let
|
|
251
|
-
const
|
|
384
|
+
let Y = "", Z = "", ee = false;
|
|
385
|
+
const te = [];
|
|
252
386
|
function onNavigationChange(e2) {
|
|
253
|
-
|
|
387
|
+
te.push(e2);
|
|
254
388
|
}
|
|
255
389
|
function _updateHrefCache() {
|
|
256
|
-
|
|
257
|
-
for (const e2 of
|
|
390
|
+
Y = window.location.href, Z = window.location.origin + window.location.pathname;
|
|
391
|
+
for (const e2 of te) try {
|
|
258
392
|
e2();
|
|
259
393
|
} catch (e3) {
|
|
260
394
|
}
|
|
261
395
|
}
|
|
262
396
|
function ensureHrefCache() {
|
|
263
|
-
if (
|
|
264
|
-
|
|
397
|
+
if (ee || "undefined" == typeof window) return;
|
|
398
|
+
ee = true, _updateHrefCache(), window.addEventListener("popstate", _updateHrefCache), window.addEventListener("hashchange", _updateHrefCache);
|
|
265
399
|
const e2 = history.pushState;
|
|
266
400
|
history.pushState = function(...t3) {
|
|
267
401
|
e2.apply(this, t3), _updateHrefCache();
|
|
@@ -272,48 +406,48 @@ function ensureHrefCache() {
|
|
|
272
406
|
};
|
|
273
407
|
}
|
|
274
408
|
function getCachedHref() {
|
|
275
|
-
return
|
|
409
|
+
return Y || ("undefined" != typeof window ? window.location.href : "");
|
|
276
410
|
}
|
|
277
411
|
function getCachedHrefNoQuery() {
|
|
278
|
-
return
|
|
412
|
+
return Z || ("undefined" != typeof window ? window.location.origin + window.location.pathname : "");
|
|
279
413
|
}
|
|
280
|
-
const
|
|
281
|
-
let
|
|
414
|
+
const ne = [];
|
|
415
|
+
let ie = null;
|
|
282
416
|
function queueEventForIDB(e2) {
|
|
283
|
-
|
|
417
|
+
ne.push(e2), ne.length >= 50 ? _flushIDBQueue() : ie || (ie = setTimeout(_flushIDBQueue, 100));
|
|
284
418
|
}
|
|
285
419
|
function _flushIDBQueue() {
|
|
286
|
-
if (
|
|
420
|
+
if (ie && (clearTimeout(ie), ie = null), 0 === ne.length) return;
|
|
287
421
|
!(async function saveEventsToIDB(e2) {
|
|
288
|
-
await withStore$
|
|
422
|
+
await withStore$2("readwrite", async (t2) => {
|
|
289
423
|
for (const n2 of e2) t2.add({ timestamp: Date.now(), data: n2 });
|
|
290
424
|
});
|
|
291
|
-
})(
|
|
425
|
+
})(ne.splice(0));
|
|
292
426
|
}
|
|
293
|
-
let
|
|
294
|
-
const
|
|
427
|
+
let oe = false, re = null, se = null, ae = false;
|
|
428
|
+
const ce = "sailfish_funcspan_global_state";
|
|
295
429
|
function wsSendPayload(e2) {
|
|
296
|
-
if (!isWebSocketOpen(
|
|
297
|
-
if (
|
|
298
|
-
return
|
|
430
|
+
if (!isWebSocketOpen(j)) return false;
|
|
431
|
+
if (O) try {
|
|
432
|
+
return O.postMessage({ type: "send", payload: e2 }), true;
|
|
299
433
|
} catch {
|
|
300
434
|
return false;
|
|
301
435
|
}
|
|
302
436
|
try {
|
|
303
|
-
return
|
|
437
|
+
return j.send(JSON.stringify(e2)), true;
|
|
304
438
|
} catch {
|
|
305
439
|
return false;
|
|
306
440
|
}
|
|
307
441
|
}
|
|
308
442
|
function wsSendRaw(e2) {
|
|
309
|
-
if (!isWebSocketOpen(
|
|
310
|
-
if (
|
|
311
|
-
return
|
|
443
|
+
if (!isWebSocketOpen(j)) return false;
|
|
444
|
+
if (O) try {
|
|
445
|
+
return O.postMessage({ type: "sendRaw", payload: e2 }), true;
|
|
312
446
|
} catch {
|
|
313
447
|
return false;
|
|
314
448
|
}
|
|
315
449
|
try {
|
|
316
|
-
return
|
|
450
|
+
return j.send(e2), true;
|
|
317
451
|
} catch {
|
|
318
452
|
return false;
|
|
319
453
|
}
|
|
@@ -322,40 +456,40 @@ function saveGlobalFuncSpanState(e2, t2) {
|
|
|
322
456
|
try {
|
|
323
457
|
if ("undefined" == typeof localStorage) return;
|
|
324
458
|
const n2 = { enabled: e2, expirationTimestampMs: t2, savedAt: Date.now() };
|
|
325
|
-
localStorage.setItem(
|
|
459
|
+
localStorage.setItem(ce, JSON.stringify(n2)), P && console.log("[Sailfish] Saved funcSpan state to localStorage:", n2);
|
|
326
460
|
} catch (e3) {
|
|
327
|
-
|
|
461
|
+
P && console.warn("[Sailfish] Failed to save funcSpan state to localStorage:", e3);
|
|
328
462
|
}
|
|
329
463
|
}
|
|
330
464
|
function clearGlobalFuncSpanState() {
|
|
331
465
|
try {
|
|
332
466
|
if ("undefined" == typeof localStorage) return;
|
|
333
|
-
localStorage.removeItem(
|
|
467
|
+
localStorage.removeItem(ce), P && console.log("[Sailfish] Cleared funcSpan state from localStorage");
|
|
334
468
|
} catch (e2) {
|
|
335
|
-
|
|
469
|
+
P && console.warn("[Sailfish] Failed to clear funcSpan state from localStorage:", e2);
|
|
336
470
|
}
|
|
337
471
|
}
|
|
338
472
|
function clearStaleFuncSpanState() {
|
|
339
|
-
|
|
473
|
+
oe = false, se = null, ae = false, clearGlobalFuncSpanState(), P && console.log("[Sailfish] Cleared stale function span tracking state (backend validation failed)");
|
|
340
474
|
}
|
|
341
|
-
let
|
|
475
|
+
let le = false;
|
|
342
476
|
function restoreFuncSpanState() {
|
|
343
|
-
if (
|
|
344
|
-
|
|
477
|
+
if (le) return;
|
|
478
|
+
le = true;
|
|
345
479
|
const e2 = (function loadGlobalFuncSpanState() {
|
|
346
480
|
try {
|
|
347
481
|
if ("undefined" == typeof localStorage) return null;
|
|
348
|
-
const e3 = localStorage.getItem(
|
|
482
|
+
const e3 = localStorage.getItem(ce);
|
|
349
483
|
if (!e3) return null;
|
|
350
484
|
const t2 = JSON.parse(e3);
|
|
351
|
-
return
|
|
485
|
+
return P && console.log("[Sailfish] Loaded funcSpan state from localStorage:", t2), t2;
|
|
352
486
|
} catch (e3) {
|
|
353
|
-
return
|
|
487
|
+
return P && console.warn("[Sailfish] Failed to load funcSpan state from localStorage:", e3), null;
|
|
354
488
|
}
|
|
355
489
|
})();
|
|
356
|
-
if (e2 && e2.enabled) if (
|
|
357
|
-
Date.now() >=
|
|
358
|
-
} else
|
|
490
|
+
if (e2 && e2.enabled) if (oe = true, se = e2.expirationTimestampMs, ae = false, P && console.log("[Sailfish] Restored global function span tracking from localStorage:", { enabled: true, expirationTime: se }), null !== se) {
|
|
491
|
+
Date.now() >= se ? (oe = false, se = null, clearGlobalFuncSpanState(), P && console.log("[Sailfish] Persisted tracking already expired, cleared state")) : P && console.log("[Sailfish] Function span tracking is active and valid (temporary until WebSocket confirms)");
|
|
492
|
+
} else P && console.log("[Sailfish] Function span tracking is active (no expiration, temporary until WebSocket confirms)");
|
|
359
493
|
}
|
|
360
494
|
function isWebSocketOpen(e2) {
|
|
361
495
|
return (e2 == null ? void 0 : e2.readyState) === WebSocket.OPEN;
|
|
@@ -367,7 +501,7 @@ async function flushNotifyQueue() {
|
|
|
367
501
|
n2.onsuccess = () => t2(n2.result), n2.onerror = () => t2([]);
|
|
368
502
|
})) ?? [];
|
|
369
503
|
})();
|
|
370
|
-
if (isWebSocketOpen(
|
|
504
|
+
if (isWebSocketOpen(j)) try {
|
|
371
505
|
for (const t2 of e2) {
|
|
372
506
|
if (!wsSendRaw(t2.value)) break;
|
|
373
507
|
await deleteNotifyMessageById(t2.id);
|
|
@@ -376,12 +510,12 @@ async function flushNotifyQueue() {
|
|
|
376
510
|
}
|
|
377
511
|
}
|
|
378
512
|
async function flushBufferedEvents() {
|
|
379
|
-
if (isWebSocketOpen(
|
|
513
|
+
if (isWebSocketOpen(j)) if (H) await H;
|
|
380
514
|
else {
|
|
381
|
-
|
|
515
|
+
H = (async () => {
|
|
382
516
|
var _a, _b;
|
|
383
517
|
const e2 = await (async function getAllIndexedEvents() {
|
|
384
|
-
const e3 = await withStore$
|
|
518
|
+
const e3 = await withStore$2("readonly", (e4) => new Promise((t4) => {
|
|
385
519
|
const n3 = e4.getAll();
|
|
386
520
|
n3.onsuccess = () => t4(n3.result), n3.onerror = () => t4([]);
|
|
387
521
|
})) ?? [], t3 = Date.now(), n2 = [], i2 = [];
|
|
@@ -396,7 +530,7 @@ async function flushBufferedEvents() {
|
|
|
396
530
|
for (const e3 of Object.values(t2)) {
|
|
397
531
|
const t3 = buildBatches(e3, (e4) => eventSize(e4.data), 52428800);
|
|
398
532
|
for (const e4 of t3) {
|
|
399
|
-
if (!isWebSocketOpen(
|
|
533
|
+
if (!isWebSocketOpen(j)) break;
|
|
400
534
|
const t4 = e4.map((e5) => (e5.data.appUrl || (e5.data.appUrl = getCachedHref()), enrichEventWithTimeSync(e5.data), e5.data)), n2 = e4.map((e5) => e5.id).filter((e5) => null != e5);
|
|
401
535
|
try {
|
|
402
536
|
wsSendPayload({ type: "events", events: t4, mapUuid: window.sfMapUuid }) && await deleteEventsByIds(n2);
|
|
@@ -406,181 +540,183 @@ async function flushBufferedEvents() {
|
|
|
406
540
|
}
|
|
407
541
|
})();
|
|
408
542
|
try {
|
|
409
|
-
await
|
|
543
|
+
await H;
|
|
410
544
|
} finally {
|
|
411
|
-
|
|
545
|
+
H = null;
|
|
412
546
|
}
|
|
413
547
|
}
|
|
414
548
|
}
|
|
415
549
|
function sendEvent(e2) {
|
|
416
|
-
e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(e2), !
|
|
550
|
+
e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(e2), !z && isWebSocketOpen(j) && wsSendPayload({ type: "event", event: e2, mapUuid: window.sfMapUuid }) || queueEventForIDB(e2);
|
|
417
551
|
}
|
|
418
552
|
function handleWsOpen() {
|
|
419
|
-
|
|
553
|
+
P && (console.log("[Sailfish] WebSocket connection opened"), console.log("[Sailfish] Function span tracking state: " + (oe ? "ENABLED" : "DISABLED"))), (async () => {
|
|
420
554
|
try {
|
|
421
|
-
|
|
555
|
+
z = true, await flushNotifyQueue(), await flushBufferedEvents();
|
|
422
556
|
} finally {
|
|
423
|
-
|
|
557
|
+
z = false;
|
|
424
558
|
}
|
|
425
|
-
null !=
|
|
426
|
-
flushBufferedEvents();
|
|
559
|
+
await flushBinaryBacklog(), null != W && clearInterval(W), W = window.setInterval(() => {
|
|
560
|
+
flushBufferedEvents(), Q && flushBinaryBacklog();
|
|
427
561
|
}, 2e3);
|
|
428
562
|
})(), (function kickoffTimeSyncBurst() {
|
|
429
563
|
if ("undefined" != typeof window) for (let e2 = 0; e2 < 3; e2++) window.setTimeout(requestTimeSync, 250 * e2);
|
|
430
564
|
})(), (function startTimeSyncInterval() {
|
|
431
|
-
null ==
|
|
565
|
+
null == X && "undefined" != typeof window && (X = window.setInterval(() => {
|
|
432
566
|
requestTimeSync();
|
|
433
567
|
}, 6e4));
|
|
434
568
|
})();
|
|
435
569
|
}
|
|
436
570
|
function handleWsClose() {
|
|
437
|
-
null !=
|
|
438
|
-
null !=
|
|
439
|
-
})(),
|
|
571
|
+
null != W && (clearInterval(W), W = null), (function stopTimeSyncInterval() {
|
|
572
|
+
null != X && "undefined" != typeof window && (window.clearInterval(X), X = null);
|
|
573
|
+
})(), P && console.log("[Sailfish] WebSocket closed");
|
|
440
574
|
}
|
|
441
575
|
function handleWsMessage(e2) {
|
|
442
576
|
try {
|
|
443
577
|
const t2 = JSON.parse(e2);
|
|
444
578
|
if ("time-sync-response" === t2.type) return void getClockSyncManager().recordTimeSyncResponse({ requestId: t2.requestId, serverReceivedAtMs: t2.serverReceivedAtMs, serverSentAtMs: t2.serverSentAtMs });
|
|
445
|
-
if ("funcSpanTrackingControl" === t2.type) if (
|
|
579
|
+
if ("funcSpanTrackingControl" === t2.type) if (P && console.log("[Sailfish] Received funcSpanTrackingControl message:", { enabled: t2.enabled, timeoutSeconds: t2.timeoutSeconds, expirationTimestampMs: t2.expirationTimestampMs }), null !== re && (window.clearTimeout(re), re = null), oe = t2.enabled, ae = false, P && console.log("[Sailfish] Function span tracking " + (t2.enabled ? "ENABLED (GLOBAL)" : "DISABLED (GLOBAL)")), t2.enabled) {
|
|
446
580
|
if (t2.expirationTimestampMs) {
|
|
447
|
-
|
|
448
|
-
const e3 = Date.now(), n2 =
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
}, n2)) : (
|
|
581
|
+
se = t2.expirationTimestampMs;
|
|
582
|
+
const e3 = Date.now(), n2 = se - e3;
|
|
583
|
+
P && console.log(`[Sailfish] Server expiration timestamp: ${se}, ms until expiration: ${n2}`), n2 > 0 ? (saveGlobalFuncSpanState(true, se), re = window.setTimeout(() => {
|
|
584
|
+
ae || (oe = false, se = null, clearGlobalFuncSpanState(), P && console.log("[Sailfish] GLOBAL function span tracking auto-disabled at server expiration time"), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), P && console.log("[Sailfish] Notified backend that function span tracking expired"));
|
|
585
|
+
}, n2)) : (oe = false, se = null, clearGlobalFuncSpanState(), P && console.log("[Sailfish] Tracking already expired, not enabling"));
|
|
452
586
|
} else {
|
|
453
587
|
const e3 = t2.timeoutSeconds || 3600;
|
|
454
|
-
e3 > 0 && (
|
|
455
|
-
|
|
588
|
+
e3 > 0 && (se = Date.now() + 1e3 * e3, saveGlobalFuncSpanState(true, se), re = window.setTimeout(() => {
|
|
589
|
+
ae || (oe = false, se = null, clearGlobalFuncSpanState(), P && console.log(`[Sailfish] GLOBAL function span tracking auto-disabled after ${e3}s (legacy)`), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), P && console.log("[Sailfish] Notified backend that function span tracking expired (legacy timeout)"));
|
|
456
590
|
}, 1e3 * e3));
|
|
457
591
|
}
|
|
458
592
|
try {
|
|
459
593
|
const e3 = getOrSetSessionId();
|
|
460
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }),
|
|
594
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }), P && console.log(`[Sailfish] GLOBAL tracking session report sent for session: ${e3}`);
|
|
461
595
|
} catch (e3) {
|
|
462
|
-
|
|
596
|
+
P && console.warn("[Sailfish] Failed to send GLOBAL tracking session report:", e3);
|
|
463
597
|
}
|
|
464
|
-
} else
|
|
598
|
+
} else se = null, clearGlobalFuncSpanState();
|
|
465
599
|
} catch (e3) {
|
|
466
600
|
}
|
|
467
601
|
}
|
|
468
|
-
function initializeWebSocket(t2, n2, i2, o2,
|
|
602
|
+
function initializeWebSocket(t2, n2, i2, o2, r2 = false) {
|
|
469
603
|
ensureHrefCache();
|
|
470
|
-
const
|
|
604
|
+
const s2 = (function getWebSocketHost(e2) {
|
|
471
605
|
const t3 = new URL(e2);
|
|
472
606
|
return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
|
|
473
607
|
})(t2);
|
|
474
|
-
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${
|
|
475
|
-
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`),
|
|
608
|
+
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${s2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.12.7`;
|
|
609
|
+
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), U = null, N = null, q = 0, O = r2 ? (function tryCreateWsWorker() {
|
|
476
610
|
if ("undefined" == typeof Worker) return null;
|
|
477
611
|
try {
|
|
478
|
-
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);
|
|
612
|
+
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\n// Backpressure (A11): report the live socket buffer depth to the main thread on\n// a light interval so canvas video capture can throttle frame production when a\n// slow-but-open socket falls behind. Cheap (one number) and off the main thread.\nvar bufferedReportTimer = null;\nfunction startBufferedReporting() {\n if (bufferedReportTimer) return;\n bufferedReportTimer = setInterval(function() {\n var amt = (ws && ws.readyState === 1) ? (ws.bufferedAmount || 0) : 0;\n postMessage({ type: "buffered", bufferedAmount: amt });\n }, 250);\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 startBufferedReporting();\n postMessage({ type: "open" });\n };\n ws.onclose = function() {\n clearTimeout(tid);\n ws = null;\n if (bufferedReportTimer) { clearInterval(bufferedReportTimer); bufferedReportTimer = null; }\n postMessage({ type: "buffered", bufferedAmount: 0 });\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 === "sendBinary") {\n // Binary frames (canvas SFCV). The main thread only posts these while the\n // socket is open; if it closed in the meantime the frame is dropped (the\n // main-thread ring buffer covers the not-open case).\n if (ws && ws.readyState === 1) {\n try { ws.send(msg.payload); } catch (e) {}\n }\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);
|
|
479
613
|
return URL.revokeObjectURL(t3), n3;
|
|
480
614
|
} catch {
|
|
481
615
|
return null;
|
|
482
616
|
}
|
|
483
|
-
})() : null,
|
|
484
|
-
const e2 =
|
|
485
|
-
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(),
|
|
617
|
+
})() : null, O) {
|
|
618
|
+
const e2 = O, t3 = { readyState: WebSocket.CONNECTING, close: () => {
|
|
619
|
+
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(), O = null, null != W && (clearInterval(W), W = null);
|
|
486
620
|
} };
|
|
487
|
-
return
|
|
621
|
+
return j = t3, O.onmessage = (e3) => {
|
|
488
622
|
const n3 = e3.data;
|
|
489
|
-
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, handleWsClose()) : "message" === n3.type
|
|
490
|
-
},
|
|
491
|
-
|
|
492
|
-
},
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
const
|
|
496
|
-
|
|
623
|
+
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, q = 0, handleWsClose()) : "message" === n3.type ? handleWsMessage(n3.data) : "buffered" === n3.type && (q = "number" == typeof n3.bufferedAmount ? n3.bufferedAmount : 0);
|
|
624
|
+
}, O.onerror = () => {
|
|
625
|
+
P && console.warn("[Sailfish] WebSocket worker error");
|
|
626
|
+
}, O.postMessage({ type: "init", wsUrl: a2 }), P && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
|
|
627
|
+
}
|
|
628
|
+
P && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
|
|
629
|
+
const c2 = new e(a2, [], { connectionTimeout: 3e4 });
|
|
630
|
+
c2.binaryType = "arraybuffer", U = (e2) => c2.send(e2), N = () => c2.bufferedAmount || 0;
|
|
631
|
+
const l2 = { get readyState() {
|
|
632
|
+
return c2.readyState;
|
|
497
633
|
}, close: () => {
|
|
498
|
-
|
|
634
|
+
c2.close(), null != W && (clearInterval(W), W = null);
|
|
499
635
|
} };
|
|
500
|
-
return
|
|
636
|
+
return j = l2, c2.addEventListener("open", () => handleWsOpen()), c2.addEventListener("close", () => handleWsClose()), c2.addEventListener("message", (e2) => handleWsMessage(e2.data)), l2;
|
|
501
637
|
}
|
|
502
638
|
function sendMessage(e2) {
|
|
503
|
-
"sessionId" in e2 || (e2.sessionId = getOrSetSessionId()), e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(e2),
|
|
639
|
+
"sessionId" in e2 || (e2.sessionId = getOrSetSessionId()), e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(e2), z || !isWebSocketOpen(j) ? saveNotifyMessageToIDB(JSON.stringify(e2)) : wsSendPayload(e2) || saveNotifyMessageToIDB(JSON.stringify(e2));
|
|
504
640
|
}
|
|
505
641
|
function enableFunctionSpanTracking() {
|
|
506
|
-
if (
|
|
507
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType:
|
|
508
|
-
} else
|
|
642
|
+
if (P && console.log("[Sailfish] enableFunctionSpanTracking() called - Report Issue recording started (LOCAL MODE)"), oe = true, ae = true, se = null, null !== re && (window.clearTimeout(re), re = null), isWebSocketOpen(j)) {
|
|
643
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType: _ });
|
|
644
|
+
} else P && console.warn("[Sailfish] WebSocket not open, cannot report LOCAL tracking session");
|
|
509
645
|
}
|
|
510
646
|
function disableFunctionSpanTracking() {
|
|
511
|
-
if (
|
|
512
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType:
|
|
647
|
+
if (P && console.log("[Sailfish] disableFunctionSpanTracking() called - Report Issue recording stopped"), isWebSocketOpen(j)) {
|
|
648
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType: _ });
|
|
513
649
|
} else console.warn("[FUNCSPAN STOP] ✗ WebSocket not open, cannot notify tracking end");
|
|
514
|
-
|
|
650
|
+
ae && (oe = false, ae = false, se = null, P && console.log("[Sailfish] LOCAL tracking mode disabled")), null !== re && (window.clearTimeout(re), re = null);
|
|
515
651
|
}
|
|
516
652
|
function isFunctionSpanTrackingEnabled() {
|
|
517
|
-
return
|
|
653
|
+
return oe;
|
|
518
654
|
}
|
|
519
655
|
function initializeFunctionSpanTrackingFromApi(e2) {
|
|
520
|
-
e2 && !
|
|
656
|
+
e2 && !oe ? (oe = true, ae = false, se = null, P && console.log("[Sailfish] Function span tracking initialized as ENABLED from API check")) : !e2 && oe && (oe = false, ae = false, se = null, P && console.log("[Sailfish] Function span tracking initialized as DISABLED from API check"));
|
|
521
657
|
}
|
|
522
658
|
function getFuncSpanHeader() {
|
|
523
|
-
if (!
|
|
524
|
-
if (null !==
|
|
525
|
-
if (Date.now() >=
|
|
659
|
+
if (!oe) return null;
|
|
660
|
+
if (null !== se) {
|
|
661
|
+
if (Date.now() >= se) return oe = false, se = null, clearGlobalFuncSpanState(), P && console.log("[Sailfish] Function span tracking expired on header check - disabling now"), null;
|
|
526
662
|
}
|
|
527
663
|
return { name: "X-Sf3-FunctionSpanCaptureOverride", value: "1-1-10-10-1-1.0-1-0-0" };
|
|
528
664
|
}
|
|
529
|
-
const
|
|
530
|
-
let
|
|
665
|
+
const de = Object.freeze(Object.defineProperty({ __proto__: null, clearStaleFuncSpanState, disableFunctionSpanTracking, enableFunctionSpanTracking, ensureHrefCache, flushBufferedEvents, getBinaryDropCount, getBufferedAmount, getCachedHref, getCachedHrefNoQuery, getFuncSpanHeader, initializeFunctionSpanTrackingFromApi, initializeWebSocket, isFunctionSpanTrackingEnabled, isTransportSaturated, onNavigationChange, requestTimeSync, restoreFuncSpanState, sendEvent, sendMessage, wsSendBinary }, Symbol.toStringTag, { value: "Module" }));
|
|
666
|
+
let ue = null, pe = null;
|
|
531
667
|
function getIdentifiedUser() {
|
|
532
|
-
return
|
|
668
|
+
return ue;
|
|
533
669
|
}
|
|
534
670
|
function identify(e2, t2 = {}, n2 = false) {
|
|
535
671
|
const i2 = { type: "identify", userId: e2, traits: t2 };
|
|
536
|
-
|
|
672
|
+
ue && ue.userId === e2 && JSON.stringify(ue.traits) === JSON.stringify(t2) || (ue = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
|
|
537
673
|
}
|
|
538
674
|
function addOrUpdateMetadata(e2) {
|
|
539
675
|
const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
540
|
-
|
|
676
|
+
pe && JSON.stringify(pe) === JSON.stringify(e2) || (pe = e2, sendMessage(t2));
|
|
541
677
|
}
|
|
542
678
|
function trackingEvent(e2) {
|
|
543
|
-
sendMessage({ type: "trackingEvent", trackingData: e2, timestamp:
|
|
679
|
+
sendMessage({ type: "trackingEvent", trackingData: e2, timestamp: B() });
|
|
544
680
|
}
|
|
545
|
-
let
|
|
546
|
-
const
|
|
681
|
+
let fe = null;
|
|
682
|
+
const ge = ["https://api.ipify.org?format=json", "https://api.ip.sb/jsonip", "https://api4.my-ip.io/ip.json"];
|
|
547
683
|
function fetchAndSendIp(e2) {
|
|
548
|
-
|
|
549
|
-
for (const e3 of
|
|
684
|
+
fe !== e2 && (fe = e2, (async () => {
|
|
685
|
+
for (const e3 of ge) try {
|
|
550
686
|
const t2 = new AbortController(), n2 = setTimeout(() => t2.abort(), 5e3), i2 = await fetch(e3, { signal: t2.signal });
|
|
551
687
|
if (clearTimeout(n2), !i2.ok) continue;
|
|
552
|
-
const o2 = await i2.json(),
|
|
553
|
-
if (
|
|
688
|
+
const o2 = await i2.json(), r2 = o2.ip || o2.origin || null;
|
|
689
|
+
if (r2 && "string" == typeof r2 && r2.length <= 45) return void sendMessage({ type: "visitorIp", ip: r2, timestamp: B() });
|
|
554
690
|
} catch {
|
|
555
691
|
}
|
|
556
|
-
|
|
692
|
+
fe = null;
|
|
557
693
|
})().catch(() => {
|
|
558
|
-
|
|
694
|
+
fe = null;
|
|
559
695
|
}));
|
|
560
696
|
}
|
|
561
|
-
let
|
|
697
|
+
let me = null;
|
|
562
698
|
async function getSourceMapModule() {
|
|
563
|
-
return
|
|
699
|
+
return me || (me = await import("source-map-js")), me;
|
|
564
700
|
}
|
|
565
|
-
const
|
|
701
|
+
const he = /* @__PURE__ */ new Map(), ye = /(?:\(|\s|^)(https?:\/\/[^)\s]+|\/[^)\s]+|[^)\s]+)?\/?([^/]+\.js)(?:\?[^:)]*)?:(\d+):(\d+)/;
|
|
566
702
|
async function getConsumerFor(e2, t2) {
|
|
567
703
|
const n2 = (e2 || `/assets/${t2}`).split("?")[0], i2 = [`${n2}.map`, n2.replace(/\.js$/, ".js.map"), `/assets/${t2}.map`], { SourceMapConsumer: o2 } = await getSourceMapModule();
|
|
568
704
|
for (const e3 of i2) try {
|
|
569
|
-
if (
|
|
705
|
+
if (he.has(e3)) return he.get(e3);
|
|
570
706
|
const t3 = await fetch(e3);
|
|
571
707
|
if (!t3.ok) continue;
|
|
572
708
|
const n3 = await t3.json();
|
|
573
709
|
if (!n3 || !n3.mappings || !n3.sources) continue;
|
|
574
710
|
const i3 = await new o2(n3);
|
|
575
|
-
return
|
|
711
|
+
return he.set(e3, i3), i3;
|
|
576
712
|
} catch {
|
|
577
713
|
}
|
|
578
714
|
return null;
|
|
579
715
|
}
|
|
580
716
|
async function captureError(e2, t2 = false, n2) {
|
|
581
717
|
let i2, o2;
|
|
582
|
-
const
|
|
583
|
-
e2 instanceof Error ? (i2 = e2.message || e2.name, o2 = e2.stack || "No stack trace",
|
|
718
|
+
const r2 = [];
|
|
719
|
+
e2 instanceof Error ? (i2 = e2.message || e2.name, o2 = e2.stack || "No stack trace", r2.push(`${e2.name}: ${i2}`)) : "string" == typeof e2 ? (i2 = e2, o2 = "No stack trace available", r2.push(t2 ? `Uncaught (in promise) ${e2}` : e2)) : (i2 = (function describeNonError(e3) {
|
|
584
720
|
if (null === e3) return "null";
|
|
585
721
|
if (void 0 === e3) return "undefined";
|
|
586
722
|
if ("string" == typeof e3) return e3;
|
|
@@ -594,83 +730,83 @@ async function captureError(e2, t2 = false, n2) {
|
|
|
594
730
|
} catch {
|
|
595
731
|
return Object.prototype.toString.call(e3);
|
|
596
732
|
}
|
|
597
|
-
})(e2), o2 = "No stack trace available",
|
|
598
|
-
const
|
|
733
|
+
})(e2), o2 = "No stack trace available", r2.push(t2 ? `Uncaught (in promise) ${i2}` : i2)), (n2 == null ? void 0 : n2.filename) && r2.push(`at ${n2.filename}:${n2.lineno ?? 0}:${n2.colno ?? 0}`);
|
|
734
|
+
const s2 = await (async function resolveStackTrace(e3) {
|
|
599
735
|
if (!e3) return ["No stack trace available"];
|
|
600
736
|
const t3 = Array.isArray(e3) ? e3 : e3.split("\n"), n3 = [];
|
|
601
737
|
for (const e4 of t3) {
|
|
602
|
-
const t4 = e4.match(
|
|
738
|
+
const t4 = e4.match(ye);
|
|
603
739
|
if (!t4) {
|
|
604
740
|
n3.push(e4);
|
|
605
741
|
continue;
|
|
606
742
|
}
|
|
607
|
-
const [, i3, o3,
|
|
608
|
-
if (!Number.isFinite(a3) || !Number.isFinite(
|
|
743
|
+
const [, i3, o3, r3, s3] = t4, a3 = parseInt(r3, 10), c3 = Math.max(0, parseInt(s3, 10) - 1);
|
|
744
|
+
if (!Number.isFinite(a3) || !Number.isFinite(c3)) {
|
|
609
745
|
n3.push(e4 + " [Invalid line/column]");
|
|
610
746
|
continue;
|
|
611
747
|
}
|
|
612
|
-
const
|
|
613
|
-
if (!
|
|
748
|
+
const l3 = await getConsumerFor(i3, o3);
|
|
749
|
+
if (!l3) {
|
|
614
750
|
n3.push(`${e4} [No source map found for ${o3}]`);
|
|
615
751
|
continue;
|
|
616
752
|
}
|
|
617
753
|
const { SourceMapConsumer: d2 } = await getSourceMapModule();
|
|
618
|
-
let u2 =
|
|
619
|
-
if (!u2.source || null == u2.line) for (let e5 = 1; e5 <= 20 && (u2 =
|
|
754
|
+
let u2 = l3.originalPositionFor({ line: a3, column: c3, bias: d2.GREATEST_LOWER_BOUND });
|
|
755
|
+
if (!u2.source || null == u2.line) for (let e5 = 1; e5 <= 20 && (u2 = l3.originalPositionFor({ line: a3, column: Math.max(0, c3 - e5), bias: d2.GREATEST_LOWER_BOUND }), !u2.source || null == u2.line); e5++) ;
|
|
620
756
|
if (u2.source && null != u2.line) {
|
|
621
757
|
const e5 = u2.name || "anonymous";
|
|
622
758
|
n3.push(`${u2.source}:${u2.line}:${u2.column ?? 0} (${e5})`);
|
|
623
759
|
} else n3.push(`${e4} [No mapping found in ${o3}]`);
|
|
624
760
|
}
|
|
625
761
|
return n3;
|
|
626
|
-
})(o2), a2 =
|
|
627
|
-
sendMessage({ type: "event", event: { type: 6, timestamp:
|
|
628
|
-
}
|
|
629
|
-
const
|
|
630
|
-
const
|
|
631
|
-
function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3,
|
|
632
|
-
const
|
|
633
|
-
return
|
|
634
|
-
let
|
|
762
|
+
})(o2), a2 = s2.filter((e3) => !e3.includes("chunk-") && !e3.includes("react-dom")), c2 = a2.length > 0 ? a2 : s2, l2 = Date.now();
|
|
763
|
+
sendMessage({ type: "event", event: { type: 6, timestamp: l2, data: { payload: { message: i2, stack: o2, trace: c2, filteredStack: a2, payload: r2, userAgent: navigator.userAgent, url: window.location.href, timestamp: l2, level: "error" } } } });
|
|
764
|
+
}
|
|
765
|
+
const be = readDebugFlag();
|
|
766
|
+
const ve = readDebugFlag();
|
|
767
|
+
function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3, r2 = 2) {
|
|
768
|
+
const s2 = `${n2.backendApi}/graphql/?apiKey=${n2.apiKey}`;
|
|
769
|
+
return ve && console.log(`Initial GraphQL request for ${e2} at ${s2}`), (function exponentialBackoff(e3, t3, n3 = 5, i3 = 2e3, o3 = 2) {
|
|
770
|
+
let r3 = 0;
|
|
635
771
|
const attemptRequest = async () => {
|
|
636
772
|
try {
|
|
637
773
|
return await e3();
|
|
638
774
|
} catch (e4) {
|
|
639
|
-
if (
|
|
640
|
-
const
|
|
641
|
-
return
|
|
775
|
+
if (r3++, r3 > n3) throw e4;
|
|
776
|
+
const s3 = i3 * Math.pow(o3, r3 - 1);
|
|
777
|
+
return be && console.log(`Attempt ${r3} failed: ${t3}; Retrying in ${s3}ms...`), await new Promise((e5) => setTimeout(e5, s3)), attemptRequest();
|
|
642
778
|
}
|
|
643
779
|
};
|
|
644
780
|
return attemptRequest();
|
|
645
|
-
})(() => fetch(
|
|
646
|
-
if (
|
|
781
|
+
})(() => fetch(s2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ operationName: e2, query: t2, variables: n2 }) }).then((e3) => {
|
|
782
|
+
if (ve && console.log(`Received response with status: ${e3.status}`), !e3.ok) throw new Error(`GraphQL request failed with status ${e3.status}`);
|
|
647
783
|
return e3.json();
|
|
648
|
-
}), "Sending GraphQL request to Sailfish AI", i2, o2,
|
|
784
|
+
}), "Sending GraphQL request to Sailfish AI", i2, o2, r2);
|
|
649
785
|
}
|
|
650
786
|
function fetchCaptureSettings(e2, t2) {
|
|
651
|
-
return sendGraphQLRequest("GetCaptureSettingsFromApiKey", "\n query GetCaptureSettingsFromApiKey($apiKey: String!) {\n captureSettingsFromApiKey(apiKey: $apiKey) {\n recordCanvas\n recordCrossOriginIframes\n collectFonts\n inlineImages\n recordPassword\n recordRealName\n recordCreditCardInfo\n recordSsn\n recordDob\n sampling\n textEditThrottleEnabled\n maskInputSelector\n maskTextSelector\n blockSelector\n unmaskSelector\n maskInputOptions\n }\n }\n ", { apiKey: e2, backendApi: t2 });
|
|
787
|
+
return sendGraphQLRequest("GetCaptureSettingsFromApiKey", "\n query GetCaptureSettingsFromApiKey($apiKey: String!) {\n captureSettingsFromApiKey(apiKey: $apiKey) {\n recordCanvas\n recordCanvasSf\n recordCrossOriginIframes\n collectFonts\n inlineImages\n recordPassword\n recordRealName\n recordCreditCardInfo\n recordSsn\n recordDob\n sampling\n textEditThrottleEnabled\n maskInputSelector\n maskTextSelector\n blockSelector\n unmaskSelector\n maskInputOptions\n maskCanvasText\n }\n }\n ", { apiKey: e2, backendApi: t2 });
|
|
652
788
|
}
|
|
653
789
|
function fetchFunctionSpanTrackingEnabled(e2, t2) {
|
|
654
790
|
return sendGraphQLRequest("GetFunctionSpanTrackingEnabledFromApiKey", "\n query GetFunctionSpanTrackingEnabledFromApiKey($apiKey: String!) {\n isFunctionSpanTrackingEnabledFromApiKey(apiKey: $apiKey)\n }\n ", { apiKey: e2, backendApi: t2 });
|
|
655
791
|
}
|
|
656
|
-
function startRecordingSession(e2, t2, n2, i2, o2,
|
|
657
|
-
return sendGraphQLRequest("StartSession", "mutation StartSession(\n $apiKey: UUID!,\n $recordingSessionId: UUID!,\n $serviceIdentifier: String!,\n $serviceVersion: String,\n $mapUuid: String,\n $gitSha: String,\n $library: String,\n $serviceAdditionalMetadata: JSON,\n $startRecordingFilePath: String,\n $startRecordingLineNumber: Int\n ) {\n startRecordingSession(\n companyApiKey: $apiKey,\n sessionId: $recordingSessionId,\n serviceIdentifier: $serviceIdentifier,\n serviceVersion: $serviceVersion,\n mapUuid: $mapUuid,\n gitSha: $gitSha,\n library: $library,\n serviceAdditionalMetadata: $serviceAdditionalMetadata,\n startRecordingFilePath: $startRecordingFilePath,\n startRecordingLineNumber: $startRecordingLineNumber\n ) {\n id\n }\n }", { apiKey: e2, recordingSessionId: t2, backendApi: n2, serviceIdentifier: i2, serviceVersion: o2, mapUuid:
|
|
792
|
+
function startRecordingSession(e2, t2, n2, i2, o2, r2, s2, a2, c2, l2, d2, u2) {
|
|
793
|
+
return sendGraphQLRequest("StartSession", "mutation StartSession(\n $apiKey: UUID!,\n $recordingSessionId: UUID!,\n $serviceIdentifier: String!,\n $serviceVersion: String,\n $mapUuid: String,\n $gitSha: String,\n $gitOrg: String,\n $gitRepo: String,\n $gitProvider: String,\n $library: String,\n $serviceAdditionalMetadata: JSON,\n $startRecordingFilePath: String,\n $startRecordingLineNumber: Int\n ) {\n startRecordingSession(\n companyApiKey: $apiKey,\n sessionId: $recordingSessionId,\n serviceIdentifier: $serviceIdentifier,\n serviceVersion: $serviceVersion,\n mapUuid: $mapUuid,\n gitSha: $gitSha,\n gitOrg: $gitOrg,\n gitRepo: $gitRepo,\n gitProvider: $gitProvider,\n library: $library,\n serviceAdditionalMetadata: $serviceAdditionalMetadata,\n startRecordingFilePath: $startRecordingFilePath,\n startRecordingLineNumber: $startRecordingLineNumber\n ) {\n id\n }\n }", { apiKey: e2, recordingSessionId: t2, backendApi: n2, serviceIdentifier: i2, serviceVersion: o2, mapUuid: r2, gitSha: s2, gitOrg: l2, gitRepo: d2, gitProvider: u2, library: a2, serviceAdditionalMetadata: c2, startRecordingFilePath: null, startRecordingLineNumber: null });
|
|
658
794
|
}
|
|
659
795
|
function sendDomainsToNotPropagateHeaderTo(e2, t2, n2) {
|
|
660
796
|
return sendGraphQLRequest("DomainsToNotPassHeaderTo", "mutation DomainsToNotPassHeaderTo($apiKey: String!, $domains: [String!]!) {\n domainsToNotPassHeaderTo(apiKey: $apiKey, domains: $domains)\n }", { apiKey: e2, domains: t2, backendApi: n2 });
|
|
661
797
|
}
|
|
662
|
-
function createTriageFromRecorder(e2, t2, n2, i2, o2,
|
|
663
|
-
return sendGraphQLRequest("CreateTriageFromRecorder", "mutation CreateTriageFromRecorder(\n $apiKey: String!,\n $recordingSessionId: String!,\n $timestampStart: String!,\n $timestampEnd: String!,\n $description: String,\n $triageSource: TriageSourceEnum\n ) {\n createTriageFromRecorder(\n apiKey: $apiKey,\n recordingSessionId: $recordingSessionId,\n timestampStart: $timestampStart,\n timestampEnd: $timestampEnd,\n description: $description,\n triageSource: $triageSource\n ) {\n id\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description:
|
|
798
|
+
function createTriageFromRecorder(e2, t2, n2, i2, o2, r2, s2) {
|
|
799
|
+
return sendGraphQLRequest("CreateTriageFromRecorder", "mutation CreateTriageFromRecorder(\n $apiKey: String!,\n $recordingSessionId: String!,\n $timestampStart: String!,\n $timestampEnd: String!,\n $description: String,\n $triageSource: TriageSourceEnum\n ) {\n createTriageFromRecorder(\n apiKey: $apiKey,\n recordingSessionId: $recordingSessionId,\n timestampStart: $timestampStart,\n timestampEnd: $timestampEnd,\n description: $description,\n triageSource: $triageSource\n ) {\n id\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description: r2, triageSource: s2, backendApi: t2 });
|
|
664
800
|
}
|
|
665
801
|
function fetchEngineeringTicketPlatformIntegrations(e2, t2) {
|
|
666
802
|
return sendGraphQLRequest("GetEngineeringTicketPlatformIntegrationsFromApiKey", "query GetEngineeringTicketPlatformIntegrationsFromApiKey($apiKey: String!) {\n getEngineeringTicketPlatformIntegrationsFromApiKey(apiKey: $apiKey) {\n pushAutoIdentifiedIssues\n provider\n clientId\n defaultPriority\n defaultProject\n defaultTeam\n primaryCloudId\n installed\n projects\n teams\n workflowStates\n webhookState\n clouds\n labels\n sprints\n users\n fieldConfigurations\n invalidFields\n jiraReporterAccountId\n }\n }", { apiKey: e2, backendApi: t2 });
|
|
667
803
|
}
|
|
668
|
-
function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2,
|
|
669
|
-
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 $triageSource: TriageSourceEnum\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 triageSource: $triageSource\n ) {\n id\n title\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description:
|
|
804
|
+
function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2, r2, s2, a2, c2, l2, d2, u2, p2, f2, g2, m2) {
|
|
805
|
+
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 $triageSource: TriageSourceEnum\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 triageSource: $triageSource\n ) {\n id\n title\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description: r2, issueName: s2, issueDescription: a2, createEngineeringTicket: c2, teamId: l2, projectId: d2, priority: u2, labels: p2, issueType: f2, customFields: g2, triageSource: m2, backendApi: t2 });
|
|
670
806
|
}
|
|
671
|
-
const
|
|
807
|
+
const Se = ["/node_modules/", "/@sailfish-ai/", "/@sailfish-rrweb/", "/dist/", "/webpack/", "/vite/", "/__vite", "/react-dom/", "/react/", "/scheduler/", "/<", "/chrome-extension://", "/extensions/"];
|
|
672
808
|
function shouldSkipFrame(e2) {
|
|
673
|
-
return
|
|
809
|
+
return Se.some((t2) => e2.includes(t2));
|
|
674
810
|
}
|
|
675
811
|
function normalizeFilePath(e2) {
|
|
676
812
|
let t2 = e2;
|
|
@@ -736,17 +872,9 @@ function yieldToMain() {
|
|
|
736
872
|
var _a;
|
|
737
873
|
return "undefined" != typeof globalThis && ((_a = globalThis.scheduler) == null ? void 0 : _a.yield) ? globalThis.scheduler.yield() : new Promise((e2) => setTimeout(e2, 0));
|
|
738
874
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
return !!e2.closest(t2);
|
|
743
|
-
} catch {
|
|
744
|
-
return false;
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
const ee = { color: true, date: true, "datetime-local": true, email: true, month: true, number: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true, textarea: true, select: true, password: true };
|
|
748
|
-
let te = null;
|
|
749
|
-
const ne = "sailfishSanitize", ie = "zendesk_chat", oe = "Zendesk";
|
|
875
|
+
const we = { color: true, date: true, "datetime-local": true, email: true, month: true, number: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true, textarea: true, select: true, password: true };
|
|
876
|
+
let ke = null;
|
|
877
|
+
const xe = "sailfishSanitize", Ie = "zendesk_chat", Te = "Zendesk";
|
|
750
878
|
function zE_safe(...e2) {
|
|
751
879
|
try {
|
|
752
880
|
if ((function hasZendesk() {
|
|
@@ -758,32 +886,30 @@ function zE_safe(...e2) {
|
|
|
758
886
|
}
|
|
759
887
|
function maskInputFn(e2, t2) {
|
|
760
888
|
var _a;
|
|
761
|
-
|
|
762
|
-
const n2 = { creditCard: /\b(?:\d[ -]*?){13,16}\b/, ssn: /\b\d{3}-\d{2}-\d{4}\b/ };
|
|
763
|
-
return 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) : "*".repeat(e2.length);
|
|
889
|
+
return "hidden" === t2.type ? "" : t2.hasAttribute("data-cc") || ((_a = t2.getAttribute("autocomplete")) == null ? void 0 : _a.startsWith("cc-")) || o(e2) ? r(e2) : t2.hasAttribute("data-ssn") || s(e2) ? a(e2) : t2.hasAttribute("data-dob") ? c(e2) : "*".repeat(e2.length);
|
|
764
890
|
}
|
|
765
|
-
let
|
|
891
|
+
let Ee = true, Ce = null, Me = null, $e = null, Ae = null;
|
|
766
892
|
function invalidateUrlCache() {
|
|
767
|
-
|
|
893
|
+
Ee = true;
|
|
768
894
|
}
|
|
769
|
-
const getUrlAndStoredUuids = () => (
|
|
770
|
-
|
|
771
|
-
})(), { page_visit_uuid:
|
|
895
|
+
const getUrlAndStoredUuids = () => (Ee && (function _refreshSessionStorageCache() {
|
|
896
|
+
Ce = sessionStorage.getItem("pageVisitUUID"), Me = sessionStorage.getItem("prevPageVisitUUID"), $e = sessionStorage.getItem("tabVisibilityChanged"), Ae = sessionStorage.getItem("tabVisibilityState"), Ee = false;
|
|
897
|
+
})(), { page_visit_uuid: Ce, prev_page_visit_uuid: Me, href: getCachedHrefNoQuery(), tabVisibilityChanged: $e, tabVisibilityState: Ae });
|
|
772
898
|
function initializeDomContentEvents(e2) {
|
|
773
899
|
document.addEventListener("readystatechange", () => {
|
|
774
900
|
const t2 = { type: 24, data: { source: 0, info: "" }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() };
|
|
775
901
|
switch (document.readyState) {
|
|
776
902
|
case "loading":
|
|
777
|
-
t2.data.source =
|
|
903
|
+
t2.data.source = g;
|
|
778
904
|
break;
|
|
779
905
|
case "complete":
|
|
780
|
-
t2.data.source =
|
|
906
|
+
t2.data.source = h;
|
|
781
907
|
}
|
|
782
908
|
t2.data.info && sendEvent(t2);
|
|
783
909
|
}), document.addEventListener("DOMContentLoaded", () => {
|
|
784
|
-
sendEvent({ type: 24, data: { source:
|
|
910
|
+
sendEvent({ type: 24, data: { source: m }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
|
|
785
911
|
}), window.addEventListener("pagehide", () => {
|
|
786
|
-
sendEvent({ type: 24, data: { source:
|
|
912
|
+
sendEvent({ type: 24, data: { source: y }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
|
|
787
913
|
});
|
|
788
914
|
}
|
|
789
915
|
async function initializePerformancePlugin(e2) {
|
|
@@ -803,37 +929,37 @@ async function initializePerformancePlugin(e2) {
|
|
|
803
929
|
async function initializeConsolePlugin(e2, n2) {
|
|
804
930
|
const { getRecordConsolePlugin: i2 } = await import("@sailfish-rrweb/rrweb-plugin-console-record");
|
|
805
931
|
await yieldToMain();
|
|
806
|
-
const { name: o2, observer:
|
|
807
|
-
|
|
808
|
-
const i3 = e3, [
|
|
932
|
+
const { name: o2, observer: r2 } = i2(e2);
|
|
933
|
+
r2((e3) => {
|
|
934
|
+
const i3 = e3, [r3, s2] = getCallerLocationFromTrace(i3 == null ? void 0 : i3.trace, 0), [a2, c2] = getCallerLocation(2), l2 = r3 ?? a2, d2 = s2 ?? c2, u2 = { ...i3, sourceFile: l2, sourceLine: d2 };
|
|
809
935
|
sendEvent({ type: t.Plugin, timestamp: Date.now(), data: { plugin: o2, payload: u2 }, sessionId: n2, ...getUrlAndStoredUuids() });
|
|
810
936
|
}, window, e2);
|
|
811
937
|
}
|
|
812
|
-
async function initializeRecording(e2,
|
|
813
|
-
const
|
|
938
|
+
async function initializeRecording(e2, o2, r2, s2, a2, c2 = true, l2 = false, d2 = false) {
|
|
939
|
+
const u2 = initializeWebSocket(o2, r2, s2, a2, l2);
|
|
814
940
|
try {
|
|
815
|
-
const
|
|
941
|
+
const o3 = (function createThrottledEmit(e3, t2 = 1e3) {
|
|
816
942
|
if (!e3) return { emit: (e4) => sendEvent(e4), flush: () => {
|
|
817
943
|
} };
|
|
818
|
-
const
|
|
819
|
-
let
|
|
944
|
+
const n2 = /* @__PURE__ */ new Map();
|
|
945
|
+
let i2 = null;
|
|
820
946
|
return { emit: (e4) => {
|
|
821
947
|
var _a, _b;
|
|
822
|
-
const
|
|
823
|
-
if (3 !== e4.type || 0 !==
|
|
824
|
-
if (0 ===
|
|
825
|
-
const t3 = e4.data,
|
|
826
|
-
if (
|
|
948
|
+
const o4 = (_a = e4.data) == null ? void 0 : _a.source;
|
|
949
|
+
if (3 !== e4.type || 0 !== o4 && 5 !== o4) return void sendEvent(e4);
|
|
950
|
+
if (0 === o4) {
|
|
951
|
+
const t3 = e4.data, n3 = (t3 == null ? void 0 : t3.adds) && t3.adds.length > 0, i3 = (t3 == null ? void 0 : t3.removes) && t3.removes.length > 0;
|
|
952
|
+
if (n3 || i3) return void sendEvent(e4);
|
|
827
953
|
}
|
|
828
|
-
const
|
|
829
|
-
|
|
830
|
-
0 !==
|
|
954
|
+
const r3 = `3:${o4}:${((_b = e4.data) == null ? void 0 : _b.id) || "unknown"}`;
|
|
955
|
+
n2.set(r3, e4), i2 || (i2 = setInterval(() => {
|
|
956
|
+
0 !== n2.size && (n2.forEach((e5) => sendEvent(e5)), n2.clear());
|
|
831
957
|
}, t2));
|
|
832
958
|
}, flush: () => {
|
|
833
|
-
|
|
959
|
+
n2.size > 0 && (n2.forEach((e4) => sendEvent(e4)), n2.clear()), i2 && (clearInterval(i2), i2 = null);
|
|
834
960
|
} };
|
|
835
961
|
})(e2.textEditThrottleEnabled), emitWithContext = (e3) => {
|
|
836
|
-
Object.assign(e3, getUrlAndStoredUuids()), e3.sessionId =
|
|
962
|
+
Object.assign(e3, getUrlAndStoredUuids()), e3.sessionId = s2, o3.emit(e3);
|
|
837
963
|
}, startHeavyWork = async () => {
|
|
838
964
|
if (true === e2.enableFiberTracking) try {
|
|
839
965
|
const { installFiberHook: e3, processExistingTree: t2 } = await import("./fiberHook-DGANQ2ma.js");
|
|
@@ -841,44 +967,50 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
841
967
|
} catch (e3) {
|
|
842
968
|
console.warn("[Sailfish] Failed to enable Fiber tracking:", e3);
|
|
843
969
|
}
|
|
844
|
-
const { record:
|
|
845
|
-
|
|
846
|
-
const
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
} catch {
|
|
856
|
-
return false;
|
|
857
|
-
}
|
|
858
|
-
})(s4, i4);
|
|
859
|
-
return l3 || c4 ? t2(e4, s4) : e4;
|
|
860
|
-
} : t2;
|
|
861
|
-
})({ baseFn: maskInputFn, unmaskSelector: i3, maskInputSelector: r3, adminMaskInputOptions: a3 }), u2 = /* @__PURE__ */ (function makeMaskTextFn(e3) {
|
|
862
|
-
return (t2, n5) => closestSafe(n5, e3) ? t2 : t2.replace(/\S/g, "*");
|
|
863
|
-
})(i3);
|
|
864
|
-
if (l2) {
|
|
865
|
-
const { chunkedSnapshot: a4 } = await import("./chunkSerializer-pkpgT-FH.js"), l3 = n4.mirror;
|
|
866
|
-
let p2 = true;
|
|
867
|
-
const f2 = [];
|
|
868
|
-
n4({ emit(e3) {
|
|
869
|
-
p2 ? f2.push(e3) : emitWithContext(e3);
|
|
870
|
-
}, ...e2, maskInputOptions: c3, maskInputFn: d2, maskTextFn: u2, maskInputSelector: r3, maskTextSelector: s3, blockSelector: o3, maskTextClass: e2.maskTextClass ?? ne, recordDOM: false });
|
|
871
|
-
const g2 = Date.now(), m2 = await a4(document, l3, { chunkSize: 500, maxChunkMs: 16, blockClass: e2.blockClass, blockSelector: o3, maskTextClass: e2.maskTextClass ?? ne, maskTextSelector: s3, maskInputSelector: r3, maskInputOptions: c3, maskInputFn: d2, maskTextFn: u2, unmaskSelector: i3 });
|
|
970
|
+
const { record: o4 } = await import("@sailfish-rrweb/rrweb-record-only");
|
|
971
|
+
ke = o4, await yieldToMain();
|
|
972
|
+
const r3 = e2.unmaskSelector || void 0, a3 = e2.blockSelector || void 0, c3 = e2.maskTextSelector || void 0, l3 = e2.maskInputSelector || void 0, u3 = { ...e2.maskInputOptions ?? {} }, p2 = l3 ? { ...we } : u3, f2 = n({ baseFn: maskInputFn, unmaskSelector: r3, maskInputSelector: l3, adminMaskInputOptions: u3 }), g2 = i(r3);
|
|
973
|
+
if (d2) {
|
|
974
|
+
const { chunkedSnapshot: n2 } = await import("./chunkSerializer-B-z7p0r-.js"), i2 = o4.mirror;
|
|
975
|
+
let s3 = true;
|
|
976
|
+
const d3 = [];
|
|
977
|
+
o4({ emit(e3) {
|
|
978
|
+
s3 ? d3.push(e3) : emitWithContext(e3);
|
|
979
|
+
}, ...e2, maskInputOptions: p2, maskInputFn: f2, maskTextFn: g2, maskInputSelector: l3, maskTextSelector: c3, blockSelector: a3, maskTextClass: e2.maskTextClass ?? xe, recordDOM: false, recordCanvas: false });
|
|
980
|
+
const u4 = Date.now(), m2 = await n2(document, i2, { chunkSize: 500, maxChunkMs: 16, blockClass: e2.blockClass, blockSelector: a3, maskTextClass: e2.maskTextClass ?? xe, maskTextSelector: c3, maskInputSelector: l3, maskInputOptions: p2, maskInputFn: f2, maskTextFn: g2, unmaskSelector: r3 });
|
|
872
981
|
if (m2) {
|
|
873
|
-
emitWithContext({ type: t.Meta, data: { href: window.location.href, width: document.documentElement.clientWidth || document.body.clientWidth, height: document.documentElement.clientHeight || document.body.clientHeight }, timestamp:
|
|
874
|
-
for (const e3 of
|
|
875
|
-
|
|
876
|
-
} else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"),
|
|
877
|
-
} else
|
|
982
|
+
emitWithContext({ type: t.Meta, data: { href: window.location.href, width: document.documentElement.clientWidth || document.body.clientWidth, height: document.documentElement.clientHeight || document.body.clientHeight }, timestamp: u4 }), emitWithContext({ type: t.FullSnapshot, data: { node: m2, initialOffset: { left: void 0 !== window.pageXOffset ? window.pageXOffset : document.documentElement.scrollLeft, top: void 0 !== window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop } }, timestamp: u4 });
|
|
983
|
+
for (const e3 of d3) emitWithContext(e3);
|
|
984
|
+
s3 = false;
|
|
985
|
+
} else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"), s3 = false;
|
|
986
|
+
} else o4({ emit(e3) {
|
|
878
987
|
emitWithContext(e3);
|
|
879
|
-
}, ...e2, maskInputOptions:
|
|
988
|
+
}, ...e2, maskInputOptions: p2, maskInputFn: f2, maskTextFn: g2, maskInputSelector: l3, maskTextSelector: c3, blockSelector: a3, maskTextClass: e2.maskTextClass ?? xe, recordCanvas: false });
|
|
989
|
+
if (e2.recordCanvas) try {
|
|
990
|
+
const { startCanvasRecording: n2, stopCanvasRecording: i2, flushAllCanvas: r4, isCanvasRecordingActive: a4 } = await import("./canvasManager-B9uQ-PFS.js"), c4 = { settings: { maskCanvasClass: e2.maskCanvasClass, maskTextClass: e2.maskTextClass, maskTextSelector: e2.maskTextSelector, blockSelector: e2.blockSelector, unmaskSelector: e2.unmaskSelector, maskCanvasText: e2.maskCanvasText ?? void 0, canvasRedactStyle: e2.canvasRedactStyle, recordSsn: e2.recordSsn, recordCreditCardInfo: e2.recordCreditCardInfo, recordDob: e2.recordDob, recordRealName: e2.recordRealName, recordPassword: e2.recordPassword }, mirror: o4.mirror, addSailfishEvent: (e3) => {
|
|
991
|
+
ke == null ? void 0 : ke.addSailfishEvent(t.SailfishCustom, { ...e3, tag: "sf-canvas" });
|
|
992
|
+
}, sendBinary: wsSendBinary, getContextIds: () => ({ session_id: s2, page_visit_uuid: getUrlAndStoredUuids().page_visit_uuid }), isTransportSaturated };
|
|
993
|
+
n2(c4);
|
|
994
|
+
const onVisibilityHidden = () => {
|
|
995
|
+
try {
|
|
996
|
+
"hidden" === document.visibilityState && r4();
|
|
997
|
+
} catch {
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
document.addEventListener("visibilitychange", onVisibilityHidden), window.addEventListener("pagehide", () => {
|
|
1001
|
+
i2();
|
|
1002
|
+
}), window.addEventListener("pageshow", (e3) => {
|
|
1003
|
+
try {
|
|
1004
|
+
e3.persisted && !a4() && n2(c4);
|
|
1005
|
+
} catch (e4) {
|
|
1006
|
+
console.warn("[Sailfish] canvas recording failed to re-arm after bfcache restore:", e4);
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
} catch (e3) {
|
|
1010
|
+
console.warn("[Sailfish] canvas recording failed to start:", e3);
|
|
1011
|
+
}
|
|
880
1012
|
};
|
|
881
|
-
if (
|
|
1013
|
+
if (c2) {
|
|
882
1014
|
let e3 = false;
|
|
883
1015
|
const startOnce = () => {
|
|
884
1016
|
e3 || (e3 = true, startHeavyWork());
|
|
@@ -895,7 +1027,7 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
895
1027
|
"complete" === document.readyState ? scheduleAfterLoad() : window.addEventListener("load", () => scheduleAfterLoad(), { once: true });
|
|
896
1028
|
} else "function" == typeof requestIdleCallback ? requestIdleCallback(startHeavyWork, { timeout: 2e3 }) : setTimeout(startHeavyWork, 0);
|
|
897
1029
|
window.addEventListener("beforeunload", () => {
|
|
898
|
-
|
|
1030
|
+
o3.flush();
|
|
899
1031
|
}), (function whenZendeskReady(e3) {
|
|
900
1032
|
if ("undefined" == typeof window) return;
|
|
901
1033
|
const t2 = window.zE;
|
|
@@ -905,14 +1037,14 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
905
1037
|
}
|
|
906
1038
|
})(() => {
|
|
907
1039
|
suppressConsoleLogsDuringCall(() => {
|
|
908
|
-
zE_safe("messenger:set", "conversationTags", [`sailfish-session-${
|
|
1040
|
+
zE_safe("messenger:set", "conversationTags", [`sailfish-session-${s2}`]);
|
|
909
1041
|
});
|
|
910
1042
|
const handleWidgetOpen = () => {
|
|
911
|
-
|
|
1043
|
+
ke == null ? void 0 : ke.addSailfishEvent(t.SailfishCustom, { action: "customer support chat opened", element_id: Ie, provider: Te });
|
|
912
1044
|
}, handleWidgetClose = () => {
|
|
913
|
-
|
|
1045
|
+
ke == null ? void 0 : ke.addSailfishEvent(t.SailfishCustom, { action: "customer support chat closed", element_id: Ie, provider: Te });
|
|
914
1046
|
}, handleUnreadMessages = (e3) => {
|
|
915
|
-
|
|
1047
|
+
ke == null ? void 0 : ke.addSailfishEvent(t.SailfishCustom, { action: "zendesk unreadmessages", element_id: Ie, provider: Te });
|
|
916
1048
|
};
|
|
917
1049
|
suppressConsoleLogsDuringCall(() => {
|
|
918
1050
|
zE_safe("messenger:on", "open", handleWidgetOpen), zE_safe("messenger:on", "close", handleWidgetClose), zE_safe("messenger:on", "unreadMessages", handleUnreadMessages);
|
|
@@ -921,9 +1053,9 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
921
1053
|
} catch (e3) {
|
|
922
1054
|
console.error("Error importing plugins!", e3);
|
|
923
1055
|
}
|
|
924
|
-
return
|
|
1056
|
+
return u2;
|
|
925
1057
|
}
|
|
926
|
-
const
|
|
1058
|
+
const Fe = [(e2) => (function checkNextJs() {
|
|
927
1059
|
try {
|
|
928
1060
|
if (void 0 !== globalThis.__NEXT_DATA__) return "nextjs";
|
|
929
1061
|
} catch {
|
|
@@ -985,52 +1117,52 @@ const de = [(e2) => (function checkNextJs() {
|
|
|
985
1117
|
}
|
|
986
1118
|
return null;
|
|
987
1119
|
}];
|
|
988
|
-
const
|
|
1120
|
+
const Le = "sf-create-issue-preference", Re = "sf-create-eng-ticket-preference";
|
|
989
1121
|
function getInitialState() {
|
|
990
1122
|
const e2 = (function loadUserPreferences() {
|
|
991
|
-
return { createIssue:
|
|
1123
|
+
return { createIssue: $ && "true" === localStorage.getItem(Le), createEngTicket: $ && "true" === localStorage.getItem(Re) };
|
|
992
1124
|
})();
|
|
993
1125
|
return { mode: "lookback", description: "", occurredInThisTab: true, createIssue: e2.createIssue, issueName: "", issueDescription: "", createEngTicket: e2.createEngTicket, engTicketTeam: "", engTicketProject: "", engTicketPriority: 0, engTicketLabels: [], engTicketSprint: "", engTicketIssueType: "", engTicketCustomFields: {} };
|
|
994
1126
|
}
|
|
995
|
-
let
|
|
1127
|
+
let De = getInitialState(), Be = null, Pe = null, _e = null, Oe = false, je = false;
|
|
996
1128
|
function setSprintDefaulted(e2) {
|
|
997
|
-
|
|
1129
|
+
je = e2;
|
|
998
1130
|
}
|
|
999
1131
|
function setTimerInterval(e2) {
|
|
1000
|
-
|
|
1132
|
+
_e = e2;
|
|
1001
1133
|
}
|
|
1002
1134
|
function setIsRecording(e2) {
|
|
1003
|
-
|
|
1135
|
+
Oe = e2;
|
|
1004
1136
|
}
|
|
1005
|
-
const
|
|
1006
|
-
let
|
|
1007
|
-
const
|
|
1137
|
+
const Ue = ["jira", "linear", "zendesk"];
|
|
1138
|
+
let Ne = null;
|
|
1139
|
+
const qe = /* @__PURE__ */ new Map();
|
|
1008
1140
|
function getIntegrationData() {
|
|
1009
|
-
return
|
|
1141
|
+
return Ne;
|
|
1010
1142
|
}
|
|
1011
1143
|
function hasValidIntegration() {
|
|
1012
|
-
return null !==
|
|
1144
|
+
return null !== Ne && true === Ne.installed;
|
|
1013
1145
|
}
|
|
1014
1146
|
function resolveIntegration(e2) {
|
|
1015
1147
|
var _a;
|
|
1016
1148
|
if ((e2 == null ? void 0 : e2.errors) && e2.errors.length > 0) return console.error("GraphQL errors fetching integrations:", e2.errors), null;
|
|
1017
1149
|
const t2 = (_a = e2 == null ? void 0 : e2.data) == null ? void 0 : _a.getEngineeringTicketPlatformIntegrationsFromApiKey, n2 = (t2 || []).filter((e3) => {
|
|
1018
1150
|
var _a2;
|
|
1019
|
-
return
|
|
1151
|
+
return Ue.includes(((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase()) || "") && true === e3.installed;
|
|
1020
1152
|
});
|
|
1021
1153
|
if (0 === n2.length) return console.warn("No valid installed integrations found"), null;
|
|
1022
1154
|
const i2 = n2.find((e3) => {
|
|
1023
1155
|
var _a2;
|
|
1024
1156
|
return "jira" === ((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase());
|
|
1025
1157
|
}) || n2[0];
|
|
1026
|
-
return (i2 == null ? void 0 : i2.primaryCloudId) &&
|
|
1158
|
+
return (i2 == null ? void 0 : i2.primaryCloudId) && qe.set(i2.primaryCloudId, i2), i2;
|
|
1027
1159
|
}
|
|
1028
1160
|
async function refreshIntegrationData(e2, t2) {
|
|
1029
1161
|
try {
|
|
1030
1162
|
const n2 = resolveIntegration(await fetchEngineeringTicketPlatformIntegrations(e2, t2));
|
|
1031
|
-
return
|
|
1163
|
+
return Ne = n2, n2;
|
|
1032
1164
|
} catch (e3) {
|
|
1033
|
-
return console.error("Error refreshing integration data:", e3),
|
|
1165
|
+
return console.error("Error refreshing integration data:", e3), Ne;
|
|
1034
1166
|
}
|
|
1035
1167
|
}
|
|
1036
1168
|
function populateSelectOptions(e2, t2, n2) {
|
|
@@ -1075,8 +1207,8 @@ function populateSprintOptions(e2, t2, n2) {
|
|
|
1075
1207
|
}), n2 && (e2.value = n2);
|
|
1076
1208
|
}
|
|
1077
1209
|
function getSprintFieldId() {
|
|
1078
|
-
if (!(
|
|
1079
|
-
const e2 = Array.isArray(
|
|
1210
|
+
if (!(Ne == null ? void 0 : Ne.fieldConfigurations)) return "customfield_10020";
|
|
1211
|
+
const e2 = Array.isArray(Ne.fieldConfigurations) ? Ne.fieldConfigurations : [];
|
|
1080
1212
|
for (const t2 of e2) {
|
|
1081
1213
|
const e3 = (t2.fields || []).find((e4) => {
|
|
1082
1214
|
var _a;
|
|
@@ -1088,12 +1220,12 @@ function getSprintFieldId() {
|
|
|
1088
1220
|
}
|
|
1089
1221
|
function updateIssueTypeOptions(e2, t2) {
|
|
1090
1222
|
var _a;
|
|
1091
|
-
if (!(
|
|
1223
|
+
if (!(Ne == null ? void 0 : Ne.projects) || !t2) {
|
|
1092
1224
|
e2.innerHTML = "";
|
|
1093
1225
|
const t3 = document.createElement("option");
|
|
1094
1226
|
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");
|
|
1095
1227
|
}
|
|
1096
|
-
const n2 =
|
|
1228
|
+
const n2 = Ne.projects.find((e3) => e3.id === t2);
|
|
1097
1229
|
if (!n2 || !n2.issue_types) {
|
|
1098
1230
|
e2.innerHTML = "";
|
|
1099
1231
|
const t3 = document.createElement("option");
|
|
@@ -1112,17 +1244,17 @@ function updateIssueTypeOptions(e2, t2) {
|
|
|
1112
1244
|
}), n3 = i2.find((e3) => {
|
|
1113
1245
|
var _a2;
|
|
1114
1246
|
return "task" === ((_a2 = e3.name) == null ? void 0 : _a2.toLowerCase());
|
|
1115
|
-
}),
|
|
1116
|
-
|
|
1247
|
+
}), r2 = (t3 == null ? void 0 : t3.id) || (n3 == null ? void 0 : n3.id) || ((_a = i2[0]) == null ? void 0 : _a.id);
|
|
1248
|
+
r2 ? (e2.value = r2, e2.style.color = "#000") : (o2.selected = true, e2.style.color = "#9ca3af");
|
|
1117
1249
|
}
|
|
1118
1250
|
}
|
|
1119
1251
|
function getFieldsForProject(e2, t2) {
|
|
1120
|
-
if (!(
|
|
1121
|
-
const n2 = Array.isArray(
|
|
1252
|
+
if (!(Ne == null ? void 0 : Ne.fieldConfigurations) || !e2) return [];
|
|
1253
|
+
const n2 = Array.isArray(Ne.fieldConfigurations) ? Ne.fieldConfigurations.find((n3) => !(n3.project_key !== e2 && String(n3.project_id) !== String(e2) || t2 && String(n3.issue_type_id) !== String(t2))) : Ne.fieldConfigurations[e2];
|
|
1122
1254
|
return n2 && n2.fields ? n2.fields : [];
|
|
1123
1255
|
}
|
|
1124
1256
|
function getUsers() {
|
|
1125
|
-
return (
|
|
1257
|
+
return (Ne == null ? void 0 : Ne.users) ? Ne.users : [];
|
|
1126
1258
|
}
|
|
1127
1259
|
function getDefaultReporterAccountId() {
|
|
1128
1260
|
const e2 = getUsers(), t2 = getIdentifiedUser();
|
|
@@ -1131,16 +1263,16 @@ function getDefaultReporterAccountId() {
|
|
|
1131
1263
|
const n3 = e2.filter(t3);
|
|
1132
1264
|
return 1 === n3.length ? n3[0] : null;
|
|
1133
1265
|
};
|
|
1134
|
-
let
|
|
1135
|
-
if (!
|
|
1266
|
+
let r2 = i2 ? findUnique((e3) => (e3.email || e3.emailAddress || "").toLowerCase().trim() === i2) : null;
|
|
1267
|
+
if (!r2 && o2 && (r2 = findUnique((e3) => (e3.name || e3.displayName || "").toLowerCase().trim() === o2)), !r2 && i2) {
|
|
1136
1268
|
const e3 = i2.split("@")[0];
|
|
1137
|
-
e3.length >= 3 && (
|
|
1269
|
+
e3.length >= 3 && (r2 = findUnique((t3) => (t3.name || t3.displayName || "").toLowerCase().trim().includes(e3)));
|
|
1138
1270
|
}
|
|
1139
|
-
return
|
|
1271
|
+
return r2 && (r2.id || r2.accountId) || null;
|
|
1140
1272
|
}
|
|
1141
1273
|
function lastReporterStorageKey() {
|
|
1142
|
-
if (!
|
|
1143
|
-
const e2 =
|
|
1274
|
+
if (!Ne) return null;
|
|
1275
|
+
const e2 = Ne.primaryCloudId || Ne.provider || "";
|
|
1144
1276
|
return e2 ? `sf-veritas:lastReporter:${e2}` : null;
|
|
1145
1277
|
}
|
|
1146
1278
|
function getSavedLastReporterAccountId() {
|
|
@@ -1167,42 +1299,42 @@ function getValidSavedReporterAccountId() {
|
|
|
1167
1299
|
return getUsers().some((t2) => (t2.accountId || t2.id) === e2 && false !== t2.active) ? e2 : null;
|
|
1168
1300
|
}
|
|
1169
1301
|
function getProjectsForTeam(e2) {
|
|
1170
|
-
if (!
|
|
1171
|
-
const t2 =
|
|
1302
|
+
if (!Ne) return [];
|
|
1303
|
+
const t2 = Ne.teams && Array.isArray(Ne.teams) && Ne.teams.length > 0;
|
|
1172
1304
|
if (t2 && e2) {
|
|
1173
|
-
const t3 =
|
|
1305
|
+
const t3 = Ne.teams.find((t4) => t4.id === e2);
|
|
1174
1306
|
return (t3 == null ? void 0 : t3.projects) || [];
|
|
1175
1307
|
}
|
|
1176
|
-
return !t2 &&
|
|
1308
|
+
return !t2 && Ne.projects ? Ne.projects : [];
|
|
1177
1309
|
}
|
|
1178
1310
|
function updateFormWithIntegrationData(e2) {
|
|
1179
1311
|
var _a;
|
|
1180
|
-
if (!
|
|
1181
|
-
const t2 =
|
|
1182
|
-
n2 && t2 && (populateSelectOptions(n2,
|
|
1312
|
+
if (!Ne) return e2;
|
|
1313
|
+
const t2 = Ne.teams && Array.isArray(Ne.teams) && Ne.teams.length > 0, n2 = document.getElementById("sf-eng-ticket-team");
|
|
1314
|
+
n2 && t2 && (populateSelectOptions(n2, Ne.teams, Ne.defaultTeam), e2.engTicketTeam ? n2.value = e2.engTicketTeam : e2.engTicketTeam = n2.value);
|
|
1183
1315
|
const i2 = document.getElementById("sf-eng-ticket-project");
|
|
1184
1316
|
if (i2) {
|
|
1185
|
-
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) :
|
|
1317
|
+
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) : Ne.projects || [], Ne.defaultProject), e2.engTicketProject ? i2.value = e2.engTicketProject : e2.engTicketProject = i2.value;
|
|
1186
1318
|
}
|
|
1187
1319
|
const o2 = document.getElementById("sf-eng-ticket-priority");
|
|
1188
|
-
o2 && (populatePriorityOptions(o2,
|
|
1189
|
-
const
|
|
1190
|
-
if (
|
|
1191
|
-
if (!e2.engTicketSprint && !
|
|
1192
|
-
const t3 = pickDefaultActiveSprint(
|
|
1320
|
+
o2 && (populatePriorityOptions(o2, Ne.provider || "", Ne.defaultPriority), e2.engTicketPriority ? o2.value = String(e2.engTicketPriority) : e2.engTicketPriority = Number(o2.value));
|
|
1321
|
+
const r2 = document.getElementById("sf-eng-ticket-sprint"), s2 = "jira" === ((_a = Ne.provider) == null ? void 0 : _a.toLowerCase());
|
|
1322
|
+
if (r2 && s2 && Ne.sprints) {
|
|
1323
|
+
if (!e2.engTicketSprint && !je) {
|
|
1324
|
+
const t3 = pickDefaultActiveSprint(Ne.sprints, e2.engTicketProject, Ne.projects || []);
|
|
1193
1325
|
(t3 == null ? void 0 : t3.id) && (e2.engTicketSprint = String(t3.id), setSprintDefaulted(true));
|
|
1194
1326
|
}
|
|
1195
|
-
populateSprintOptions(
|
|
1327
|
+
populateSprintOptions(r2, Ne.sprints, e2.engTicketSprint || void 0), e2.engTicketSprint && (r2.style.color = "");
|
|
1196
1328
|
}
|
|
1197
1329
|
const a2 = document.getElementById("sf-eng-ticket-type");
|
|
1198
|
-
return a2 &&
|
|
1330
|
+
return a2 && s2 && e2.engTicketProject && (updateIssueTypeOptions(a2, e2.engTicketProject), e2.engTicketIssueType ? (a2.value = e2.engTicketIssueType, a2.style.color = "#000") : a2.value && (e2.engTicketIssueType = a2.value)), e2;
|
|
1199
1331
|
}
|
|
1200
|
-
const
|
|
1201
|
-
if (!
|
|
1332
|
+
const ze = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrationData: async function fetchIntegrationData(e2, t2) {
|
|
1333
|
+
if (!Ne) try {
|
|
1202
1334
|
const n2 = await fetchEngineeringTicketPlatformIntegrations(e2, t2);
|
|
1203
|
-
|
|
1335
|
+
Ne = resolveIntegration(n2);
|
|
1204
1336
|
} catch (e3) {
|
|
1205
|
-
console.error("Error fetching integration data:", e3),
|
|
1337
|
+
console.error("Error fetching integration data:", e3), Ne = null;
|
|
1206
1338
|
}
|
|
1207
1339
|
}, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSavedLastReporterAccountId, getSprintFieldId, getUsers, getValidSavedReporterAccountId, hasValidIntegration, pickDefaultActiveSprint, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, saveLastReporterAccountId, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" }));
|
|
1208
1340
|
function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
|
|
@@ -1238,9 +1370,9 @@ function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
|
|
|
1238
1370
|
</div>
|
|
1239
1371
|
`;
|
|
1240
1372
|
}
|
|
1241
|
-
const
|
|
1373
|
+
const He = { 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 } }, We = { shortcuts: { ...He }, resolveSessionId: null, apiKey: null, backendApi: null, triageBaseUrl: "https://app.sailfishqa.com", deactivateIsolation: () => {
|
|
1242
1374
|
}, integrationData: null, showEngTicketFieldsDefault: false };
|
|
1243
|
-
let
|
|
1375
|
+
let Ke = null, Ve = false;
|
|
1244
1376
|
function setupCustomMultiSelectListeners(e2, t2) {
|
|
1245
1377
|
const n2 = document.getElementById(`${e2}-container`), i2 = document.getElementById(`${e2}-dropdown`);
|
|
1246
1378
|
if (!n2 || !i2) return;
|
|
@@ -1257,16 +1389,16 @@ function setupCustomMultiSelectListeners(e2, t2) {
|
|
|
1257
1389
|
</span>`);
|
|
1258
1390
|
}
|
|
1259
1391
|
});
|
|
1260
|
-
const
|
|
1261
|
-
return
|
|
1392
|
+
const r2 = n2.querySelector(".sf-multiselect-chips");
|
|
1393
|
+
return r2 && (r2.innerHTML = o2.join("") || '<span style="color:#9ca3af;">Select...</span>', r2.querySelectorAll(".sf-multiselect-chip-remove").forEach((e4) => {
|
|
1262
1394
|
e4.addEventListener("click", (n3) => {
|
|
1263
1395
|
n3.stopPropagation();
|
|
1264
|
-
const o3 = e4.dataset.value || "",
|
|
1265
|
-
|
|
1266
|
-
const
|
|
1396
|
+
const o3 = e4.dataset.value || "", r3 = i2.querySelector(`.sf-multiselect-option[data-value="${o3}"]`);
|
|
1397
|
+
r3 && (r3.dataset.selected = "false", r3.style.backgroundColor = ""), updateChipsDisplay();
|
|
1398
|
+
const s2 = [];
|
|
1267
1399
|
i2.querySelectorAll(".sf-multiselect-option").forEach((e5) => {
|
|
1268
|
-
"true" === e5.dataset.selected &&
|
|
1269
|
-
}), t2(
|
|
1400
|
+
"true" === e5.dataset.selected && s2.push(e5.dataset.value || "");
|
|
1401
|
+
}), t2(s2);
|
|
1270
1402
|
});
|
|
1271
1403
|
})), e3;
|
|
1272
1404
|
}
|
|
@@ -1275,8 +1407,8 @@ function setupCustomMultiSelectListeners(e2, t2) {
|
|
|
1275
1407
|
n3.stopPropagation();
|
|
1276
1408
|
const i3 = e3, o2 = "true" === i3.dataset.selected;
|
|
1277
1409
|
i3.dataset.selected = String(!o2), i3.style.backgroundColor = o2 ? "" : "#e0f2fe";
|
|
1278
|
-
const
|
|
1279
|
-
t2(
|
|
1410
|
+
const r2 = updateChipsDisplay();
|
|
1411
|
+
t2(r2);
|
|
1280
1412
|
});
|
|
1281
1413
|
}), updateChipsDisplay(), document.addEventListener("click", (e3) => {
|
|
1282
1414
|
const t3 = e3.target;
|
|
@@ -1289,12 +1421,12 @@ function renderDynamicFields(e2, t2) {
|
|
|
1289
1421
|
if (!e2) return void (n2.innerHTML = '<div style="font-size:14px; color:#64748B;">Select a project to see additional fields</div>');
|
|
1290
1422
|
const i2 = getFieldsForProject(e2, t2), o2 = getUsers();
|
|
1291
1423
|
if (!i2 || 0 === i2.length) return void (n2.innerHTML = "");
|
|
1292
|
-
const
|
|
1424
|
+
const r2 = i2.map((e3) => (function renderDynamicField(e4, t3, n3 = []) {
|
|
1293
1425
|
var _a, _b, _c, _d;
|
|
1294
|
-
const i3 = e4.fieldId || e4.key, o3 = e4.name,
|
|
1295
|
-
if (d2.includes(i3) || d2.includes(
|
|
1296
|
-
const u2 =
|
|
1297
|
-
switch (
|
|
1426
|
+
const i3 = e4.fieldId || e4.key, o3 = e4.name, r3 = (_a = e4.schema) == null ? void 0 : _a.type, s2 = (_b = e4.schema) == null ? void 0 : _b.system, a2 = (_c = e4.schema) == null ? void 0 : _c.custom, c2 = e4.required || false, l2 = e4.allowedValues, d2 = ["summary", "description", "project", "issuetype", "priority"];
|
|
1427
|
+
if (d2.includes(i3) || d2.includes(s2)) return null;
|
|
1428
|
+
const u2 = c2 ? '<span style="color:#ef4444;">*</span>' : "", p2 = "width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none;";
|
|
1429
|
+
switch (r3) {
|
|
1298
1430
|
case "string":
|
|
1299
1431
|
return a2 && a2.includes("textarea") ? `
|
|
1300
1432
|
<div>
|
|
@@ -1307,7 +1439,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1307
1439
|
data-field-id="${i3}"
|
|
1308
1440
|
placeholder="Enter ${o3.toLowerCase()}"
|
|
1309
1441
|
style="${p2} height:80px; resize:none;"
|
|
1310
|
-
${
|
|
1442
|
+
${c2 ? "required" : ""}
|
|
1311
1443
|
>${t3 || ""}</textarea>
|
|
1312
1444
|
</div>
|
|
1313
1445
|
` : `
|
|
@@ -1323,7 +1455,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1323
1455
|
value="${t3 || ""}"
|
|
1324
1456
|
placeholder="Enter ${o3.toLowerCase()}"
|
|
1325
1457
|
style="${p2}"
|
|
1326
|
-
${
|
|
1458
|
+
${c2 ? "required" : ""}
|
|
1327
1459
|
/>
|
|
1328
1460
|
</div>
|
|
1329
1461
|
`;
|
|
@@ -1342,7 +1474,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1342
1474
|
placeholder="Enter ${o3.toLowerCase()}"
|
|
1343
1475
|
style="${p2}"
|
|
1344
1476
|
step="0.5"
|
|
1345
|
-
${
|
|
1477
|
+
${c2 ? "required" : ""}
|
|
1346
1478
|
/>
|
|
1347
1479
|
</div>
|
|
1348
1480
|
`;
|
|
@@ -1359,7 +1491,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1359
1491
|
data-field-id="${i3}"
|
|
1360
1492
|
value="${t3 || ""}"
|
|
1361
1493
|
style="${p2}"
|
|
1362
|
-
${
|
|
1494
|
+
${c2 ? "required" : ""}
|
|
1363
1495
|
/>
|
|
1364
1496
|
</div>
|
|
1365
1497
|
`;
|
|
@@ -1368,7 +1500,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1368
1500
|
const e5 = n3.map((e6) => {
|
|
1369
1501
|
const n4 = e6.email ? `${e6.name} (${e6.email})` : e6.name, i4 = t3 === e6.id ? "selected" : "";
|
|
1370
1502
|
return `<option value="${e6.id}" ${i4}>${n4}</option>`;
|
|
1371
|
-
}).join(""),
|
|
1503
|
+
}).join(""), r4 = t3 && n3.some((e6) => e6.id === t3);
|
|
1372
1504
|
return `
|
|
1373
1505
|
<div>
|
|
1374
1506
|
<label for="${i3}" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
|
|
@@ -1378,10 +1510,10 @@ function renderDynamicFields(e2, t2) {
|
|
|
1378
1510
|
id="${i3}"
|
|
1379
1511
|
class="sf-dynamic-field"
|
|
1380
1512
|
data-field-id="${i3}"
|
|
1381
|
-
style="${p2} appearance:none; cursor:pointer; background-color: white; ${
|
|
1382
|
-
${
|
|
1513
|
+
style="${p2} appearance:none; cursor:pointer; background-color: white; ${r4 ? "" : "color: #9ca3af;"}"
|
|
1514
|
+
${c2 ? "required" : ""}
|
|
1383
1515
|
>
|
|
1384
|
-
<option value="" ${
|
|
1516
|
+
<option value="" ${r4 ? "" : "selected"} style="color: #9ca3af;">Select ${o3.toLowerCase()}...</option>
|
|
1385
1517
|
${e5}
|
|
1386
1518
|
</select>
|
|
1387
1519
|
</div>
|
|
@@ -1389,11 +1521,11 @@ function renderDynamicFields(e2, t2) {
|
|
|
1389
1521
|
}
|
|
1390
1522
|
return null;
|
|
1391
1523
|
case "option":
|
|
1392
|
-
if (
|
|
1393
|
-
const e5 =
|
|
1524
|
+
if (l2 && l2.length > 0) {
|
|
1525
|
+
const e5 = l2.map((e6) => {
|
|
1394
1526
|
const n5 = e6.id || e6.value || e6, i4 = e6.value || e6.name || e6;
|
|
1395
1527
|
return `<option value="${n5}" ${t3 === n5 ? "selected" : ""}>${i4}</option>`;
|
|
1396
|
-
}).join(""), n4 = t3 &&
|
|
1528
|
+
}).join(""), n4 = t3 && l2.some((e6) => (e6.id || e6.value || e6) === t3);
|
|
1397
1529
|
return `
|
|
1398
1530
|
<div>
|
|
1399
1531
|
<label for="${i3}" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
|
|
@@ -1404,7 +1536,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1404
1536
|
class="sf-dynamic-field"
|
|
1405
1537
|
data-field-id="${i3}"
|
|
1406
1538
|
style="${p2} appearance:none; cursor:pointer; background-color: white; ${n4 ? "" : "color: #9ca3af;"}"
|
|
1407
|
-
${
|
|
1539
|
+
${c2 ? "required" : ""}
|
|
1408
1540
|
>
|
|
1409
1541
|
<option value="" ${n4 ? "" : "selected"} style="color: #9ca3af;">Select ${o3.toLowerCase()}...</option>
|
|
1410
1542
|
${e5}
|
|
@@ -1414,7 +1546,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1414
1546
|
}
|
|
1415
1547
|
return null;
|
|
1416
1548
|
case "array":
|
|
1417
|
-
return "labels" ===
|
|
1549
|
+
return "labels" === s2 ? null : l2 && l2.length > 0 ? renderCustomMultiSelect(i3, o3, l2, Array.isArray(t3) ? t3 : [], c2) : null;
|
|
1418
1550
|
case "parent":
|
|
1419
1551
|
case "issuelink":
|
|
1420
1552
|
return `
|
|
@@ -1430,7 +1562,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1430
1562
|
value="${t3 || ""}"
|
|
1431
1563
|
placeholder="e.g., PROJ-123"
|
|
1432
1564
|
style="${p2}"
|
|
1433
|
-
${
|
|
1565
|
+
${c2 ? "required" : ""}
|
|
1434
1566
|
/>
|
|
1435
1567
|
</div>
|
|
1436
1568
|
`;
|
|
@@ -1448,27 +1580,27 @@ function renderDynamicFields(e2, t2) {
|
|
|
1448
1580
|
value="${t3 || ""}"
|
|
1449
1581
|
placeholder="Enter ${o3.toLowerCase()}"
|
|
1450
1582
|
style="${p2}"
|
|
1451
|
-
${
|
|
1583
|
+
${c2 ? "required" : ""}
|
|
1452
1584
|
/>
|
|
1453
1585
|
</div>
|
|
1454
1586
|
` : null;
|
|
1455
1587
|
}
|
|
1456
|
-
})(e3,
|
|
1457
|
-
n2.innerHTML =
|
|
1588
|
+
})(e3, De.engTicketCustomFields[e3.fieldId || e3.key], o2)).filter(Boolean).join("");
|
|
1589
|
+
n2.innerHTML = r2 || "", i2.forEach((e3) => {
|
|
1458
1590
|
var _a;
|
|
1459
1591
|
const t3 = e3.fieldId || e3.key, n3 = (_a = e3.schema) == null ? void 0 : _a.type, i3 = e3.allowedValues;
|
|
1460
1592
|
"array" === n3 && i3 && i3.length > 0 && setupCustomMultiSelectListeners(t3, (e4) => {
|
|
1461
|
-
|
|
1593
|
+
De.engTicketCustomFields[t3] = e4;
|
|
1462
1594
|
});
|
|
1463
1595
|
});
|
|
1464
1596
|
}
|
|
1465
1597
|
function generateEngTicketFieldsHTML() {
|
|
1466
1598
|
var _a;
|
|
1467
|
-
const e2 =
|
|
1599
|
+
const e2 = We.integrationData;
|
|
1468
1600
|
if (!e2) return "";
|
|
1469
1601
|
const t2 = "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase());
|
|
1470
1602
|
let n2 = "<div style='display:flex; flex-direction:column; gap:12px;'>";
|
|
1471
|
-
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,
|
|
1603
|
+
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, De.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;
|
|
1472
1604
|
}
|
|
1473
1605
|
function getShortcutKeyCmdCtrlLabel() {
|
|
1474
1606
|
return (function isMacPlatform() {
|
|
@@ -1482,19 +1614,19 @@ function getShortcutLabelFromContext(e2) {
|
|
|
1482
1614
|
return e3.requireCmdCtrl && t2.push(getShortcutKeyCmdCtrlLabel()), t2.push((function formatShortcutKeyLabel(e4) {
|
|
1483
1615
|
return ({ escape: "esc" }[e4.toLowerCase()] || e4).toUpperCase();
|
|
1484
1616
|
})(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 ? " + " : "");
|
|
1485
|
-
})(
|
|
1617
|
+
})(We.shortcuts[e2]);
|
|
1486
1618
|
}
|
|
1487
1619
|
function getSessionIdSafely() {
|
|
1488
|
-
if (!
|
|
1489
|
-
return
|
|
1620
|
+
if (!We.resolveSessionId) throw new Error("getSessionId not defined");
|
|
1621
|
+
return We.resolveSessionId();
|
|
1490
1622
|
}
|
|
1491
1623
|
function openReportIssueModal(e2) {
|
|
1492
|
-
|
|
1624
|
+
Oe ? stopRecording() : (Ve = (e2 == null ? void 0 : e2.showEngTicketFields) ?? We.showEngTicketFieldsDefault, injectModalHTML(), Ke && document.body.appendChild(Ke));
|
|
1493
1625
|
}
|
|
1494
1626
|
function closeModal() {
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
})(),
|
|
1627
|
+
We.deactivateIsolation(), document.activeElement instanceof HTMLElement && document.activeElement.blur(), (Ke == null ? void 0 : Ke.parentNode) && Ke.parentNode.removeChild(Ke), Ke = null, Oe || (function resetState() {
|
|
1628
|
+
De = getInitialState(), Be = null, Pe = null, je = false;
|
|
1629
|
+
})(), _e && (clearInterval(_e), setTimerInterval(null));
|
|
1498
1630
|
}
|
|
1499
1631
|
function activateModalIsolation(e2) {
|
|
1500
1632
|
e2.setAttribute("role", "dialog"), e2.setAttribute("aria-modal", "true"), e2.hasAttribute("tabindex") || e2.setAttribute("tabindex", "-1");
|
|
@@ -1511,10 +1643,10 @@ function activateModalIsolation(e2) {
|
|
|
1511
1643
|
n3 && (e2.contains(n3) || (t3.stopImmediatePropagation(), t3.preventDefault(), refocus()));
|
|
1512
1644
|
}, o2 = ["mousedown", "mouseup", "click", "pointerdown", "pointerup", "touchstart", "touchend", "wheel", "keydown", "keyup", "focus", "focusin", "focusout", "blur"];
|
|
1513
1645
|
o2.forEach((e3) => document.addEventListener(e3, quarantine, true));
|
|
1514
|
-
let
|
|
1646
|
+
let r2 = 0, s2 = null;
|
|
1515
1647
|
const a2 = t2 instanceof HTMLTextAreaElement ? t2 : null, refocus = () => {
|
|
1516
|
-
if ((e2.querySelector(":focus") || a2 || t2 || e2).focus({ preventScroll: true }), a2 && document.activeElement === a2 &&
|
|
1517
|
-
a2.setSelectionRange(
|
|
1648
|
+
if ((e2.querySelector(":focus") || a2 || t2 || e2).focus({ preventScroll: true }), a2 && document.activeElement === a2 && s2) try {
|
|
1649
|
+
a2.setSelectionRange(s2.start, s2.end, "none");
|
|
1518
1650
|
} catch {
|
|
1519
1651
|
}
|
|
1520
1652
|
}, selectionInsideModal = () => {
|
|
@@ -1527,17 +1659,17 @@ function activateModalIsolation(e2) {
|
|
|
1527
1659
|
}
|
|
1528
1660
|
return false;
|
|
1529
1661
|
};
|
|
1530
|
-
let
|
|
1662
|
+
let c2 = 0;
|
|
1531
1663
|
const watchdog = () => {
|
|
1532
1664
|
const t3 = document.activeElement, n3 = t3 === document.body || null == t3 || !e2.contains(t3), i3 = selectionInsideModal();
|
|
1533
|
-
n3 && !i3 ? (
|
|
1665
|
+
n3 && !i3 ? (c2 += 1, c2 >= 2 && (refocus(), c2 = 0)) : (c2 = 0, (() => {
|
|
1534
1666
|
if (a2 && document.activeElement === a2) try {
|
|
1535
|
-
|
|
1667
|
+
s2 = { start: a2.selectionStart ?? a2.value.length, end: a2.selectionEnd ?? a2.value.length };
|
|
1536
1668
|
} catch {
|
|
1537
1669
|
}
|
|
1538
|
-
})()),
|
|
1670
|
+
})()), r2 = window.requestAnimationFrame(watchdog);
|
|
1539
1671
|
};
|
|
1540
|
-
|
|
1672
|
+
r2 = window.requestAnimationFrame(watchdog);
|
|
1541
1673
|
const onBlurLike = () => {
|
|
1542
1674
|
setTimeout(() => {
|
|
1543
1675
|
const t3 = document.activeElement;
|
|
@@ -1549,13 +1681,13 @@ function activateModalIsolation(e2) {
|
|
|
1549
1681
|
n2.remove(), i2.remove();
|
|
1550
1682
|
} catch {
|
|
1551
1683
|
}
|
|
1552
|
-
o2.forEach((e3) => document.removeEventListener(e3, quarantine, true)), window.removeEventListener("blur", onBlurLike, true), document.removeEventListener("focusout", onBlurLike, true),
|
|
1684
|
+
o2.forEach((e3) => document.removeEventListener(e3, quarantine, true)), window.removeEventListener("blur", onBlurLike, true), document.removeEventListener("focusout", onBlurLike, true), r2 && cancelAnimationFrame(r2);
|
|
1553
1685
|
};
|
|
1554
1686
|
}
|
|
1555
1687
|
function injectModalHTML(e2 = "lookback") {
|
|
1556
|
-
|
|
1688
|
+
Ke && (Ke.remove(), Ke = null), Ke = document.createElement("div"), Ke.id = "sf-report-issue-modal";
|
|
1557
1689
|
const t2 = "startnow" === e2;
|
|
1558
|
-
|
|
1690
|
+
Ke.innerHTML = `
|
|
1559
1691
|
<div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
|
|
1560
1692
|
<div style="position:fixed; top:50%; left:50%; transform:translate(-50%, -50%);
|
|
1561
1693
|
background:#fff; border-radius:12px;
|
|
@@ -1610,7 +1742,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1610
1742
|
<textarea id="sf-issue-description" placeholder="Add description here"
|
|
1611
1743
|
style="width:100%; height:80px; padding:8px 12px; font-size:14px;
|
|
1612
1744
|
border:1px solid #cbd5e1; border-radius:6px; margin-bottom:20px;
|
|
1613
|
-
resize:none; outline:none;">${
|
|
1745
|
+
resize:none; outline:none;">${De.description}</textarea>
|
|
1614
1746
|
|
|
1615
1747
|
<!-- When did this happen Section -->
|
|
1616
1748
|
<div id="sf-lookback-container" style="display:${t2 ? "none" : "block"}; margin-bottom:20px;">
|
|
@@ -1676,34 +1808,34 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1676
1808
|
<!-- Checkboxes on same line -->
|
|
1677
1809
|
<div style="display:flex; align-items:center; gap:24px; margin-bottom:16px;">
|
|
1678
1810
|
<label style="display:flex; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
|
|
1679
|
-
<input type="checkbox" id="sf-create-issue-checkbox" ${
|
|
1811
|
+
<input type="checkbox" id="sf-create-issue-checkbox" ${De.createIssue ? "checked" : ""}
|
|
1680
1812
|
style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;">
|
|
1681
1813
|
Create an Issue
|
|
1682
1814
|
</label>
|
|
1683
1815
|
|
|
1684
|
-
<label id="sf-create-eng-ticket-label" style="display:${
|
|
1685
|
-
<input type="checkbox" id="sf-create-eng-ticket-checkbox" ${
|
|
1816
|
+
<label id="sf-create-eng-ticket-label" style="display:${We.integrationData && Ve ? "flex" : "none"}; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
|
|
1817
|
+
<input type="checkbox" id="sf-create-eng-ticket-checkbox" ${De.createEngTicket ? "checked" : ""}
|
|
1686
1818
|
style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;">
|
|
1687
1819
|
Create an Eng Ticket
|
|
1688
1820
|
</label>
|
|
1689
1821
|
</div>
|
|
1690
1822
|
|
|
1691
1823
|
<!-- Issue Title Field (always shown when create issue is checked) -->
|
|
1692
|
-
<div id="sf-issue-fields-container" style="display:${
|
|
1824
|
+
<div id="sf-issue-fields-container" style="display:${De.createIssue ? "block" : "none"};">
|
|
1693
1825
|
<div style="display:flex; flex-direction:column; gap:12px;">
|
|
1694
1826
|
<div>
|
|
1695
1827
|
<label for="sf-issue-name" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
|
|
1696
1828
|
Title <span style="color:#ef4444;">*</span>
|
|
1697
1829
|
</label>
|
|
1698
1830
|
<input type="text" id="sf-issue-name" placeholder="Enter title"
|
|
1699
|
-
value="${
|
|
1831
|
+
value="${De.issueName}"
|
|
1700
1832
|
style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none;">
|
|
1701
1833
|
</div>
|
|
1702
1834
|
</div>
|
|
1703
1835
|
</div>
|
|
1704
1836
|
|
|
1705
1837
|
<!-- Engineering Ticket Fields (shown when create eng ticket is checked) -->
|
|
1706
|
-
<div id="sf-eng-ticket-fields-container" style="display:${
|
|
1838
|
+
<div id="sf-eng-ticket-fields-container" style="display:${De.createEngTicket && We.integrationData ? "block" : "none"}; margin-top: ${De.createIssue ? "12px" : "0"};">
|
|
1707
1839
|
${generateEngTicketFieldsHTML()}
|
|
1708
1840
|
</div>
|
|
1709
1841
|
</div>
|
|
@@ -1746,8 +1878,8 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1746
1878
|
</div>
|
|
1747
1879
|
</div>
|
|
1748
1880
|
</div>
|
|
1749
|
-
`,
|
|
1750
|
-
const e3 =
|
|
1881
|
+
`, De.mode = e2, document.body.appendChild(Ke), (function bindListeners() {
|
|
1882
|
+
const e3 = Ke == null ? void 0 : Ke.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");
|
|
1751
1883
|
e3 == null ? void 0 : e3.forEach((e4) => {
|
|
1752
1884
|
e4.addEventListener("click", (e5) => {
|
|
1753
1885
|
const t4 = e5.currentTarget.dataset.mode;
|
|
@@ -1755,10 +1887,10 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1755
1887
|
});
|
|
1756
1888
|
}), n2 && (n2.onclick = closeModal);
|
|
1757
1889
|
o2 && o2.addEventListener("change", () => {
|
|
1758
|
-
"lookback" ===
|
|
1890
|
+
"lookback" === De.mode && (i2.disabled = false, i2.style.opacity = "1", i2.style.cursor = "pointer");
|
|
1759
1891
|
});
|
|
1760
|
-
const
|
|
1761
|
-
|
|
1892
|
+
const r2 = Ke == null ? void 0 : Ke.querySelectorAll(".sf-collapsible-header");
|
|
1893
|
+
r2 == null ? void 0 : r2.forEach((e4) => {
|
|
1762
1894
|
e4.addEventListener("click", (e5) => {
|
|
1763
1895
|
const t4 = e5.currentTarget, n3 = t4.dataset.target, i3 = document.getElementById(n3), o3 = t4.querySelector(".sf-chevron");
|
|
1764
1896
|
if (i3 && o3) {
|
|
@@ -1769,22 +1901,22 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1769
1901
|
}
|
|
1770
1902
|
});
|
|
1771
1903
|
});
|
|
1772
|
-
const
|
|
1773
|
-
|
|
1774
|
-
const e4 =
|
|
1775
|
-
|
|
1904
|
+
const s2 = document.getElementById("sf-create-issue-checkbox"), a2 = document.getElementById("sf-issue-fields-container"), c2 = document.getElementById("sf-create-eng-ticket-checkbox"), l2 = document.getElementById("sf-eng-ticket-fields-container");
|
|
1905
|
+
s2 && s2.addEventListener("change", () => {
|
|
1906
|
+
const e4 = s2.checked;
|
|
1907
|
+
De.createIssue = e4, localStorage.setItem(Le, String(e4)), a2 && (a2.style.display = e4 ? "block" : "none"), !e4 && c2 && (c2.checked = false, De.createEngTicket = false, localStorage.setItem(Re, "false"), l2 && (l2.style.display = "none"));
|
|
1776
1908
|
});
|
|
1777
|
-
|
|
1909
|
+
c2 && c2.addEventListener("change", async () => {
|
|
1778
1910
|
var _a;
|
|
1779
|
-
const e4 =
|
|
1780
|
-
if (
|
|
1781
|
-
if (!hasValidIntegration()) return
|
|
1911
|
+
const e4 = c2.checked;
|
|
1912
|
+
if (De.createEngTicket = e4, localStorage.setItem(Re, String(e4)), e4 && !De.createIssue && (De.createIssue = true, localStorage.setItem(Le, "true"), s2 && (s2.checked = true), a2 && (a2.style.display = "block")), l2 && (l2.style.display = e4 ? "block" : "none"), e4) {
|
|
1913
|
+
if (!hasValidIntegration()) return c2.checked = false, De.createEngTicket = false, localStorage.setItem(Re, "false"), l2 && (l2.style.display = "none"), void alert("No engineering ticket integration found. Please install and configure an integration (Jira, Linear, or Zendesk) first.");
|
|
1782
1914
|
const e5 = getIntegrationData();
|
|
1783
1915
|
if (e5) {
|
|
1784
|
-
if (!
|
|
1785
|
-
if (getFieldsForProject(
|
|
1916
|
+
if (!De.engTicketTeam && e5.defaultTeam && (De.engTicketTeam = e5.defaultTeam), !De.engTicketProject && e5.defaultProject && (De.engTicketProject = e5.defaultProject), !De.engTicketPriority && e5.defaultPriority && (De.engTicketPriority = e5.defaultPriority), updateFormWithIntegrationData(De), "jira" === ((_a = e5.provider) == null ? void 0 : _a.toLowerCase()) && De.engTicketProject && !De.engTicketCustomFields.reporter) {
|
|
1917
|
+
if (getFieldsForProject(De.engTicketProject, De.engTicketIssueType).find((e6) => "reporter" === e6.fieldId)) {
|
|
1786
1918
|
const t5 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
|
|
1787
|
-
|
|
1919
|
+
De.engTicketCustomFields.reporter = t5 || e5.jiraReporterAccountId || "";
|
|
1788
1920
|
}
|
|
1789
1921
|
}
|
|
1790
1922
|
const t4 = document.getElementById("sf-eng-ticket-project"), n3 = document.getElementById("sf-eng-ticket-type");
|
|
@@ -1794,11 +1926,11 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1794
1926
|
});
|
|
1795
1927
|
const d2 = document.getElementById("sf-issue-name");
|
|
1796
1928
|
d2 && d2.addEventListener("input", () => {
|
|
1797
|
-
|
|
1929
|
+
De.issueName = d2.value;
|
|
1798
1930
|
});
|
|
1799
1931
|
bindEngTicketListeners(), t3 && (t3.onclick = () => {
|
|
1800
1932
|
const e4 = document.getElementById("sf-issue-description");
|
|
1801
|
-
e4 && (
|
|
1933
|
+
e4 && (De.description = e4.value), (function startCountdownThenRecord() {
|
|
1802
1934
|
if (document.getElementById("sf-countdown-overlay")) return;
|
|
1803
1935
|
const e5 = document.createElement("div");
|
|
1804
1936
|
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 ";
|
|
@@ -1808,10 +1940,10 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1808
1940
|
if (t4--, t4 > 0) e5.textContent = t4.toString();
|
|
1809
1941
|
else {
|
|
1810
1942
|
clearInterval(n3), document.body.removeChild(e5), (function setRecordingStartTime(e6) {
|
|
1811
|
-
|
|
1943
|
+
Be = e6;
|
|
1812
1944
|
})(Date.now()), setIsRecording(true);
|
|
1813
1945
|
try {
|
|
1814
|
-
const { enableFunctionSpanTracking: e6 } = await Promise.resolve().then(() =>
|
|
1946
|
+
const { enableFunctionSpanTracking: e6 } = await Promise.resolve().then(() => de);
|
|
1815
1947
|
e6();
|
|
1816
1948
|
} catch (e6) {
|
|
1817
1949
|
console.error("[Report Issue] Failed to enable function span tracking:", e6);
|
|
@@ -1838,7 +1970,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1838
1970
|
const t5 = e6.querySelector("#sf-recording-timer");
|
|
1839
1971
|
if (!t5) return;
|
|
1840
1972
|
const n4 = setInterval(() => {
|
|
1841
|
-
const e7 = Date.now() - (
|
|
1973
|
+
const e7 = Date.now() - (Be ?? Date.now()), n5 = Math.floor(e7 / 6e4).toString().padStart(2, "0"), i3 = Math.floor(e7 % 6e4 / 1e3).toString().padStart(2, "0");
|
|
1842
1974
|
t5.textContent = `${n5}:${i3}`;
|
|
1843
1975
|
}, 1e3);
|
|
1844
1976
|
setTimerInterval(n4);
|
|
@@ -1847,41 +1979,41 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1847
1979
|
}, 1e3);
|
|
1848
1980
|
})();
|
|
1849
1981
|
});
|
|
1850
|
-
|
|
1982
|
+
Ke == null ? void 0 : Ke.addEventListener("click", (e4) => {
|
|
1851
1983
|
var _a;
|
|
1852
1984
|
if (e4.target.closest("#sf-issue-submit-btn")) {
|
|
1853
|
-
const e5 = ((_a = document.getElementById("sf-issue-description")) == null ? void 0 : _a.value) || "", t4 =
|
|
1854
|
-
if (
|
|
1985
|
+
const e5 = ((_a = document.getElementById("sf-issue-description")) == null ? void 0 : _a.value) || "", t4 = De.mode;
|
|
1986
|
+
if (De.description = e5, De.createIssue && !De.issueName.trim()) return void alert("Issue title is required when creating an issue.");
|
|
1855
1987
|
let n3, i3;
|
|
1856
|
-
if ("startnow" === t4) n3 =
|
|
1988
|
+
if ("startnow" === t4) n3 = Be ?? Date.now() - 3e5, i3 = Pe ?? Date.now();
|
|
1857
1989
|
else {
|
|
1858
1990
|
const e6 = 60 * Number((o2 == null ? void 0 : o2.value) || "2") * 1e3;
|
|
1859
1991
|
i3 = Date.now(), n3 = i3 - e6;
|
|
1860
1992
|
}
|
|
1861
|
-
if (
|
|
1862
|
-
const o3 = document.getElementById("sf-issue-name"),
|
|
1993
|
+
if (De.createIssue) {
|
|
1994
|
+
const o3 = document.getElementById("sf-issue-name"), r3 = document.getElementById("sf-eng-ticket-team"), s3 = document.getElementById("sf-eng-ticket-project"), a3 = document.getElementById("sf-eng-ticket-priority"), c3 = document.getElementById("sf-eng-ticket-type"), l3 = (o3 == null ? void 0 : o3.value) || "", d3 = e5, u2 = (r3 == null ? void 0 : r3.value) || "", p2 = (s3 == null ? void 0 : s3.value) || "", f2 = a3 ? Number(a3.value) : 0, g2 = De.engTicketLabels, m2 = (c3 == null ? void 0 : c3.value) || "", h2 = { ...De.engTicketCustomFields };
|
|
1863
1995
|
document.querySelectorAll(".sf-dynamic-field").forEach((e6) => {
|
|
1864
1996
|
const t5 = e6, n4 = t5.dataset.fieldId;
|
|
1865
1997
|
n4 && ("checkbox" === t5.type ? h2[n4] = t5.checked : "number" === t5.type ? h2[n4] = parseFloat(t5.value) || null : t5.classList.contains("sf-custom-multiselect") || (h2[n4] = t5.value));
|
|
1866
1998
|
});
|
|
1867
|
-
const y2 = document.getElementById("sf-eng-ticket-sprint"),
|
|
1868
|
-
if (
|
|
1999
|
+
const y2 = document.getElementById("sf-eng-ticket-sprint"), b2 = (y2 == null ? void 0 : y2.value) || De.engTicketSprint;
|
|
2000
|
+
if (b2) {
|
|
1869
2001
|
const e6 = getSprintFieldId();
|
|
1870
|
-
h2[e6] = parseInt(
|
|
2002
|
+
h2[e6] = parseInt(b2, 10);
|
|
1871
2003
|
}
|
|
1872
|
-
const isFieldEmpty = (e6) => null == e6 || ("string" == typeof e6 ? "" === e6.trim() : !!Array.isArray(e6) && 0 === e6.length),
|
|
1873
|
-
for (const e6 of
|
|
2004
|
+
const isFieldEmpty = (e6) => null == e6 || ("string" == typeof e6 ? "" === e6.trim() : !!Array.isArray(e6) && 0 === e6.length), v2 = De.createEngTicket ? (getFieldsForProject(p2, m2) || []).filter((e6) => e6 && e6.required) : [], S2 = [];
|
|
2005
|
+
for (const e6 of v2) {
|
|
1874
2006
|
const t5 = e6.fieldId || e6.key;
|
|
1875
2007
|
if ("summary" === t5 || "description" === t5 || "priority" === t5) continue;
|
|
1876
2008
|
let n4, i4;
|
|
1877
|
-
"project" === t5 ? (n4 = !!document.getElementById("sf-eng-ticket-project"), i4 = p2) : "issuetype" === t5 ? (n4 = !!document.getElementById("sf-eng-ticket-type"), i4 = m2) : (n4 = !!document.querySelector(`[data-field-id="${t5}"]`), i4 = h2[t5]), n4 && isFieldEmpty(i4) &&
|
|
2009
|
+
"project" === t5 ? (n4 = !!document.getElementById("sf-eng-ticket-project"), i4 = p2) : "issuetype" === t5 ? (n4 = !!document.getElementById("sf-eng-ticket-type"), i4 = m2) : (n4 = !!document.querySelector(`[data-field-id="${t5}"]`), i4 = h2[t5]), n4 && isFieldEmpty(i4) && S2.push(e6.name || t5);
|
|
1878
2010
|
}
|
|
1879
|
-
if (
|
|
1880
|
-
closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4,
|
|
2011
|
+
if (S2.length > 0) return void alert(`Please fill in the required field${S2.length > 1 ? "s" : ""}: ${S2.join(", ")}`);
|
|
2012
|
+
closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4, r4, s4, a4, c4, l4, d4, u3, p3) {
|
|
1881
2013
|
var _a2, _b, _c;
|
|
1882
2014
|
try {
|
|
1883
2015
|
showStatusModal(true);
|
|
1884
|
-
const f3 = await createTriageAndIssueFromRecorder(
|
|
2016
|
+
const f3 = await createTriageAndIssueFromRecorder(We.apiKey, We.backendApi, getSessionIdSafely(), e6, t5, n4, i4, o4, r4, s4, a4, c4, l4, d4, u3, p3);
|
|
1885
2017
|
if ((_a2 = f3 == null ? void 0 : f3.errors) == null ? void 0 : _a2.length) {
|
|
1886
2018
|
const e7 = f3.errors.map((e8) => e8.message).join("; ");
|
|
1887
2019
|
return console.error("GraphQL error creating triage and issue:", e7), void showStatusModal(false, null, e7);
|
|
@@ -1891,33 +2023,33 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1891
2023
|
} catch (e7) {
|
|
1892
2024
|
console.error("Error creating triage and issue:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
|
|
1893
2025
|
}
|
|
1894
|
-
})(`${n3}`, `${i3}`, e5,
|
|
2026
|
+
})(`${n3}`, `${i3}`, e5, l3, d3, De.createEngTicket, u2, p2, f2, g2, m2, h2, "startnow" === t4 ? "RECORDED" : "LOOKBACK");
|
|
1895
2027
|
} else closeModal(), (async function createTriage(e6, t5, n4, i4) {
|
|
1896
2028
|
var _a2, _b, _c;
|
|
1897
2029
|
try {
|
|
1898
2030
|
showStatusModal(true);
|
|
1899
|
-
const o3 = await createTriageFromRecorder(
|
|
2031
|
+
const o3 = await createTriageFromRecorder(We.apiKey, We.backendApi, getSessionIdSafely(), e6, t5, n4, i4);
|
|
1900
2032
|
if ((_a2 = o3 == null ? void 0 : o3.errors) == null ? void 0 : _a2.length) {
|
|
1901
2033
|
const e7 = o3.errors.map((e8) => e8.message).join("; ");
|
|
1902
2034
|
return console.error("GraphQL error creating triage:", e7), void showStatusModal(false, null, e7);
|
|
1903
2035
|
}
|
|
1904
|
-
const
|
|
1905
|
-
|
|
2036
|
+
const r3 = (_c = (_b = o3 == null ? void 0 : o3.data) == null ? void 0 : _b.createTriageFromRecorder) == null ? void 0 : _c.id;
|
|
2037
|
+
r3 ? showStatusModal(false, { type: "triage", id: r3 }) : (console.error("No Triage ID returned from backend."), showStatusModal(false, null, "No triage was created. Please try again."));
|
|
1906
2038
|
} catch (e7) {
|
|
1907
2039
|
console.error("Error creating triage:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
|
|
1908
2040
|
}
|
|
1909
2041
|
})(`${n3}`, `${i3}`, e5, "startnow" === t4 ? "RECORDED" : "LOOKBACK");
|
|
1910
2042
|
}
|
|
1911
2043
|
});
|
|
1912
|
-
})(),
|
|
2044
|
+
})(), We.deactivateIsolation = activateModalIsolation(Ke), We.integrationData && De.createEngTicket ? initializeEngTicketForm() : We.integrationData || (De.createEngTicket = false), We.apiKey && We.backendApi && refreshIntegrationData(We.apiKey, We.backendApi).then((e3) => {
|
|
1913
2045
|
if (!e3 || !document.getElementById("sf-report-issue-modal")) return;
|
|
1914
|
-
|
|
2046
|
+
We.integrationData = e3;
|
|
1915
2047
|
const t3 = document.getElementById("sf-eng-ticket-fields-container");
|
|
1916
2048
|
if (t3) {
|
|
1917
2049
|
const e4 = generateEngTicketFieldsHTML();
|
|
1918
|
-
e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(
|
|
2050
|
+
e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(De), renderDynamicFields(De.engTicketProject, De.engTicketIssueType));
|
|
1919
2051
|
}
|
|
1920
|
-
if (
|
|
2052
|
+
if (Ve) {
|
|
1921
2053
|
const e4 = document.getElementById("sf-create-eng-ticket-label");
|
|
1922
2054
|
e4 && (e4.style.display = "flex");
|
|
1923
2055
|
}
|
|
@@ -1925,40 +2057,40 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1925
2057
|
}
|
|
1926
2058
|
function initializeEngTicketForm() {
|
|
1927
2059
|
var _a;
|
|
1928
|
-
const e2 =
|
|
2060
|
+
const e2 = We.integrationData;
|
|
1929
2061
|
if (e2) {
|
|
1930
|
-
if (!
|
|
1931
|
-
if (getFieldsForProject(
|
|
2062
|
+
if (!De.engTicketTeam && e2.defaultTeam && (De.engTicketTeam = e2.defaultTeam), !De.engTicketProject && e2.defaultProject && (De.engTicketProject = e2.defaultProject), !De.engTicketPriority && e2.defaultPriority && (De.engTicketPriority = e2.defaultPriority), updateFormWithIntegrationData(De), "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase()) && De.engTicketProject && !De.engTicketCustomFields.reporter) {
|
|
2063
|
+
if (getFieldsForProject(De.engTicketProject, De.engTicketIssueType).find((e3) => "reporter" === e3.fieldId)) {
|
|
1932
2064
|
const t2 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
|
|
1933
|
-
|
|
2065
|
+
De.engTicketCustomFields.reporter = t2 || e2.jiraReporterAccountId || "";
|
|
1934
2066
|
}
|
|
1935
2067
|
}
|
|
1936
|
-
|
|
2068
|
+
De.engTicketProject && renderDynamicFields(De.engTicketProject, De.engTicketIssueType);
|
|
1937
2069
|
}
|
|
1938
2070
|
}
|
|
1939
2071
|
function setActiveTab(e2) {
|
|
1940
|
-
|
|
1941
|
-
const t2 =
|
|
2072
|
+
De.mode = e2;
|
|
2073
|
+
const t2 = Ke == null ? void 0 : Ke.querySelector("#sf-tab-lookback"), n2 = Ke == null ? void 0 : Ke.querySelector("#sf-tab-startnow");
|
|
1942
2074
|
"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");
|
|
1943
2075
|
}
|
|
1944
2076
|
function updateModeSpecificUI(e2) {
|
|
1945
|
-
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"),
|
|
1946
|
-
if (t2 && n2 && i2 && o2 &&
|
|
1947
|
-
i2.style.display = "block", a2.style.display = "none",
|
|
1948
|
-
const e3 = null !==
|
|
1949
|
-
if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed",
|
|
1950
|
-
const e4 = Math.floor((
|
|
1951
|
-
o2.style.display = "block",
|
|
2077
|
+
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"), r2 = document.getElementById("sf-recording-timer-display"), s2 = document.getElementById("sf-modal-footer"), a2 = document.getElementById("sf-lookback-container");
|
|
2078
|
+
if (t2 && n2 && i2 && o2 && r2 && s2 && a2) if ("startnow" === e2) {
|
|
2079
|
+
i2.style.display = "block", a2.style.display = "none", s2.style.justifyContent = "space-between", t2.textContent = "I want to reproduce the issue right now.";
|
|
2080
|
+
const e3 = null !== Be && null !== Pe;
|
|
2081
|
+
if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed", Be && Pe) {
|
|
2082
|
+
const e4 = Math.floor((Pe - Be) / 1e3), t3 = String(Math.floor(e4 / 60)).padStart(2, "0"), n3 = String(e4 % 60).padStart(2, "0");
|
|
2083
|
+
o2.style.display = "block", r2.textContent = `${t3}:${n3}`;
|
|
1952
2084
|
} else o2.style.display = "none";
|
|
1953
|
-
} else i2.style.display = "none", o2.style.display = "none", a2.style.display = "block",
|
|
2085
|
+
} else i2.style.display = "none", o2.style.display = "none", a2.style.display = "block", s2.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";
|
|
1954
2086
|
}
|
|
1955
2087
|
function bindEngTicketListeners() {
|
|
1956
|
-
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"),
|
|
2088
|
+
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"), r2 = document.getElementById("sf-eng-ticket-sprint");
|
|
1957
2089
|
e2 && e2.addEventListener("change", () => {
|
|
1958
|
-
|
|
2090
|
+
De.engTicketTeam = e2.value, e2.style.color = e2.value ? "" : "#9ca3af";
|
|
1959
2091
|
const t3 = document.getElementById("sf-eng-ticket-project");
|
|
1960
2092
|
if (t3) {
|
|
1961
|
-
|
|
2093
|
+
De.engTicketProject = "", De.engTicketCustomFields = {};
|
|
1962
2094
|
const n3 = getProjectsForTeam(e2.value);
|
|
1963
2095
|
t3.innerHTML = '<option value="">Select project...</option>', n3.forEach((e3) => {
|
|
1964
2096
|
const n4 = document.createElement("option");
|
|
@@ -1967,41 +2099,41 @@ function bindEngTicketListeners() {
|
|
|
1967
2099
|
}
|
|
1968
2100
|
}), t2 && t2.addEventListener("change", () => {
|
|
1969
2101
|
var _a;
|
|
1970
|
-
|
|
2102
|
+
De.engTicketProject = t2.value, t2.style.color = t2.value ? "" : "#9ca3af", De.engTicketCustomFields = {};
|
|
1971
2103
|
const e3 = getIntegrationData();
|
|
1972
|
-
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value),
|
|
1973
|
-
if (getFieldsForProject(t2.value,
|
|
2104
|
+
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value), De.engTicketIssueType = o2.value), e3 && "jira" === ((_a = e3.provider) == null ? void 0 : _a.toLowerCase()) && t2.value) {
|
|
2105
|
+
if (getFieldsForProject(t2.value, De.engTicketIssueType).find((e4) => "reporter" === e4.fieldId)) {
|
|
1974
2106
|
const t3 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
|
|
1975
|
-
|
|
2107
|
+
De.engTicketCustomFields.reporter = t3 || e3.jiraReporterAccountId || "";
|
|
1976
2108
|
}
|
|
1977
2109
|
}
|
|
1978
|
-
renderDynamicFields(t2.value,
|
|
1979
|
-
}),
|
|
1980
|
-
|
|
2110
|
+
renderDynamicFields(t2.value, De.engTicketIssueType);
|
|
2111
|
+
}), r2 && r2.addEventListener("change", () => {
|
|
2112
|
+
De.engTicketSprint = r2.value, r2.style.color = r2.value ? "" : "#9ca3af", setSprintDefaulted(true);
|
|
1981
2113
|
}), n2 && n2.addEventListener("change", () => {
|
|
1982
|
-
|
|
2114
|
+
De.engTicketPriority = Number(n2.value);
|
|
1983
2115
|
}), i2 && setupCustomMultiSelectListeners("sf-eng-ticket-labels", (e3) => {
|
|
1984
|
-
|
|
2116
|
+
De.engTicketLabels = e3;
|
|
1985
2117
|
}), o2 && o2.addEventListener("change", () => {
|
|
1986
|
-
|
|
2118
|
+
De.engTicketIssueType = o2.value, o2.style.color = o2.value ? "" : "#9ca3af";
|
|
1987
2119
|
const e3 = document.getElementById("sf-eng-ticket-project");
|
|
1988
2120
|
if (e3 && e3.value) {
|
|
1989
|
-
const t3 =
|
|
1990
|
-
|
|
2121
|
+
const t3 = De.engTicketCustomFields.reporter;
|
|
2122
|
+
De.engTicketCustomFields = {}, t3 && (De.engTicketCustomFields.reporter = t3), renderDynamicFields(e3.value, o2.value);
|
|
1991
2123
|
}
|
|
1992
2124
|
});
|
|
1993
|
-
const
|
|
1994
|
-
|
|
2125
|
+
const s2 = document.getElementById("sf-dynamic-fields-container");
|
|
2126
|
+
s2 && (s2.addEventListener("input", (e3) => {
|
|
1995
2127
|
const t3 = e3.target;
|
|
1996
2128
|
if (t3.classList.contains("sf-dynamic-field")) {
|
|
1997
2129
|
const e4 = t3.dataset.fieldId;
|
|
1998
|
-
e4 && ("checkbox" === t3.type ?
|
|
2130
|
+
e4 && ("checkbox" === t3.type ? De.engTicketCustomFields[e4] = t3.checked : "number" === t3.type ? De.engTicketCustomFields[e4] = parseFloat(t3.value) || null : De.engTicketCustomFields[e4] = t3.value);
|
|
1999
2131
|
}
|
|
2000
|
-
}),
|
|
2132
|
+
}), s2.addEventListener("change", (e3) => {
|
|
2001
2133
|
const t3 = e3.target;
|
|
2002
2134
|
if (t3.classList.contains("sf-dynamic-field")) {
|
|
2003
2135
|
const e4 = t3.dataset.fieldId;
|
|
2004
|
-
if (e4 && (
|
|
2136
|
+
if (e4 && (De.engTicketCustomFields[e4] = t3.value, "reporter" === e4 && t3.value && saveLastReporterAccountId(t3.value)), "SELECT" === t3.tagName) {
|
|
2005
2137
|
const e5 = t3;
|
|
2006
2138
|
e5.style.color = e5.value ? "" : "#9ca3af";
|
|
2007
2139
|
}
|
|
@@ -2011,10 +2143,10 @@ function bindEngTicketListeners() {
|
|
|
2011
2143
|
async function stopRecording() {
|
|
2012
2144
|
var _a;
|
|
2013
2145
|
!(function setRecordingEndTime(e2) {
|
|
2014
|
-
|
|
2015
|
-
})(Date.now()), setIsRecording(false),
|
|
2146
|
+
Pe = e2;
|
|
2147
|
+
})(Date.now()), setIsRecording(false), _e && (clearInterval(_e), setTimerInterval(null)), (_a = document.getElementById("sf-recording-indicator")) == null ? void 0 : _a.remove();
|
|
2016
2148
|
try {
|
|
2017
|
-
const { disableFunctionSpanTracking: e2 } = await Promise.resolve().then(() =>
|
|
2149
|
+
const { disableFunctionSpanTracking: e2 } = await Promise.resolve().then(() => de);
|
|
2018
2150
|
e2();
|
|
2019
2151
|
} catch (e2) {
|
|
2020
2152
|
console.error("[Report Issue] Failed to disable function span tracking:", e2);
|
|
@@ -2027,18 +2159,18 @@ async function stopRecording() {
|
|
|
2027
2159
|
t3 && (t3.textContent = "Re-record");
|
|
2028
2160
|
}
|
|
2029
2161
|
const t2 = document.getElementById("sf-recording-timer-label"), n2 = document.getElementById("sf-recording-timer-display");
|
|
2030
|
-
if (t2 && n2 &&
|
|
2031
|
-
const e3 = Math.floor((
|
|
2162
|
+
if (t2 && n2 && Be && Pe) {
|
|
2163
|
+
const e3 = Math.floor((Pe - Be) / 1e3), i3 = Math.floor(e3 / 60).toString().padStart(2, "0"), o3 = (e3 % 60).toString().padStart(2, "0");
|
|
2032
2164
|
n2.textContent = `${i3}:${o3}`, t2.style.display = "block";
|
|
2033
2165
|
}
|
|
2034
2166
|
const i2 = document.getElementById("sf-issue-description");
|
|
2035
|
-
i2 && (i2.value =
|
|
2167
|
+
i2 && (i2.value = De.description);
|
|
2036
2168
|
const o2 = document.querySelector('input[value="startnow"]');
|
|
2037
2169
|
o2 && (o2.checked = true);
|
|
2038
|
-
const
|
|
2039
|
-
if (
|
|
2040
|
-
const e3 = Math.floor(((
|
|
2041
|
-
|
|
2170
|
+
const r2 = document.getElementById("sf-inline-record-chip"), s2 = document.getElementById("sf-inline-record-timer");
|
|
2171
|
+
if (r2 && s2) {
|
|
2172
|
+
const e3 = Math.floor(((Pe ?? 0) - (Be ?? 0)) / 1e3), t3 = Math.floor(e3 / 60).toString().padStart(2, "0"), n3 = Math.floor(e3 % 60).toString().padStart(2, "0");
|
|
2173
|
+
s2.textContent = `${t3}:${n3}`, s2.style.color = "black", r2.style.display = "flex";
|
|
2042
2174
|
}
|
|
2043
2175
|
const a2 = document.getElementById("sf-issue-submit-btn");
|
|
2044
2176
|
a2.disabled = false, a2.style.opacity = "1", a2.style.cursor = "pointer";
|
|
@@ -2051,10 +2183,10 @@ function showStatusModal(e2, t2, n2) {
|
|
|
2051
2183
|
var _a2, _b;
|
|
2052
2184
|
(_a2 = document.getElementById("sf-report-issue-modal")) == null ? void 0 : _a2.remove(), (_b = document.getElementById("sf-triage-status-modal")) == null ? void 0 : _b.remove();
|
|
2053
2185
|
})();
|
|
2054
|
-
const o2 = !e3 && i2,
|
|
2055
|
-
|
|
2056
|
-
const a2 = e3 ? "Reporting Issue..." : o2 ? "Failed to report issue" : "Issue reported!",
|
|
2057
|
-
|
|
2186
|
+
const o2 = !e3 && i2, r2 = n3 ? `${We.triageBaseUrl}/issues/${n3}?from=inAppReportIssue` : t3 ? `${We.triageBaseUrl}/triage/${t3}?from=inAppReportIssue` : "", s2 = document.createElement("div");
|
|
2187
|
+
s2.id = "sf-triage-status-modal", Object.assign(s2.style, { position: "fixed", inset: "0", zIndex: "9998", display: "flex", alignItems: "center", justifyContent: "center" });
|
|
2188
|
+
const a2 = e3 ? "Reporting Issue..." : o2 ? "Failed to report issue" : "Issue reported!", c2 = 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>` : "", l2 = 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>';
|
|
2189
|
+
s2.innerHTML = `
|
|
2058
2190
|
<div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
|
|
2059
2191
|
<div id="sf-triage-card"
|
|
2060
2192
|
style="position:relative; background:#fff; padding:24px; border-radius:12px; width:300px; max-width:90%;
|
|
@@ -2071,8 +2203,8 @@ function showStatusModal(e2, t2, n2) {
|
|
|
2071
2203
|
</button>
|
|
2072
2204
|
|
|
2073
2205
|
<h2 style="font-size:18px; font-weight:600; margin-bottom:${e3 || o2 ? 8 : 40}px; line-height:28px;">${a2}</h2>
|
|
2074
|
-
${l2}
|
|
2075
2206
|
${c2}
|
|
2207
|
+
${l2}
|
|
2076
2208
|
|
|
2077
2209
|
<div style="display:${o2 ? "none" : "flex"}; justify-content:flex-end; align-items:center; gap:8px;">
|
|
2078
2210
|
<button id="sf-copy-triage-link"
|
|
@@ -2095,28 +2227,28 @@ function showStatusModal(e2, t2, n2) {
|
|
|
2095
2227
|
<style>
|
|
2096
2228
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
2097
2229
|
</style>
|
|
2098
|
-
`, document.body.appendChild(
|
|
2099
|
-
const u2 =
|
|
2230
|
+
`, document.body.appendChild(s2);
|
|
2231
|
+
const u2 = s2.querySelector("#sf-triage-card");
|
|
2100
2232
|
(_a = document.getElementById("sf-triage-modal-close")) == null ? void 0 : _a.addEventListener("click", () => {
|
|
2101
|
-
fadeCardAndRemove(
|
|
2233
|
+
fadeCardAndRemove(s2, u2, 300);
|
|
2102
2234
|
});
|
|
2103
2235
|
const p2 = document.getElementById("sf-copy-triage-link"), f2 = document.getElementById("sf-view-triage-btn");
|
|
2104
2236
|
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", () => {
|
|
2105
|
-
navigator.clipboard.writeText(
|
|
2237
|
+
navigator.clipboard.writeText(r2).then(() => {
|
|
2106
2238
|
const e4 = document.getElementById("sf-copied-status");
|
|
2107
2239
|
e4 && (e4.style.display = "flex");
|
|
2108
2240
|
});
|
|
2109
2241
|
}), f2.disabled = false, f2.addEventListener("click", () => {
|
|
2110
|
-
(t3 || n3) && window.open(
|
|
2111
|
-
}), o2 || setTimeout(() => fadeCardAndRemove(
|
|
2242
|
+
(t3 || n3) && window.open(r2, "_blank");
|
|
2243
|
+
}), o2 || setTimeout(() => fadeCardAndRemove(s2, u2, 300), 1e4));
|
|
2112
2244
|
})(e2, "triage" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, "issue" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, n2);
|
|
2113
2245
|
}
|
|
2114
2246
|
function fadeCardAndRemove(e2, t2, n2 = 300) {
|
|
2115
2247
|
t2.style.opacity = "0", t2.addEventListener("transitionend", () => e2.remove(), { once: true }), setTimeout(() => e2.remove(), n2 + 100);
|
|
2116
2248
|
}
|
|
2117
|
-
const
|
|
2118
|
-
|
|
2119
|
-
const t3 = { ...
|
|
2249
|
+
const Ge = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueContext: We, openReportIssueModal, setupIssueReporting: function setupIssueReporting(e2) {
|
|
2250
|
+
We.apiKey = e2.apiKey, We.backendApi = e2.backendApi, We.resolveSessionId = e2.getSessionId, We.integrationData = e2.integrationData || null, We.showEngTicketFieldsDefault = e2.showEngTicketFieldsInReportIssueModalDefault ?? false, e2.customBaseUrl && (We.triageBaseUrl = e2.customBaseUrl), We.shortcuts = (function mergeShortcutsConfig(e3) {
|
|
2251
|
+
const t3 = { ...He };
|
|
2120
2252
|
if (!e3) return t3;
|
|
2121
2253
|
"boolean" == typeof e3.enabled && (t3.enabled = e3.enabled);
|
|
2122
2254
|
const n2 = ["openModalExistingMode", "openModalCaptureNewMode", "closeModal", "submitReport", "startRecording", "stopRecording"];
|
|
@@ -2126,41 +2258,250 @@ const Me = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueCon
|
|
|
2126
2258
|
}
|
|
2127
2259
|
return t3;
|
|
2128
2260
|
})(e2.shortcuts);
|
|
2129
|
-
const { shortcuts: t2 } =
|
|
2261
|
+
const { shortcuts: t2 } = We;
|
|
2130
2262
|
window.addEventListener("keydown", (e3) => {
|
|
2131
2263
|
const n2 = (function isTypingInInput() {
|
|
2132
2264
|
const e4 = document.activeElement;
|
|
2133
2265
|
return e4 instanceof HTMLInputElement || e4 instanceof HTMLTextAreaElement || e4 instanceof HTMLElement && e4.isContentEditable;
|
|
2134
|
-
})(), i2 = e3.key.toLowerCase(), o2 = e3.metaKey || e3.ctrlKey,
|
|
2266
|
+
})(), i2 = e3.key.toLowerCase(), o2 = e3.metaKey || e3.ctrlKey, r2 = !!document.getElementById("sf-report-issue-modal"), s2 = !n2 && (t2.enabled || r2), shortcutUsed = (e4) => i2 === t2[e4].key && o2 === t2[e4].requireCmdCtrl, a2 = r2 ? (e4) => {
|
|
2135
2267
|
setActiveTab(e4), updateModeSpecificUI(e4);
|
|
2136
2268
|
} : injectModalHTML;
|
|
2137
|
-
if (
|
|
2138
|
-
if (
|
|
2139
|
-
if (
|
|
2140
|
-
if (
|
|
2269
|
+
if (s2 && shortcutUsed("openModalExistingMode")) return e3.preventDefault(), void a2("lookback");
|
|
2270
|
+
if (s2 && shortcutUsed("openModalCaptureNewMode")) return e3.preventDefault(), void a2("startnow");
|
|
2271
|
+
if (r2 && !Oe && shortcutUsed("closeModal")) return e3.preventDefault(), void closeModal();
|
|
2272
|
+
if (r2 && shortcutUsed("submitReport")) {
|
|
2141
2273
|
const t3 = document.getElementById("sf-issue-submit-btn");
|
|
2142
2274
|
return void (t3 && !t3.disabled && (e3.preventDefault(), t3.click()));
|
|
2143
2275
|
}
|
|
2144
|
-
if (
|
|
2145
|
-
if (
|
|
2276
|
+
if (Oe && i2 === t2.stopRecording.key && o2 === t2.stopRecording.requireCmdCtrl) return e3.preventDefault(), void stopRecording();
|
|
2277
|
+
if (r2 && "startnow" === De.mode && i2 === t2.startRecording.key && o2 === t2.startRecording.requireCmdCtrl && !n2) {
|
|
2146
2278
|
const t3 = document.getElementById("sf-start-recording-btn");
|
|
2147
2279
|
return void (t3 && (e3.preventDefault(), t3.click()));
|
|
2148
2280
|
}
|
|
2149
2281
|
});
|
|
2150
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
2282
|
+
} }, Symbol.toStringTag, { value: "Module" })), Qe = /* @__PURE__ */ new WeakMap();
|
|
2283
|
+
function creationOf(e2) {
|
|
2284
|
+
const t2 = {};
|
|
2285
|
+
try {
|
|
2286
|
+
let n2 = e2;
|
|
2287
|
+
for (let e3 = 0; e3 < 8 && n2 && "object" == typeof n2; e3++) {
|
|
2288
|
+
const e4 = Qe.get(n2);
|
|
2289
|
+
if (e4) {
|
|
2290
|
+
t2.createId = e4;
|
|
2291
|
+
break;
|
|
2292
|
+
}
|
|
2293
|
+
n2 = n2.parent;
|
|
2294
|
+
}
|
|
2295
|
+
} catch {
|
|
2296
|
+
}
|
|
2297
|
+
return t2;
|
|
2298
|
+
}
|
|
2299
|
+
function frameworkChildren(e2) {
|
|
2300
|
+
const t2 = [], push = (e3) => {
|
|
2301
|
+
e3 && "object" == typeof e3 && t2.push(e3);
|
|
2302
|
+
};
|
|
2303
|
+
try {
|
|
2304
|
+
const t3 = e2;
|
|
2305
|
+
if (Array.isArray(t3.children)) for (const e3 of t3.children) push(e3);
|
|
2306
|
+
if (push(t3.scene), Array.isArray(t3.scenes)) for (const e3 of t3.scenes) push(e3);
|
|
2307
|
+
if ("function" == typeof t3.getObjects) {
|
|
2308
|
+
const e3 = t3.getObjects();
|
|
2309
|
+
if (Array.isArray(e3)) for (const t4 of e3) push(t4);
|
|
2310
|
+
}
|
|
2311
|
+
} catch {
|
|
2312
|
+
}
|
|
2313
|
+
return t2;
|
|
2314
|
+
}
|
|
2315
|
+
function markSubtree(e2, t2) {
|
|
2316
|
+
try {
|
|
2317
|
+
if (!e2 || "object" != typeof e2) return;
|
|
2318
|
+
const n2 = /* @__PURE__ */ new WeakSet();
|
|
2319
|
+
let i2 = [e2];
|
|
2320
|
+
n2.add(e2);
|
|
2321
|
+
let o2 = 0;
|
|
2322
|
+
for (let e3 = 0; e3 <= 6 && i2.length; e3++) {
|
|
2323
|
+
const r2 = [];
|
|
2324
|
+
for (const s2 of i2) {
|
|
2325
|
+
if (o2 >= 2e3) return;
|
|
2326
|
+
o2++;
|
|
2327
|
+
try {
|
|
2328
|
+
Qe.has(s2) || Qe.set(s2, t2);
|
|
2329
|
+
} catch {
|
|
2330
|
+
}
|
|
2331
|
+
if (e3 < 6) for (const e4 of frameworkChildren(s2)) n2.has(e4) || (n2.add(e4), r2.push(e4));
|
|
2332
|
+
}
|
|
2333
|
+
i2 = r2;
|
|
2334
|
+
}
|
|
2335
|
+
} catch {
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
const Xe = /* @__PURE__ */ new Map();
|
|
2339
|
+
function bind(e2, t2) {
|
|
2340
|
+
return (function isCanvas(e3) {
|
|
2341
|
+
return "undefined" != typeof HTMLCanvasElement && e3 instanceof HTMLCanvasElement;
|
|
2342
|
+
})(e2) ? (Xe.set(e2, t2), () => {
|
|
2343
|
+
Xe.get(e2) === t2 && Xe.delete(e2);
|
|
2344
|
+
}) : () => {
|
|
2345
|
+
};
|
|
2346
|
+
}
|
|
2347
|
+
function registerKonvaStage(e2) {
|
|
2348
|
+
var _a, _b, _c, _d;
|
|
2349
|
+
try {
|
|
2350
|
+
const t2 = e2, n2 = ((_a = t2.getLayers) == null ? void 0 : _a.call(t2)) ?? [], i2 = (_d = (_c = (_b = n2[0]) == null ? void 0 : _b.getCanvas) == null ? void 0 : _c.call(_b)) == null ? void 0 : _d._canvas;
|
|
2351
|
+
return bind(i2, (e3, n3) => {
|
|
2352
|
+
var _a2, _b2, _c2, _d2;
|
|
2353
|
+
const i3 = e3.getBoundingClientRect(), o2 = (_a2 = t2.getIntersection) == null ? void 0 : _a2.call(t2, { x: n3.clientX - i3.left, y: n3.clientY - i3.top });
|
|
2354
|
+
if (!o2) return null;
|
|
2355
|
+
const r2 = (_b2 = o2.getClassName) == null ? void 0 : _b2.call(o2);
|
|
2356
|
+
return { framework: "konva", label: ((_c2 = o2.name) == null ? void 0 : _c2.call(o2)) || ((_d2 = o2.id) == null ? void 0 : _d2.call(o2)) || r2 || "shape", objectType: r2, ...creationOf(o2) };
|
|
2357
|
+
});
|
|
2358
|
+
} catch {
|
|
2359
|
+
return () => {
|
|
2360
|
+
};
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
function registerFabricCanvas(e2) {
|
|
2364
|
+
try {
|
|
2365
|
+
const t2 = e2;
|
|
2366
|
+
return bind(t2.lowerCanvasEl, (e3, n2) => {
|
|
2367
|
+
var _a;
|
|
2368
|
+
const i2 = (_a = t2.findTarget) == null ? void 0 : _a.call(t2, n2);
|
|
2369
|
+
if (!i2) return null;
|
|
2370
|
+
return { framework: "fabric", label: i2.name || i2.id || i2.type || "object", objectType: i2.type, ...creationOf(i2) };
|
|
2371
|
+
});
|
|
2372
|
+
} catch {
|
|
2373
|
+
return () => {
|
|
2374
|
+
};
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
function registerChart(e2) {
|
|
2378
|
+
try {
|
|
2379
|
+
const t2 = e2;
|
|
2380
|
+
return bind(t2.canvas, (e3, n2) => {
|
|
2381
|
+
var _a, _b, _c, _d, _e2;
|
|
2382
|
+
const i2 = (_a = t2.getElementsAtEventForMode) == null ? void 0 : _a.call(t2, n2, "nearest", { intersect: true }, false);
|
|
2383
|
+
if (!i2 || !i2.length) return null;
|
|
2384
|
+
const { datasetIndex: o2, index: r2 } = i2[0];
|
|
2385
|
+
return { framework: "chartjs", label: `${((_d = (_c = (_b = t2.data) == null ? void 0 : _b.datasets) == null ? void 0 : _c[o2]) == null ? void 0 : _d.label) ?? `dataset${o2}`}[${r2}]`, objectType: (_e2 = t2.config) == null ? void 0 : _e2.type, ...creationOf(t2), configRef: { datasetIndex: o2, index: r2 } };
|
|
2386
|
+
});
|
|
2387
|
+
} catch {
|
|
2388
|
+
return () => {
|
|
2389
|
+
};
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
function registerThreeScene(e2, t2, n2, i2) {
|
|
2393
|
+
try {
|
|
2394
|
+
const o2 = i2, r2 = n2, s2 = e2, a2 = new o2.Raycaster(), c2 = new o2.Vector2();
|
|
2395
|
+
return bind(r2.domElement, (e3, n3) => {
|
|
2396
|
+
const i3 = e3.getBoundingClientRect();
|
|
2397
|
+
c2.x = (n3.clientX - i3.left) / i3.width * 2 - 1, c2.y = -(n3.clientY - i3.top) / i3.height * 2 + 1, a2.setFromCamera(c2, t2);
|
|
2398
|
+
const o3 = a2.intersectObjects(s2.children ?? [], true);
|
|
2399
|
+
if (!o3.length) return null;
|
|
2400
|
+
const r3 = o3[0].object;
|
|
2401
|
+
let l2 = r3;
|
|
2402
|
+
for (; l2 && !l2.name && l2.parent; ) l2 = l2.parent;
|
|
2403
|
+
return { framework: "three", label: (l2 == null ? void 0 : l2.name) || r3.name || r3.uuid || "mesh", objectType: r3.type, path: r3.uuid, ...creationOf(r3) };
|
|
2404
|
+
});
|
|
2405
|
+
} catch {
|
|
2406
|
+
return () => {
|
|
2407
|
+
};
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
function registerPixiApp(e2) {
|
|
2411
|
+
try {
|
|
2412
|
+
const t2 = e2;
|
|
2413
|
+
return bind(t2.canvas ?? t2.view, (e3, n2) => {
|
|
2414
|
+
var _a, _b, _c, _d;
|
|
2415
|
+
const i2 = e3.getBoundingClientRect(), o2 = n2.clientX - i2.left, r2 = n2.clientY - i2.top, s2 = (_d = (_c = (_b = (_a = t2.renderer) == null ? void 0 : _a.events) == null ? void 0 : _b.rootBoundary) == null ? void 0 : _c.hitTest) == null ? void 0 : _d.call(_c, o2, r2);
|
|
2416
|
+
if (!s2) return null;
|
|
2417
|
+
const a2 = (function pixiObjectType(e4) {
|
|
2418
|
+
var _a2;
|
|
2419
|
+
if ("string" == typeof e4.text) return "Text";
|
|
2420
|
+
const t3 = !!e4.texture && "function" != typeof e4.texture;
|
|
2421
|
+
if (t3 && (e4.tilePosition || e4.tileScale)) return "TilingSprite";
|
|
2422
|
+
if (e4.geometry && e4.shader) return "Mesh";
|
|
2423
|
+
if (e4.context) return "Graphics";
|
|
2424
|
+
if (t3) return "Sprite";
|
|
2425
|
+
if (Array.isArray(e4.children)) return "Container";
|
|
2426
|
+
const n3 = (_a2 = e4.constructor) == null ? void 0 : _a2.name;
|
|
2427
|
+
return n3 && n3.length > 1 ? n3 : void 0;
|
|
2428
|
+
})(s2);
|
|
2429
|
+
return { framework: "pixi", label: s2.label || s2.name || a2 || "displayObject", objectType: a2, ...creationOf(s2) };
|
|
2430
|
+
});
|
|
2431
|
+
} catch {
|
|
2432
|
+
return () => {
|
|
2433
|
+
};
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
let Je = null, Ye = false;
|
|
2437
|
+
function onPointerDown(e2) {
|
|
2438
|
+
const t2 = Je;
|
|
2439
|
+
if (t2) for (const [n2, i2] of Xe) try {
|
|
2440
|
+
if (!n2.isConnected) {
|
|
2441
|
+
Xe.delete(n2);
|
|
2442
|
+
continue;
|
|
2443
|
+
}
|
|
2444
|
+
const o2 = n2.getBoundingClientRect();
|
|
2445
|
+
if (e2.clientX < o2.left || e2.clientX > o2.right || e2.clientY < o2.top || e2.clientY > o2.bottom) continue;
|
|
2446
|
+
const r2 = t2.canvasIdFor(n2);
|
|
2447
|
+
if (!r2) continue;
|
|
2448
|
+
const s2 = i2(n2, e2);
|
|
2449
|
+
if (!s2) continue;
|
|
2450
|
+
const a2 = n2.width, c2 = n2.height, l2 = o2.width ? Math.round((e2.clientX - o2.left) * a2 / o2.width) : 0, d2 = o2.height ? Math.round((e2.clientY - o2.top) * c2 / o2.height) : 0;
|
|
2451
|
+
t2.emitHit({ op: "hit", canvasId: r2, t: t2.now(), x: l2, y: d2, target: s2 });
|
|
2452
|
+
} catch {
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
function installAdapters(e2) {
|
|
2456
|
+
Je = e2;
|
|
2457
|
+
const t2 = globalThis;
|
|
2458
|
+
t2.__sfCreateSite = (e3, t3) => {
|
|
2459
|
+
try {
|
|
2460
|
+
e3 && "object" == typeof e3 && Qe.set(e3, t3);
|
|
2461
|
+
} catch {
|
|
2462
|
+
}
|
|
2463
|
+
}, t2.__sfCreateFrom = (e3, t3) => {
|
|
2464
|
+
!(function createFrom(e4, t4) {
|
|
2465
|
+
try {
|
|
2466
|
+
if (!t4) return;
|
|
2467
|
+
if ((function isThenable(e5) {
|
|
2468
|
+
try {
|
|
2469
|
+
return !!e5 && ("object" == typeof e5 || "function" == typeof e5) && "function" == typeof e5.then;
|
|
2470
|
+
} catch {
|
|
2471
|
+
return false;
|
|
2472
|
+
}
|
|
2473
|
+
})(e4)) return void e4.then((e5) => {
|
|
2474
|
+
markSubtree(e5, t4);
|
|
2475
|
+
}, () => {
|
|
2476
|
+
});
|
|
2477
|
+
markSubtree(e4, t4);
|
|
2478
|
+
} catch {
|
|
2479
|
+
}
|
|
2480
|
+
})(e3, t3);
|
|
2481
|
+
}, Ye || "undefined" == typeof window || (window.addEventListener("pointerdown", onPointerDown, { capture: true, passive: true }), Ye = true);
|
|
2482
|
+
}
|
|
2483
|
+
function uninstallAdapters() {
|
|
2484
|
+
Je = null, Ye && "undefined" != typeof window && window.removeEventListener("pointerdown", onPointerDown, { capture: true }), Ye = false, Xe.clear();
|
|
2485
|
+
try {
|
|
2486
|
+
const e2 = globalThis;
|
|
2487
|
+
delete e2.__sfCreateSite, delete e2.__sfCreateFrom;
|
|
2488
|
+
} catch {
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
const Ze = readDebugFlag(), et = /* @__PURE__ */ new Map();
|
|
2151
2492
|
function getCachedRegex(e2, t2) {
|
|
2152
2493
|
const n2 = `${e2}|${t2}`;
|
|
2153
|
-
let i2 =
|
|
2154
|
-
return i2 || (i2 = new RegExp(e2, t2),
|
|
2494
|
+
let i2 = et.get(n2);
|
|
2495
|
+
return i2 || (i2 = new RegExp(e2, t2), et.set(n2, i2)), i2;
|
|
2155
2496
|
}
|
|
2156
|
-
const
|
|
2497
|
+
const tt = 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())), nt = ["t.co", "*.twitter.com", "*.gravatar.com", "*.googleapis.com", "*.amazonaws.com", "*.smooch.io", "*.zendesk.com", "*.zdassets.com"], it = [400, 403], ot = "CORS", rt = 1, st = "authorization", at = "Authorization", ct = { recordCanvas: false, recordCrossOriginIframes: false, collectFonts: false, inlineImages: false, recordPassword: false, recordRealName: true, recordCreditCardInfo: false, recordSsn: false, recordDob: false, sampling: {}, enableFiberTracking: false, maskInputSelector: "", maskTextSelector: "", blockSelector: "", unmaskSelector: "", maskInputOptions: { password: true } }, lt = { level: ["info", "log", "warn", "error"], lengthThreshold: 1e4, stringifyOptions: { stringLengthLimit: 1e3, numOfKeysLimit: 20, depthOfLimit: 4 }, logger: "console" };
|
|
2157
2498
|
function maskAuthorizationHeader(e2) {
|
|
2158
|
-
const t2 = e2[
|
|
2499
|
+
const t2 = e2[st] ? st : e2[at] ? at : null;
|
|
2159
2500
|
if (!t2) return;
|
|
2160
2501
|
const n2 = e2[t2], i2 = n2.indexOf(" ");
|
|
2161
2502
|
if (-1 !== i2) {
|
|
2162
|
-
const o2 = n2.slice(0, i2 + 1),
|
|
2163
|
-
|
|
2503
|
+
const o2 = n2.slice(0, i2 + 1), r2 = n2.slice(i2 + 1);
|
|
2504
|
+
r2.length > 8 ? e2[t2] = o2 + r2.slice(0, 4) + "*".repeat(r2.length - 8) + r2.slice(-4) : e2[t2] = o2 + "*".repeat(r2.length);
|
|
2164
2505
|
} else n2.length > 8 ? e2[t2] = n2.slice(0, 4) + "*".repeat(n2.length - 8) + n2.slice(-4) : e2[t2] = "*".repeat(n2.length);
|
|
2165
2506
|
}
|
|
2166
2507
|
function trackDomainChangesOnce() {
|
|
@@ -2171,10 +2512,10 @@ function trackDomainChangesOnce() {
|
|
|
2171
2512
|
const i2 = window.location.href.split("?")[0];
|
|
2172
2513
|
if (n3 || i2 !== t2) {
|
|
2173
2514
|
t2 = i2;
|
|
2174
|
-
const o2 = uuidv4(),
|
|
2175
|
-
sessionStorage.setItem("pageVisitUUID", o2), sessionStorage.setItem("prevPageVisitUUID",
|
|
2176
|
-
const
|
|
2177
|
-
e2.internalDebugLogs && console.log("[sf-recorder] mint pageVisitUUID", { url: i2, newUuid: o2, prevUuid:
|
|
2515
|
+
const o2 = uuidv4(), r2 = sessionStorage.getItem("pageVisitUUID") ?? "";
|
|
2516
|
+
sessionStorage.setItem("pageVisitUUID", o2), sessionStorage.setItem("prevPageVisitUUID", r2), invalidateUrlCache();
|
|
2517
|
+
const s2 = Date.now();
|
|
2518
|
+
e2.internalDebugLogs && console.log("[sf-recorder] mint pageVisitUUID", { url: i2, newUuid: o2, prevUuid: r2, forceSend: n3, timestamp: s2, stack: new Error().stack }), sendMessage({ type: "routeChange", data: { url: i2, timestamp: s2, page_visit_uuid: o2, prev_page_visit_uuid: r2 } });
|
|
2178
2519
|
}
|
|
2179
2520
|
}, n2 = /* @__PURE__ */ (function debounce(e3, t3) {
|
|
2180
2521
|
let n3;
|
|
@@ -2187,14 +2528,14 @@ function trackDomainChangesOnce() {
|
|
|
2187
2528
|
function sendUserDeviceUuid() {
|
|
2188
2529
|
sendMessage({ type: "userDeviceUuid", userDeviceUuid: (function getOrSetUserDeviceUuid() {
|
|
2189
2530
|
let e2 = null;
|
|
2190
|
-
if (
|
|
2531
|
+
if ($) try {
|
|
2191
2532
|
e2 = localStorage.getItem("sailfishUserDeviceUuid");
|
|
2192
2533
|
} catch {
|
|
2193
2534
|
}
|
|
2194
2535
|
if (!e2) {
|
|
2195
2536
|
e2 = uuidv4();
|
|
2196
2537
|
try {
|
|
2197
|
-
|
|
2538
|
+
$ && localStorage.setItem("sailfishUserDeviceUuid", e2);
|
|
2198
2539
|
} catch {
|
|
2199
2540
|
}
|
|
2200
2541
|
}
|
|
@@ -2205,48 +2546,48 @@ function handleVisibilityChange() {
|
|
|
2205
2546
|
const e2 = document.visibilityState, t2 = Date.now();
|
|
2206
2547
|
"visible" === e2 && (getOrSetSessionId(), requestTimeSync());
|
|
2207
2548
|
try {
|
|
2208
|
-
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }),
|
|
2549
|
+
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }), Ze && console.log(`[Sailfish] Tab became ${e2}, sent visibility change event`);
|
|
2209
2550
|
} catch (e3) {
|
|
2210
2551
|
console.warn("[Sailfish] Failed to send visibility change event:", e3);
|
|
2211
2552
|
}
|
|
2212
2553
|
sessionStorage.setItem("tabVisibilityChanged", t2.toString()), sessionStorage.setItem("tabVisibilityState", e2), invalidateUrlCache();
|
|
2213
2554
|
}
|
|
2214
2555
|
function clearPageVisitDataFromSessionStorage() {
|
|
2215
|
-
|
|
2556
|
+
A && (sessionStorage.removeItem("pageVisitUUID"), sessionStorage.removeItem("prevPageVisitUUID"), sessionStorage.removeItem("tabVisibilityChanged"), sessionStorage.removeItem("tabVisibilityState"), invalidateUrlCache());
|
|
2216
2557
|
}
|
|
2217
|
-
let
|
|
2558
|
+
let dt = false;
|
|
2218
2559
|
function _ensureModuleSideEffects() {
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
window.name =
|
|
2560
|
+
dt || (dt = true, restoreFuncSpanState(), (function ensureSessionListeners() {
|
|
2561
|
+
D || (D = true, C && window.addEventListener("beforeunload", () => {
|
|
2562
|
+
window.name = L + window.name;
|
|
2222
2563
|
}));
|
|
2223
|
-
})(),
|
|
2564
|
+
})(), C && (sendUserDeviceUuid(), (function sendTimeZone() {
|
|
2224
2565
|
sendMessage({ type: "timeZone", timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
2225
|
-
})()),
|
|
2566
|
+
})()), M && document.addEventListener("visibilitychange", handleVisibilityChange), C && (window.addEventListener("beforeunload", () => {
|
|
2226
2567
|
clearPageVisitDataFromSessionStorage();
|
|
2227
2568
|
}), window.addEventListener("online", () => {
|
|
2228
2569
|
requestTimeSync();
|
|
2229
2570
|
})));
|
|
2230
2571
|
}
|
|
2231
2572
|
function matchParsedUrlAgainstPatterns(e2, t2) {
|
|
2232
|
-
const { hostname: n2, pathname: i2, port: o2 } = e2,
|
|
2573
|
+
const { hostname: n2, pathname: i2, port: o2 } = e2, r2 = n2.startsWith("www.") ? n2.slice(4).toLowerCase() : n2.toLowerCase();
|
|
2233
2574
|
return t2.some((e3) => {
|
|
2234
2575
|
const t3 = String(e3 || "").replace(/^[a-zA-Z]+:\/\//, "");
|
|
2235
|
-
let [n3,
|
|
2576
|
+
let [n3, s2] = t3.split("/", 2), a2 = "";
|
|
2236
2577
|
n3.includes(":") && ([n3, a2] = n3.split(":"));
|
|
2237
|
-
const
|
|
2578
|
+
const c2 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), l2 = r2.startsWith("www.") ? r2.slice(4) : r2;
|
|
2238
2579
|
if (a2 && "*" !== a2 && o2 !== a2) return false;
|
|
2239
2580
|
if (n3.startsWith("*.")) {
|
|
2240
2581
|
const e4 = n3.slice(2).toLowerCase();
|
|
2241
|
-
if (!(
|
|
2242
|
-
if (
|
|
2243
|
-
return getCachedRegex(`^/${
|
|
2582
|
+
if (!(r2 === e4 || l2 === e4 || r2.endsWith("." + e4))) return false;
|
|
2583
|
+
if (s2) {
|
|
2584
|
+
return getCachedRegex(`^/${s2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
|
|
2244
2585
|
}
|
|
2245
2586
|
return true;
|
|
2246
2587
|
}
|
|
2247
|
-
if (!
|
|
2248
|
-
if (
|
|
2249
|
-
return getCachedRegex(`^/${
|
|
2588
|
+
if (!c2.test(l2) && !c2.test(r2)) return false;
|
|
2589
|
+
if (s2) {
|
|
2590
|
+
return getCachedRegex(`^/${s2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
|
|
2250
2591
|
}
|
|
2251
2592
|
return true;
|
|
2252
2593
|
});
|
|
@@ -2272,7 +2613,7 @@ function matchUrlWithWildcard(e2, t2) {
|
|
|
2272
2613
|
return matchParsedUrlAgainstPatterns(i2, t2);
|
|
2273
2614
|
}
|
|
2274
2615
|
function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
2275
|
-
const n2 = [...
|
|
2616
|
+
const n2 = [...nt, ...e2], i2 = t2.length > 0;
|
|
2276
2617
|
return function shouldSkipHeadersPropagation(e3) {
|
|
2277
2618
|
let o2;
|
|
2278
2619
|
try {
|
|
@@ -2280,33 +2621,33 @@ function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
|
2280
2621
|
} catch {
|
|
2281
2622
|
return true;
|
|
2282
2623
|
}
|
|
2283
|
-
const
|
|
2284
|
-
return !(-1 ===
|
|
2624
|
+
const r2 = o2.pathname.toLowerCase(), s2 = r2.lastIndexOf(".");
|
|
2625
|
+
return !(-1 === s2 || !tt.has(r2.slice(s2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
|
|
2285
2626
|
};
|
|
2286
2627
|
}
|
|
2287
|
-
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 },
|
|
2288
|
-
const
|
|
2289
|
-
window.fetch = new Proxy(
|
|
2290
|
-
let c2,
|
|
2291
|
-
if ("string" == typeof
|
|
2292
|
-
else if (
|
|
2628
|
+
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, n2 = []) {
|
|
2629
|
+
const i2 = window.fetch, o2 = getOrSetSessionId(), r2 = createSkipHeadersPropagationChecker(e2, n2), s2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], a2 = ["application/octet-stream"];
|
|
2630
|
+
window.fetch = new Proxy(i2, { apply: async (e3, n3, i3) => {
|
|
2631
|
+
let c2, l2 = i3[0], d2 = i3[1] || {};
|
|
2632
|
+
if ("string" == typeof l2) c2 = l2;
|
|
2633
|
+
else if (l2 instanceof Request) c2 = l2.url;
|
|
2293
2634
|
else {
|
|
2294
|
-
if (!(
|
|
2295
|
-
c2 =
|
|
2635
|
+
if (!(l2 instanceof URL)) return e3.apply(n3, i3);
|
|
2636
|
+
c2 = l2.href;
|
|
2296
2637
|
}
|
|
2297
|
-
return r2(c2) ? e3.apply(
|
|
2638
|
+
return r2(c2) ? e3.apply(n3, i3) : (async function injectHeaderWrapper(e4, n4, i4, o3, r3, c3, l3) {
|
|
2298
2639
|
var _a, _b;
|
|
2299
|
-
if (!c3) return e4.apply(
|
|
2300
|
-
let
|
|
2301
|
-
const
|
|
2640
|
+
if (!c3) return e4.apply(n4, i4);
|
|
2641
|
+
let d3 = uuidv4();
|
|
2642
|
+
const u2 = getUrlAndStoredUuids(), p2 = r3.method || "GET", g2 = Date.now();
|
|
2302
2643
|
let m2, h2 = {}, y2 = null;
|
|
2303
2644
|
try {
|
|
2304
|
-
if (
|
|
2305
|
-
|
|
2645
|
+
if (o3 instanceof Request) {
|
|
2646
|
+
o3.headers.forEach((e5, t3) => {
|
|
2306
2647
|
h2[t3] = e5;
|
|
2307
2648
|
});
|
|
2308
2649
|
try {
|
|
2309
|
-
y2 =
|
|
2650
|
+
y2 = o3.clone();
|
|
2310
2651
|
} catch (e5) {
|
|
2311
2652
|
y2 = null;
|
|
2312
2653
|
}
|
|
@@ -2316,96 +2657,96 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2316
2657
|
h2[e5] = t3;
|
|
2317
2658
|
}) : h2 = { ...r3.headers }), m2 = r3.body;
|
|
2318
2659
|
} catch (e5) {
|
|
2319
|
-
|
|
2660
|
+
Ze && console.warn("[Sailfish] Failed to capture request data:", e5);
|
|
2320
2661
|
}
|
|
2321
|
-
delete h2[
|
|
2322
|
-
const
|
|
2323
|
-
|
|
2324
|
-
const
|
|
2325
|
-
h2[
|
|
2662
|
+
delete h2[f];
|
|
2663
|
+
const b2 = getFuncSpanHeader();
|
|
2664
|
+
b2 && delete h2[b2.name];
|
|
2665
|
+
const v2 = `${c3}/${u2.page_visit_uuid}/${d3}`;
|
|
2666
|
+
h2[f] = v2, b2 && (h2[b2.name] = b2.value);
|
|
2326
2667
|
maskAuthorizationHeader(h2);
|
|
2327
2668
|
try {
|
|
2328
|
-
let
|
|
2329
|
-
const
|
|
2330
|
-
if (
|
|
2331
|
-
const c4 =
|
|
2332
|
-
|
|
2333
|
-
const
|
|
2334
|
-
return await e5.call(t3,
|
|
2669
|
+
let b3 = await (async function injectHeader(e5, t3, n5, i5, o4, r4, s3) {
|
|
2670
|
+
const a3 = getFuncSpanHeader();
|
|
2671
|
+
if (n5 instanceof Request) {
|
|
2672
|
+
const c4 = n5.clone(), l4 = new Headers(c4.headers);
|
|
2673
|
+
l4.set(f, `${o4}/${r4}/${s3}`), a3 && (l4.set(a3.name, a3.value), Ze && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: n5.url, header: a3.name }));
|
|
2674
|
+
const d4 = new Request(c4, { headers: l4 });
|
|
2675
|
+
return await e5.call(t3, d4, i5);
|
|
2335
2676
|
}
|
|
2336
2677
|
{
|
|
2337
|
-
const c4 = { ...
|
|
2338
|
-
return
|
|
2678
|
+
const c4 = { ...i5 }, l4 = new Headers(i5.headers || {});
|
|
2679
|
+
return l4.set(f, `${o4}/${r4}/${s3}`), a3 && (l4.set(a3.name, a3.value), Ze && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof n5 ? n5 : n5.href, header: a3.name })), c4.headers = l4, await e5.call(t3, n5, c4);
|
|
2339
2680
|
}
|
|
2340
|
-
})(e4,
|
|
2341
|
-
|
|
2681
|
+
})(e4, n4, o3, r3, c3, u2.page_visit_uuid, d3), v3 = false;
|
|
2682
|
+
it.includes(b3.status) && (Ze && console.log("Perform retry as status was fail:", b3), delete h2[f], b3 = await (async function retryWithoutPropagateHeaders(e5, t3, n5, i5) {
|
|
2342
2683
|
try {
|
|
2343
|
-
let
|
|
2344
|
-
if ("string" == typeof
|
|
2345
|
-
const
|
|
2346
|
-
r4.delete(
|
|
2347
|
-
return await e5.call(t3,
|
|
2684
|
+
let i6 = n5[0], o4 = n5[1] || {};
|
|
2685
|
+
if ("string" == typeof i6 || i6 instanceof URL) {
|
|
2686
|
+
const n6 = { ...o4 }, r4 = new Headers(o4.headers || {});
|
|
2687
|
+
r4.delete(f), n6.headers = r4;
|
|
2688
|
+
return await e5.call(t3, i6, n6);
|
|
2348
2689
|
}
|
|
2349
|
-
if (
|
|
2350
|
-
const
|
|
2351
|
-
r4.delete(
|
|
2352
|
-
const
|
|
2353
|
-
return await e5.call(t3,
|
|
2690
|
+
if (i6 instanceof Request) {
|
|
2691
|
+
const n6 = i6.clone(), r4 = new Headers(n6.headers);
|
|
2692
|
+
r4.delete(f);
|
|
2693
|
+
const s3 = new Request(n6, { headers: r4 });
|
|
2694
|
+
return await e5.call(t3, s3, o4);
|
|
2354
2695
|
}
|
|
2355
|
-
return e5.apply(t3,
|
|
2696
|
+
return e5.apply(t3, n5);
|
|
2356
2697
|
} catch (e6) {
|
|
2357
|
-
throw
|
|
2698
|
+
throw Ze && console.log(`Retry without ${f} for ${i5} also failed:`, e6), e6;
|
|
2358
2699
|
}
|
|
2359
|
-
})(e4,
|
|
2360
|
-
const
|
|
2700
|
+
})(e4, n4, i4, l3), v3 = true);
|
|
2701
|
+
const S2 = Date.now(), w2 = (function captureClientTime() {
|
|
2361
2702
|
return { wallTimeMs: Date.now(), monotonicMs: monotonicNow(), timeOriginMs: timeOriginMs() };
|
|
2362
|
-
})(), k2 =
|
|
2703
|
+
})(), k2 = b3.status, x2 = b3.ok, I2 = x2 ? "" : `Request Error: ${b3.statusText}`;
|
|
2363
2704
|
let T2 = null;
|
|
2364
2705
|
try {
|
|
2365
|
-
T2 = {},
|
|
2706
|
+
T2 = {}, b3.headers.forEach((e5, t3) => {
|
|
2366
2707
|
T2[t3] = e5;
|
|
2367
2708
|
});
|
|
2368
2709
|
} catch (e5) {
|
|
2369
|
-
|
|
2710
|
+
Ze && console.warn("[Sailfish] Failed to capture response headers:", e5), T2 = null;
|
|
2370
2711
|
}
|
|
2371
|
-
const E2 = { type: 27, timestamp:
|
|
2712
|
+
const E2 = { type: 27, timestamp: S2, sessionId: c3, client: w2, data: { request_id: d3, session_id: c3, timestamp_start: g2, timestamp_end: S2, response_code: k2, success: x2, error: I2, method: p2, url: toAbsoluteUrl(l3), retry_without_trace_id: v3, request_headers: h2, request_body: m2, response_headers: T2, response_body: null }, ...u2 }, sendEventWithBody = (e5) => {
|
|
2372
2713
|
E2.data.response_body = e5, y2 ? y2.text().then((e6) => {
|
|
2373
2714
|
E2.data.request_body = e6, sendEvent(E2);
|
|
2374
2715
|
}, () => {
|
|
2375
2716
|
sendEvent(E2);
|
|
2376
2717
|
}) : sendEvent(E2);
|
|
2377
|
-
},
|
|
2718
|
+
}, C2 = 1024 * t2.captureResponseBodyMaxMb * 1024;
|
|
2378
2719
|
if (0 === t2.captureResponseBodyMaxMb) sendEventWithBody(null);
|
|
2379
2720
|
else if ((function shouldSkipBodyCapture(e5) {
|
|
2380
2721
|
const t3 = e5.headers.get("content-type");
|
|
2381
2722
|
if (!t3) return false;
|
|
2382
|
-
const
|
|
2383
|
-
return
|
|
2384
|
-
})(
|
|
2723
|
+
const n5 = t3.toLowerCase();
|
|
2724
|
+
return a2.some((e6) => n5.includes(e6));
|
|
2725
|
+
})(b3)) sendEventWithBody(null);
|
|
2385
2726
|
else if ((function isStreamingResponse(e5) {
|
|
2386
2727
|
const t3 = e5.headers.get("content-type");
|
|
2387
2728
|
if (!t3) return false;
|
|
2388
|
-
const
|
|
2389
|
-
return
|
|
2390
|
-
})(
|
|
2391
|
-
(async function readStreamPrefix(e5, t3,
|
|
2729
|
+
const n5 = t3.toLowerCase();
|
|
2730
|
+
return s2.some((e6) => n5.includes(e6));
|
|
2731
|
+
})(b3)) if (t2.captureStreamingResponseBody) try {
|
|
2732
|
+
(async function readStreamPrefix(e5, t3, n5) {
|
|
2392
2733
|
const i5 = e5.body;
|
|
2393
2734
|
if (!i5) return null;
|
|
2394
|
-
const
|
|
2735
|
+
const o4 = i5.getReader(), r4 = new TextDecoder(), s3 = [];
|
|
2395
2736
|
let a3 = 0;
|
|
2396
2737
|
const readWithLimit = async () => {
|
|
2397
2738
|
try {
|
|
2398
2739
|
for (; a3 < t3; ) {
|
|
2399
|
-
const { done: e6, value: t4 } = await
|
|
2740
|
+
const { done: e6, value: t4 } = await o4.read();
|
|
2400
2741
|
if (e6) break;
|
|
2401
|
-
a3 += t4.byteLength,
|
|
2742
|
+
a3 += t4.byteLength, s3.push(r4.decode(t4, { stream: true }));
|
|
2402
2743
|
}
|
|
2403
|
-
return
|
|
2744
|
+
return s3.push(r4.decode()), s3.join("");
|
|
2404
2745
|
} catch {
|
|
2405
|
-
return
|
|
2746
|
+
return s3.length > 0 ? s3.join("") : null;
|
|
2406
2747
|
} finally {
|
|
2407
2748
|
try {
|
|
2408
|
-
|
|
2749
|
+
o4.cancel();
|
|
2409
2750
|
} catch {
|
|
2410
2751
|
}
|
|
2411
2752
|
}
|
|
@@ -2413,52 +2754,52 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2413
2754
|
try {
|
|
2414
2755
|
return await Promise.race([readWithLimit(), new Promise((e6) => setTimeout(() => {
|
|
2415
2756
|
try {
|
|
2416
|
-
|
|
2757
|
+
o4.cancel();
|
|
2417
2758
|
} catch {
|
|
2418
2759
|
}
|
|
2419
|
-
e6(
|
|
2420
|
-
},
|
|
2760
|
+
e6(s3.length > 0 ? s3.join("") : null);
|
|
2761
|
+
}, n5))]);
|
|
2421
2762
|
} catch {
|
|
2422
2763
|
try {
|
|
2423
|
-
|
|
2764
|
+
o4.cancel();
|
|
2424
2765
|
} catch {
|
|
2425
2766
|
}
|
|
2426
2767
|
return null;
|
|
2427
2768
|
}
|
|
2428
|
-
})(
|
|
2769
|
+
})(b3.clone(), 1024 * t2.captureStreamPrefixKb, t2.captureStreamTimeoutMs).then((e5) => sendEventWithBody(e5), () => sendEventWithBody(null));
|
|
2429
2770
|
} catch {
|
|
2430
2771
|
sendEventWithBody(null);
|
|
2431
2772
|
}
|
|
2432
2773
|
else sendEventWithBody(null);
|
|
2433
2774
|
else {
|
|
2434
|
-
const e5 =
|
|
2435
|
-
if (!isNaN(t3) && t3 >
|
|
2775
|
+
const e5 = b3.headers.get("content-length"), t3 = e5 ? parseInt(e5, 10) : NaN;
|
|
2776
|
+
if (!isNaN(t3) && t3 > C2) sendEventWithBody(null);
|
|
2436
2777
|
else try {
|
|
2437
|
-
|
|
2438
|
-
e6.length >
|
|
2778
|
+
b3.clone().text().then((e6) => {
|
|
2779
|
+
e6.length > C2 ? sendEventWithBody(null) : sendEventWithBody(e6);
|
|
2439
2780
|
}, () => sendEventWithBody(null));
|
|
2440
2781
|
} catch {
|
|
2441
2782
|
sendEventWithBody(null);
|
|
2442
2783
|
}
|
|
2443
2784
|
}
|
|
2444
|
-
return
|
|
2785
|
+
return b3;
|
|
2445
2786
|
} catch (t3) {
|
|
2446
|
-
const
|
|
2447
|
-
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(
|
|
2448
|
-
let
|
|
2787
|
+
const o4 = Date.now(), r4 = false, s3 = ((_a = t3.response) == null ? void 0 : _a.status) || 500, a3 = t3.message || "Fetch request failed";
|
|
2788
|
+
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(ot.toLowerCase()))) return e4.apply(n4, i4);
|
|
2789
|
+
let f2 = m2;
|
|
2449
2790
|
if (y2) try {
|
|
2450
|
-
|
|
2791
|
+
f2 = await y2.text();
|
|
2451
2792
|
} catch {
|
|
2452
|
-
|
|
2793
|
+
f2 = null;
|
|
2453
2794
|
}
|
|
2454
|
-
throw sendEvent({ type: 27, timestamp:
|
|
2795
|
+
throw sendEvent({ type: 27, timestamp: o4, sessionId: c3, data: { request_id: d3, session_id: c3, timestamp_start: g2, timestamp_end: o4, response_code: s3, success: r4, error: a3, method: p2, url: toAbsoluteUrl(l3), request_headers: h2, request_body: f2, response_body: null }, ...u2 }), t3;
|
|
2455
2796
|
}
|
|
2456
|
-
})(e3, i3,
|
|
2797
|
+
})(e3, n3, i3, l2, d2, o2, c2);
|
|
2457
2798
|
} });
|
|
2458
2799
|
}
|
|
2459
|
-
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo:
|
|
2460
|
-
var _a, _b;
|
|
2461
|
-
if (!
|
|
2800
|
+
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: n2 = ["*"], domainsToNotPropagateHeaderTo: i2 = [], serviceVersion: o2, serviceIdentifier: r2, gitSha: s2, serviceAdditionalMetadata: a2, enableIpTracking: c2, captureStreamingResponseBody: l2 = true, captureResponseBodyMaxMb: d2 = 10, captureStreamPrefixKb: u2 = 64, captureStreamTimeoutMs: g2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: b2, useWsWorker: v2 = true, capturePerformanceMetrics: S2 = true, maskTextClass: w2, maskInputSelector: k2, maskTextSelector: x2, blockSelector: I2, unmaskSelector: T2, maskInputOptions: E2, recordCanvas: C2, maskCanvasClass: M2, gitOrg: $2, gitRepo: F2, gitProvider: L2, library: R2, headlessRecording: D2 = false }) {
|
|
2801
|
+
var _a, _b, _c, _d;
|
|
2802
|
+
if (!D2 && (function isHeadlessOrLighthouse() {
|
|
2462
2803
|
try {
|
|
2463
2804
|
if ("undefined" == typeof navigator) return false;
|
|
2464
2805
|
const e3 = navigator;
|
|
@@ -2469,53 +2810,53 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2469
2810
|
return false;
|
|
2470
2811
|
}
|
|
2471
2812
|
})()) return;
|
|
2472
|
-
const
|
|
2473
|
-
if (
|
|
2474
|
-
const
|
|
2475
|
-
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()),
|
|
2476
|
-
const
|
|
2813
|
+
const B2 = h2 ?? y2 ?? true, P2 = getOrSetSessionId(), _2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
2814
|
+
if (_2.sessionId = P2, _2.apiKey = e2, _2.backendApi = t2, _2.serviceAdditionalMetadata = a2, _2.initialized && _2.sessionId === P2 && _2.ws && 1 === _2.ws.readyState) return void trackDomainChangesOnce();
|
|
2815
|
+
const O2 = { captureStreamingResponseBody: l2, captureResponseBodyMaxMb: d2, captureStreamPrefixKb: u2, captureStreamTimeoutMs: g2 };
|
|
2816
|
+
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), _2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, n3 = []) {
|
|
2817
|
+
const i3 = XMLHttpRequest.prototype.open, o3 = XMLHttpRequest.prototype.send, r3 = XMLHttpRequest.prototype.setRequestHeader, s3 = getOrSetSessionId(), a3 = createSkipHeadersPropagationChecker(e3, n3);
|
|
2477
2818
|
XMLHttpRequest.prototype.setRequestHeader = function(e4, t4) {
|
|
2478
2819
|
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, r3.call(this, e4, t4);
|
|
2479
|
-
}, XMLHttpRequest.prototype.open = function(e4, t4, ...
|
|
2480
|
-
return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {},
|
|
2820
|
+
}, XMLHttpRequest.prototype.open = function(e4, t4, ...n4) {
|
|
2821
|
+
return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {}, i3.apply(this, [e4, t4, ...n4]);
|
|
2481
2822
|
}, XMLHttpRequest.prototype.send = function(...e4) {
|
|
2482
|
-
const
|
|
2483
|
-
if (!
|
|
2484
|
-
if (
|
|
2485
|
-
const
|
|
2823
|
+
const n4 = this._requestUrl;
|
|
2824
|
+
if (!n4) return o3.apply(this, e4);
|
|
2825
|
+
if (a3(n4)) return o3.apply(this, e4);
|
|
2826
|
+
const i4 = sessionStorage.getItem("pageVisitUUID"), r4 = uuidv4(), c3 = `${s3}/${i4}/${r4}`;
|
|
2486
2827
|
try {
|
|
2487
|
-
this.setRequestHeader(
|
|
2828
|
+
this.setRequestHeader(f, c3);
|
|
2488
2829
|
} catch (e5) {
|
|
2489
|
-
console.warn(`Could not set X-Sf3-Rid for ${
|
|
2830
|
+
console.warn(`Could not set X-Sf3-Rid for ${n4}`, e5);
|
|
2490
2831
|
}
|
|
2491
|
-
const
|
|
2492
|
-
if (
|
|
2493
|
-
this.setRequestHeader(
|
|
2832
|
+
const l3 = getFuncSpanHeader();
|
|
2833
|
+
if (l3) try {
|
|
2834
|
+
this.setRequestHeader(l3.name, l3.value), Ze && console.log("[Sailfish] Added funcspan header to XMLHttpRequest:", { url: n4, header: l3.name });
|
|
2494
2835
|
} catch (e5) {
|
|
2495
|
-
|
|
2836
|
+
Ze && console.warn(`[Sailfish] Could not set funcspan header for ${n4}`, e5);
|
|
2496
2837
|
}
|
|
2497
|
-
const
|
|
2498
|
-
let
|
|
2499
|
-
const
|
|
2838
|
+
const d3 = Date.now();
|
|
2839
|
+
let u3 = false;
|
|
2840
|
+
const p2 = e4[0], g3 = { ...this._capturedRequestHeaders };
|
|
2500
2841
|
maskAuthorizationHeader(g3);
|
|
2501
|
-
const emitFinished = (e5, t4,
|
|
2502
|
-
if (
|
|
2503
|
-
|
|
2504
|
-
const
|
|
2505
|
-
sendEvent({ type: 27, timestamp:
|
|
2842
|
+
const emitFinished = (e5, t4, i5, o4, a4) => {
|
|
2843
|
+
if (u3) return;
|
|
2844
|
+
u3 = true;
|
|
2845
|
+
const c4 = Date.now();
|
|
2846
|
+
sendEvent({ type: 27, timestamp: c4, sessionId: s3, data: { request_id: r4, session_id: s3, timestamp_start: d3, timestamp_end: c4, response_code: t4, success: e5, error: i5, method: this._requestMethod, url: toAbsoluteUrl(n4), request_headers: g3, request_body: p2, response_headers: a4, response_body: o4 }, ...getUrlAndStoredUuids() });
|
|
2506
2847
|
};
|
|
2507
2848
|
return this.addEventListener("load", () => {
|
|
2508
2849
|
const e5 = this.status || 0;
|
|
2509
|
-
let
|
|
2510
|
-
const
|
|
2850
|
+
let n5, i5 = null;
|
|
2851
|
+
const o4 = 1024 * t3.captureResponseBodyMaxMb * 1024;
|
|
2511
2852
|
try {
|
|
2512
|
-
if (0 === t3.captureResponseBodyMaxMb)
|
|
2853
|
+
if (0 === t3.captureResponseBodyMaxMb) n5 = null;
|
|
2513
2854
|
else {
|
|
2514
2855
|
const e6 = this.responseText || this.response;
|
|
2515
|
-
|
|
2856
|
+
n5 = "string" == typeof e6 && e6.length > o4 ? null : e6;
|
|
2516
2857
|
}
|
|
2517
2858
|
} catch (e6) {
|
|
2518
|
-
|
|
2859
|
+
n5 = null;
|
|
2519
2860
|
}
|
|
2520
2861
|
try {
|
|
2521
2862
|
i5 = {};
|
|
@@ -2525,36 +2866,45 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2525
2866
|
2 === t4.length && (i5[t4[0]] = t4[1]);
|
|
2526
2867
|
});
|
|
2527
2868
|
} catch (e6) {
|
|
2528
|
-
|
|
2869
|
+
Ze && console.warn("[Sailfish] Failed to capture XHR response headers:", e6), i5 = null;
|
|
2529
2870
|
}
|
|
2530
|
-
if (e5 >= 200 && e5 < 300) emitFinished(true, e5, "",
|
|
2871
|
+
if (e5 >= 200 && e5 < 300) emitFinished(true, e5, "", n5, i5);
|
|
2531
2872
|
else {
|
|
2532
2873
|
const t4 = this.statusText || `HTTP ${e5}`;
|
|
2533
|
-
emitFinished(false, e5, t4,
|
|
2874
|
+
emitFinished(false, e5, t4, n5, i5);
|
|
2534
2875
|
}
|
|
2535
2876
|
}, { once: true }), this.addEventListener("error", () => {
|
|
2536
2877
|
const e5 = this.status || 0, t4 = 0 === e5 ? "Network or CORS failure" : this.statusText || `Error ${e5}`;
|
|
2537
2878
|
emitFinished(false, e5, t4);
|
|
2538
|
-
}, { once: true }),
|
|
2879
|
+
}, { once: true }), o3.apply(this, e4);
|
|
2539
2880
|
};
|
|
2540
|
-
})(
|
|
2881
|
+
})(i2, O2, n2), _2.xhrPatched = true), _2.fetchPatched || (setupFetchInterceptor(i2, O2, n2), _2.fetchPatched = true);
|
|
2882
|
+
const j2 = C2 ?? ct.recordCanvas;
|
|
2883
|
+
if (!_2.canvasObjLogInit && j2) {
|
|
2884
|
+
try {
|
|
2885
|
+
p();
|
|
2886
|
+
} catch {
|
|
2887
|
+
}
|
|
2888
|
+
_2.canvasObjLogInit = true;
|
|
2889
|
+
}
|
|
2890
|
+
await yieldToMain(), _2.domEventsInit || (initializeDomContentEvents(P2), _2.domEventsInit = true), await yieldToMain(), _2.consoleInit || (initializeConsolePlugin(lt, P2), _2.consoleInit = true), await yieldToMain(), _2.errorInit || (!(function initializeErrorInterceptor() {
|
|
2541
2891
|
window.addEventListener("error", (e3) => {
|
|
2542
2892
|
captureError(e3.error ?? e3.message, false, { filename: e3.filename, lineno: e3.lineno, colno: e3.colno });
|
|
2543
2893
|
}), window.addEventListener("unhandledrejection", (e3) => {
|
|
2544
2894
|
captureError(e3.reason, true);
|
|
2545
2895
|
});
|
|
2546
|
-
})(),
|
|
2547
|
-
|
|
2548
|
-
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() ||
|
|
2896
|
+
})(), _2.errorInit = true), await yieldToMain(), !_2.perfInit && S2 && (initializePerformancePlugin(P2), _2.perfInit = true), await yieldToMain(), _ensureModuleSideEffects(), (function storeCredentialsAndConnection({ apiKey: e3, backendApi: t3 }) {
|
|
2897
|
+
A && (sessionStorage.setItem("sailfishApiKey", e3), sessionStorage.setItem("sailfishBackendApi", t3));
|
|
2898
|
+
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() || _2.ws && 1 === _2.ws.readyState || fetchFunctionSpanTrackingEnabled(e2, t2).then((e3) => {
|
|
2549
2899
|
var _a2;
|
|
2550
|
-
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ?
|
|
2900
|
+
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? Ze && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), Ze && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
|
|
2551
2901
|
}).catch((e3) => {
|
|
2552
|
-
|
|
2553
|
-
}),
|
|
2902
|
+
Ze && console.warn("[Sailfish] Failed to validate function span tracking status with backend:", e3);
|
|
2903
|
+
}), _2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e2, [...i2, ...nt], t2).catch((e3) => console.error("Failed to send domains to not propagate header to:", e3)), _2.sentDoNotPropagateOnce = true), (async function gatherAndCacheDeviceInfo() {
|
|
2554
2904
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: { language: navigator.language, userAgent: navigator.userAgent } } });
|
|
2555
|
-
})(), c2 && fetchAndSendIp(
|
|
2905
|
+
})(), c2 && fetchAndSendIp(P2);
|
|
2556
2906
|
try {
|
|
2557
|
-
const
|
|
2907
|
+
const n3 = s2 ?? (function readGitSha() {
|
|
2558
2908
|
var _a2;
|
|
2559
2909
|
try {
|
|
2560
2910
|
const e3 = globalThis;
|
|
@@ -2571,36 +2921,36 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2571
2921
|
if ("string" == typeof e3 && e3) return e3;
|
|
2572
2922
|
} catch {
|
|
2573
2923
|
}
|
|
2574
|
-
})(), i3 = r2 ?? "",
|
|
2924
|
+
})(), i3 = r2 ?? "", c3 = o2 ?? "", l3 = R2 ?? "JS/TS", d3 = (function getMapUuidFromWindow() {
|
|
2575
2925
|
try {
|
|
2576
2926
|
const e3 = window;
|
|
2577
2927
|
if (e3 && "string" == typeof e3.sfMapUuid && e3.sfMapUuid) return e3.sfMapUuid;
|
|
2578
2928
|
} catch {
|
|
2579
2929
|
}
|
|
2580
|
-
})(), u3 = withAppUrlMetadata(
|
|
2930
|
+
})(), u3 = withAppUrlMetadata(a2), p2 = (function detectFramework(e3) {
|
|
2581
2931
|
let t3 = false;
|
|
2582
2932
|
try {
|
|
2583
2933
|
t3 = "undefined" != typeof document && "loading" !== document.readyState;
|
|
2584
2934
|
} catch {
|
|
2585
2935
|
}
|
|
2586
|
-
const
|
|
2587
|
-
for (const e4 of
|
|
2588
|
-
const t4 = e4(
|
|
2936
|
+
const n4 = t3, i4 = [];
|
|
2937
|
+
for (const e4 of Fe) {
|
|
2938
|
+
const t4 = e4(n4);
|
|
2589
2939
|
t4 && !i4.includes(t4) && i4.push(t4);
|
|
2590
2940
|
}
|
|
2591
2941
|
return { framework: i4[0] ?? null, additionalFrameworks: i4.slice(1), serviceRole: "frontend" };
|
|
2592
|
-
})(),
|
|
2942
|
+
})(), f2 = { ...u3, serviceRole: p2.serviceRole, ...null !== p2.framework && { framework: p2.framework }, ...p2.additionalFrameworks.length > 0 && { additionalFrameworks: p2.additionalFrameworks } };
|
|
2593
2943
|
await yieldToMain();
|
|
2594
|
-
const [
|
|
2595
|
-
if (
|
|
2596
|
-
if ((
|
|
2597
|
-
const
|
|
2944
|
+
const [g3, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, P2, t2, i3, c3, d3, n3, l3, f2, $2, F2, L2)]), y3 = { ...ct, ...(_a = g3.data) == null ? void 0 : _a.captureSettingsFromApiKey, enableFiberTracking: m2, ...void 0 !== w2 ? { maskTextClass: w2 } : {}, ...void 0 !== k2 ? { maskInputSelector: k2 } : {}, ...void 0 !== x2 ? { maskTextSelector: x2 } : {}, ...void 0 !== I2 ? { blockSelector: I2 } : {}, ...void 0 !== T2 ? { unmaskSelector: T2 } : {}, ...void 0 !== E2 ? { maskInputOptions: E2 } : {}, recordCanvas: C2 ?? ((_c = (_b = g3.data) == null ? void 0 : _b.captureSettingsFromApiKey) == null ? void 0 : _c.recordCanvasSf) ?? ct.recordCanvas, ...void 0 !== M2 ? { maskCanvasClass: M2 } : {} };
|
|
2945
|
+
if (_2.ws && 1 === _2.ws.readyState) return;
|
|
2946
|
+
if ((_d = h3.data) == null ? void 0 : _d.startRecordingSession) {
|
|
2947
|
+
const n4 = (a2 == null ? void 0 : a2.env) || (a2 == null ? void 0 : a2.environment);
|
|
2598
2948
|
await yieldToMain();
|
|
2599
|
-
const i4 = await initializeRecording(y3, t2, e2,
|
|
2600
|
-
|
|
2949
|
+
const i4 = await initializeRecording(y3, t2, e2, P2, n4, B2, v2, b2 ?? false);
|
|
2950
|
+
_2.ws = i4, _2.initialized = true, trackDomainChangesOnce(), _2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
|
|
2601
2951
|
window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
|
|
2602
|
-
})(r2,
|
|
2603
|
-
} else console.error("Failed to start recording session:",
|
|
2952
|
+
})(r2, o2), _2.sentMapUuidOnce = true);
|
|
2953
|
+
} else console.error("Failed to start recording session:", h3.errors || h3);
|
|
2604
2954
|
} catch (e3) {
|
|
2605
2955
|
console.error("Error starting recording:", e3);
|
|
2606
2956
|
}
|
|
@@ -2613,14 +2963,14 @@ const initRecorder = async (e2) => {
|
|
|
2613
2963
|
return clearPageVisitDataFromSessionStorage(), t2.initialized && t2.sessionId === n2 && t2.ws && 1 === t2.ws.readyState ? void 0 : (t2.initPromise || (t2.initPromise = (async () => {
|
|
2614
2964
|
try {
|
|
2615
2965
|
if (t2.hasLoggedInitOnce || (console.log("Initializing Sailfish Recorder (first run) …"), t2.hasLoggedInitOnce = true), await startRecording(e2), !t2.issueReportingInit) {
|
|
2616
|
-
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData:
|
|
2617
|
-
let
|
|
2966
|
+
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: r2 }] = await Promise.all([Promise.resolve().then(() => Ge), Promise.resolve().then(() => ze)]);
|
|
2967
|
+
let s2 = null;
|
|
2618
2968
|
try {
|
|
2619
|
-
await o2(e2.apiKey, n3),
|
|
2969
|
+
await o2(e2.apiKey, n3), s2 = r2();
|
|
2620
2970
|
} catch (e3) {
|
|
2621
2971
|
console.warn("[Sailfish] Failed to fetch integration data for issue reporting:", e3);
|
|
2622
2972
|
}
|
|
2623
|
-
i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData:
|
|
2973
|
+
i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData: s2, showEngTicketFieldsInReportIssueModalDefault: e2.showEngTicketFieldsInReportIssueModalDefault }), t2.issueReportingInit = true;
|
|
2624
2974
|
}
|
|
2625
2975
|
} catch (e3) {
|
|
2626
2976
|
console.warn("[Sailfish] Recorder initialization failed:", e3);
|
|
@@ -2629,33 +2979,74 @@ const initRecorder = async (e2) => {
|
|
|
2629
2979
|
delete t2.initPromise;
|
|
2630
2980
|
})), t2.initPromise);
|
|
2631
2981
|
};
|
|
2982
|
+
function maskCanvasDraws(e2, t2, n2) {
|
|
2983
|
+
let i2 = null;
|
|
2984
|
+
try {
|
|
2985
|
+
i2 = "undefined" != typeof HTMLCanvasElement && e2 instanceof HTMLCanvasElement ? e2.getContext("2d") : e2;
|
|
2986
|
+
} catch {
|
|
2987
|
+
i2 = null;
|
|
2988
|
+
}
|
|
2989
|
+
const o2 = i2 ? l(i2) : void 0;
|
|
2990
|
+
if (!o2) {
|
|
2991
|
+
let n3 = null;
|
|
2992
|
+
try {
|
|
2993
|
+
if ("undefined" != typeof HTMLCanvasElement && e2 instanceof HTMLCanvasElement) n3 = e2;
|
|
2994
|
+
else {
|
|
2995
|
+
const e3 = i2 == null ? void 0 : i2.canvas;
|
|
2996
|
+
"undefined" != typeof HTMLCanvasElement && e3 instanceof HTMLCanvasElement && (n3 = e3);
|
|
2997
|
+
}
|
|
2998
|
+
} catch {
|
|
2999
|
+
n3 = null;
|
|
3000
|
+
}
|
|
3001
|
+
return d(n3), t2();
|
|
3002
|
+
}
|
|
3003
|
+
const r2 = o2.redactStyle, s2 = o2.textOnlyMask;
|
|
3004
|
+
n2 && (o2.redactStyle = u(r2, { text: n2.text, shape: n2.shape }), void 0 !== n2.keepShapes && (o2.textOnlyMask = n2.keepShapes)), o2.maskDepth++;
|
|
3005
|
+
try {
|
|
3006
|
+
return t2();
|
|
3007
|
+
} finally {
|
|
3008
|
+
o2.maskDepth--, o2.redactStyle = r2, o2.textOnlyMask = s2;
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
2632
3011
|
export {
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
3012
|
+
sendDomainsToNotPropagateHeaderTo as $,
|
|
3013
|
+
getUrlAndStoredUuids as A,
|
|
3014
|
+
identify as B,
|
|
3015
|
+
initRecorder as C,
|
|
3016
|
+
ct as D,
|
|
3017
|
+
initializeConsolePlugin as E,
|
|
3018
|
+
initializeDomContentEvents as F,
|
|
3019
|
+
initializeFunctionSpanTrackingFromApi as G,
|
|
3020
|
+
initializePerformancePlugin as H,
|
|
3021
|
+
initializeRecording as I,
|
|
3022
|
+
initializeWebSocket as J,
|
|
3023
|
+
invalidateUrlCache as K,
|
|
3024
|
+
isFunctionSpanTrackingEnabled as L,
|
|
3025
|
+
isTransportSaturated as M,
|
|
3026
|
+
maskCanvasDraws as N,
|
|
3027
|
+
maskInputFn as O,
|
|
3028
|
+
matchUrlWithWildcard as P,
|
|
3029
|
+
B as Q,
|
|
3030
|
+
onNavigationChange as R,
|
|
3031
|
+
rt as S,
|
|
3032
|
+
openReportIssueModal as T,
|
|
3033
|
+
registerChart as U,
|
|
3034
|
+
registerFabricCanvas as V,
|
|
3035
|
+
registerKonvaStage as W,
|
|
3036
|
+
registerPixiApp as X,
|
|
3037
|
+
registerThreeScene as Y,
|
|
3038
|
+
requestTimeSync as Z,
|
|
3039
|
+
restoreFuncSpanState as _,
|
|
3040
|
+
lt as a,
|
|
3041
|
+
sendEvent as a0,
|
|
3042
|
+
sendGraphQLRequest as a1,
|
|
3043
|
+
sendMessage as a2,
|
|
3044
|
+
startRecording as a3,
|
|
3045
|
+
startRecordingSession as a4,
|
|
3046
|
+
toAbsoluteUrl as a5,
|
|
3047
|
+
trackingEvent as a6,
|
|
3048
|
+
withAppUrlMetadata as a7,
|
|
3049
|
+
wsSendBinary as a8,
|
|
2659
3050
|
addOrUpdateMetadata as b,
|
|
2660
3051
|
buildBatches as c,
|
|
2661
3052
|
clearStaleFuncSpanState as d,
|
|
@@ -2663,22 +3054,22 @@ export {
|
|
|
2663
3054
|
createTriageAndIssueFromRecorder as f,
|
|
2664
3055
|
createTriageFromRecorder as g,
|
|
2665
3056
|
disableFunctionSpanTracking as h,
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
3057
|
+
installAdapters as i,
|
|
3058
|
+
enableFunctionSpanTracking as j,
|
|
3059
|
+
ensureHrefCache as k,
|
|
3060
|
+
eventSize as l,
|
|
3061
|
+
fetchAndSendIp as m,
|
|
3062
|
+
fetchCaptureSettings as n,
|
|
3063
|
+
fetchEngineeringTicketPlatformIntegrations as o,
|
|
3064
|
+
fetchFunctionSpanTrackingEnabled as p,
|
|
3065
|
+
flushBufferedEvents as q,
|
|
3066
|
+
getBinaryDropCount as r,
|
|
3067
|
+
getBufferedAmount as s,
|
|
3068
|
+
getCachedHref as t,
|
|
3069
|
+
uninstallAdapters as u,
|
|
3070
|
+
getCachedHrefNoQuery as v,
|
|
3071
|
+
getFuncSpanHeader as w,
|
|
3072
|
+
getIdentifiedUser as x,
|
|
2682
3073
|
yieldToMain as y,
|
|
2683
|
-
|
|
3074
|
+
getOrSetSessionId as z
|
|
2684
3075
|
};
|