@jumio/websdk 0.4.0 → 0.6.0

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 (114) hide show
  1. package/assets/icons/add.svg +3 -0
  2. package/assets/icons/bra-id.svg +4 -0
  3. package/assets/icons/camera-number-placeholder.svg +3 -0
  4. package/assets/icons/camera-video.svg +4 -0
  5. package/assets/icons/check.svg +3 -0
  6. package/assets/icons/chevron-direction-down.svg +3 -0
  7. package/assets/icons/chevron-direction-left.svg +3 -0
  8. package/assets/icons/chevron-direction-right.svg +3 -0
  9. package/assets/icons/close.svg +3 -0
  10. package/assets/icons/collapse.svg +3 -0
  11. package/assets/icons/delete.svg +3 -0
  12. package/assets/icons/device.svg +3 -0
  13. package/assets/icons/digital-id.svg +4 -0
  14. package/assets/icons/download.svg +3 -0
  15. package/assets/icons/exclamation-mark.svg +3 -0
  16. package/assets/icons/expand.svg +3 -0
  17. package/assets/icons/external.svg +3 -0
  18. package/assets/icons/globe.svg +3 -0
  19. package/assets/icons/help.svg +3 -0
  20. package/assets/icons/ic-method-camera.svg +4 -0
  21. package/assets/icons/id-back.svg +3 -0
  22. package/assets/icons/id-digital.svg +4 -0
  23. package/assets/icons/id-document.svg +3 -0
  24. package/assets/icons/id-drivers-license.svg +3 -0
  25. package/assets/icons/id-front.svg +3 -0
  26. package/assets/icons/id-passport.svg +9 -0
  27. package/assets/icons/id-work-visa.svg +4 -0
  28. package/assets/icons/jumio.svg +4 -0
  29. package/assets/icons/schedule.svg +3 -0
  30. package/assets/icons/shield.svg +3 -0
  31. package/assets/icons/upload-method.svg +3 -0
  32. package/assets/icons/upload.svg +3 -0
  33. package/assets/icons/visibility-off.svg +3 -0
  34. package/assets/icons/visibility.svg +3 -0
  35. package/assets/ml/assets_da_web_id.tar.gz +0 -0
  36. package/assets/ml/assets_da_web_liveness.tar.gz +0 -0
  37. package/assets/ml/dac.wasm +0 -0
  38. package/assets/ml/dac_simd.wasm +0 -0
  39. package/assets/style.css +1 -1
  40. package/index.html +1 -3
  41. package/index.js +1 -1
  42. package/index2.d.ts +1053 -130
  43. package/index2.js +861 -843
  44. package/js/assets_da_web_id_1_1_6.tar.B0wlC5WP.js +5 -0
  45. package/js/assets_da_web_liveness_1_1_6.tar.BMW6psZZ.js +5 -0
  46. package/js/dd/datadogProfiler-P8U8zq4E.js +408 -0
  47. package/js/dd/datadogRecorder-DZ9J4YQm.js +1218 -0
  48. package/js/i18n/{ar.DkrHFf0z.js → ar.CJ5f0MbK.js} +11 -3
  49. package/js/i18n/{az.BSkQXnwx.js → az.DDh3x_FF.js} +11 -3
  50. package/js/i18n/{bg.x6rcaPaK.js → bg.BUrg34tD.js} +11 -3
  51. package/js/i18n/{bn.DGFK9qJh.js → bn.C9Cvu33l.js} +11 -3
  52. package/js/i18n/{ca.mdNlHU-j.js → ca.BN8pRbii.js} +11 -3
  53. package/js/i18n/{ceb.BhF6mxA1.js → ceb.D1GAcQG1.js} +11 -3
  54. package/js/i18n/{cs.DCAPAQob.js → cs.DqM7YsXT.js} +11 -3
  55. package/js/i18n/{da.Bk_Vdzce.js → da.Bb_asJdt.js} +11 -3
  56. package/js/i18n/{de.Bpox16Tb.js → de.pMzo4HpF.js} +11 -3
  57. package/js/i18n/{el.DYnJoGSo.js → el.vsvsn980.js} +11 -3
  58. package/js/i18n/{en.Cdq06XXI.js → en.CpGcRLUP.js} +12 -4
  59. package/js/i18n/{en_GB.D6Y3GVH3.js → en_GB.CuRoI-ag.js} +12 -4
  60. package/js/i18n/{es.DfLJlARH.js → es.C45KgGLF.js} +11 -3
  61. package/js/i18n/{es_MX.DHwOkPFx.js → es_MX.BXsMZlGL.js} +11 -3
  62. package/js/i18n/{et.tVyYfTGa.js → et.CW7A5O5g.js} +11 -3
  63. package/js/i18n/{fi.CUb9um3q.js → fi.CkcFeDYr.js} +11 -3
  64. package/js/i18n/{fil.Bz5mS-t3.js → fil.C44c-WvM.js} +11 -3
  65. package/js/i18n/{fr.BDS-SRLF.js → fr.DrHWHQSB.js} +11 -3
  66. package/js/i18n/{fr_CA.BaMhXjza.js → fr_CA.BrRknP4P.js} +11 -3
  67. package/js/i18n/{ga.Cz17Jrc0.js → ga.CXCo-gow.js} +11 -3
  68. package/js/i18n/{he.Vk5TYTE0.js → he.w55E5DbW.js} +11 -3
  69. package/js/i18n/{hi.Bfjbt1hl.js → hi.CFryETDm.js} +11 -3
  70. package/js/i18n/{hr.CgRnuGgn.js → hr.Bkon4j6k.js} +11 -3
  71. package/js/i18n/{hu.rj4FulFy.js → hu.DvJpJWLH.js} +11 -3
  72. package/js/i18n/{hy.rK2i4OKY.js → hy.D4MCccPX.js} +11 -3
  73. package/js/i18n/{id.1174iI3U.js → id.O49txROs.js} +11 -3
  74. package/js/i18n/{is.BStEjEbG.js → is.4-D8oYt4.js} +11 -3
  75. package/js/i18n/{it.ByzrS6GF.js → it.CoOeyRd7.js} +11 -3
  76. package/js/i18n/{ja.PP3gCv3l.js → ja.C3o8YGyb.js} +11 -3
  77. package/js/i18n/{jv.CzzgZPMq.js → jv.C5eKltSo.js} +11 -3
  78. package/js/i18n/{ka_GE.DAYqZQqk.js → ka_GE.B7jUBJSI.js} +11 -3
  79. package/js/i18n/{kk.8BoMixSA.js → kk.DaYPv7kS.js} +11 -3
  80. package/js/i18n/{km_KH.l8EDtWHo.js → km_KH.BFWTDYTj.js} +11 -3
  81. package/js/i18n/{ko.D0qgK5UW.js → ko.CDCmsS7K.js} +11 -3
  82. package/js/i18n/{lt.Twbcs4Em.js → lt.cWqB7TbU.js} +11 -3
  83. package/js/i18n/{lv.D7ezMwVc.js → lv.Tr0qUXv8.js} +15 -7
  84. package/js/i18n/{ms.CJZG8Ll1.js → ms.CwDHHUnC.js} +11 -3
  85. package/js/i18n/{my.DQjNSwr3.js → my.DgCbecbm.js} +11 -3
  86. package/js/i18n/{nl.B6sQUXuN.js → nl.rwprkZNn.js} +11 -3
  87. package/js/i18n/{no.B55mMOOq.js → no.Cq7NZb45.js} +11 -3
  88. package/js/i18n/{pl.B2put9DP.js → pl.DRHC-qD2.js} +11 -3
  89. package/js/i18n/{pt.B7PxU_IO.js → pt.pdIrMleR.js} +15 -7
  90. package/js/i18n/{pt_BR.BKqqa1pH.js → pt_BR.B7E_lBYV.js} +11 -3
  91. package/js/i18n/{ro.N89dgSUQ.js → ro.TwikY-Eu.js} +11 -3
  92. package/js/i18n/{ru.1PNbIwxj.js → ru.C57ucjDU.js} +11 -3
  93. package/js/i18n/{sk.B411Twgh.js → sk.BF80m0zE.js} +11 -3
  94. package/js/i18n/{sl.BPBaO-Zp.js → sl.DCrKLmRM.js} +11 -3
  95. package/js/i18n/{sq.Cq5lOBqt.js → sq.BPNNJ-V0.js} +11 -3
  96. package/js/i18n/{sr_Cyrl.9BeOe20j.js → sr_Cyrl.C2n9ECio.js} +11 -3
  97. package/js/i18n/{sr_Latn.C2U3IPYN.js → sr_Latn.Css4vgq8.js} +11 -3
  98. package/js/i18n/{sv.l5wQhwi_.js → sv.DoJqy2ZF.js} +11 -3
  99. package/js/i18n/{sw.CsifT5Cq.js → sw.C2Vc-khP.js} +11 -3
  100. package/js/i18n/{th.BP234sbB.js → th.D3IdUlLq.js} +11 -3
  101. package/js/i18n/{tr.CInDz9Jd.js → tr.BsXleD8A.js} +11 -3
  102. package/js/i18n/{uk.hNjFGYJm.js → uk.Dt-xSQPx.js} +11 -3
  103. package/js/i18n/{ur.D60gDBWS.js → ur.dXgVPzpk.js} +11 -3
  104. package/js/i18n/{uz.Cx7fveDe.js → uz.DoIJtzOq.js} +11 -3
  105. package/js/i18n/{vi.2DYOwV8T.js → vi.BeiSxuGI.js} +11 -3
  106. package/js/i18n/{zh_CN.Cj8T_5mA.js → zh_CN.C6x4ojAS.js} +11 -3
  107. package/js/i18n/{zh_HK.CUqb_GDk.js → zh_HK.BFHGwm_b.js} +11 -3
  108. package/js/{index.BI4tfquX.js → index.DD1XWd33.js} +28050 -26846
  109. package/package.json +12 -4
  110. package/third-party-licenses.txt +45 -25
  111. package/assets/ml/assets_da_web.tar.gz +0 -0
  112. package/js/assets_da_web_1_1_6.tar.DJoLQbzK.js +0 -5
  113. package/js/dd/profiler-BFqIgQQx.js +0 -235
  114. package/js/dd/startRecording-DtvE5Wi2.js +0 -1494
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "start": "npx serve"
5
5
  },
6
6
  "name": "@jumio/websdk",
7
- "version": "0.4.0",
7
+ "version": "0.6.0",
8
8
  "license": "UNLICENSED",
9
9
  "author": "Jumio Corporation",
10
10
  "website": "https://www.jumio.com",
@@ -62,9 +62,17 @@
62
62
  "import": "./assets/*.webp",
63
63
  "default": "./assets/*.webp"
64
64
  },
65
- "./ml/assets_da_web.tar.gz": {
66
- "import": "./assets/ml/assets_da_web.tar.gz",
67
- "default": "./assets/ml/assets_da_web.tar.gz"
65
+ "./assets/icons/*.svg": {
66
+ "import": "./assets/icons/*.svg",
67
+ "default": "./assets/icons/*.svg"
68
+ },
69
+ "./ml/assets_da_web_id.tar.gz": {
70
+ "import": "./assets/ml/assets_da_web_id.tar.gz",
71
+ "default": "./assets/ml/assets_da_web_id.tar.gz"
72
+ },
73
+ "./ml/assets_da_web_liveness.tar.gz": {
74
+ "import": "./assets/ml/assets_da_web_liveness.tar.gz",
75
+ "default": "./assets/ml/assets_da_web_liveness.tar.gz"
68
76
  },
69
77
  "./ml/dac.wasm": {
70
78
  "import": "./assets/ml/dac.wasm",
@@ -188,9 +188,10 @@ Apache License
188
188
 
189
189
  The following npm packages may be included in this product:
190
190
 
191
- - @datadog/browser-core@6.27.1
192
- - @datadog/browser-rum-core@6.27.1
193
- - @datadog/browser-rum@6.27.1
191
+ - @datadog/browser-core@7.4.0
192
+ - @datadog/browser-rum-core@7.4.0
193
+ - @datadog/browser-rum@7.4.0
194
+ - @datadog/js-core@0.0.4
194
195
 
195
196
  These packages each contain the following license:
196
197
 
@@ -497,7 +498,7 @@ THE SOFTWARE.
497
498
 
498
499
  The following npm package may be included in this product:
499
500
 
500
- - pako@2.1.0
501
+ - pako@2.2.0
501
502
 
502
503
  This package contains the following license:
503
504
 
@@ -940,7 +941,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
940
941
 
941
942
  The following npm package may be included in this product:
942
943
 
943
- - minimatch@10.2.2
944
+ - minimatch@10.2.5
944
945
 
945
946
  This package contains the following license:
946
947
 
@@ -1004,7 +1005,7 @@ software or this license, under any kind of legal claim._**
1004
1005
 
1005
1006
  The following npm package may be included in this product:
1006
1007
 
1007
- - ua-parser-js@2.0.9
1008
+ - ua-parser-js@2.0.10
1008
1009
 
1009
1010
  This package contains the following license:
1010
1011
 
@@ -2120,7 +2121,7 @@ Maintainer: James C. (Jamie) Davis @davisjam
2120
2121
  The following npm packages may be included in this product:
2121
2122
 
2122
2123
  - enhanced-resolve@5.18.3
2123
- - enhanced-resolve@5.19.0
2124
+ - enhanced-resolve@5.22.1
2124
2125
 
2125
2126
  These packages each contain the following license:
2126
2127
 
@@ -2178,7 +2179,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2178
2179
 
2179
2180
  The following npm package may be included in this product:
2180
2181
 
2181
- - lodash-es@4.17.23
2182
+ - lodash-es@4.18.1
2182
2183
 
2183
2184
  This package contains the following license:
2184
2185
 
@@ -2326,7 +2327,7 @@ SOFTWARE.
2326
2327
  The following npm packages may be included in this product:
2327
2328
 
2328
2329
  - acorn-loose@8.5.2
2329
- - acorn-walk@8.3.4
2330
+ - acorn-walk@8.3.5
2330
2331
 
2331
2332
  These packages each contain the following license:
2332
2333
 
@@ -2573,13 +2574,13 @@ SOFTWARE.
2573
2574
 
2574
2575
  The following npm packages may be included in this product:
2575
2576
 
2576
- - @otplib/core@13.4.0
2577
- - @otplib/hotp@13.4.0
2578
- - @otplib/plugin-base32-scure@13.4.0
2579
- - @otplib/plugin-crypto-noble@13.4.0
2580
- - @otplib/totp@13.4.0
2581
- - @otplib/uri@13.4.0
2582
- - otplib@13.4.0
2577
+ - @otplib/core@13.4.1
2578
+ - @otplib/hotp@13.4.1
2579
+ - @otplib/plugin-base32-scure@13.4.1
2580
+ - @otplib/plugin-crypto-noble@13.4.1
2581
+ - @otplib/totp@13.4.1
2582
+ - @otplib/uri@13.4.1
2583
+ - otplib@13.4.1
2583
2584
 
2584
2585
  These packages each contain the following license:
2585
2586
 
@@ -2724,7 +2725,7 @@ THE SOFTWARE.
2724
2725
 
2725
2726
  The following npm package may be included in this product:
2726
2727
 
2727
- - brace-expansion@5.0.2
2728
+ - brace-expansion@5.0.6
2728
2729
 
2729
2730
  This package contains the following license:
2730
2731
 
@@ -2810,7 +2811,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2810
2811
  The following npm packages may be included in this product:
2811
2812
 
2812
2813
  - ini@4.1.1
2813
- - semver@7.7.4
2814
+ - semver@7.8.1
2814
2815
 
2815
2816
  These packages each contain the following license:
2816
2817
 
@@ -2864,11 +2865,12 @@ THE SOFTWARE.
2864
2865
 
2865
2866
  -----------
2866
2867
 
2867
- The following npm package may be included in this product:
2868
+ The following npm packages may be included in this product:
2868
2869
 
2869
2870
  - tapable@2.3.0
2871
+ - tapable@2.3.3
2870
2872
 
2871
- This package contains the following license:
2873
+ These packages each contain the following license:
2872
2874
 
2873
2875
  The MIT License
2874
2876
 
@@ -2894,6 +2896,24 @@ THE SOFTWARE.
2894
2896
 
2895
2897
  -----------
2896
2898
 
2899
+ The following npm package may be included in this product:
2900
+
2901
+ - uuid@14.0.1
2902
+
2903
+ This package contains the following license:
2904
+
2905
+ The MIT License (MIT)
2906
+
2907
+ Copyright (c) 2010-2020 Robert Kieffer and other contributors
2908
+
2909
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2910
+
2911
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2912
+
2913
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2914
+
2915
+ -----------
2916
+
2897
2917
  The following npm package may be included in this product:
2898
2918
 
2899
2919
  - require-directory@2.1.1
@@ -3065,7 +3085,7 @@ SOFTWARE.
3065
3085
 
3066
3086
  The following npm package may be included in this product:
3067
3087
 
3068
- - xstate@5.28.0
3088
+ - xstate@5.32.2
3069
3089
 
3070
3090
  This package contains the following license:
3071
3091
 
@@ -3186,7 +3206,7 @@ SOFTWARE.
3186
3206
 
3187
3207
  The following npm package may be included in this product:
3188
3208
 
3189
- - dependency-cruiser@17.3.8
3209
+ - dependency-cruiser@17.4.3
3190
3210
 
3191
3211
  This package contains the following license:
3192
3212
 
@@ -3216,7 +3236,7 @@ SOFTWARE.
3216
3236
 
3217
3237
  The following npm package may be included in this product:
3218
3238
 
3219
- - picomatch@4.0.3
3239
+ - picomatch@4.0.4
3220
3240
 
3221
3241
  This package contains the following license:
3222
3242
 
@@ -3366,7 +3386,7 @@ THE SOFTWARE.
3366
3386
 
3367
3387
  The following npm package may be included in this product:
3368
3388
 
3369
- - watskeburt@5.0.2
3389
+ - watskeburt@5.0.3
3370
3390
 
3371
3391
  This package contains the following license:
3372
3392
 
@@ -3519,7 +3539,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3519
3539
 
3520
3540
  The following npm package may be included in this product:
3521
3541
 
3522
- - @jumio/da-system@6.0.4
3542
+ - @jumio/da-system@6.0.9-SNAPSHOT.1783390529104
3523
3543
 
3524
3544
  This package contains the following license:
3525
3545
 
Binary file
@@ -1,5 +0,0 @@
1
- const s = "" + new URL("../assets/ml/assets_da_web.tar.gz", import.meta.url).href;
2
- export {
3
- s as default
4
- };
5
- //# sourceMappingURL=assets_da_web_1_1_6.tar.DJoLQbzK.js.map
@@ -1,235 +0,0 @@
1
- import { c as H, j as D, o as x, a as C, b as q, d as G, e as _, g as X, f as J, s as K, h as N, i as Q, k as W, l as Y, m as Z } from "../index.BI4tfquX.js";
2
- function $(e, s, o, i) {
3
- const p = (a) => {
4
- s.notify(14, { error: a }), C("Error reported to customer", { "error.message": a.message });
5
- }, d = H([e.profilingEndpointBuilder], p), c = o(i);
6
- return {
7
- async send({ event: a, ...E }) {
8
- const f = new FormData(), m = D(a);
9
- if (!m)
10
- throw new Error("Failed to serialize event");
11
- f.append("event", new Blob([m], { type: "application/json" }), "event.json");
12
- let n = m.length;
13
- for (const [v, k] of x(E)) {
14
- const w = D(k);
15
- if (!w)
16
- throw new Error("Failed to serialize attachment");
17
- const g = await ee(c, w);
18
- n += g.outputBytesCount, f.append(v, new Blob([g.output]), v);
19
- }
20
- d.send({
21
- data: f,
22
- bytesCount: n
23
- });
24
- }
25
- };
26
- }
27
- function ee(e, s) {
28
- return new Promise((o) => {
29
- e.write(s), e.finish((i) => {
30
- o(i);
31
- });
32
- });
33
- }
34
- function te(e) {
35
- let s = 0;
36
- for (const o of e)
37
- o.stackId !== void 0 && s++;
38
- return s;
39
- }
40
- const se = /\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g;
41
- function ne(e) {
42
- return e ? e.replace(se, "/?") : "/";
43
- }
44
- const O = (e, s) => e || ne(s);
45
- function re(e, s, o) {
46
- const { ids: i, names: p } = oe(e.views), d = e.longTasks.map((a) => a.id).filter((a) => a !== void 0), c = { application: { id: s } };
47
- return o && (c.session = { id: o }), i.length && (c.view = { id: i, name: p }), d.length && (c.long_task = { id: d }), c;
48
- }
49
- function oe(e) {
50
- const s = { ids: [], names: [] };
51
- for (const o of e)
52
- s.ids.push(o.viewId), o.viewName && s.names.push(o.viewName);
53
- return s.names = Array.from(new Set(s.names)), s;
54
- }
55
- function ae(e, s, o) {
56
- return {
57
- event: ie(e, s, o),
58
- "wall-time.json": e
59
- };
60
- }
61
- function ie(e, s, o) {
62
- const i = q(s), p = re(e, s.applicationId, o), d = le(i);
63
- return {
64
- ...p,
65
- attachments: ["wall-time.json"],
66
- start: new Date(e.startClocks.timeStamp).toISOString(),
67
- end: new Date(e.endClocks.timeStamp).toISOString(),
68
- family: "chrome",
69
- runtime: "chrome",
70
- format: "json",
71
- version: 4,
72
- // Ingestion event version (not the version application tag)
73
- tags_profiler: d.join(","),
74
- _dd: {
75
- clock_drift: G()
76
- }
77
- };
78
- }
79
- function le(e) {
80
- return e.concat(["language:javascript", "runtime:chrome", "family:chrome", "host:browser"]);
81
- }
82
- const ue = {
83
- sampleIntervalMs: 10,
84
- // Sample stack trace every 10ms
85
- collectIntervalMs: 6e4,
86
- // Collect data every minute
87
- minProfileDurationMs: 5e3,
88
- // Require at least 5 seconds of profile data to reduce noise and cost
89
- minNumberOfSamples: 50
90
- // Require at least 50 samples (~500 ms) to report a profile to reduce noise and cost
91
- };
92
- function de(e, s, o, i, p, d, c, a = ue) {
93
- const E = $(
94
- e,
95
- s,
96
- d,
97
- 6
98
- /* DeflateEncoderStreamId.PROFILING */
99
- );
100
- let f;
101
- const m = [];
102
- let n = { state: "stopped", stateReason: "initializing" };
103
- s.subscribe(9, () => {
104
- w("session-expired");
105
- }), s.subscribe(10, () => {
106
- n.state === "stopped" && n.stateReason === "session-expired" && v();
107
- });
108
- function v() {
109
- if (n.state === "running")
110
- return;
111
- const t = c.findView();
112
- f = t ? {
113
- startClocks: t.startClocks,
114
- viewId: t.id,
115
- viewName: O(t.name, document.location.pathname)
116
- } : void 0, m.push(_(e, window, "visibilitychange", A).stop, _(e, window, "beforeunload", B).stop), b();
117
- }
118
- function k() {
119
- w("stopped-by-user");
120
- }
121
- function w(t) {
122
- j(t), m.forEach((r) => r()), i.set({ status: "stopped", error_reason: void 0 });
123
- }
124
- function g(t) {
125
- if (t.state === "running")
126
- return {
127
- cleanupTasks: t.cleanupTasks
128
- };
129
- const r = [], u = s.subscribe(2, (l) => {
130
- const h = {
131
- viewId: l.id,
132
- // Note: `viewName` is only filled when users use manual view creation via `startView` method.
133
- viewName: O(l.name, document.location.pathname),
134
- startClocks: l.startClocks
135
- };
136
- y(h), f = h;
137
- });
138
- return r.push(u.unsubscribe), {
139
- cleanupTasks: r
140
- };
141
- }
142
- function b() {
143
- const t = X().Profiler;
144
- if (!t)
145
- throw i.set({ status: "error", error_reason: "not-supported-by-browser" }), new Error("RUM Profiler is not supported in this browser.");
146
- n.state === "running" && I(n);
147
- const { cleanupTasks: r } = g(n);
148
- let u;
149
- try {
150
- u = new t({
151
- sampleInterval: a.sampleIntervalMs,
152
- // Keep buffer size at 1.5 times of minimum required to collect data for a profiling instance
153
- maxBufferSize: Math.round(a.collectIntervalMs * 1.5 / a.sampleIntervalMs)
154
- });
155
- } catch (l) {
156
- l instanceof Error && l.message.includes("disabled by Document Policy") ? (J.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.", l), i.set({ status: "error", error_reason: "missing-document-policy-header" })) : i.set({ status: "error", error_reason: "unexpected-exception" });
157
- return;
158
- }
159
- i.set({ status: "running", error_reason: void 0 }), n = {
160
- state: "running",
161
- startClocks: N(),
162
- profiler: u,
163
- timeoutId: K(b, a.collectIntervalMs),
164
- views: [],
165
- cleanupTasks: r,
166
- longTasks: []
167
- }, y(f), u.addEventListener("samplebufferfull", T);
168
- }
169
- function I(t) {
170
- Q(t.timeoutId), t.profiler.removeEventListener("samplebufferfull", T);
171
- const { startClocks: r, views: u } = t;
172
- t.profiler.stop().then((l) => {
173
- const h = N(), P = W(r.timeStamp, h.timeStamp), S = p.findLongTasks(r.relative, P), U = P < a.minProfileDurationMs, z = te(l.samples) < a.minNumberOfSamples;
174
- S.length === 0 && (U || z) || R(
175
- // Enrich trace with time and instance data
176
- Object.assign(l, {
177
- startClocks: r,
178
- endClocks: h,
179
- clocksOrigin: Y(),
180
- longTasks: S,
181
- views: u,
182
- sampleInterval: a.sampleIntervalMs
183
- })
184
- );
185
- }).catch(Z);
186
- }
187
- function j(t) {
188
- if (n.state === "paused") {
189
- n = { state: "stopped", stateReason: t };
190
- return;
191
- }
192
- if (n.state !== "running")
193
- return;
194
- const r = n;
195
- n = { state: "stopped", stateReason: t }, r.cleanupTasks.forEach((u) => u()), I(r);
196
- }
197
- function M() {
198
- if (n.state !== "running")
199
- return;
200
- const t = n;
201
- n = { state: "paused" }, t.cleanupTasks.forEach((r) => r()), I(t);
202
- }
203
- function y(t) {
204
- n.state !== "running" || !t || n.views.push(t);
205
- }
206
- function R(t) {
207
- var r;
208
- const u = (r = o.findTrackedSession()) === null || r === void 0 ? void 0 : r.id, l = ae(t, e, u);
209
- E.send(l);
210
- }
211
- function T() {
212
- b();
213
- }
214
- function A() {
215
- document.visibilityState === "hidden" && n.state === "running" ? M() : document.visibilityState === "visible" && n.state === "paused" && b();
216
- }
217
- function B() {
218
- b();
219
- }
220
- function L() {
221
- return n.state === "stopped";
222
- }
223
- function V() {
224
- return n.state === "running";
225
- }
226
- function F() {
227
- return n.state === "paused";
228
- }
229
- return { start: v, stop: k, isStopped: L, isRunning: V, isPaused: F };
230
- }
231
- export {
232
- ue as DEFAULT_RUM_PROFILER_CONFIGURATION,
233
- de as createRumProfiler
234
- };
235
- //# sourceMappingURL=profiler-BFqIgQQx.js.map