@jumio/websdk 0.6.1 → 0.6.3

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.
Files changed (90) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +17 -3
  3. package/assets/icons/error.svg +3 -0
  4. package/assets/icons/success.svg +3 -0
  5. package/assets/ml/dac.wasm +0 -0
  6. package/assets/ml/dac_simd.wasm +0 -0
  7. package/assets/style.css +1 -1
  8. package/index.html +2 -2
  9. package/index.js +799 -24
  10. package/index2.d.ts +1321 -2669
  11. package/js/da-system.CF4xYrOs.js +3311 -0
  12. package/js/i18n/{ar.DJCGXB2w.js → ar.G4YO_Y_p.js} +24 -4
  13. package/js/i18n/{az.COAR442z.js → az.-zT6np34.js} +24 -4
  14. package/js/i18n/{bg.BnAcaGp-.js → bg.DxM_GEeK.js} +24 -4
  15. package/js/i18n/{bn.D5TmwFpa.js → bn.CKeY4G7p.js} +24 -4
  16. package/js/i18n/{ca.BjwMAKvc.js → ca.BKTY9yUg.js} +24 -4
  17. package/js/i18n/{ceb.DVKMwSKX.js → ceb.JLohZjii.js} +24 -4
  18. package/js/i18n/{cs.D5cCPRuY.js → cs.BA2Vep8y.js} +24 -4
  19. package/js/i18n/{da.BuJNuhnR.js → da.B9agaK9h.js} +24 -4
  20. package/js/i18n/{de.rKIf4fAw.js → de.vUPfn2Oo.js} +24 -4
  21. package/js/i18n/{el.Bn--4b86.js → el.CZhNQ18R.js} +24 -4
  22. package/js/i18n/{en.D6Xcuaob.js → en.B9cSV95A.js} +24 -4
  23. package/js/i18n/{en_GB.uaf19-ht.js → en_GB.DjNAh_2o.js} +24 -4
  24. package/js/i18n/{es.Bh_iETUQ.js → es.Ch5DzQZa.js} +24 -4
  25. package/js/i18n/{es_MX.D2NQorYq.js → es_MX.DmW4rnyT.js} +24 -4
  26. package/js/i18n/{et.D2Q9r-3y.js → et.F6IvljwK.js} +24 -4
  27. package/js/i18n/{fi.CNjEK5fc.js → fi.CUS8RexX.js} +24 -4
  28. package/js/i18n/{fil.CLDV-3cS.js → fil.Z-e4hm0l.js} +24 -4
  29. package/js/i18n/{fr.CA8X8em9.js → fr.DwdzaTwF.js} +24 -4
  30. package/js/i18n/{fr_CA.CXGgnoAY.js → fr_CA.Bq8FNlJo.js} +24 -4
  31. package/js/i18n/{ga.C1hmAiav.js → ga.DBpKAZUR.js} +24 -4
  32. package/js/i18n/{he.-XKz2lD2.js → he.DMmA1ZqA.js} +24 -4
  33. package/js/i18n/{hi.C0KBwhQk.js → hi.Cy8wi17L.js} +24 -4
  34. package/js/i18n/{hr.uxoIGptt.js → hr.BZ6ug-jc.js} +24 -4
  35. package/js/i18n/{hu.BWv0c70l.js → hu.o-xDRGsO.js} +24 -4
  36. package/js/i18n/{hy.BXjLEn-o.js → hy.D32BUH4n.js} +24 -4
  37. package/js/i18n/{id.CAU6yYSa.js → id.C-UnIn3z.js} +24 -4
  38. package/js/i18n/{is.Dy4_ecmW.js → is.eMAflTw8.js} +24 -4
  39. package/js/i18n/{it.B3KUcD4q.js → it.CIBQ3ml4.js} +24 -4
  40. package/js/i18n/{ja.CaZYxC9B.js → ja.Bin9p7ZD.js} +24 -4
  41. package/js/i18n/{jv.CR72tAaT.js → jv.DSROGovC.js} +24 -4
  42. package/js/i18n/{ka_GE.Cr-1NYDP.js → ka_GE.CaM7IMJX.js} +24 -4
  43. package/js/i18n/{kk.Ca7tjmtN.js → kk.DcskzbbK.js} +24 -4
  44. package/js/i18n/{km_KH.5bzfX4fH.js → km_KH.DRNO5fkq.js} +24 -4
  45. package/js/i18n/{ko.BR7WjEVs.js → ko.DKRNCmSz.js} +24 -4
  46. package/js/i18n/{lt.DLxW84xt.js → lt.bPIia0iM.js} +24 -4
  47. package/js/i18n/{lv.CtzfObfK.js → lv.DIlk3g7N.js} +24 -4
  48. package/js/i18n/{ms.Bp0STOr5.js → ms.DEJX56Wa.js} +24 -4
  49. package/js/i18n/{my.-ro5sNON.js → my.DQY-gdZl.js} +24 -4
  50. package/js/i18n/{nl.D0LLWo_Y.js → nl.DqBWUrWI.js} +24 -4
  51. package/js/i18n/{no.BYKxbI4x.js → no.DIknVO0F.js} +24 -4
  52. package/js/i18n/{pl.DgKQ2UVD.js → pl.uacFwjGK.js} +24 -4
  53. package/js/i18n/{pt.BTA2Pv7x.js → pt.DnHAjNgx.js} +24 -4
  54. package/js/i18n/{pt_BR.BRF7M-ts.js → pt_BR.BzDKzZSl.js} +24 -4
  55. package/js/i18n/{ro.BPwxxMAK.js → ro.C_ugDPjB.js} +24 -4
  56. package/js/i18n/{ru.wspWsIPg.js → ru.CbHdcVyw.js} +24 -4
  57. package/js/i18n/{sk.CXAGCXtS.js → sk.DPjBeKJf.js} +24 -4
  58. package/js/i18n/{sl.DW87OtC8.js → sl.CXVM3eQd.js} +24 -4
  59. package/js/i18n/{sq.6JBP37Rr.js → sq.BwOb4h9N.js} +24 -4
  60. package/js/i18n/{sr_Cyrl.02dFN3jq.js → sr_Cyrl.BO2hYmw9.js} +24 -4
  61. package/js/i18n/{sr_Latn.BTAmz9Gv.js → sr_Latn.iMeB6lsy.js} +24 -4
  62. package/js/i18n/{sv.S9SZiw5h.js → sv.BElOZUsc.js} +24 -4
  63. package/js/i18n/{sw.VnsOTYda.js → sw.CzFrkmbC.js} +24 -4
  64. package/js/i18n/{th.BtdkMYDs.js → th.B8CnAYHf.js} +24 -4
  65. package/js/i18n/{tr.Bn9WaSgB.js → tr.CZbsef6a.js} +24 -4
  66. package/js/i18n/{uk.BWteiLoJ.js → uk.Di9VzU09.js} +24 -4
  67. package/js/i18n/{ur.Bvf95gqk.js → ur.F2L7rh71.js} +24 -4
  68. package/js/i18n/{uz.D8_cEsZg.js → uz.s6qLauh_.js} +25 -5
  69. package/js/i18n/{vi.BMi-BwuI.js → vi.vMJPCM9t.js} +24 -4
  70. package/js/i18n/{zh_CN.Dipv9Pqc.js → zh_CN.ConQ8v4P.js} +24 -4
  71. package/js/i18n/{zh_HK.DkyVCxyR.js → zh_HK.Ba4wmp5J.js} +24 -4
  72. package/js/logging/datadog.DrMNEV3y.js +10147 -0
  73. package/js/{loader.BMK4_g6C.js → pages/data.DhS_CSrV.js} +80 -3
  74. package/js/pages/document.CQ_B9GTj.js +1522 -0
  75. package/js/pages/facemap.C8DMARoY.js +3060 -0
  76. package/js/pages/id.CPQIHmLw.js +9485 -0
  77. package/js/pdfjs/{pdf-U_mH0bJO.js → pdf.U_mH0bJO.js} +1 -1
  78. package/js/pdfjs/{pdf.worker.min-DFxVranA.js → pdf.worker.DFxVranA.js} +1 -1
  79. package/js/runtime.BjZbWNSZ.js +47296 -0
  80. package/package.json +4 -4
  81. package/third-party-licenses.txt +0 -3546
  82. package/index2.js +0 -906
  83. package/js/BRAZILIAN_ID.BxztzOl2.js +0 -5
  84. package/js/assets_da_web_id_1_1_6.tar.B0wlC5WP.js +0 -5
  85. package/js/assets_da_web_liveness_1_1_6.tar.BMW6psZZ.js +0 -5
  86. package/js/dac.DkgyVAg0.js +0 -5
  87. package/js/dac_simd.CUDgtSoV.js +0 -5
  88. package/js/dd/datadogProfiler-5-Pwxhm7.js +0 -408
  89. package/js/dd/datadogRecorder-CexR-8pQ.js +0 -1218
  90. package/js/index.D9DhPHsY.js +0 -67358
@@ -1,1218 +0,0 @@
1
- import { B as y, k as ge, C as A, E as $, F as me, N as g, G as Ee, H as z, I as Te, J as Ie, K as W, M as ye, P as Ne, O as ve, Q as K, T as be, U as J, W as j, X as Ce, Y as Z, Z as v, _ as q, L as R, $ as we, a0 as O, a1 as C, t as S, r as Me, a2 as Re, a3 as N, a4 as x, a5 as M, a6 as _e, a7 as xe, a8 as Ae, a9 as De, aa as Oe, ab as Le, ac as Pe, ad as ke, ae as Ve, m as ze, s as Ue, af as He, ag as Fe, ah as Be, g as Ge, p as Ye, c as Xe, a as $e, b as We } from "../index.D9DhPHsY.js";
2
- function Ke() {
3
- return Je() === 1;
4
- }
5
- let U;
6
- function Je() {
7
- return U ?? (U = je());
8
- }
9
- function je(e = window) {
10
- const t = e.navigator.userAgent;
11
- return e.chrome || /HeadlessChrome/.test(t) ? 0 : e.navigator.vendor?.indexOf("Apple") === 0 || /safari/i.test(t) && !/chrome|android/i.test(t) ? 1 : 2;
12
- }
13
- const T = {
14
- FullSnapshot: 2,
15
- IncrementalSnapshot: 3,
16
- Meta: 4,
17
- Focus: 6,
18
- ViewEnd: 7,
19
- VisualViewport: 8,
20
- Change: 12
21
- }, h = {
22
- AddString: 0,
23
- AddNode: 1,
24
- RemoveNode: 2,
25
- Attribute: 3,
26
- Text: 4,
27
- Size: 5,
28
- ScrollPosition: 6,
29
- AddStyleSheet: 7,
30
- AttachedStyleSheets: 8,
31
- MediaPlaybackState: 9,
32
- VisualViewport: 10
33
- }, E = {
34
- MouseMove: 1,
35
- MouseInteraction: 2,
36
- Scroll: 3,
37
- ViewportResize: 4,
38
- Input: 5,
39
- TouchMove: 6,
40
- MediaInteraction: 7,
41
- StyleSheetRule: 8
42
- }, m = {
43
- MouseUp: 0,
44
- MouseDown: 1,
45
- Click: 2,
46
- ContextMenu: 3,
47
- DblClick: 4,
48
- Focus: 5,
49
- Blur: 6,
50
- TouchStart: 7,
51
- TouchEnd: 9
52
- }, D = {
53
- Play: 0,
54
- Pause: 1
55
- }, Ze = {
56
- Change: 1
57
- };
58
- function qe(e) {
59
- return Q(void 0, void 0, e);
60
- }
61
- function Qe(e, t, n) {
62
- return Q(e, t, n);
63
- }
64
- function Q(e, t, n) {
65
- let o = {
66
- container: void 0,
67
- parentId: e,
68
- previousSiblingId: void 0,
69
- nextSiblingId: t
70
- };
71
- const i = (s) => o.previousSiblingId === s - 1 ? 0 : o.nextSiblingId !== void 0 ? o.nextSiblingId - s : o.parentId !== void 0 ? s - o.parentId : null;
72
- return {
73
- advance(s) {
74
- const r = n.getOrInsert(s), a = i(r);
75
- return o.previousSiblingId = r, {
76
- nodeId: r,
77
- insertionPoint: a
78
- };
79
- },
80
- ascend() {
81
- o.container && (o = o.container);
82
- },
83
- descend() {
84
- o.previousSiblingId !== void 0 && (o = {
85
- container: o,
86
- parentId: o.previousSiblingId,
87
- previousSiblingId: void 0,
88
- nextSiblingId: void 0
89
- });
90
- }
91
- };
92
- }
93
- function ee() {
94
- return {
95
- cssText: {
96
- count: 0,
97
- max: 0,
98
- sum: 0
99
- },
100
- serializationDuration: {
101
- count: 0,
102
- max: 0,
103
- sum: 0
104
- }
105
- };
106
- }
107
- function H(e, t, n) {
108
- e[t].count += 1, e[t].max = Math.max(e[t].max, n), e[t].sum += n;
109
- }
110
- function et(e, t) {
111
- for (const n of ["cssText", "serializationDuration"])
112
- e[n].count += t[n].count, e[n].max = Math.max(e[n].max, t[n].max), e[n].sum += t[n].sum;
113
- }
114
- function tt(e) {
115
- let t = {};
116
- const n = (s) => {
117
- for (let r = 0, a = s.length; r < a; r++) {
118
- const c = s[r];
119
- if (typeof c == "string") {
120
- const u = e.size;
121
- u < 1e6 ? (s[r] = e.getOrInsert(c), e.size > u && o(h.AddString, c)) : s[r] = e.get(c) ?? c;
122
- } else Array.isArray(c) && n(c);
123
- }
124
- }, o = (s, r) => {
125
- s in t || (t[s] = [s]), s !== h.AddString && Array.isArray(r) && n(r), t[s].push(r);
126
- };
127
- return {
128
- add: o,
129
- flush: () => {
130
- const s = [];
131
- return [
132
- h.AddString,
133
- h.AddNode,
134
- h.RemoveNode,
135
- h.Attribute,
136
- h.Text,
137
- h.Size,
138
- h.ScrollPosition,
139
- h.AddStyleSheet,
140
- h.AttachedStyleSheets,
141
- h.MediaPlaybackState,
142
- h.VisualViewport
143
- ].forEach((r) => {
144
- const a = t[r];
145
- a && s.push(a);
146
- }), t = {}, s;
147
- }
148
- };
149
- }
150
- function te(e, t, n, o, i, s) {
151
- const r = tt(o.stringIds), a = ee(), c = {
152
- addMetric(l, f) {
153
- H(a, l, f);
154
- },
155
- addNode(...l) {
156
- r.add(h.AddNode, l);
157
- },
158
- addStyleSheet(l, f, p) {
159
- p ? r.add(h.AddStyleSheet, [
160
- l,
161
- f || [],
162
- p
163
- ]) : f ? r.add(h.AddStyleSheet, [l, f]) : r.add(h.AddStyleSheet, [l]);
164
- },
165
- attachStyleSheets(l, f) {
166
- const p = [l];
167
- for (const b of f) p.push(b);
168
- r.add(h.AttachedStyleSheets, p);
169
- },
170
- removeNode(l) {
171
- r.add(h.RemoveNode, l);
172
- },
173
- setAttributes(l) {
174
- r.add(h.Attribute, l);
175
- },
176
- setMediaPlaybackState(l, f) {
177
- r.add(h.MediaPlaybackState, [l, f]);
178
- },
179
- setScrollPosition(l, f, p) {
180
- r.add(h.ScrollPosition, [
181
- l,
182
- f,
183
- p
184
- ]);
185
- },
186
- setSize(l, f, p) {
187
- r.add(h.Size, [
188
- l,
189
- f,
190
- p
191
- ]);
192
- },
193
- setText(l, f) {
194
- r.add(h.Text, [l, f]);
195
- },
196
- kind: e,
197
- scope: o
198
- }, u = y();
199
- s(c), H(a, "serializationDuration", ge(u, y()));
200
- const d = r.flush();
201
- d.length > 0 && t(e === 0 || e === 1 ? {
202
- data: d,
203
- format: Ze.Change,
204
- type: T.FullSnapshot,
205
- timestamp: i
206
- } : {
207
- data: d,
208
- type: T.Change,
209
- timestamp: i
210
- }), n(a);
211
- }
212
- function P(e, t) {
213
- const n = e.tagName, o = e.value;
214
- if (A(e, t)) {
215
- const i = e.type;
216
- return n === "INPUT" && (i === "button" || i === "submit" || i === "reset") ? o : !o || n === "OPTION" ? void 0 : $;
217
- }
218
- if (n === "OPTION" || n === "SELECT") return e.value;
219
- if (!(n !== "INPUT" && n !== "TEXTAREA"))
220
- return o;
221
- }
222
- const nt = /url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm, ot = /^[A-Za-z]+:|^\/\//, st = /^["']?data:.*,/i;
223
- function it(e, t) {
224
- return e.replace(nt, (n, o, i, s, r, a) => {
225
- const c = i || r || a;
226
- if (!t || !c || ot.test(c) || st.test(c)) return n;
227
- const u = o || s || "";
228
- return `url(${u}${rt(c, t)}${u})`;
229
- });
230
- }
231
- function rt(e, t) {
232
- try {
233
- return me(e, t).href;
234
- } catch {
235
- return e;
236
- }
237
- }
238
- function ne(e) {
239
- return e.tagName.toLowerCase();
240
- }
241
- function F(e, t) {
242
- return `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' style='background-color:silver'%3E%3C/svg%3E`;
243
- }
244
- const at = 1e6;
245
- function oe(e, t, n, o) {
246
- if (t === g.HIDDEN) return null;
247
- const i = e.getAttribute(n), s = e.tagName;
248
- if (Ee(s, n, i, t, o)) {
249
- if (s === "IMG") {
250
- const r = e;
251
- if (r.naturalWidth > 0) return F(r.naturalWidth, r.naturalHeight);
252
- const { width: a, height: c } = e.getBoundingClientRect();
253
- return a > 0 || c > 0 ? F(a, c) : z;
254
- }
255
- return s === "SOURCE" ? z : $;
256
- }
257
- return i && Te(i, at);
258
- }
259
- function ct(e, t, n) {
260
- if (t === g.HIDDEN) return {};
261
- const o = {}, i = ne(e);
262
- for (let r = 0; r < e.attributes.length; r += 1) {
263
- const a = e.attributes.item(r).name, c = oe(e, t, a, n.scope.configuration);
264
- c !== null && (o[a] = c);
265
- }
266
- if (e.value && (i === "textarea" || i === "select" || i === "option" || i === "input")) {
267
- const r = P(e, t);
268
- r !== void 0 && (o.value = r);
269
- }
270
- if (i === "option") {
271
- const r = e;
272
- r.selected && !A(r, t) ? o.selected = "" : delete o.selected;
273
- }
274
- const s = e;
275
- return i === "input" && (s.type === "radio" || s.type === "checkbox") && (s.checked && !A(s, t) ? o.checked = "" : delete o.checked), o;
276
- }
277
- function ut(e, t, n) {
278
- if (t === g.HIDDEN) return {};
279
- const o = {}, i = e.ownerDocument, s = ne(e);
280
- if (s === "link") {
281
- const c = Array.from(i.styleSheets).find((d) => d.href === e.href), u = L(c);
282
- u && c && (n.addMetric("cssText", u.length), o._cssText = u);
283
- }
284
- if (s === "style" && e.sheet) {
285
- const c = L(e.sheet);
286
- c && (n.addMetric("cssText", c.length), o._cssText = c);
287
- }
288
- (s === "audio" || s === "video") && (o.rr_mediaState = e.paused ? "paused" : "played");
289
- let r, a;
290
- switch (n.kind) {
291
- case 0:
292
- r = Math.round(e.scrollTop), a = Math.round(e.scrollLeft), (r || a) && n.scope.elementsScrollPositions.set(e, {
293
- scrollTop: r,
294
- scrollLeft: a
295
- });
296
- break;
297
- case 1:
298
- n.scope.elementsScrollPositions.has(e) && ({ scrollTop: r, scrollLeft: a } = n.scope.elementsScrollPositions.get(e));
299
- break;
300
- }
301
- return a && (o.rr_scrollLeft = a), r && (o.rr_scrollTop = r), o;
302
- }
303
- function L(e) {
304
- if (!e) return null;
305
- let t;
306
- try {
307
- t = e.rules || e.cssRules;
308
- } catch {
309
- }
310
- return t ? it(Array.from(t, Ke() ? dt : se).join(""), e.href) : null;
311
- }
312
- function dt(e) {
313
- return ft(e) && e.selectorText.includes(":") ? e.cssText.replace(/(\[[\w-]+[^\\])(:[^\]]+\])/g, "$1\\$2") : se(e);
314
- }
315
- function se(e) {
316
- return lt(e) && L(e.styleSheet) || e.cssText;
317
- }
318
- function lt(e) {
319
- return "styleSheet" in e;
320
- }
321
- function ft(e) {
322
- return "selectorText" in e;
323
- }
324
- function k(e, t, n, o) {
325
- if (t.parentNode?.nodeName === "STYLE" || n === g.HIDDEN || n === g.IGNORE) return;
326
- let i;
327
- const s = Ie(t);
328
- if (s ? i = Ce(s, n) : i = n, i === g.HIDDEN) {
329
- Tt(e, t, o);
330
- return;
331
- }
332
- if (i !== g.IGNORE) {
333
- switch (t.nodeType) {
334
- case t.CDATA_SECTION_NODE:
335
- Et(e, t, o);
336
- break;
337
- case t.DOCUMENT_NODE:
338
- pt(e, t, o);
339
- break;
340
- case t.DOCUMENT_FRAGMENT_NODE:
341
- ht(e, t, o);
342
- break;
343
- case t.DOCUMENT_TYPE_NODE:
344
- St(e, t, o);
345
- break;
346
- case t.ELEMENT_NODE:
347
- gt(e, t, i, o);
348
- break;
349
- case t.TEXT_NODE:
350
- mt(e, t, i, o);
351
- break;
352
- default:
353
- return;
354
- }
355
- switch (t.nodeType) {
356
- case t.CDATA_SECTION_NODE:
357
- case t.DOCUMENT_TYPE_NODE:
358
- case t.TEXT_NODE:
359
- return;
360
- }
361
- e.descend(), W(t, (r) => {
362
- k(e, r, i, o);
363
- }), e.ascend();
364
- }
365
- }
366
- function pt(e, t, n) {
367
- const { nodeId: o, insertionPoint: i } = e.advance(t);
368
- n.addNode(i, "#document"), n.setScrollPosition(o, J(), j()), ie(t.adoptedStyleSheets, o, n);
369
- }
370
- function ht(e, t, n) {
371
- const { nodeId: o, insertionPoint: i } = e.advance(t);
372
- if (!be(t)) {
373
- n.addNode(i, "#document-fragment");
374
- return;
375
- }
376
- n.addNode(i, "#shadow-root"), n.scope.shadowRootsController.addShadowRoot(t, n.scope), ie(t.adoptedStyleSheets, o, n);
377
- }
378
- function St(e, t, n) {
379
- const { insertionPoint: o } = e.advance(t);
380
- n.addNode(o, "#doctype", t.name, t.publicId, t.systemId);
381
- }
382
- function gt(e, t, n, o) {
383
- const { nodeId: i, insertionPoint: s } = e.advance(t), r = Object.entries(ct(t, n, o));
384
- o.addNode(s, re(t), ...r);
385
- const { _cssText: a, rr_mediaState: c, rr_scrollLeft: u, rr_scrollTop: d } = ut(t, n, o), l = t;
386
- if (a !== void 0 && l.sheet) {
387
- const f = o.scope.styleSheetIds.getOrInsert(l.sheet);
388
- o.addStyleSheet(a), o.attachStyleSheets(i, [f]);
389
- }
390
- c === "played" ? o.setMediaPlaybackState(i, D.Play) : c === "paused" && o.setMediaPlaybackState(i, D.Pause), (u !== void 0 || d !== void 0) && o.setScrollPosition(i, u || 0, d || 0);
391
- }
392
- function mt(e, t, n, o) {
393
- const { insertionPoint: i } = e.advance(t), s = K(t, n);
394
- o.addNode(i, "#text", s);
395
- }
396
- function Et(e, t, n) {
397
- const { insertionPoint: o } = e.advance(t);
398
- n.addNode(o, "#cdata-section");
399
- }
400
- function Tt(e, t, n) {
401
- if (!ye(t)) return;
402
- const { nodeId: o, insertionPoint: i } = e.advance(t);
403
- n.addNode(i, re(t), [Ne, ve]);
404
- const { width: s, height: r } = t.getBoundingClientRect();
405
- n.setSize(o, s, r);
406
- }
407
- function ie(e, t, n) {
408
- !e || e.length === 0 || n.attachStyleSheets(t, e.map((o) => It(o, n)));
409
- }
410
- function It(e, t) {
411
- const n = Array.from(e.cssRules || e.rules, (i) => i.cssText), o = e.media.length > 0 ? Array.from(e.media) : void 0;
412
- return t.addMetric("cssText", n.reduce((i, s) => i + s.length, 0)), t.addStyleSheet(n, o, e.disabled), t.scope.styleSheetIds.getOrInsert(e);
413
- }
414
- function re(e) {
415
- const t = e.nodeName;
416
- return yt(e) ? `svg>${t}` : t;
417
- }
418
- function yt(e) {
419
- return e.namespaceURI === "http://www.w3.org/2000/svg";
420
- }
421
- function Nt(e, t, n, o, i, s) {
422
- s.resetIds(), te(t, o, i, s, e, (r) => {
423
- k(qe(s.nodeIds), n, s.configuration.defaultPrivacyLevel, r);
424
- });
425
- }
426
- function vt(e, t, n, o, i) {
427
- te(2, n, o, i, e, (s) => bt(t, s));
428
- }
429
- function bt(e, t) {
430
- const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
431
- for (const c of e) switch (c.type) {
432
- case "attributes": {
433
- const u = c.target;
434
- let d = o.get(u);
435
- d || (d = /* @__PURE__ */ new Map(), o.set(u, d));
436
- const l = c.attributeName;
437
- d.has(l) || d.set(l, c.oldValue);
438
- break;
439
- }
440
- case "characterData":
441
- i.has(c.target) || i.set(c.target, c.oldValue);
442
- break;
443
- case "childList":
444
- for (let u = 0; u < c.addedNodes.length; u++) n.add(c.addedNodes[u]);
445
- for (let u = 0; u < c.removedNodes.length; u++) s.add(c.removedNodes[u]);
446
- break;
447
- }
448
- const r = t.scope.nodeIds.nextId, a = /* @__PURE__ */ new Map();
449
- Ct(s, t), wt(n, a, t), Mt(i, r, a, t), Rt(o, r, a, t);
450
- }
451
- function Ct(e, t) {
452
- const n = t.scope.nodeIds;
453
- for (const o of e) {
454
- const i = n.get(o);
455
- i !== void 0 && (ae(o, (s) => {
456
- q(s) && t.scope.shadowRootsController.removeShadowRoot(s.shadowRoot), n.delete(s);
457
- }), t.removeNode(i));
458
- }
459
- }
460
- function wt(e, t, n) {
461
- const o = n.scope.nodeIds;
462
- for (const i of e) {
463
- if (!i.isConnected || o.get(i) !== void 0) continue;
464
- const s = Z(i);
465
- if (!s) continue;
466
- const r = o.get(s);
467
- if (r === void 0) continue;
468
- const a = v(s, n.scope.configuration.defaultPrivacyLevel, t);
469
- k(Qe(r, _t(i, o), o), i, a, n);
470
- }
471
- }
472
- function Mt(e, t, n, o) {
473
- const i = o.scope.nodeIds;
474
- for (const [s, r] of e) {
475
- if (s.textContent === r || !s.isConnected) continue;
476
- const a = i.get(s);
477
- if (a === void 0 || a >= t) continue;
478
- const c = Z(s);
479
- if (!c) continue;
480
- const u = v(c, o.scope.configuration.defaultPrivacyLevel, n);
481
- if (u === g.HIDDEN || u === g.IGNORE) continue;
482
- const d = K(s, u);
483
- o.setText(a, d);
484
- }
485
- }
486
- function Rt(e, t, n, o) {
487
- const i = o.scope.nodeIds;
488
- for (const [s, r] of e) {
489
- if (!s.isConnected) continue;
490
- const a = i.get(s);
491
- if (a === void 0 || a >= t) continue;
492
- const c = v(s, o.scope.configuration.defaultPrivacyLevel, n);
493
- if (c === g.HIDDEN || c === g.IGNORE) continue;
494
- const u = [a];
495
- for (const [d, l] of r) {
496
- if (s.getAttribute(d) === l) continue;
497
- if (d === "value") {
498
- const p = P(s, c);
499
- p !== void 0 && u.push([d, p]);
500
- continue;
501
- }
502
- const f = oe(s, c, d, o.scope.configuration);
503
- f === null ? u.push([d]) : u.push([d, f]);
504
- }
505
- u.length > 1 && o.setAttributes(u);
506
- }
507
- }
508
- function _t(e, t) {
509
- let n = e.nextSibling;
510
- for (; n; ) {
511
- const o = t.get(n);
512
- if (o !== void 0) return o;
513
- n = n.nextSibling;
514
- }
515
- }
516
- function ae(e, t) {
517
- t(e), W(e, (n) => ae(n, t));
518
- }
519
- const B = 25;
520
- function xt(e) {
521
- return Math.abs(e.pageTop - e.offsetTop - window.scrollY) > B || Math.abs(e.pageLeft - e.offsetLeft - window.scrollX) > B;
522
- }
523
- const At = (e, t) => {
524
- const n = window.visualViewport, o = {
525
- layoutViewportX: e,
526
- layoutViewportY: t,
527
- visualViewportX: e,
528
- visualViewportY: t
529
- };
530
- if (n) xt(n) ? (o.layoutViewportX = Math.round(e + n.offsetLeft), o.layoutViewportY = Math.round(t + n.offsetTop)) : (o.visualViewportX = Math.round(e - n.offsetLeft), o.visualViewportY = Math.round(t - n.offsetTop));
531
- else return o;
532
- return o;
533
- }, ce = (e) => ({
534
- scale: e.scale,
535
- offsetLeft: e.offsetLeft,
536
- offsetTop: e.offsetTop,
537
- pageLeft: e.pageLeft,
538
- pageTop: e.pageTop,
539
- height: e.height,
540
- width: e.width
541
- });
542
- function Dt(e, t, n, o, i) {
543
- G(y(), 0, t, n, i);
544
- const { unsubscribe: s } = e.subscribe(R.VIEW_CREATED, (r) => {
545
- o(), G(r.startClocks.timeStamp, 1, t, n, i);
546
- });
547
- return { stop: s };
548
- }
549
- function G(e, t, n, o, i) {
550
- const { width: s, height: r } = we();
551
- n({
552
- data: {
553
- height: r,
554
- href: window.location.href,
555
- width: s
556
- },
557
- type: T.Meta,
558
- timestamp: e
559
- }), n({
560
- data: { has_focus: document.hasFocus() },
561
- type: T.Focus,
562
- timestamp: e
563
- }), Nt(e, t, document, n, o, i), window.visualViewport && n({
564
- data: ce(window.visualViewport),
565
- type: T.VisualViewport,
566
- timestamp: e
567
- });
568
- }
569
- function Ot() {
570
- return V(1);
571
- }
572
- function Lt() {
573
- return V(0);
574
- }
575
- function Pt() {
576
- return Vt(0);
577
- }
578
- function kt() {
579
- return V(0);
580
- }
581
- function Vt(e) {
582
- return ue(() => /* @__PURE__ */ new Map(), e);
583
- }
584
- function V(e) {
585
- return ue(() => /* @__PURE__ */ new WeakMap(), e);
586
- }
587
- function ue(e, t) {
588
- let n = e(), o = t;
589
- const i = (s) => n.get(s);
590
- return {
591
- clear() {
592
- o !== t && (n = e(), o = t);
593
- },
594
- delete(s) {
595
- n.delete(s);
596
- },
597
- get: i,
598
- getOrInsert(s) {
599
- let r = i(s);
600
- return r === void 0 && (r = o++, n.set(s, r)), r;
601
- },
602
- get nextId() {
603
- return o;
604
- },
605
- get size() {
606
- return o - t;
607
- }
608
- };
609
- }
610
- function zt(e, t, n) {
611
- const o = {
612
- resetIds() {
613
- o.eventIds.clear(), o.nodeIds.clear(), o.stringIds.clear(), o.styleSheetIds.clear();
614
- },
615
- configuration: e,
616
- elementsScrollPositions: t,
617
- eventIds: Ot(),
618
- nodeIds: Lt(),
619
- shadowRootsController: n,
620
- stringIds: Pt(),
621
- styleSheetIds: kt()
622
- };
623
- return o;
624
- }
625
- function Ut() {
626
- const e = /* @__PURE__ */ new WeakMap();
627
- return {
628
- set(t, n) {
629
- t === document && !document.scrollingElement || e.set(t === document ? document.scrollingElement : t, n);
630
- },
631
- get(t) {
632
- return e.get(t);
633
- },
634
- has(t) {
635
- return e.has(t);
636
- }
637
- };
638
- }
639
- function de(e) {
640
- return !!e.changedTouches;
641
- }
642
- function _(e) {
643
- return e.composed === !0 && q(e.target) ? e.composedPath()[0] : e.target;
644
- }
645
- function I(e, t, n = y()) {
646
- return {
647
- data: {
648
- source: e,
649
- ...t
650
- },
651
- type: T.IncrementalSnapshot,
652
- timestamp: n
653
- };
654
- }
655
- const Ht = 50;
656
- function Ft(e, t) {
657
- const { throttled: n, cancel: o } = O((s) => {
658
- const r = _(s), a = t.nodeIds.get(r);
659
- if (a === void 0) return;
660
- const c = le(s);
661
- if (!c) return;
662
- const u = {
663
- id: a,
664
- timeOffset: 0,
665
- x: c.x,
666
- y: c.y
667
- };
668
- e(I(de(s) ? E.TouchMove : E.MouseMove, { positions: [u] }));
669
- }, Ht, { trailing: !1 }), { stop: i } = C(document, [S.MOUSE_MOVE, S.TOUCH_MOVE], n, {
670
- capture: !0,
671
- passive: !0
672
- });
673
- return { stop: () => {
674
- i(), o();
675
- } };
676
- }
677
- function le(e) {
678
- let { clientX: t, clientY: n } = de(e) ? e.changedTouches[0] : e;
679
- if (window.visualViewport) {
680
- const { visualViewportX: o, visualViewportY: i } = At(t, n);
681
- t = o, n = i;
682
- }
683
- if (!(!Number.isFinite(t) || !Number.isFinite(n)))
684
- return {
685
- x: t,
686
- y: n
687
- };
688
- }
689
- const Y = {
690
- [S.POINTER_UP]: m.MouseUp,
691
- [S.MOUSE_DOWN]: m.MouseDown,
692
- [S.CLICK]: m.Click,
693
- [S.CONTEXT_MENU]: m.ContextMenu,
694
- [S.DBL_CLICK]: m.DblClick,
695
- [S.FOCUS]: m.Focus,
696
- [S.BLUR]: m.Blur,
697
- [S.TOUCH_START]: m.TouchStart,
698
- [S.TOUCH_END]: m.TouchEnd
699
- };
700
- function Bt(e, t) {
701
- const n = (o) => {
702
- const i = _(o), s = t.nodeIds.get(i);
703
- if (s === void 0 || v(i, t.configuration.defaultPrivacyLevel) === g.HIDDEN) return;
704
- const r = Y[o.type];
705
- let a;
706
- if (r !== m.Blur && r !== m.Focus) {
707
- const c = le(o);
708
- if (!c) return;
709
- a = {
710
- id: s,
711
- type: r,
712
- x: c.x,
713
- y: c.y
714
- };
715
- } else a = {
716
- id: s,
717
- type: r
718
- };
719
- e({
720
- id: t.eventIds.getOrInsert(o),
721
- ...I(E.MouseInteraction, a)
722
- });
723
- };
724
- return C(document, Object.keys(Y), n, {
725
- capture: !0,
726
- passive: !0
727
- });
728
- }
729
- const Gt = 100;
730
- function fe(e, t, n) {
731
- const { throttled: o, cancel: i } = O((r) => {
732
- const a = _(r);
733
- if (!a) return;
734
- const c = n.nodeIds.get(a);
735
- if (c === void 0 || v(a, n.configuration.defaultPrivacyLevel) === g.HIDDEN) return;
736
- const u = a === document ? {
737
- scrollTop: j(),
738
- scrollLeft: J()
739
- } : {
740
- scrollTop: Math.round(a.scrollTop),
741
- scrollLeft: Math.round(a.scrollLeft)
742
- };
743
- n.elementsScrollPositions.set(a, u), t(I(E.Scroll, {
744
- id: c,
745
- x: u.scrollLeft,
746
- y: u.scrollTop
747
- }));
748
- }, Gt), { stop: s } = Me(e, S.SCROLL, o, {
749
- capture: !0,
750
- passive: !0
751
- });
752
- return { stop: () => {
753
- s(), i();
754
- } };
755
- }
756
- const Yt = 200;
757
- function Xt(e) {
758
- const t = Re().subscribe((n) => {
759
- e(I(E.ViewportResize, n));
760
- });
761
- return { stop: () => {
762
- t.unsubscribe();
763
- } };
764
- }
765
- function $t(e) {
766
- const t = window.visualViewport;
767
- if (!t) return { stop: N };
768
- const { throttled: n, cancel: o } = O(() => {
769
- e({
770
- data: ce(t),
771
- type: T.VisualViewport,
772
- timestamp: y()
773
- });
774
- }, Yt, { trailing: !1 }), { stop: i } = C(t, [S.RESIZE, S.SCROLL], n, {
775
- capture: !0,
776
- passive: !0
777
- });
778
- return { stop: () => {
779
- i(), o();
780
- } };
781
- }
782
- function Wt(e, t) {
783
- return C(document, [S.PLAY, S.PAUSE], (n) => {
784
- const o = _(n);
785
- if (!o) return;
786
- const i = t.nodeIds.get(o);
787
- i === void 0 || v(o, t.configuration.defaultPrivacyLevel) === g.HIDDEN || e(I(E.MediaInteraction, {
788
- id: i,
789
- type: n.type === S.PLAY ? D.Play : D.Pause
790
- }));
791
- }, {
792
- capture: !0,
793
- passive: !0
794
- });
795
- }
796
- function Kt(e, t) {
797
- function n(s, r) {
798
- if (!s?.ownerNode) return;
799
- const a = t.nodeIds.get(s.ownerNode);
800
- a !== void 0 && r(a);
801
- }
802
- const o = [x(CSSStyleSheet.prototype, "insertRule", ({ target: s, parameters: [r, a] }) => {
803
- n(s, (c) => e(I(E.StyleSheetRule, {
804
- id: c,
805
- adds: [{
806
- rule: r,
807
- index: a
808
- }]
809
- })));
810
- }), x(CSSStyleSheet.prototype, "deleteRule", ({ target: s, parameters: [r] }) => {
811
- n(s, (a) => e(I(E.StyleSheetRule, {
812
- id: a,
813
- removes: [{ index: r }]
814
- })));
815
- })];
816
- typeof CSSGroupingRule < "u" ? i(CSSGroupingRule) : (i(CSSMediaRule), i(CSSSupportsRule));
817
- function i(s) {
818
- o.push(x(s.prototype, "insertRule", ({ target: r, parameters: [a, c] }) => {
819
- n(r.parentStyleSheet, (u) => {
820
- const d = X(r);
821
- d && (d.push(c || 0), e(I(E.StyleSheetRule, {
822
- id: u,
823
- adds: [{
824
- rule: a,
825
- index: d
826
- }]
827
- })));
828
- });
829
- }), x(s.prototype, "deleteRule", ({ target: r, parameters: [a] }) => {
830
- n(r.parentStyleSheet, (c) => {
831
- const u = X(r);
832
- u && (u.push(a), e(I(E.StyleSheetRule, {
833
- id: c,
834
- removes: [{ index: u }]
835
- })));
836
- });
837
- }));
838
- }
839
- return { stop: () => {
840
- o.forEach((s) => s.stop());
841
- } };
842
- }
843
- function X(e) {
844
- const t = [];
845
- let n = e;
846
- for (; n.parentRule; ) {
847
- const i = Array.from(n.parentRule.cssRules).indexOf(n);
848
- t.unshift(i), n = n.parentRule;
849
- }
850
- if (!n.parentStyleSheet) return;
851
- const o = Array.from(n.parentStyleSheet.cssRules).indexOf(n);
852
- return t.unshift(o), t;
853
- }
854
- function Jt(e) {
855
- return C(window, [S.FOCUS, S.BLUR], () => {
856
- e({
857
- data: { has_focus: document.hasFocus() },
858
- type: T.Focus,
859
- timestamp: y()
860
- });
861
- });
862
- }
863
- function jt(e, t, n) {
864
- const o = e.subscribe(R.VIEW_ENDED, () => {
865
- n(), t({
866
- timestamp: y(),
867
- type: T.ViewEnd
868
- });
869
- });
870
- return { stop: () => {
871
- o.unsubscribe();
872
- } };
873
- }
874
- function pe(e, t, n) {
875
- const o = n.configuration.defaultPrivacyLevel, i = /* @__PURE__ */ new WeakMap(), s = e !== document, { stop: r } = C(e, s ? [S.CHANGE] : [S.INPUT, S.CHANGE], (d) => {
876
- const l = _(d);
877
- (l instanceof HTMLInputElement || l instanceof HTMLTextAreaElement || l instanceof HTMLSelectElement) && c(l);
878
- }, {
879
- capture: !0,
880
- passive: !0
881
- });
882
- let a;
883
- if (s)
884
- a = N;
885
- else {
886
- const d = [
887
- M(HTMLInputElement.prototype, "value", c),
888
- M(HTMLInputElement.prototype, "checked", c),
889
- M(HTMLSelectElement.prototype, "value", c),
890
- M(HTMLTextAreaElement.prototype, "value", c),
891
- M(HTMLSelectElement.prototype, "selectedIndex", c)
892
- ];
893
- a = () => {
894
- d.forEach((l) => l.stop());
895
- };
896
- }
897
- return { stop: () => {
898
- a(), r();
899
- } };
900
- function c(d) {
901
- const l = v(d, o);
902
- if (l === g.HIDDEN) return;
903
- const f = d.type;
904
- let p;
905
- if (f === "radio" || f === "checkbox") {
906
- if (A(d, l)) return;
907
- p = { isChecked: d.checked };
908
- } else {
909
- const w = P(d, l);
910
- if (w === void 0) return;
911
- p = { text: w };
912
- }
913
- u(d, p);
914
- const b = d.name;
915
- f === "radio" && b && d.checked && document.querySelectorAll(`input[type="radio"][name="${CSS.escape(b)}"]`).forEach((w) => {
916
- w !== d && u(w, { isChecked: !1 });
917
- });
918
- }
919
- function u(d, l) {
920
- const f = n.nodeIds.get(d);
921
- if (f === void 0) return;
922
- const p = i.get(d);
923
- (!p || p.text !== l.text || p.isChecked !== l.isChecked) && (i.set(d, l), t(I(E.Input, {
924
- id: f,
925
- ...l
926
- })));
927
- }
928
- }
929
- const Zt = 100;
930
- function qt(e) {
931
- let t = N, n = [];
932
- function o() {
933
- t(), e(n), n = [];
934
- }
935
- const { throttled: i, cancel: s } = O(o, 16, { leading: !1 });
936
- return {
937
- addMutations: (r) => {
938
- n.length === 0 && (t = _e(i, { timeout: Zt }));
939
- for (const a of r) n.push(a);
940
- },
941
- flush: o,
942
- stop: () => {
943
- t(), s();
944
- }
945
- };
946
- }
947
- function he(e, t, n, o) {
948
- const i = xe();
949
- if (!i) return {
950
- stop: N,
951
- flush: N
952
- };
953
- const s = qt((a) => {
954
- vt(y(), a.concat(r.takeRecords()), t, n, o);
955
- }), r = new i(Ae(s.addMutations));
956
- return r.observe(e, {
957
- attributeOldValue: !0,
958
- attributes: !0,
959
- characterData: !0,
960
- characterDataOldValue: !0,
961
- childList: !0,
962
- subtree: !0
963
- }), {
964
- stop: () => {
965
- r.disconnect(), s.stop();
966
- },
967
- flush: () => {
968
- s.flush();
969
- }
970
- };
971
- }
972
- const Qt = (e, t) => {
973
- const n = /* @__PURE__ */ new Map();
974
- return {
975
- addShadowRoot: (o, i) => {
976
- if (n.has(o)) return;
977
- const s = he(o, e, t, i), r = pe(o, e, i), a = fe(o, e, i);
978
- n.set(o, {
979
- flush: () => s.flush(),
980
- stop: () => {
981
- s.stop(), r.stop(), a.stop();
982
- }
983
- });
984
- },
985
- removeShadowRoot: (o) => {
986
- const i = n.get(o);
987
- i && (i.stop(), n.delete(o));
988
- },
989
- stop: () => {
990
- n.forEach(({ stop: o }) => o());
991
- },
992
- flush: () => {
993
- n.forEach(({ flush: o }) => o());
994
- }
995
- };
996
- };
997
- function en(e) {
998
- const { emitRecord: t, emitStats: n, configuration: o, lifeCycle: i } = e;
999
- if (!t || !n) throw new Error("emit functions are required");
1000
- const s = (f) => {
1001
- t(f), De("record", { record: f }), Oe(e.viewHistory.findView().id);
1002
- }, r = Qt(s, n), a = zt(o, Ut(), r), { stop: c } = Dt(i, s, n, u, a);
1003
- function u() {
1004
- r.flush(), d.flush();
1005
- }
1006
- const d = he(document, s, n, a), l = [
1007
- d,
1008
- Ft(s, a),
1009
- Bt(s, a),
1010
- fe(document, s, a),
1011
- Xt(s),
1012
- pe(document, s, a),
1013
- Wt(s, a),
1014
- Kt(s, a),
1015
- Jt(s),
1016
- $t(s),
1017
- jt(i, s, u)
1018
- ];
1019
- return {
1020
- stop: () => {
1021
- r.stop(), l.forEach((f) => f.stop()), c();
1022
- },
1023
- flushMutations: u,
1024
- shadowRootsController: r
1025
- };
1026
- }
1027
- function tn(e, t, n, o) {
1028
- const i = new FormData();
1029
- i.append("segment", new Blob([e], { type: "application/octet-stream" }), `${t.session.id}-${t.start}`);
1030
- const s = {
1031
- raw_segment_size: o,
1032
- compressed_segment_size: e.byteLength,
1033
- ...t
1034
- }, r = JSON.stringify(s);
1035
- return i.append("event", new Blob([r], { type: "application/json" })), {
1036
- data: i,
1037
- bytesCount: e.byteLength,
1038
- cssText: n.cssText,
1039
- isFullSnapshot: t.index_in_view === 0,
1040
- rawSize: o,
1041
- recordCount: t.records_count,
1042
- serializationDuration: n.serializationDuration
1043
- };
1044
- }
1045
- function nn({ context: e, creationReason: t, encoder: n }) {
1046
- let o = 0;
1047
- const i = e.view.id, s = {
1048
- start: 1 / 0,
1049
- end: -1 / 0,
1050
- creation_reason: t,
1051
- records_count: 0,
1052
- has_full_snapshot: !1,
1053
- index_in_view: Le(i),
1054
- source: "browser",
1055
- ...e
1056
- }, r = ee();
1057
- Pe(i);
1058
- function a(d, l) {
1059
- s.start = Math.min(s.start, d.timestamp), s.end = Math.max(s.end, d.timestamp), s.records_count += 1, s.has_full_snapshot ||= d.type === T.FullSnapshot || d.type === T.Change && s.index_in_view === 0;
1060
- const f = n.isEmpty ? '{"records":[' : ",";
1061
- n.write(f + JSON.stringify(d), (p) => {
1062
- o += p, l(o);
1063
- });
1064
- }
1065
- function c(d) {
1066
- et(r, d);
1067
- }
1068
- function u(d) {
1069
- if (n.isEmpty) throw new Error("Empty segment flushed");
1070
- n.write(`],${JSON.stringify(s).slice(1)}
1071
- `), n.finish((l) => {
1072
- ke(s.view.id, l.rawBytesCount), d(s, r, l);
1073
- });
1074
- }
1075
- return {
1076
- addRecord: a,
1077
- addStats: c,
1078
- flush: u
1079
- };
1080
- }
1081
- const on = 5 * He;
1082
- let Se = 6e4;
1083
- function sn(e, t, n, o, i, s) {
1084
- return rn(e, () => an(t.applicationId, n, o), i, s);
1085
- }
1086
- function rn(e, t, n, o) {
1087
- let i = {
1088
- status: 0,
1089
- nextSegmentCreationReason: "init"
1090
- };
1091
- const { unsubscribe: s } = e.subscribe(R.VIEW_CREATED, () => {
1092
- a("view_change");
1093
- }), { unsubscribe: r } = e.subscribe(R.PAGE_MAY_EXIT, (c) => {
1094
- a(c.reason);
1095
- });
1096
- function a(c) {
1097
- i.status === 1 && (i.segment.flush((u, d, l) => {
1098
- const f = tn(l.output, u, d, l.rawBytesCount);
1099
- Ve(c) ? n.sendOnExit(f) : n.send(f);
1100
- }), ze(i.expirationTimeoutId)), c !== "stop" ? i = {
1101
- status: 0,
1102
- nextSegmentCreationReason: c
1103
- } : i = { status: 2 };
1104
- }
1105
- return {
1106
- addRecord: (c) => {
1107
- if (i.status !== 2) {
1108
- if (i.status === 0) {
1109
- const u = t();
1110
- if (!u) return;
1111
- i = {
1112
- status: 1,
1113
- segment: nn({
1114
- encoder: o,
1115
- context: u,
1116
- creationReason: i.nextSegmentCreationReason
1117
- }),
1118
- expirationTimeoutId: Ue(() => {
1119
- a("segment_duration_limit");
1120
- }, on)
1121
- };
1122
- }
1123
- i.segment.addRecord(c, (u) => {
1124
- u > Se && a("segment_bytes_limit");
1125
- });
1126
- }
1127
- },
1128
- addStats: (c) => {
1129
- i.status === 1 && i.segment.addStats(c);
1130
- },
1131
- stop: () => {
1132
- a("stop"), s(), r();
1133
- }
1134
- };
1135
- }
1136
- function an(e, t, n) {
1137
- const o = t.findTrackedSession(), i = n.findView();
1138
- if (!(!o || !i))
1139
- return {
1140
- application: { id: e },
1141
- session: { id: o.id },
1142
- view: { id: i.id }
1143
- };
1144
- }
1145
- function cn(e, t) {
1146
- if (!e.metricsEnabled) return { stop: N };
1147
- const { unsubscribe: n } = t.subscribe((o) => {
1148
- if (o.type === "failure" || o.type === "queue-full" || o.type === "success" && o.payload.isFullSnapshot) {
1149
- const i = un(o.type, o.bandwidth, o.payload);
1150
- Fe(Be.SEGMENT_METRICS_TELEMETRY_NAME, { metrics: i });
1151
- }
1152
- });
1153
- return { stop: n };
1154
- }
1155
- function un(e, t, n) {
1156
- return {
1157
- cssText: {
1158
- count: n.cssText.count,
1159
- max: n.cssText.max,
1160
- sum: n.cssText.sum
1161
- },
1162
- encoding: {
1163
- fullSnapshot: "change",
1164
- incrementalSnapshot: "change"
1165
- },
1166
- isFullSnapshot: n.isFullSnapshot,
1167
- ongoingRequests: {
1168
- count: t.ongoingRequestCount,
1169
- totalSize: t.ongoingByteCount
1170
- },
1171
- recordCount: n.recordCount,
1172
- result: e,
1173
- serializationDuration: {
1174
- count: n.serializationDuration.count,
1175
- max: n.serializationDuration.max,
1176
- sum: n.serializationDuration.sum
1177
- },
1178
- size: {
1179
- compressed: n.bytesCount,
1180
- raw: n.rawSize
1181
- }
1182
- };
1183
- }
1184
- function dn(e) {
1185
- const t = Ge();
1186
- return { addRecord: (n) => {
1187
- const o = e.findView();
1188
- t.send("record", n, o.id);
1189
- } };
1190
- }
1191
- function fn(e, t, n, o, i, s, r) {
1192
- const a = [], c = (p) => {
1193
- e.notify(R.RAW_ERROR_COLLECTED, { error: p }), We("Error reported to customer", { "error.message": p.message });
1194
- }, u = r || Xe([$e(t, "replay")], c, Se);
1195
- let d, l;
1196
- if (Ye())
1197
- ({ addRecord: d } = dn(o)), l = N;
1198
- else {
1199
- const p = sn(e, t, n, o, u, i);
1200
- d = p.addRecord, l = p.addStats, a.push(p.stop);
1201
- const b = cn(s, u.observable);
1202
- a.push(b.stop);
1203
- }
1204
- const { stop: f } = en({
1205
- emitRecord: d,
1206
- emitStats: l,
1207
- configuration: t,
1208
- lifeCycle: e,
1209
- viewHistory: o
1210
- });
1211
- return a.push(f), { stop: () => {
1212
- a.forEach((p) => p());
1213
- } };
1214
- }
1215
- export {
1216
- fn as startRecording
1217
- };
1218
- //# sourceMappingURL=datadogRecorder-CexR-8pQ.js.map