@elenjical-ai/browser 0.0.0-stage → 10.76.2

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 (695) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -2
  3. package/build/npm/cjs/dev/client.js +77 -0
  4. package/build/npm/cjs/dev/client.js.map +1 -0
  5. package/build/npm/cjs/dev/debug-build.js +6 -0
  6. package/build/npm/cjs/dev/debug-build.js.map +1 -0
  7. package/build/npm/cjs/dev/diagnose-sdk.js +34 -0
  8. package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -0
  9. package/build/npm/cjs/dev/eventbuilder.js +231 -0
  10. package/build/npm/cjs/dev/eventbuilder.js.map +1 -0
  11. package/build/npm/cjs/dev/feedbackAsync.js +11 -0
  12. package/build/npm/cjs/dev/feedbackAsync.js.map +1 -0
  13. package/build/npm/cjs/dev/feedbackSync.js +11 -0
  14. package/build/npm/cjs/dev/feedbackSync.js.map +1 -0
  15. package/build/npm/cjs/dev/helpers.js +108 -0
  16. package/build/npm/cjs/dev/helpers.js.map +1 -0
  17. package/build/npm/cjs/dev/index.js +208 -0
  18. package/build/npm/cjs/dev/index.js.map +1 -0
  19. package/build/npm/cjs/dev/integrations/breadcrumbs.js +249 -0
  20. package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -0
  21. package/build/npm/cjs/dev/integrations/browserapierrors.js +167 -0
  22. package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -0
  23. package/build/npm/cjs/dev/integrations/browsersession.js +50 -0
  24. package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -0
  25. package/build/npm/cjs/dev/integrations/contextlines.js +53 -0
  26. package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -0
  27. package/build/npm/cjs/dev/integrations/culturecontext.js +50 -0
  28. package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -0
  29. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +8 -0
  30. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
  31. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +30 -0
  32. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  33. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +32 -0
  34. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
  35. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +23 -0
  36. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
  37. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +37 -0
  38. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
  39. package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js +60 -0
  40. package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js.map +1 -0
  41. package/build/npm/cjs/dev/integrations/globalhandlers.js +143 -0
  42. package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -0
  43. package/build/npm/cjs/dev/integrations/graphqlClient.js +148 -0
  44. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -0
  45. package/build/npm/cjs/dev/integrations/httpclient.js +250 -0
  46. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -0
  47. package/build/npm/cjs/dev/integrations/httpcontext.js +47 -0
  48. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -0
  49. package/build/npm/cjs/dev/integrations/linkederrors.js +31 -0
  50. package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -0
  51. package/build/npm/cjs/dev/integrations/reportingobserver.js +60 -0
  52. package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -0
  53. package/build/npm/cjs/dev/integrations/spanstreaming.js +49 -0
  54. package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -0
  55. package/build/npm/cjs/dev/integrations/spotlight.js +61 -0
  56. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -0
  57. package/build/npm/cjs/dev/integrations/view-hierarchy.js +74 -0
  58. package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -0
  59. package/build/npm/cjs/dev/integrations/webVitals.js +62 -0
  60. package/build/npm/cjs/dev/integrations/webVitals.js.map +1 -0
  61. package/build/npm/cjs/dev/integrations/webWorker.js +133 -0
  62. package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -0
  63. package/build/npm/cjs/dev/normalizeStringifyValue.js +27 -0
  64. package/build/npm/cjs/dev/normalizeStringifyValue.js.map +1 -0
  65. package/build/npm/cjs/dev/profiling/UIProfiler.js +306 -0
  66. package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -0
  67. package/build/npm/cjs/dev/profiling/index.js +38 -0
  68. package/build/npm/cjs/dev/profiling/index.js.map +1 -0
  69. package/build/npm/cjs/dev/profiling/integration.js +120 -0
  70. package/build/npm/cjs/dev/profiling/integration.js.map +1 -0
  71. package/build/npm/cjs/dev/profiling/startProfileForSpan.js +91 -0
  72. package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -0
  73. package/build/npm/cjs/dev/profiling/utils.js +498 -0
  74. package/build/npm/cjs/dev/profiling/utils.js.map +1 -0
  75. package/build/npm/cjs/dev/report-dialog.js +53 -0
  76. package/build/npm/cjs/dev/report-dialog.js.map +1 -0
  77. package/build/npm/cjs/dev/sdk.js +70 -0
  78. package/build/npm/cjs/dev/sdk.js.map +1 -0
  79. package/build/npm/cjs/dev/stack-parsers.js +118 -0
  80. package/build/npm/cjs/dev/stack-parsers.js.map +1 -0
  81. package/build/npm/cjs/dev/tracing/backgroundtab.js +34 -0
  82. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -0
  83. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +437 -0
  84. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -0
  85. package/build/npm/cjs/dev/tracing/linkedTraces.js +140 -0
  86. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -0
  87. package/build/npm/cjs/dev/tracing/reportPageLoaded.js +10 -0
  88. package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -0
  89. package/build/npm/cjs/dev/tracing/request.js +236 -0
  90. package/build/npm/cjs/dev/tracing/request.js.map +1 -0
  91. package/build/npm/cjs/dev/tracing/setActiveSpan.js +21 -0
  92. package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -0
  93. package/build/npm/cjs/dev/tracing/utils.js +31 -0
  94. package/build/npm/cjs/dev/tracing/utils.js.map +1 -0
  95. package/build/npm/cjs/dev/transports/fetch.js +58 -0
  96. package/build/npm/cjs/dev/transports/fetch.js.map +1 -0
  97. package/build/npm/cjs/dev/transports/offline.js +111 -0
  98. package/build/npm/cjs/dev/transports/offline.js.map +1 -0
  99. package/build/npm/cjs/dev/userfeedback.js +32 -0
  100. package/build/npm/cjs/dev/userfeedback.js.map +1 -0
  101. package/build/npm/cjs/dev/utils/detectBrowserExtension.js +38 -0
  102. package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -0
  103. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +92 -0
  104. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -0
  105. package/build/npm/cjs/prod/client.js +77 -0
  106. package/build/npm/cjs/prod/client.js.map +1 -0
  107. package/build/npm/cjs/prod/debug-build.js +6 -0
  108. package/build/npm/cjs/prod/debug-build.js.map +1 -0
  109. package/build/npm/cjs/prod/diagnose-sdk.js +34 -0
  110. package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -0
  111. package/build/npm/cjs/prod/eventbuilder.js +231 -0
  112. package/build/npm/cjs/prod/eventbuilder.js.map +1 -0
  113. package/build/npm/cjs/prod/feedbackAsync.js +11 -0
  114. package/build/npm/cjs/prod/feedbackAsync.js.map +1 -0
  115. package/build/npm/cjs/prod/feedbackSync.js +11 -0
  116. package/build/npm/cjs/prod/feedbackSync.js.map +1 -0
  117. package/build/npm/cjs/prod/helpers.js +108 -0
  118. package/build/npm/cjs/prod/helpers.js.map +1 -0
  119. package/build/npm/cjs/prod/index.js +208 -0
  120. package/build/npm/cjs/prod/index.js.map +1 -0
  121. package/build/npm/cjs/prod/integrations/breadcrumbs.js +249 -0
  122. package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -0
  123. package/build/npm/cjs/prod/integrations/browserapierrors.js +167 -0
  124. package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -0
  125. package/build/npm/cjs/prod/integrations/browsersession.js +50 -0
  126. package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -0
  127. package/build/npm/cjs/prod/integrations/contextlines.js +53 -0
  128. package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -0
  129. package/build/npm/cjs/prod/integrations/culturecontext.js +50 -0
  130. package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -0
  131. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +8 -0
  132. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
  133. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +30 -0
  134. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  135. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +32 -0
  136. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
  137. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +23 -0
  138. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
  139. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +37 -0
  140. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
  141. package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js +60 -0
  142. package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js.map +1 -0
  143. package/build/npm/cjs/prod/integrations/globalhandlers.js +143 -0
  144. package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -0
  145. package/build/npm/cjs/prod/integrations/graphqlClient.js +148 -0
  146. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -0
  147. package/build/npm/cjs/prod/integrations/httpclient.js +250 -0
  148. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -0
  149. package/build/npm/cjs/prod/integrations/httpcontext.js +47 -0
  150. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -0
  151. package/build/npm/cjs/prod/integrations/linkederrors.js +31 -0
  152. package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -0
  153. package/build/npm/cjs/prod/integrations/reportingobserver.js +60 -0
  154. package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -0
  155. package/build/npm/cjs/prod/integrations/spanstreaming.js +49 -0
  156. package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -0
  157. package/build/npm/cjs/prod/integrations/spotlight.js +61 -0
  158. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -0
  159. package/build/npm/cjs/prod/integrations/view-hierarchy.js +74 -0
  160. package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -0
  161. package/build/npm/cjs/prod/integrations/webVitals.js +62 -0
  162. package/build/npm/cjs/prod/integrations/webVitals.js.map +1 -0
  163. package/build/npm/cjs/prod/integrations/webWorker.js +133 -0
  164. package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -0
  165. package/build/npm/cjs/prod/normalizeStringifyValue.js +27 -0
  166. package/build/npm/cjs/prod/normalizeStringifyValue.js.map +1 -0
  167. package/build/npm/cjs/prod/profiling/UIProfiler.js +306 -0
  168. package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -0
  169. package/build/npm/cjs/prod/profiling/index.js +38 -0
  170. package/build/npm/cjs/prod/profiling/index.js.map +1 -0
  171. package/build/npm/cjs/prod/profiling/integration.js +120 -0
  172. package/build/npm/cjs/prod/profiling/integration.js.map +1 -0
  173. package/build/npm/cjs/prod/profiling/startProfileForSpan.js +91 -0
  174. package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -0
  175. package/build/npm/cjs/prod/profiling/utils.js +498 -0
  176. package/build/npm/cjs/prod/profiling/utils.js.map +1 -0
  177. package/build/npm/cjs/prod/report-dialog.js +53 -0
  178. package/build/npm/cjs/prod/report-dialog.js.map +1 -0
  179. package/build/npm/cjs/prod/sdk.js +60 -0
  180. package/build/npm/cjs/prod/sdk.js.map +1 -0
  181. package/build/npm/cjs/prod/stack-parsers.js +118 -0
  182. package/build/npm/cjs/prod/stack-parsers.js.map +1 -0
  183. package/build/npm/cjs/prod/tracing/backgroundtab.js +34 -0
  184. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -0
  185. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +437 -0
  186. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -0
  187. package/build/npm/cjs/prod/tracing/linkedTraces.js +139 -0
  188. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -0
  189. package/build/npm/cjs/prod/tracing/reportPageLoaded.js +10 -0
  190. package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -0
  191. package/build/npm/cjs/prod/tracing/request.js +236 -0
  192. package/build/npm/cjs/prod/tracing/request.js.map +1 -0
  193. package/build/npm/cjs/prod/tracing/setActiveSpan.js +21 -0
  194. package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -0
  195. package/build/npm/cjs/prod/tracing/utils.js +31 -0
  196. package/build/npm/cjs/prod/tracing/utils.js.map +1 -0
  197. package/build/npm/cjs/prod/transports/fetch.js +58 -0
  198. package/build/npm/cjs/prod/transports/fetch.js.map +1 -0
  199. package/build/npm/cjs/prod/transports/offline.js +111 -0
  200. package/build/npm/cjs/prod/transports/offline.js.map +1 -0
  201. package/build/npm/cjs/prod/userfeedback.js +32 -0
  202. package/build/npm/cjs/prod/userfeedback.js.map +1 -0
  203. package/build/npm/cjs/prod/utils/detectBrowserExtension.js +38 -0
  204. package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -0
  205. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +92 -0
  206. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -0
  207. package/build/npm/esm/dev/client.js +74 -0
  208. package/build/npm/esm/dev/client.js.map +1 -0
  209. package/build/npm/esm/dev/debug-build.js +4 -0
  210. package/build/npm/esm/dev/debug-build.js.map +1 -0
  211. package/build/npm/esm/dev/diagnose-sdk.js +32 -0
  212. package/build/npm/esm/dev/diagnose-sdk.js.map +1 -0
  213. package/build/npm/esm/dev/eventbuilder.js +224 -0
  214. package/build/npm/esm/dev/eventbuilder.js.map +1 -0
  215. package/build/npm/esm/dev/feedbackAsync.js +9 -0
  216. package/build/npm/esm/dev/feedbackAsync.js.map +1 -0
  217. package/build/npm/esm/dev/feedbackSync.js +9 -0
  218. package/build/npm/esm/dev/feedbackSync.js.map +1 -0
  219. package/build/npm/esm/dev/helpers.js +102 -0
  220. package/build/npm/esm/dev/helpers.js.map +1 -0
  221. package/build/npm/esm/dev/index.js +48 -0
  222. package/build/npm/esm/dev/index.js.map +1 -0
  223. package/build/npm/esm/dev/integrations/breadcrumbs.js +247 -0
  224. package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -0
  225. package/build/npm/esm/dev/integrations/browserapierrors.js +165 -0
  226. package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -0
  227. package/build/npm/esm/dev/integrations/browsersession.js +48 -0
  228. package/build/npm/esm/dev/integrations/browsersession.js.map +1 -0
  229. package/build/npm/esm/dev/integrations/contextlines.js +50 -0
  230. package/build/npm/esm/dev/integrations/contextlines.js.map +1 -0
  231. package/build/npm/esm/dev/integrations/culturecontext.js +48 -0
  232. package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -0
  233. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +6 -0
  234. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
  235. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +27 -0
  236. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  237. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +29 -0
  238. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
  239. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +21 -0
  240. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
  241. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +35 -0
  242. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
  243. package/build/npm/esm/dev/integrations/fetchStreamPerformance.js +58 -0
  244. package/build/npm/esm/dev/integrations/fetchStreamPerformance.js.map +1 -0
  245. package/build/npm/esm/dev/integrations/globalhandlers.js +139 -0
  246. package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -0
  247. package/build/npm/esm/dev/integrations/graphqlClient.js +142 -0
  248. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -0
  249. package/build/npm/esm/dev/integrations/httpclient.js +248 -0
  250. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -0
  251. package/build/npm/esm/dev/integrations/httpcontext.js +45 -0
  252. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -0
  253. package/build/npm/esm/dev/integrations/linkederrors.js +29 -0
  254. package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -0
  255. package/build/npm/esm/dev/integrations/reportingobserver.js +58 -0
  256. package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -0
  257. package/build/npm/esm/dev/integrations/spanstreaming.js +47 -0
  258. package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -0
  259. package/build/npm/esm/dev/integrations/spotlight.js +57 -0
  260. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -0
  261. package/build/npm/esm/dev/integrations/view-hierarchy.js +72 -0
  262. package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -0
  263. package/build/npm/esm/dev/integrations/webVitals.js +59 -0
  264. package/build/npm/esm/dev/integrations/webVitals.js.map +1 -0
  265. package/build/npm/esm/dev/integrations/webWorker.js +129 -0
  266. package/build/npm/esm/dev/integrations/webWorker.js.map +1 -0
  267. package/build/npm/esm/dev/normalizeStringifyValue.js +25 -0
  268. package/build/npm/esm/dev/normalizeStringifyValue.js.map +1 -0
  269. package/build/npm/esm/dev/package.json +1 -0
  270. package/build/npm/esm/dev/profiling/UIProfiler.js +304 -0
  271. package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -0
  272. package/build/npm/esm/dev/profiling/index.js +36 -0
  273. package/build/npm/esm/dev/profiling/index.js.map +1 -0
  274. package/build/npm/esm/dev/profiling/integration.js +118 -0
  275. package/build/npm/esm/dev/profiling/integration.js.map +1 -0
  276. package/build/npm/esm/dev/profiling/startProfileForSpan.js +89 -0
  277. package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -0
  278. package/build/npm/esm/dev/profiling/utils.js +474 -0
  279. package/build/npm/esm/dev/profiling/utils.js.map +1 -0
  280. package/build/npm/esm/dev/report-dialog.js +51 -0
  281. package/build/npm/esm/dev/report-dialog.js.map +1 -0
  282. package/build/npm/esm/dev/sdk.js +65 -0
  283. package/build/npm/esm/dev/sdk.js.map +1 -0
  284. package/build/npm/esm/dev/stack-parsers.js +110 -0
  285. package/build/npm/esm/dev/stack-parsers.js.map +1 -0
  286. package/build/npm/esm/dev/tracing/backgroundtab.js +32 -0
  287. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -0
  288. package/build/npm/esm/dev/tracing/browserTracingIntegration.js +429 -0
  289. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -0
  290. package/build/npm/esm/dev/tracing/linkedTraces.js +131 -0
  291. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -0
  292. package/build/npm/esm/dev/tracing/reportPageLoaded.js +8 -0
  293. package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -0
  294. package/build/npm/esm/dev/tracing/request.js +232 -0
  295. package/build/npm/esm/dev/tracing/request.js.map +1 -0
  296. package/build/npm/esm/dev/tracing/setActiveSpan.js +19 -0
  297. package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -0
  298. package/build/npm/esm/dev/tracing/utils.js +26 -0
  299. package/build/npm/esm/dev/tracing/utils.js.map +1 -0
  300. package/build/npm/esm/dev/transports/fetch.js +56 -0
  301. package/build/npm/esm/dev/transports/fetch.js.map +1 -0
  302. package/build/npm/esm/dev/transports/offline.js +105 -0
  303. package/build/npm/esm/dev/transports/offline.js.map +1 -0
  304. package/build/npm/esm/dev/userfeedback.js +30 -0
  305. package/build/npm/esm/dev/userfeedback.js.map +1 -0
  306. package/build/npm/esm/dev/utils/detectBrowserExtension.js +36 -0
  307. package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -0
  308. package/build/npm/esm/dev/utils/lazyLoadIntegration.js +89 -0
  309. package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -0
  310. package/build/npm/esm/prod/client.js +74 -0
  311. package/build/npm/esm/prod/client.js.map +1 -0
  312. package/build/npm/esm/prod/debug-build.js +4 -0
  313. package/build/npm/esm/prod/debug-build.js.map +1 -0
  314. package/build/npm/esm/prod/diagnose-sdk.js +32 -0
  315. package/build/npm/esm/prod/diagnose-sdk.js.map +1 -0
  316. package/build/npm/esm/prod/eventbuilder.js +224 -0
  317. package/build/npm/esm/prod/eventbuilder.js.map +1 -0
  318. package/build/npm/esm/prod/feedbackAsync.js +9 -0
  319. package/build/npm/esm/prod/feedbackAsync.js.map +1 -0
  320. package/build/npm/esm/prod/feedbackSync.js +9 -0
  321. package/build/npm/esm/prod/feedbackSync.js.map +1 -0
  322. package/build/npm/esm/prod/helpers.js +102 -0
  323. package/build/npm/esm/prod/helpers.js.map +1 -0
  324. package/build/npm/esm/prod/index.js +48 -0
  325. package/build/npm/esm/prod/index.js.map +1 -0
  326. package/build/npm/esm/prod/integrations/breadcrumbs.js +247 -0
  327. package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -0
  328. package/build/npm/esm/prod/integrations/browserapierrors.js +165 -0
  329. package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -0
  330. package/build/npm/esm/prod/integrations/browsersession.js +48 -0
  331. package/build/npm/esm/prod/integrations/browsersession.js.map +1 -0
  332. package/build/npm/esm/prod/integrations/contextlines.js +50 -0
  333. package/build/npm/esm/prod/integrations/contextlines.js.map +1 -0
  334. package/build/npm/esm/prod/integrations/culturecontext.js +48 -0
  335. package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -0
  336. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +6 -0
  337. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
  338. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +27 -0
  339. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  340. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +29 -0
  341. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
  342. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +21 -0
  343. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
  344. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +35 -0
  345. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
  346. package/build/npm/esm/prod/integrations/fetchStreamPerformance.js +58 -0
  347. package/build/npm/esm/prod/integrations/fetchStreamPerformance.js.map +1 -0
  348. package/build/npm/esm/prod/integrations/globalhandlers.js +139 -0
  349. package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -0
  350. package/build/npm/esm/prod/integrations/graphqlClient.js +142 -0
  351. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -0
  352. package/build/npm/esm/prod/integrations/httpclient.js +248 -0
  353. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -0
  354. package/build/npm/esm/prod/integrations/httpcontext.js +45 -0
  355. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -0
  356. package/build/npm/esm/prod/integrations/linkederrors.js +29 -0
  357. package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -0
  358. package/build/npm/esm/prod/integrations/reportingobserver.js +58 -0
  359. package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -0
  360. package/build/npm/esm/prod/integrations/spanstreaming.js +47 -0
  361. package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -0
  362. package/build/npm/esm/prod/integrations/spotlight.js +57 -0
  363. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -0
  364. package/build/npm/esm/prod/integrations/view-hierarchy.js +72 -0
  365. package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -0
  366. package/build/npm/esm/prod/integrations/webVitals.js +59 -0
  367. package/build/npm/esm/prod/integrations/webVitals.js.map +1 -0
  368. package/build/npm/esm/prod/integrations/webWorker.js +129 -0
  369. package/build/npm/esm/prod/integrations/webWorker.js.map +1 -0
  370. package/build/npm/esm/prod/normalizeStringifyValue.js +25 -0
  371. package/build/npm/esm/prod/normalizeStringifyValue.js.map +1 -0
  372. package/build/npm/esm/prod/package.json +1 -0
  373. package/build/npm/esm/prod/profiling/UIProfiler.js +304 -0
  374. package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -0
  375. package/build/npm/esm/prod/profiling/index.js +36 -0
  376. package/build/npm/esm/prod/profiling/index.js.map +1 -0
  377. package/build/npm/esm/prod/profiling/integration.js +118 -0
  378. package/build/npm/esm/prod/profiling/integration.js.map +1 -0
  379. package/build/npm/esm/prod/profiling/startProfileForSpan.js +89 -0
  380. package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -0
  381. package/build/npm/esm/prod/profiling/utils.js +474 -0
  382. package/build/npm/esm/prod/profiling/utils.js.map +1 -0
  383. package/build/npm/esm/prod/report-dialog.js +51 -0
  384. package/build/npm/esm/prod/report-dialog.js.map +1 -0
  385. package/build/npm/esm/prod/sdk.js +55 -0
  386. package/build/npm/esm/prod/sdk.js.map +1 -0
  387. package/build/npm/esm/prod/stack-parsers.js +110 -0
  388. package/build/npm/esm/prod/stack-parsers.js.map +1 -0
  389. package/build/npm/esm/prod/tracing/backgroundtab.js +32 -0
  390. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -0
  391. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +429 -0
  392. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -0
  393. package/build/npm/esm/prod/tracing/linkedTraces.js +130 -0
  394. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -0
  395. package/build/npm/esm/prod/tracing/reportPageLoaded.js +8 -0
  396. package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -0
  397. package/build/npm/esm/prod/tracing/request.js +232 -0
  398. package/build/npm/esm/prod/tracing/request.js.map +1 -0
  399. package/build/npm/esm/prod/tracing/setActiveSpan.js +19 -0
  400. package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -0
  401. package/build/npm/esm/prod/tracing/utils.js +26 -0
  402. package/build/npm/esm/prod/tracing/utils.js.map +1 -0
  403. package/build/npm/esm/prod/transports/fetch.js +56 -0
  404. package/build/npm/esm/prod/transports/fetch.js.map +1 -0
  405. package/build/npm/esm/prod/transports/offline.js +105 -0
  406. package/build/npm/esm/prod/transports/offline.js.map +1 -0
  407. package/build/npm/esm/prod/userfeedback.js +30 -0
  408. package/build/npm/esm/prod/userfeedback.js.map +1 -0
  409. package/build/npm/esm/prod/utils/detectBrowserExtension.js +36 -0
  410. package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -0
  411. package/build/npm/esm/prod/utils/lazyLoadIntegration.js +89 -0
  412. package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -0
  413. package/build/npm/types/client.d.ts +79 -0
  414. package/build/npm/types/client.d.ts.map +1 -0
  415. package/build/npm/types/debug-build.d.ts +7 -0
  416. package/build/npm/types/debug-build.d.ts.map +1 -0
  417. package/build/npm/types/diagnose-sdk.d.ts +11 -0
  418. package/build/npm/types/diagnose-sdk.d.ts.map +1 -0
  419. package/build/npm/types/eventbuilder.d.ts +40 -0
  420. package/build/npm/types/eventbuilder.d.ts.map +1 -0
  421. package/build/npm/types/exports.d.ts +21 -0
  422. package/build/npm/types/exports.d.ts.map +1 -0
  423. package/build/npm/types/feedbackAsync.d.ts +7 -0
  424. package/build/npm/types/feedbackAsync.d.ts.map +1 -0
  425. package/build/npm/types/feedbackSync.d.ts +4 -0
  426. package/build/npm/types/feedbackSync.d.ts.map +1 -0
  427. package/build/npm/types/helpers.d.ts +27 -0
  428. package/build/npm/types/helpers.d.ts.map +1 -0
  429. package/build/npm/types/index.bundle.base.d.ts +2 -0
  430. package/build/npm/types/index.bundle.base.d.ts.map +1 -0
  431. package/build/npm/types/index.bundle.d.ts +5 -0
  432. package/build/npm/types/index.bundle.d.ts.map +1 -0
  433. package/build/npm/types/index.bundle.feedback.d.ts +7 -0
  434. package/build/npm/types/index.bundle.feedback.d.ts.map +1 -0
  435. package/build/npm/types/index.bundle.logs.metrics.d.ts +6 -0
  436. package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -0
  437. package/build/npm/types/index.bundle.replay.d.ts +6 -0
  438. package/build/npm/types/index.bundle.replay.d.ts.map +1 -0
  439. package/build/npm/types/index.bundle.replay.feedback.d.ts +8 -0
  440. package/build/npm/types/index.bundle.replay.feedback.d.ts.map +1 -0
  441. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +7 -0
  442. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -0
  443. package/build/npm/types/index.bundle.tracing.d.ts +13 -0
  444. package/build/npm/types/index.bundle.tracing.d.ts.map +1 -0
  445. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +13 -0
  446. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -0
  447. package/build/npm/types/index.bundle.tracing.replay.d.ts +14 -0
  448. package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -0
  449. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +16 -0
  450. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -0
  451. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +14 -0
  452. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -0
  453. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +14 -0
  454. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -0
  455. package/build/npm/types/index.d.ts +38 -0
  456. package/build/npm/types/index.d.ts.map +1 -0
  457. package/build/npm/types/integrations/breadcrumbs.d.ts +16 -0
  458. package/build/npm/types/integrations/breadcrumbs.d.ts.map +1 -0
  459. package/build/npm/types/integrations/browserapierrors.d.ts +23 -0
  460. package/build/npm/types/integrations/browserapierrors.d.ts.map +1 -0
  461. package/build/npm/types/integrations/browserprofiling.d.ts +2 -0
  462. package/build/npm/types/integrations/browserprofiling.d.ts.map +1 -0
  463. package/build/npm/types/integrations/browsersession.d.ts +25 -0
  464. package/build/npm/types/integrations/browsersession.d.ts.map +1 -0
  465. package/build/npm/types/integrations/contextlines.d.ts +32 -0
  466. package/build/npm/types/integrations/contextlines.d.ts.map +1 -0
  467. package/build/npm/types/integrations/culturecontext.d.ts +18 -0
  468. package/build/npm/types/integrations/culturecontext.d.ts.map +1 -0
  469. package/build/npm/types/integrations/featureFlags/growthbook/index.d.ts +2 -0
  470. package/build/npm/types/integrations/featureFlags/growthbook/index.d.ts.map +1 -0
  471. package/build/npm/types/integrations/featureFlags/growthbook/integration.d.ts +25 -0
  472. package/build/npm/types/integrations/featureFlags/growthbook/integration.d.ts.map +1 -0
  473. package/build/npm/types/integrations/featureFlags/growthbook/types.d.ts +6 -0
  474. package/build/npm/types/integrations/featureFlags/growthbook/types.d.ts.map +1 -0
  475. package/build/npm/types/integrations/featureFlags/launchdarkly/index.d.ts +2 -0
  476. package/build/npm/types/integrations/featureFlags/launchdarkly/index.d.ts.map +1 -0
  477. package/build/npm/types/integrations/featureFlags/launchdarkly/integration.d.ts +27 -0
  478. package/build/npm/types/integrations/featureFlags/launchdarkly/integration.d.ts.map +1 -0
  479. package/build/npm/types/integrations/featureFlags/launchdarkly/types.d.ts +44 -0
  480. package/build/npm/types/integrations/featureFlags/launchdarkly/types.d.ts.map +1 -0
  481. package/build/npm/types/integrations/featureFlags/openfeature/index.d.ts +2 -0
  482. package/build/npm/types/integrations/featureFlags/openfeature/index.d.ts.map +1 -0
  483. package/build/npm/types/integrations/featureFlags/openfeature/integration.d.ts +18 -0
  484. package/build/npm/types/integrations/featureFlags/openfeature/integration.d.ts.map +1 -0
  485. package/build/npm/types/integrations/featureFlags/openfeature/types.d.ts +78 -0
  486. package/build/npm/types/integrations/featureFlags/openfeature/types.d.ts.map +1 -0
  487. package/build/npm/types/integrations/featureFlags/statsig/index.d.ts +2 -0
  488. package/build/npm/types/integrations/featureFlags/statsig/index.d.ts.map +1 -0
  489. package/build/npm/types/integrations/featureFlags/statsig/integration.d.ts +30 -0
  490. package/build/npm/types/integrations/featureFlags/statsig/integration.d.ts.map +1 -0
  491. package/build/npm/types/integrations/featureFlags/statsig/types.d.ts +14 -0
  492. package/build/npm/types/integrations/featureFlags/statsig/types.d.ts.map +1 -0
  493. package/build/npm/types/integrations/featureFlags/unleash/index.d.ts +2 -0
  494. package/build/npm/types/integrations/featureFlags/unleash/index.d.ts.map +1 -0
  495. package/build/npm/types/integrations/featureFlags/unleash/integration.d.ts +31 -0
  496. package/build/npm/types/integrations/featureFlags/unleash/integration.d.ts.map +1 -0
  497. package/build/npm/types/integrations/featureFlags/unleash/types.d.ts +21 -0
  498. package/build/npm/types/integrations/featureFlags/unleash/types.d.ts.map +1 -0
  499. package/build/npm/types/integrations/fetchStreamPerformance.d.ts +16 -0
  500. package/build/npm/types/integrations/fetchStreamPerformance.d.ts.map +1 -0
  501. package/build/npm/types/integrations/globalhandlers.d.ts +19 -0
  502. package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -0
  503. package/build/npm/types/integrations/graphqlClient.d.ts +60 -0
  504. package/build/npm/types/integrations/graphqlClient.d.ts.map +1 -0
  505. package/build/npm/types/integrations/httpclient.d.ts +29 -0
  506. package/build/npm/types/integrations/httpclient.d.ts.map +1 -0
  507. package/build/npm/types/integrations/httpcontext.d.ts +8 -0
  508. package/build/npm/types/integrations/httpcontext.d.ts.map +1 -0
  509. package/build/npm/types/integrations/linkederrors.d.ts +12 -0
  510. package/build/npm/types/integrations/linkederrors.d.ts.map +1 -0
  511. package/build/npm/types/integrations/reportingobserver.d.ts +12 -0
  512. package/build/npm/types/integrations/reportingobserver.d.ts.map +1 -0
  513. package/build/npm/types/integrations/spanstreaming.d.ts +4 -0
  514. package/build/npm/types/integrations/spanstreaming.d.ts.map +1 -0
  515. package/build/npm/types/integrations/spotlight.d.ts +21 -0
  516. package/build/npm/types/integrations/spotlight.d.ts.map +1 -0
  517. package/build/npm/types/integrations/view-hierarchy.d.ts +51 -0
  518. package/build/npm/types/integrations/view-hierarchy.d.ts.map +1 -0
  519. package/build/npm/types/integrations/webVitals.d.ts +26 -0
  520. package/build/npm/types/integrations/webVitals.d.ts.map +1 -0
  521. package/build/npm/types/integrations/webWorker.d.ts +129 -0
  522. package/build/npm/types/integrations/webWorker.d.ts.map +1 -0
  523. package/build/npm/types/integrations-bundle/index.captureconsole.d.ts +2 -0
  524. package/build/npm/types/integrations-bundle/index.captureconsole.d.ts.map +1 -0
  525. package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts +2 -0
  526. package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts.map +1 -0
  527. package/build/npm/types/integrations-bundle/index.dedupe.d.ts +2 -0
  528. package/build/npm/types/integrations-bundle/index.dedupe.d.ts.map +1 -0
  529. package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts +2 -0
  530. package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts.map +1 -0
  531. package/build/npm/types/integrations-bundle/index.feedback.d.ts +5 -0
  532. package/build/npm/types/integrations-bundle/index.feedback.d.ts.map +1 -0
  533. package/build/npm/types/integrations-bundle/index.graphqlclient.d.ts +2 -0
  534. package/build/npm/types/integrations-bundle/index.graphqlclient.d.ts.map +1 -0
  535. package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts +2 -0
  536. package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts.map +1 -0
  537. package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +2 -0
  538. package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts.map +1 -0
  539. package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts +2 -0
  540. package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts.map +1 -0
  541. package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts +2 -0
  542. package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts.map +1 -0
  543. package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts +2 -0
  544. package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts.map +1 -0
  545. package/build/npm/types/integrations-bundle/index.instrumentstategraph.d.ts +2 -0
  546. package/build/npm/types/integrations-bundle/index.instrumentstategraph.d.ts.map +1 -0
  547. package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts +2 -0
  548. package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts.map +1 -0
  549. package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts +2 -0
  550. package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts.map +1 -0
  551. package/build/npm/types/integrations-bundle/index.spotlight.d.ts +2 -0
  552. package/build/npm/types/integrations-bundle/index.spotlight.d.ts.map +1 -0
  553. package/build/npm/types/normalizeStringifyValue.d.ts +15 -0
  554. package/build/npm/types/normalizeStringifyValue.d.ts.map +1 -0
  555. package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts +2 -0
  556. package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts.map +1 -0
  557. package/build/npm/types/profiling/UIProfiler.d.ts +75 -0
  558. package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -0
  559. package/build/npm/types/profiling/index.d.ts +8 -0
  560. package/build/npm/types/profiling/index.d.ts.map +1 -0
  561. package/build/npm/types/profiling/integration.d.ts +4 -0
  562. package/build/npm/types/profiling/integration.d.ts.map +1 -0
  563. package/build/npm/types/profiling/jsSelfProfiling.d.ts +41 -0
  564. package/build/npm/types/profiling/jsSelfProfiling.d.ts.map +1 -0
  565. package/build/npm/types/profiling/startProfileForSpan.d.ts +8 -0
  566. package/build/npm/types/profiling/startProfileForSpan.d.ts.map +1 -0
  567. package/build/npm/types/profiling/utils.d.ts +112 -0
  568. package/build/npm/types/profiling/utils.d.ts.map +1 -0
  569. package/build/npm/types/report-dialog.d.ts +8 -0
  570. package/build/npm/types/report-dialog.d.ts.map +1 -0
  571. package/build/npm/types/sdk.d.ts +62 -0
  572. package/build/npm/types/sdk.d.ts.map +1 -0
  573. package/build/npm/types/stack-parsers.d.ts +9 -0
  574. package/build/npm/types/stack-parsers.d.ts.map +1 -0
  575. package/build/npm/types/tracing/backgroundtab.d.ts +6 -0
  576. package/build/npm/types/tracing/backgroundtab.d.ts.map +1 -0
  577. package/build/npm/types/tracing/browserTracingIntegration.d.ts +271 -0
  578. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -0
  579. package/build/npm/types/tracing/linkedTraces.d.ts +52 -0
  580. package/build/npm/types/tracing/linkedTraces.d.ts.map +1 -0
  581. package/build/npm/types/tracing/reportPageLoaded.d.ts +11 -0
  582. package/build/npm/types/tracing/reportPageLoaded.d.ts.map +1 -0
  583. package/build/npm/types/tracing/request.d.ts +87 -0
  584. package/build/npm/types/tracing/request.d.ts.map +1 -0
  585. package/build/npm/types/tracing/setActiveSpan.d.ts +39 -0
  586. package/build/npm/types/tracing/setActiveSpan.d.ts.map +1 -0
  587. package/build/npm/types/tracing/utils.d.ts +17 -0
  588. package/build/npm/types/tracing/utils.d.ts.map +1 -0
  589. package/build/npm/types/transports/fetch.d.ts +8 -0
  590. package/build/npm/types/transports/fetch.d.ts.map +1 -0
  591. package/build/npm/types/transports/offline.d.ts +33 -0
  592. package/build/npm/types/transports/offline.d.ts.map +1 -0
  593. package/build/npm/types/transports/types.d.ts +6 -0
  594. package/build/npm/types/transports/types.d.ts.map +1 -0
  595. package/build/npm/types/userfeedback.d.ts +10 -0
  596. package/build/npm/types/userfeedback.d.ts.map +1 -0
  597. package/build/npm/types/utils/detectBrowserExtension.d.ts +6 -0
  598. package/build/npm/types/utils/detectBrowserExtension.d.ts.map +1 -0
  599. package/build/npm/types/utils/lazyLoadIntegration.d.ts +13 -0
  600. package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -0
  601. package/build/npm/types-ts3.8/client.d.ts +79 -0
  602. package/build/npm/types-ts3.8/debug-build.d.ts +7 -0
  603. package/build/npm/types-ts3.8/diagnose-sdk.d.ts +11 -0
  604. package/build/npm/types-ts3.8/eventbuilder.d.ts +40 -0
  605. package/build/npm/types-ts3.8/exports.d.ts +21 -0
  606. package/build/npm/types-ts3.8/feedbackAsync.d.ts +7 -0
  607. package/build/npm/types-ts3.8/feedbackSync.d.ts +4 -0
  608. package/build/npm/types-ts3.8/helpers.d.ts +27 -0
  609. package/build/npm/types-ts3.8/index.bundle.base.d.ts +2 -0
  610. package/build/npm/types-ts3.8/index.bundle.d.ts +5 -0
  611. package/build/npm/types-ts3.8/index.bundle.feedback.d.ts +7 -0
  612. package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +6 -0
  613. package/build/npm/types-ts3.8/index.bundle.replay.d.ts +6 -0
  614. package/build/npm/types-ts3.8/index.bundle.replay.feedback.d.ts +8 -0
  615. package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +7 -0
  616. package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +13 -0
  617. package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +13 -0
  618. package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +14 -0
  619. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +16 -0
  620. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +14 -0
  621. package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +14 -0
  622. package/build/npm/types-ts3.8/index.d.ts +38 -0
  623. package/build/npm/types-ts3.8/integrations/breadcrumbs.d.ts +16 -0
  624. package/build/npm/types-ts3.8/integrations/browserapierrors.d.ts +23 -0
  625. package/build/npm/types-ts3.8/integrations/browserprofiling.d.ts +2 -0
  626. package/build/npm/types-ts3.8/integrations/browsersession.d.ts +25 -0
  627. package/build/npm/types-ts3.8/integrations/contextlines.d.ts +32 -0
  628. package/build/npm/types-ts3.8/integrations/culturecontext.d.ts +18 -0
  629. package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/index.d.ts +2 -0
  630. package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/integration.d.ts +25 -0
  631. package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/types.d.ts +6 -0
  632. package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/index.d.ts +2 -0
  633. package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/integration.d.ts +27 -0
  634. package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/types.d.ts +44 -0
  635. package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/index.d.ts +2 -0
  636. package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/integration.d.ts +18 -0
  637. package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/types.d.ts +78 -0
  638. package/build/npm/types-ts3.8/integrations/featureFlags/statsig/index.d.ts +2 -0
  639. package/build/npm/types-ts3.8/integrations/featureFlags/statsig/integration.d.ts +30 -0
  640. package/build/npm/types-ts3.8/integrations/featureFlags/statsig/types.d.ts +14 -0
  641. package/build/npm/types-ts3.8/integrations/featureFlags/unleash/index.d.ts +2 -0
  642. package/build/npm/types-ts3.8/integrations/featureFlags/unleash/integration.d.ts +31 -0
  643. package/build/npm/types-ts3.8/integrations/featureFlags/unleash/types.d.ts +21 -0
  644. package/build/npm/types-ts3.8/integrations/fetchStreamPerformance.d.ts +16 -0
  645. package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +19 -0
  646. package/build/npm/types-ts3.8/integrations/graphqlClient.d.ts +60 -0
  647. package/build/npm/types-ts3.8/integrations/httpclient.d.ts +32 -0
  648. package/build/npm/types-ts3.8/integrations/httpcontext.d.ts +8 -0
  649. package/build/npm/types-ts3.8/integrations/linkederrors.d.ts +12 -0
  650. package/build/npm/types-ts3.8/integrations/reportingobserver.d.ts +12 -0
  651. package/build/npm/types-ts3.8/integrations/spanstreaming.d.ts +4 -0
  652. package/build/npm/types-ts3.8/integrations/spotlight.d.ts +21 -0
  653. package/build/npm/types-ts3.8/integrations/view-hierarchy.d.ts +51 -0
  654. package/build/npm/types-ts3.8/integrations/webVitals.d.ts +26 -0
  655. package/build/npm/types-ts3.8/integrations/webWorker.d.ts +129 -0
  656. package/build/npm/types-ts3.8/integrations-bundle/index.captureconsole.d.ts +2 -0
  657. package/build/npm/types-ts3.8/integrations-bundle/index.createlangchaincallbackhandler.d.ts +2 -0
  658. package/build/npm/types-ts3.8/integrations-bundle/index.dedupe.d.ts +2 -0
  659. package/build/npm/types-ts3.8/integrations-bundle/index.extraerrordata.d.ts +2 -0
  660. package/build/npm/types-ts3.8/integrations-bundle/index.feedback.d.ts +5 -0
  661. package/build/npm/types-ts3.8/integrations-bundle/index.graphqlclient.d.ts +2 -0
  662. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentanthropicaiclient.d.ts +2 -0
  663. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +2 -0
  664. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlangchainembeddings.d.ts +2 -0
  665. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlanggraph.d.ts +2 -0
  666. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentopenaiclient.d.ts +2 -0
  667. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentstategraph.d.ts +2 -0
  668. package/build/npm/types-ts3.8/integrations-bundle/index.modulemetadata.d.ts +2 -0
  669. package/build/npm/types-ts3.8/integrations-bundle/index.rewriteframes.d.ts +2 -0
  670. package/build/npm/types-ts3.8/integrations-bundle/index.spotlight.d.ts +2 -0
  671. package/build/npm/types-ts3.8/normalizeStringifyValue.d.ts +15 -0
  672. package/build/npm/types-ts3.8/pluggable-exports-bundle/index.multiplexedtransport.d.ts +2 -0
  673. package/build/npm/types-ts3.8/profiling/UIProfiler.d.ts +75 -0
  674. package/build/npm/types-ts3.8/profiling/index.d.ts +8 -0
  675. package/build/npm/types-ts3.8/profiling/integration.d.ts +4 -0
  676. package/build/npm/types-ts3.8/profiling/jsSelfProfiling.d.ts +41 -0
  677. package/build/npm/types-ts3.8/profiling/startProfileForSpan.d.ts +8 -0
  678. package/build/npm/types-ts3.8/profiling/utils.d.ts +112 -0
  679. package/build/npm/types-ts3.8/report-dialog.d.ts +8 -0
  680. package/build/npm/types-ts3.8/sdk.d.ts +62 -0
  681. package/build/npm/types-ts3.8/stack-parsers.d.ts +9 -0
  682. package/build/npm/types-ts3.8/tracing/backgroundtab.d.ts +6 -0
  683. package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +271 -0
  684. package/build/npm/types-ts3.8/tracing/linkedTraces.d.ts +52 -0
  685. package/build/npm/types-ts3.8/tracing/reportPageLoaded.d.ts +11 -0
  686. package/build/npm/types-ts3.8/tracing/request.d.ts +87 -0
  687. package/build/npm/types-ts3.8/tracing/setActiveSpan.d.ts +39 -0
  688. package/build/npm/types-ts3.8/tracing/utils.d.ts +17 -0
  689. package/build/npm/types-ts3.8/transports/fetch.d.ts +8 -0
  690. package/build/npm/types-ts3.8/transports/offline.d.ts +33 -0
  691. package/build/npm/types-ts3.8/transports/types.d.ts +6 -0
  692. package/build/npm/types-ts3.8/userfeedback.d.ts +10 -0
  693. package/build/npm/types-ts3.8/utils/detectBrowserExtension.d.ts +6 -0
  694. package/build/npm/types-ts3.8/utils/lazyLoadIntegration.d.ts +37 -0
  695. package/package.json +85 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-hierarchy.js","sources":["../../../../../src/integrations/view-hierarchy.ts"],"sourcesContent":["import type { Attachment, Event, EventHint, ViewHierarchyData, ViewHierarchyWindow } from '@elenjical/core/browser';\nimport { defineIntegration, getComponentName } from '@elenjical/core/browser';\nimport { WINDOW } from '../helpers';\n\ninterface OnElementArgs {\n /**\n * The element being processed.\n */\n element: HTMLElement;\n /**\n * Lowercase tag name of the element.\n */\n tagName: string;\n /**\n * The component name of the element.\n */\n componentName?: string;\n\n /**\n * The current depth of the element in the view hierarchy. The root element will have a depth of 0.\n *\n * This allows you to limit the traversal depth for large DOM trees.\n */\n depth?: number;\n}\n\ninterface Options {\n /**\n * Whether to attach the view hierarchy to the event.\n *\n * Default: Always attach.\n */\n shouldAttach?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * A function that returns the root element to start walking the DOM from.\n *\n * Default: `window.document.body`\n */\n rootElement?: () => HTMLElement | undefined;\n\n /**\n * Called for each HTMLElement as we walk the DOM.\n *\n * Return an object to include the element with any additional properties.\n * Return `skip` to exclude the element and its children.\n * Return `children` to skip the element but include its children.\n */\n onElement?: (prop: OnElementArgs) => Record<string, string | number | boolean> | 'skip' | 'children';\n}\n\n/**\n * An integration to include a view hierarchy attachment which contains the DOM.\n */\nexport const viewHierarchyIntegration = defineIntegration((options: Options = {}) => {\n const skipHtmlTags = ['script'];\n\n /** Walk an element */\n function walk(element: HTMLElement, windows: ViewHierarchyWindow[], depth = 0): void {\n if (!element) {\n return;\n }\n\n // With Web Components, we need to walk into shadow DOMs\n const children = 'shadowRoot' in element && element.shadowRoot ? element.shadowRoot.children : element.children;\n\n for (const child of children) {\n if (!(child instanceof HTMLElement)) {\n continue;\n }\n\n const componentName = getComponentName(child, 1) || undefined;\n const tagName = child.tagName.toLowerCase();\n\n if (skipHtmlTags.includes(tagName)) {\n continue;\n }\n\n const result = options.onElement?.({ element: child, componentName, tagName, depth }) || {};\n\n if (result === 'skip') {\n continue;\n }\n\n // Skip this element but include its children\n if (result === 'children') {\n walk(child, windows, depth + 1);\n continue;\n }\n\n const { x, y, width, height } = child.getBoundingClientRect();\n\n const window: ViewHierarchyWindow = {\n identifier: (child.id || undefined) as string,\n type: componentName || tagName,\n visible: true,\n alpha: 1,\n height,\n width,\n x,\n y,\n ...result,\n };\n\n const children: ViewHierarchyWindow[] = [];\n window.children = children;\n\n // Recursively walk the children\n walk(child, window.children, depth + 1);\n\n windows.push(window);\n }\n }\n\n return {\n name: 'ViewHierarchy' as const,\n processEvent: (event, hint) => {\n // only capture for error events\n if (event.type !== undefined || options.shouldAttach?.(event, hint) === false) {\n return event;\n }\n\n const root: ViewHierarchyData = {\n rendering_system: 'DOM',\n positioning: 'absolute',\n windows: [],\n };\n\n walk(options.rootElement?.() || WINDOW.document.body, root.windows);\n\n const attachment: Attachment = {\n filename: 'view-hierarchy.json',\n attachmentType: 'event.view_hierarchy',\n contentType: 'application/json',\n data: JSON.stringify(root),\n };\n\n hint.attachments = hint.attachments || [];\n hint.attachments.push(attachment);\n\n return event;\n },\n };\n});\n"],"names":["children"],"mappings":";;;AAsDO,MAAM,wBAAA,GAA2B,iBAAA,CAAkB,CAAC,OAAA,GAAmB,EAAC,KAAM;AACnF,EAAA,MAAM,YAAA,GAAe,CAAC,QAAQ,CAAA;AAG9B,EAAA,SAAS,IAAA,CAAK,OAAA,EAAsB,OAAA,EAAgC,KAAA,GAAQ,CAAA,EAAS;AACnF,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA;AAAA,IACF;AAGA,IAAA,MAAM,QAAA,GAAW,gBAAgB,OAAA,IAAW,OAAA,CAAQ,aAAa,OAA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AU,KAAA,GAAQ,CAAC,CAAA;AAEtC,MAAA,OAAA,CAAQ,KAAK,MAAM,CAAA;AAAA,IACrB;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,eAAA;AAAA,IACN,YAAA,EAAc,CAAC,KAAA,EAAO,IAAA,KAAS;AAE7B,MAAA,IAAI,KAAA,CAAM,SAAS,MAAA,IAAa,OAAA,CAAQ,eAAe,KAAA,EAAO,IAAI,MAAM,KAAA,EAAO;AAC7E,QAAA,OAAO,KAAA;AAAA,MACT;AAEA,MAAA,MAAM,IAAA,GAA0B;AAAA,QAC9B,gBAAA,EAAkB,KAAA;AAAA,QAClB,WAAA,EAAa,UAAA;AAAA,QACb,SAAS;AAAC,OACZ;AAEA,MAAA,IAAA,CAAK,QAAQ,WAAA,IAAc,IAAK,OAAO,QAAA,CAAS,IAAA,EAAM,KAAK,OAAO,CAAA;AAElE,MAAA,MAAM,UAAA,GAAyB;AAAA,QAC7B,QAAA,EAAU,qBAAA;AAAA,QACV,cAAA,EAAgB,sBAAA;AAAA,QAChB,WAAA,EAAa,kBAAA;AAAA,QACb,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,IAAI;AAAA,OAC3B;AAEA,MAAA,IAAA,CAAK,WAAA,GAAc,IAAA,CAAK,WAAA,IAAe,EAAC;AACxC,MAAA,IAAA,CAAK,WAAA,CAAY,KAAK,UAAU,CAAA;AAEhC,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,GACF;AACF,CAAC;;;;"}
@@ -0,0 +1,59 @@
1
+ import { defineIntegration, hasSpanStreamingEnabled } from '@elenjical/core/browser';
2
+ import { registerInpInteractionListener, startTrackingWebVitals, addWebVitalsToSpan, trackLcpAsSpan, trackClsAsSpan, trackInpAsSpan, startTrackingINP } from '@elenjical/browser-utils';
3
+
4
+ const WEB_VITALS_INTEGRATION_NAME = "WebVitals";
5
+ const webVitalsIntegration = defineIntegration((options = {}) => {
6
+ const ignored = new Set(options.ignore ?? []);
7
+ return {
8
+ name: WEB_VITALS_INTEGRATION_NAME,
9
+ setup(client) {
10
+ const spanStreamingEnabled = hasSpanStreamingEnabled(client);
11
+ const { enableStandaloneClsSpans, enableStandaloneLcpSpans } = options._experiments ?? {};
12
+ const recordClsStandaloneSpans = spanStreamingEnabled || ignored.has("cls") ? void 0 : enableStandaloneClsSpans || false;
13
+ const recordLcpStandaloneSpans = spanStreamingEnabled || ignored.has("lcp") ? void 0 : enableStandaloneLcpSpans || false;
14
+ const finalizeWebVitals = startTrackingWebVitals({
15
+ recordClsStandaloneSpans,
16
+ recordLcpStandaloneSpans,
17
+ client
18
+ });
19
+ const pageloadSpans = /* @__PURE__ */ new WeakSet();
20
+ client.on("afterStartPageLoadSpan", (span) => {
21
+ pageloadSpans.add(span);
22
+ });
23
+ client.on("spanEnd", (span) => {
24
+ if (!pageloadSpans.delete(span)) {
25
+ return;
26
+ }
27
+ finalizeWebVitals();
28
+ addWebVitalsToSpan(span, {
29
+ // CLS/LCP are recorded as pageload span measurements only when they're neither
30
+ // tracked as standalone spans nor handled by span streaming (and not ignored).
31
+ recordClsOnPageloadSpan: recordClsStandaloneSpans === false,
32
+ recordLcpOnPageloadSpan: recordLcpStandaloneSpans === false,
33
+ spanStreamingEnabled
34
+ });
35
+ });
36
+ if (spanStreamingEnabled) {
37
+ if (!ignored.has("lcp")) {
38
+ trackLcpAsSpan(client);
39
+ }
40
+ if (!ignored.has("cls")) {
41
+ trackClsAsSpan(client);
42
+ }
43
+ if (!ignored.has("inp")) {
44
+ trackInpAsSpan();
45
+ }
46
+ } else if (!ignored.has("inp")) {
47
+ startTrackingINP();
48
+ }
49
+ },
50
+ afterAllSetup() {
51
+ if (!ignored.has("inp")) {
52
+ registerInpInteractionListener();
53
+ }
54
+ }
55
+ };
56
+ });
57
+
58
+ export { WEB_VITALS_INTEGRATION_NAME, webVitalsIntegration };
59
+ //# sourceMappingURL=webVitals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webVitals.js","sources":["../../../../../src/integrations/webVitals.ts"],"sourcesContent":["import type { IntegrationFn, Span } from '@elenjical/core/browser';\nimport { defineIntegration, hasSpanStreamingEnabled } from '@elenjical/core/browser';\nimport {\n addWebVitalsToSpan,\n registerInpInteractionListener,\n startTrackingINP,\n startTrackingWebVitals,\n trackClsAsSpan,\n trackInpAsSpan,\n trackLcpAsSpan,\n} from '@elenjical/browser-utils';\n\nexport const WEB_VITALS_INTEGRATION_NAME = 'WebVitals' as const;\n\nexport type WebVitalName = 'cls' | 'inp' | 'lcp';\n\nexport interface WebVitalsOptions {\n /**\n * Web vitals to skip.\n */\n ignore?: WebVitalName[];\n\n /**\n * @experimental\n */\n _experiments?: Partial<{\n enableStandaloneClsSpans: boolean;\n enableStandaloneLcpSpans: boolean;\n }>;\n}\n\n/**\n * Captures Core Web Vitals (LCP, CLS, INP) and related pageload vitals.\n *\n * `browserTracingIntegration` auto-registers this integration if no\n * `webVitalsIntegration` is already present, so explicit registration is only\n * needed to customize options or to use it without `browserTracingIntegration`.\n */\nexport const webVitalsIntegration = defineIntegration((options: WebVitalsOptions = {}) => {\n const ignored = new Set(options.ignore ?? []);\n\n return {\n name: WEB_VITALS_INTEGRATION_NAME,\n setup(client) {\n const spanStreamingEnabled = hasSpanStreamingEnabled(client);\n const { enableStandaloneClsSpans, enableStandaloneLcpSpans } = options._experiments ?? {};\n\n const recordClsStandaloneSpans =\n spanStreamingEnabled || ignored.has('cls') ? undefined : enableStandaloneClsSpans || false;\n const recordLcpStandaloneSpans =\n spanStreamingEnabled || ignored.has('lcp') ? undefined : enableStandaloneLcpSpans || false;\n\n // eslint-disable-next-line typescript/no-deprecated\n const finalizeWebVitals = startTrackingWebVitals({\n recordClsStandaloneSpans,\n recordLcpStandaloneSpans,\n client,\n });\n\n const pageloadSpans = new WeakSet<Span>();\n\n client.on('afterStartPageLoadSpan', span => {\n pageloadSpans.add(span);\n });\n\n client.on('spanEnd', span => {\n if (!pageloadSpans.delete(span)) {\n return;\n }\n\n finalizeWebVitals();\n addWebVitalsToSpan(span, {\n // CLS/LCP are recorded as pageload span measurements only when they're neither\n // tracked as standalone spans nor handled by span streaming (and not ignored).\n recordClsOnPageloadSpan: recordClsStandaloneSpans === false,\n recordLcpOnPageloadSpan: recordLcpStandaloneSpans === false,\n spanStreamingEnabled,\n });\n });\n\n if (spanStreamingEnabled) {\n if (!ignored.has('lcp')) {\n trackLcpAsSpan(client);\n }\n if (!ignored.has('cls')) {\n trackClsAsSpan(client);\n }\n if (!ignored.has('inp')) {\n trackInpAsSpan();\n }\n } else if (!ignored.has('inp')) {\n startTrackingINP();\n }\n },\n afterAllSetup() {\n if (!ignored.has('inp')) {\n registerInpInteractionListener();\n }\n },\n };\n}) satisfies IntegrationFn;\n"],"names":[],"mappings":";;;AAYO,MAAM,2BAAA,GAA8B;AA0BpC,MAAM,oBAAA,GAAuB,iBAAA,CAAkB,CAAC,OAAA,GAA4B,EAAC,KAAM;AACxF,EAAA,MAAM,UAAU,IAAI,GAAA,CAAI,OAAA,CAAQ,MAAA,IAAU,EAAE,CAAA;AAE5C,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,2BAAA;AAAA,IACN,MAAM,MAAA,EAAQ;AACZ,MAAA,MAAM,oBAAA,GAAuB,wBAAwB,MAAM,CAAA;AAC3D,MAAA,MAAM,EAAE,wBAAA,EAA0B,wBAAA,EAAyB,GAAI,OAAA,CAAQ,gBAAgB,EAAC;AAExF,MAAA,MAAM,2BACJ,oBAAA,IAAwB,OAAA,CAAQ,IAAI,KAAK,CAAA,GAAI,SAAY,wBAAA,IAA4B,KAAA;AACvF,MAAA,MAAM,2BACJ,oBAAA,IAAwB,OAAA,CAAQ,IAAI,KAAK,CAAA,GAAI,SAAY,wBAAA,IAA4B,KAAA;AAGvF,MAAA,MAAM,oBAAoB,sBAAA,CAAuB;AAAA,QAC/C,wBAAA;AAAA,QACA,wBAAA;AAAA,QACA;AAAA,OACD,CAAA;AAED,MAAA,MAAM,aAAA,uBAAoB,OAAA,EAAc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@elenjical/core/browser';
2
+ import { DEBUG_BUILD } from '../debug-build.js';
3
+ import { eventFromUnknownInput } from '../eventbuilder.js';
4
+ import { WINDOW } from '../helpers.js';
5
+ import { _eventFromRejectionWithPrimitive, _getUnhandledRejectionError } from './globalhandlers.js';
6
+
7
+ const INTEGRATION_NAME = "WebWorker";
8
+ const webWorkerIntegration = defineIntegration(({ worker }) => ({
9
+ name: INTEGRATION_NAME,
10
+ setupOnce: () => {
11
+ (Array.isArray(worker) ? worker : [worker]).forEach((w) => listenForElenjicalMessages(w));
12
+ },
13
+ addWorker: (worker2) => listenForElenjicalMessages(worker2)
14
+ }));
15
+ function listenForElenjicalMessages(worker) {
16
+ worker.addEventListener("message", (event) => {
17
+ if (isElenjicalMessage(event.data)) {
18
+ event.stopImmediatePropagation();
19
+ if (event.data._sentryDebugIds) {
20
+ DEBUG_BUILD && debug.log("Elenjical debugId web worker message received", event.data);
21
+ WINDOW._sentryDebugIds = {
22
+ ...event.data._sentryDebugIds,
23
+ // debugIds of the main thread have precedence over the worker's in case of a collision.
24
+ ...WINDOW._sentryDebugIds
25
+ };
26
+ }
27
+ if (event.data._sentryModuleMetadata) {
28
+ DEBUG_BUILD && debug.log("Elenjical module metadata web worker message received", event.data);
29
+ WINDOW._sentryModuleMetadata = {
30
+ ...event.data._sentryModuleMetadata,
31
+ // Module metadata of the main thread have precedence over the worker's in case of a collision.
32
+ ...WINDOW._sentryModuleMetadata
33
+ };
34
+ }
35
+ if (event.data._elenjicalWasmImages) {
36
+ DEBUG_BUILD && debug.log("Elenjical WASM images web worker message received", event.data);
37
+ const existingImages = WINDOW._elenjicalWasmImages || [];
38
+ const newImages = event.data._elenjicalWasmImages.filter(
39
+ (newImg) => isPlainObject(newImg) && typeof newImg.code_file === "string" && !existingImages.some((existing) => existing.code_file === newImg.code_file)
40
+ );
41
+ WINDOW._elenjicalWasmImages = [
42
+ ...existingImages,
43
+ ...newImages
44
+ ];
45
+ }
46
+ if (event.data._elenjicalWorkerError) {
47
+ DEBUG_BUILD && debug.log("Elenjical worker rejection message received", event.data._elenjicalWorkerError);
48
+ handleForwardedWorkerRejection(event.data._elenjicalWorkerError);
49
+ }
50
+ }
51
+ });
52
+ }
53
+ function handleForwardedWorkerRejection(workerError) {
54
+ const client = getClient();
55
+ if (!client) {
56
+ return;
57
+ }
58
+ const stackParser = client.getOptions().stackParser;
59
+ const attachStacktrace = client.getOptions().attachStacktrace;
60
+ const error = workerError.reason;
61
+ const event = isPrimitive(error) ? _eventFromRejectionWithPrimitive(error) : eventFromUnknownInput(stackParser, error, void 0, attachStacktrace, true);
62
+ event.level = "error";
63
+ if (workerError.filename) {
64
+ event.contexts = {
65
+ ...event.contexts,
66
+ worker: {
67
+ filename: workerError.filename
68
+ }
69
+ };
70
+ }
71
+ captureEvent(event, {
72
+ originalException: error,
73
+ mechanism: {
74
+ handled: false,
75
+ type: "auto.browser.web_worker.onunhandledrejection"
76
+ }
77
+ });
78
+ DEBUG_BUILD && debug.log("Captured worker unhandled rejection", error);
79
+ }
80
+ function registerWebWorker({ self }) {
81
+ self.postMessage({
82
+ _elenjicalMessage: true,
83
+ _sentryDebugIds: self._sentryDebugIds ?? void 0,
84
+ _sentryModuleMetadata: self._sentryModuleMetadata ?? void 0
85
+ });
86
+ self.addEventListener("unhandledrejection", (event) => {
87
+ const reason = _getUnhandledRejectionError(event);
88
+ const serializedError = {
89
+ reason,
90
+ filename: self.location?.href
91
+ };
92
+ self.postMessage({
93
+ _elenjicalMessage: true,
94
+ _elenjicalWorkerError: serializedError
95
+ });
96
+ DEBUG_BUILD && debug.log("[Elenjical Worker] Forwarding unhandled rejection to parent", serializedError);
97
+ });
98
+ DEBUG_BUILD && debug.log("[Elenjical Worker] Registered worker with unhandled rejection handling");
99
+ }
100
+ function isElenjicalMessage(eventData) {
101
+ if (!isPlainObject(eventData) || eventData._elenjicalMessage !== true) {
102
+ return false;
103
+ }
104
+ const hasDebugIds = "_sentryDebugIds" in eventData;
105
+ const hasModuleMetadata = "_sentryModuleMetadata" in eventData;
106
+ const hasWorkerError = "_elenjicalWorkerError" in eventData;
107
+ const hasWasmImages = "_elenjicalWasmImages" in eventData;
108
+ if (!hasDebugIds && !hasModuleMetadata && !hasWorkerError && !hasWasmImages) {
109
+ return false;
110
+ }
111
+ if (hasDebugIds && !(isPlainObject(eventData._sentryDebugIds) || eventData._sentryDebugIds === void 0)) {
112
+ return false;
113
+ }
114
+ if (hasModuleMetadata && !(isPlainObject(eventData._sentryModuleMetadata) || eventData._sentryModuleMetadata === void 0)) {
115
+ return false;
116
+ }
117
+ if (hasWorkerError && !isPlainObject(eventData._elenjicalWorkerError)) {
118
+ return false;
119
+ }
120
+ if (hasWasmImages && (!Array.isArray(eventData._elenjicalWasmImages) || !eventData._elenjicalWasmImages.every(
121
+ (img) => isPlainObject(img) && typeof img.code_file === "string"
122
+ ))) {
123
+ return false;
124
+ }
125
+ return true;
126
+ }
127
+
128
+ export { INTEGRATION_NAME, registerWebWorker, webWorkerIntegration };
129
+ //# sourceMappingURL=webWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webWorker.js","sources":["../../../../../src/integrations/webWorker.ts"],"sourcesContent":["import type { DebugImage, Integration, IntegrationFn } from '@elenjical/core/browser';\nimport { captureEvent, debug, defineIntegration, getClient, isPlainObject, isPrimitive } from '@elenjical/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { WINDOW } from '../helpers';\nimport { _eventFromRejectionWithPrimitive, _getUnhandledRejectionError } from './globalhandlers';\n\nexport const INTEGRATION_NAME = 'WebWorker' as const;\n\ninterface WebWorkerMessage {\n _elenjicalMessage: boolean;\n _sentryDebugIds?: Record<string, string>;\n _sentryModuleMetadata?: Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\n _elenjicalWorkerError?: SerializedWorkerError;\n _elenjicalWasmImages?: Array<DebugImage>;\n}\n\ninterface SerializedWorkerError {\n reason: unknown;\n filename?: string;\n}\n\ninterface WebWorkerIntegrationOptions {\n worker: Worker | Array<Worker>;\n}\n\ninterface WebWorkerIntegration extends Integration {\n addWorker: (worker: Worker) => void;\n}\n\n/**\n * Use this integration to set up Elenjical with web workers.\n *\n * IMPORTANT: This integration must be added **before** you start listening to\n * any messages from the worker. Otherwise, your message handlers will receive\n * messages from the Elenjical SDK which you need to ignore.\n *\n * This integration only has an effect, if you call `Elenjical.registerWebWorker(self)`\n * from within the worker(s) you're adding to the integration.\n *\n * Given that you want to initialize the SDK as early as possible, you most likely\n * want to add this integration **after** initializing the SDK:\n *\n * @example:\n * ```ts filename={main.js}\n * import * as Elenjical from '@elenjical/<your-sdk>';\n *\n * // some time earlier:\n * Elenjical.init(...)\n *\n * // 1. Initialize the worker\n * const worker = new Worker(new URL('./worker.ts', import.meta.url));\n *\n * // 2. Add the integration\n * const webWorkerIntegration = Elenjical.webWorkerIntegration({ worker });\n * Elenjical.addIntegration(webWorkerIntegration);\n *\n * // 3. Register message listeners on the worker\n * worker.addEventListener('message', event => {\n * // ...\n * });\n * ```\n *\n * If you initialize multiple workers at the same time, you can also pass an array of workers\n * to the integration:\n *\n * ```ts filename={main.js}\n * const webWorkerIntegration = Elenjical.webWorkerIntegration({ worker: [worker1, worker2] });\n * Elenjical.addIntegration(webWorkerIntegration);\n * ```\n *\n * If you have any additional workers that you initialize at a later point,\n * you can add them to the integration as follows:\n *\n * ```ts filename={main.js}\n * const webWorkerIntegration = Elenjical.webWorkerIntegration({ worker: worker1 });\n * Elenjical.addIntegration(webWorkerIntegration);\n *\n * // sometime later:\n * webWorkerIntegration.addWorker(worker2);\n * ```\n *\n * Of course, you can also directly add the integration in Elenjical.init:\n * ```ts filename={main.js}\n * import * as Elenjical from '@elenjical/<your-sdk>';\n *\n * // 1. Initialize the worker\n * const worker = new Worker(new URL('./worker.ts', import.meta.url));\n *\n * // 2. Initialize the SDK\n * Elenjical.init({\n * integrations: [Elenjical.webWorkerIntegration({ worker })]\n * });\n *\n * // 3. Register message listeners on the worker\n * worker.addEventListener('message', event => {\n * // ...\n * });\n * ```\n *\n * @param options {WebWorkerIntegrationOptions} Integration options:\n * - `worker`: The worker instance.\n */\nexport const webWorkerIntegration = defineIntegration(({ worker }: WebWorkerIntegrationOptions) => ({\n name: INTEGRATION_NAME,\n setupOnce: () => {\n (Array.isArray(worker) ? worker : [worker]).forEach(w => listenForElenjicalMessages(w));\n },\n addWorker: (worker: Worker) => listenForElenjicalMessages(worker),\n})) as IntegrationFn<WebWorkerIntegration>;\n\nfunction listenForElenjicalMessages(worker: Worker): void {\n worker.addEventListener('message', event => {\n if (isElenjicalMessage(event.data)) {\n event.stopImmediatePropagation(); // other listeners should not receive this message\n\n // Handle debug IDs\n if (event.data._sentryDebugIds) {\n DEBUG_BUILD && debug.log('Elenjical debugId web worker message received', event.data);\n WINDOW._sentryDebugIds = {\n ...event.data._sentryDebugIds,\n // debugIds of the main thread have precedence over the worker's in case of a collision.\n ...WINDOW._sentryDebugIds,\n };\n }\n\n // Handle module metadata\n if (event.data._sentryModuleMetadata) {\n DEBUG_BUILD && debug.log('Elenjical module metadata web worker message received', event.data);\n // Merge worker's raw metadata into the global object\n // It will be parsed lazily when needed by getMetadataForUrl\n WINDOW._sentryModuleMetadata = {\n ...event.data._sentryModuleMetadata,\n // Module metadata of the main thread have precedence over the worker's in case of a collision.\n ...WINDOW._sentryModuleMetadata,\n };\n }\n\n // Handle WASM images from worker\n if (event.data._elenjicalWasmImages) {\n DEBUG_BUILD && debug.log('Elenjical WASM images web worker message received', event.data);\n const existingImages =\n (WINDOW as typeof WINDOW & { _elenjicalWasmImages?: Array<DebugImage> })._elenjicalWasmImages || [];\n const newImages = event.data._elenjicalWasmImages.filter(\n (newImg: unknown) =>\n isPlainObject(newImg) &&\n typeof newImg.code_file === 'string' &&\n !existingImages.some(existing => existing.code_file === newImg.code_file),\n );\n (WINDOW as typeof WINDOW & { _elenjicalWasmImages?: Array<DebugImage> })._elenjicalWasmImages = [\n ...existingImages,\n ...newImages,\n ];\n }\n\n // Handle unhandled rejections forwarded from worker\n if (event.data._elenjicalWorkerError) {\n DEBUG_BUILD && debug.log('Elenjical worker rejection message received', event.data._elenjicalWorkerError);\n handleForwardedWorkerRejection(event.data._elenjicalWorkerError);\n }\n }\n });\n}\n\nfunction handleForwardedWorkerRejection(workerError: SerializedWorkerError): void {\n const client = getClient();\n if (!client) {\n return;\n }\n\n const stackParser = client.getOptions().stackParser;\n const attachStacktrace = client.getOptions().attachStacktrace;\n\n const error = workerError.reason;\n\n // Follow same pattern as globalHandlers for unhandledrejection\n // Handle both primitives and errors the same way\n const event = isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n event.level = 'error';\n\n // Add worker-specific context\n if (workerError.filename) {\n event.contexts = {\n ...event.contexts,\n worker: {\n filename: workerError.filename,\n },\n };\n }\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'auto.browser.web_worker.onunhandledrejection',\n },\n });\n\n DEBUG_BUILD && debug.log('Captured worker unhandled rejection', error);\n}\n\n/**\n * Minimal interface for DedicatedWorkerGlobalScope, only requiring the postMessage method.\n * (which is the only thing we need from the worker's global object)\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope\n *\n * We can't use the actual type because it breaks everyone who doesn't have {\"lib\": [\"WebWorker\"]}\n * but uses {\"skipLibCheck\": true} in their tsconfig.json.\n */\ninterface MinimalDedicatedWorkerGlobalScope {\n postMessage: (message: unknown) => void;\n addEventListener: (type: string, listener: (event: unknown) => void) => void;\n location?: { href?: string };\n}\n\ninterface RegisterWebWorkerOptions {\n self: MinimalDedicatedWorkerGlobalScope & {\n _sentryDebugIds?: Record<string, string>;\n _sentryModuleMetadata?: Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\n };\n}\n\n/**\n * Use this function to register the worker with the Elenjical SDK.\n *\n * This function will:\n * - Send debug IDs to the parent thread\n * - Send module metadata to the parent thread (for thirdPartyErrorFilterIntegration)\n * - Set up a handler for unhandled rejections in the worker\n * - Forward unhandled rejections to the parent thread for capture\n *\n * Note: Synchronous errors in workers are already captured by globalHandlers.\n * This only handles unhandled promise rejections which don't bubble to the parent.\n *\n * @example\n * ```ts filename={worker.js}\n * import * as Elenjical from '@elenjical/<your-sdk>';\n *\n * // Do this as early as possible in your worker.\n * Elenjical.registerWebWorker({ self });\n *\n * // continue setting up your worker\n * self.postMessage(...)\n * ```\n * @param options {RegisterWebWorkerOptions} Integration options:\n * - `self`: The worker instance you're calling this function from (self).\n */\nexport function registerWebWorker({ self }: RegisterWebWorkerOptions): void {\n // Send debug IDs and raw module metadata to parent thread\n // The metadata will be parsed lazily on the main thread when needed\n self.postMessage({\n _elenjicalMessage: true,\n _sentryDebugIds: self._sentryDebugIds ?? undefined,\n _sentryModuleMetadata: self._sentryModuleMetadata ?? undefined,\n });\n\n // Set up unhandledrejection handler inside the worker\n // Following the same pattern as globalHandlers\n // unhandled rejections don't bubble to the parent thread, so we need to handle them here\n self.addEventListener('unhandledrejection', (event: unknown) => {\n const reason = _getUnhandledRejectionError(event);\n\n // Forward the raw reason to parent thread\n // The parent will handle primitives vs errors the same way globalHandlers does\n const serializedError: SerializedWorkerError = {\n reason: reason,\n filename: self.location?.href,\n };\n\n // Forward to parent thread\n self.postMessage({\n _elenjicalMessage: true,\n _elenjicalWorkerError: serializedError,\n });\n\n DEBUG_BUILD && debug.log('[Elenjical Worker] Forwarding unhandled rejection to parent', serializedError);\n });\n\n DEBUG_BUILD && debug.log('[Elenjical Worker] Registered worker with unhandled rejection handling');\n}\n\nfunction isElenjicalMessage(eventData: unknown): eventData is WebWorkerMessage {\n if (!isPlainObject(eventData) || eventData._elenjicalMessage !== true) {\n return false;\n }\n\n // Must have at least one of: debug IDs, module metadata, worker error, or WASM images\n const hasDebugIds = '_sentryDebugIds' in eventData;\n const hasModuleMetadata = '_sentryModuleMetadata' in eventData;\n const hasWorkerError = '_elenjicalWorkerError' in eventData;\n const hasWasmImages = '_elenjicalWasmImages' in eventData;\n\n if (!hasDebugIds && !hasModuleMetadata && !hasWorkerError && !hasWasmImages) {\n return false;\n }\n\n // Validate debug IDs if present\n if (hasDebugIds && !(isPlainObject(eventData._sentryDebugIds) || eventData._sentryDebugIds === undefined)) {\n return false;\n }\n\n // Validate module metadata if present\n if (\n hasModuleMetadata &&\n !(isPlainObject(eventData._sentryModuleMetadata) || eventData._sentryModuleMetadata === undefined)\n ) {\n return false;\n }\n\n // Validate worker error if present\n if (hasWorkerError && !isPlainObject(eventData._elenjicalWorkerError)) {\n return false;\n }\n\n // Validate WASM images if present\n if (\n hasWasmImages &&\n (!Array.isArray(eventData._elenjicalWasmImages) ||\n !eventData._elenjicalWasmImages.every(\n (img: unknown) => isPlainObject(img) && typeof (img as { code_file?: unknown }).code_file === 'string',\n ))\n ) {\n return false;\n }\n\n return true;\n}\n"],"names":["worker"],"mappings":";;;;;;AAOO,MAAM,gBAAA,GAAmB;AAgGzB,MAAM,oBAAA,GAAuB,iBAAA,CAAkB,CAAC,EAAE,QAAO,MAAoC;AAAA,EAClG,IAAA,EAAM,gBAAA;AAAA,EACN,WAAW,MAAM;AACf,IAAA,CAAC,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,GAAI,MAAA,GAAS,CAAC,MAAM,CAAA,EAAG,OAAA,CAAQ,CAAA,CAAA,KAAK,0BAAA,CAA2B,CAAC,CAAC,CAAA;AAAA,EACxF,CAAA;AAAA,EACA,SAAA,EAAW,CAACA,OAAAA,KAAmB,0BAAA,CAA2BA,OAAM;AAClE,CAAA,CAAE;AAEF,SAAS,2BAA2B,MAAA,EAAsB;AACxD,EAAA,MAAA,CAAO,gBAAA,CAAiB,WAAW,CAAA,KAAA,KAAS;AAC1C,IAAA,IAAI,kBAAA,CAAmB,KAAA,CAAM,IAAI,CAAA,EAAG;AAClC,MAAA,KAAA,CAAM,wBAAA,EAAyB;AAG/B,MAAA,IAAI,KAAA,CAAM,KAA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A,CAAc,SAAA,CAAU,qBAAqB,CAAA,IAAK,SAAA,CAAU,0BAA0B,MAAA,CAAA,EACxF;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AAGA,EAAA,IAAI,cAAA,IAAkB,CAAC,aAAA,CAAc,SAAA,CAAU,qBAAqB,CAAA,EAAG;AACrE,IAAA,OAAO,KAAA;AAAA,EACT;AAGA,EAAA,IACE,aAAA,KACC,CAAC,KAAA,CAAM,OAAA,CAAQ,UAAU,oBAAoB,CAAA,IAC5C,CAAC,SAAA,CAAU,oBAAA,CAAqB,KAAA;AAAA,IAC9B,CAAC,GAAA,KAAiB,aAAA,CAAc,GAAG,CAAA,IAAK,OAAQ,IAAgC,SAAA,KAAc;AAAA,GAChG,CAAA,EACF;AACA,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA;AACT;;;;"}
@@ -0,0 +1,25 @@
1
+ import { isElement, htmlTreeAsString } from '@elenjical/browser-utils';
2
+
3
+ const HTML_ELEMENT_CONSTRUCTOR_NAME_REGEX = /^HTML(\w*)Element$/;
4
+ function normalizeStringifyValue(value) {
5
+ if (typeof window !== "undefined" && value === window) {
6
+ return "[Window]";
7
+ }
8
+ if (typeof document !== "undefined" && value === document) {
9
+ return "[Document]";
10
+ }
11
+ if (isElement(value)) {
12
+ const objName = getConstructorName(value);
13
+ if (HTML_ELEMENT_CONSTRUCTOR_NAME_REGEX.test(objName)) {
14
+ return `[HTMLElement: ${htmlTreeAsString(value)}]`;
15
+ }
16
+ }
17
+ return void 0;
18
+ }
19
+ function getConstructorName(value) {
20
+ const prototype = Object.getPrototypeOf(value);
21
+ return prototype?.constructor ? prototype.constructor.name : "null prototype";
22
+ }
23
+
24
+ export { normalizeStringifyValue };
25
+ //# sourceMappingURL=normalizeStringifyValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeStringifyValue.js","sources":["../../../../src/normalizeStringifyValue.ts"],"sourcesContent":["import { htmlTreeAsString, isElement } from '@elenjical/browser-utils';\n\ntype Prototype = { constructor?: (...args: unknown[]) => unknown };\n\nconst HTML_ELEMENT_CONSTRUCTOR_NAME_REGEX = /^HTML(\\w*)Element$/;\n\n/**\n * Browser-specific contributions to `normalize()`'s `stringifyValue`. Plug into\n * `setNormalizeStringifier` from the browser SDK so DOM values get a useful string\n * representation without forcing core to carry the DOM-specific code.\n *\n * Handles:\n * - `window` → `[Window]`\n * - `document` → `[Document]`\n * - `HTMLElement` subclasses → `[HTMLElement: <css-selector-path>]` (via `htmlTreeAsString`)\n *\n * Vue ViewModels and React SyntheticEvents are not handled here — the Vue and React\n * SDKs wrap this function in their `init` and add their own checks on top.\n */\nexport function normalizeStringifyValue(value: Exclude<unknown, string | number | boolean | null>): string | undefined {\n // oxlint-disable-next-line no-restricted-globals\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n }\n // oxlint-disable-next-line no-restricted-globals\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n }\n\n if (isElement(value)) {\n const objName = getConstructorName(value);\n if (HTML_ELEMENT_CONSTRUCTOR_NAME_REGEX.test(objName)) {\n return `[HTMLElement: ${htmlTreeAsString(value)}]`;\n }\n }\n\n return undefined;\n}\n\nfunction getConstructorName(value: unknown): string {\n const prototype: Prototype | null = Object.getPrototypeOf(value);\n\n return prototype?.constructor ? prototype.constructor.name : 'null prototype';\n}\n"],"names":[],"mappings":";;AAIA,MAAM,mCAAA,GAAsC,oBAAA;AAerC,SAAS,wBAAwB,KAAA,EAA+E;AAErH,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,IAAe,KAAA,KAAU,MAAA,EAAQ;AACrD,IAAA,OAAO,UAAA;AAAA,EACT;AAEA,EAAA,IAAI,OAAO,QAAA,KAAa,WAAA,IAAe,KAAA,KAAU,QAAA,EAAU;AACzD,IAAA,OAAO,YAAA;AAAA,EACT;AAEA,EAAA,IAAI,SAAA,CAAU,KAAK,CAAA,EAAG;AACpB,IAAA,MAAM,OAAA,GAAU,mBAAmB,KAAK,CAAA;AACxC,IAAA,IAAI,mCAAA,CAAoC,IAAA,CAAK,OAAO,CAAA,EAAG;AACrD,MAAA,OAAO,CAAA,cAAA,EAAiB,gBAAA,CAAiB,KAAK,CAAC,CAAA,CAAA,CAAA;AAAA,IACjD;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,mBAAmB,KAAA,EAAwB;AAClD,EAAA,MAAM,SAAA,GAA8B,MAAA,CAAO,cAAA,CAAe,KAAK,CAAA;AAE/D,EAAA,OAAO,SAAA,EAAW,WAAA,GAAc,SAAA,CAAU,WAAA,CAAY,IAAA,GAAO,gBAAA;AAC/D;;;;"}
@@ -0,0 +1 @@
1
+ {"type":"module","version":"10.76.2","sideEffects":false}
@@ -0,0 +1,304 @@
1
+ import { debug, uuid4, getGlobalScope, getRootSpan, getSdkMetadataForEnvelopeHeader, createEnvelope, dsnToString } from '@elenjical/core/browser';
2
+ import { DEBUG_BUILD } from '../debug-build.js';
3
+ import { shouldProfileSession, setThreadAttributes, startJSSelfProfile, createProfileChunkPayload, validateProfileChunk } from './utils.js';
4
+
5
+ const CHUNK_INTERVAL_MS = 6e4;
6
+ const MAX_ROOT_SPAN_PROFILE_MS = 3e5;
7
+ class UIProfiler {
8
+ constructor() {
9
+ this._client = void 0;
10
+ this._profiler = void 0;
11
+ this._chunkTimer = void 0;
12
+ this._profilerId = void 0;
13
+ this._isRunning = false;
14
+ this._sessionSampled = false;
15
+ this._lifecycleMode = void 0;
16
+ this._activeRootSpanIds = /* @__PURE__ */ new Set();
17
+ this._rootSpanTimeouts = /* @__PURE__ */ new Map();
18
+ }
19
+ /**
20
+ * Initialize the profiler with client, session sampling and lifecycle mode.
21
+ */
22
+ initialize(client) {
23
+ const lifecycleMode = client.getOptions().profileLifecycle;
24
+ const sessionSampled = shouldProfileSession(client.getOptions());
25
+ DEBUG_BUILD && debug.log(`[Profiling] Initializing profiler (lifecycle='${lifecycleMode}').`);
26
+ if (!sessionSampled) {
27
+ DEBUG_BUILD && debug.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization.");
28
+ }
29
+ this._profilerId = uuid4();
30
+ this._client = client;
31
+ this._sessionSampled = sessionSampled;
32
+ this._lifecycleMode = lifecycleMode;
33
+ if (lifecycleMode === "trace") {
34
+ this._setupTraceLifecycleListeners(client);
35
+ }
36
+ client.on("spanStart", (span) => {
37
+ if (this._isRunning) {
38
+ setThreadAttributes(span);
39
+ }
40
+ });
41
+ }
42
+ /** Starts UI profiling (only effective in 'manual' mode and when sampled). */
43
+ start() {
44
+ if (this._lifecycleMode === "trace") {
45
+ DEBUG_BUILD && debug.warn(
46
+ '[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.'
47
+ );
48
+ return;
49
+ }
50
+ if (this._isRunning) {
51
+ DEBUG_BUILD && debug.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");
52
+ return;
53
+ }
54
+ if (!this._sessionSampled) {
55
+ DEBUG_BUILD && debug.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");
56
+ return;
57
+ }
58
+ this._beginProfiling();
59
+ }
60
+ /** Stops UI profiling (only effective in 'manual' mode). */
61
+ stop() {
62
+ if (this._lifecycleMode === "trace") {
63
+ DEBUG_BUILD && debug.warn(
64
+ '[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.'
65
+ );
66
+ return;
67
+ }
68
+ if (!this._isRunning) {
69
+ DEBUG_BUILD && debug.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");
70
+ return;
71
+ }
72
+ this._endProfiling();
73
+ }
74
+ /** Handle an already-active root span at integration setup time (used only in trace mode). */
75
+ notifyRootSpanActive(rootSpan) {
76
+ if (this._lifecycleMode !== "trace" || !this._sessionSampled) {
77
+ return;
78
+ }
79
+ const spanId = rootSpan.spanContext().spanId;
80
+ if (!spanId || this._activeRootSpanIds.has(spanId)) {
81
+ return;
82
+ }
83
+ this._registerTraceRootSpan(spanId);
84
+ const rootSpanCount = this._activeRootSpanIds.size;
85
+ if (rootSpanCount === 1) {
86
+ DEBUG_BUILD && debug.log("[Profiling] Detected already active root span during setup. Active root spans now:", rootSpanCount);
87
+ this._beginProfiling();
88
+ }
89
+ if (this._isRunning) {
90
+ setThreadAttributes(rootSpan);
91
+ }
92
+ }
93
+ /**
94
+ * Begin profiling if not already running.
95
+ */
96
+ _beginProfiling() {
97
+ if (this._isRunning) {
98
+ return;
99
+ }
100
+ this._isRunning = true;
101
+ DEBUG_BUILD && debug.log("[Profiling] Started profiling with profiler ID:", this._profilerId);
102
+ getGlobalScope().setContext("profile", { profiler_id: this._profilerId });
103
+ this._startProfilerInstance();
104
+ if (!this._profiler) {
105
+ DEBUG_BUILD && debug.log("[Profiling] Failed to start JS Profiler; stopping.");
106
+ this._resetProfilerInfo();
107
+ return;
108
+ }
109
+ this._startPeriodicChunking();
110
+ }
111
+ /** End profiling session; final chunk will be collected and sent. */
112
+ _endProfiling() {
113
+ if (!this._isRunning) {
114
+ return;
115
+ }
116
+ this._isRunning = false;
117
+ if (this._chunkTimer) {
118
+ clearTimeout(this._chunkTimer);
119
+ this._chunkTimer = void 0;
120
+ }
121
+ this._clearAllRootSpanTimeouts();
122
+ this._collectCurrentChunk().catch((e) => {
123
+ DEBUG_BUILD && debug.error("[Profiling] Failed to collect current profile chunk on `stop()`:", e);
124
+ });
125
+ if (this._lifecycleMode === "manual") {
126
+ getGlobalScope().setContext("profile", {});
127
+ }
128
+ }
129
+ /** Trace-mode: attach spanStart/spanEnd listeners. */
130
+ _setupTraceLifecycleListeners(client) {
131
+ client.on("spanStart", (span) => {
132
+ if (!this._sessionSampled) {
133
+ DEBUG_BUILD && debug.log("[Profiling] Span not profiled because of negative sampling decision for user session.");
134
+ return;
135
+ }
136
+ if (span !== getRootSpan(span)) {
137
+ return;
138
+ }
139
+ if (!span.isRecording()) {
140
+ DEBUG_BUILD && debug.log("[Profiling] Discarding profile because root span was not sampled.");
141
+ return;
142
+ }
143
+ const spanId = span.spanContext().spanId;
144
+ if (!spanId || this._activeRootSpanIds.has(spanId)) {
145
+ return;
146
+ }
147
+ this._registerTraceRootSpan(spanId);
148
+ const rootSpanCount = this._activeRootSpanIds.size;
149
+ if (rootSpanCount === 1) {
150
+ DEBUG_BUILD && debug.log(
151
+ `[Profiling] Root span ${spanId} started. Profiling active while there are active root spans (count=${rootSpanCount}).`
152
+ );
153
+ this._beginProfiling();
154
+ }
155
+ });
156
+ client.on("spanEnd", (span) => {
157
+ if (!this._sessionSampled) {
158
+ return;
159
+ }
160
+ const spanId = span.spanContext().spanId;
161
+ if (!spanId || !this._activeRootSpanIds.has(spanId)) {
162
+ return;
163
+ }
164
+ this._activeRootSpanIds.delete(spanId);
165
+ const rootSpanCount = this._activeRootSpanIds.size;
166
+ DEBUG_BUILD && debug.log(
167
+ `[Profiling] Root span with ID ${spanId} ended. Will continue profiling for as long as there are active root spans (currently: ${rootSpanCount}).`
168
+ );
169
+ if (rootSpanCount === 0) {
170
+ this._collectCurrentChunk().catch((e) => {
171
+ DEBUG_BUILD && debug.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:", e);
172
+ });
173
+ this._endProfiling();
174
+ }
175
+ });
176
+ }
177
+ /**
178
+ * Resets profiling information from scope and resets running state (used on failure)
179
+ */
180
+ _resetProfilerInfo() {
181
+ this._isRunning = false;
182
+ getGlobalScope().setContext("profile", {});
183
+ }
184
+ /**
185
+ * Clear and reset all per-root-span timeouts.
186
+ */
187
+ _clearAllRootSpanTimeouts() {
188
+ this._rootSpanTimeouts.forEach((timeout) => clearTimeout(timeout));
189
+ this._rootSpanTimeouts.clear();
190
+ }
191
+ /** Keep track of root spans and schedule safeguard timeout (trace mode). */
192
+ _registerTraceRootSpan(spanId) {
193
+ this._activeRootSpanIds.add(spanId);
194
+ const timeout = setTimeout(() => this._onRootSpanTimeout(spanId), MAX_ROOT_SPAN_PROFILE_MS);
195
+ this._rootSpanTimeouts.set(spanId, timeout);
196
+ }
197
+ /**
198
+ * Start a profiler instance if needed.
199
+ */
200
+ _startProfilerInstance() {
201
+ if (this._profiler?.stopped === false) {
202
+ return;
203
+ }
204
+ const profiler = startJSSelfProfile();
205
+ if (!profiler) {
206
+ DEBUG_BUILD && debug.log("[Profiling] Failed to start JS Profiler.");
207
+ return;
208
+ }
209
+ this._profiler = profiler;
210
+ }
211
+ /**
212
+ * Schedule the next 60s chunk while running.
213
+ * Each tick collects a chunk and restarts the profiler.
214
+ * A chunk should be closed when there are no active root spans anymore OR when the maximum chunk interval is reached.
215
+ */
216
+ _startPeriodicChunking() {
217
+ if (!this._isRunning) {
218
+ return;
219
+ }
220
+ this._chunkTimer = setTimeout(() => {
221
+ this._collectCurrentChunk().catch((e) => {
222
+ DEBUG_BUILD && debug.error("[Profiling] Failed to collect current profile chunk during periodic chunking:", e);
223
+ });
224
+ if (this._isRunning) {
225
+ this._startProfilerInstance();
226
+ if (!this._profiler) {
227
+ this._resetProfilerInfo();
228
+ return;
229
+ }
230
+ this._startPeriodicChunking();
231
+ }
232
+ }, CHUNK_INTERVAL_MS);
233
+ }
234
+ /**
235
+ * Handle timeout for a specific root span ID to avoid indefinitely running profiler if `spanEnd` never fires.
236
+ * If this was the last active root span, collect the current chunk and stop profiling.
237
+ */
238
+ _onRootSpanTimeout(rootSpanId) {
239
+ if (!this._rootSpanTimeouts.has(rootSpanId)) {
240
+ return;
241
+ }
242
+ this._rootSpanTimeouts.delete(rootSpanId);
243
+ if (!this._activeRootSpanIds.has(rootSpanId)) {
244
+ return;
245
+ }
246
+ DEBUG_BUILD && debug.log(
247
+ `[Profiling] Reached 5-minute timeout for root span ${rootSpanId}. You likely started a manual root span that never called \`.end()\`.`
248
+ );
249
+ this._activeRootSpanIds.delete(rootSpanId);
250
+ if (this._activeRootSpanIds.size === 0) {
251
+ this._endProfiling();
252
+ }
253
+ }
254
+ /**
255
+ * Stop current profiler instance, convert profile to chunk & send.
256
+ */
257
+ async _collectCurrentChunk() {
258
+ const prevProfiler = this._profiler;
259
+ this._profiler = void 0;
260
+ if (!prevProfiler) {
261
+ return;
262
+ }
263
+ try {
264
+ const profile = await prevProfiler.stop();
265
+ const chunk = createProfileChunkPayload(profile, this._client, this._profilerId);
266
+ const validationReturn = validateProfileChunk(chunk);
267
+ if ("reason" in validationReturn) {
268
+ DEBUG_BUILD && debug.log(
269
+ "[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",
270
+ validationReturn.reason
271
+ );
272
+ return;
273
+ }
274
+ this._sendProfileChunk(chunk);
275
+ DEBUG_BUILD && debug.log("[Profiling] Collected browser profile chunk.");
276
+ } catch (e) {
277
+ DEBUG_BUILD && debug.log("[Profiling] Error while stopping JS Profiler for chunk:", e);
278
+ }
279
+ }
280
+ /**
281
+ * Send a profile chunk as a standalone envelope.
282
+ */
283
+ _sendProfileChunk(chunk) {
284
+ const client = this._client;
285
+ const sdkInfo = getSdkMetadataForEnvelopeHeader(client.getSdkMetadata?.());
286
+ const dsn = client.getDsn();
287
+ const tunnel = client.getOptions().tunnel;
288
+ const envelope = createEnvelope(
289
+ {
290
+ event_id: uuid4(),
291
+ sent_at: (/* @__PURE__ */ new Date()).toISOString(),
292
+ ...sdkInfo && { sdk: sdkInfo },
293
+ ...!!tunnel && dsn && { dsn: dsnToString(dsn) }
294
+ },
295
+ [[{ type: "profile_chunk", platform: "javascript" }, chunk]]
296
+ );
297
+ client.sendEnvelope(envelope).then(null, (reason) => {
298
+ DEBUG_BUILD && debug.error("Error while sending profile chunk envelope:", reason);
299
+ });
300
+ }
301
+ }
302
+
303
+ export { UIProfiler };
304
+ //# sourceMappingURL=UIProfiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UIProfiler.js","sources":["../../../../../src/profiling/UIProfiler.ts"],"sourcesContent":["import type { Client, ContinuousProfiler, ProfileChunk, ProfileChunkEnvelope, Span } from '@elenjical/core/browser';\nimport {\n createEnvelope,\n debug,\n dsnToString,\n getGlobalScope,\n getRootSpan,\n getSdkMetadataForEnvelopeHeader,\n uuid4,\n} from '@elenjical/core/browser';\nimport type { BrowserOptions } from '../client';\nimport { DEBUG_BUILD } from './../debug-build';\nimport type { JSSelfProfiler } from './jsSelfProfiling';\nimport {\n createProfileChunkPayload,\n setThreadAttributes,\n shouldProfileSession,\n startJSSelfProfile,\n validateProfileChunk,\n} from './utils';\n\nconst CHUNK_INTERVAL_MS = 60_000; // 1 minute\n// Maximum length for trace lifecycle profiling per root span (e.g. if spanEnd never fires)\nconst MAX_ROOT_SPAN_PROFILE_MS = 300_000; // 5 minutes max per root span in trace mode\n\n/**\n * UIProfiler (Profiling V2):\n * Supports two lifecycle modes:\n * - 'manual': controlled explicitly via start()/stop()\n * - 'trace': automatically runs while there are active sampled root spans\n *\n * Profiles are emitted as standalone `profile_chunk` envelopes either when:\n * - there are no more sampled root spans, or\n * - the 60s chunk timer elapses while profiling is running.\n */\nexport class UIProfiler implements ContinuousProfiler<Client> {\n private _client: Client | undefined;\n private _profiler: JSSelfProfiler | undefined;\n private _chunkTimer: ReturnType<typeof setTimeout> | undefined;\n\n // Manual + Trace\n private _profilerId: string | undefined; // one per Profiler session\n private _isRunning: boolean; // current profiler instance active flag\n private _sessionSampled: boolean; // sampling decision for entire session\n private _lifecycleMode: 'manual' | 'trace' | undefined;\n\n // Trace-only\n private _activeRootSpanIds: Set<string>;\n private _rootSpanTimeouts: Map<string, ReturnType<typeof setTimeout>>;\n\n public constructor() {\n this._client = undefined;\n this._profiler = undefined;\n this._chunkTimer = undefined;\n\n this._profilerId = undefined;\n this._isRunning = false;\n this._sessionSampled = false;\n this._lifecycleMode = undefined;\n\n this._activeRootSpanIds = new Set();\n this._rootSpanTimeouts = new Map();\n }\n\n /**\n * Initialize the profiler with client, session sampling and lifecycle mode.\n */\n public initialize(client: Client): void {\n const lifecycleMode = (client.getOptions() as BrowserOptions).profileLifecycle;\n const sessionSampled = shouldProfileSession(client.getOptions());\n\n DEBUG_BUILD && debug.log(`[Profiling] Initializing profiler (lifecycle='${lifecycleMode}').`);\n\n if (!sessionSampled) {\n DEBUG_BUILD && debug.log('[Profiling] Session not sampled. Skipping lifecycle profiler initialization.');\n }\n\n // One Profiler ID per profiling session (user session)\n this._profilerId = uuid4();\n this._client = client;\n this._sessionSampled = sessionSampled;\n this._lifecycleMode = lifecycleMode;\n\n if (lifecycleMode === 'trace') {\n this._setupTraceLifecycleListeners(client);\n }\n\n client.on('spanStart', span => {\n if (this._isRunning) {\n setThreadAttributes(span);\n }\n });\n }\n\n /** Starts UI profiling (only effective in 'manual' mode and when sampled). */\n public start(): void {\n if (this._lifecycleMode === 'trace') {\n DEBUG_BUILD &&\n debug.warn(\n '[Profiling] `profileLifecycle` is set to \"trace\". Calls to `uiProfiler.start()` are ignored in trace mode.',\n );\n return;\n }\n\n if (this._isRunning) {\n DEBUG_BUILD && debug.warn('[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.');\n return;\n }\n\n if (!this._sessionSampled) {\n DEBUG_BUILD && debug.warn('[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.');\n return;\n }\n\n this._beginProfiling();\n }\n\n /** Stops UI profiling (only effective in 'manual' mode). */\n public stop(): void {\n if (this._lifecycleMode === 'trace') {\n DEBUG_BUILD &&\n debug.warn(\n '[Profiling] `profileLifecycle` is set to \"trace\". Calls to `uiProfiler.stop()` are ignored in trace mode.',\n );\n return;\n }\n\n if (!this._isRunning) {\n DEBUG_BUILD && debug.warn('[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.');\n return;\n }\n\n this._endProfiling();\n }\n\n /** Handle an already-active root span at integration setup time (used only in trace mode). */\n public notifyRootSpanActive(rootSpan: Span): void {\n if (this._lifecycleMode !== 'trace' || !this._sessionSampled) {\n return;\n }\n\n const spanId = rootSpan.spanContext().spanId;\n if (!spanId || this._activeRootSpanIds.has(spanId)) {\n return;\n }\n\n this._registerTraceRootSpan(spanId);\n\n const rootSpanCount = this._activeRootSpanIds.size;\n\n if (rootSpanCount === 1) {\n DEBUG_BUILD &&\n debug.log('[Profiling] Detected already active root span during setup. Active root spans now:', rootSpanCount);\n\n this._beginProfiling();\n }\n\n if (this._isRunning) {\n setThreadAttributes(rootSpan);\n }\n }\n\n /**\n * Begin profiling if not already running.\n */\n private _beginProfiling(): void {\n if (this._isRunning) {\n return;\n }\n this._isRunning = true;\n\n DEBUG_BUILD && debug.log('[Profiling] Started profiling with profiler ID:', this._profilerId);\n\n // Expose profiler_id to match root spans with profiles\n getGlobalScope().setContext('profile', { profiler_id: this._profilerId });\n\n this._startProfilerInstance();\n\n if (!this._profiler) {\n DEBUG_BUILD && debug.log('[Profiling] Failed to start JS Profiler; stopping.');\n this._resetProfilerInfo();\n return;\n }\n\n this._startPeriodicChunking();\n }\n\n /** End profiling session; final chunk will be collected and sent. */\n private _endProfiling(): void {\n if (!this._isRunning) {\n return;\n }\n this._isRunning = false;\n\n if (this._chunkTimer) {\n clearTimeout(this._chunkTimer);\n this._chunkTimer = undefined;\n }\n\n this._clearAllRootSpanTimeouts();\n\n // Collect whatever was currently recording\n this._collectCurrentChunk().catch(e => {\n DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on `stop()`:', e);\n });\n\n // Manual: Clear profiling context so spans outside start()/stop() aren't marked as profiled\n // Trace: Profile context is kept for the whole session duration\n if (this._lifecycleMode === 'manual') {\n getGlobalScope().setContext('profile', {});\n }\n }\n\n /** Trace-mode: attach spanStart/spanEnd listeners. */\n private _setupTraceLifecycleListeners(client: Client): void {\n client.on('spanStart', span => {\n if (!this._sessionSampled) {\n DEBUG_BUILD &&\n debug.log('[Profiling] Span not profiled because of negative sampling decision for user session.');\n return;\n }\n if (span !== getRootSpan(span)) {\n return; // only care about root spans\n }\n // Only count sampled root spans\n if (!span.isRecording()) {\n DEBUG_BUILD && debug.log('[Profiling] Discarding profile because root span was not sampled.');\n return;\n }\n\n const spanId = span.spanContext().spanId;\n if (!spanId || this._activeRootSpanIds.has(spanId)) {\n return;\n }\n\n this._registerTraceRootSpan(spanId);\n\n const rootSpanCount = this._activeRootSpanIds.size;\n if (rootSpanCount === 1) {\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Root span ${spanId} started. Profiling active while there are active root spans (count=${rootSpanCount}).`,\n );\n this._beginProfiling();\n }\n });\n\n client.on('spanEnd', span => {\n if (!this._sessionSampled) {\n return;\n }\n const spanId = span.spanContext().spanId;\n if (!spanId || !this._activeRootSpanIds.has(spanId)) {\n return;\n }\n this._activeRootSpanIds.delete(spanId);\n const rootSpanCount = this._activeRootSpanIds.size;\n\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Root span with ID ${spanId} ended. Will continue profiling for as long as there are active root spans (currently: ${rootSpanCount}).`,\n );\n if (rootSpanCount === 0) {\n this._collectCurrentChunk().catch(e => {\n DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on last `spanEnd`:', e);\n });\n this._endProfiling();\n }\n });\n }\n\n /**\n * Resets profiling information from scope and resets running state (used on failure)\n */\n private _resetProfilerInfo(): void {\n this._isRunning = false;\n getGlobalScope().setContext('profile', {});\n }\n\n /**\n * Clear and reset all per-root-span timeouts.\n */\n private _clearAllRootSpanTimeouts(): void {\n this._rootSpanTimeouts.forEach(timeout => clearTimeout(timeout));\n this._rootSpanTimeouts.clear();\n }\n\n /** Keep track of root spans and schedule safeguard timeout (trace mode). */\n private _registerTraceRootSpan(spanId: string): void {\n this._activeRootSpanIds.add(spanId);\n const timeout = setTimeout(() => this._onRootSpanTimeout(spanId), MAX_ROOT_SPAN_PROFILE_MS);\n this._rootSpanTimeouts.set(spanId, timeout);\n }\n\n /**\n * Start a profiler instance if needed.\n */\n private _startProfilerInstance(): void {\n if (this._profiler?.stopped === false) {\n return; // already running\n }\n const profiler = startJSSelfProfile();\n if (!profiler) {\n DEBUG_BUILD && debug.log('[Profiling] Failed to start JS Profiler.');\n return;\n }\n this._profiler = profiler;\n }\n\n /**\n * Schedule the next 60s chunk while running.\n * Each tick collects a chunk and restarts the profiler.\n * A chunk should be closed when there are no active root spans anymore OR when the maximum chunk interval is reached.\n */\n private _startPeriodicChunking(): void {\n if (!this._isRunning) {\n return;\n }\n\n this._chunkTimer = setTimeout(() => {\n this._collectCurrentChunk().catch(e => {\n DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk during periodic chunking:', e);\n });\n\n if (this._isRunning) {\n this._startProfilerInstance();\n\n if (!this._profiler) {\n // If restart failed, stop scheduling further chunks and reset context.\n this._resetProfilerInfo();\n return;\n }\n\n this._startPeriodicChunking();\n }\n }, CHUNK_INTERVAL_MS);\n }\n\n /**\n * Handle timeout for a specific root span ID to avoid indefinitely running profiler if `spanEnd` never fires.\n * If this was the last active root span, collect the current chunk and stop profiling.\n */\n private _onRootSpanTimeout(rootSpanId: string): void {\n // If span already ended, ignore\n if (!this._rootSpanTimeouts.has(rootSpanId)) {\n return;\n }\n this._rootSpanTimeouts.delete(rootSpanId);\n\n if (!this._activeRootSpanIds.has(rootSpanId)) {\n return;\n }\n\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Reached 5-minute timeout for root span ${rootSpanId}. You likely started a manual root span that never called \\`.end()\\`.`,\n );\n\n this._activeRootSpanIds.delete(rootSpanId);\n\n if (this._activeRootSpanIds.size === 0) {\n this._endProfiling();\n }\n }\n\n /**\n * Stop current profiler instance, convert profile to chunk & send.\n */\n private async _collectCurrentChunk(): Promise<void> {\n const prevProfiler = this._profiler;\n this._profiler = undefined;\n\n if (!prevProfiler) {\n return;\n }\n\n try {\n const profile = await prevProfiler.stop();\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const chunk = createProfileChunkPayload(profile, this._client!, this._profilerId);\n\n // Validate chunk before sending\n const validationReturn = validateProfileChunk(chunk);\n if ('reason' in validationReturn) {\n DEBUG_BUILD &&\n debug.log(\n '[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):',\n validationReturn.reason,\n );\n return;\n }\n\n this._sendProfileChunk(chunk);\n\n DEBUG_BUILD && debug.log('[Profiling] Collected browser profile chunk.');\n } catch (e) {\n DEBUG_BUILD && debug.log('[Profiling] Error while stopping JS Profiler for chunk:', e);\n }\n }\n\n /**\n * Send a profile chunk as a standalone envelope.\n */\n private _sendProfileChunk(chunk: ProfileChunk): void {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const client = this._client!;\n\n const sdkInfo = getSdkMetadataForEnvelopeHeader(client.getSdkMetadata?.());\n const dsn = client.getDsn();\n const tunnel = client.getOptions().tunnel;\n\n const envelope = createEnvelope<ProfileChunkEnvelope>(\n {\n event_id: uuid4(),\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n },\n [[{ type: 'profile_chunk', platform: 'javascript' }, chunk]],\n );\n\n client.sendEnvelope(envelope).then(null, reason => {\n DEBUG_BUILD && debug.error('Error while sending profile chunk envelope:', reason);\n });\n }\n}\n"],"names":[],"mappings":";;;;AAqBA,MAAM,iBAAA,GAAoB,GAAA;AAE1B,MAAM,wBAAA,GAA2B,GAAA;AAY1B,MAAM,UAAA,CAAiD;AAAA,EAerD,WAAA,GAAc;AACnB,IAAA,IAAA,CAAK,OAAA,GAAU,MAAA;AACf,IAAA,IAAA,CAAK,SAAA,GAAY,MAAA;AACjB,IAAA,IAAA,CAAK,WAAA,GAAc,MAAA;AAEnB,IAAA,IAAA,CAAK,WAAA,GAAc,MAAA;AACnB,IAAA,IAAA,CAAK,UAAA,GAAa,KAAA;AAClB,IAAA,IAAA,CAAK,eAAA,GAAkB,KAAA;AACvB,IAAA,IAAA,CAAK,cAAA,GAAiB,MAAA;AAEtB,IAAA,IAAA,CAAK,kBAAA,uBAAyB,GAAA,EAAI;AAClC,IAAA,IAAA,CAAK,iBAAA,uBAAwB,GAAA,EAAI;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA,EAKO,WAAW,MAAA,EAAsB;AACtC,IAAA,MAAM,aAAA,GAAiB,MAAA,CAAO,UAAA,EAAW,CAAqB,gBAAA;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