@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,249 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const browser = require('@elenjical/core/browser');
4
+ const browserUtils = require('@elenjical/browser-utils');
5
+ const debugBuild = require('../debug-build.js');
6
+ const helpers = require('../helpers.js');
7
+
8
+ const MAX_ALLOWED_STRING_LENGTH = 1024;
9
+ const INTEGRATION_NAME = "Breadcrumbs";
10
+ const _breadcrumbsIntegration = ((options = {}) => {
11
+ const _options = {
12
+ console: true,
13
+ dom: true,
14
+ fetch: true,
15
+ history: true,
16
+ elenjical: true,
17
+ xhr: true,
18
+ ...options
19
+ };
20
+ return {
21
+ name: INTEGRATION_NAME,
22
+ setup(client) {
23
+ if (_options.console) {
24
+ browser.addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));
25
+ }
26
+ if (_options.dom) {
27
+ browserUtils.addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));
28
+ }
29
+ if (_options.xhr) {
30
+ browserUtils.addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));
31
+ }
32
+ if (_options.fetch) {
33
+ browser.addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));
34
+ }
35
+ if (_options.history) {
36
+ browserUtils.addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));
37
+ }
38
+ if (_options.elenjical) {
39
+ client.on("beforeSendEvent", _getElenjicalBreadcrumbHandler(client));
40
+ }
41
+ }
42
+ };
43
+ });
44
+ const breadcrumbsIntegration = browser.defineIntegration(_breadcrumbsIntegration);
45
+ function _getElenjicalBreadcrumbHandler(client) {
46
+ return function addElenjicalBreadcrumb(event) {
47
+ if (browser.getClient() !== client) {
48
+ return;
49
+ }
50
+ browser.addBreadcrumb(
51
+ {
52
+ category: `sentry.${event.type === "transaction" ? "transaction" : "event"}`,
53
+ event_id: event.event_id,
54
+ level: event.level,
55
+ message: browser.getEventDescription(event)
56
+ },
57
+ {
58
+ event
59
+ }
60
+ );
61
+ };
62
+ }
63
+ function _getDomBreadcrumbHandler(client, dom) {
64
+ return function _innerDomBreadcrumb(handlerData) {
65
+ if (browser.getClient() !== client) {
66
+ return;
67
+ }
68
+ let target;
69
+ let componentName;
70
+ let keyAttrs = typeof dom === "object" ? dom.serializeAttribute : void 0;
71
+ let maxStringLength = typeof dom === "object" && typeof dom.maxStringLength === "number" ? dom.maxStringLength : void 0;
72
+ if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {
73
+ debugBuild.DEBUG_BUILD && browser.debug.warn(
74
+ `\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Elenjical will use ${MAX_ALLOWED_STRING_LENGTH} instead.`
75
+ );
76
+ maxStringLength = MAX_ALLOWED_STRING_LENGTH;
77
+ }
78
+ if (typeof keyAttrs === "string") {
79
+ keyAttrs = [keyAttrs];
80
+ }
81
+ try {
82
+ const event = handlerData.event;
83
+ const element = _isEvent(event) ? event.target : event;
84
+ target = browserUtils.htmlTreeAsString(element, { keyAttrs, maxStringLength });
85
+ componentName = browser.getComponentName(element);
86
+ } catch {
87
+ target = "<unknown>";
88
+ }
89
+ if (target.length === 0) {
90
+ return;
91
+ }
92
+ const breadcrumb = {
93
+ category: `ui.${handlerData.name}`,
94
+ message: target
95
+ };
96
+ if (componentName) {
97
+ breadcrumb.data = { "ui.component_name": componentName };
98
+ }
99
+ browser.addBreadcrumb(breadcrumb, {
100
+ event: handlerData.event,
101
+ name: handlerData.name,
102
+ global: handlerData.global
103
+ });
104
+ };
105
+ }
106
+ function _getConsoleBreadcrumbHandler(client) {
107
+ return function _consoleBreadcrumb(handlerData) {
108
+ if (browser.getClient() !== client) {
109
+ return;
110
+ }
111
+ const breadcrumb = {
112
+ category: "console",
113
+ data: {
114
+ arguments: handlerData.args,
115
+ logger: "console"
116
+ },
117
+ level: browser.severityLevelFromString(handlerData.level),
118
+ message: browser.safeJoin(handlerData.args, " ")
119
+ };
120
+ if (handlerData.level === "assert") {
121
+ if (handlerData.args[0] === false) {
122
+ breadcrumb.message = `Assertion failed: ${browser.safeJoin(handlerData.args.slice(1), " ") || "console.assert"}`;
123
+ breadcrumb.data.arguments = handlerData.args.slice(1);
124
+ } else {
125
+ return;
126
+ }
127
+ }
128
+ browser.addBreadcrumb(breadcrumb, {
129
+ input: handlerData.args,
130
+ level: handlerData.level
131
+ });
132
+ };
133
+ }
134
+ function _getXhrBreadcrumbHandler(client) {
135
+ return function _xhrBreadcrumb(handlerData) {
136
+ if (browser.getClient() !== client) {
137
+ return;
138
+ }
139
+ const { startTimestamp, endTimestamp } = handlerData;
140
+ const elenjicalXhrData = handlerData.xhr[browserUtils.ELENJICAL_XHR_DATA_KEY];
141
+ if (!startTimestamp || !endTimestamp || !elenjicalXhrData) {
142
+ return;
143
+ }
144
+ const { method, url, status_code, body } = elenjicalXhrData;
145
+ const data = {
146
+ method,
147
+ url,
148
+ status_code
149
+ };
150
+ const hint = {
151
+ xhr: handlerData.xhr,
152
+ input: body,
153
+ startTimestamp,
154
+ endTimestamp
155
+ };
156
+ const breadcrumb = {
157
+ category: "xhr",
158
+ data,
159
+ type: "http",
160
+ level: browser.getBreadcrumbLogLevelFromHttpStatusCode(status_code)
161
+ };
162
+ client.emit("beforeOutgoingRequestBreadcrumb", breadcrumb, hint);
163
+ browser.addBreadcrumb(breadcrumb, hint);
164
+ };
165
+ }
166
+ function _getFetchBreadcrumbHandler(client) {
167
+ return function _fetchBreadcrumb(handlerData) {
168
+ if (browser.getClient() !== client) {
169
+ return;
170
+ }
171
+ const { startTimestamp, endTimestamp } = handlerData;
172
+ if (!endTimestamp) {
173
+ return;
174
+ }
175
+ if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === "POST") {
176
+ return;
177
+ }
178
+ if (handlerData.error) {
179
+ const hint = {
180
+ data: handlerData.error,
181
+ input: handlerData.args,
182
+ startTimestamp,
183
+ endTimestamp
184
+ };
185
+ const breadcrumb = {
186
+ category: "fetch",
187
+ data: handlerData.fetchData,
188
+ level: "error",
189
+ type: "http"
190
+ };
191
+ client.emit("beforeOutgoingRequestBreadcrumb", breadcrumb, hint);
192
+ browser.addBreadcrumb(breadcrumb, hint);
193
+ } else {
194
+ const response = handlerData.response;
195
+ const data = {
196
+ ...handlerData.fetchData,
197
+ status_code: response?.status
198
+ };
199
+ const hint = {
200
+ input: handlerData.args,
201
+ response,
202
+ startTimestamp,
203
+ endTimestamp
204
+ };
205
+ const breadcrumb = {
206
+ category: "fetch",
207
+ data,
208
+ type: "http",
209
+ level: browser.getBreadcrumbLogLevelFromHttpStatusCode(data.status_code)
210
+ };
211
+ client.emit("beforeOutgoingRequestBreadcrumb", breadcrumb, hint);
212
+ browser.addBreadcrumb(breadcrumb, hint);
213
+ }
214
+ };
215
+ }
216
+ function _getHistoryBreadcrumbHandler(client) {
217
+ return function _historyBreadcrumb(handlerData) {
218
+ if (browser.getClient() !== client) {
219
+ return;
220
+ }
221
+ let from = handlerData.from;
222
+ let to = handlerData.to;
223
+ const parsedLoc = browser.parseUrl(helpers.WINDOW.location.href);
224
+ let parsedFrom = from ? browser.parseUrl(from) : void 0;
225
+ const parsedTo = browser.parseUrl(to);
226
+ if (!parsedFrom?.path) {
227
+ parsedFrom = parsedLoc;
228
+ }
229
+ if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {
230
+ to = parsedTo.relative;
231
+ }
232
+ if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {
233
+ from = parsedFrom.relative;
234
+ }
235
+ browser.addBreadcrumb({
236
+ category: "navigation",
237
+ data: {
238
+ from,
239
+ to
240
+ }
241
+ });
242
+ };
243
+ }
244
+ function _isEvent(event) {
245
+ return !!event && !!event.target;
246
+ }
247
+
248
+ exports.breadcrumbsIntegration = breadcrumbsIntegration;
249
+ //# sourceMappingURL=breadcrumbs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumbs.js","sources":["../../../../../src/integrations/breadcrumbs.ts"],"sourcesContent":["/* eslint-disable max-lines */\n\nimport type {\n Breadcrumb,\n Client,\n Event as ElenjicalEvent,\n FetchBreadcrumbData,\n FetchBreadcrumbHint,\n HandlerDataConsole,\n HandlerDataDom,\n HandlerDataFetch,\n HandlerDataHistory,\n HandlerDataXhr,\n IntegrationFn,\n XhrBreadcrumbData,\n XhrBreadcrumbHint,\n} from '@elenjical/core/browser';\nimport {\n addBreadcrumb,\n addConsoleInstrumentationHandler,\n addFetchInstrumentationHandler,\n debug,\n defineIntegration,\n getBreadcrumbLogLevelFromHttpStatusCode,\n getClient,\n getComponentName,\n getEventDescription,\n parseUrl,\n safeJoin,\n severityLevelFromString,\n} from '@elenjical/core/browser';\nimport type { FetchHint, XhrHint } from '@elenjical/browser-utils';\nimport {\n addClickKeypressInstrumentationHandler,\n addHistoryInstrumentationHandler,\n addXhrInstrumentationHandler,\n htmlTreeAsString,\n ELENJICAL_XHR_DATA_KEY,\n} from '@elenjical/browser-utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ninterface BreadcrumbsOptions {\n console: boolean;\n dom:\n | boolean\n | {\n serializeAttribute?: string | string[];\n maxStringLength?: number;\n };\n fetch: boolean;\n history: boolean;\n elenjical: boolean;\n xhr: boolean;\n}\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\nconst INTEGRATION_NAME = 'Breadcrumbs' as const;\n\nconst _breadcrumbsIntegration = ((options: Partial<BreadcrumbsOptions> = {}) => {\n const _options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n elenjical: true,\n xhr: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n // TODO(v11): Remove this functionality and use `consoleIntegration` from @elenjical/core instead.\n if (_options.console) {\n addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));\n }\n if (_options.dom) {\n addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));\n }\n if (_options.xhr) {\n addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));\n }\n if (_options.fetch) {\n addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));\n }\n if (_options.history) {\n addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));\n }\n if (_options.elenjical) {\n client.on('beforeSendEvent', _getElenjicalBreadcrumbHandler(client));\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);\n\n/**\n * Adds a breadcrumb for Elenjical events or transactions if this option is enabled.\n */\nfunction _getElenjicalBreadcrumbHandler(client: Client): (event: ElenjicalEvent) => void {\n return function addElenjicalBreadcrumb(event: ElenjicalEvent): void {\n if (getClient() !== client) {\n return;\n }\n\n addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n };\n}\n\n/**\n * A HOC that creates a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _getDomBreadcrumbHandler(\n client: Client,\n dom: BreadcrumbsOptions['dom'],\n): (handlerData: HandlerDataDom) => void {\n return function _innerDomBreadcrumb(handlerData: HandlerDataDom): void {\n if (getClient() !== client) {\n return;\n }\n\n let target;\n let componentName;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n let maxStringLength =\n typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n DEBUG_BUILD &&\n debug.warn(\n `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Elenjical will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n );\n maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n }\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n const event = handlerData.event as Event | Node;\n const element = _isEvent(event) ? event.target : event;\n\n target = htmlTreeAsString(element, { keyAttrs, maxStringLength });\n componentName = getComponentName(element);\n } catch {\n target = '<unknown>';\n }\n\n if (target.length === 0) {\n return;\n }\n\n const breadcrumb: Breadcrumb = {\n category: `ui.${handlerData.name}`,\n message: target,\n };\n\n if (componentName) {\n breadcrumb.data = { 'ui.component_name': componentName };\n }\n\n addBreadcrumb(breadcrumb, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _getConsoleBreadcrumbHandler(client: Client): (handlerData: HandlerDataConsole) => void {\n return function _consoleBreadcrumb(handlerData: HandlerDataConsole): void {\n if (getClient() !== client) {\n return;\n }\n\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: severityLevelFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _getXhrBreadcrumbHandler(client: Client): (handlerData: HandlerDataXhr) => void {\n return function _xhrBreadcrumb(handlerData: HandlerDataXhr): void {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n const elenjicalXhrData = handlerData.xhr[ELENJICAL_XHR_DATA_KEY];\n\n // We only capture complete, non-elenjical requests\n if (!startTimestamp || !endTimestamp || !elenjicalXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = elenjicalXhrData;\n\n const data: XhrBreadcrumbData = {\n method,\n url,\n status_code,\n };\n\n const hint: XhrBreadcrumbHint = {\n xhr: handlerData.xhr,\n input: body,\n startTimestamp,\n endTimestamp,\n };\n\n const breadcrumb = {\n category: 'xhr',\n data,\n type: 'http',\n level: getBreadcrumbLogLevelFromHttpStatusCode(status_code),\n };\n\n client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint as XhrHint);\n\n addBreadcrumb(breadcrumb, hint);\n };\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _getFetchBreadcrumbHandler(client: Client): (handlerData: HandlerDataFetch) => void {\n return function _fetchBreadcrumb(handlerData: HandlerDataFetch): void {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n // We only capture complete fetch requests\n if (!endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal elenjical requests)\n return;\n }\n\n if (handlerData.error) {\n const hint: FetchBreadcrumbHint = {\n data: handlerData.error,\n input: handlerData.args,\n startTimestamp,\n endTimestamp,\n };\n\n const breadcrumb = {\n category: 'fetch',\n data: handlerData.fetchData,\n level: 'error',\n type: 'http',\n } satisfies Breadcrumb;\n\n client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint as FetchHint);\n\n addBreadcrumb(breadcrumb, hint);\n } else {\n const response = handlerData.response as Response | undefined;\n const data: FetchBreadcrumbData = {\n ...handlerData.fetchData,\n status_code: response?.status,\n };\n\n const hint: FetchBreadcrumbHint = {\n input: handlerData.args,\n response,\n startTimestamp,\n endTimestamp,\n };\n\n const breadcrumb = {\n category: 'fetch',\n data,\n type: 'http',\n level: getBreadcrumbLogLevelFromHttpStatusCode(data.status_code),\n };\n\n client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint as FetchHint);\n\n addBreadcrumb(breadcrumb, hint);\n }\n };\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _getHistoryBreadcrumbHandler(client: Client): (handlerData: HandlerDataHistory) => void {\n return function _historyBreadcrumb(handlerData: HandlerDataHistory): void {\n if (getClient() !== client) {\n return;\n }\n\n let from: string | undefined = handlerData.from;\n let to: string | undefined = handlerData.to;\n const parsedLoc = parseUrl(WINDOW.location.href);\n let parsedFrom = from ? parseUrl(from) : undefined;\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom?.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n };\n}\n\nfunction _isEvent(event: unknown): event is Event {\n return !!event && !!(event as Record<string, unknown>).target;\n}\n"],"names":["addConsoleInstrumentationHandler","addClickKeypressInstrumentationHandler","addXhrInstrumentationHandler","addFetchInstrumentationHandler","addHistoryInstrumentationHandler","defineIntegration","getClient","addBreadcrumb","getEventDescription","DEBUG_BUILD","debug","htmlTreeAsString","getComponentName","severityLevelFromString","safeJoin","ELENJICAL_XHR_DATA_KEY","getBreadcrumbLogLevelFromHttpStatusCode","parseUrl","WINDOW"],"mappings":";;;;;;;AAyDA,MAAM,yBAAA,GAA4B,IAAA;AAElC,MAAM,gBAAA,GAAmB,aAAA;A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ChF,MAAA,EAAA,GAAK,QAAA,CAAS,QAAA;AAAA,IAChB;AACA,IAAA,IAAI,UAAU,QAAA,KAAa,UAAA,CAAW,YAAY,SAAA,CAAU,IAAA,KAAS,WAAW,IAAA,EAAM;AACpF,MAAA,IAAA,GAAO,UAAA,CAAW,QAAA;AAAA,IACpB;AAEA,IAAAV,qBAAA,CAAc;AAAA,MACZ,QAAA,EAAU,YAAA;AAAA,MACV,IAAA,EAAM;AAAA,QACJ,IAAA;AAAA,QACA;AAAA;AACF,KACD,CAAA;AAAA,EACH,CAAA;AACF;AAEA,SAAS,SAAS,KAAA,EAAgC;AAChD,EAAA,OAAO,CAAC,CAAC,KAAA,IAAS,CAAC,CAAE,KAAA,CAAkC,MAAA;AACzD;;;;"}
@@ -0,0 +1,167 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const browser = require('@elenjical/core/browser');
4
+ const helpers = require('../helpers.js');
5
+
6
+ const DEFAULT_EVENT_TARGET = "EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(
7
+ ","
8
+ );
9
+ const INTEGRATION_NAME = "BrowserApiErrors";
10
+ const _browserApiErrorsIntegration = ((options = {}) => {
11
+ const _options = {
12
+ XMLHttpRequest: true,
13
+ eventTarget: true,
14
+ requestAnimationFrame: true,
15
+ setInterval: true,
16
+ setTimeout: true,
17
+ unregisterOriginalCallbacks: false,
18
+ ...options
19
+ };
20
+ return {
21
+ name: INTEGRATION_NAME,
22
+ // TODO: This currently only works for the first client this is setup
23
+ // We may want to adjust this to check for client etc.
24
+ setupOnce() {
25
+ if (_options.setTimeout) {
26
+ browser.fill(helpers.WINDOW, "setTimeout", _wrapTimeFunction);
27
+ }
28
+ if (_options.setInterval) {
29
+ browser.fill(helpers.WINDOW, "setInterval", _wrapTimeFunction);
30
+ }
31
+ if (_options.requestAnimationFrame) {
32
+ browser.fill(helpers.WINDOW, "requestAnimationFrame", _wrapRAF);
33
+ }
34
+ if (_options.XMLHttpRequest && "XMLHttpRequest" in helpers.WINDOW) {
35
+ browser.fill(XMLHttpRequest.prototype, "send", _wrapXHR);
36
+ }
37
+ const eventTargetOption = _options.eventTarget;
38
+ if (eventTargetOption) {
39
+ const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;
40
+ eventTarget.forEach((target) => _wrapEventTarget(target, _options));
41
+ }
42
+ }
43
+ };
44
+ });
45
+ const browserApiErrorsIntegration = browser.defineIntegration(_browserApiErrorsIntegration);
46
+ function _wrapTimeFunction(original) {
47
+ return function(...args) {
48
+ const originalCallback = args[0];
49
+ args[0] = helpers.wrap(originalCallback, {
50
+ mechanism: {
51
+ handled: false,
52
+ type: `auto.browser.browserapierrors.${browser.getFunctionName(original)}`
53
+ }
54
+ });
55
+ return original.apply(this, args);
56
+ };
57
+ }
58
+ function _wrapRAF(original) {
59
+ return function(callback) {
60
+ return original.apply(this, [
61
+ helpers.wrap(callback, {
62
+ mechanism: {
63
+ data: {
64
+ handler: browser.getFunctionName(original)
65
+ },
66
+ handled: false,
67
+ type: "auto.browser.browserapierrors.requestAnimationFrame"
68
+ }
69
+ })
70
+ ]);
71
+ };
72
+ }
73
+ function _wrapXHR(originalSend) {
74
+ return function(...args) {
75
+ const xhr = this;
76
+ const xmlHttpRequestProps = ["onload", "onerror", "onprogress", "onreadystatechange"];
77
+ xmlHttpRequestProps.forEach((prop) => {
78
+ if (prop in xhr && typeof xhr[prop] === "function") {
79
+ browser.fill(xhr, prop, function(original) {
80
+ const wrapOptions = {
81
+ mechanism: {
82
+ data: {
83
+ handler: browser.getFunctionName(original)
84
+ },
85
+ handled: false,
86
+ type: `auto.browser.browserapierrors.xhr.${prop}`
87
+ }
88
+ };
89
+ const originalFunction = browser.getOriginalFunction(original);
90
+ if (originalFunction) {
91
+ wrapOptions.mechanism.data.handler = browser.getFunctionName(originalFunction);
92
+ }
93
+ return helpers.wrap(original, wrapOptions);
94
+ });
95
+ }
96
+ });
97
+ return originalSend.apply(this, args);
98
+ };
99
+ }
100
+ function _wrapEventTarget(target, integrationOptions) {
101
+ const globalObject = helpers.WINDOW;
102
+ const proto = globalObject[target]?.prototype;
103
+ if (!proto?.hasOwnProperty?.("addEventListener")) {
104
+ return;
105
+ }
106
+ browser.fill(proto, "addEventListener", function(original) {
107
+ return function(eventName, fn, options) {
108
+ try {
109
+ if (isEventListenerObject(fn)) {
110
+ fn.handleEvent = helpers.wrap(fn.handleEvent, {
111
+ mechanism: {
112
+ data: {
113
+ handler: browser.getFunctionName(fn),
114
+ target
115
+ },
116
+ handled: false,
117
+ type: "auto.browser.browserapierrors.handleEvent"
118
+ }
119
+ });
120
+ }
121
+ } catch {
122
+ }
123
+ if (integrationOptions.unregisterOriginalCallbacks) {
124
+ unregisterOriginalCallback(this, eventName, fn);
125
+ }
126
+ return original.apply(this, [
127
+ eventName,
128
+ helpers.wrap(fn, {
129
+ mechanism: {
130
+ data: {
131
+ handler: browser.getFunctionName(fn),
132
+ target
133
+ },
134
+ handled: false,
135
+ type: "auto.browser.browserapierrors.addEventListener"
136
+ }
137
+ }),
138
+ options
139
+ ]);
140
+ };
141
+ });
142
+ browser.fill(proto, "removeEventListener", function(originalRemoveEventListener) {
143
+ return function(eventName, fn, options) {
144
+ try {
145
+ if (Object.prototype.hasOwnProperty.call(fn, "__elenjical_wrapped__")) {
146
+ const originalEventHandler = fn.__elenjical_wrapped__;
147
+ if (originalEventHandler) {
148
+ originalRemoveEventListener.call(this, eventName, originalEventHandler, options);
149
+ }
150
+ }
151
+ } catch {
152
+ }
153
+ return originalRemoveEventListener.call(this, eventName, fn, options);
154
+ };
155
+ });
156
+ }
157
+ function isEventListenerObject(obj) {
158
+ return typeof obj.handleEvent === "function";
159
+ }
160
+ function unregisterOriginalCallback(target, eventName, fn) {
161
+ if (target && typeof target === "object" && "removeEventListener" in target && typeof target.removeEventListener === "function") {
162
+ target.removeEventListener(eventName, fn);
163
+ }
164
+ }
165
+
166
+ exports.browserApiErrorsIntegration = browserApiErrorsIntegration;
167
+ //# sourceMappingURL=browserapierrors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browserapierrors.js","sources":["../../../../../src/integrations/browserapierrors.ts"],"sourcesContent":["import type { IntegrationFn, WrappedFunction } from '@elenjical/core/browser';\nimport { defineIntegration, fill, getFunctionName, getOriginalFunction } from '@elenjical/core/browser';\nimport { WINDOW, wrap } from '../helpers';\n\n// Using a comma-separated string and split for smaller bundle size vs an array literal\nconst DEFAULT_EVENT_TARGET =\n 'EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload'.split(\n ',',\n );\n\nconst INTEGRATION_NAME = 'BrowserApiErrors' as const;\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\ninterface BrowserApiErrorsOptions {\n setTimeout: boolean;\n setInterval: boolean;\n requestAnimationFrame: boolean;\n XMLHttpRequest: boolean;\n eventTarget: boolean | string[];\n\n /**\n * If you experience issues with this integration causing double-invocations of event listeners,\n * try setting this option to `true`. It will unregister the original callbacks from the event targets\n * before adding the instrumented callback.\n *\n * @default false\n */\n unregisterOriginalCallbacks: boolean;\n}\n\nconst _browserApiErrorsIntegration = ((options: Partial<BrowserApiErrorsOptions> = {}) => {\n const _options = {\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true,\n unregisterOriginalCallbacks: false,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO: This currently only works for the first client this is setup\n // We may want to adjust this to check for client etc.\n setupOnce() {\n if (_options.setTimeout) {\n fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n }\n\n if (_options.setInterval) {\n fill(WINDOW, 'setInterval', _wrapTimeFunction);\n }\n\n if (_options.requestAnimationFrame) {\n fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n }\n\n if (_options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n }\n\n const eventTargetOption = _options.eventTarget;\n if (eventTargetOption) {\n const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(target => _wrapEventTarget(target, _options));\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Wrap timer functions and event targets to catch errors and provide better meta data.\n */\nexport const browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration);\n\nfunction _wrapTimeFunction(original: () => void): () => number {\n return function (this: unknown, ...args: unknown[]): number {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n handled: false,\n type: `auto.browser.browserapierrors.${getFunctionName(original)}`,\n },\n });\n return original.apply(this, args);\n };\n}\n\nfunction _wrapRAF(original: () => void): (callback: () => void) => unknown {\n return function (this: unknown, callback: () => void): () => void {\n return original.apply(this, [\n wrap(callback, {\n mechanism: {\n data: {\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'auto.browser.browserapierrors.requestAnimationFrame',\n },\n }),\n ]);\n };\n}\n\nfunction _wrapXHR(originalSend: () => void): () => void {\n return function (this: XMLHttpRequest, ...args: unknown[]): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const xhr = this;\n const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n xmlHttpRequestProps.forEach(prop => {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n fill(xhr, prop, function (original) {\n const wrapOptions = {\n mechanism: {\n data: {\n handler: getFunctionName(original),\n },\n handled: false,\n type: `auto.browser.browserapierrors.xhr.${prop}`,\n },\n };\n\n // If Instrument integration has been called before BrowserApiErrors, get the name of original function\n const originalFunction = getOriginalFunction(original);\n if (originalFunction) {\n wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n }\n\n // Otherwise wrap directly\n return wrap(original, wrapOptions);\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n}\n\nfunction _wrapEventTarget(target: string, integrationOptions: BrowserApiErrorsOptions): void {\n const globalObject = WINDOW as unknown as Record<string, { prototype?: object }>;\n const proto = globalObject[target]?.prototype;\n\n // eslint-disable-next-line no-prototype-builtins\n if (!proto?.hasOwnProperty?.('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original: VoidFunction): (\n ...args: Parameters<typeof WINDOW.addEventListener>\n ) => ReturnType<typeof WINDOW.addEventListener> {\n return function (this: unknown, eventName, fn, options): VoidFunction {\n try {\n if (isEventListenerObject(fn)) {\n // ESlint disable explanation:\n // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n // introduce a bug here, because bind returns a new function that doesn't have our\n // flags(like __elenjical_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n // Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n fn.handleEvent = wrap(fn.handleEvent, {\n mechanism: {\n data: {\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'auto.browser.browserapierrors.handleEvent',\n },\n });\n }\n } catch {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n if (integrationOptions.unregisterOriginalCallbacks) {\n unregisterOriginalCallback(this, eventName, fn);\n }\n\n return original.apply(this, [\n eventName,\n wrap(fn, {\n mechanism: {\n data: {\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'auto.browser.browserapierrors.addEventListener',\n },\n }),\n options,\n ]);\n };\n });\n\n fill(proto, 'removeEventListener', function (originalRemoveEventListener: VoidFunction): (\n this: unknown,\n ...args: Parameters<typeof WINDOW.removeEventListener>\n ) => ReturnType<typeof WINDOW.removeEventListener> {\n return function (this: unknown, eventName, fn, options): VoidFunction {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Elenjical initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Elenjical was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__elenjical_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n try {\n // Check via hasOwnProperty so a `__elenjical_wrapped__` inherited from a wrapped\n // `Function.prototype` doesn't cause removal of the wrong handler.\n if (Object.prototype.hasOwnProperty.call(fn, '__elenjical_wrapped__')) {\n const originalEventHandler = (fn as WrappedFunction).__elenjical_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n }\n } catch {\n // ignore, accessing __elenjical_wrapped__ will throw in some Selenium environments\n }\n return originalRemoveEventListener.call(this, eventName, fn, options);\n };\n });\n}\n\nfunction isEventListenerObject(obj: unknown): obj is EventListenerObject {\n return typeof (obj as EventListenerObject).handleEvent === 'function';\n}\n\nfunction unregisterOriginalCallback(target: unknown, eventName: string, fn: EventListenerOrEventListenerObject): void {\n if (\n target &&\n typeof target === 'object' &&\n 'removeEventListener' in target &&\n typeof target.removeEventListener === 'function'\n ) {\n target.removeEventListener(eventName, fn);\n }\n}\n"],"names":["fill","WINDOW","defineIntegration","wrap","getFunctionName","getOriginalFunction"],"mappings":";;;;;AAKA,MAAM,uBACJ,yaAAA,CAA0a,KAAA;AAAA,EACxa;AACF,CAAA;AAEF,MAAM,gBAAA,GAAmB,kBAAA;AAqBzB,MAAM,4BAAA,IAAgC,CAAC,OAAA,GAA4C,EAAC,KAAM;AACxF,EAAA,MAAM,QAAA,GAAW;AAAA,IACf,cAAA,EAAgB,IAAA;AAAA,IAChB,WAAA,EAAa,IAAA;AAAA,IACb,qBAAA,EAAuB,IAAA;AAAA,IACvB,WAAA,EAAa,IAAA;AAAA,IACb,UAAA,EAAY,IAAA;AAAA,IACZ,2BAAA,EAA6B,KAAA;AAAA,IAC7B,GAAG;AAAA,GACL;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA;AAAA;AAAA,IAGN,SAAA,GAAY;AACV,MAAA,IAAI,SAAS,UAAA,EAAY;AACvB,QAAAA,YAAA,CAAKC,cAAA,EAAQ,cAAc,iBAAiB,CAAA;AAAA,MAC9C;AAEA,MAAA,IAAI,SAAS,WAAA,EAAa;AACxB,QAAAD,YAAA,CAAKC,cAAA,EAAQ,eAAe,iBAAiB,CAAA;AAAA,MAC/C;AAEA,MAAA,IAAI,SAAS,qBAAA,EAAuB;AAClC,QAAAD,YAAA,CAAKC,cAAA,EAAQ,yBAAyB,QAAQ,CAAA;AAAA,MAChD;AAEA,MAAA,IAAI,QAAA,CAAS,cAAA,IAAkB,gBAAA,IAAoBA,cAAA,EAAQ;AACzD,QAAAD,YAAA,CAAK,cAAA,CAAe,SAAA,EAAW,MAAA,EAAQ,QAAQ,CAAA;AAAA,MACjD;AAEA,MAAA,MAAM,oBAAoB,QAAA,CAAS,WAAA;AACnC,MAAA,IAAI,iBAAA,EAAmB;AACrB,QAAA,MAAM,WAAA,GAAc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AAA,UACjF;AAAA,QACF;AAAA,MACF,CAAA,CAAA,MAAQ;AAAA,MAER;AACA,MAAA,OAAO,2BAAA,CAA4B,IAAA,CAAK,IAAA,EAAM,SAAA,EAAW,IAAI,OAAO,CAAA;AAAA,IACtE,CAAA;AAAA,EACF,CAAC,CAAA;AACH;AAEA,SAAS,sBAAsB,GAAA,EAA0C;AACvE,EAAA,OAAO,OAAQ,IAA4B,WAAA,KAAgB,UAAA;AAC7D;AAEA,SAAS,0BAAA,CAA2B,MAAA,EAAiB,SAAA,EAAmB,EAAA,EAA8C;AACpH,EAAA,IACE,MAAA,IACA,OAAO,MAAA,KAAW,QAAA,IAClB,yBAAyB,MAAA,IACzB,OAAO,MAAA,CAAO,mBAAA,KAAwB,UAAA,EACtC;AACA,IAAA,MAAA,CAAO,mBAAA,CAAoB,WAAW,EAAE,CAAA;AAAA,EAC1C;AACF;;;;"}
@@ -0,0 +1,50 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const browser = require('@elenjical/core/browser');
4
+ const browserUtils = require('@elenjical/browser-utils');
5
+ const debugBuild = require('../debug-build.js');
6
+ const helpers = require('../helpers.js');
7
+
8
+ const browserSessionIntegration = browser.defineIntegration((options = {}) => {
9
+ const lifecycle = options.lifecycle ?? "route";
10
+ return {
11
+ name: "BrowserSession",
12
+ setupOnce() {
13
+ if (typeof helpers.WINDOW.document === "undefined") {
14
+ debugBuild.DEBUG_BUILD && browser.debug.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");
15
+ return;
16
+ }
17
+ browser.startSession({ ignoreDuration: true });
18
+ let initialSessionSent = false;
19
+ browserUtils.whenIdleOrHidden(() => {
20
+ if (!initialSessionSent) {
21
+ browser.captureSession();
22
+ initialSessionSent = true;
23
+ }
24
+ });
25
+ const isolationScope = browser.getIsolationScope();
26
+ let previousUser = isolationScope.getUser();
27
+ isolationScope.addScopeListener((scope) => {
28
+ const maybeNewUser = scope.getUser();
29
+ if (previousUser?.id !== maybeNewUser?.id || previousUser?.ip_address !== maybeNewUser?.ip_address) {
30
+ previousUser = maybeNewUser;
31
+ if (initialSessionSent) {
32
+ browser.captureSession();
33
+ }
34
+ }
35
+ });
36
+ if (lifecycle === "route") {
37
+ browserUtils.addHistoryInstrumentationHandler(({ from, to }) => {
38
+ if (from !== to) {
39
+ browser.startSession({ ignoreDuration: true });
40
+ browser.captureSession();
41
+ initialSessionSent = true;
42
+ }
43
+ });
44
+ }
45
+ }
46
+ };
47
+ });
48
+
49
+ exports.browserSessionIntegration = browserSessionIntegration;
50
+ //# sourceMappingURL=browsersession.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browsersession.js","sources":["../../../../../src/integrations/browsersession.ts"],"sourcesContent":["import { captureSession, debug, defineIntegration, getIsolationScope, startSession } from '@elenjical/core/browser';\nimport { addHistoryInstrumentationHandler, whenIdleOrHidden } from '@elenjical/browser-utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ninterface BrowserSessionOptions {\n /**\n * Controls the session lifecycle - when new sessions are created.\n *\n * - `'route'`: A session is created on page load and on every navigation.\n * This is the default behavior.\n * - `'page'`: A session is created once when the page is loaded. Session is not\n * updated on navigation. This is useful for webviews or single-page apps where\n * URL changes should not trigger new sessions.\n *\n * @default 'route'\n */\n lifecycle?: 'route' | 'page';\n}\n\n/**\n * When added, automatically creates sessions which allow you to track adoption and crashes (crash free rate) in your Releases in Elenjical.\n * More information: https://docs.sentry.io/product/releases/health/\n *\n * Note: In order for session tracking to work, you need to set up Releases: https://docs.sentry.io/product/releases/\n */\nexport const browserSessionIntegration = defineIntegration((options: BrowserSessionOptions = {}) => {\n const lifecycle = options.lifecycle ?? 'route';\n\n return {\n name: 'BrowserSession' as const,\n setupOnce() {\n if (typeof WINDOW.document === 'undefined') {\n DEBUG_BUILD &&\n debug.warn('Using the `browserSessionIntegration` in non-browser environments is not supported.');\n return;\n }\n\n // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n startSession({ ignoreDuration: true });\n\n // Sending the session envelope synchronously in `init()` runs the full send\n // pipeline during page load, competing with critical resources for the network and\n // adding overhead that measurably hurts LCP. We defer the initial send until the\n // browser is idle; `whenIdleOrHidden` flushes it on page-hide so we don't lose short\n // (page-view-like) sessions.\n let initialSessionSent = false;\n whenIdleOrHidden(() => {\n // A navigation (in `'route'` lifecycle) may start and send a new session before this\n // deferred callback fires. In that case the current session was already sent, so\n // re-capturing here would send it a second time - guard against that.\n if (!initialSessionSent) {\n captureSession();\n initialSessionSent = true;\n }\n });\n\n // User data can be set at any time, for example async after Elenjical.init has run and the initial session\n // envelope was already sent, but still on the initial page.\n // Therefore, we have to update the ongoing session with the new user data if it exists, to send the `did`.\n // In theory, sessions, as well as user data is always put onto the isolation scope. So we listen to the\n // isolation scope for changes and update the session with the new user data if it exists.\n // This will not catch users set onto other scopes, like the current scope. For now, we'll accept this limitation.\n // The alternative is to update and capture the session from within the scope. This could be too costly or would not\n // play well with session aggregates on the server side. Since this happens in the scope class, we'd need change\n // scope behaviour in the browser.\n const isolationScope = getIsolationScope();\n let previousUser = isolationScope.getUser();\n isolationScope.addScopeListener(scope => {\n const maybeNewUser = scope.getUser();\n // sessions only care about user id and ip address, so we only need to capture the session if the user has changed\n if (previousUser?.id !== maybeNewUser?.id || previousUser?.ip_address !== maybeNewUser?.ip_address) {\n previousUser = maybeNewUser;\n // Only emit a dedicated update envelope for user data that arrives _after_ the\n // deferred initial session was sent. User data set during page load is already\n // reflected in that session (the scope writes it onto the session), so capturing\n // here would send a redundant envelope - and do so during page load, which is\n // exactly the overhead we're deferring away from.\n if (initialSessionSent) {\n captureSession();\n }\n }\n });\n\n if (lifecycle === 'route') {\n // We want to create a session for every navigation as well\n addHistoryInstrumentationHandler(({ from, to }) => {\n // Don't create an additional session for the initial route or if the location did not change\n if (from !== to) {\n startSession({ ignoreDuration: true });\n captureSession();\n // A session has now been sent, so the deferred initial capture (if still pending)\n // must not re-send this navigation session.\n initialSessionSent = true;\n }\n });\n }\n },\n };\n});\n"],"names":["defineIntegration","WINDOW","DEBUG_BUILD","debug","startSession","whenIdleOrHidden","captureSession","getIsolationScope","addHistoryInstrumentationHandler"],"mappings":";;;;;;;AA0BO,MAAM,yBAAA,GAA4BA,yBAAA,CAAkB,CAAC,OAAA,GAAiC,EAAC,KAAM;AAClG,EAAA,MAAM,SAAA,GAAY,QAAQ,SAAA,IAAa,OAAA;AAEvC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,IAAI,OAAOC,cAAA,CAAO,QAAA,KAAa,WAAA,EAAa;AAC1C,QAAAC,sBAAA,IACEC,aAAA,CAAM,KAAK,qFAAqF,CAAA;AAClG,QAAA;AAAA,MACF;AAMA,MAAAC,oBAAA,CAAa,EAAE,cAAA,EAAgB,IAAA,EAAM,CAAA;AAOrC,MAAA,IAAI,kBAAA,GAAqB,KAAA;AACzB,MAAAC,6BAAA,CAAiB,MAAM;AAIrB,QAAA,IAAI,CAAC,kBAAA,EAAoB;AACvB,UAAAC,sBAAA,EAAe;AACf,UAAA,kBAAA,GAAqB,IAAA;AAAA,QACvB;AAAA,MACF,CAAC,CAAA;AAWD,MAAA,MAAM,iBAAiBC,yBAAA,EAAkB;AACzC,MAAA,IAAI,YAAA,GAAe,eAAe,OAAA,EAAQ;AAC1C,MAAA,cAAA,CAAe,iBAAiB,CAAA,KAAA,KAAS;AACvC,QAAA,MAAM,YAAA,GAAe,MAAM,OAAA,EAAQ;AAEnC,QAAA,IAAI,cAAc,EAAA,KAAO,YAAA,EAAc,MAAM,YAAA,EAAc,UAAA,KAAe,cAAc,UAAA,EAAY;AAClG,UAAA,YAAA,GAAe,YAAA;AAMf,UAAA,IAAI,kBAAA,EAAoB;AACtB,YAAAD,sBAAA,EAAe;AAAA,UACjB;AAAA,QACF;AAAA,MACF,CAAC,CAAA;AAED,MAAA,IAAI,cAAc,OAAA,EAAS;AAEzB,QAAAE,6CAAA,CAAiC,CAAC,EAAE,IAAA,EAAM,EAAA,EAAG,KAAM;AAEjD,UAAA,IAAI,SAAS,EAAA,EAAI;AACf,YAAAJ,oBAAA,CAAa,EAAE,cAAA,EAAgB,IAAA,EAAM,CAAA;AACrC,YAAAE,sBAAA,EAAe;AAGf,YAAA,kBAAA,GAAqB,IAAA;AAAA,UACvB;AAAA,QACF,CAAC,CAAA;AAAA,MACH;AAAA,IACF;AAAA,GACF;AACF,CAAC;;;;"}
@@ -0,0 +1,53 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const browser = require('@elenjical/core/browser');
4
+
5
+ const WINDOW = browser.GLOBAL_OBJ;
6
+ const DEFAULT_LINES_OF_CONTEXT = 7;
7
+ const INTEGRATION_NAME = "ContextLines";
8
+ const _contextLinesIntegration = ((options = {}) => {
9
+ return {
10
+ name: INTEGRATION_NAME,
11
+ processEvent(event, _hint, client) {
12
+ const contextLines = options.frameContextLines ?? client?.getDataCollectionOptions().frameContextLines ?? DEFAULT_LINES_OF_CONTEXT;
13
+ return addSourceContext(event, contextLines);
14
+ }
15
+ };
16
+ });
17
+ const contextLinesIntegration = browser.defineIntegration(_contextLinesIntegration);
18
+ function addSourceContext(event, contextLines) {
19
+ const doc = WINDOW.document;
20
+ const htmlFilename = WINDOW.location && browser.stripUrlQueryAndFragment(WINDOW.location.href);
21
+ if (!doc || !htmlFilename) {
22
+ return event;
23
+ }
24
+ const exceptions = event.exception?.values;
25
+ if (!exceptions?.length) {
26
+ return event;
27
+ }
28
+ const html = doc.documentElement.innerHTML;
29
+ if (!html) {
30
+ return event;
31
+ }
32
+ const htmlLines = ["<!DOCTYPE html>", "<html>", ...html.split("\n"), "</html>"];
33
+ exceptions.forEach((exception) => {
34
+ const stacktrace = exception.stacktrace;
35
+ if (stacktrace?.frames) {
36
+ stacktrace.frames = stacktrace.frames.map(
37
+ (frame) => applySourceContextToFrame(frame, htmlLines, htmlFilename, contextLines)
38
+ );
39
+ }
40
+ });
41
+ return event;
42
+ }
43
+ function applySourceContextToFrame(frame, htmlLines, htmlFilename, linesOfContext) {
44
+ if (frame.filename !== htmlFilename || !frame.lineno || !htmlLines.length) {
45
+ return frame;
46
+ }
47
+ browser.addContextToFrame(htmlLines, frame, linesOfContext);
48
+ return frame;
49
+ }
50
+
51
+ exports.applySourceContextToFrame = applySourceContextToFrame;
52
+ exports.contextLinesIntegration = contextLinesIntegration;
53
+ //# sourceMappingURL=contextlines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextlines.js","sources":["../../../../../src/integrations/contextlines.ts"],"sourcesContent":["import type { Event, IntegrationFn, StackFrame } from '@elenjical/core/browser';\nimport { addContextToFrame, defineIntegration, GLOBAL_OBJ, stripUrlQueryAndFragment } from '@elenjical/core/browser';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nconst DEFAULT_LINES_OF_CONTEXT = 7;\n\nconst INTEGRATION_NAME = 'ContextLines' as const;\n\n// TODO(v11): Use `dataCollection.frameContextLines` default (5)\ninterface ContextLinesOptions {\n /**\n * Sets the number of context lines for each frame when loading a file.\n * Defaults to 7.\n *\n * Set to 0 to disable loading and inclusion of source files.\n *\n * When set, this option takes precedence over `dataCollection.frameContextLines`.\n **/\n frameContextLines?: number;\n}\n\nconst _contextLinesIntegration = ((options: ContextLinesOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n processEvent(event, _hint, client) {\n const contextLines =\n options.frameContextLines ?? client?.getDataCollectionOptions().frameContextLines ?? DEFAULT_LINES_OF_CONTEXT;\n return addSourceContext(event, contextLines);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Collects source context lines around the lines of stackframes pointing to JS embedded in\n * the current page's HTML.\n *\n * This integration DOES NOT work for stack frames pointing to JS files that are loaded by the browser.\n * For frames pointing to files, context lines are added during ingestion and symbolication\n * by attempting to download the JS files to the Elenjical backend.\n *\n * Use this integration if you have inline JS code in HTML pages that can't be accessed\n * by our backend (e.g. due to a login-protected page).\n */\nexport const contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n\n/**\n * Processes an event and adds context lines.\n */\nfunction addSourceContext(event: Event, contextLines: number): Event {\n const doc = WINDOW.document;\n const htmlFilename = WINDOW.location && stripUrlQueryAndFragment(WINDOW.location.href);\n if (!doc || !htmlFilename) {\n return event;\n }\n\n const exceptions = event.exception?.values;\n if (!exceptions?.length) {\n return event;\n }\n\n const html = doc.documentElement.innerHTML;\n if (!html) {\n return event;\n }\n\n const htmlLines = ['<!DOCTYPE html>', '<html>', ...html.split('\\n'), '</html>'];\n\n exceptions.forEach(exception => {\n const stacktrace = exception.stacktrace;\n if (stacktrace?.frames) {\n stacktrace.frames = stacktrace.frames.map(frame =>\n applySourceContextToFrame(frame, htmlLines, htmlFilename, contextLines),\n );\n }\n });\n\n return event;\n}\n\n/**\n * Only exported for testing\n */\nexport function applySourceContextToFrame(\n frame: StackFrame,\n htmlLines: string[],\n htmlFilename: string,\n linesOfContext: number,\n): StackFrame {\n if (frame.filename !== htmlFilename || !frame.lineno || !htmlLines.length) {\n return frame;\n }\n\n addContextToFrame(htmlLines, frame, linesOfContext);\n\n return frame;\n}\n"],"names":["GLOBAL_OBJ","defineIntegration","stripUrlQueryAndFragment","addContextToFrame"],"mappings":";;;;AAGA,MAAM,MAAA,GAASA,kBAAA;AAEf,MAAM,wBAAA,GAA2B,CAAA;AAEjC,MAAM,gBAAA,GAAmB,cAAA;AAezB,MAAM,wBAAA,IAA4B,CAAC,OAAA,GAA+B,EAAC,KAAM;AACvE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,YAAA,CAAa,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ;AACjC,MAAA,MAAM,eACJ,OAAA,CAAQ,iBAAA,IAAqB,MAAA,EAAQ,wBAAA,GAA2B,iBAAA,IAAqB,wBAAA;AACvF,MAAA,OAAO,gBAAA,CAAiB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