@sentry/browser 10.24.0 → 10.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. package/build/npm/cjs/dev/client.js.map +1 -0
  2. package/build/npm/cjs/dev/debug-build.js.map +1 -0
  3. package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -0
  4. package/build/npm/cjs/dev/eventbuilder.js.map +1 -0
  5. package/build/npm/cjs/dev/feedbackAsync.js.map +1 -0
  6. package/build/npm/cjs/dev/feedbackSync.js.map +1 -0
  7. package/build/npm/cjs/dev/helpers.js.map +1 -0
  8. package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -0
  9. package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -0
  10. package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -0
  11. package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -0
  12. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
  13. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  14. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
  15. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
  16. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
  17. package/build/npm/cjs/{integrations → dev/integrations}/globalhandlers.js +1 -1
  18. package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -0
  19. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -0
  20. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -0
  21. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -0
  22. package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -0
  23. package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -0
  24. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -0
  25. package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -0
  26. package/build/npm/cjs/dev/profiling/integration.js.map +1 -0
  27. package/build/npm/cjs/dev/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
  28. package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -0
  29. package/build/npm/cjs/dev/profiling/utils.js.map +1 -0
  30. package/build/npm/cjs/dev/report-dialog.js.map +1 -0
  31. package/build/npm/cjs/dev/sdk.js +133 -0
  32. package/build/npm/cjs/dev/sdk.js.map +1 -0
  33. package/build/npm/cjs/dev/stack-parsers.js.map +1 -0
  34. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -0
  35. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -0
  36. package/build/npm/cjs/{tracing → dev/tracing}/linkedTraces.js +1 -0
  37. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -0
  38. package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -0
  39. package/build/npm/cjs/dev/tracing/request.js.map +1 -0
  40. package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -0
  41. package/build/npm/cjs/dev/tracing/utils.js.map +1 -0
  42. package/build/npm/cjs/dev/transports/fetch.js.map +1 -0
  43. package/build/npm/cjs/dev/transports/offline.js.map +1 -0
  44. package/build/npm/cjs/dev/userfeedback.js.map +1 -0
  45. package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -0
  46. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -0
  47. package/build/npm/cjs/prod/client.js +125 -0
  48. package/build/npm/cjs/prod/client.js.map +1 -0
  49. package/build/npm/cjs/prod/debug-build.js +11 -0
  50. package/build/npm/cjs/prod/debug-build.js.map +1 -0
  51. package/build/npm/cjs/prod/diagnose-sdk.js +51 -0
  52. package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -0
  53. package/build/npm/cjs/prod/eventbuilder.js +397 -0
  54. package/build/npm/cjs/prod/eventbuilder.js.map +1 -0
  55. package/build/npm/cjs/prod/feedbackAsync.js +15 -0
  56. package/build/npm/cjs/prod/feedbackAsync.js.map +1 -0
  57. package/build/npm/cjs/prod/feedbackSync.js +12 -0
  58. package/build/npm/cjs/prod/feedbackSync.js.map +1 -0
  59. package/build/npm/cjs/prod/helpers.js +185 -0
  60. package/build/npm/cjs/prod/helpers.js.map +1 -0
  61. package/build/npm/cjs/prod/index.js +179 -0
  62. package/build/npm/cjs/prod/index.js.map +1 -0
  63. package/build/npm/cjs/prod/integrations/breadcrumbs.js +341 -0
  64. package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -0
  65. package/build/npm/cjs/prod/integrations/browserapierrors.js +259 -0
  66. package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -0
  67. package/build/npm/cjs/prod/integrations/browsersession.js +44 -0
  68. package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -0
  69. package/build/npm/cjs/prod/integrations/contextlines.js +89 -0
  70. package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -0
  71. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +29 -0
  72. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
  73. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +55 -0
  74. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  75. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +38 -0
  76. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
  77. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +48 -0
  78. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
  79. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +74 -0
  80. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
  81. package/build/npm/cjs/prod/integrations/globalhandlers.js +210 -0
  82. package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -0
  83. package/build/npm/cjs/prod/integrations/graphqlClient.js +180 -0
  84. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -0
  85. package/build/npm/cjs/prod/integrations/httpclient.js +395 -0
  86. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -0
  87. package/build/npm/cjs/prod/integrations/httpcontext.js +35 -0
  88. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -0
  89. package/build/npm/cjs/prod/integrations/linkederrors.js +39 -0
  90. package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -0
  91. package/build/npm/cjs/prod/integrations/reportingobserver.js +85 -0
  92. package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -0
  93. package/build/npm/cjs/prod/integrations/spotlight.js +85 -0
  94. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -0
  95. package/build/npm/cjs/prod/integrations/webWorker.js +251 -0
  96. package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -0
  97. package/build/npm/cjs/prod/profiling/integration.js +150 -0
  98. package/build/npm/cjs/prod/profiling/integration.js.map +1 -0
  99. package/build/npm/cjs/prod/profiling/lifecycleMode/traceLifecycleProfiler.js +343 -0
  100. package/build/npm/cjs/prod/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
  101. package/build/npm/cjs/prod/profiling/startProfileForSpan.js +144 -0
  102. package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -0
  103. package/build/npm/cjs/prod/profiling/utils.js +786 -0
  104. package/build/npm/cjs/prod/profiling/utils.js.map +1 -0
  105. package/build/npm/cjs/prod/report-dialog.js +68 -0
  106. package/build/npm/cjs/prod/report-dialog.js.map +1 -0
  107. package/build/npm/cjs/{sdk.js → prod/sdk.js} +5 -2
  108. package/build/npm/cjs/prod/sdk.js.map +1 -0
  109. package/build/npm/cjs/prod/stack-parsers.js +202 -0
  110. package/build/npm/cjs/prod/stack-parsers.js.map +1 -0
  111. package/build/npm/cjs/prod/tracing/backgroundtab.js +46 -0
  112. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -0
  113. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +577 -0
  114. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -0
  115. package/build/npm/cjs/prod/tracing/linkedTraces.js +227 -0
  116. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -0
  117. package/build/npm/cjs/prod/tracing/reportPageLoaded.js +18 -0
  118. package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -0
  119. package/build/npm/cjs/prod/tracing/request.js +342 -0
  120. package/build/npm/cjs/prod/tracing/request.js.map +1 -0
  121. package/build/npm/cjs/prod/tracing/setActiveSpan.js +68 -0
  122. package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -0
  123. package/build/npm/cjs/prod/tracing/utils.js +54 -0
  124. package/build/npm/cjs/prod/tracing/utils.js.map +1 -0
  125. package/build/npm/cjs/prod/transports/fetch.js +71 -0
  126. package/build/npm/cjs/prod/transports/fetch.js.map +1 -0
  127. package/build/npm/cjs/prod/transports/offline.js +168 -0
  128. package/build/npm/cjs/prod/transports/offline.js.map +1 -0
  129. package/build/npm/cjs/prod/userfeedback.js +42 -0
  130. package/build/npm/cjs/prod/userfeedback.js.map +1 -0
  131. package/build/npm/cjs/prod/utils/detectBrowserExtension.js +59 -0
  132. package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -0
  133. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +106 -0
  134. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -0
  135. package/build/npm/esm/dev/client.js.map +1 -0
  136. package/build/npm/esm/dev/debug-build.js.map +1 -0
  137. package/build/npm/esm/dev/diagnose-sdk.js.map +1 -0
  138. package/build/npm/esm/dev/eventbuilder.js.map +1 -0
  139. package/build/npm/esm/dev/feedbackAsync.js.map +1 -0
  140. package/build/npm/esm/dev/feedbackSync.js.map +1 -0
  141. package/build/npm/esm/dev/helpers.js.map +1 -0
  142. package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -0
  143. package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -0
  144. package/build/npm/esm/dev/integrations/browsersession.js.map +1 -0
  145. package/build/npm/esm/dev/integrations/contextlines.js.map +1 -0
  146. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
  147. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  148. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
  149. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
  150. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
  151. package/build/npm/esm/{integrations → dev/integrations}/globalhandlers.js +1 -1
  152. package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -0
  153. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -0
  154. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -0
  155. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -0
  156. package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -0
  157. package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -0
  158. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -0
  159. package/build/npm/esm/dev/integrations/webWorker.js.map +1 -0
  160. package/build/npm/esm/dev/package.json +1 -0
  161. package/build/npm/esm/dev/profiling/integration.js.map +1 -0
  162. package/build/npm/esm/dev/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
  163. package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -0
  164. package/build/npm/esm/dev/profiling/utils.js.map +1 -0
  165. package/build/npm/esm/dev/report-dialog.js.map +1 -0
  166. package/build/npm/esm/dev/sdk.js +128 -0
  167. package/build/npm/esm/dev/sdk.js.map +1 -0
  168. package/build/npm/esm/dev/stack-parsers.js.map +1 -0
  169. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -0
  170. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -0
  171. package/build/npm/esm/{tracing → dev/tracing}/linkedTraces.js +1 -0
  172. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -0
  173. package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -0
  174. package/build/npm/esm/dev/tracing/request.js.map +1 -0
  175. package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -0
  176. package/build/npm/esm/dev/tracing/utils.js.map +1 -0
  177. package/build/npm/esm/dev/transports/fetch.js.map +1 -0
  178. package/build/npm/esm/dev/transports/offline.js.map +1 -0
  179. package/build/npm/esm/dev/userfeedback.js.map +1 -0
  180. package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -0
  181. package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -0
  182. package/build/npm/esm/prod/client.js +122 -0
  183. package/build/npm/esm/prod/client.js.map +1 -0
  184. package/build/npm/esm/prod/debug-build.js +9 -0
  185. package/build/npm/esm/prod/debug-build.js.map +1 -0
  186. package/build/npm/esm/prod/diagnose-sdk.js +49 -0
  187. package/build/npm/esm/prod/diagnose-sdk.js.map +1 -0
  188. package/build/npm/esm/prod/eventbuilder.js +390 -0
  189. package/build/npm/esm/prod/eventbuilder.js.map +1 -0
  190. package/build/npm/esm/prod/feedbackAsync.js +13 -0
  191. package/build/npm/esm/prod/feedbackAsync.js.map +1 -0
  192. package/build/npm/esm/prod/feedbackSync.js +10 -0
  193. package/build/npm/esm/prod/feedbackSync.js.map +1 -0
  194. package/build/npm/esm/prod/helpers.js +179 -0
  195. package/build/npm/esm/prod/helpers.js.map +1 -0
  196. package/build/npm/esm/prod/index.js +40 -0
  197. package/build/npm/esm/prod/index.js.map +1 -0
  198. package/build/npm/esm/prod/integrations/breadcrumbs.js +339 -0
  199. package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -0
  200. package/build/npm/esm/prod/integrations/browserapierrors.js +257 -0
  201. package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -0
  202. package/build/npm/esm/prod/integrations/browsersession.js +42 -0
  203. package/build/npm/esm/prod/integrations/browsersession.js.map +1 -0
  204. package/build/npm/esm/prod/integrations/contextlines.js +86 -0
  205. package/build/npm/esm/prod/integrations/contextlines.js.map +1 -0
  206. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +27 -0
  207. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
  208. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +52 -0
  209. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  210. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +35 -0
  211. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
  212. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +46 -0
  213. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
  214. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +72 -0
  215. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
  216. package/build/npm/esm/prod/integrations/globalhandlers.js +206 -0
  217. package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -0
  218. package/build/npm/esm/prod/integrations/graphqlClient.js +175 -0
  219. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -0
  220. package/build/npm/esm/prod/integrations/httpclient.js +393 -0
  221. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -0
  222. package/build/npm/esm/prod/integrations/httpcontext.js +33 -0
  223. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -0
  224. package/build/npm/esm/prod/integrations/linkederrors.js +37 -0
  225. package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -0
  226. package/build/npm/esm/prod/integrations/reportingobserver.js +83 -0
  227. package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -0
  228. package/build/npm/esm/prod/integrations/spotlight.js +81 -0
  229. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -0
  230. package/build/npm/esm/prod/integrations/webWorker.js +247 -0
  231. package/build/npm/esm/prod/integrations/webWorker.js.map +1 -0
  232. package/build/npm/esm/prod/package.json +1 -0
  233. package/build/npm/esm/prod/profiling/integration.js +148 -0
  234. package/build/npm/esm/prod/profiling/integration.js.map +1 -0
  235. package/build/npm/esm/prod/profiling/lifecycleMode/traceLifecycleProfiler.js +341 -0
  236. package/build/npm/esm/prod/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
  237. package/build/npm/esm/prod/profiling/startProfileForSpan.js +142 -0
  238. package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -0
  239. package/build/npm/esm/prod/profiling/utils.js +763 -0
  240. package/build/npm/esm/prod/profiling/utils.js.map +1 -0
  241. package/build/npm/esm/prod/report-dialog.js +66 -0
  242. package/build/npm/esm/prod/report-dialog.js.map +1 -0
  243. package/build/npm/esm/{sdk.js → prod/sdk.js} +5 -2
  244. package/build/npm/esm/prod/sdk.js.map +1 -0
  245. package/build/npm/esm/prod/stack-parsers.js +194 -0
  246. package/build/npm/esm/prod/stack-parsers.js.map +1 -0
  247. package/build/npm/esm/prod/tracing/backgroundtab.js +44 -0
  248. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -0
  249. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +571 -0
  250. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -0
  251. package/build/npm/esm/prod/tracing/linkedTraces.js +218 -0
  252. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -0
  253. package/build/npm/esm/prod/tracing/reportPageLoaded.js +16 -0
  254. package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -0
  255. package/build/npm/esm/prod/tracing/request.js +338 -0
  256. package/build/npm/esm/prod/tracing/request.js.map +1 -0
  257. package/build/npm/esm/prod/tracing/setActiveSpan.js +66 -0
  258. package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -0
  259. package/build/npm/esm/prod/tracing/utils.js +49 -0
  260. package/build/npm/esm/prod/tracing/utils.js.map +1 -0
  261. package/build/npm/esm/prod/transports/fetch.js +69 -0
  262. package/build/npm/esm/prod/transports/fetch.js.map +1 -0
  263. package/build/npm/esm/prod/transports/offline.js +162 -0
  264. package/build/npm/esm/prod/transports/offline.js.map +1 -0
  265. package/build/npm/esm/prod/userfeedback.js +40 -0
  266. package/build/npm/esm/prod/userfeedback.js.map +1 -0
  267. package/build/npm/esm/prod/utils/detectBrowserExtension.js +57 -0
  268. package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -0
  269. package/build/npm/esm/prod/utils/lazyLoadIntegration.js +104 -0
  270. package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -0
  271. package/build/npm/types/client.d.ts +11 -0
  272. package/build/npm/types/client.d.ts.map +1 -1
  273. package/build/npm/types/sdk.d.ts.map +1 -1
  274. package/build/npm/types-ts3.8/client.d.ts +11 -0
  275. package/package.json +21 -16
  276. package/build/npm/cjs/client.js.map +0 -1
  277. package/build/npm/cjs/debug-build.js.map +0 -1
  278. package/build/npm/cjs/diagnose-sdk.js.map +0 -1
  279. package/build/npm/cjs/eventbuilder.js.map +0 -1
  280. package/build/npm/cjs/feedbackAsync.js.map +0 -1
  281. package/build/npm/cjs/feedbackSync.js.map +0 -1
  282. package/build/npm/cjs/helpers.js.map +0 -1
  283. package/build/npm/cjs/integrations/breadcrumbs.js.map +0 -1
  284. package/build/npm/cjs/integrations/browserapierrors.js.map +0 -1
  285. package/build/npm/cjs/integrations/browsersession.js.map +0 -1
  286. package/build/npm/cjs/integrations/contextlines.js.map +0 -1
  287. package/build/npm/cjs/integrations/featureFlags/growthbook/integration.js.map +0 -1
  288. package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
  289. package/build/npm/cjs/integrations/featureFlags/openfeature/integration.js.map +0 -1
  290. package/build/npm/cjs/integrations/featureFlags/statsig/integration.js.map +0 -1
  291. package/build/npm/cjs/integrations/featureFlags/unleash/integration.js.map +0 -1
  292. package/build/npm/cjs/integrations/globalhandlers.js.map +0 -1
  293. package/build/npm/cjs/integrations/graphqlClient.js.map +0 -1
  294. package/build/npm/cjs/integrations/httpclient.js.map +0 -1
  295. package/build/npm/cjs/integrations/httpcontext.js.map +0 -1
  296. package/build/npm/cjs/integrations/linkederrors.js.map +0 -1
  297. package/build/npm/cjs/integrations/reportingobserver.js.map +0 -1
  298. package/build/npm/cjs/integrations/spotlight.js.map +0 -1
  299. package/build/npm/cjs/integrations/webWorker.js.map +0 -1
  300. package/build/npm/cjs/profiling/integration.js.map +0 -1
  301. package/build/npm/cjs/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
  302. package/build/npm/cjs/profiling/startProfileForSpan.js.map +0 -1
  303. package/build/npm/cjs/profiling/utils.js.map +0 -1
  304. package/build/npm/cjs/report-dialog.js.map +0 -1
  305. package/build/npm/cjs/sdk.js.map +0 -1
  306. package/build/npm/cjs/stack-parsers.js.map +0 -1
  307. package/build/npm/cjs/tracing/backgroundtab.js.map +0 -1
  308. package/build/npm/cjs/tracing/browserTracingIntegration.js.map +0 -1
  309. package/build/npm/cjs/tracing/linkedTraces.js.map +0 -1
  310. package/build/npm/cjs/tracing/reportPageLoaded.js.map +0 -1
  311. package/build/npm/cjs/tracing/request.js.map +0 -1
  312. package/build/npm/cjs/tracing/setActiveSpan.js.map +0 -1
  313. package/build/npm/cjs/tracing/utils.js.map +0 -1
  314. package/build/npm/cjs/transports/fetch.js.map +0 -1
  315. package/build/npm/cjs/transports/offline.js.map +0 -1
  316. package/build/npm/cjs/userfeedback.js.map +0 -1
  317. package/build/npm/cjs/utils/detectBrowserExtension.js.map +0 -1
  318. package/build/npm/cjs/utils/lazyLoadIntegration.js.map +0 -1
  319. package/build/npm/esm/client.js.map +0 -1
  320. package/build/npm/esm/debug-build.js.map +0 -1
  321. package/build/npm/esm/diagnose-sdk.js.map +0 -1
  322. package/build/npm/esm/eventbuilder.js.map +0 -1
  323. package/build/npm/esm/feedbackAsync.js.map +0 -1
  324. package/build/npm/esm/feedbackSync.js.map +0 -1
  325. package/build/npm/esm/helpers.js.map +0 -1
  326. package/build/npm/esm/integrations/breadcrumbs.js.map +0 -1
  327. package/build/npm/esm/integrations/browserapierrors.js.map +0 -1
  328. package/build/npm/esm/integrations/browsersession.js.map +0 -1
  329. package/build/npm/esm/integrations/contextlines.js.map +0 -1
  330. package/build/npm/esm/integrations/featureFlags/growthbook/integration.js.map +0 -1
  331. package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
  332. package/build/npm/esm/integrations/featureFlags/openfeature/integration.js.map +0 -1
  333. package/build/npm/esm/integrations/featureFlags/statsig/integration.js.map +0 -1
  334. package/build/npm/esm/integrations/featureFlags/unleash/integration.js.map +0 -1
  335. package/build/npm/esm/integrations/globalhandlers.js.map +0 -1
  336. package/build/npm/esm/integrations/graphqlClient.js.map +0 -1
  337. package/build/npm/esm/integrations/httpclient.js.map +0 -1
  338. package/build/npm/esm/integrations/httpcontext.js.map +0 -1
  339. package/build/npm/esm/integrations/linkederrors.js.map +0 -1
  340. package/build/npm/esm/integrations/reportingobserver.js.map +0 -1
  341. package/build/npm/esm/integrations/spotlight.js.map +0 -1
  342. package/build/npm/esm/integrations/webWorker.js.map +0 -1
  343. package/build/npm/esm/package.json +0 -1
  344. package/build/npm/esm/profiling/integration.js.map +0 -1
  345. package/build/npm/esm/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
  346. package/build/npm/esm/profiling/startProfileForSpan.js.map +0 -1
  347. package/build/npm/esm/profiling/utils.js.map +0 -1
  348. package/build/npm/esm/report-dialog.js.map +0 -1
  349. package/build/npm/esm/sdk.js.map +0 -1
  350. package/build/npm/esm/stack-parsers.js.map +0 -1
  351. package/build/npm/esm/tracing/backgroundtab.js.map +0 -1
  352. package/build/npm/esm/tracing/browserTracingIntegration.js.map +0 -1
  353. package/build/npm/esm/tracing/linkedTraces.js.map +0 -1
  354. package/build/npm/esm/tracing/reportPageLoaded.js.map +0 -1
  355. package/build/npm/esm/tracing/request.js.map +0 -1
  356. package/build/npm/esm/tracing/setActiveSpan.js.map +0 -1
  357. package/build/npm/esm/tracing/utils.js.map +0 -1
  358. package/build/npm/esm/transports/fetch.js.map +0 -1
  359. package/build/npm/esm/transports/offline.js.map +0 -1
  360. package/build/npm/esm/userfeedback.js.map +0 -1
  361. package/build/npm/esm/utils/detectBrowserExtension.js.map +0 -1
  362. package/build/npm/esm/utils/lazyLoadIntegration.js.map +0 -1
  363. /package/build/npm/cjs/{client.js → dev/client.js} +0 -0
  364. /package/build/npm/cjs/{debug-build.js → dev/debug-build.js} +0 -0
  365. /package/build/npm/cjs/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
  366. /package/build/npm/cjs/{eventbuilder.js → dev/eventbuilder.js} +0 -0
  367. /package/build/npm/cjs/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
  368. /package/build/npm/cjs/{feedbackSync.js → dev/feedbackSync.js} +0 -0
  369. /package/build/npm/cjs/{helpers.js → dev/helpers.js} +0 -0
  370. /package/build/npm/cjs/{index.js → dev/index.js} +0 -0
  371. /package/build/npm/cjs/{index.js.map → dev/index.js.map} +0 -0
  372. /package/build/npm/cjs/{integrations → dev/integrations}/breadcrumbs.js +0 -0
  373. /package/build/npm/cjs/{integrations → dev/integrations}/browserapierrors.js +0 -0
  374. /package/build/npm/cjs/{integrations → dev/integrations}/browsersession.js +0 -0
  375. /package/build/npm/cjs/{integrations → dev/integrations}/contextlines.js +0 -0
  376. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
  377. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
  378. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
  379. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
  380. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
  381. /package/build/npm/cjs/{integrations → dev/integrations}/graphqlClient.js +0 -0
  382. /package/build/npm/cjs/{integrations → dev/integrations}/httpclient.js +0 -0
  383. /package/build/npm/cjs/{integrations → dev/integrations}/httpcontext.js +0 -0
  384. /package/build/npm/cjs/{integrations → dev/integrations}/linkederrors.js +0 -0
  385. /package/build/npm/cjs/{integrations → dev/integrations}/reportingobserver.js +0 -0
  386. /package/build/npm/cjs/{integrations → dev/integrations}/spotlight.js +0 -0
  387. /package/build/npm/cjs/{integrations → dev/integrations}/webWorker.js +0 -0
  388. /package/build/npm/cjs/{profiling → dev/profiling}/integration.js +0 -0
  389. /package/build/npm/cjs/{profiling → dev/profiling}/lifecycleMode/traceLifecycleProfiler.js +0 -0
  390. /package/build/npm/cjs/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
  391. /package/build/npm/cjs/{profiling → dev/profiling}/utils.js +0 -0
  392. /package/build/npm/cjs/{report-dialog.js → dev/report-dialog.js} +0 -0
  393. /package/build/npm/cjs/{stack-parsers.js → dev/stack-parsers.js} +0 -0
  394. /package/build/npm/cjs/{tracing → dev/tracing}/backgroundtab.js +0 -0
  395. /package/build/npm/cjs/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
  396. /package/build/npm/cjs/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
  397. /package/build/npm/cjs/{tracing → dev/tracing}/request.js +0 -0
  398. /package/build/npm/cjs/{tracing → dev/tracing}/setActiveSpan.js +0 -0
  399. /package/build/npm/cjs/{tracing → dev/tracing}/utils.js +0 -0
  400. /package/build/npm/cjs/{transports → dev/transports}/fetch.js +0 -0
  401. /package/build/npm/cjs/{transports → dev/transports}/offline.js +0 -0
  402. /package/build/npm/cjs/{userfeedback.js → dev/userfeedback.js} +0 -0
  403. /package/build/npm/cjs/{utils → dev/utils}/detectBrowserExtension.js +0 -0
  404. /package/build/npm/cjs/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
  405. /package/build/npm/esm/{client.js → dev/client.js} +0 -0
  406. /package/build/npm/esm/{debug-build.js → dev/debug-build.js} +0 -0
  407. /package/build/npm/esm/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
  408. /package/build/npm/esm/{eventbuilder.js → dev/eventbuilder.js} +0 -0
  409. /package/build/npm/esm/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
  410. /package/build/npm/esm/{feedbackSync.js → dev/feedbackSync.js} +0 -0
  411. /package/build/npm/esm/{helpers.js → dev/helpers.js} +0 -0
  412. /package/build/npm/esm/{index.js → dev/index.js} +0 -0
  413. /package/build/npm/esm/{index.js.map → dev/index.js.map} +0 -0
  414. /package/build/npm/esm/{integrations → dev/integrations}/breadcrumbs.js +0 -0
  415. /package/build/npm/esm/{integrations → dev/integrations}/browserapierrors.js +0 -0
  416. /package/build/npm/esm/{integrations → dev/integrations}/browsersession.js +0 -0
  417. /package/build/npm/esm/{integrations → dev/integrations}/contextlines.js +0 -0
  418. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
  419. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
  420. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
  421. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
  422. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
  423. /package/build/npm/esm/{integrations → dev/integrations}/graphqlClient.js +0 -0
  424. /package/build/npm/esm/{integrations → dev/integrations}/httpclient.js +0 -0
  425. /package/build/npm/esm/{integrations → dev/integrations}/httpcontext.js +0 -0
  426. /package/build/npm/esm/{integrations → dev/integrations}/linkederrors.js +0 -0
  427. /package/build/npm/esm/{integrations → dev/integrations}/reportingobserver.js +0 -0
  428. /package/build/npm/esm/{integrations → dev/integrations}/spotlight.js +0 -0
  429. /package/build/npm/esm/{integrations → dev/integrations}/webWorker.js +0 -0
  430. /package/build/npm/esm/{profiling → dev/profiling}/integration.js +0 -0
  431. /package/build/npm/esm/{profiling → dev/profiling}/lifecycleMode/traceLifecycleProfiler.js +0 -0
  432. /package/build/npm/esm/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
  433. /package/build/npm/esm/{profiling → dev/profiling}/utils.js +0 -0
  434. /package/build/npm/esm/{report-dialog.js → dev/report-dialog.js} +0 -0
  435. /package/build/npm/esm/{stack-parsers.js → dev/stack-parsers.js} +0 -0
  436. /package/build/npm/esm/{tracing → dev/tracing}/backgroundtab.js +0 -0
  437. /package/build/npm/esm/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
  438. /package/build/npm/esm/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
  439. /package/build/npm/esm/{tracing → dev/tracing}/request.js +0 -0
  440. /package/build/npm/esm/{tracing → dev/tracing}/setActiveSpan.js +0 -0
  441. /package/build/npm/esm/{tracing → dev/tracing}/utils.js +0 -0
  442. /package/build/npm/esm/{transports → dev/transports}/fetch.js +0 -0
  443. /package/build/npm/esm/{transports → dev/transports}/offline.js +0 -0
  444. /package/build/npm/esm/{userfeedback.js → dev/userfeedback.js} +0 -0
  445. /package/build/npm/esm/{utils → dev/utils}/detectBrowserExtension.js +0 -0
  446. /package/build/npm/esm/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offline.js","sources":["../../../../../src/transports/offline.ts"],"sourcesContent":["import type { BaseTransportOptions, Envelope, OfflineStore, OfflineTransportOptions, Transport } from '@sentry/core';\nimport { makeOfflineTransport, parseEnvelope, serializeEnvelope } from '@sentry/core';\nimport { WINDOW } from '../helpers';\nimport { makeFetchTransport } from './fetch';\n\n// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being\n// modified and simplified: https://github.com/jakearchibald/idb-keyval\n//\n// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca\n// Original license:\n\n// Copyright 2016, Jake Archibald\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;\n\nfunction promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n // @ts-expect-error - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-expect-error - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\n\n/** Create or open an IndexedDb store */\nexport function createStore(dbName: string, storeName: string): Store {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n\n return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));\n}\n\nfunction keys(store: IDBObjectStore): Promise<number[]> {\n return promisifyRequest(store.getAllKeys() as IDBRequest<number[]>);\n}\n\n/** Insert into the end of the store */\nexport function push(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an incremented key so that the entries are popped in order\n store.put(value, Math.max(...keys, 0) + 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Insert into the front of the store */\nexport function unshift(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an decremented key so that the entries are popped in order\n store.put(value, Math.min(...keys, 0) - 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Pop the oldest value from the store */\nexport function shift(store: Store): Promise<Uint8Array | string | undefined> {\n return store(store => {\n return keys(store).then(keys => {\n const firstKey = keys[0];\n if (firstKey == null) {\n return undefined;\n }\n\n return promisifyRequest(store.get(firstKey)).then(value => {\n store.delete(firstKey);\n return promisifyRequest(store.transaction).then(() => value);\n });\n });\n });\n}\n\nexport interface BrowserOfflineTransportOptions extends Omit<OfflineTransportOptions, 'createStore'> {\n /**\n * Name of indexedDb database to store envelopes in\n * Default: 'sentry-offline'\n */\n dbName?: string;\n /**\n * Name of indexedDb object store to store envelopes in\n * Default: 'queue'\n */\n storeName?: string;\n /**\n * Maximum number of envelopes to store\n * Default: 30\n */\n maxQueueSize?: number;\n}\n\nfunction createIndexedDbStore(options: BrowserOfflineTransportOptions): OfflineStore {\n let store: Store | undefined;\n\n // Lazily create the store only when it's needed\n function getStore(): Store {\n if (store == undefined) {\n store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');\n }\n\n return store;\n }\n\n return {\n push: async (env: Envelope) => {\n try {\n const serialized = await serializeEnvelope(env);\n await push(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n unshift: async (env: Envelope) => {\n try {\n const serialized = await serializeEnvelope(env);\n await unshift(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n shift: async () => {\n try {\n const deserialized = await shift(getStore());\n if (deserialized) {\n return parseEnvelope(deserialized);\n }\n } catch {\n //\n }\n\n return undefined;\n },\n };\n}\n\nfunction makeIndexedDbOfflineTransport<T>(\n createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return options => {\n const transport = createTransport({ ...options, createStore: createIndexedDbStore });\n\n WINDOW.addEventListener('online', async _ => {\n await transport.flush();\n });\n\n return transport;\n };\n}\n\n/**\n * Creates a transport that uses IndexedDb to store events when offline.\n */\nexport function makeBrowserOfflineTransport<T extends BaseTransportOptions>(\n createTransport: (options: T) => Transport = makeFetchTransport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return makeIndexedDbOfflineTransport<T>(makeOfflineTransport(createTransport));\n}\n"],"names":["serializeEnvelope","parseEnvelope","WINDOW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,kBAAa,CAAC,YAAY,CAAC;AAC5C,QAAQ;AACR,MAAM,EAAE,MAAM;AACd;AACA,MAAM;;AAEN,MAAM,OAAO,SAAS;AACtB,IAAI,CAAC;AACL,GAAG;AACH;;AAEA,SAAS,6BAA6B;AACtC,EAAE,eAAe;AACjB,EAA8D;AAC9D,EAAE,OAAO,WAAW;AACpB,IAAI,MAAM,SAAA,GAAY,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,WAAW,EAAE,oBAAA,EAAsB,CAAC;;AAExF,IAAIC,cAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,KAAK;AACjD,MAAM,MAAM,SAAS,CAAC,KAAK,EAAE;AAC7B,IAAI,CAAC,CAAC;;AAEN,IAAI,OAAO,SAAS;AACpB,EAAE,CAAC;AACH;;AAEA;AACA;AACA;AACO,SAAS,2BAA2B;AAC3C,EAAE,eAAe,GAA8BC,wBAAkB;AACjE,EAA8D;AAC9D,EAAE,OAAO,6BAA6B,CAAIC,yBAAoB,CAAC,eAAe,CAAC,CAAC;AAChF;;;;;;;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userfeedback.js","sources":["../../../../src/userfeedback.ts"],"sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/core';\nimport { createEnvelope, dsnToString } from '@sentry/core';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata?.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"],"names":["dsnToString","createEnvelope"],"mappings":";;;;AAGA;AACA;AACA;AACO,SAAS,0BAA0B;AAC1C,EAAE,QAAQ;AACV,EAAE;AACF,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,IAAI,GAAG;AACP;;AAIE;AACF,EAAiB;AACjB,EAAE,MAAM,OAAO,GAAqB;AACpC,IAAI,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AAC/B,IAAI,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACrC,IAAI,IAAI,QAAQ,EAAE,OAAO;AACzB,MAAM,GAAG,EAAE;AACX,QAAQ,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;AAC/B,QAAQ,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;AACrC,OAAO;AACP,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,CAAC,MAAA,IAAU,CAAC,CAAC,GAAA,IAAO,EAAE,GAAG,EAAEA,gBAAW,CAAC,GAAG,CAAA,EAAG,CAAC;AACvD,GAAG;AACH,EAAE,MAAM,IAAA,GAAO,8BAA8B,CAAC,QAAQ,CAAC;;AAEvD,EAAE,OAAOC,mBAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;AACxC;;AAEA,SAAS,8BAA8B,CAAC,QAAQ,EAAkC;AAClF,EAAE,MAAM,eAAe,GAAwB;AAC/C,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG;AACH,EAAE,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC;AACpC;;;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detectBrowserExtension.js","sources":["../../../../../src/utils/detectBrowserExtension.ts"],"sourcesContent":["import { consoleSandbox, getLocationHref } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ntype ExtensionRuntime = {\n runtime?: {\n id?: string;\n };\n};\ntype ExtensionProperties = {\n chrome?: ExtensionRuntime;\n browser?: ExtensionRuntime;\n nw?: unknown;\n};\n\n/**\n * Returns true if the SDK is running in an embedded browser extension.\n * Stand-alone browser extensions (which do not share the same data as the main browser page) are fine.\n */\nexport function checkAndWarnIfIsEmbeddedBrowserExtension(): boolean {\n if (_isEmbeddedBrowserExtension()) {\n if (DEBUG_BUILD) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(\n '[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',\n );\n });\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction _isEmbeddedBrowserExtension(): boolean {\n if (typeof WINDOW.window === 'undefined') {\n // No need to show the error if we're not in a browser window environment (e.g. service workers)\n return false;\n }\n\n const _window = WINDOW as typeof WINDOW & ExtensionProperties;\n\n // Running the SDK in NW.js, which appears like a browser extension but isn't, is also fine\n // see: https://github.com/getsentry/sentry-javascript/issues/12668\n if (_window.nw) {\n return false;\n }\n\n const extensionObject = _window['chrome'] || _window['browser'];\n\n if (!extensionObject?.runtime?.id) {\n return false;\n }\n\n const href = getLocationHref();\n const extensionProtocols = ['chrome-extension', 'moz-extension', 'ms-browser-extension', 'safari-web-extension'];\n\n // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage\n const isDedicatedExtensionPage =\n WINDOW === WINDOW.top && extensionProtocols.some(protocol => href.startsWith(`${protocol}://`));\n\n return !isDedicatedExtensionPage;\n}\n"],"names":["DEBUG_BUILD","consoleSandbox","WINDOW","getLocationHref"],"mappings":";;;;;;AAeA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAY;AACpE,EAAE,IAAI,2BAA2B,EAAE,EAAE;AACrC,IAAI,IAAIA,sBAAW,EAAE;AACrB,MAAMC,mBAAc,CAAC,MAAM;AAC3B;AACA,QAAQ,OAAO,CAAC,KAAK;AACrB,UAAU,mJAAmJ;AAC7J,SAAS;AACT,MAAM,CAAC,CAAC;AACR,IAAI;;AAEJ,IAAI,OAAO,IAAI;AACf,EAAE;;AAEF,EAAE,OAAO,KAAK;AACd;;AAEA,SAAS,2BAA2B,GAAY;AAChD,EAAE,IAAI,OAAOC,cAAM,CAAC,MAAA,KAAW,WAAW,EAAE;AAC5C;AACA,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,OAAA,GAAUA,cAAA;;AAElB;AACA;AACA,EAAE,IAAI,OAAO,CAAC,EAAE,EAAE;AAClB,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,eAAA,GAAkB,OAAO,CAAC,QAAQ,CAAA,IAAK,OAAO,CAAC,SAAS,CAAC;;AAEjE,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,IAAA,GAAOC,oBAAe,EAAE;AAChC,EAAE,MAAM,kBAAA,GAAqB,CAAC,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,CAAC;;AAElH;AACA,EAAE,MAAM,wBAAA;AACR,IAAID,mBAAWA,cAAM,CAAC,GAAA,IAAO,kBAAkB,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,UAAU,CAAC,CAAC,EAAA,QAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;AAEA,EAAA,OAAA,CAAA,wBAAA;AACA;;;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { getClient, SDK_VERSION } from '@sentry/core';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// This is a map of integration function method to bundle file name.\nconst LazyLoadableIntegrations = {\n replayIntegration: 'replay',\n replayCanvasIntegration: 'replay-canvas',\n feedbackIntegration: 'feedback',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n captureConsoleIntegration: 'captureconsole',\n contextLinesIntegration: 'contextlines',\n linkedErrorsIntegration: 'linkederrors',\n dedupeIntegration: 'dedupe',\n extraErrorDataIntegration: 'extraerrordata',\n graphqlClientIntegration: 'graphqlclient',\n httpClientIntegration: 'httpclient',\n reportingObserverIntegration: 'reportingobserver',\n rewriteFramesIntegration: 'rewriteframes',\n browserProfilingIntegration: 'browserprofiling',\n moduleMetadataIntegration: 'modulemetadata',\n instrumentAnthropicAiClient: 'instrumentanthropicaiclient',\n instrumentOpenAiClient: 'instrumentopenaiclient',\n instrumentGoogleGenAIClient: 'instrumentgooglegenaiclient',\n} as const;\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<keyof typeof LazyLoadableIntegrations, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: keyof typeof LazyLoadableIntegrations,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LazyLoadableIntegrations[name];\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n}\n"],"names":["WINDOW","getClient","SDK_VERSION"],"mappings":";;;;;AAKA;AACA,MAAM,2BAA2B;AACjC,EAAE,iBAAiB,EAAE,QAAQ;AAC7B,EAAE,uBAAuB,EAAE,eAAe;AAC1C,EAAE,mBAAmB,EAAE,UAAU;AACjC,EAAE,wBAAwB,EAAE,gBAAgB;AAC5C,EAAE,6BAA6B,EAAE,qBAAqB;AACtD,EAAE,yBAAyB,EAAE,gBAAgB;AAC7C,EAAE,uBAAuB,EAAE,cAAc;AACzC,EAAE,uBAAuB,EAAE,cAAc;AACzC,EAAE,iBAAiB,EAAE,QAAQ;AAC7B,EAAE,yBAAyB,EAAE,gBAAgB;AAC7C,EAAE,wBAAwB,EAAE,eAAe;AAC3C,EAAE,qBAAqB,EAAE,YAAY;AACrC,EAAE,4BAA4B,EAAE,mBAAmB;AACnD,EAAE,wBAAwB,EAAE,eAAe;AAC3C,EAAE,2BAA2B,EAAE,kBAAkB;AACjD,EAAE,yBAAyB,EAAE,gBAAgB;AAC7C,EAAE,2BAA2B,EAAE,6BAA6B;AAC5D,EAAE,sBAAsB,EA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AA;AACA,EAAA,CAAA,CAAA;;AAEA,EAAA,MAAA,aAAA,GAAAA,cAAA,CAAA,QAAA,CAAA,aAAA;AACA,EAAA,MAAA,MAAA,GAAAA,cAAA,CAAA,QAAA,CAAA,IAAA,IAAAA,cAAA,CAAA,QAAA,CAAA,IAAA,IAAA,aAAA,EAAA,aAAA;;AAEA,EAAA,IAAA,MAAA,EAAA;AACA,IAAA,MAAA,CAAA,WAAA,CAAA,MAAA,CAAA;AACA,EAAA,CAAA,MAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,oDAAA,EAAA,IAAA,CAAA,OAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,IAAA;AACA,IAAA,MAAA,WAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,gCAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,MAAA,aAAA,GAAA,cAAA,CAAA,IAAA,CAAA;;AAEA,EAAA,IAAA,OAAA,aAAA,KAAA,UAAA,EAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,4BAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,aAAA;AACA;;AAEA,SAAA,YAAA,CAAA,MAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAAC,cAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,EAAA,UAAA,EAAA,EAAA,UAAA,IAAA,gCAAA;;AAEA,EAAA,OAAA,IAAA,GAAA,CAAA,CAAA,CAAA,EAAAC,gBAAA,CAAA,CAAA,EAAA,MAAA,CAAA,OAAA,CAAA,EAAA,OAAA,CAAA,CAAA,QAAA,EAAA;AACA;;;;"}
@@ -0,0 +1,125 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+ const eventbuilder = require('./eventbuilder.js');
5
+ const helpers = require('./helpers.js');
6
+
7
+ /**
8
+ * A magic string that build tooling can leverage in order to inject a release value into the SDK.
9
+ */
10
+
11
+ /**
12
+ * The Sentry Browser SDK Client.
13
+ *
14
+ * @see BrowserOptions for documentation on configuration options.
15
+ * @see SentryClient for usage documentation.
16
+ */
17
+ class BrowserClient extends core.Client {
18
+ /**
19
+ * Creates a new Browser SDK instance.
20
+ *
21
+ * @param options Configuration options for this SDK.
22
+ */
23
+ constructor(options) {
24
+ const opts = applyDefaultOptions(options);
25
+ const sdkSource = helpers.WINDOW.SENTRY_SDK_SOURCE || core.getSDKSource();
26
+ core.applySdkMetadata(opts, 'browser', ['browser'], sdkSource);
27
+
28
+ // Only allow IP inferral by Relay if sendDefaultPii is true
29
+ if (opts._metadata?.sdk) {
30
+ opts._metadata.sdk.settings = {
31
+ infer_ip: opts.sendDefaultPii ? 'auto' : 'never',
32
+ // purposefully allowing already passed settings to override the default
33
+ ...opts._metadata.sdk.settings,
34
+ };
35
+ }
36
+
37
+ super(opts);
38
+
39
+ const {
40
+ sendDefaultPii,
41
+ sendClientReports,
42
+ enableLogs,
43
+ _experiments,
44
+ enableMetrics: enableMetricsOption,
45
+ } = this._options;
46
+
47
+ // todo(v11): Remove the experimental flag
48
+ // eslint-disable-next-line deprecation/deprecation
49
+ const enableMetrics = enableMetricsOption ?? _experiments?.enableMetrics ?? true;
50
+
51
+ // Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)
52
+ // todo(v11): Remove the experimental flag
53
+ // eslint-disable-next-line deprecation/deprecation
54
+ if (helpers.WINDOW.document && (sendClientReports || enableLogs || enableMetrics)) {
55
+ helpers.WINDOW.document.addEventListener('visibilitychange', () => {
56
+ if (helpers.WINDOW.document.visibilityState === 'hidden') {
57
+ if (sendClientReports) {
58
+ this._flushOutcomes();
59
+ }
60
+ if (enableLogs) {
61
+ core._INTERNAL_flushLogsBuffer(this);
62
+ }
63
+
64
+ if (enableMetrics) {
65
+ core._INTERNAL_flushMetricsBuffer(this);
66
+ }
67
+ }
68
+ });
69
+ }
70
+
71
+ if (sendDefaultPii) {
72
+ this.on('beforeSendSession', core.addAutoIpAddressToSession);
73
+ }
74
+ }
75
+
76
+ /**
77
+ * @inheritDoc
78
+ */
79
+ eventFromException(exception, hint) {
80
+ return eventbuilder.eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);
81
+ }
82
+
83
+ /**
84
+ * @inheritDoc
85
+ */
86
+ eventFromMessage(
87
+ message,
88
+ level = 'info',
89
+ hint,
90
+ ) {
91
+ return eventbuilder.eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);
92
+ }
93
+
94
+ /**
95
+ * @inheritDoc
96
+ */
97
+ _prepareEvent(
98
+ event,
99
+ hint,
100
+ currentScope,
101
+ isolationScope,
102
+ ) {
103
+ event.platform = event.platform || 'javascript';
104
+
105
+ return super._prepareEvent(event, hint, currentScope, isolationScope);
106
+ }
107
+ }
108
+
109
+ /** Exported only for tests. */
110
+ function applyDefaultOptions(optionsArg) {
111
+ return {
112
+ release:
113
+ typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value
114
+ ? __SENTRY_RELEASE__
115
+ : helpers.WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects
116
+ sendClientReports: true,
117
+ // We default this to true, as it is the safer scenario
118
+ parentSpanIsAlwaysRootSpan: true,
119
+ ...optionsArg,
120
+ };
121
+ }
122
+
123
+ exports.BrowserClient = BrowserClient;
124
+ exports.applyDefaultOptions = applyDefaultOptions;
125
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sources":["../../../../src/client.ts"],"sourcesContent":["import type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options as CoreOptions,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n _INTERNAL_flushMetricsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\ntype BrowserSpecificOptions = BrowserClientReplayOptions &\n BrowserClientProfilingOptions & {\n /** If configured, this URL will be used as base URL for lazy loading integration. */\n cdnBaseUrl?: string;\n\n /**\n * Important: Only set this option if you know what you are doing!\n *\n * By default, the SDK will check if `Sentry.init` is called in a browser extension.\n * In case it is, it will stop initialization and log a warning\n * because browser extensions require a different Sentry initialization process:\n * https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/\n *\n * Setting up the SDK in a browser extension with global error monitoring is not recommended\n * and will likely flood you with errors from other web sites or extensions. This can heavily\n * impact your quota and cause interference with your and other Sentry SDKs in shared environments.\n *\n * If this check wrongfully flags your setup as a browser extension, you can set this\n * option to `true` to skip the check.\n *\n * @default false\n */\n skipBrowserExtensionCheck?: boolean;\n\n /**\n * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,\n * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}\n * option to control to which outgoing requests the header will be attached.\n *\n * **Important:** If you set this option to `true`, make sure that you configured your servers'\n * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.\n *\n * @see https://www.w3.org/TR/trace-context/\n *\n * @default false\n */\n propagateTraceparent?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n };\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends Client<BrowserClientOptions> {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const opts = applyDefaultOptions(options);\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n // Only allow IP inferral by Relay if sendDefaultPii is true\n if (opts._metadata?.sdk) {\n opts._metadata.sdk.settings = {\n infer_ip: opts.sendDefaultPii ? 'auto' : 'never',\n // purposefully allowing already passed settings to override the default\n ...opts._metadata.sdk.settings,\n };\n }\n\n super(opts);\n\n const {\n sendDefaultPii,\n sendClientReports,\n enableLogs,\n _experiments,\n enableMetrics: enableMetricsOption,\n } = this._options;\n\n // todo(v11): Remove the experimental flag\n // eslint-disable-next-line deprecation/deprecation\n const enableMetrics = enableMetricsOption ?? _experiments?.enableMetrics ?? true;\n\n // Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)\n // todo(v11): Remove the experimental flag\n // eslint-disable-next-line deprecation/deprecation\n if (WINDOW.document && (sendClientReports || enableLogs || enableMetrics)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (enableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n\n if (enableMetrics) {\n _INTERNAL_flushMetricsBuffer(this);\n }\n }\n });\n }\n\n if (sendDefaultPii) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n currentScope: Scope,\n isolationScope: Scope,\n ): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n\n return super._prepareEvent(event, hint, currentScope, isolationScope);\n }\n}\n\n/** Exported only for tests. */\nexport function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T {\n return {\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects\n sendClientReports: true,\n // We default this to true, as it is the safer scenario\n parentSpanIsAlwaysRootSpan: true,\n ...optionsArg,\n };\n}\n"],"names":["Client","WINDOW","getSDKSource","applySdkMetadata","_INTERNAL_flushLogsBuffer","_INTERNAL_flushMetricsBuffer","addAutoIpAddressToSession","eventFromException","eventFromMessage"],"mappings":";;;;;;AAuBA;AACA;AACA;;AAiEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAA,SAAsBA,WAAM,CAAuB;AAChE;AACA;AACA;AACA;AACA;AACA,GAAS,WAAW,CAAC,OAAO,EAAwB;AACpD,IAAI,MAAM,IAAA,GAAO,mBAAmB,CAAC,OAAO,CAAC;AAC7C,IAAI,MAAM,YAAYC,cAAM,CAAC,iBAAA,IAAqBC,iBAAY,EAAE;AAChE,IAAIC,qBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;;AAE7D;AACA,IAAI,IAAI,IAAI,CAAC,S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AAS,EAAW,IAAI,EAAkC;AACtF,IAAI,OAAOC,+BAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;AACzG,EAAE;;AAEF;AACA;AACA;AACA,GAAS,gBAAgB;AACzB,IAAI,OAAO;AACX,IAAI,KAAK,GAAkB,MAAM;AACjC,IAAI,IAAI;AACR,IAAwB;AACxB,IAAI,OAAOC,6BAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;AAC5G,EAAE;;AAEF;AACA;AACA;AACA,GAAY,aAAa;AACzB,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAA+B;AAC/B,IAAI,KAAK,CAAC,QAAA,GAAW,KAAK,CAAC,QAAA,IAAY,YAAY;;AAEnD,IAAI,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC;AACzE,EAAE;AACF;;AAEA;AACO,SAAS,mBAAmB,CAA0C,UAAU,EAAQ;AAC/F,EAAE,OAAO;AACT,IAAI,OAAO;AACX,MAAM,OAAO,uBAAuB,QAAA;AACpC,UAAU;AACV,UAAUP,cAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;;"}
@@ -0,0 +1,11 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ /**
4
+ * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
5
+ *
6
+ * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
7
+ */
8
+ const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);
9
+
10
+ exports.DEBUG_BUILD = DEBUG_BUILD;
11
+ //# sourceMappingURL=debug-build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-build.js","sources":["../../../../src/debug-build.ts"],"sourcesContent":["declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAA,IAAc,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}
@@ -0,0 +1,51 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+
5
+ /**
6
+ * A function to diagnose why the SDK might not be successfully sending data.
7
+ *
8
+ * Possible return values wrapped in a Promise:
9
+ * - `"no-client-active"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.
10
+ * - `"sentry-unreachable"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.
11
+ *
12
+ * If the function doesn't detect an issue it resolves to `undefined`.
13
+ */
14
+ async function diagnoseSdkConnectivity()
15
+
16
+ {
17
+ const client = core.getClient();
18
+
19
+ if (!client) {
20
+ return 'no-client-active';
21
+ }
22
+
23
+ if (!client.getDsn()) {
24
+ return 'no-dsn-configured';
25
+ }
26
+
27
+ try {
28
+ await core.suppressTracing(() =>
29
+ // If fetch throws, there is likely an ad blocker active or there are other connective issues.
30
+ fetch(
31
+ // We are using the
32
+ // - "sentry-sdks" org with id 447951 not to pollute any actual organizations.
33
+ // - "diagnose-sdk-connectivity" project with id 4509632503087104
34
+ // - the public key of said org/project, which is disabled in the project settings
35
+ // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)
36
+ 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',
37
+ {
38
+ body: '{}',
39
+ method: 'POST',
40
+ mode: 'cors',
41
+ credentials: 'omit',
42
+ },
43
+ ),
44
+ );
45
+ } catch {
46
+ return 'sentry-unreachable';
47
+ }
48
+ }
49
+
50
+ exports.diagnoseSdkConnectivity = diagnoseSdkConnectivity;
51
+ //# sourceMappingURL=diagnose-sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnose-sdk.js","sources":["../../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient, suppressTracing } from '@sentry/core';\n\n/**\n * A function to diagnose why the SDK might not be successfully sending data.\n *\n * Possible return values wrapped in a Promise:\n * - `\"no-client-active\"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.\n * - `\"sentry-unreachable\"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.\n *\n * If the function doesn't detect an issue it resolves to `undefined`.\n */\nexport async function diagnoseSdkConnectivity(): Promise<\n 'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void\n> {\n const client = getClient();\n\n if (!client) {\n return 'no-client-active';\n }\n\n if (!client.getDsn()) {\n return 'no-dsn-configured';\n }\n\n try {\n await suppressTracing(() =>\n // If fetch throws, there is likely an ad blocker active or there are other connective issues.\n fetch(\n // We are using the\n // - \"sentry-sdks\" org with id 447951 not to pollute any actual organizations.\n // - \"diagnose-sdk-connectivity\" project with id 4509632503087104\n // - the public key of said org/project, which is disabled in the project settings\n // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)\n 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',\n {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n },\n ),\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":["getClient","suppressTracing"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,uBAAuB;;AAE7C,CAAE;AACF,EAAE,MAAM,MAAA,GAASA,cAAS,EAAE;;AAE5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,kBAAkB;AAC7B,EAAE;;AAEF,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;AACxB,IAAI,OAAO,mBAAmB;AAC9B,EAAE;;AAEF,EAAE,IAAI;AACN,IAAI,MAAMC,oBAAe,CAAC;AAC1B;AACA,MAAM,KAAK;AACX;AACA;AACA;AACA;AACA;AACA,QAAQ,+KAA+K;AACvL,QAAQ;AACR,UAAU,IAAI,EAAE,IAAI;AACpB,UAAU,MAAM,EAAE,MAAM;AACxB,UAAU,IAAI,EAAE,MAAM;AACtB,UAAU,WAAW,EAAE,MAAM;AAC7B,SAAS;AACT,OAAO;AACP,KAAK;AACL,EAAE,EAAE,MAAM;AACV,IAAI,OAAO,oBAAoB;AAC/B,EAAE;AACF;;;;"}