@sentry/browser 10.52.0 → 10.53.1

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 (507) hide show
  1. package/build/npm/cjs/dev/client.js +7 -7
  2. package/build/npm/cjs/dev/client.js.map +1 -1
  3. package/build/npm/cjs/dev/diagnose-sdk.js +3 -3
  4. package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -1
  5. package/build/npm/cjs/dev/eventbuilder.js +23 -23
  6. package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
  7. package/build/npm/cjs/dev/feedbackAsync.js.map +1 -1
  8. package/build/npm/cjs/dev/feedbackSync.js.map +1 -1
  9. package/build/npm/cjs/dev/helpers.js +10 -10
  10. package/build/npm/cjs/dev/helpers.js.map +1 -1
  11. package/build/npm/cjs/dev/index.js +84 -84
  12. package/build/npm/cjs/dev/integrations/breadcrumbs.js +29 -29
  13. package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -1
  14. package/build/npm/cjs/dev/integrations/browserapierrors.js +16 -16
  15. package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -1
  16. package/build/npm/cjs/dev/integrations/browsersession.js +9 -9
  17. package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
  18. package/build/npm/cjs/dev/integrations/contextlines.js +5 -5
  19. package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -1
  20. package/build/npm/cjs/dev/integrations/culturecontext.js +3 -3
  21. package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -1
  22. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +2 -2
  23. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
  24. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +5 -5
  25. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  26. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +7 -7
  27. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
  28. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +5 -5
  29. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
  30. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +7 -7
  31. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
  32. package/build/npm/cjs/dev/integrations/globalhandlers.js +16 -16
  33. package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
  34. package/build/npm/cjs/dev/integrations/graphqlClient.js +9 -9
  35. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
  36. package/build/npm/cjs/dev/integrations/httpclient.js +14 -14
  37. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
  38. package/build/npm/cjs/dev/integrations/httpcontext.js +3 -3
  39. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
  40. package/build/npm/cjs/dev/integrations/linkederrors.js +3 -3
  41. package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -1
  42. package/build/npm/cjs/dev/integrations/reportingobserver.js +7 -7
  43. package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -1
  44. package/build/npm/cjs/dev/integrations/spanstreaming.js +10 -10
  45. package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -1
  46. package/build/npm/cjs/dev/integrations/spotlight.js +6 -6
  47. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
  48. package/build/npm/cjs/dev/integrations/view-hierarchy.js +3 -3
  49. package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
  50. package/build/npm/cjs/dev/integrations/webWorker.js +18 -18
  51. package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
  52. package/build/npm/cjs/dev/profiling/UIProfiler.js +43 -33
  53. package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -1
  54. package/build/npm/cjs/dev/profiling/index.js +7 -7
  55. package/build/npm/cjs/dev/profiling/index.js.map +1 -1
  56. package/build/npm/cjs/dev/profiling/integration.js +20 -18
  57. package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
  58. package/build/npm/cjs/dev/profiling/startProfileForSpan.js +14 -11
  59. package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -1
  60. package/build/npm/cjs/dev/profiling/utils.js +39 -68
  61. package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
  62. package/build/npm/cjs/dev/report-dialog.js +7 -7
  63. package/build/npm/cjs/dev/report-dialog.js.map +1 -1
  64. package/build/npm/cjs/dev/sdk.js +8 -8
  65. package/build/npm/cjs/dev/sdk.js.map +1 -1
  66. package/build/npm/cjs/dev/stack-parsers.js +10 -10
  67. package/build/npm/cjs/dev/stack-parsers.js.map +1 -1
  68. package/build/npm/cjs/dev/tracing/backgroundtab.js +7 -7
  69. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
  70. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +52 -52
  71. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
  72. package/build/npm/cjs/dev/tracing/linkedTraces.js +11 -11
  73. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
  74. package/build/npm/cjs/dev/tracing/reportPageLoaded.js +2 -2
  75. package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -1
  76. package/build/npm/cjs/dev/tracing/request.js +28 -28
  77. package/build/npm/cjs/dev/tracing/request.js.map +1 -1
  78. package/build/npm/cjs/dev/tracing/setActiveSpan.js +5 -5
  79. package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -1
  80. package/build/npm/cjs/dev/transports/fetch.js +3 -3
  81. package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
  82. package/build/npm/cjs/dev/transports/offline.js +5 -5
  83. package/build/npm/cjs/dev/transports/offline.js.map +1 -1
  84. package/build/npm/cjs/dev/userfeedback.js +3 -3
  85. package/build/npm/cjs/dev/userfeedback.js.map +1 -1
  86. package/build/npm/cjs/dev/utils/detectBrowserExtension.js +3 -3
  87. package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -1
  88. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +3 -3
  89. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
  90. package/build/npm/cjs/prod/client.js +7 -7
  91. package/build/npm/cjs/prod/client.js.map +1 -1
  92. package/build/npm/cjs/prod/diagnose-sdk.js +3 -3
  93. package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -1
  94. package/build/npm/cjs/prod/eventbuilder.js +23 -23
  95. package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
  96. package/build/npm/cjs/prod/feedbackAsync.js.map +1 -1
  97. package/build/npm/cjs/prod/feedbackSync.js.map +1 -1
  98. package/build/npm/cjs/prod/helpers.js +10 -10
  99. package/build/npm/cjs/prod/helpers.js.map +1 -1
  100. package/build/npm/cjs/prod/index.js +84 -84
  101. package/build/npm/cjs/prod/integrations/breadcrumbs.js +29 -29
  102. package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -1
  103. package/build/npm/cjs/prod/integrations/browserapierrors.js +16 -16
  104. package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -1
  105. package/build/npm/cjs/prod/integrations/browsersession.js +9 -9
  106. package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
  107. package/build/npm/cjs/prod/integrations/contextlines.js +5 -5
  108. package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -1
  109. package/build/npm/cjs/prod/integrations/culturecontext.js +3 -3
  110. package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -1
  111. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +2 -2
  112. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
  113. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +5 -5
  114. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  115. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +7 -7
  116. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
  117. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +5 -5
  118. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
  119. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +7 -7
  120. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
  121. package/build/npm/cjs/prod/integrations/globalhandlers.js +16 -16
  122. package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
  123. package/build/npm/cjs/prod/integrations/graphqlClient.js +9 -9
  124. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
  125. package/build/npm/cjs/prod/integrations/httpclient.js +14 -14
  126. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
  127. package/build/npm/cjs/prod/integrations/httpcontext.js +3 -3
  128. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
  129. package/build/npm/cjs/prod/integrations/linkederrors.js +3 -3
  130. package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -1
  131. package/build/npm/cjs/prod/integrations/reportingobserver.js +7 -7
  132. package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -1
  133. package/build/npm/cjs/prod/integrations/spanstreaming.js +10 -10
  134. package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -1
  135. package/build/npm/cjs/prod/integrations/spotlight.js +6 -6
  136. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
  137. package/build/npm/cjs/prod/integrations/view-hierarchy.js +3 -3
  138. package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
  139. package/build/npm/cjs/prod/integrations/webWorker.js +18 -18
  140. package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
  141. package/build/npm/cjs/prod/profiling/UIProfiler.js +43 -33
  142. package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -1
  143. package/build/npm/cjs/prod/profiling/index.js +7 -7
  144. package/build/npm/cjs/prod/profiling/index.js.map +1 -1
  145. package/build/npm/cjs/prod/profiling/integration.js +20 -18
  146. package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
  147. package/build/npm/cjs/prod/profiling/startProfileForSpan.js +14 -11
  148. package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -1
  149. package/build/npm/cjs/prod/profiling/utils.js +39 -68
  150. package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
  151. package/build/npm/cjs/prod/report-dialog.js +7 -7
  152. package/build/npm/cjs/prod/report-dialog.js.map +1 -1
  153. package/build/npm/cjs/prod/sdk.js +8 -8
  154. package/build/npm/cjs/prod/sdk.js.map +1 -1
  155. package/build/npm/cjs/prod/stack-parsers.js +10 -10
  156. package/build/npm/cjs/prod/stack-parsers.js.map +1 -1
  157. package/build/npm/cjs/prod/tracing/backgroundtab.js +7 -7
  158. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
  159. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +52 -52
  160. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
  161. package/build/npm/cjs/prod/tracing/linkedTraces.js +11 -11
  162. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
  163. package/build/npm/cjs/prod/tracing/reportPageLoaded.js +2 -2
  164. package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -1
  165. package/build/npm/cjs/prod/tracing/request.js +28 -28
  166. package/build/npm/cjs/prod/tracing/request.js.map +1 -1
  167. package/build/npm/cjs/prod/tracing/setActiveSpan.js +5 -5
  168. package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -1
  169. package/build/npm/cjs/prod/transports/fetch.js +3 -3
  170. package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
  171. package/build/npm/cjs/prod/transports/offline.js +5 -5
  172. package/build/npm/cjs/prod/transports/offline.js.map +1 -1
  173. package/build/npm/cjs/prod/userfeedback.js +3 -3
  174. package/build/npm/cjs/prod/userfeedback.js.map +1 -1
  175. package/build/npm/cjs/prod/utils/detectBrowserExtension.js +3 -3
  176. package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -1
  177. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +3 -3
  178. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
  179. package/build/npm/esm/dev/client.js +1 -1
  180. package/build/npm/esm/dev/client.js.map +1 -1
  181. package/build/npm/esm/dev/diagnose-sdk.js +1 -1
  182. package/build/npm/esm/dev/diagnose-sdk.js.map +1 -1
  183. package/build/npm/esm/dev/eventbuilder.js +1 -1
  184. package/build/npm/esm/dev/eventbuilder.js.map +1 -1
  185. package/build/npm/esm/dev/feedbackAsync.js.map +1 -1
  186. package/build/npm/esm/dev/feedbackSync.js.map +1 -1
  187. package/build/npm/esm/dev/helpers.js +1 -1
  188. package/build/npm/esm/dev/helpers.js.map +1 -1
  189. package/build/npm/esm/dev/index.js +1 -1
  190. package/build/npm/esm/dev/integrations/breadcrumbs.js +1 -1
  191. package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -1
  192. package/build/npm/esm/dev/integrations/browserapierrors.js +1 -1
  193. package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -1
  194. package/build/npm/esm/dev/integrations/browsersession.js +1 -1
  195. package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
  196. package/build/npm/esm/dev/integrations/contextlines.js +1 -1
  197. package/build/npm/esm/dev/integrations/contextlines.js.map +1 -1
  198. package/build/npm/esm/dev/integrations/culturecontext.js +1 -1
  199. package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -1
  200. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +1 -1
  201. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
  202. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +1 -1
  203. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  204. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +1 -1
  205. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
  206. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +1 -1
  207. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
  208. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +1 -1
  209. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
  210. package/build/npm/esm/dev/integrations/globalhandlers.js +1 -1
  211. package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
  212. package/build/npm/esm/dev/integrations/graphqlClient.js +1 -1
  213. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
  214. package/build/npm/esm/dev/integrations/httpclient.js +1 -1
  215. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
  216. package/build/npm/esm/dev/integrations/httpcontext.js +1 -1
  217. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
  218. package/build/npm/esm/dev/integrations/linkederrors.js +1 -1
  219. package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -1
  220. package/build/npm/esm/dev/integrations/reportingobserver.js +1 -1
  221. package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -1
  222. package/build/npm/esm/dev/integrations/spanstreaming.js +1 -1
  223. package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -1
  224. package/build/npm/esm/dev/integrations/spotlight.js +1 -1
  225. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
  226. package/build/npm/esm/dev/integrations/view-hierarchy.js +1 -1
  227. package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
  228. package/build/npm/esm/dev/integrations/webWorker.js +1 -1
  229. package/build/npm/esm/dev/integrations/webWorker.js.map +1 -1
  230. package/build/npm/esm/dev/package.json +1 -1
  231. package/build/npm/esm/dev/profiling/UIProfiler.js +12 -2
  232. package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -1
  233. package/build/npm/esm/dev/profiling/index.js +1 -1
  234. package/build/npm/esm/dev/profiling/index.js.map +1 -1
  235. package/build/npm/esm/dev/profiling/integration.js +9 -7
  236. package/build/npm/esm/dev/profiling/integration.js.map +1 -1
  237. package/build/npm/esm/dev/profiling/startProfileForSpan.js +5 -2
  238. package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -1
  239. package/build/npm/esm/dev/profiling/utils.js +6 -36
  240. package/build/npm/esm/dev/profiling/utils.js.map +1 -1
  241. package/build/npm/esm/dev/report-dialog.js +1 -1
  242. package/build/npm/esm/dev/report-dialog.js.map +1 -1
  243. package/build/npm/esm/dev/sdk.js +1 -1
  244. package/build/npm/esm/dev/sdk.js.map +1 -1
  245. package/build/npm/esm/dev/stack-parsers.js +1 -1
  246. package/build/npm/esm/dev/stack-parsers.js.map +1 -1
  247. package/build/npm/esm/dev/tracing/backgroundtab.js +1 -1
  248. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
  249. package/build/npm/esm/dev/tracing/browserTracingIntegration.js +1 -1
  250. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
  251. package/build/npm/esm/dev/tracing/linkedTraces.js +2 -2
  252. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
  253. package/build/npm/esm/dev/tracing/reportPageLoaded.js +1 -1
  254. package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -1
  255. package/build/npm/esm/dev/tracing/request.js +1 -1
  256. package/build/npm/esm/dev/tracing/request.js.map +1 -1
  257. package/build/npm/esm/dev/tracing/setActiveSpan.js +1 -1
  258. package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -1
  259. package/build/npm/esm/dev/transports/fetch.js +1 -1
  260. package/build/npm/esm/dev/transports/fetch.js.map +1 -1
  261. package/build/npm/esm/dev/transports/offline.js +1 -1
  262. package/build/npm/esm/dev/transports/offline.js.map +1 -1
  263. package/build/npm/esm/dev/userfeedback.js +1 -1
  264. package/build/npm/esm/dev/userfeedback.js.map +1 -1
  265. package/build/npm/esm/dev/utils/detectBrowserExtension.js +1 -1
  266. package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -1
  267. package/build/npm/esm/dev/utils/lazyLoadIntegration.js +1 -1
  268. package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
  269. package/build/npm/esm/prod/client.js +1 -1
  270. package/build/npm/esm/prod/client.js.map +1 -1
  271. package/build/npm/esm/prod/diagnose-sdk.js +1 -1
  272. package/build/npm/esm/prod/diagnose-sdk.js.map +1 -1
  273. package/build/npm/esm/prod/eventbuilder.js +1 -1
  274. package/build/npm/esm/prod/eventbuilder.js.map +1 -1
  275. package/build/npm/esm/prod/feedbackAsync.js.map +1 -1
  276. package/build/npm/esm/prod/feedbackSync.js.map +1 -1
  277. package/build/npm/esm/prod/helpers.js +1 -1
  278. package/build/npm/esm/prod/helpers.js.map +1 -1
  279. package/build/npm/esm/prod/index.js +1 -1
  280. package/build/npm/esm/prod/integrations/breadcrumbs.js +1 -1
  281. package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -1
  282. package/build/npm/esm/prod/integrations/browserapierrors.js +1 -1
  283. package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -1
  284. package/build/npm/esm/prod/integrations/browsersession.js +1 -1
  285. package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
  286. package/build/npm/esm/prod/integrations/contextlines.js +1 -1
  287. package/build/npm/esm/prod/integrations/contextlines.js.map +1 -1
  288. package/build/npm/esm/prod/integrations/culturecontext.js +1 -1
  289. package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -1
  290. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +1 -1
  291. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
  292. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +1 -1
  293. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  294. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +1 -1
  295. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
  296. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +1 -1
  297. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
  298. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +1 -1
  299. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
  300. package/build/npm/esm/prod/integrations/globalhandlers.js +1 -1
  301. package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
  302. package/build/npm/esm/prod/integrations/graphqlClient.js +1 -1
  303. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
  304. package/build/npm/esm/prod/integrations/httpclient.js +1 -1
  305. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
  306. package/build/npm/esm/prod/integrations/httpcontext.js +1 -1
  307. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
  308. package/build/npm/esm/prod/integrations/linkederrors.js +1 -1
  309. package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -1
  310. package/build/npm/esm/prod/integrations/reportingobserver.js +1 -1
  311. package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -1
  312. package/build/npm/esm/prod/integrations/spanstreaming.js +1 -1
  313. package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -1
  314. package/build/npm/esm/prod/integrations/spotlight.js +1 -1
  315. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
  316. package/build/npm/esm/prod/integrations/view-hierarchy.js +1 -1
  317. package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
  318. package/build/npm/esm/prod/integrations/webWorker.js +1 -1
  319. package/build/npm/esm/prod/integrations/webWorker.js.map +1 -1
  320. package/build/npm/esm/prod/package.json +1 -1
  321. package/build/npm/esm/prod/profiling/UIProfiler.js +12 -2
  322. package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -1
  323. package/build/npm/esm/prod/profiling/index.js +1 -1
  324. package/build/npm/esm/prod/profiling/index.js.map +1 -1
  325. package/build/npm/esm/prod/profiling/integration.js +9 -7
  326. package/build/npm/esm/prod/profiling/integration.js.map +1 -1
  327. package/build/npm/esm/prod/profiling/startProfileForSpan.js +5 -2
  328. package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -1
  329. package/build/npm/esm/prod/profiling/utils.js +6 -36
  330. package/build/npm/esm/prod/profiling/utils.js.map +1 -1
  331. package/build/npm/esm/prod/report-dialog.js +1 -1
  332. package/build/npm/esm/prod/report-dialog.js.map +1 -1
  333. package/build/npm/esm/prod/sdk.js +1 -1
  334. package/build/npm/esm/prod/sdk.js.map +1 -1
  335. package/build/npm/esm/prod/stack-parsers.js +1 -1
  336. package/build/npm/esm/prod/stack-parsers.js.map +1 -1
  337. package/build/npm/esm/prod/tracing/backgroundtab.js +1 -1
  338. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
  339. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +1 -1
  340. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
  341. package/build/npm/esm/prod/tracing/linkedTraces.js +2 -2
  342. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
  343. package/build/npm/esm/prod/tracing/reportPageLoaded.js +1 -1
  344. package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -1
  345. package/build/npm/esm/prod/tracing/request.js +1 -1
  346. package/build/npm/esm/prod/tracing/request.js.map +1 -1
  347. package/build/npm/esm/prod/tracing/setActiveSpan.js +1 -1
  348. package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -1
  349. package/build/npm/esm/prod/transports/fetch.js +1 -1
  350. package/build/npm/esm/prod/transports/fetch.js.map +1 -1
  351. package/build/npm/esm/prod/transports/offline.js +1 -1
  352. package/build/npm/esm/prod/transports/offline.js.map +1 -1
  353. package/build/npm/esm/prod/userfeedback.js +1 -1
  354. package/build/npm/esm/prod/userfeedback.js.map +1 -1
  355. package/build/npm/esm/prod/utils/detectBrowserExtension.js +1 -1
  356. package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -1
  357. package/build/npm/esm/prod/utils/lazyLoadIntegration.js +1 -1
  358. package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
  359. package/build/npm/types/client.d.ts +2 -2
  360. package/build/npm/types/client.d.ts.map +1 -1
  361. package/build/npm/types/eventbuilder.d.ts +1 -1
  362. package/build/npm/types/eventbuilder.d.ts.map +1 -1
  363. package/build/npm/types/exports.d.ts +3 -3
  364. package/build/npm/types/exports.d.ts.map +1 -1
  365. package/build/npm/types/feedbackAsync.d.ts +2 -7
  366. package/build/npm/types/feedbackAsync.d.ts.map +1 -1
  367. package/build/npm/types/feedbackSync.d.ts +2 -7
  368. package/build/npm/types/feedbackSync.d.ts.map +1 -1
  369. package/build/npm/types/helpers.d.ts +2 -2
  370. package/build/npm/types/helpers.d.ts.map +1 -1
  371. package/build/npm/types/index.bundle.logs.metrics.d.ts +1 -1
  372. package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
  373. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +1 -1
  374. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
  375. package/build/npm/types/index.bundle.tracing.d.ts +1 -1
  376. package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
  377. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +2 -2
  378. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
  379. package/build/npm/types/index.bundle.tracing.replay.d.ts +1 -1
  380. package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
  381. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +1 -1
  382. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
  383. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -1
  384. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
  385. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +2 -2
  386. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
  387. package/build/npm/types/index.d.ts +3 -3
  388. package/build/npm/types/index.d.ts.map +1 -1
  389. package/build/npm/types/integrations/contextlines.d.ts +1 -1
  390. package/build/npm/types/integrations/contextlines.d.ts.map +1 -1
  391. package/build/npm/types/integrations/globalhandlers.d.ts +1 -1
  392. package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -1
  393. package/build/npm/types/integrations/view-hierarchy.d.ts +1 -1
  394. package/build/npm/types/integrations/view-hierarchy.d.ts.map +1 -1
  395. package/build/npm/types/integrations/webWorker.d.ts +1 -1
  396. package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
  397. package/build/npm/types/integrations-bundle/index.captureconsole.d.ts +1 -1
  398. package/build/npm/types/integrations-bundle/index.captureconsole.d.ts.map +1 -1
  399. package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts +1 -1
  400. package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts.map +1 -1
  401. package/build/npm/types/integrations-bundle/index.dedupe.d.ts +1 -1
  402. package/build/npm/types/integrations-bundle/index.dedupe.d.ts.map +1 -1
  403. package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts +1 -1
  404. package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts.map +1 -1
  405. package/build/npm/types/integrations-bundle/index.feedback.d.ts +1 -1
  406. package/build/npm/types/integrations-bundle/index.feedback.d.ts.map +1 -1
  407. package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts +1 -1
  408. package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts.map +1 -1
  409. package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +1 -1
  410. package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts.map +1 -1
  411. package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts +1 -1
  412. package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts.map +1 -1
  413. package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts +1 -1
  414. package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts.map +1 -1
  415. package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts +1 -1
  416. package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts.map +1 -1
  417. package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts +1 -1
  418. package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts.map +1 -1
  419. package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts +1 -1
  420. package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts.map +1 -1
  421. package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
  422. package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts.map +1 -1
  423. package/build/npm/types/profiling/UIProfiler.d.ts +1 -1
  424. package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -1
  425. package/build/npm/types/profiling/index.d.ts +1 -1
  426. package/build/npm/types/profiling/index.d.ts.map +1 -1
  427. package/build/npm/types/profiling/integration.d.ts.map +1 -1
  428. package/build/npm/types/profiling/startProfileForSpan.d.ts +1 -1
  429. package/build/npm/types/profiling/startProfileForSpan.d.ts.map +1 -1
  430. package/build/npm/types/profiling/utils.d.ts +3 -5
  431. package/build/npm/types/profiling/utils.d.ts.map +1 -1
  432. package/build/npm/types/report-dialog.d.ts +1 -1
  433. package/build/npm/types/report-dialog.d.ts.map +1 -1
  434. package/build/npm/types/sdk.d.ts +1 -1
  435. package/build/npm/types/sdk.d.ts.map +1 -1
  436. package/build/npm/types/stack-parsers.d.ts +1 -1
  437. package/build/npm/types/stack-parsers.d.ts.map +1 -1
  438. package/build/npm/types/tracing/browserTracingIntegration.d.ts +1 -1
  439. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  440. package/build/npm/types/tracing/linkedTraces.d.ts +2 -2
  441. package/build/npm/types/tracing/linkedTraces.d.ts.map +1 -1
  442. package/build/npm/types/tracing/reportPageLoaded.d.ts +1 -1
  443. package/build/npm/types/tracing/reportPageLoaded.d.ts.map +1 -1
  444. package/build/npm/types/tracing/request.d.ts +1 -1
  445. package/build/npm/types/tracing/request.d.ts.map +1 -1
  446. package/build/npm/types/tracing/setActiveSpan.d.ts +1 -1
  447. package/build/npm/types/tracing/setActiveSpan.d.ts.map +1 -1
  448. package/build/npm/types/transports/fetch.d.ts +1 -1
  449. package/build/npm/types/transports/fetch.d.ts.map +1 -1
  450. package/build/npm/types/transports/offline.d.ts +1 -1
  451. package/build/npm/types/transports/offline.d.ts.map +1 -1
  452. package/build/npm/types/transports/types.d.ts +1 -1
  453. package/build/npm/types/transports/types.d.ts.map +1 -1
  454. package/build/npm/types/userfeedback.d.ts +1 -1
  455. package/build/npm/types/userfeedback.d.ts.map +1 -1
  456. package/build/npm/types/utils/lazyLoadIntegration.d.ts +1 -1
  457. package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -1
  458. package/build/npm/types-ts3.8/client.d.ts +2 -2
  459. package/build/npm/types-ts3.8/eventbuilder.d.ts +1 -1
  460. package/build/npm/types-ts3.8/exports.d.ts +3 -3
  461. package/build/npm/types-ts3.8/feedbackAsync.d.ts +2 -7
  462. package/build/npm/types-ts3.8/feedbackSync.d.ts +2 -7
  463. package/build/npm/types-ts3.8/helpers.d.ts +2 -2
  464. package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +1 -1
  465. package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +1 -1
  466. package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -1
  467. package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +2 -2
  468. package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -1
  469. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -1
  470. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -1
  471. package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +2 -2
  472. package/build/npm/types-ts3.8/index.d.ts +3 -3
  473. package/build/npm/types-ts3.8/integrations/contextlines.d.ts +1 -1
  474. package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +1 -1
  475. package/build/npm/types-ts3.8/integrations/view-hierarchy.d.ts +1 -1
  476. package/build/npm/types-ts3.8/integrations/webWorker.d.ts +1 -1
  477. package/build/npm/types-ts3.8/integrations-bundle/index.captureconsole.d.ts +1 -1
  478. package/build/npm/types-ts3.8/integrations-bundle/index.createlangchaincallbackhandler.d.ts +1 -1
  479. package/build/npm/types-ts3.8/integrations-bundle/index.dedupe.d.ts +1 -1
  480. package/build/npm/types-ts3.8/integrations-bundle/index.extraerrordata.d.ts +1 -1
  481. package/build/npm/types-ts3.8/integrations-bundle/index.feedback.d.ts +1 -1
  482. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentanthropicaiclient.d.ts +1 -1
  483. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +1 -1
  484. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlangchainembeddings.d.ts +1 -1
  485. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlanggraph.d.ts +1 -1
  486. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentopenaiclient.d.ts +1 -1
  487. package/build/npm/types-ts3.8/integrations-bundle/index.modulemetadata.d.ts +1 -1
  488. package/build/npm/types-ts3.8/integrations-bundle/index.rewriteframes.d.ts +1 -1
  489. package/build/npm/types-ts3.8/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
  490. package/build/npm/types-ts3.8/profiling/UIProfiler.d.ts +1 -1
  491. package/build/npm/types-ts3.8/profiling/index.d.ts +1 -1
  492. package/build/npm/types-ts3.8/profiling/startProfileForSpan.d.ts +1 -1
  493. package/build/npm/types-ts3.8/profiling/utils.d.ts +3 -5
  494. package/build/npm/types-ts3.8/report-dialog.d.ts +1 -1
  495. package/build/npm/types-ts3.8/sdk.d.ts +1 -1
  496. package/build/npm/types-ts3.8/stack-parsers.d.ts +1 -1
  497. package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +1 -1
  498. package/build/npm/types-ts3.8/tracing/linkedTraces.d.ts +2 -2
  499. package/build/npm/types-ts3.8/tracing/reportPageLoaded.d.ts +1 -1
  500. package/build/npm/types-ts3.8/tracing/request.d.ts +1 -1
  501. package/build/npm/types-ts3.8/tracing/setActiveSpan.d.ts +1 -1
  502. package/build/npm/types-ts3.8/transports/fetch.d.ts +1 -1
  503. package/build/npm/types-ts3.8/transports/offline.d.ts +1 -1
  504. package/build/npm/types-ts3.8/transports/types.d.ts +1 -1
  505. package/build/npm/types-ts3.8/userfeedback.d.ts +1 -1
  506. package/build/npm/types-ts3.8/utils/lazyLoadIntegration.d.ts +1 -1
  507. package/package.json +7 -7
@@ -1 +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 SentryEvent,\n FetchBreadcrumbData,\n FetchBreadcrumbHint,\n HandlerDataConsole,\n HandlerDataDom,\n HandlerDataFetch,\n HandlerDataHistory,\n HandlerDataXhr,\n IntegrationFn,\n XhrBreadcrumbData,\n XhrBreadcrumbHint,\n} from '@sentry/core';\nimport {\n addBreadcrumb,\n addConsoleInstrumentationHandler,\n addFetchInstrumentationHandler,\n debug,\n defineIntegration,\n getBreadcrumbLogLevelFromHttpStatusCode,\n getClient,\n getComponentName,\n getEventDescription,\n htmlTreeAsString,\n parseUrl,\n safeJoin,\n severityLevelFromString,\n} from '@sentry/core';\nimport type { FetchHint, XhrHint } from '@sentry-internal/browser-utils';\nimport {\n addClickKeypressInstrumentationHandler,\n addHistoryInstrumentationHandler,\n addXhrInstrumentationHandler,\n SENTRY_XHR_DATA_KEY,\n} from '@sentry-internal/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 sentry: 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';\n\nconst _breadcrumbsIntegration = ((options: Partial<BreadcrumbsOptions> = {}) => {\n const _options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: 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 @sentry/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.sentry) {\n client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);\n\n/**\n * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n */\nfunction _getSentryBreadcrumbHandler(client: Client): (event: SentryEvent) => void {\n return function addSentryBreadcrumb(event: SentryEvent): 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. Sentry 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 sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n // We only capture complete, non-sentry requests\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = sentryXhrData;\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 sentry 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":[],"mappings":";;;;;AAwDA;AACA,MAAM,yBAAA,GAA4B,IAAI;;AAEtC,MAAM,gBAAA,GAAmB,aAAa;;AAEtC,MAAM,uBAAA,IAA2B,CAAC,OAAO,GAAgC,EAAE,KAAK;AAChF,EAAE,MAAM,WAAW;AACnB,IAAI,OAAO,EAAE,IAAI;AACjB,IAAI,GAAG,EAAE,IAAI;AACb,IAAI,KAAK,EAAE,IAAI;AACf,IAAI,OAAO,EAAE,IAAI;AACjB,IAAI,MAAM,EAAE,IAAI;AAChB,IAAI,GAAG,EAAE,IAAI;AACb,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB;AACA,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE;AAC5B,QAAQ,gCAAgC,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC;AAC9E,MAAM;AACN,MAAM,IAAI,QAAQ,CAAC,GAAG,EAAE;AACxB,QAAQ,sCAAsC,CAAC,wBAAwB,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9F,MAAM;AACN,MAAM,IAAI,QAAQ,CAAC,GAAG,EAAE;AACxB,QAAQ,4BAA4B,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;AACtE,MAAM;AACN,MAAM,IAAI,QAAQ,CAAC,KAAK,EAAE;AAC1B,QAAQ,8BAA8B,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC;AAC1E,MAAM;AACN,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE;AAC5B,QAAQ,gCAAgC,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC;AAC9E,MAAM;AACN,MAAM,IAAI,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.js","sources":["../../../../../src/integrations/breadcrumbs.ts"],"sourcesContent":["/* eslint-disable max-lines */\n\nimport type {\n Breadcrumb,\n Client,\n Event as SentryEvent,\n FetchBreadcrumbData,\n FetchBreadcrumbHint,\n HandlerDataConsole,\n HandlerDataDom,\n HandlerDataFetch,\n HandlerDataHistory,\n HandlerDataXhr,\n IntegrationFn,\n XhrBreadcrumbData,\n XhrBreadcrumbHint,\n} from '@sentry/core/browser';\nimport {\n addBreadcrumb,\n addConsoleInstrumentationHandler,\n addFetchInstrumentationHandler,\n debug,\n defineIntegration,\n getBreadcrumbLogLevelFromHttpStatusCode,\n getClient,\n getComponentName,\n getEventDescription,\n htmlTreeAsString,\n parseUrl,\n safeJoin,\n severityLevelFromString,\n} from '@sentry/core/browser';\nimport type { FetchHint, XhrHint } from '@sentry-internal/browser-utils';\nimport {\n addClickKeypressInstrumentationHandler,\n addHistoryInstrumentationHandler,\n addXhrInstrumentationHandler,\n SENTRY_XHR_DATA_KEY,\n} from '@sentry-internal/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 sentry: 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';\n\nconst _breadcrumbsIntegration = ((options: Partial<BreadcrumbsOptions> = {}) => {\n const _options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: 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 @sentry/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.sentry) {\n client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);\n\n/**\n * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n */\nfunction _getSentryBreadcrumbHandler(client: Client): (event: SentryEvent) => void {\n return function addSentryBreadcrumb(event: SentryEvent): 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. Sentry 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 sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n // We only capture complete, non-sentry requests\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = sentryXhrData;\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 sentry 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":[],"mappings":";;;;;AAwDA;AACA,MAAM,yBAAA,GAA4B,IAAI;;AAEtC,MAAM,gBAAA,GAAmB,aAAa;;AAEtC,MAAM,uBAAA,IAA2B,CAAC,OAAO,GAAgC,EAAE,KAAK;AAChF,EAAE,MAAM,WAAW;AACnB,IAAI,OAAO,EAAE,IAAI;AACjB,IAAI,GAAG,EAAE,IAAI;AACb,IAAI,KAAK,EAAE,IAAI;AACf,IAAI,OAAO,EAAE,IAAI;AACjB,IAAI,MAAM,EAAE,IAAI;AAChB,IAAI,GAAG,EAAE,IAAI;AACb,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB;AACA,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE;AAC5B,QAAQ,gCAAgC,CAAC,4BAA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CAAA,IAAA,EAAA;AACA,MAAA,EAAA,GAAA,QAAA,CAAA,QAAA;AACA,IAAA;AACA,IAAA,IAAA,SAAA,CAAA,QAAA,KAAA,UAAA,CAAA,QAAA,IAAA,SAAA,CAAA,IAAA,KAAA,UAAA,CAAA,IAAA,EAAA;AACA,MAAA,IAAA,GAAA,UAAA,CAAA,QAAA;AACA,IAAA;;AAEA,IAAA,aAAA,CAAA;AACA,MAAA,QAAA,EAAA,YAAA;AACA,MAAA,IAAA,EAAA;AACA,QAAA,IAAA;AACA,QAAA,EAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,EAAA,CAAA;AACA;;AAEA,SAAA,QAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,CAAA,CAAA,KAAA,IAAA,CAAA,CAAA,CAAA,KAAA,GAAA,MAAA;AACA;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, fill, getFunctionName, getOriginalFunction } from '@sentry/core';
1
+ import { defineIntegration, fill, getFunctionName, getOriginalFunction } from '@sentry/core/browser';
2
2
  import { WINDOW, wrap } from '../helpers.js';
3
3
 
4
4
  // Using a comma-separated string and split for smaller bundle size vs an array literal
@@ -1 +1 @@
1
- {"version":3,"file":"browserapierrors.js","sources":["../../../../../src/integrations/browserapierrors.ts"],"sourcesContent":["import type { IntegrationFn, WrappedFunction } from '@sentry/core';\nimport { defineIntegration, fill, getFunctionName, getOriginalFunction } from '@sentry/core';\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';\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 __sentry_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 Sentry 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 Sentry 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 `__sentry_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 const originalEventHandler = (fn as WrappedFunction).__sentry_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch {\n // ignore, accessing __sentry_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":[],"mappings":";;;AAIA;AACA,MAAM,oBAAA;AACN,EAAE,yaAAya,CAAC,KAAK;AACjb,IAAI,GAAG;AACP,GAAG;;AAEH,MAAM,gBAAA,GAAmB,kBAAkB;;AAqB3C,MAAM,4BAAA,IAAgC,CAAC,OAAO,GAAqC,EAAE,KAAK;AAC1F,EAAE,MAAM,WAAW;AACnB,IAAI,cAAc,EAAE,IAAI;AACxB,IAAI,WAAW,EAAE,IAAI;AACrB,IAAI,qBAAqB,EAAE,IAAI;AAC/B,IAAI,WAAW,EAAE,IAAI;AACrB,IAAI,UAAU,EAAE,IAAI;AACpB,IAAI,2BAA2B,EAAE,KAAK;AACtC,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B;AACA;AACA,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE;AAC/B,QAAQ,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,iBAAiB,CAAC;AACrD,MAAM;;AAEN,MAAM,IAAI,QAAQ,CAAC,WAAW,EAAE;AAChC,QAAQ,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,iBAAiB,CAAC;AACtD,MAAM;;AAEN,MAAM,IAAI,QAAQ,CAAC,qBAAqB,EAAE;AAC1C,QAAQ,IAAI,CAAC,MAAM,EA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AAA,gDAAA;AACA,WAAA;AACA,SAAA,CAAA;AACA,QAAA,OAAA;AACA,OAAA,CAAA;AACA,IAAA,CAAA;AACA,EAAA,CAAA,CAAA;;AAEA,EAAA,IAAA,CAAA,KAAA,EAAA,qBAAA,EAAA,UAAA,2BAAA;;AAGA,CAAA;AACA,IAAA,OAAA,WAAA,SAAA,EAAA,EAAA,EAAA,OAAA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,IAAA;AACA,QAAA,MAAA,oBAAA,GAAA,CAAA,EAAA,GAAA,kBAAA;AACA,QAAA,IAAA,oBAAA,EAAA;AACA,UAAA,2BAAA,CAAA,IAAA,CAAA,IAAA,EAAA,SAAA,EAAA,oBAAA,EAAA,OAAA,CAAA;AACA,QAAA;AACA,MAAA,CAAA,CAAA,MAAA;AACA;AACA,MAAA;AACA,MAAA,OAAA,2BAAA,CAAA,IAAA,CAAA,IAAA,EAAA,SAAA,EAAA,EAAA,EAAA,OAAA,CAAA;AACA,IAAA,CAAA;AACA,EAAA,CAAA,CAAA;AACA;;AAEA,SAAA,qBAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,GAAA,GAAA,WAAA,KAAA,UAAA;AACA;;AAEA,SAAA,0BAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAAA,EAAA;AACA,EAAA;AACA,IAAA,MAAA;AACA,IAAA,OAAA,MAAA,KAAA,QAAA;AACA,IAAA,qBAAA,IAAA,MAAA;AACA,IAAA,OAAA,MAAA,CAAA,mBAAA,KAAA;AACA,IAAA;AACA,IAAA,MAAA,CAAA,mBAAA,CAAA,SAAA,EAAA,EAAA,CAAA;AACA,EAAA;AACA;;;;"}
1
+ {"version":3,"file":"browserapierrors.js","sources":["../../../../../src/integrations/browserapierrors.ts"],"sourcesContent":["import type { IntegrationFn, WrappedFunction } from '@sentry/core/browser';\nimport { defineIntegration, fill, getFunctionName, getOriginalFunction } from '@sentry/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';\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 __sentry_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 Sentry 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 Sentry 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 `__sentry_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 const originalEventHandler = (fn as WrappedFunction).__sentry_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch {\n // ignore, accessing __sentry_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":[],"mappings":";;;AAIA;AACA,MAAM,oBAAA;AACN,EAAE,yaAAya,CAAC,KAAK;AACjb,IAAI,GAAG;AACP,GAAG;;AAEH,MAAM,gBAAA,GAAmB,kBAAkB;;AAqB3C,MAAM,4BAAA,IAAgC,CAAC,OAAO,GAAqC,EAAE,KAAK;AAC1F,EAAE,MAAM,WAAW;AACnB,IAAI,cAAc,EAAE,IAAI;AACxB,IAAI,WAAW,EAAE,IAAI;AACrB,IAAI,qBAAqB,EAAE,IAAI;AAC/B,IAAI,WAAW,EAAE,IAAI;AACrB,IAAI,UAAU,EAAE,IAAI;AACpB,IAAI,2BAA2B,EAAE,KAAK;AACtC,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAE,OAAO;AACT,IAAI,IAA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AA,EAAA,EAAA;AACA,EAAA;AACA,IAAA,MAAA;AACA,IAAA,OAAA,MAAA,KAAA,QAAA;AACA,IAAA,qBAAA,IAAA,MAAA;AACA,IAAA,OAAA,MAAA,CAAA,mBAAA,KAAA;AACA,IAAA;AACA,IAAA,MAAA,CAAA,mBAAA,CAAA,SAAA,EAAA,EAAA,CAAA;AACA,EAAA;AACA;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, debug, startSession, captureSession, getIsolationScope } from '@sentry/core';
1
+ import { defineIntegration, debug, startSession, captureSession, getIsolationScope } from '@sentry/core/browser';
2
2
  import { addHistoryInstrumentationHandler } from '@sentry-internal/browser-utils';
3
3
  import { DEBUG_BUILD } from '../debug-build.js';
4
4
  import { WINDOW } from '../helpers.js';
@@ -1 +1 @@
1
- {"version":3,"file":"browsersession.js","sources":["../../../../../src/integrations/browsersession.ts"],"sourcesContent":["import { captureSession, debug, defineIntegration, getIsolationScope, startSession } from '@sentry/core';\nimport { addHistoryInstrumentationHandler } from '@sentry-internal/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 Sentry.\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',\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 captureSession();\n\n // User data can be set at any time, for example async after Sentry.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 // the scope class already writes the user to its session, so we only need to capture the session here\n captureSession();\n previousUser = maybeNewUser;\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 }\n });\n }\n },\n };\n});\n"],"names":[],"mappings":";;;;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAA,GAA4B,iBAAiB,CAAC,CAAC,OAAO,GAA0B,EAAE,KAAK;AACpG,EAAE,MAAM,SAAA,GAAY,OAAO,CAAC,SAAA,IAAa,OAAO;;AAEhD,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI,OAAO,MAAM,CAAC,QAAA,KAAa,WAAW,EAAE;AAClD,QAAQ,WAAA;AACR,UAAU,KAAK,CAAC,IAAI,CAAC,qFAAqF,CAAC;AAC3G,QAAQ;AACR,MAAM;;AAEN;AACA;AACA;AACA;AACA,MAAM,YAAY,CAAC,EAAE,cAAc,EAAE,IAAA,EAAM,CAAC;AAC5C,MAAM,cAAc,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,cAAA,GAAiB,iBAAiB,EAAE;AAChD,MAAM,IAAI,YAAA,GAAe,cAAc,CAAC,OAAO,EAAE;AACjD,MAAM,cAAc,CAAC,gBAAgB,CAAC,SAAS;AAC/C,QAAQ,MAAM,YAAA,GAAe,KAAK,CAAC,OAAO,EAAE;AAC5C;AACA,QAAQ,IAAI,YAAY,EAAE,EAAA,KAAO,YAAY,EAAE,EAAA,IAAM,YAAY,EAAE,UAAA,KAAe,YAAY,EAAE,UAAU,EAAE;AAC5G;AACA,UAAU,cAAc,EAAE;AAC1B,UAAU,YAAA,GAAe,YAAY;AACrC,QAAQ;AACR,MAAM,CAAC,CAAC;;AAER,MAAM,IAAI,SAAA,KAAc,OAAO,EAAE;AACjC;AACA,QAAQ,gCAAgC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAA,EAAI,KAAK;AAC3D;AACA,UAAU,IAAI,IAAA,KAAS,EAAE,EAAE;AAC3B,YAAY,YAAY,CAAC,EAAE,cAAc,EAAE,IAAA,EAAM,CAAC;AAClD,YAAY,cAAc,EAAE;AAC5B,UAAU;AACV,QAAQ,CAAC,CAAC;AACV,MAAM;AACN,IAAI,CAAC;AACL,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"browsersession.js","sources":["../../../../../src/integrations/browsersession.ts"],"sourcesContent":["import { captureSession, debug, defineIntegration, getIsolationScope, startSession } from '@sentry/core/browser';\nimport { addHistoryInstrumentationHandler } from '@sentry-internal/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 Sentry.\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',\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 captureSession();\n\n // User data can be set at any time, for example async after Sentry.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 // the scope class already writes the user to its session, so we only need to capture the session here\n captureSession();\n previousUser = maybeNewUser;\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 }\n });\n }\n },\n };\n});\n"],"names":[],"mappings":";;;;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAA,GAA4B,iBAAiB,CAAC,CAAC,OAAO,GAA0B,EAAE,KAAK;AACpG,EAAE,MAAM,SAAA,GAAY,OAAO,CAAC,SAAA,IAAa,OAAO;;AAEhD,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI,OAAO,MAAM,CAAC,QAAA,KAAa,WAAW,EAAE;AAClD,QAAQ,WAAA;AACR,UAAU,KAAK,CAAC,IAAI,CAAC,qFAAqF,CAAC;AAC3G,QAAQ;AACR,MAAM;;AAEN;AACA;AACA;AACA;AACA,MAAM,YAAY,CAAC,EAAE,cAAc,EAAE,IAAA,EAAM,CAAC;AAC5C,MAAM,cAAc,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,cAAA,GAAiB,iBAAiB,EAAE;AAChD,MAAM,IAAI,YAAA,GAAe,cAAc,CAAC,OAAO,EAAE;AACjD,MAAM,cAAc,CAAC,gBAAgB,CAAC,SAAS;AAC/C,QAAQ,MAAM,YAAA,GAAe,KAAK,CAAC,OAAO,EAAE;AAC5C;AACA,QAAQ,IAAI,YAAY,EAAE,EAAA,KAAO,YAAY,EAAE,EAAA,IAAM,YAAY,EAAE,UAAA,KAAe,YAAY,EAAE,UAAU,EAAE;AAC5G;AACA,UAAU,cAAc,EAAE;AAC1B,UAAU,YAAA,GAAe,YAAY;AACrC,QAAQ;AACR,MAAM,CAAC,CAAC;;AAER,MAAM,IAAI,SAAA,KAAc,OAAO,EAAE;AACjC;AACA,QAAQ,gCAAgC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAA,EAAI,KAAK;AAC3D;AACA,UAAU,IAAI,IAAA,KAAS,EAAE,EAAE;AAC3B,YAAY,YAAY,CAAC,EAAE,cAAc,EAAE,IAAA,EAAM,CAAC;AAClD,YAAY,cAAc,EAAE;AAC5B,UAAU;AACV,QAAQ,CAAC,CAAC;AACV,MAAM;AACN,IAAI,CAAC;AACL,GAAG;AACH,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, GLOBAL_OBJ, stripUrlQueryAndFragment, addContextToFrame } from '@sentry/core';
1
+ import { defineIntegration, GLOBAL_OBJ, stripUrlQueryAndFragment, addContextToFrame } from '@sentry/core/browser';
2
2
 
3
3
  const WINDOW = GLOBAL_OBJ ;
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"contextlines.js","sources":["../../../../../src/integrations/contextlines.ts"],"sourcesContent":["import type { Event, IntegrationFn, StackFrame } from '@sentry/core';\nimport { addContextToFrame, defineIntegration, GLOBAL_OBJ, stripUrlQueryAndFragment } from '@sentry/core';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nconst DEFAULT_LINES_OF_CONTEXT = 7;\n\nconst INTEGRATION_NAME = 'ContextLines';\n\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 frameContextLines?: number;\n}\n\nconst _contextLinesIntegration = ((options: ContextLinesOptions = {}) => {\n const contextLines = options.frameContextLines != null ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n\n return {\n name: INTEGRATION_NAME,\n processEvent(event) {\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 Sentry 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":[],"mappings":";;AAGA,MAAM,MAAA,GAAS,UAAA;;AAEf,MAAM,wBAAA,GAA2B,CAAC;;AAElC,MAAM,gBAAA,GAAmB,cAAc;;AAYvC,MAAM,wBAAA,IAA4B,CAAC,OAAO,GAAwB,EAAE,KAAK;AACzE,EAAE,MAAM,YAAA,GAAe,OAAO,CAAC,iBAAA,IAAqB,IAAA,GAAO,OAAO,CAAC,iBAAA,GAAoB,wBAAwB;;AAE/G,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,YAAY,CAAC,KAAK,EAAE;AACxB,MAAM,OAAO,gBAAgB,CAAC,KAAK,EAAE,YAAY,CAAC;AAClD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA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ACX,EAAE,YAAY;AACd,EAAE,cAAc;AAChB,EAAc;AACd,EAAE,IAAI,KAAK,CAAC,QAAA,KAAa,YAAA,IAAgB,CAAC,KAAK,CAAC,MAAA,IAAU,CAAC,SAAS,CAAC,MAAM,EAAE;AAC7E,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,iBAAiB,CAAC,SAAS,EAAE,KAAK,EAAE,cAAc,CAAC;;AAErD,EAAE,OAAO,KAAK;AACd;;;;"}
1
+ {"version":3,"file":"contextlines.js","sources":["../../../../../src/integrations/contextlines.ts"],"sourcesContent":["import type { Event, IntegrationFn, StackFrame } from '@sentry/core/browser';\nimport { addContextToFrame, defineIntegration, GLOBAL_OBJ, stripUrlQueryAndFragment } from '@sentry/core/browser';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nconst DEFAULT_LINES_OF_CONTEXT = 7;\n\nconst INTEGRATION_NAME = 'ContextLines';\n\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 frameContextLines?: number;\n}\n\nconst _contextLinesIntegration = ((options: ContextLinesOptions = {}) => {\n const contextLines = options.frameContextLines != null ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n\n return {\n name: INTEGRATION_NAME,\n processEvent(event) {\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 Sentry 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":[],"mappings":";;AAGA,MAAM,MAAA,GAAS,UAAA;;AAEf,MAAM,wBAAA,GAA2B,CAAC;;AAElC,MAAM,gBAAA,GAAmB,cAAc;;AAYvC,MAAM,wBAAA,IAA4B,CAAC,OAAO,GAAwB,EAAE,KAAK;AACzE,EAAE,MAAM,YAAA,GAAe,OAAO,CAAC,iBAAA,IAAqB,IAAA,GAAO,OAAO,CAAC,iBAAA,GAAoB,wBAAwB;;AAE/G,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,YAAY,CAAC,KAAK,EAAE;AACxB,MAAM,OAAO,gBAAgB,CAAC,KAAK,EAAE,YAAY,CAAC;AAClD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,uBAAA,GAA0B,iBAAiB,CAAC,wBAAwB;;AAEjF;AACA;AACA;AACA,SAAS,gBAAgB,CAAC,KAAK,EAAS,YAAY,E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SAAS,CAAC,MAAM,EAAE;AAC7E,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,iBAAiB,CAAC,SAAS,EAAE,KAAK,EAAE,cAAc,CAAC;;AAErD,EAAE,OAAO,KAAK;AACd;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, safeSetSpanJSONAttributes } from '@sentry/core';
1
+ import { defineIntegration, safeSetSpanJSONAttributes } from '@sentry/core/browser';
2
2
  import { WINDOW } from '../helpers.js';
3
3
 
4
4
  const INTEGRATION_NAME = 'CultureContext';
@@ -1 +1 @@
1
- {"version":3,"file":"culturecontext.js","sources":["../../../../../src/integrations/culturecontext.ts"],"sourcesContent":["import type { CultureContext, IntegrationFn } from '@sentry/core';\nimport { defineIntegration, safeSetSpanJSONAttributes } from '@sentry/core';\nimport { WINDOW } from '../helpers';\n\nconst INTEGRATION_NAME = 'CultureContext';\n\nconst _cultureContextIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n preprocessEvent(event) {\n const culture = getCultureContext();\n\n if (culture) {\n event.contexts = {\n ...event.contexts,\n culture: { ...culture, ...event.contexts?.culture },\n };\n }\n },\n processSegmentSpan(span) {\n const culture = getCultureContext();\n\n if (culture) {\n safeSetSpanJSONAttributes(span, {\n 'culture.locale': culture.locale,\n 'culture.timezone': culture.timezone,\n 'culture.calendar': culture.calendar,\n });\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Captures culture context from the browser.\n *\n * Enabled by default.\n *\n * @example\n * ```js\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * integrations: [Sentry.cultureContextIntegration()],\n * });\n * ```\n */\nexport const cultureContextIntegration = defineIntegration(_cultureContextIntegration);\n\n/**\n * Returns the culture context from the browser's Intl API.\n */\nfunction getCultureContext(): CultureContext | undefined {\n try {\n const intl = (WINDOW as { Intl?: typeof Intl }).Intl;\n if (!intl) {\n return undefined;\n }\n\n const options = intl.DateTimeFormat().resolvedOptions();\n\n return {\n locale: options.locale,\n timezone: options.timeZone,\n calendar: options.calendar,\n };\n } catch {\n // Ignore errors\n return undefined;\n }\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,gBAAA,GAAmB,gBAAgB;;AAEzC,MAAM,0BAAA,IAA8B,MAAM;AAC1C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,eAAe,CAAC,KAAK,EAAE;AAC3B,MAAM,MAAM,OAAA,GAAU,iBAAiB,EAAE;;AAEzC,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,KAAK,CAAC,QAAA,GAAW;AACzB,UAAU,GAAG,KAAK,CAAC,QAAQ;AAC3B,UAAU,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,OAAA,EAAS;AAC7D,SAAS;AACT,MAAM;AACN,IAAI,CAAC;AACL,IAAI,kBAAkB,CAAC,IAAI,EAAE;AAC7B,MAAM,MAAM,OAAA,GAAU,iBAAiB,EAAE;;AAEzC,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,yBAAyB,CAAC,IAAI,EAAE;AACxC,UAAU,gBAAgB,EAAE,OAAO,CAAC,MAAM;AAC1C,UAAU,kBAAkB,EAAE,OAAO,CAAC,QAAQ;AAC9C,UAAU,kBAAkB,EAAE,OAAO,CAAC,QAAQ;AAC9C,SAAS,CAAC;AACV,MAAM;AACN,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,yBAAA,GAA4B,iBAAiB,CAAC,0BAA0B;;AAErF;AACA;AACA;AACA,SAAS,iBAAiB,GAA+B;AACzD,EAAE,IAAI;AACN,IAAI,MAAM,IAAA,GAAO,CAAC,MAAA,GAAkC,IAAI;AACxD,IAAI,IAAI,CAAC,IAAI,EAAE;AACf,MAAM,OAAO,SAAS;AACtB,IAAI;;AAEJ,IAAI,MAAM,OAAA,GAAU,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE;;AAE3D,IAAI,OAAO;AACX,MAAM,MAAM,EAAE,OAAO,CAAC,MAAM;AAC5B,MAAM,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAChC,MAAM,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAChC,KAAK;AACL,EAAE,EAAE,MAAM;AACV;AACA,IAAI,OAAO,SAAS;AACpB,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"culturecontext.js","sources":["../../../../../src/integrations/culturecontext.ts"],"sourcesContent":["import type { CultureContext, IntegrationFn } from '@sentry/core/browser';\nimport { defineIntegration, safeSetSpanJSONAttributes } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\n\nconst INTEGRATION_NAME = 'CultureContext';\n\nconst _cultureContextIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n preprocessEvent(event) {\n const culture = getCultureContext();\n\n if (culture) {\n event.contexts = {\n ...event.contexts,\n culture: { ...culture, ...event.contexts?.culture },\n };\n }\n },\n processSegmentSpan(span) {\n const culture = getCultureContext();\n\n if (culture) {\n safeSetSpanJSONAttributes(span, {\n 'culture.locale': culture.locale,\n 'culture.timezone': culture.timezone,\n 'culture.calendar': culture.calendar,\n });\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Captures culture context from the browser.\n *\n * Enabled by default.\n *\n * @example\n * ```js\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * integrations: [Sentry.cultureContextIntegration()],\n * });\n * ```\n */\nexport const cultureContextIntegration = defineIntegration(_cultureContextIntegration);\n\n/**\n * Returns the culture context from the browser's Intl API.\n */\nfunction getCultureContext(): CultureContext | undefined {\n try {\n const intl = (WINDOW as { Intl?: typeof Intl }).Intl;\n if (!intl) {\n return undefined;\n }\n\n const options = intl.DateTimeFormat().resolvedOptions();\n\n return {\n locale: options.locale,\n timezone: options.timeZone,\n calendar: options.calendar,\n };\n } catch {\n // Ignore errors\n return undefined;\n }\n}\n"],"names":[],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AAE,OAAO,CAAC,MAAM;AAC5B,MAAM,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAChC,MAAM,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAChC,KAAK;AACL,EAAE,EAAE,MAAM;AACV;AACA,IAAI,OAAO,SAAS;AACpB,EAAE;AACF;;;;"}
@@ -1,4 +1,4 @@
1
- import { growthbookIntegration as growthbookIntegration$1 } from '@sentry/core';
1
+ import { growthbookIntegration as growthbookIntegration$1 } from '@sentry/core/browser';
2
2
 
3
3
  /**
4
4
  * Sentry integration for capturing feature flag evaluations from GrowthBook.
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/growthbook/integration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { growthbookIntegration as coreGrowthbookIntegration } from '@sentry/core';\nimport type { GrowthBookClass } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from GrowthBook.\n *\n * See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags\n *\n * @example\n * ```\n * import { GrowthBook } from '@growthbook/growthbook';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],\n * });\n *\n * const gb = new GrowthBook();\n * gb.isOn('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const growthbookIntegration = (({ growthbookClass }: { growthbookClass: GrowthBookClass }) =>\n coreGrowthbookIntegration({ growthbookClass })) satisfies IntegrationFn;\n"],"names":["coreGrowthbookIntegration"],"mappings":";;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,CAAC,EAAE,eAAA,EAAiB;AAC1D,EAAEA,uBAAyB,CAAC,EAAE,eAAA,EAAiB,CAAC,CAAA;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/growthbook/integration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport { growthbookIntegration as coreGrowthbookIntegration } from '@sentry/core/browser';\nimport type { GrowthBookClass } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from GrowthBook.\n *\n * See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags\n *\n * @example\n * ```\n * import { GrowthBook } from '@growthbook/growthbook';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],\n * });\n *\n * const gb = new GrowthBook();\n * gb.isOn('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const growthbookIntegration = (({ growthbookClass }: { growthbookClass: GrowthBookClass }) =>\n coreGrowthbookIntegration({ growthbookClass })) satisfies IntegrationFn;\n"],"names":["coreGrowthbookIntegration"],"mappings":";;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,CAAC,EAAE,eAAA,EAAiB;AAC1D,EAAEA,uBAAyB,CAAC,EAAE,eAAA,EAAiB,CAAC,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core';
1
+ import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core/browser';
2
2
 
3
3
  /**
4
4
  * Sentry integration for capturing feature flag evaluations from LaunchDarkly.
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/launchdarkly/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core';\nimport type { LDContext, LDEvaluationDetail, LDInspectionFlagUsedHandler } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from LaunchDarkly.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from '@sentry/browser';\n * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';\n * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';\n *\n * Sentry.init(..., integrations: [launchDarklyIntegration()])\n * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});\n * ```\n */\nexport const launchDarklyIntegration = defineIntegration(() => {\n return {\n name: 'LaunchDarkly',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * LaunchDarkly hook to listen for and buffer flag evaluations. This needs to\n * be registered as an 'inspector' in LaunchDarkly initialize() options,\n * separately from `launchDarklyIntegration`. Both the hook and the integration\n * are needed to capture LaunchDarkly flags.\n */\nexport function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler {\n return {\n name: 'sentry-flag-auditor',\n type: 'flag-used',\n\n synchronous: true,\n\n /**\n * Handle a flag evaluation by storing its name and value on the current scope.\n */\n method: (flagKey: string, flagDetail: LDEvaluationDetail, _context: LDContext) => {\n _INTERNAL_insertFlagToScope(flagKey, flagDetail.value);\n _INTERNAL_addFeatureFlagToActiveSpan(flagKey, flagDetail.value);\n },\n };\n}\n"],"names":[],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,uBAAA,GAA0B,iBAAiB,CAAC,MAAM;AAC/D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,cAAc;;AAExB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACvD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gCAAgC,GAAgC;AAChF,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,qBAAqB;AAC/B,IAAI,IAAI,EAAE,WAAW;;AAErB,IAAI,WAAW,EAAE,IAAI;;AAErB;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,OAAO,EAAU,UAAU,EAAsB,QAAQ,KAAgB;AACtF,MAAM,2BAA2B,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;AAC5D,MAAM,oCAAoC,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;AACrE,IAAI,CAAC;AACL,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/launchdarkly/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core/browser';\nimport type { LDContext, LDEvaluationDetail, LDInspectionFlagUsedHandler } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from LaunchDarkly.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from '@sentry/browser';\n * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';\n * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';\n *\n * Sentry.init(..., integrations: [launchDarklyIntegration()])\n * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});\n * ```\n */\nexport const launchDarklyIntegration = defineIntegration(() => {\n return {\n name: 'LaunchDarkly',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * LaunchDarkly hook to listen for and buffer flag evaluations. This needs to\n * be registered as an 'inspector' in LaunchDarkly initialize() options,\n * separately from `launchDarklyIntegration`. Both the hook and the integration\n * are needed to capture LaunchDarkly flags.\n */\nexport function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler {\n return {\n name: 'sentry-flag-auditor',\n type: 'flag-used',\n\n synchronous: true,\n\n /**\n * Handle a flag evaluation by storing its name and value on the current scope.\n */\n method: (flagKey: string, flagDetail: LDEvaluationDetail, _context: LDContext) => {\n _INTERNAL_insertFlagToScope(flagKey, flagDetail.value);\n _INTERNAL_addFeatureFlagToActiveSpan(flagKey, flagDetail.value);\n },\n };\n}\n"],"names":[],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,uBAAA,GAA0B,iBAAiB,CAAC,MAAM;AAC/D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,cAAc;;AAExB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACvD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gCAAgC,GAAgC;AAChF,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,qBAAqB;AAC/B,IAAI,IAAI,EAAE,WAAW;;AAErB,IAAI,WAAW,EAAE,IAAI;;AAErB;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,OAAO,EAAU,UAAU,EAAsB,QAAQ,KAAgB;AACtF,MAAM,2BAA2B,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;AAC5D,MAAM,oCAAoC,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;AACrE,IAAI,CAAC;AACL,GAAG;AACH;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core';
1
+ import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core/browser';
2
2
 
3
3
  const openFeatureIntegration = defineIntegration(() => {
4
4
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/openfeature/integration.ts"],"sourcesContent":["/**\n * Sentry integration for capturing OpenFeature feature flag evaluations.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from \"@sentry/browser\";\n * import { OpenFeature } from \"@openfeature/web-sdk\";\n *\n * Sentry.init(..., integrations: [Sentry.openFeatureIntegration()]);\n * OpenFeature.setProvider(new MyProviderOfChoice());\n * OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());\n * ```\n */\nimport type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core';\nimport type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureHook } from './types';\n\nexport const openFeatureIntegration = defineIntegration(() => {\n return {\n name: 'OpenFeature',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * OpenFeature Hook class implementation.\n */\nexport class OpenFeatureIntegrationHook implements OpenFeatureHook {\n /**\n * Successful evaluation result.\n */\n public after(_hookContext: Readonly<HookContext<JsonValue>>, evaluationDetails: EvaluationDetails<JsonValue>): void {\n _INTERNAL_insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);\n _INTERNAL_addFeatureFlagToActiveSpan(evaluationDetails.flagKey, evaluationDetails.value);\n }\n\n /**\n * On error evaluation result.\n */\n public error(hookContext: Readonly<HookContext<JsonValue>>, _error: unknown, _hookHints?: HookHints): void {\n _INTERNAL_insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);\n _INTERNAL_addFeatureFlagToActiveSpan(hookContext.flagKey, hookContext.defaultValue);\n }\n}\n"],"names":[],"mappings":";;MAwBa,sBAAA,GAAyB,iBAAiB,CAAC,MAAM;AAC9D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,aAAa;;AAEvB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACvD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACO,MAAM,4BAAsD;AACnE;AACA;AACA;AACA,GAAS,KAAK,CAAC,YAAY,EAAoC,iBAAiB,EAAsC;AACtH,IAAI,2BAA2B,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AACnF,IAAI,oCAAoC,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AAC5F,EAAE;;AAEF;AACA;AACA;AACA,GAAS,KAAK,CAAC,WAAW,EAAoC,MAAM,EAAW,UAAU,EAAoB;AAC7G,IAAI,2BAA2B,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AAC9E,IAAI,oCAAoC,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AACvF,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/openfeature/integration.ts"],"sourcesContent":["/**\n * Sentry integration for capturing OpenFeature feature flag evaluations.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from \"@sentry/browser\";\n * import { OpenFeature } from \"@openfeature/web-sdk\";\n *\n * Sentry.init(..., integrations: [Sentry.openFeatureIntegration()]);\n * OpenFeature.setProvider(new MyProviderOfChoice());\n * OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());\n * ```\n */\nimport type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core/browser';\nimport type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureHook } from './types';\n\nexport const openFeatureIntegration = defineIntegration(() => {\n return {\n name: 'OpenFeature',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * OpenFeature Hook class implementation.\n */\nexport class OpenFeatureIntegrationHook implements OpenFeatureHook {\n /**\n * Successful evaluation result.\n */\n public after(_hookContext: Readonly<HookContext<JsonValue>>, evaluationDetails: EvaluationDetails<JsonValue>): void {\n _INTERNAL_insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);\n _INTERNAL_addFeatureFlagToActiveSpan(evaluationDetails.flagKey, evaluationDetails.value);\n }\n\n /**\n * On error evaluation result.\n */\n public error(hookContext: Readonly<HookContext<JsonValue>>, _error: unknown, _hookHints?: HookHints): void {\n _INTERNAL_insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);\n _INTERNAL_addFeatureFlagToActiveSpan(hookContext.flagKey, hookContext.defaultValue);\n }\n}\n"],"names":[],"mappings":";;MAwBa,sBAAA,GAAyB,iBAAiB,CAAC,MAAM;AAC9D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,aAAa;;AAEvB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACvD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACO,MAAM,4BAAsD;AACnE;AACA;AACA;AACA,GAAS,KAAK,CAAC,YAAY,EAAoC,iBAAiB,EAAsC;AACtH,IAAI,2BAA2B,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AACnF,IAAI,oCAAoC,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AAC5F,EAAE;;AAEF;AACA;AACA;AACA,GAAS,KAAK,CAAC,WAAW,EAAoC,MAAM,EAAW,UAAU,EAAoB;AAC7G,IAAI,2BAA2B,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AAC9E,IAAI,oCAAoC,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AACvF,EAAE;AACF;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core';
1
+ import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core/browser';
2
2
 
3
3
  /**
4
4
  * Sentry integration for capturing feature flag evaluations from the Statsig js-client SDK.
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/statsig/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core';\nimport type { FeatureGate, StatsigClient } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Statsig js-client SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { StatsigClient } from '@statsig/js-client';\n * import * as Sentry from '@sentry/browser';\n *\n * const statsigClient = new StatsigClient();\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.statsigIntegration({featureFlagClient: statsigClient})],\n * });\n *\n * await statsigClient.initializeAsync(); // or statsigClient.initializeSync();\n *\n * const result = statsigClient.checkGate('my-feature-gate');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const statsigIntegration = defineIntegration(\n ({ featureFlagClient: statsigClient }: { featureFlagClient: StatsigClient }) => {\n return {\n name: 'Statsig',\n\n setup(_client: Client) {\n statsigClient.on('gate_evaluation', (event: { gate: FeatureGate }) => {\n _INTERNAL_insertFlagToScope(event.gate.name, event.gate.value);\n _INTERNAL_addFeatureFlagToActiveSpan(event.gate.name, event.gate.value);\n });\n },\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n },\n) satisfies IntegrationFn;\n"],"names":[],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAA,GAAqB,iBAAiB;AACnD,EAAE,CAAC,EAAE,iBAAiB,EAAE,aAAA,EAAe,KAA2C;AAClF,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,SAAS;;AAErB,MAAM,KAAK,CAAC,OAAO,EAAU;AAC7B,QAAQ,aAAa,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,KAAK,KAA4B;AAC9E,UAAU,2BAA2B,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACxE,UAAU,oCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACjF,QAAQ,CAAC,CAAC;AACV,MAAM,CAAC;;AAEP,MAAM,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AAC3E,QAAQ,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACzD,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH,CAAA;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/statsig/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core/browser';\nimport type { FeatureGate, StatsigClient } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Statsig js-client SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { StatsigClient } from '@statsig/js-client';\n * import * as Sentry from '@sentry/browser';\n *\n * const statsigClient = new StatsigClient();\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.statsigIntegration({featureFlagClient: statsigClient})],\n * });\n *\n * await statsigClient.initializeAsync(); // or statsigClient.initializeSync();\n *\n * const result = statsigClient.checkGate('my-feature-gate');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const statsigIntegration = defineIntegration(\n ({ featureFlagClient: statsigClient }: { featureFlagClient: StatsigClient }) => {\n return {\n name: 'Statsig',\n\n setup(_client: Client) {\n statsigClient.on('gate_evaluation', (event: { gate: FeatureGate }) => {\n _INTERNAL_insertFlagToScope(event.gate.name, event.gate.value);\n _INTERNAL_addFeatureFlagToActiveSpan(event.gate.name, event.gate.value);\n });\n },\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n },\n) satisfies IntegrationFn;\n"],"names":[],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAA,GAAqB,iBAAiB;AACnD,EAAE,CAAC,EAAE,iBAAiB,EAAE,aAAA,EAAe,KAA2C;AAClF,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,SAAS;;AAErB,MAAM,KAAK,CAAC,OAAO,EAAU;AAC7B,QAAQ,aAAa,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,KAAK,KAA4B;AAC9E,UAAU,2BAA2B,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACxE,UAAU,oCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACjF,QAAQ,CAAC,CAAC;AACV,MAAM,CAAC;;AAEP,MAAM,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AAC3E,QAAQ,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACzD,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, fill, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan, debug } from '@sentry/core';
1
+ import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, fill, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan, debug } from '@sentry/core/browser';
2
2
  import { DEBUG_BUILD } from '../../../debug-build.js';
3
3
 
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/unleash/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n debug,\n defineIntegration,\n fill,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport type { UnleashClient, UnleashClientClass } from './types';\n\ntype UnleashIntegrationOptions = {\n featureFlagClientClass: UnleashClientClass;\n};\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Unleash SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { UnleashClient } from 'unleash-proxy-client';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],\n * });\n *\n * const unleash = new UnleashClient(...);\n * unleash.start();\n *\n * unleash.isEnabled('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const unleashIntegration = defineIntegration(\n ({ featureFlagClientClass: unleashClientClass }: UnleashIntegrationOptions) => {\n return {\n name: 'Unleash',\n\n setupOnce() {\n const unleashClientPrototype = unleashClientClass.prototype as UnleashClient;\n fill(unleashClientPrototype, 'isEnabled', _wrappedIsEnabled);\n },\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n },\n) satisfies IntegrationFn;\n\n/**\n * Wraps the UnleashClient.isEnabled method to capture feature flag evaluations. Its only side effect is writing to Sentry scope.\n *\n * This wrapper is safe for all isEnabled signatures. If the signature does not match (this: UnleashClient, toggleName: string, ...args: unknown[]) => boolean,\n * we log an error and return the original result.\n *\n * @param original - The original method.\n * @returns Wrapped method. Results should match the original.\n */\nfunction _wrappedIsEnabled(\n original: (this: UnleashClient, ...args: unknown[]) => unknown,\n): (this: UnleashClient, ...args: unknown[]) => unknown {\n return function (this: UnleashClient, ...args: unknown[]): unknown {\n const toggleName = args[0];\n const result = original.apply(this, args);\n\n if (typeof toggleName === 'string' && typeof result === 'boolean') {\n _INTERNAL_insertFlagToScope(toggleName, result);\n _INTERNAL_addFeatureFlagToActiveSpan(toggleName, result);\n } else if (DEBUG_BUILD) {\n debug.error(\n `[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`,\n );\n }\n return result;\n };\n}\n"],"names":[],"mappings":";;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAA,GAAqB,iBAAiB;AACnD,EAAE,CAAC,EAAE,sBAAsB,EAAE,kBAAA,EAAoB,KAAgC;AACjF,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,SAAS;;AAErB,MAAM,SAAS,GAAG;AAClB,QAAQ,MAAM,sBAAA,GAAyB,kBAAkB,CAAC,SAAA;AAC1D,QAAQ,IAAI,CAAC,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,CAAC;AACpE,MAAM,CAAC;;AAEP,MAAM,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AAC3E,QAAQ,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACzD,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB;AAC1B,EAAE,QAAQ;AACV,EAAwD;AACxD,EAAE,OAAO,WAA+B,GAAG,IAAI,EAAsB;AACrE,IAAI,MAAM,UAAA,GAAa,IAAI,CAAC,CAAC,CAAC;AAC9B,IAAI,MAAM,MAAA,GAAS,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;;AAE7C,IAAI,IAAI,OAAO,UAAA,KAAe,QAAA,IAAY,OAAO,MAAA,KAAW,SAAS,EAAE;AACvE,MAAM,2BAA2B,CAAC,UAAU,EAAE,MAAM,CAAC;AACrD,MAAM,oCAAoC,CAAC,UAAU,EAAE,MAAM,CAAC;AAC9D,IAAI,CAAA,MAAO,IAAI,WAAW,EAAE;AAC5B,MAAM,KAAK,CAAC,KAAK;AACjB,QAAQ,CAAC,iFAAiF,EAAE,UAAU,CAAC,EAAE,EAAE,OAAO,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,MAAM,CAAC,CAAC,CAAC;AACrK,OAAO;AACP,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB,EAAE,CAAC;AACH;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/unleash/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core/browser';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n debug,\n defineIntegration,\n fill,\n} from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport type { UnleashClient, UnleashClientClass } from './types';\n\ntype UnleashIntegrationOptions = {\n featureFlagClientClass: UnleashClientClass;\n};\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Unleash SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { UnleashClient } from 'unleash-proxy-client';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],\n * });\n *\n * const unleash = new UnleashClient(...);\n * unleash.start();\n *\n * unleash.isEnabled('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const unleashIntegration = defineIntegration(\n ({ featureFlagClientClass: unleashClientClass }: UnleashIntegrationOptions) => {\n return {\n name: 'Unleash',\n\n setupOnce() {\n const unleashClientPrototype = unleashClientClass.prototype as UnleashClient;\n fill(unleashClientPrototype, 'isEnabled', _wrappedIsEnabled);\n },\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n },\n) satisfies IntegrationFn;\n\n/**\n * Wraps the UnleashClient.isEnabled method to capture feature flag evaluations. Its only side effect is writing to Sentry scope.\n *\n * This wrapper is safe for all isEnabled signatures. If the signature does not match (this: UnleashClient, toggleName: string, ...args: unknown[]) => boolean,\n * we log an error and return the original result.\n *\n * @param original - The original method.\n * @returns Wrapped method. Results should match the original.\n */\nfunction _wrappedIsEnabled(\n original: (this: UnleashClient, ...args: unknown[]) => unknown,\n): (this: UnleashClient, ...args: unknown[]) => unknown {\n return function (this: UnleashClient, ...args: unknown[]): unknown {\n const toggleName = args[0];\n const result = original.apply(this, args);\n\n if (typeof toggleName === 'string' && typeof result === 'boolean') {\n _INTERNAL_insertFlagToScope(toggleName, result);\n _INTERNAL_addFeatureFlagToActiveSpan(toggleName, result);\n } else if (DEBUG_BUILD) {\n debug.error(\n `[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`,\n );\n }\n return result;\n };\n}\n"],"names":[],"mappings":";;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAA,GAAqB,iBAAiB;AACnD,EAAE,CAAC,EAAE,sBAAsB,EAAE,kBAAA,EAAoB,KAAgC;AACjF,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,SAAS;;AAErB,MAAM,SAAS,GAAG;AAClB,QAAQ,MAAM,sBAAA,GAAyB,kBAAkB,CAAC,SAAA;AAC1D,QAAQ,IAAI,CAAC,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,CAAC;AACpE,MAAM,CAAC;;AAEP,MAAM,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AAC3E,QAAQ,OAAO,mCAAmC,CAAC,KAAK,CAAC;AACzD,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB;AAC1B,EAAE,QAAQ;AACV,EAAwD;AACxD,EAAE,OAAO,WAA+B,GAAG,IAAI,EAAsB;AACrE,IAAI,MAAM,UAAA,GAAa,IAAI,CAAC,CAAC,CAAC;AAC9B,IAAI,MAAM,MAAA,GAAS,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;;AAE7C,IAAI,IAAI,OAAO,UAAA,KAAe,QAAA,IAAY,OAAO,MAAA,KAAW,SAAS,EAAE;AACvE,MAAM,2BAA2B,CAAC,UAAU,EAAE,MAAM,CAAC;AACrD,MAAM,oCAAoC,CAAC,UAAU,EAAE,MAAM,CAAC;AAC9D,IAAI,CAAA,MAAO,IAAI,WAAW,EAAE;AAC5B,MAAM,KAAK,CAAC,KAAK;AACjB,QAAQ,CAAC,iFAAiF,EAAE,UAAU,CAAC,EAAE,EAAE,OAAO,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,MAAM,CAAC,CAAC,CAAC;AACrK,OAAO;AACP,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB,EAAE,CAAC;AACH;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, addGlobalErrorInstrumentationHandler, getClient, captureEvent, debug, addGlobalUnhandledRejectionInstrumentationHandler, isPrimitive, UNKNOWN_FUNCTION, getLocationHref, isString, stripDataUrlContent } from '@sentry/core';
1
+ import { defineIntegration, addGlobalErrorInstrumentationHandler, getClient, captureEvent, debug, addGlobalUnhandledRejectionInstrumentationHandler, isPrimitive, UNKNOWN_FUNCTION, getLocationHref, isString, stripDataUrlContent } from '@sentry/core/browser';
2
2
  import { DEBUG_BUILD } from '../debug-build.js';
3
3
  import { eventFromUnknownInput } from '../eventbuilder.js';
4
4
  import { shouldIgnoreOnError } from '../helpers.js';
@@ -1 +1 @@
1
- {"version":3,"file":"globalhandlers.js","sources":["../../../../../src/integrations/globalhandlers.ts"],"sourcesContent":["import type { Client, Event, IntegrationFn, Primitive, StackParser } from '@sentry/core';\nimport {\n addGlobalErrorInstrumentationHandler,\n addGlobalUnhandledRejectionInstrumentationHandler,\n captureEvent,\n debug,\n defineIntegration,\n getClient,\n getLocationHref,\n isPrimitive,\n isString,\n stripDataUrlContent,\n UNKNOWN_FUNCTION,\n} from '@sentry/core';\nimport type { BrowserClient } from '../client';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\ntype GlobalHandlersIntegrationsOptionKeys = 'onerror' | 'onunhandledrejection';\n\ntype GlobalHandlersIntegrations = Record<GlobalHandlersIntegrationsOptionKeys, boolean>;\n\nconst INTEGRATION_NAME = 'GlobalHandlers';\n\nconst _globalHandlersIntegration = ((options: Partial<GlobalHandlersIntegrations> = {}) => {\n const _options = {\n onerror: true,\n onunhandledrejection: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n Error.stackTraceLimit = 50;\n },\n setup(client) {\n if (_options.onerror) {\n _installGlobalOnErrorHandler(client);\n globalHandlerLog('onerror');\n }\n if (_options.onunhandledrejection) {\n _installGlobalOnUnhandledRejectionHandler(client);\n globalHandlerLog('onunhandledrejection');\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const globalHandlersIntegration = defineIntegration(_globalHandlersIntegration);\n\nfunction _installGlobalOnErrorHandler(client: Client): void {\n addGlobalErrorInstrumentationHandler(data => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const { msg, url, line, column, error } = data;\n\n const event = _enhanceEventWithInitialFrame(\n eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n url,\n line,\n column,\n );\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'auto.browser.global_handlers.onerror',\n },\n });\n });\n}\n\nfunction _installGlobalOnUnhandledRejectionHandler(client: Client): void {\n addGlobalUnhandledRejectionInstrumentationHandler(e => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const error = _getUnhandledRejectionError(e);\n\n const event = isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'auto.browser.global_handlers.onunhandledrejection',\n },\n });\n });\n}\n\n/**\n *\n */\nexport function _getUnhandledRejectionError(error: unknown): unknown {\n if (isPrimitive(error)) {\n return error;\n }\n\n // dig the object of the rejection out of known event types\n try {\n type ErrorWithReason = { reason: unknown };\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in (error as ErrorWithReason)) {\n return (error as ErrorWithReason).reason;\n }\n\n type CustomEventWithDetail = { detail: { reason: unknown } };\n // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n if ('detail' in (error as CustomEventWithDetail) && 'reason' in (error as CustomEventWithDetail).detail) {\n return (error as CustomEventWithDetail).detail.reason;\n }\n } catch {} // eslint-disable-line no-empty\n\n return error;\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nexport function _eventFromRejectionWithPrimitive(reason: Primitive): Event {\n return {\n exception: {\n values: [\n {\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n },\n ],\n },\n };\n}\n\nfunction _enhanceEventWithInitialFrame(\n event: Event,\n url: string | undefined,\n lineno: number | undefined,\n colno: number | undefined,\n): Event {\n // event.exception\n const e = (event.exception = event.exception || {});\n // event.exception.values\n const ev = (e.values = e.values || []);\n // event.exception.values[0]\n const ev0 = (ev[0] = ev[0] || {});\n // event.exception.values[0].stacktrace\n const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n // event.exception.values[0].stacktrace.frames\n const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n if (ev0sf.length === 0) {\n ev0sf.push({\n colno,\n lineno,\n filename: getFilenameFromUrl(url) ?? getLocationHref(),\n function: UNKNOWN_FUNCTION,\n in_app: true,\n });\n }\n\n return event;\n}\n\nfunction globalHandlerLog(type: string): void {\n DEBUG_BUILD && debug.log(`Global Handler attached: ${type}`);\n}\n\nfunction getOptions(): { stackParser: StackParser; attachStacktrace?: boolean } {\n const client = getClient<BrowserClient>();\n const options = client?.getOptions() || {\n stackParser: () => [],\n attachStacktrace: false,\n };\n return options;\n}\n\nfunction getFilenameFromUrl(url: string | undefined): string | undefined {\n if (!isString(url) || url.length === 0) {\n return undefined;\n }\n\n // Strip data URL content to avoid long base64 strings in stack frames\n // (e.g. when initializing a Worker with a base64 encoded script)\n // Don't include data prefix for filenames as it's not useful for stack traces\n // Wrap with < > to indicate it's a placeholder\n if (url.startsWith('data:')) {\n return `<${stripDataUrlContent(url, false)}>`;\n }\n\n return url;\n}\n"],"names":[],"mappings":";;;;;AAuBA,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AAA,CAAA,MAAA,IAAA,EAAA,CAAA;;AAEA,EAAA,IAAA,KAAA,CAAA,MAAA,KAAA,CAAA,EAAA;AACA,IAAA,KAAA,CAAA,IAAA,CAAA;AACA,MAAA,KAAA;AACA,MAAA,MAAA;AACA,MAAA,QAAA,EAAA,kBAAA,CAAA,GAAA,CAAA,IAAA,eAAA,EAAA;AACA,MAAA,QAAA,EAAA,gBAAA;AACA,MAAA,MAAA,EAAA,IAAA;AACA,KAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,KAAA;AACA;;AAEA,SAAA,gBAAA,CAAA,IAAA,EAAA;AACA,EAAA,WAAA,IAAA,KAAA,CAAA,GAAA,CAAA,CAAA,yBAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA;;AAEA,SAAA,UAAA,GAAA;AACA,EAAA,MAAA,MAAA,GAAA,SAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,EAAA,UAAA,EAAA,IAAA;AACA,IAAA,WAAA,EAAA,MAAA,EAAA;AACA,IAAA,gBAAA,EAAA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,OAAA;AACA;;AAEA,SAAA,kBAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,IAAA,GAAA,CAAA,MAAA,KAAA,CAAA,EAAA;AACA,IAAA,OAAA,SAAA;AACA,EAAA;;AAEA;AACA;AACA;AACA;AACA,EAAA,IAAA,GAAA,CAAA,UAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,CAAA,CAAA,EAAA,mBAAA,CAAA,GAAA,EAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"globalhandlers.js","sources":["../../../../../src/integrations/globalhandlers.ts"],"sourcesContent":["import type { Client, Event, IntegrationFn, Primitive, StackParser } from '@sentry/core/browser';\nimport {\n addGlobalErrorInstrumentationHandler,\n addGlobalUnhandledRejectionInstrumentationHandler,\n captureEvent,\n debug,\n defineIntegration,\n getClient,\n getLocationHref,\n isPrimitive,\n isString,\n stripDataUrlContent,\n UNKNOWN_FUNCTION,\n} from '@sentry/core/browser';\nimport type { BrowserClient } from '../client';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\ntype GlobalHandlersIntegrationsOptionKeys = 'onerror' | 'onunhandledrejection';\n\ntype GlobalHandlersIntegrations = Record<GlobalHandlersIntegrationsOptionKeys, boolean>;\n\nconst INTEGRATION_NAME = 'GlobalHandlers';\n\nconst _globalHandlersIntegration = ((options: Partial<GlobalHandlersIntegrations> = {}) => {\n const _options = {\n onerror: true,\n onunhandledrejection: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n Error.stackTraceLimit = 50;\n },\n setup(client) {\n if (_options.onerror) {\n _installGlobalOnErrorHandler(client);\n globalHandlerLog('onerror');\n }\n if (_options.onunhandledrejection) {\n _installGlobalOnUnhandledRejectionHandler(client);\n globalHandlerLog('onunhandledrejection');\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const globalHandlersIntegration = defineIntegration(_globalHandlersIntegration);\n\nfunction _installGlobalOnErrorHandler(client: Client): void {\n addGlobalErrorInstrumentationHandler(data => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const { msg, url, line, column, error } = data;\n\n const event = _enhanceEventWithInitialFrame(\n eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n url,\n line,\n column,\n );\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'auto.browser.global_handlers.onerror',\n },\n });\n });\n}\n\nfunction _installGlobalOnUnhandledRejectionHandler(client: Client): void {\n addGlobalUnhandledRejectionInstrumentationHandler(e => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const error = _getUnhandledRejectionError(e);\n\n const event = isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'auto.browser.global_handlers.onunhandledrejection',\n },\n });\n });\n}\n\n/**\n *\n */\nexport function _getUnhandledRejectionError(error: unknown): unknown {\n if (isPrimitive(error)) {\n return error;\n }\n\n // dig the object of the rejection out of known event types\n try {\n type ErrorWithReason = { reason: unknown };\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in (error as ErrorWithReason)) {\n return (error as ErrorWithReason).reason;\n }\n\n type CustomEventWithDetail = { detail: { reason: unknown } };\n // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n if ('detail' in (error as CustomEventWithDetail) && 'reason' in (error as CustomEventWithDetail).detail) {\n return (error as CustomEventWithDetail).detail.reason;\n }\n } catch {} // eslint-disable-line no-empty\n\n return error;\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nexport function _eventFromRejectionWithPrimitive(reason: Primitive): Event {\n return {\n exception: {\n values: [\n {\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n },\n ],\n },\n };\n}\n\nfunction _enhanceEventWithInitialFrame(\n event: Event,\n url: string | undefined,\n lineno: number | undefined,\n colno: number | undefined,\n): Event {\n // event.exception\n const e = (event.exception = event.exception || {});\n // event.exception.values\n const ev = (e.values = e.values || []);\n // event.exception.values[0]\n const ev0 = (ev[0] = ev[0] || {});\n // event.exception.values[0].stacktrace\n const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n // event.exception.values[0].stacktrace.frames\n const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n if (ev0sf.length === 0) {\n ev0sf.push({\n colno,\n lineno,\n filename: getFilenameFromUrl(url) ?? getLocationHref(),\n function: UNKNOWN_FUNCTION,\n in_app: true,\n });\n }\n\n return event;\n}\n\nfunction globalHandlerLog(type: string): void {\n DEBUG_BUILD && debug.log(`Global Handler attached: ${type}`);\n}\n\nfunction getOptions(): { stackParser: StackParser; attachStacktrace?: boolean } {\n const client = getClient<BrowserClient>();\n const options = client?.getOptions() || {\n stackParser: () => [],\n attachStacktrace: false,\n };\n return options;\n}\n\nfunction getFilenameFromUrl(url: string | undefined): string | undefined {\n if (!isString(url) || url.length === 0) {\n return undefined;\n }\n\n // Strip data URL content to avoid long base64 strings in stack frames\n // (e.g. when initializing a Worker with a base64 encoded script)\n // Don't include data prefix for filenames as it's not useful for stack traces\n // Wrap with < > to indicate it's a placeholder\n if (url.startsWith('data:')) {\n return `<${stripDataUrlContent(url, false)}>`;\n }\n\n return url;\n}\n"],"names":[],"mappings":";;;;;AAuBA,MAAM,gBAAA,GAAmB,gBAAgB;;AAEzC,MAAM,0BAAA,IAA8B,CAAC,OAAO,GAAwC,EAAE,KAAK;AAC3F,EAAE,MAAM,WAAW;AACnB,IAAI,OAAO,EAAE,IAAI;AACjB,IAAI,oBAAoB,EAAE,IAAI;AAC9B,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,KAAK,CAAC,eAAA,GAAkB,EAAE;AAChC,IAAI,CAAC;AACL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,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IAAA,KAAA,CAAA,GAAA,CAAA,CAAA,yBAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA;;AAEA,SAAA,UAAA,GAAA;AACA,EAAA,MAAA,MAAA,GAAA,SAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,EAAA,UAAA,EAAA,IAAA;AACA,IAAA,WAAA,EAAA,MAAA,EAAA;AACA,IAAA,gBAAA,EAAA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,OAAA;AACA;;AAEA,SAAA,kBAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,IAAA,GAAA,CAAA,MAAA,KAAA,CAAA,EAAA;AACA,IAAA,OAAA,SAAA;AACA,EAAA;;AAEA;AACA;AACA;AACA;AACA,EAAA,IAAA,GAAA,CAAA,UAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,CAAA,CAAA,EAAA,mBAAA,CAAA,GAAA,EAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,GAAA;AACA;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_URL_FULL, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, isString, stringMatchesSomePattern } from '@sentry/core';
1
+ import { defineIntegration, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_URL_FULL, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, isString, stringMatchesSomePattern } from '@sentry/core/browser';
2
2
  import { SENTRY_XHR_DATA_KEY, getBodyString, getFetchRequestArgBody } from '@sentry-internal/browser-utils';
3
3
 
4
4
  const INTEGRATION_NAME = 'GraphQLClient';
@@ -1 +1 @@
1
- {"version":3,"file":"graphqlClient.js","sources":["../../../../../src/integrations/graphqlClient.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n isString,\n SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_URL_FULL,\n spanToJSON,\n stringMatchesSomePattern,\n} from '@sentry/core';\nimport type { FetchHint, XhrHint } from '@sentry-internal/browser-utils';\nimport { getBodyString, getFetchRequestArgBody, SENTRY_XHR_DATA_KEY } from '@sentry-internal/browser-utils';\n\ninterface GraphQLClientOptions {\n endpoints: Array<string | RegExp>;\n}\n\n/** Standard graphql request shape: https://graphql.org/learn/serving-over-http/#post-request-and-body */\ninterface GraphQLStandardRequest {\n query: string;\n operationName?: string;\n variables?: Record<string, unknown>;\n extensions?: Record<string, unknown>;\n}\n\n/** Persisted operation request */\ninterface GraphQLPersistedRequest {\n operationName: string;\n variables?: Record<string, unknown>;\n extensions: {\n persistedQuery: {\n version: number;\n sha256Hash: string;\n };\n } & Record<string, unknown>;\n}\n\ntype GraphQLRequestPayload = GraphQLStandardRequest | GraphQLPersistedRequest;\n\ninterface GraphQLOperation {\n operationType?: string;\n operationName?: string;\n}\n\nconst INTEGRATION_NAME = 'GraphQLClient';\n\nconst _graphqlClientIntegration = ((options: GraphQLClientOptions) => {\n return {\n name: INTEGRATION_NAME,\n setup(client: Client) {\n _updateSpanWithGraphQLData(client, options);\n _updateBreadcrumbWithGraphQLData(client, options);\n },\n };\n}) satisfies IntegrationFn;\n\nfunction _updateSpanWithGraphQLData(client: Client, options: GraphQLClientOptions): void {\n client.on('beforeOutgoingRequestSpan', (span, hint) => {\n const spanJSON = spanToJSON(span);\n\n const spanAttributes = spanJSON.data || {};\n const spanOp = spanAttributes[SEMANTIC_ATTRIBUTE_SENTRY_OP];\n\n const isHttpClientSpan = spanOp === 'http.client';\n\n if (!isHttpClientSpan) {\n return;\n }\n\n // Fall back to `url` because fetch instrumentation only sets `http.url` for absolute URLs;\n // relative URLs end up only in `url` (see `getFetchSpanAttributes` in packages/core/src/fetch.ts).\n const httpUrl = spanAttributes[SEMANTIC_ATTRIBUTE_URL_FULL] || spanAttributes['http.url'] || spanAttributes['url'];\n const httpMethod = spanAttributes[SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD] || spanAttributes['http.method'];\n\n if (!isString(httpUrl) || !isString(httpMethod)) {\n return;\n }\n\n const { endpoints } = options;\n const isTracedGraphqlEndpoint = stringMatchesSomePattern(httpUrl, endpoints);\n const payload = getRequestPayloadXhrOrFetch(hint as XhrHint | FetchHint);\n\n if (isTracedGraphqlEndpoint && payload) {\n const graphqlBody = getGraphQLRequestPayload(payload);\n\n if (graphqlBody) {\n const operationInfo = _getGraphQLOperation(graphqlBody);\n span.updateName(`${httpMethod} ${httpUrl} (${operationInfo})`);\n\n // Handle standard requests - always capture the query document\n if (isStandardRequest(graphqlBody)) {\n span.setAttribute('graphql.document', graphqlBody.query);\n }\n\n // Handle persisted operations - capture hash for debugging\n if (isPersistedRequest(graphqlBody)) {\n span.setAttribute('graphql.persisted_query.hash.sha256', graphqlBody.extensions.persistedQuery.sha256Hash);\n span.setAttribute('graphql.persisted_query.version', graphqlBody.extensions.persistedQuery.version);\n }\n }\n }\n });\n}\n\nfunction _updateBreadcrumbWithGraphQLData(client: Client, options: GraphQLClientOptions): void {\n client.on('beforeOutgoingRequestBreadcrumb', (breadcrumb, handlerData) => {\n const { category, type, data } = breadcrumb;\n\n const isFetch = category === 'fetch';\n const isXhr = category === 'xhr';\n const isHttpBreadcrumb = type === 'http';\n\n if (isHttpBreadcrumb && (isFetch || isXhr)) {\n const httpUrl = data?.url;\n const { endpoints } = options;\n\n const isTracedGraphqlEndpoint = stringMatchesSomePattern(httpUrl, endpoints);\n const payload = getRequestPayloadXhrOrFetch(handlerData as XhrHint | FetchHint);\n\n if (isTracedGraphqlEndpoint && data && payload) {\n const graphqlBody = getGraphQLRequestPayload(payload);\n\n if (!data.graphql && graphqlBody) {\n const operationInfo = _getGraphQLOperation(graphqlBody);\n\n data['graphql.operation'] = operationInfo;\n\n if (isStandardRequest(graphqlBody)) {\n data['graphql.document'] = graphqlBody.query;\n }\n\n if (isPersistedRequest(graphqlBody)) {\n data['graphql.persisted_query.hash.sha256'] = graphqlBody.extensions.persistedQuery.sha256Hash;\n data['graphql.persisted_query.version'] = graphqlBody.extensions.persistedQuery.version;\n }\n }\n }\n }\n });\n}\n\n/**\n * @param requestBody - GraphQL request\n * @returns A formatted version of the request: 'TYPE NAME' or 'TYPE' or 'persisted NAME'\n */\nexport function _getGraphQLOperation(requestBody: GraphQLRequestPayload): string {\n // Handle persisted operations\n if (isPersistedRequest(requestBody)) {\n return `persisted ${requestBody.operationName}`;\n }\n\n // Handle standard GraphQL requests\n if (isStandardRequest(requestBody)) {\n const { query: graphqlQuery, operationName: graphqlOperationName } = requestBody;\n const { operationName = graphqlOperationName, operationType } = parseGraphQLQuery(graphqlQuery);\n const operationInfo = operationName ? `${operationType} ${operationName}` : `${operationType}`;\n return operationInfo;\n }\n\n // Fallback for unknown request types\n return 'unknown';\n}\n\n/**\n * Get the request body/payload based on the shape of the hint.\n *\n * Exported for tests only.\n */\nexport function getRequestPayloadXhrOrFetch(hint: XhrHint | FetchHint): string | undefined {\n const isXhr = 'xhr' in hint;\n\n let body: string | undefined;\n\n if (isXhr) {\n const sentryXhrData = hint.xhr[SENTRY_XHR_DATA_KEY];\n body = sentryXhrData && getBodyString(sentryXhrData.body)[0];\n } else {\n const sentryFetchData = getFetchRequestArgBody(hint.input);\n body = getBodyString(sentryFetchData)[0];\n }\n\n return body;\n}\n\n/**\n * Extract the name and type of the operation from the GraphQL query.\n *\n * Exported for tests only.\n */\nexport function parseGraphQLQuery(query: string): GraphQLOperation {\n const namedQueryRe = /^(?:\\s*)(query|mutation|subscription)(?:\\s*)(\\w+)(?:\\s*)[{(]/;\n const unnamedQueryRe = /^(?:\\s*)(query|mutation|subscription)(?:\\s*)[{(]/;\n\n const namedMatch = query.match(namedQueryRe);\n if (namedMatch) {\n return {\n operationType: namedMatch[1],\n operationName: namedMatch[2],\n };\n }\n\n const unnamedMatch = query.match(unnamedQueryRe);\n if (unnamedMatch) {\n return {\n operationType: unnamedMatch[1],\n operationName: undefined,\n };\n }\n return {\n operationType: undefined,\n operationName: undefined,\n };\n}\n\n/**\n * Helper to safely check if a value is a non-null object\n */\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * Type guard to check if a request is a standard GraphQL request\n */\nfunction isStandardRequest(payload: unknown): payload is GraphQLStandardRequest {\n return isObject(payload) && typeof payload.query === 'string';\n}\n\n/**\n * Type guard to check if a request is a persisted operation request\n */\nfunction isPersistedRequest(payload: unknown): payload is GraphQLPersistedRequest {\n return (\n isObject(payload) &&\n typeof payload.operationName === 'string' &&\n isObject(payload.extensions) &&\n isObject(payload.extensions.persistedQuery) &&\n typeof payload.extensions.persistedQuery.sha256Hash === 'string' &&\n typeof payload.extensions.persistedQuery.version === 'number'\n );\n}\n\n/**\n * Extract the payload of a request if it's GraphQL.\n * Exported for tests only.\n * @param payload - A valid JSON string\n * @returns A POJO or undefined\n */\nexport function getGraphQLRequestPayload(payload: string): GraphQLRequestPayload | undefined {\n try {\n const requestBody = JSON.parse(payload);\n\n // Return any valid GraphQL request (standard, persisted, or APQ retry with both)\n if (isStandardRequest(requestBody) || isPersistedRequest(requestBody)) {\n return requestBody;\n }\n\n // Not a GraphQL request\n return undefined;\n } catch {\n // Invalid JSON\n return undefined;\n }\n}\n\n/**\n * This integration ensures that GraphQL requests made in the browser\n * have their GraphQL-specific data captured and attached to spans and breadcrumbs.\n */\nexport const graphqlClientIntegration = defineIntegration(_graphqlClientIntegration);\n"],"names":[],"mappings":";;;AA4CA,MAAM,gBAAA,GAAmB,eAAe;;AAExC,MAAM,6BAA6B,CAAC,OAAO,KAA2B;AACtE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAU;AAC1B,MAAM,0BAA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AACA;;AAEA;AACA;AACA;AACA,SAAA,QAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,OAAA,KAAA,KAAA,QAAA,IAAA,KAAA,KAAA,IAAA;AACA;;AAEA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,OAAA,EAAA;AACA,EAAA,OAAA,QAAA,CAAA,OAAA,CAAA,IAAA,OAAA,OAAA,CAAA,KAAA,KAAA,QAAA;AACA;;AAEA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,OAAA,EAAA;AACA,EAAA;AACA,IAAA,QAAA,CAAA,OAAA,CAAA;AACA,IAAA,OAAA,OAAA,CAAA,aAAA,KAAA,QAAA;AACA,IAAA,QAAA,CAAA,OAAA,CAAA,UAAA,CAAA;AACA,IAAA,QAAA,CAAA,OAAA,CAAA,UAAA,CAAA,cAAA,CAAA;AACA,IAAA,OAAA,OAAA,CAAA,UAAA,CAAA,cAAA,CAAA,UAAA,KAAA,QAAA;AACA,IAAA,OAAA,OAAA,CAAA,UAAA,CAAA,cAAA,CAAA,OAAA,KAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,wBAAA,CAAA,OAAA,EAAA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,WAAA,GAAA,IAAA,CAAA,KAAA,CAAA,OAAA,CAAA;;AAEA;AACA,IAAA,IAAA,iBAAA,CAAA,WAAA,CAAA,IAAA,kBAAA,CAAA,WAAA,CAAA,EAAA;AACA,MAAA,OAAA,WAAA;AACA,IAAA;;AAEA;AACA,IAAA,OAAA,SAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA;AACA,IAAA,OAAA,SAAA;AACA,EAAA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAA,wBAAA,GAAA,iBAAA,CAAA,yBAAA;;;;"}
1
+ {"version":3,"file":"graphqlClient.js","sources":["../../../../../src/integrations/graphqlClient.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core/browser';\nimport {\n defineIntegration,\n isString,\n SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_URL_FULL,\n spanToJSON,\n stringMatchesSomePattern,\n} from '@sentry/core/browser';\nimport type { FetchHint, XhrHint } from '@sentry-internal/browser-utils';\nimport { getBodyString, getFetchRequestArgBody, SENTRY_XHR_DATA_KEY } from '@sentry-internal/browser-utils';\n\ninterface GraphQLClientOptions {\n endpoints: Array<string | RegExp>;\n}\n\n/** Standard graphql request shape: https://graphql.org/learn/serving-over-http/#post-request-and-body */\ninterface GraphQLStandardRequest {\n query: string;\n operationName?: string;\n variables?: Record<string, unknown>;\n extensions?: Record<string, unknown>;\n}\n\n/** Persisted operation request */\ninterface GraphQLPersistedRequest {\n operationName: string;\n variables?: Record<string, unknown>;\n extensions: {\n persistedQuery: {\n version: number;\n sha256Hash: string;\n };\n } & Record<string, unknown>;\n}\n\ntype GraphQLRequestPayload = GraphQLStandardRequest | GraphQLPersistedRequest;\n\ninterface GraphQLOperation {\n operationType?: string;\n operationName?: string;\n}\n\nconst INTEGRATION_NAME = 'GraphQLClient';\n\nconst _graphqlClientIntegration = ((options: GraphQLClientOptions) => {\n return {\n name: INTEGRATION_NAME,\n setup(client: Client) {\n _updateSpanWithGraphQLData(client, options);\n _updateBreadcrumbWithGraphQLData(client, options);\n },\n };\n}) satisfies IntegrationFn;\n\nfunction _updateSpanWithGraphQLData(client: Client, options: GraphQLClientOptions): void {\n client.on('beforeOutgoingRequestSpan', (span, hint) => {\n const spanJSON = spanToJSON(span);\n\n const spanAttributes = spanJSON.data || {};\n const spanOp = spanAttributes[SEMANTIC_ATTRIBUTE_SENTRY_OP];\n\n const isHttpClientSpan = spanOp === 'http.client';\n\n if (!isHttpClientSpan) {\n return;\n }\n\n // Fall back to `url` because fetch instrumentation only sets `http.url` for absolute URLs;\n // relative URLs end up only in `url` (see `getFetchSpanAttributes` in packages/core/src/fetch.ts).\n const httpUrl = spanAttributes[SEMANTIC_ATTRIBUTE_URL_FULL] || spanAttributes['http.url'] || spanAttributes['url'];\n const httpMethod = spanAttributes[SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD] || spanAttributes['http.method'];\n\n if (!isString(httpUrl) || !isString(httpMethod)) {\n return;\n }\n\n const { endpoints } = options;\n const isTracedGraphqlEndpoint = stringMatchesSomePattern(httpUrl, endpoints);\n const payload = getRequestPayloadXhrOrFetch(hint as XhrHint | FetchHint);\n\n if (isTracedGraphqlEndpoint && payload) {\n const graphqlBody = getGraphQLRequestPayload(payload);\n\n if (graphqlBody) {\n const operationInfo = _getGraphQLOperation(graphqlBody);\n span.updateName(`${httpMethod} ${httpUrl} (${operationInfo})`);\n\n // Handle standard requests - always capture the query document\n if (isStandardRequest(graphqlBody)) {\n span.setAttribute('graphql.document', graphqlBody.query);\n }\n\n // Handle persisted operations - capture hash for debugging\n if (isPersistedRequest(graphqlBody)) {\n span.setAttribute('graphql.persisted_query.hash.sha256', graphqlBody.extensions.persistedQuery.sha256Hash);\n span.setAttribute('graphql.persisted_query.version', graphqlBody.extensions.persistedQuery.version);\n }\n }\n }\n });\n}\n\nfunction _updateBreadcrumbWithGraphQLData(client: Client, options: GraphQLClientOptions): void {\n client.on('beforeOutgoingRequestBreadcrumb', (breadcrumb, handlerData) => {\n const { category, type, data } = breadcrumb;\n\n const isFetch = category === 'fetch';\n const isXhr = category === 'xhr';\n const isHttpBreadcrumb = type === 'http';\n\n if (isHttpBreadcrumb && (isFetch || isXhr)) {\n const httpUrl = data?.url;\n const { endpoints } = options;\n\n const isTracedGraphqlEndpoint = stringMatchesSomePattern(httpUrl, endpoints);\n const payload = getRequestPayloadXhrOrFetch(handlerData as XhrHint | FetchHint);\n\n if (isTracedGraphqlEndpoint && data && payload) {\n const graphqlBody = getGraphQLRequestPayload(payload);\n\n if (!data.graphql && graphqlBody) {\n const operationInfo = _getGraphQLOperation(graphqlBody);\n\n data['graphql.operation'] = operationInfo;\n\n if (isStandardRequest(graphqlBody)) {\n data['graphql.document'] = graphqlBody.query;\n }\n\n if (isPersistedRequest(graphqlBody)) {\n data['graphql.persisted_query.hash.sha256'] = graphqlBody.extensions.persistedQuery.sha256Hash;\n data['graphql.persisted_query.version'] = graphqlBody.extensions.persistedQuery.version;\n }\n }\n }\n }\n });\n}\n\n/**\n * @param requestBody - GraphQL request\n * @returns A formatted version of the request: 'TYPE NAME' or 'TYPE' or 'persisted NAME'\n */\nexport function _getGraphQLOperation(requestBody: GraphQLRequestPayload): string {\n // Handle persisted operations\n if (isPersistedRequest(requestBody)) {\n return `persisted ${requestBody.operationName}`;\n }\n\n // Handle standard GraphQL requests\n if (isStandardRequest(requestBody)) {\n const { query: graphqlQuery, operationName: graphqlOperationName } = requestBody;\n const { operationName = graphqlOperationName, operationType } = parseGraphQLQuery(graphqlQuery);\n const operationInfo = operationName ? `${operationType} ${operationName}` : `${operationType}`;\n return operationInfo;\n }\n\n // Fallback for unknown request types\n return 'unknown';\n}\n\n/**\n * Get the request body/payload based on the shape of the hint.\n *\n * Exported for tests only.\n */\nexport function getRequestPayloadXhrOrFetch(hint: XhrHint | FetchHint): string | undefined {\n const isXhr = 'xhr' in hint;\n\n let body: string | undefined;\n\n if (isXhr) {\n const sentryXhrData = hint.xhr[SENTRY_XHR_DATA_KEY];\n body = sentryXhrData && getBodyString(sentryXhrData.body)[0];\n } else {\n const sentryFetchData = getFetchRequestArgBody(hint.input);\n body = getBodyString(sentryFetchData)[0];\n }\n\n return body;\n}\n\n/**\n * Extract the name and type of the operation from the GraphQL query.\n *\n * Exported for tests only.\n */\nexport function parseGraphQLQuery(query: string): GraphQLOperation {\n const namedQueryRe = /^(?:\\s*)(query|mutation|subscription)(?:\\s*)(\\w+)(?:\\s*)[{(]/;\n const unnamedQueryRe = /^(?:\\s*)(query|mutation|subscription)(?:\\s*)[{(]/;\n\n const namedMatch = query.match(namedQueryRe);\n if (namedMatch) {\n return {\n operationType: namedMatch[1],\n operationName: namedMatch[2],\n };\n }\n\n const unnamedMatch = query.match(unnamedQueryRe);\n if (unnamedMatch) {\n return {\n operationType: unnamedMatch[1],\n operationName: undefined,\n };\n }\n return {\n operationType: undefined,\n operationName: undefined,\n };\n}\n\n/**\n * Helper to safely check if a value is a non-null object\n */\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * Type guard to check if a request is a standard GraphQL request\n */\nfunction isStandardRequest(payload: unknown): payload is GraphQLStandardRequest {\n return isObject(payload) && typeof payload.query === 'string';\n}\n\n/**\n * Type guard to check if a request is a persisted operation request\n */\nfunction isPersistedRequest(payload: unknown): payload is GraphQLPersistedRequest {\n return (\n isObject(payload) &&\n typeof payload.operationName === 'string' &&\n isObject(payload.extensions) &&\n isObject(payload.extensions.persistedQuery) &&\n typeof payload.extensions.persistedQuery.sha256Hash === 'string' &&\n typeof payload.extensions.persistedQuery.version === 'number'\n );\n}\n\n/**\n * Extract the payload of a request if it's GraphQL.\n * Exported for tests only.\n * @param payload - A valid JSON string\n * @returns A POJO or undefined\n */\nexport function getGraphQLRequestPayload(payload: string): GraphQLRequestPayload | undefined {\n try {\n const requestBody = JSON.parse(payload);\n\n // Return any valid GraphQL request (standard, persisted, or APQ retry with both)\n if (isStandardRequest(requestBody) || isPersistedRequest(requestBody)) {\n return requestBody;\n }\n\n // Not a GraphQL request\n return undefined;\n } catch {\n // Invalid JSON\n return undefined;\n }\n}\n\n/**\n * This integration ensures that GraphQL requests made in the browser\n * have their GraphQL-specific data captured and attached to spans and breadcrumbs.\n */\nexport const graphqlClientIntegration = defineIntegration(_graphqlClientIntegration);\n"],"names":[],"mappings":";;;AA4CA,MAAM,gBAAA,GAAmB,eAAe;;AAExC,MAAM,6BAA6B,CAAC,OAAO,KAA2B;AACtE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAU;AAC1B,MAAM,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAAC;A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AA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,OAAA,KAAA,KAAA,QAAA,IAAA,KAAA,KAAA,IAAA;AACA;;AAEA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,OAAA,EAAA;AACA,EAAA,OAAA,QAAA,CAAA,OAAA,CAAA,IAAA,OAAA,OAAA,CAAA,KAAA,KAAA,QAAA;AACA;;AAEA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,OAAA,EAAA;AACA,EAAA;AACA,IAAA,QAAA,CAAA,OAAA,CAAA;AACA,IAAA,OAAA,OAAA,CAAA,aAAA,KAAA,QAAA;AACA,IAAA,QAAA,CAAA,OAAA,CAAA,UAAA,CAAA;AACA,IAAA,QAAA,CAAA,OAAA,CAAA,UAAA,CAAA,cAAA,CAAA;AACA,IAAA,OAAA,OAAA,CAAA,UAAA,CAAA,cAAA,CAAA,UAAA,KAAA,QAAA;AACA,IAAA,OAAA,OAAA,CAAA,UAAA,CAAA,cAAA,CAAA,OAAA,KAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,wBAAA,CAAA,OAAA,EAAA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,WAAA,GAAA,IAAA,CAAA,KAAA,CAAA,OAAA,CAAA;;AAEA;AACA,IAAA,IAAA,iBAAA,CAAA,WAAA,CAAA,IAAA,kBAAA,CAAA,WAAA,CAAA,EAAA;AACA,MAAA,OAAA,WAAA;AACA,IAAA;;AAEA;AACA,IAAA,OAAA,SAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA;AACA,IAAA,OAAA,SAAA;AACA,EAAA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAA,wBAAA,GAAA,iBAAA,CAAA,yBAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineIntegration, supportsNativeFetch, addFetchInstrumentationHandler, getClient, GLOBAL_OBJ, debug, captureEvent, isSentryRequestUrl, addExceptionMechanism } from '@sentry/core';
1
+ import { defineIntegration, supportsNativeFetch, addFetchInstrumentationHandler, getClient, GLOBAL_OBJ, debug, captureEvent, isSentryRequestUrl, addExceptionMechanism } from '@sentry/core/browser';
2
2
  import { addXhrInstrumentationHandler, SENTRY_XHR_DATA_KEY } from '@sentry-internal/browser-utils';
3
3
  import { DEBUG_BUILD } from '../debug-build.js';
4
4