@sentry/node 8.54.0 → 9.0.0-alpha.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 (282) hide show
  1. package/build/cjs/cron/common.js +1 -1
  2. package/build/cjs/cron/cron.js +1 -1
  3. package/build/cjs/cron/index.js +1 -1
  4. package/build/cjs/cron/node-cron.js +10 -11
  5. package/build/cjs/cron/node-cron.js.map +1 -1
  6. package/build/cjs/cron/node-schedule.js +2 -6
  7. package/build/cjs/cron/node-schedule.js.map +1 -1
  8. package/build/cjs/debug-build.js +1 -1
  9. package/build/cjs/index.js +3 -15
  10. package/build/cjs/index.js.map +1 -1
  11. package/build/cjs/integrations/anr/index.js +8 -13
  12. package/build/cjs/integrations/anr/index.js.map +1 -1
  13. package/build/cjs/integrations/childProcess.js +19 -24
  14. package/build/cjs/integrations/childProcess.js.map +1 -1
  15. package/build/cjs/integrations/console.js +1 -1
  16. package/build/cjs/integrations/context.js +16 -19
  17. package/build/cjs/integrations/context.js.map +1 -1
  18. package/build/cjs/integrations/contextlines.js +6 -10
  19. package/build/cjs/integrations/contextlines.js.map +1 -1
  20. package/build/cjs/integrations/fs.js +1 -1
  21. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +99 -19
  22. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  23. package/build/cjs/integrations/http/index.js +32 -46
  24. package/build/cjs/integrations/http/index.js.map +1 -1
  25. package/build/cjs/integrations/http/vendor/getRequestInfo.js +1 -1
  26. package/build/cjs/integrations/http/vendor/getRequestInfo.js.map +1 -1
  27. package/build/cjs/integrations/local-variables/common.js +1 -1
  28. package/build/cjs/integrations/local-variables/index.js +1 -1
  29. package/build/cjs/integrations/local-variables/local-variables-async.js +4 -8
  30. package/build/cjs/integrations/local-variables/local-variables-async.js.map +1 -1
  31. package/build/cjs/integrations/local-variables/local-variables-sync.js +18 -22
  32. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +1 -1
  33. package/build/cjs/integrations/modules.js +2 -2
  34. package/build/cjs/integrations/modules.js.map +1 -1
  35. package/build/cjs/integrations/node-fetch.js +3 -7
  36. package/build/cjs/integrations/node-fetch.js.map +1 -1
  37. package/build/cjs/integrations/onuncaughtexception.js +1 -1
  38. package/build/cjs/integrations/onunhandledrejection.js +1 -1
  39. package/build/cjs/integrations/processSession.js +36 -0
  40. package/build/cjs/integrations/processSession.js.map +1 -0
  41. package/build/cjs/integrations/spotlight.js +2 -2
  42. package/build/cjs/integrations/spotlight.js.map +1 -1
  43. package/build/cjs/integrations/tracing/amqplib.js +1 -1
  44. package/build/cjs/integrations/tracing/connect.js +2 -2
  45. package/build/cjs/integrations/tracing/connect.js.map +1 -1
  46. package/build/cjs/integrations/tracing/dataloader.js +2 -6
  47. package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
  48. package/build/cjs/integrations/tracing/express.js +4 -31
  49. package/build/cjs/integrations/tracing/express.js.map +1 -1
  50. package/build/cjs/integrations/tracing/fastify.js +3 -7
  51. package/build/cjs/integrations/tracing/fastify.js.map +1 -1
  52. package/build/cjs/integrations/tracing/genericPool.js +1 -1
  53. package/build/cjs/integrations/tracing/graphql.js +5 -5
  54. package/build/cjs/integrations/tracing/graphql.js.map +1 -1
  55. package/build/cjs/integrations/tracing/hapi/index.js +5 -9
  56. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  57. package/build/cjs/integrations/tracing/index.js +1 -6
  58. package/build/cjs/integrations/tracing/index.js.map +1 -1
  59. package/build/cjs/integrations/tracing/kafka.js +1 -1
  60. package/build/cjs/integrations/tracing/knex.js +2 -2
  61. package/build/cjs/integrations/tracing/knex.js.map +1 -1
  62. package/build/cjs/integrations/tracing/koa.js +4 -8
  63. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  64. package/build/cjs/integrations/tracing/lrumemoizer.js +1 -1
  65. package/build/cjs/integrations/tracing/mongo.js +1 -1
  66. package/build/cjs/integrations/tracing/mongoose.js +1 -1
  67. package/build/cjs/integrations/tracing/mysql.js +1 -1
  68. package/build/cjs/integrations/tracing/mysql2.js +1 -1
  69. package/build/cjs/integrations/tracing/postgres.js +1 -1
  70. package/build/cjs/integrations/tracing/prisma.js +21 -67
  71. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  72. package/build/cjs/integrations/tracing/redis.js +4 -8
  73. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  74. package/build/cjs/integrations/tracing/tedious.js +3 -7
  75. package/build/cjs/integrations/tracing/tedious.js.map +1 -1
  76. package/build/cjs/integrations/tracing/vercelai/index.js +14 -20
  77. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  78. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +1 -1
  79. package/build/cjs/nodeVersion.js +1 -1
  80. package/build/cjs/otel/contextManager.js +2 -2
  81. package/build/cjs/otel/contextManager.js.map +1 -1
  82. package/build/cjs/otel/instrument.js +1 -1
  83. package/build/cjs/proxy/base.js +30 -33
  84. package/build/cjs/proxy/base.js.map +1 -1
  85. package/build/cjs/proxy/index.js +3 -8
  86. package/build/cjs/proxy/index.js.map +1 -1
  87. package/build/cjs/proxy/parse-proxy-response.js +2 -2
  88. package/build/cjs/proxy/parse-proxy-response.js.map +1 -1
  89. package/build/cjs/sdk/api.js +2 -2
  90. package/build/cjs/sdk/api.js.map +1 -1
  91. package/build/cjs/sdk/client.js +3 -8
  92. package/build/cjs/sdk/client.js.map +1 -1
  93. package/build/cjs/sdk/index.js +5 -58
  94. package/build/cjs/sdk/index.js.map +1 -1
  95. package/build/cjs/sdk/initOtel.js +8 -22
  96. package/build/cjs/sdk/initOtel.js.map +1 -1
  97. package/build/cjs/transports/http.js +10 -16
  98. package/build/cjs/transports/http.js.map +1 -1
  99. package/build/cjs/utils/addOriginToSpan.js +1 -1
  100. package/build/cjs/utils/commonjs.js +1 -1
  101. package/build/cjs/utils/createMissingInstrumentationContext.js +1 -1
  102. package/build/cjs/utils/debug.js +1 -1
  103. package/build/cjs/utils/ensureIsWrapped.js +2 -6
  104. package/build/cjs/utils/ensureIsWrapped.js.map +1 -1
  105. package/build/cjs/utils/envToBool.js +2 -2
  106. package/build/cjs/utils/envToBool.js.map +1 -1
  107. package/build/cjs/utils/errorhandling.js +2 -3
  108. package/build/cjs/utils/errorhandling.js.map +1 -1
  109. package/build/cjs/utils/getRequestUrl.js +1 -1
  110. package/build/cjs/utils/module.js +1 -1
  111. package/build/cjs/utils/module.js.map +1 -1
  112. package/build/cjs/utils/redisCache.js +1 -4
  113. package/build/cjs/utils/redisCache.js.map +1 -1
  114. package/build/esm/cron/node-cron.js +9 -7
  115. package/build/esm/cron/node-cron.js.map +1 -1
  116. package/build/esm/cron/node-schedule.js +1 -2
  117. package/build/esm/cron/node-schedule.js.map +1 -1
  118. package/build/esm/index.js +3 -4
  119. package/build/esm/index.js.map +1 -1
  120. package/build/esm/integrations/anr/index.js +8 -9
  121. package/build/esm/integrations/anr/index.js.map +1 -1
  122. package/build/esm/integrations/anr/worker-script.js +2 -2
  123. package/build/esm/integrations/childProcess.js +20 -24
  124. package/build/esm/integrations/childProcess.js.map +1 -1
  125. package/build/esm/integrations/context.js +15 -15
  126. package/build/esm/integrations/context.js.map +1 -1
  127. package/build/esm/integrations/contextlines.js +5 -6
  128. package/build/esm/integrations/contextlines.js.map +1 -1
  129. package/build/esm/integrations/http/SentryHttpInstrumentation.js +99 -20
  130. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  131. package/build/esm/integrations/http/index.js +32 -43
  132. package/build/esm/integrations/http/index.js.map +1 -1
  133. package/build/esm/integrations/http/vendor/getRequestInfo.js.map +1 -1
  134. package/build/esm/integrations/local-variables/local-variables-async.js +3 -4
  135. package/build/esm/integrations/local-variables/local-variables-async.js.map +1 -1
  136. package/build/esm/integrations/local-variables/local-variables-sync.js +17 -18
  137. package/build/esm/integrations/local-variables/local-variables-sync.js.map +1 -1
  138. package/build/esm/integrations/local-variables/worker-script.js +2 -2
  139. package/build/esm/integrations/modules.js +1 -1
  140. package/build/esm/integrations/modules.js.map +1 -1
  141. package/build/esm/integrations/node-fetch.js +3 -4
  142. package/build/esm/integrations/node-fetch.js.map +1 -1
  143. package/build/esm/integrations/processSession.js +34 -0
  144. package/build/esm/integrations/processSession.js.map +1 -0
  145. package/build/esm/integrations/spotlight.js +1 -1
  146. package/build/esm/integrations/spotlight.js.map +1 -1
  147. package/build/esm/integrations/tracing/connect.js +1 -1
  148. package/build/esm/integrations/tracing/connect.js.map +1 -1
  149. package/build/esm/integrations/tracing/dataloader.js +1 -2
  150. package/build/esm/integrations/tracing/dataloader.js.map +1 -1
  151. package/build/esm/integrations/tracing/express.js +4 -28
  152. package/build/esm/integrations/tracing/express.js.map +1 -1
  153. package/build/esm/integrations/tracing/fastify.js +2 -3
  154. package/build/esm/integrations/tracing/fastify.js.map +1 -1
  155. package/build/esm/integrations/tracing/graphql.js +4 -4
  156. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  157. package/build/esm/integrations/tracing/hapi/index.js +4 -5
  158. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  159. package/build/esm/integrations/tracing/index.js +0 -5
  160. package/build/esm/integrations/tracing/index.js.map +1 -1
  161. package/build/esm/integrations/tracing/knex.js +1 -1
  162. package/build/esm/integrations/tracing/knex.js.map +1 -1
  163. package/build/esm/integrations/tracing/koa.js +3 -4
  164. package/build/esm/integrations/tracing/koa.js.map +1 -1
  165. package/build/esm/integrations/tracing/prisma.js +21 -64
  166. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  167. package/build/esm/integrations/tracing/redis.js +4 -5
  168. package/build/esm/integrations/tracing/redis.js.map +1 -1
  169. package/build/esm/integrations/tracing/tedious.js +2 -3
  170. package/build/esm/integrations/tracing/tedious.js.map +1 -1
  171. package/build/esm/integrations/tracing/vercelai/index.js +13 -16
  172. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  173. package/build/esm/otel/contextManager.js +1 -1
  174. package/build/esm/otel/contextManager.js.map +1 -1
  175. package/build/esm/package.json +1 -1
  176. package/build/esm/proxy/base.js +29 -29
  177. package/build/esm/proxy/base.js.map +1 -1
  178. package/build/esm/proxy/index.js +2 -3
  179. package/build/esm/proxy/index.js.map +1 -1
  180. package/build/esm/proxy/parse-proxy-response.js +1 -1
  181. package/build/esm/proxy/parse-proxy-response.js.map +1 -1
  182. package/build/esm/sdk/api.js +1 -1
  183. package/build/esm/sdk/api.js.map +1 -1
  184. package/build/esm/sdk/client.js +2 -3
  185. package/build/esm/sdk/client.js.map +1 -1
  186. package/build/esm/sdk/index.js +5 -58
  187. package/build/esm/sdk/index.js.map +1 -1
  188. package/build/esm/sdk/initOtel.js +7 -18
  189. package/build/esm/sdk/initOtel.js.map +1 -1
  190. package/build/esm/transports/http.js +9 -12
  191. package/build/esm/transports/http.js.map +1 -1
  192. package/build/esm/utils/ensureIsWrapped.js +1 -2
  193. package/build/esm/utils/ensureIsWrapped.js.map +1 -1
  194. package/build/esm/utils/envToBool.js +1 -1
  195. package/build/esm/utils/envToBool.js.map +1 -1
  196. package/build/esm/utils/errorhandling.js +1 -2
  197. package/build/esm/utils/errorhandling.js.map +1 -1
  198. package/build/esm/utils/module.js.map +1 -1
  199. package/build/esm/utils/redisCache.js +0 -3
  200. package/build/esm/utils/redisCache.js.map +1 -1
  201. package/build/types/cron/node-cron.d.ts +1 -1
  202. package/build/types/cron/node-cron.d.ts.map +1 -1
  203. package/build/types/index.d.ts +4 -6
  204. package/build/types/index.d.ts.map +1 -1
  205. package/build/types/integrations/childProcess.d.ts +7 -7
  206. package/build/types/integrations/childProcess.d.ts.map +1 -1
  207. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +30 -0
  208. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -1
  209. package/build/types/integrations/http/index.d.ts +11 -8
  210. package/build/types/integrations/http/index.d.ts.map +1 -1
  211. package/build/types/integrations/processSession.d.ts +5 -0
  212. package/build/types/integrations/processSession.d.ts.map +1 -0
  213. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  214. package/build/types/integrations/tracing/hapi/types.d.ts +1 -0
  215. package/build/types/integrations/tracing/hapi/types.d.ts.map +1 -1
  216. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  217. package/build/types/integrations/tracing/prisma.d.ts +11 -12
  218. package/build/types/integrations/tracing/prisma.d.ts.map +1 -1
  219. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  220. package/build/types/otel/contextManager.d.ts +1 -1
  221. package/build/types/proxy/helpers.d.ts +1 -0
  222. package/build/types/proxy/helpers.d.ts.map +1 -1
  223. package/build/types/proxy/parse-proxy-response.d.ts +1 -0
  224. package/build/types/proxy/parse-proxy-response.d.ts.map +1 -1
  225. package/build/types/sdk/index.d.ts.map +1 -1
  226. package/build/types/sdk/initOtel.d.ts +1 -3
  227. package/build/types/sdk/initOtel.d.ts.map +1 -1
  228. package/build/types/transports/http-module.d.ts +1 -0
  229. package/build/types/transports/http-module.d.ts.map +1 -1
  230. package/build/types/transports/http.d.ts +1 -0
  231. package/build/types/transports/http.d.ts.map +1 -1
  232. package/build/types/types.d.ts +2 -48
  233. package/build/types/types.d.ts.map +1 -1
  234. package/build/types/utils/errorhandling.d.ts.map +1 -1
  235. package/build/types-ts3.8/cron/node-cron.d.ts +1 -1
  236. package/build/types-ts3.8/index.d.ts +4 -6
  237. package/build/types-ts3.8/integrations/childProcess.d.ts +7 -7
  238. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +29 -0
  239. package/build/types-ts3.8/integrations/http/index.d.ts +11 -8
  240. package/build/types-ts3.8/integrations/processSession.d.ts +5 -0
  241. package/build/types-ts3.8/integrations/tracing/prisma.d.ts +11 -12
  242. package/build/types-ts3.8/otel/contextManager.d.ts +1 -1
  243. package/build/types-ts3.8/sdk/initOtel.d.ts +1 -3
  244. package/build/types-ts3.8/types.d.ts +2 -48
  245. package/package.json +8 -9
  246. package/build/cjs/integrations/tracing/nest/helpers.js +0 -100
  247. package/build/cjs/integrations/tracing/nest/helpers.js.map +0 -1
  248. package/build/cjs/integrations/tracing/nest/nest.js +0 -148
  249. package/build/cjs/integrations/tracing/nest/nest.js.map +0 -1
  250. package/build/cjs/integrations/tracing/nest/sentry-nest-event-instrumentation.js +0 -117
  251. package/build/cjs/integrations/tracing/nest/sentry-nest-event-instrumentation.js.map +0 -1
  252. package/build/cjs/integrations/tracing/nest/sentry-nest-instrumentation.js +0 -301
  253. package/build/cjs/integrations/tracing/nest/sentry-nest-instrumentation.js.map +0 -1
  254. package/build/esm/integrations/tracing/nest/helpers.js +0 -91
  255. package/build/esm/integrations/tracing/nest/helpers.js.map +0 -1
  256. package/build/esm/integrations/tracing/nest/nest.js +0 -141
  257. package/build/esm/integrations/tracing/nest/nest.js.map +0 -1
  258. package/build/esm/integrations/tracing/nest/sentry-nest-event-instrumentation.js +0 -115
  259. package/build/esm/integrations/tracing/nest/sentry-nest-event-instrumentation.js.map +0 -1
  260. package/build/esm/integrations/tracing/nest/sentry-nest-instrumentation.js +0 -295
  261. package/build/esm/integrations/tracing/nest/sentry-nest-instrumentation.js.map +0 -1
  262. package/build/types/integrations/tracing/nest/helpers.d.ts +0 -36
  263. package/build/types/integrations/tracing/nest/helpers.d.ts.map +0 -1
  264. package/build/types/integrations/tracing/nest/nest.d.ts +0 -19
  265. package/build/types/integrations/tracing/nest/nest.d.ts.map +0 -1
  266. package/build/types/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts +0 -27
  267. package/build/types/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts.map +0 -1
  268. package/build/types/integrations/tracing/nest/sentry-nest-instrumentation.d.ts +0 -37
  269. package/build/types/integrations/tracing/nest/sentry-nest-instrumentation.d.ts.map +0 -1
  270. package/build/types/integrations/tracing/nest/types.d.ts +0 -84
  271. package/build/types/integrations/tracing/nest/types.d.ts.map +0 -1
  272. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -38
  273. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts.map +0 -1
  274. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -31
  275. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +0 -1
  276. package/build/types-ts3.8/integrations/tracing/nest/helpers.d.ts +0 -36
  277. package/build/types-ts3.8/integrations/tracing/nest/nest.d.ts +0 -19
  278. package/build/types-ts3.8/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts +0 -27
  279. package/build/types-ts3.8/integrations/tracing/nest/sentry-nest-instrumentation.d.ts +0 -37
  280. package/build/types-ts3.8/integrations/tracing/nest/types.d.ts +0 -84
  281. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -44
  282. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -34
@@ -1,2 +1,2 @@
1
- /*! @sentry/node 8.54.0 (e9a45fe) | https://github.com/getsentry/sentry-javascript */
2
- import{Session as t}from"node:inspector";import{parentPort as n,workerData as e}from"node:worker_threads";import{posix as r,sep as o}from"node:path";import*as s from"node:http";import*as i from"node:https";import{Readable as c}from"node:stream";import{createGzip as u}from"node:zlib";import*as a from"node:net";import*as f from"node:tls";const h="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,p="8.54.0",l=globalThis;function d(t,n,e){const r=l,o=r.__SENTRY__=r.__SENTRY__||{},s=o[p]=o[p]||{};return s[t]||(s[t]=n())}const m="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,y=["debug","info","warn","error","log","assert","trace"],g={};function b(t){if(!("console"in l))return t();const n=l.console,e={},r=Object.keys(g);r.forEach((t=>{const r=g[t];e[t]=n[t],n[t]=r}));try{return t()}finally{r.forEach((t=>{n[t]=e[t]}))}}const _=d("logger",(function(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return m?y.forEach((e=>{n[e]=(...n)=>{t&&b((()=>{l.console[e](`Sentry Logger [${e}]:`,...n)}))}})):y.forEach((t=>{n[t]=()=>{}})),n})),v=50,w="?",S=/captureMessage|captureException/;function $(t){return t[t.length-1]||{}}const E="<anonymous>";function x(){return N(l),l}function N(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||p,n[p]=n[p]||{}}const T=Object.prototype.toString;function C(t,n){return T.call(t)===`[object ${n}]`}function j(t){return C(t,"String")}function k(t){return C(t,"Object")}function R(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function O(t,n){try{return t instanceof n}catch(t){return!1}}const D=l,A=80;function I(t,n){const e=t,r=[];if(!e||!e.tagName)return"";if(D.HTMLElement&&e instanceof HTMLElement&&e.dataset){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}r.push(e.tagName.toLowerCase());const o=n&&n.length?n.filter((t=>e.getAttribute(t))).map((t=>[t,e.getAttribute(t)])):null;if(o&&o.length)o.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else{e.id&&r.push(`#${e.id}`);const t=e.className;if(t&&j(t)){const n=t.split(/\s+/);for(const t of n)r.push(`.${t}`)}}const s=["aria-label","type","name","title","alt"];for(const t of s){const n=e.getAttribute(t);n&&r.push(`[${t}="${n}"]`)}return r.join("")}function P(t){if(function(t){switch(T.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return O(t,Error)}}(t))return{message:t.message,name:t.name,stack:t.stack,...M(t)};if(n=t,"undefined"!=typeof Event&&O(n,Event)){const n={type:t.type,target:U(t.target),currentTarget:U(t.currentTarget),...M(t)};return"undefined"!=typeof CustomEvent&&O(t,CustomEvent)&&(n.detail=t.detail),n}return t;var n}function U(t){try{return n=t,"undefined"!=typeof Element&&O(n,Element)?function(t,n={}){if(!t)return"<unknown>";try{let e=t;const r=5,o=[];let s=0,i=0;const c=" > ",u=c.length;let a;const f=Array.isArray(n)?n:n.keyAttrs,h=!Array.isArray(n)&&n.maxStringLength||A;for(;e&&s++<r&&(a=I(e,f),!("html"===a||s>1&&i+o.length*u+a.length>=h));)o.push(a),i+=a.length,e=e.parentNode;return o.reverse().join(c)}catch(t){return"<unknown>"}}(t):Object.prototype.toString.call(t)}catch(t){return"<unknown>"}var n}function M(t){if("object"==typeof t&&null!==t){const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}return{}}function L(t){return B(t,new Map)}function B(t,n){if(function(t){if(!k(t))return!1;try{const n=Object.getPrototypeOf(t).constructor.name;return!n||"Object"===n}catch(t){return!0}}(t)){const e=n.get(t);if(void 0!==e)return e;const r={};n.set(t,r);for(const e of Object.getOwnPropertyNames(t))void 0!==t[e]&&(r[e]=B(t[e],n));return r}if(Array.isArray(t)){const e=n.get(t);if(void 0!==e)return e;const r=[];return n.set(t,r),t.forEach((t=>{r.push(B(t,n))})),r}return t}const G=1e3;function J(){return Date.now()/G}const Y=function(){const{performance:t}=l;if(!t||!t.now)return J;const n=Date.now()-t.now(),e=null==t.timeOrigin?n:t.timeOrigin;return()=>(e+t.now())/G}();function z(){const t=l,n=t.crypto||t.msCrypto;let e=()=>16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch(t){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&e())>>t/4).toString(16)))}var H;function W(t){return new F((n=>{n(t)}))}(()=>{const{performance:t}=l;if(!t||!t.now)return;const n=36e5,e=t.now(),r=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+e-r):n,s=o<n,i=t.timing&&t.timing.navigationStart,c="number"==typeof i?Math.abs(i+e-r):n;(s||c<n)&&(o<=c&&t.timeOrigin)})(),function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(H||(H={}));class F{constructor(t){F.prototype.__init.call(this),F.prototype.__init2.call(this),F.prototype.__init3.call(this),F.prototype.__init4.call(this),this.t=H.PENDING,this.o=[];try{t(this.i,this.u)}catch(t){this.u(t)}}then(t,n){return new F(((e,r)=>{this.o.push([!1,n=>{if(t)try{e(t(n))}catch(t){r(t)}else e(n)},t=>{if(n)try{e(n(t))}catch(t){r(t)}else r(t)}]),this.h()}))}catch(t){return this.then((t=>t),t)}finally(t){return new F(((n,e)=>{let r,o;return this.then((n=>{o=!1,r=n,t&&t()}),(n=>{o=!0,r=n,t&&t()})).then((()=>{o?e(r):n(r)}))}))}__init(){this.i=t=>{this.p(H.RESOLVED,t)}}__init2(){this.u=t=>{this.p(H.REJECTED,t)}}__init3(){this.p=(t,n)=>{this.t===H.PENDING&&(R(n)?n.then(this.i,this.u):(this.t=t,this.l=n,this.h()))}}__init4(){this.h=()=>{if(this.t===H.PENDING)return;const t=this.o.slice();this.o=[],t.forEach((t=>{t[0]||(this.t===H.RESOLVED&&t[1](this.l),this.t===H.REJECTED&&t[2](this.l),t[0]=!0)}))}}}function K(t){const n=Y(),e={sid:z(),init:!0,timestamp:n,started:n,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return L({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(e)};return t&&V(e,t),e}function V(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),t.did||n.did||(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||Y(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:z()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}function Z(){return z()}function q(){return z().substring(16)}function Q(t,n,e=2){if(!n||"object"!=typeof n||e<=0)return n;if(t&&n&&0===Object.keys(n).length)return t;const r={...t};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=Q(r[t],n[t],e-1));return r}const X="_sentrySpan";function tt(t,n){n?function(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch(e){m&&_.log(`Failed to add non-enumerable property "${n}" to object`,t)}}(t,X,n):delete t[X]}function nt(t){return t[X]}class et{constructor(){this.m=!1,this._=[],this.v=[],this.S=[],this.N=[],this.T={},this.C={},this.j={},this.k={},this.R={},this.O={traceId:Z(),spanId:q()}}clone(){const t=new et;return t.S=[...this.S],t.C={...this.C},t.j={...this.j},t.k={...this.k},this.k.flags&&(t.k.flags={values:[...this.k.flags.values]}),t.T=this.T,t.D=this.D,t.A=this.A,t.I=this.I,t.P=this.P,t.v=[...this.v],t.U=this.U,t.N=[...this.N],t.R={...this.R},t.O={...this.O},t.M=this.M,t.L=this.L,tt(t,nt(this)),t}setClient(t){this.M=t}setLastEventId(t){this.L=t}getClient(){return this.M}lastEventId(){return this.L}addScopeListener(t){this._.push(t)}addEventProcessor(t){return this.v.push(t),this}setUser(t){return this.T=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this.A&&V(this.A,{user:t}),this.B(),this}getUser(){return this.T}getRequestSession(){return this.U}setRequestSession(t){return this.U=t,this}setTags(t){return this.C={...this.C,...t},this.B(),this}setTag(t,n){return this.C={...this.C,[t]:n},this.B(),this}setExtras(t){return this.j={...this.j,...t},this.B(),this}setExtra(t,n){return this.j={...this.j,[t]:n},this.B(),this}setFingerprint(t){return this.P=t,this.B(),this}setLevel(t){return this.D=t,this.B(),this}setTransactionName(t){return this.I=t,this.B(),this}setContext(t,n){return null===n?delete this.k[t]:this.k[t]=n,this.B(),this}setSession(t){return t?this.A=t:delete this.A,this.B(),this}getSession(){return this.A}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,[e,r]=n instanceof rt?[n.getScopeData(),n.getRequestSession()]:k(n)?[t,t.requestSession]:[],{tags:o,extra:s,user:i,contexts:c,level:u,fingerprint:a=[],propagationContext:f}=e||{};return this.C={...this.C,...o},this.j={...this.j,...s},this.k={...this.k,...c},i&&Object.keys(i).length&&(this.T=i),u&&(this.D=u),a.length&&(this.P=a),f&&(this.O=f),r&&(this.U=r),this}clear(){return this.S=[],this.C={},this.j={},this.T={},this.k={},this.D=void 0,this.I=void 0,this.P=void 0,this.U=void 0,this.A=void 0,tt(this,void 0),this.N=[],this.setPropagationContext({traceId:Z()}),this.B(),this}addBreadcrumb(t,n){const e="number"==typeof n?n:100;if(e<=0)return this;const r={timestamp:J(),...t};return this.S.push(r),this.S.length>e&&(this.S=this.S.slice(-e),this.M&&this.M.recordDroppedEvent("buffer_overflow","log_item")),this.B(),this}getLastBreadcrumb(){return this.S[this.S.length-1]}clearBreadcrumbs(){return this.S=[],this.B(),this}addAttachment(t){return this.N.push(t),this}clearAttachments(){return this.N=[],this}getScopeData(){return{breadcrumbs:this.S,attachments:this.N,contexts:this.k,tags:this.C,extra:this.j,user:this.T,level:this.D,fingerprint:this.P||[],eventProcessors:this.v,propagationContext:this.O,sdkProcessingMetadata:this.R,transactionName:this.I,span:nt(this)}}setSDKProcessingMetadata(t){return this.R=Q(this.R,t,2),this}setPropagationContext(t){return this.O={spanId:q(),...t},this}getPropagationContext(){return this.O}captureException(t,n){const e=n&&n.event_id?n.event_id:z();if(!this.M)return _.warn("No client configured on scope - will not capture exception!"),e;const r=new Error("Sentry syntheticException");return this.M.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e&&e.event_id?e.event_id:z();if(!this.M)return _.warn("No client configured on scope - will not capture message!"),r;const o=new Error(t);return this.M.captureMessage(t,n,{originalException:t,syntheticException:o,...e,event_id:r},this),r}captureEvent(t,n){const e=n&&n.event_id?n.event_id:z();return this.M?(this.M.captureEvent(t,{...n,event_id:e},this),e):(_.warn("No client configured on scope - will not capture event!"),e)}B(){this.m||(this.m=!0,this._.forEach((t=>{t(this)})),this.m=!1)}}const rt=et;class ot{constructor(t,n){let e,r;e=t||new rt,r=n||new rt,this.G=[{scope:e}],this.J=r}withScope(t){const n=this.Y();let e;try{e=t(n)}catch(t){throw this.H(),t}return R(e)?e.then((t=>(this.H(),t)),(t=>{throw this.H(),t})):(this.H(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this.J}getStackTop(){return this.G[this.G.length-1]}Y(){const t=this.getScope().clone();return this.G.push({client:this.getClient(),scope:t}),t}H(){return!(this.G.length<=1)&&!!this.G.pop()}}function st(){const t=N(x());return t.stack=t.stack||new ot(d("defaultCurrentScope",(()=>new rt)),d("defaultIsolationScope",(()=>new rt)))}function it(t){return st().withScope(t)}function ct(t,n){const e=st();return e.withScope((()=>(e.getStackTop().scope=t,n(t))))}function ut(t){return st().withScope((()=>t(st().getIsolationScope())))}function at(t){const n=N(t);return n.acs?n.acs:{withIsolationScope:ut,withScope:it,withSetScope:ct,withSetIsolationScope:(t,n)=>ut(n),getCurrentScope:()=>st().getScope(),getIsolationScope:()=>st().getIsolationScope()}}function ft(){return at(x()).getCurrentScope().getClient()}const ht="_sentryMetrics";function pt(t){const n=t[ht];if(!n)return;const e={};for(const[,[t,r]]of n){(e[t]||(e[t]=[])).push(L(r))}return e}const lt="sentry.source",dt="sentry.sample_rate",mt="sentry.op",yt="sentry.origin",gt=0,bt=1,_t="sentry-",vt=/^sentry-/;function wt(t){const n=function(t){if(!t||!j(t)&&!Array.isArray(t))return;if(Array.isArray(t))return t.reduce(((t,n)=>{const e=St(n);return Object.entries(e).forEach((([n,e])=>{t[n]=e})),t}),{});return St(t)}(t);if(!n)return;const e=Object.entries(n).reduce(((t,[n,e])=>{if(n.match(vt)){t[n.slice(_t.length)]=e}return t}),{});return Object.keys(e).length>0?e:void 0}function St(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[n,e])=>(n&&e&&(t[n]=e),t)),{})}const $t=1;function Et(t){const{spanId:n,traceId:e,isRemote:r}=t.spanContext();return L({parent_span_id:r?n:Tt(t).parent_span_id,span_id:r?q():n,trace_id:e})}function xt(t){return"number"==typeof t?Nt(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Nt(t.getTime()):Y()}function Nt(t){return t>9999999999?t/1e3:t}function Tt(t){if(function(t){return"function"==typeof t.getSpanJSON}(t))return t.getSpanJSON();try{const{spanId:n,traceId:e}=t.spanContext();if(function(t){const n=t;return!!(n.attributes&&n.startTime&&n.name&&n.endTime&&n.status)}(t)){const{attributes:r,startTime:o,name:s,endTime:i,parentSpanId:c,status:u}=t;return L({span_id:n,trace_id:e,data:r,description:s,parent_span_id:c,start_timestamp:xt(o),timestamp:xt(i)||void 0,status:Ct(u),op:r[mt],origin:r[yt],_metrics_summary:pt(t)})}return{span_id:n,trace_id:e}}catch(t){return{}}}function Ct(t){if(t&&t.code!==gt)return t.code===bt?"ok":t.message||"unknown_error"}const jt="_sentryRootSpan";function kt(t){return t[jt]||t}const Rt="production",Ot="_frozenDsc";function Dt(t){const n=ft();if(!n)return{};const e=kt(t),r=e[Ot];if(r)return r;const o=e.spanContext().traceState,s=o&&o.get("sentry.dsc"),i=s&&wt(s);if(i)return i;const c=function(t,n){const e=n.getOptions(),{publicKey:r}=n.getDsn()||{},o=L({environment:e.environment||Rt,release:e.release,public_key:r,trace_id:t});return n.emit("createDsc",o),o}(t.spanContext().traceId,n),u=Tt(e),a=u.data||{},f=a[dt];null!=f&&(c.sample_rate=`${f}`);const h=a[lt],p=u.description;return"url"!==h&&p&&(c.transaction=p),function(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const n=ft(),e=n&&n.getOptions();return!!e&&(e.enableTracing||"tracesSampleRate"in e||"tracesSampler"in e)}()&&(c.sampled=String(function(t){const{traceFlags:n}=t.spanContext();return n===$t}(e))),n.emit("createDsc",c,e),c}function At(t,n=!1){const{host:e,path:r,pass:o,port:s,projectId:i,protocol:c,publicKey:u}=t;return`${c}://${u}${n&&o?`:${o}`:""}@${e}${s?`:${s}`:""}/${r?`${r}/`:r}${i}`}function It(t,n=100,e=1/0){try{return Pt("",t,n,e)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function Pt(t,n,e=1/0,r=1/0,o=function(){const t="function"==typeof WeakSet,n=t?new WeakSet:[];return[function(e){if(t)return!!n.has(e)||(n.add(e),!1);for(let t=0;t<n.length;t++)if(n[t]===e)return!0;return n.push(e),!1},function(e){if(t)n.delete(e);else for(let t=0;t<n.length;t++)if(n[t]===e){n.splice(t,1);break}}]}()){const[s,i]=o;if(null==n||["boolean","string"].includes(typeof n)||"number"==typeof n&&Number.isFinite(n))return n;const c=function(t,n){try{if("domain"===t&&n&&"object"==typeof n&&n.W)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if("undefined"!=typeof global&&n===global)return"[Global]";if("undefined"!=typeof window&&n===window)return"[Window]";if("undefined"!=typeof document&&n===document)return"[Document]";if("object"==typeof(e=n)&&null!==e&&(e.__isVue||e.F))return"[VueViewModel]";if(function(t){return k(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}(n))return"[SyntheticEvent]";if("number"==typeof n&&!Number.isFinite(n))return`[${n}]`;if("function"==typeof n)return`[Function: ${function(t){try{return t&&"function"==typeof t&&t.name||E}catch(t){return E}}(n)}]`;if("symbol"==typeof n)return`[${String(n)}]`;if("bigint"==typeof n)return`[BigInt: ${String(n)}]`;const r=function(t){const n=Object.getPrototypeOf(t);return n?n.constructor.name:"null prototype"}(n);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(t){return`**non-serializable** (${t})`}var e}(t,n);if(!c.startsWith("[object "))return c;if(n.__sentry_skip_normalization__)return n;const u="number"==typeof n.__sentry_override_normalization_depth__?n.__sentry_override_normalization_depth__:e;if(0===u)return c.replace("object ","");if(s(n))return"[Circular ~]";const a=n;if(a&&"function"==typeof a.toJSON)try{return Pt("",a.toJSON(),u-1,r,o)}catch(t){}const f=Array.isArray(n)?[]:{};let h=0;const p=P(n);for(const t in p){if(!Object.prototype.hasOwnProperty.call(p,t))continue;if(h>=r){f[t]="[MaxProperties ~]";break}const n=p[t];f[t]=Pt(t,n,u-1,r,o),h++}return i(n),f}function Ut(t,n){const e=n.replace(/\\/g,"/").replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");let r=t;try{r=decodeURI(t)}catch(t){}return r.replace(/\\/g,"/").replace(/webpack:\/?/g,"").replace(new RegExp(`(file://)?/*${e}/*`,"ig"),"app:///")}function Mt(t,n=[]){return[t,n]}function Lt(t,n){const e=t[1];for(const t of e){if(n(t,t[0].type))return!0}return!1}function Bt(t){return l.__SENTRY__&&l.__SENTRY__.encodePolyfill?l.__SENTRY__.encodePolyfill(t):(new TextEncoder).encode(t)}function Gt(t){const[n,e]=t;let r=JSON.stringify(n);function o(t){"string"==typeof r?r="string"==typeof t?r+t:[Bt(r),t]:r.push("string"==typeof t?Bt(t):t)}for(const t of e){const[n,e]=t;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch(n){t=JSON.stringify(It(e))}o(t)}}return"string"==typeof r?r:function(t){const n=t.reduce(((t,n)=>t+n.length),0),e=new Uint8Array(n);let r=0;for(const n of t)e.set(n,r),r+=n.length;return e}(r)}const Jt={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function Yt(t){if(!t||!t.sdk)return;const{name:n,version:e}=t.sdk;return{name:n,version:e}}function zt(t,n,e,r){const o=Yt(e),s=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,n){n&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||n.name,t.sdk.version=t.sdk.version||n.version,t.sdk.integrations=[...t.sdk.integrations||[],...n.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...n.packages||[]])}(t,e&&e.sdk);const i=function(t,n,e,r){const o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&{sdk:n},...!!e&&r&&{dsn:At(r)},...o&&{trace:L({...o})}}}(t,o,r,n);delete t.sdkProcessingMetadata;return Mt(i,[[{type:s},t]])}const Ht="__SENTRY_SUPPRESS_TRACING__";function Wt(t){const n=at(x());return n.suppressTracing?n.suppressTracing(t):function(...t){const n=at(x());if(2===t.length){const[e,r]=t;return e?n.withSetScope(e,r):n.withScope(r)}return n.withScope(t[0])}((n=>(n.setSDKProcessingMetadata({[Ht]:!0}),t())))}function Ft(t,n){const{fingerprint:e,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=n;!function(t,n){const{extra:e,tags:r,user:o,contexts:s,level:i,transactionName:c}=n,u=L(e);u&&Object.keys(u).length&&(t.extra={...u,...t.extra});const a=L(r);a&&Object.keys(a).length&&(t.tags={...a,...t.tags});const f=L(o);f&&Object.keys(f).length&&(t.user={...f,...t.user});const h=L(s);h&&Object.keys(h).length&&(t.contexts={...h,...t.contexts});i&&(t.level=i);c&&"transaction"!==t.type&&(t.transaction=c)}(t,n),r&&function(t,n){t.contexts={trace:Et(n),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Dt(n),...t.sdkProcessingMetadata};const e=kt(n),r=Tt(e).description;r&&!t.transaction&&"transaction"===t.type&&(t.transaction=r)}(t,r),function(t,n){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],n&&(t.fingerprint=t.fingerprint.concat(n));t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}(t,e),function(t,n){const e=[...t.breadcrumbs||[],...n];t.breadcrumbs=e.length?e:void 0}(t,o),function(t,n){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...n}}(t,s)}const Kt="7";class Vt extends Error{constructor(t,n="warn"){super(t),this.message=t,this.logLevel=n}}function Zt(t){const n=[];function e(t){return n.splice(n.indexOf(t),1)[0]||Promise.resolve(void 0)}return{$:n,add:function(r){if(!(void 0===t||n.length<t))return o=new Vt("Not adding Promise because buffer limit was reached."),new F(((t,n)=>{n(o)}));var o;const s=r();return-1===n.indexOf(s)&&n.push(s),s.then((()=>e(s))).then(null,(()=>e(s).then(null,(()=>{})))),s},drain:function(t){return new F(((e,r)=>{let o=n.length;if(!o)return e(!0);const s=setTimeout((()=>{t&&t>0&&e(!1)}),t);n.forEach((t=>{W(t).then((()=>{--o||(clearTimeout(s),e(!0))}),r)}))}))}}}const qt=6e4;function Qt(t,{statusCode:n,headers:e},r=Date.now()){const o={...t},s=e&&e["x-sentry-rate-limits"],i=e&&e["retry-after"];if(s)for(const t of s.trim().split(",")){const[n,e,,,s]=t.split(":",5),i=parseInt(n,10),c=1e3*(isNaN(i)?60:i);if(e)for(const t of e.split(";"))"metric_bucket"===t&&s&&!s.split(";").includes("custom")||(o[t]=r+c);else o.all=r+c}else i?o.all=r+function(t,n=Date.now()){const e=parseInt(`${t}`,10);if(!isNaN(e))return 1e3*e;const r=Date.parse(`${t}`);return isNaN(r)?qt:r-n}(i,r):429===n&&(o.all=r+6e4);return o}const Xt=64;function tn(t,n,e=Zt(t.bufferSize||Xt)){let r={};return{send:function(t){const o=[];if(Lt(t,((t,n)=>{const e=function(t){return Jt[t]}(n);(function(t,n,e=Date.now()){return function(t,n){return t[n]||t.all||0}(t,n)>e})(r,e)||o.push(t)})),0===o.length)return W({});const s=Mt(t[0],o),i=t=>{Lt(s,((t,n)=>{}))};return e.add((()=>n({body:Gt(s)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&&h&&_.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),r=Qt(r,t),t)),(t=>{throw i(),t})))).then((t=>t),(t=>{if(t instanceof Vt)return h&&_.error("Skipped sending event because buffer is full."),i(),W({});throw t}))},flush:t=>e.drain(t)}}const nn=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function en(t){const n=function(t){const n=t.length>1024?`<truncated>${t.slice(-1024)}`:t,e=nn.exec(n);return e?e.slice(1):[]}(t),e=n[0]||"";let r=n[1];return e||r?(r&&(r=r.slice(0,r.length-1)),e+r):"."}function rn(t,n=!1){return!(n||t&&!t.startsWith("/")&&!t.match(/^[A-Z]:/)&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&void 0!==t&&!t.includes("node_modules/")}const on=Symbol("AgentBaseInternalState");class sn extends s.Agent{[on];options;keepAlive;constructor(t){super(t),this[on]={}}isSecureEndpoint(t){if(t){if("boolean"==typeof t.secureEndpoint)return t.secureEndpoint;if("string"==typeof t.protocol)return"https:"===t.protocol}const{stack:n}=new Error;return"string"==typeof n&&n.split("\n").some((t=>-1!==t.indexOf("(https.js:")||-1!==t.indexOf("node:https:")))}createSocket(t,n,e){const r={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then((()=>this.connect(t,r))).then((o=>{if(o instanceof s.Agent)return o.addRequest(t,r);this[on].currentSocket=o,super.createSocket(t,n,e)}),e)}createConnection(){const t=this[on].currentSocket;if(this[on].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[on].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(t){this[on]&&(this[on].defaultPort=t)}get protocol(){return this[on].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[on]&&(this[on].protocol=t)}}function cn(...t){_.log("[https-proxy-agent:parse-proxy-response]",...t)}function un(t){return new Promise(((n,e)=>{let r=0;const o=[];function s(){const c=t.read();c?function(c){o.push(c),r+=c.length;const u=Buffer.concat(o,r),a=u.indexOf("\r\n\r\n");if(-1===a)return cn("have not received end of HTTP headers yet..."),void s();const f=u.slice(0,a).toString("ascii").split("\r\n"),h=f.shift();if(!h)return t.destroy(),e(new Error("No header received from proxy CONNECT response"));const p=h.split(" "),l=+(p[1]||0),d=p.slice(2).join(" "),m={};for(const n of f){if(!n)continue;const r=n.indexOf(":");if(-1===r)return t.destroy(),e(new Error(`Invalid header from proxy CONNECT response: "${n}"`));const o=n.slice(0,r).toLowerCase(),s=n.slice(r+1).trimStart(),i=m[o];"string"==typeof i?m[o]=[i,s]:Array.isArray(i)?i.push(s):m[o]=s}cn("got proxy server response: %o %o",h,m),i(),n({connect:{statusCode:l,statusText:d,headers:m},buffered:u})}(c):t.once("readable",s)}function i(){t.removeListener("end",c),t.removeListener("error",u),t.removeListener("readable",s)}function c(){i(),cn("onend"),e(new Error("Proxy connection ended before receiving CONNECT response"))}function u(t){i(),cn("onerror %o",t),e(t)}t.on("error",u),t.on("end",c),s()}))}function an(...t){_.log("[https-proxy-agent]",...t)}class fn extends sn{static protocols=["http","https"];proxy;proxyHeaders;connectOpts;constructor(t,n){super(n),this.options={},this.proxy="string"==typeof t?new URL(t):t,this.proxyHeaders=n?.headers??{},an("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const e=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?pn(n,"headers"):null,host:e,port:r}}async connect(t,n){const{proxy:e}=this;if(!n.host)throw new TypeError('No "host" provided');let r;if("https:"===e.protocol){an("Creating `tls.Socket`: %o",this.connectOpts);const t=this.connectOpts.servername||this.connectOpts.host;r=f.connect({...this.connectOpts,servername:t&&a.isIP(t)?void 0:t})}else an("Creating `net.Socket`: %o",this.connectOpts),r=a.connect(this.connectOpts);const o="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},s=a.isIPv6(n.host)?`[${n.host}]`:n.host;let i=`CONNECT ${s}:${n.port} HTTP/1.1\r\n`;if(e.username||e.password){const t=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(t).toString("base64")}`}o.Host=`${s}:${n.port}`,o["Proxy-Connection"]||(o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const t of Object.keys(o))i+=`${t}: ${o[t]}\r\n`;const c=un(r);r.write(`${i}\r\n`);const{connect:u,buffered:h}=await c;if(t.emit("proxyConnect",u),this.emit("proxyConnect",u,t),200===u.statusCode){if(t.once("socket",hn),n.secureEndpoint){an("Upgrading socket connection to TLS");const t=n.servername||n.host;return f.connect({...pn(n,"host","path","port"),socket:r,servername:a.isIP(t)?void 0:t})}return r}r.destroy();const p=new a.Socket({writable:!1});return p.readable=!0,t.once("socket",(t=>{an("Replaying proxy buffer for failed request"),t.push(h),t.push(null)})),p}}function hn(t){t.resume()}function pn(t,...n){const e={};let r;for(r in t)n.includes(r)||(e[r]=t[r]);return e}const ln=32768;function dn(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}const mn=e;let yn,gn=0,bn={};function _n(t){mn.debug&&console.log(`[ANR Worker] ${t}`)}var vn,wn,Sn;const $n=function(t){let n;try{n=new URL(t.url)}catch(n){return b((()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")})),tn(t,(()=>Promise.resolve({})))}const e="https:"===n.protocol,r=function(t,n){const{no_proxy:e}=process.env;return e&&e.split(",").some((n=>t.host.endsWith(n)||t.hostname.endsWith(n)))?void 0:n}(n,t.proxy||(e?process.env.https_proxy:void 0)||process.env.http_proxy),o=e?i:s,a=void 0!==t.keepAlive&&t.keepAlive,f=r?new fn(r):new o.Agent({keepAlive:a,maxSockets:30,timeout:2e3}),h=function(t,n,e){const{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(f){return new Promise(((h,p)=>{Wt((()=>{let l=function(t){return new c({read(){this.push(t),this.push(null)}})}(f.body);const d={...t.headers};f.body.length>ln&&(d["content-encoding"]="gzip",l=l.pipe(u()));const m=n.request({method:"POST",agent:e,headers:d,hostname:r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},(t=>{t.on("data",(()=>{})),t.on("end",(()=>{})),t.setEncoding("utf8");const n=t.headers["retry-after"]??null,e=t.headers["x-sentry-rate-limits"]??null;h({statusCode:t.statusCode,headers:{"retry-after":n,"x-sentry-rate-limits":Array.isArray(e)?e[0]||null:e}})}));m.on("error",p),l.pipe(m)}))}))}}(t,t.httpModule??o,f);return tn(t,h)}({url:(vn=mn.dsn,wn=mn.tunnel,Sn=mn.sdkMetadata.sdk,wn||`${function(t){return`${function(t){const n=t.protocol?`${t.protocol}:`:"",e=t.port?`:${t.port}`:"";return`${n}//${t.host}${e}${t.path?`/${t.path}`:""}/api/`}(t)}${t.projectId}/envelope/`}(vn)}?${function(t,n){const e={sentry_version:Kt};return t.publicKey&&(e.sentry_key=t.publicKey),n&&(e.sentry_client=`${n.name}/${n.version}`),new URLSearchParams(e).toString()}(vn,Sn)}`),recordDroppedEvent:()=>{}});async function En(){if(yn){_n("Sending abnormal session"),V(yn,{status:"abnormal",abnormal_mechanism:"anr_foreground"});const t=function(t,n,e,r){const o=Yt(e);return Mt({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&n&&{dsn:At(n)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(yn,mn.dsn,mn.sdkMetadata,mn.tunnel);_n(JSON.stringify(t)),await $n.send(t);try{n?.postMessage("session-ended")}catch(t){}}}function xn(t){if(!t)return;const n=function(t){if(!t.length)return[];const n=Array.from(t);return/sentryWrapped/.test($(n).function||"")&&n.pop(),n.reverse(),S.test($(n).function||"")&&(n.pop(),S.test($(n).function||"")&&n.pop()),n.slice(0,v).map((t=>({...t,filename:t.filename||$(n).filename,function:t.function||w})))}(t);if(mn.appRootPath)for(const t of n)t.filename&&(t.filename=Ut(t.filename,mn.appRootPath));return n}async function Nn(t,n){if(gn>=mn.maxAnrEvents)return;gn+=1,await En(),_n("Sending event");const e={event_id:z(),contexts:mn.contexts,release:mn.release,environment:mn.environment,dist:mn.dist,platform:"node",level:"error",exception:{values:[{type:"ApplicationNotResponding",value:`Application Not Responding for at least ${mn.anrThreshold} ms`,stacktrace:{frames:xn(t)},mechanism:{type:"ANR"}}]},tags:mn.staticTags};n&&function(t,n){if(Ft(t,n),!t.contexts?.trace){const{traceId:e,spanId:r,parentSpanId:o}=n.propagationContext;t.contexts={trace:{trace_id:e,span_id:r,parent_span_id:o},...t.contexts}}}(e,n),function(t){if(0===Object.keys(bn).length)return;const n=mn.appRootPath?{}:bn;if(mn.appRootPath)for(const[t,e]of Object.entries(bn))n[Ut(t,mn.appRootPath)]=e;const e=new Map;for(const r of t.exception?.values||[])for(const t of r.stacktrace?.frames||[]){const r=t.abs_path||t.filename;r&&n[r]&&e.set(r,n[r])}if(e.size>0){const n=[];for(const[t,r]of e.entries())n.push({type:"sourcemap",code_file:t,debug_id:r});t.debug_meta={images:n}}}(e);const r=zt(e,mn.dsn,mn.sdkMetadata,mn.tunnel);_n(JSON.stringify(r)),await $n.send(r),await $n.flush(2e3),gn>=mn.maxAnrEvents&&setTimeout((()=>{process.exit(0)}),5e3)}let Tn;if(_n("Started"),mn.captureStackTrace){_n("Connecting to debugger");const n=new t;n.connectToMainThread(),_n("Connected to debugger");const e=new Map;n.on("Debugger.scriptParsed",(t=>{e.set(t.params.scriptId,t.params.url)})),n.on("Debugger.paused",(t=>{if("other"===t.params.reason)try{_n("Debugger paused");const s=[...t.params.callFrames],i=mn.appRootPath?function(t=(process.argv[1]?en(process.argv[1]):process.cwd()),n="\\"===o){const e=n?dn(t):t;return t=>{if(!t)return;const o=n?dn(t):t;let{dir:s,base:i,ext:c}=r.parse(o);".js"!==c&&".mjs"!==c&&".cjs"!==c||(i=i.slice(0,-1*c.length));const u=decodeURIComponent(i);s||(s=".");const a=s.lastIndexOf("/node_modules");if(a>-1)return`${s.slice(a+14).replace(/\//g,".")}:${u}`;if(s.startsWith(e)){const t=s.slice(e.length+1).replace(/\//g,".");return t?`${t}:${u}`:u}return u}}(mn.appRootPath):()=>{},c=s.map((t=>function(t,n,e){const r=n?n.replace(/^file:\/\//,""):void 0,o=t.location.columnNumber?t.location.columnNumber+1:void 0,s=t.location.lineNumber?t.location.lineNumber+1:void 0;return L({filename:r,module:e(r),function:t.functionName||w,colno:o,lineno:s,in_app:r?rn(r):void 0})}(t,e.get(t.location.scriptId),i))),u=setTimeout((()=>{Nn(c).then(null,(()=>{_n("Sending ANR event failed.")}))}),5e3);n.post("Runtime.evaluate",{expression:"global.__SENTRY_GET_SCOPES__();",silent:!0,returnByValue:!0},((t,e)=>{t&&_n(`Error executing script: '${t.message}'`),clearTimeout(u);const r=e&&e.result?e.result.value:void 0;n.post("Debugger.resume"),n.post("Debugger.disable"),Nn(c,r).then(null,(()=>{_n("Sending ANR event failed.")}))}))}catch(t){throw n.post("Debugger.resume"),n.post("Debugger.disable"),t}})),Tn=()=>{try{n.post("Debugger.enable",(()=>{n.post("Debugger.pause")}))}catch(t){}}}const{poll:Cn}=function(t,n,e,r){const o=t();let s=!1,i=!0;return setInterval((()=>{const t=o.getTimeMs();!1===s&&t>n+e&&(s=!0,i&&r()),t<n+e&&(s=!1)}),20),{poll:()=>{o.reset()},enabled:t=>{i=t}}}((function(){let t=process.hrtime();return{getTimeMs:()=>{const[n,e]=process.hrtime(t);return Math.floor(1e3*n+e/1e6)},reset:()=>{t=process.hrtime()}}}),mn.pollInterval,mn.anrThreshold,(function(){_n("Watchdog timeout"),Tn?(_n("Pausing debugger to capture stack trace"),Tn()):(_n("Capturing event without a stack trace"),Nn().then(null,(()=>{_n("Sending ANR event failed on watchdog timeout.")})))}));n?.on("message",(t=>{t.session&&(yn=K(t.session)),t.debugImages&&(bn=t.debugImages),Cn()}));
1
+ /*! @sentry/node 9.0.0-alpha.0 (035022b) | https://github.com/getsentry/sentry-javascript */
2
+ import{Session as t}from"node:inspector";import{parentPort as n,workerData as e}from"node:worker_threads";import{posix as r,sep as o}from"node:path";import*as s from"node:http";import*as i from"node:https";import{Readable as c}from"node:stream";import{createGzip as u}from"node:zlib";import*as a from"node:net";import*as f from"node:tls";const h="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,p=globalThis,d="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,l="9.0.0-alpha.0";function m(){return g(p),p}function g(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||l,n[l]=n[l]||{}}function y(t,n,e=p){const r=e.__SENTRY__=e.__SENTRY__||{},o=r[l]=r[l]||{};return o[t]||(o[t]=n())}const b=["debug","info","warn","error","log","assert","trace"],_={};function v(t){if(!("console"in p))return t();const n=p.console,e={},r=Object.keys(_);r.forEach((t=>{const r=_[t];e[t]=n[t],n[t]=r}));try{return t()}finally{r.forEach((t=>{n[t]=e[t]}))}}const w=y("logger",(function(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return d?b.forEach((e=>{n[e]=(...n)=>{t&&v((()=>{p.console[e](`Sentry Logger [${e}]:`,...n)}))}})):b.forEach((t=>{n[t]=()=>{}})),n})),S=50,$="?",E=/captureMessage|captureException/;function x(t){return t[t.length-1]||{}}const N="<anonymous>";const T=Object.prototype.toString;function j(t,n){return T.call(t)===`[object ${n}]`}function C(t){return j(t,"String")}function O(t){return j(t,"Object")}function R(t){return Boolean(t?.then&&"function"==typeof t.then)}function D(t,n){try{return t instanceof n}catch(t){return!1}}const k=p,A=80;function I(t,n){const e=t,r=[];if(!e?.tagName)return"";if(k.HTMLElement&&e instanceof HTMLElement&&e.dataset){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}r.push(e.tagName.toLowerCase());const o=n?.length?n.filter((t=>e.getAttribute(t))).map((t=>[t,e.getAttribute(t)])):null;if(o?.length)o.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else{e.id&&r.push(`#${e.id}`);const t=e.className;if(t&&C(t)){const n=t.split(/\s+/);for(const t of n)r.push(`.${t}`)}}const s=["aria-label","type","name","title","alt"];for(const t of s){const n=e.getAttribute(t);n&&r.push(`[${t}="${n}"]`)}return r.join("")}function P(t){if(function(t){switch(T.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return D(t,Error)}}(t))return{message:t.message,name:t.name,stack:t.stack,...M(t)};if(n=t,"undefined"!=typeof Event&&D(n,Event)){const n={type:t.type,target:U(t.target),currentTarget:U(t.currentTarget),...M(t)};return"undefined"!=typeof CustomEvent&&D(t,CustomEvent)&&(n.detail=t.detail),n}return t;var n}function U(t){try{return n=t,"undefined"!=typeof Element&&D(n,Element)?function(t,n={}){if(!t)return"<unknown>";try{let e=t;const r=5,o=[];let s=0,i=0;const c=" > ",u=c.length;let a;const f=Array.isArray(n)?n:n.keyAttrs,h=!Array.isArray(n)&&n.maxStringLength||A;for(;e&&s++<r&&(a=I(e,f),!("html"===a||s>1&&i+o.length*u+a.length>=h));)o.push(a),i+=a.length,e=e.parentNode;return o.reverse().join(c)}catch(t){return"<unknown>"}}(t):Object.prototype.toString.call(t)}catch(t){return"<unknown>"}var n}function M(t){if("object"==typeof t&&null!==t){const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}return{}}function L(t){return B(t,new Map)}function B(t,n){if(function(t){if(!O(t))return!1;try{const n=Object.getPrototypeOf(t).constructor.name;return!n||"Object"===n}catch{return!0}}(t)){const e=n.get(t);if(void 0!==e)return e;const r={};n.set(t,r);for(const e of Object.getOwnPropertyNames(t))void 0!==t[e]&&(r[e]=B(t[e],n));return r}if(Array.isArray(t)){const e=n.get(t);if(void 0!==e)return e;const r=[];return n.set(t,r),t.forEach((t=>{r.push(B(t,n))})),r}return t}const G=1e3;function J(){return Date.now()/G}const Y=function(){const{performance:t}=p;if(!t?.now)return J;const n=Date.now()-t.now(),e=null==t.timeOrigin?n:t.timeOrigin;return()=>(e+t.now())/G}();function z(){const t=p,n=t.crypto||t.msCrypto;let e=()=>16*Math.random();try{if(n?.randomUUID)return n.randomUUID().replace(/-/g,"");n?.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch(t){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&e())>>t/4).toString(16)))}var H;function W(t){return new F((n=>{n(t)}))}!function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(H||(H={}));class F{constructor(t){this.t=H.PENDING,this.o=[],this.i(t)}then(t,n){return new F(((e,r)=>{this.o.push([!1,n=>{if(t)try{e(t(n))}catch(t){r(t)}else e(n)},t=>{if(n)try{e(n(t))}catch(t){r(t)}else r(t)}]),this.u()}))}catch(t){return this.then((t=>t),t)}finally(t){return new F(((n,e)=>{let r,o;return this.then((n=>{o=!1,r=n,t&&t()}),(n=>{o=!0,r=n,t&&t()})).then((()=>{o?e(r):n(r)}))}))}u(){if(this.t===H.PENDING)return;const t=this.o.slice();this.o=[],t.forEach((t=>{t[0]||(this.t===H.RESOLVED&&t[1](this.h),this.t===H.REJECTED&&t[2](this.h),t[0]=!0)}))}i(t){const n=(t,n)=>{this.t===H.PENDING&&(R(n)?n.then(e,r):(this.t=t,this.h=n,this.u()))},e=t=>{n(H.RESOLVED,t)},r=t=>{n(H.REJECTED,t)};try{t(e,r)}catch(t){r(t)}}}function K(t){const n=Y(),e={sid:z(),init:!0,timestamp:n,started:n,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return L({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(e)};return t&&V(e,t),e}function V(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),t.did||n.did||(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||Y(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:z()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}function Z(){return z()}function q(){return z().substring(16)}function Q(t,n,e=2){if(!n||"object"!=typeof n||e<=0)return n;if(t&&0===Object.keys(n).length)return t;const r={...t};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=Q(r[t],n[t],e-1));return r}const X="_sentrySpan";function tt(t,n){n?function(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch(e){d&&w.log(`Failed to add non-enumerable property "${n}" to object`,t)}}(t,X,n):delete t[X]}function nt(t){return t[X]}class et{constructor(){this.p=!1,this.l=[],this.m=[],this._=[],this.v=[],this.S={},this.N={},this.T={},this.j={},this.C={},this.O={traceId:Z(),sampleRand:Math.random()}}clone(){const t=new et;return t._=[...this._],t.N={...this.N},t.T={...this.T},t.j={...this.j},this.j.flags&&(t.j.flags={values:[...this.j.flags.values]}),t.S=this.S,t.R=this.R,t.D=this.D,t.k=this.k,t.A=this.A,t.m=[...this.m],t.v=[...this.v],t.C={...this.C},t.O={...this.O},t.I=this.I,t.P=this.P,tt(t,nt(this)),t}setClient(t){this.I=t}setLastEventId(t){this.P=t}getClient(){return this.I}lastEventId(){return this.P}addScopeListener(t){this.l.push(t)}addEventProcessor(t){return this.m.push(t),this}setUser(t){return this.S=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this.D&&V(this.D,{user:t}),this.U(),this}getUser(){return this.S}setTags(t){return this.N={...this.N,...t},this.U(),this}setTag(t,n){return this.N={...this.N,[t]:n},this.U(),this}setExtras(t){return this.T={...this.T,...t},this.U(),this}setExtra(t,n){return this.T={...this.T,[t]:n},this.U(),this}setFingerprint(t){return this.A=t,this.U(),this}setLevel(t){return this.R=t,this.U(),this}setTransactionName(t){return this.k=t,this.U(),this}setContext(t,n){return null===n?delete this.j[t]:this.j[t]=n,this.U(),this}setSession(t){return t?this.D=t:delete this.D,this.U(),this}getSession(){return this.D}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,e=n instanceof et?n.getScopeData():O(n)?t:void 0,{tags:r,extra:o,user:s,contexts:i,level:c,fingerprint:u=[],propagationContext:a}=e||{};return this.N={...this.N,...r},this.T={...this.T,...o},this.j={...this.j,...i},s&&Object.keys(s).length&&(this.S=s),c&&(this.R=c),u.length&&(this.A=u),a&&(this.O=a),this}clear(){return this._=[],this.N={},this.T={},this.S={},this.j={},this.R=void 0,this.k=void 0,this.A=void 0,this.D=void 0,tt(this,void 0),this.v=[],this.setPropagationContext({traceId:Z(),sampleRand:Math.random()}),this.U(),this}addBreadcrumb(t,n){const e="number"==typeof n?n:100;if(e<=0)return this;const r={timestamp:J(),...t},o=this._;return o.push(r),this._=o.length>e?o.slice(-e):o,this.U(),this}getLastBreadcrumb(){return this._[this._.length-1]}clearBreadcrumbs(){return this._=[],this.U(),this}addAttachment(t){return this.v.push(t),this}clearAttachments(){return this.v=[],this}getScopeData(){return{breadcrumbs:this._,attachments:this.v,contexts:this.j,tags:this.N,extra:this.T,user:this.S,level:this.R,fingerprint:this.A||[],eventProcessors:this.m,propagationContext:this.O,sdkProcessingMetadata:this.C,transactionName:this.k,span:nt(this)}}setSDKProcessingMetadata(t){return this.C=Q(this.C,t,2),this}setPropagationContext(t){return this.O=t,this}getPropagationContext(){return this.O}captureException(t,n){const e=n?.event_id||z();if(!this.I)return w.warn("No client configured on scope - will not capture exception!"),e;const r=new Error("Sentry syntheticException");return this.I.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e?.event_id||z();if(!this.I)return w.warn("No client configured on scope - will not capture message!"),r;const o=new Error(t);return this.I.captureMessage(t,n,{originalException:t,syntheticException:o,...e,event_id:r},this),r}captureEvent(t,n){const e=n?.event_id||z();return this.I?(this.I.captureEvent(t,{...n,event_id:e},this),e):(w.warn("No client configured on scope - will not capture event!"),e)}U(){this.p||(this.p=!0,this.l.forEach((t=>{t(this)})),this.p=!1)}}class rt{constructor(t,n){let e,r;e=t||new et,r=n||new et,this.M=[{scope:e}],this.L=r}withScope(t){const n=this.B();let e;try{e=t(n)}catch(t){throw this.G(),t}return R(e)?e.then((t=>(this.G(),t)),(t=>{throw this.G(),t})):(this.G(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this.L}getStackTop(){return this.M[this.M.length-1]}B(){const t=this.getScope().clone();return this.M.push({client:this.getClient(),scope:t}),t}G(){return!(this.M.length<=1)&&!!this.M.pop()}}function ot(){const t=g(m());return t.stack=t.stack||new rt(y("defaultCurrentScope",(()=>new et)),y("defaultIsolationScope",(()=>new et)))}function st(t){return ot().withScope(t)}function it(t,n){const e=ot();return e.withScope((()=>(e.getStackTop().scope=t,n(t))))}function ct(t){return ot().withScope((()=>t(ot().getIsolationScope())))}function ut(t){const n=g(t);return n.acs?n.acs:{withIsolationScope:ct,withScope:st,withSetScope:it,withSetIsolationScope:(t,n)=>ct(n),getCurrentScope:()=>ot().getScope(),getIsolationScope:()=>ot().getIsolationScope()}}function at(){return ut(m()).getCurrentScope().getClient()}const ft="sentry.source",ht="sentry.sample_rate",pt="sentry.op",dt="sentry.origin",lt=0,mt=1,gt="_sentryScope",yt="_sentryIsolationScope";function bt(t){return{scope:t[gt],isolationScope:t[yt]}}const _t="sentry-",vt=/^sentry-/;function wt(t){const n=function(t){if(!t||!C(t)&&!Array.isArray(t))return;if(Array.isArray(t))return t.reduce(((t,n)=>{const e=St(n);return Object.entries(e).forEach((([n,e])=>{t[n]=e})),t}),{});return St(t)}(t);if(!n)return;const e=Object.entries(n).reduce(((t,[n,e])=>{if(n.match(vt)){t[n.slice(_t.length)]=e}return t}),{});return Object.keys(e).length>0?e:void 0}function St(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[n,e])=>(n&&e&&(t[n]=e),t)),{})}const $t=1;function Et(t){const{spanId:n,traceId:e,isRemote:r}=t.spanContext(),o=r?n:Tt(t).parent_span_id,s=bt(t).scope;return L({parent_span_id:o,span_id:r?s?.getPropagationContext().propagationSpanId||q():n,trace_id:e})}function xt(t){return"number"==typeof t?Nt(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Nt(t.getTime()):Y()}function Nt(t){return t>9999999999?t/1e3:t}function Tt(t){if(function(t){return"function"==typeof t.getSpanJSON}(t))return t.getSpanJSON();const{spanId:n,traceId:e}=t.spanContext();if(function(t){const n=t;return!!(n.attributes&&n.startTime&&n.name&&n.endTime&&n.status)}(t)){const{attributes:r,startTime:o,name:s,endTime:i,parentSpanId:c,status:u}=t;return L({span_id:n,trace_id:e,data:r,description:s,parent_span_id:c,start_timestamp:xt(o),timestamp:xt(i)||void 0,status:jt(u),op:r[pt],origin:r[dt]})}return{span_id:n,trace_id:e,start_timestamp:0,data:{}}}function jt(t){if(t&&t.code!==lt)return t.code===mt?"ok":t.message||"unknown_error"}const Ct="_sentryRootSpan";function Ot(t){return t[Ct]||t}const Rt="production",Dt="_frozenDsc";function kt(t){const n=at();if(!n)return{};const e=Ot(t),r=Tt(e),o=r.data,s=e.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[ht];function c(t){return"number"!=typeof i&&"string"!=typeof i||(t.sample_rate=`${i}`),t}const u=e[Dt];if(u)return c(u);const a=s?.get("sentry.dsc"),f=a&&wt(a);if(f)return c(f);const h=function(t,n){const e=n.getOptions(),{publicKey:r}=n.getDsn()||{},o=L({environment:e.environment||Rt,release:e.release,public_key:r,trace_id:t});return n.emit("createDsc",o),o}(t.spanContext().traceId,n),p=o[ft],d=r.description;return"url"!==p&&d&&(h.transaction=d),function(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const n=at(),e=n?.getOptions();return!(!e||null==e.tracesSampleRate&&!e.tracesSampler)}()&&(h.sampled=String(function(t){const{traceFlags:n}=t.spanContext();return n===$t}(e)),h.sample_rand=s?.get("sentry.sample_rand")??bt(e).scope?.getPropagationContext().sampleRand.toString()),c(h),n.emit("createDsc",h,e),h}function At(t,n=!1){const{host:e,path:r,pass:o,port:s,projectId:i,protocol:c,publicKey:u}=t;return`${c}://${u}${n&&o?`:${o}`:""}@${e}${s?`:${s}`:""}/${r?`${r}/`:r}${i}`}function It(t,n=100,e=1/0){try{return Pt("",t,n,e)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function Pt(t,n,e=1/0,r=1/0,o=function(){const t=new WeakSet;function n(n){return!!t.has(n)||(t.add(n),!1)}function e(n){t.delete(n)}return[n,e]}()){const[s,i]=o;if(null==n||["boolean","string"].includes(typeof n)||"number"==typeof n&&Number.isFinite(n))return n;const c=function(t,n){try{if("domain"===t&&n&&"object"==typeof n&&n.J)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if("undefined"!=typeof global&&n===global)return"[Global]";if("undefined"!=typeof window&&n===window)return"[Window]";if("undefined"!=typeof document&&n===document)return"[Document]";if("object"==typeof(e=n)&&null!==e&&(e.__isVue||e.Y))return"[VueViewModel]";if(function(t){return O(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}(n))return"[SyntheticEvent]";if("number"==typeof n&&!Number.isFinite(n))return`[${n}]`;if("function"==typeof n)return`[Function: ${function(t){try{return t&&"function"==typeof t&&t.name||N}catch(t){return N}}(n)}]`;if("symbol"==typeof n)return`[${String(n)}]`;if("bigint"==typeof n)return`[BigInt: ${String(n)}]`;const r=function(t){const n=Object.getPrototypeOf(t);return n?n.constructor.name:"null prototype"}(n);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(t){return`**non-serializable** (${t})`}var e}(t,n);if(!c.startsWith("[object "))return c;if(n.__sentry_skip_normalization__)return n;const u="number"==typeof n.__sentry_override_normalization_depth__?n.__sentry_override_normalization_depth__:e;if(0===u)return c.replace("object ","");if(s(n))return"[Circular ~]";const a=n;if(a&&"function"==typeof a.toJSON)try{return Pt("",a.toJSON(),u-1,r,o)}catch(t){}const f=Array.isArray(n)?[]:{};let h=0;const p=P(n);for(const t in p){if(!Object.prototype.hasOwnProperty.call(p,t))continue;if(h>=r){f[t]="[MaxProperties ~]";break}const n=p[t];f[t]=Pt(t,n,u-1,r,o),h++}return i(n),f}function Ut(t,n){const e=n.replace(/\\/g,"/").replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");let r=t;try{r=decodeURI(t)}catch(t){}return r.replace(/\\/g,"/").replace(/webpack:\/?/g,"").replace(new RegExp(`(file://)?/*${e}/*`,"ig"),"app:///")}function Mt(t,n=[]){return[t,n]}function Lt(t,n){const e=t[1];for(const t of e){if(n(t,t[0].type))return!0}return!1}function Bt(t){const n=g(p);return n.encodePolyfill?n.encodePolyfill(t):(new TextEncoder).encode(t)}function Gt(t){const[n,e]=t;let r=JSON.stringify(n);function o(t){"string"==typeof r?r="string"==typeof t?r+t:[Bt(r),t]:r.push("string"==typeof t?Bt(t):t)}for(const t of e){const[n,e]=t;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch(n){t=JSON.stringify(It(e))}o(t)}}return"string"==typeof r?r:function(t){const n=t.reduce(((t,n)=>t+n.length),0),e=new Uint8Array(n);let r=0;for(const n of t)e.set(n,r),r+=n.length;return e}(r)}const Jt={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security"};function Yt(t){if(!t?.sdk)return;const{name:n,version:e}=t.sdk;return{name:n,version:e}}function zt(t,n,e,r){const o=Yt(e),s=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,n){n&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||n.name,t.sdk.version=t.sdk.version||n.version,t.sdk.integrations=[...t.sdk.integrations||[],...n.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...n.packages||[]])}(t,e?.sdk);const i=function(t,n,e,r){const o=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&{sdk:n},...!!e&&r&&{dsn:At(r)},...o&&{trace:L({...o})}}}(t,o,r,n);delete t.sdkProcessingMetadata;return Mt(i,[[{type:s},t]])}const Ht="__SENTRY_SUPPRESS_TRACING__";function Wt(t){const n=ut(m());return n.suppressTracing?n.suppressTracing(t):function(...t){const n=ut(m());if(2===t.length){const[e,r]=t;return e?n.withSetScope(e,r):n.withScope(r)}return n.withScope(t[0])}((n=>(n.setSDKProcessingMetadata({[Ht]:!0}),t())))}function Ft(t,n){const{fingerprint:e,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=n;!function(t,n){const{extra:e,tags:r,user:o,contexts:s,level:i,transactionName:c}=n,u=L(e);Object.keys(u).length&&(t.extra={...u,...t.extra});const a=L(r);Object.keys(a).length&&(t.tags={...a,...t.tags});const f=L(o);Object.keys(f).length&&(t.user={...f,...t.user});const h=L(s);Object.keys(h).length&&(t.contexts={...h,...t.contexts});i&&(t.level=i);c&&"transaction"!==t.type&&(t.transaction=c)}(t,n),r&&function(t,n){t.contexts={trace:Et(n),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:kt(n),...t.sdkProcessingMetadata};const e=Ot(n),r=Tt(e).description;r&&!t.transaction&&"transaction"===t.type&&(t.transaction=r)}(t,r),function(t,n){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],n&&(t.fingerprint=t.fingerprint.concat(n));t.fingerprint.length||delete t.fingerprint}(t,e),function(t,n){const e=[...t.breadcrumbs||[],...n];t.breadcrumbs=e.length?e:void 0}(t,o),function(t,n){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...n}}(t,s)}const Kt="7";class Vt extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function Zt(t){const n=[];function e(t){return n.splice(n.indexOf(t),1)[0]||Promise.resolve(void 0)}return{$:n,add:function(r){if(!(void 0===t||n.length<t))return o=new Vt("Not adding Promise because buffer limit was reached."),new F(((t,n)=>{n(o)}));var o;const s=r();return-1===n.indexOf(s)&&n.push(s),s.then((()=>e(s))).then(null,(()=>e(s).then(null,(()=>{})))),s},drain:function(t){return new F(((e,r)=>{let o=n.length;if(!o)return e(!0);const s=setTimeout((()=>{t&&t>0&&e(!1)}),t);n.forEach((t=>{W(t).then((()=>{--o||(clearTimeout(s),e(!0))}),r)}))}))}}}const qt=6e4;function Qt(t,{statusCode:n,headers:e},r=Date.now()){const o={...t},s=e?.["x-sentry-rate-limits"],i=e?.["retry-after"];if(s)for(const t of s.trim().split(",")){const[n,e,,,s]=t.split(":",5),i=parseInt(n,10),c=1e3*(isNaN(i)?60:i);if(e)for(const t of e.split(";"))"metric_bucket"===t&&s&&!s.split(";").includes("custom")||(o[t]=r+c);else o.all=r+c}else i?o.all=r+function(t,n=Date.now()){const e=parseInt(`${t}`,10);if(!isNaN(e))return 1e3*e;const r=Date.parse(`${t}`);return isNaN(r)?qt:r-n}(i,r):429===n&&(o.all=r+6e4);return o}const Xt=64;function tn(t,n,e=Zt(t.bufferSize||Xt)){let r={};return{send:function(t){const o=[];if(Lt(t,((t,n)=>{const e=function(t){return Jt[t]}(n);(function(t,n,e=Date.now()){return function(t,n){return t[n]||t.all||0}(t,n)>e})(r,e)||o.push(t)})),0===o.length)return W({});const s=Mt(t[0],o),i=t=>{Lt(s,((t,n)=>{}))};return e.add((()=>n({body:Gt(s)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&&h&&w.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),r=Qt(r,t),t)),(t=>{throw i(),t})))).then((t=>t),(t=>{if(t instanceof Vt)return h&&w.error("Skipped sending event because buffer is full."),i(),W({});throw t}))},flush:t=>e.drain(t)}}const nn=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function en(t){const n=function(t){const n=t.length>1024?`<truncated>${t.slice(-1024)}`:t,e=nn.exec(n);return e?e.slice(1):[]}(t),e=n[0]||"";let r=n[1];return e||r?(r&&(r=r.slice(0,r.length-1)),e+r):"."}function rn(t,n=!1){return!(n||t&&!t.startsWith("/")&&!t.match(/^[A-Z]:/)&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&void 0!==t&&!t.includes("node_modules/")}const on=Symbol("AgentBaseInternalState");class sn extends s.Agent{constructor(t){super(t),this[on]={}}isSecureEndpoint(t){if(t){if("boolean"==typeof t.secureEndpoint)return t.secureEndpoint;if("string"==typeof t.protocol)return"https:"===t.protocol}const{stack:n}=new Error;return"string"==typeof n&&n.split("\n").some((t=>-1!==t.indexOf("(https.js:")||-1!==t.indexOf("node:https:")))}createSocket(t,n,e){const r={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then((()=>this.connect(t,r))).then((o=>{if(o instanceof s.Agent)return o.addRequest(t,r);this[on].currentSocket=o,super.createSocket(t,n,e)}),e)}createConnection(){const t=this[on].currentSocket;if(this[on].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[on].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(t){this[on]&&(this[on].defaultPort=t)}get protocol(){return this[on].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[on]&&(this[on].protocol=t)}}function cn(...t){w.log("[https-proxy-agent:parse-proxy-response]",...t)}function un(t){return new Promise(((n,e)=>{let r=0;const o=[];function s(){const c=t.read();c?function(c){o.push(c),r+=c.length;const u=Buffer.concat(o,r),a=u.indexOf("\r\n\r\n");if(-1===a)return cn("have not received end of HTTP headers yet..."),void s();const f=u.subarray(0,a).toString("ascii").split("\r\n"),h=f.shift();if(!h)return t.destroy(),e(new Error("No header received from proxy CONNECT response"));const p=h.split(" "),d=+(p[1]||0),l=p.slice(2).join(" "),m={};for(const n of f){if(!n)continue;const r=n.indexOf(":");if(-1===r)return t.destroy(),e(new Error(`Invalid header from proxy CONNECT response: "${n}"`));const o=n.slice(0,r).toLowerCase(),s=n.slice(r+1).trimStart(),i=m[o];"string"==typeof i?m[o]=[i,s]:Array.isArray(i)?i.push(s):m[o]=s}cn("got proxy server response: %o %o",h,m),i(),n({connect:{statusCode:d,statusText:l,headers:m},buffered:u})}(c):t.once("readable",s)}function i(){t.removeListener("end",c),t.removeListener("error",u),t.removeListener("readable",s)}function c(){i(),cn("onend"),e(new Error("Proxy connection ended before receiving CONNECT response"))}function u(t){i(),cn("onerror %o",t),e(t)}t.on("error",u),t.on("end",c),s()}))}function an(...t){w.log("[https-proxy-agent]",...t)}class fn extends sn{static __initStatic(){this.protocols=["http","https"]}constructor(t,n){super(n),this.options={},this.proxy="string"==typeof t?new URL(t):t,this.proxyHeaders=n?.headers??{},an("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const e=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?pn(n,"headers"):null,host:e,port:r}}async connect(t,n){const{proxy:e}=this;if(!n.host)throw new TypeError('No "host" provided');let r;if("https:"===e.protocol){an("Creating `tls.Socket`: %o",this.connectOpts);const t=this.connectOpts.servername||this.connectOpts.host;r=f.connect({...this.connectOpts,servername:t&&a.isIP(t)?void 0:t})}else an("Creating `net.Socket`: %o",this.connectOpts),r=a.connect(this.connectOpts);const o="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},s=a.isIPv6(n.host)?`[${n.host}]`:n.host;let i=`CONNECT ${s}:${n.port} HTTP/1.1\r\n`;if(e.username||e.password){const t=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(t).toString("base64")}`}o.Host=`${s}:${n.port}`,o["Proxy-Connection"]||(o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const t of Object.keys(o))i+=`${t}: ${o[t]}\r\n`;const c=un(r);r.write(`${i}\r\n`);const{connect:u,buffered:h}=await c;if(t.emit("proxyConnect",u),this.emit("proxyConnect",u,t),200===u.statusCode){if(t.once("socket",hn),n.secureEndpoint){an("Upgrading socket connection to TLS");const t=n.servername||n.host;return f.connect({...pn(n,"host","path","port"),socket:r,servername:a.isIP(t)?void 0:t})}return r}r.destroy();const p=new a.Socket({writable:!1});return p.readable=!0,t.once("socket",(t=>{an("Replaying proxy buffer for failed request"),t.push(h),t.push(null)})),p}}function hn(t){t.resume()}function pn(t,...n){const e={};let r;for(r in t)n.includes(r)||(e[r]=t[r]);return e}fn.__initStatic();const dn=32768;function ln(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}const mn=e;let gn,yn=0,bn={};function _n(t){mn.debug&&console.log(`[ANR Worker] ${t}`)}var vn,wn,Sn;const $n=function(t){let n;try{n=new URL(t.url)}catch(n){return v((()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")})),tn(t,(()=>Promise.resolve({})))}const e="https:"===n.protocol,r=function(t,n){const{no_proxy:e}=process.env,r=e?.split(",").some((n=>t.host.endsWith(n)||t.hostname.endsWith(n)));return r?void 0:n}(n,t.proxy||(e?process.env.https_proxy:void 0)||process.env.http_proxy),o=e?i:s,a=void 0!==t.keepAlive&&t.keepAlive,f=r?new fn(r):new o.Agent({keepAlive:a,maxSockets:30,timeout:2e3}),h=function(t,n,e){const{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(f){return new Promise(((h,p)=>{Wt((()=>{let d=function(t){return new c({read(){this.push(t),this.push(null)}})}(f.body);const l={...t.headers};f.body.length>dn&&(l["content-encoding"]="gzip",d=d.pipe(u()));const m=n.request({method:"POST",agent:e,headers:l,hostname:r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},(t=>{t.on("data",(()=>{})),t.on("end",(()=>{})),t.setEncoding("utf8");const n=t.headers["retry-after"]??null,e=t.headers["x-sentry-rate-limits"]??null;h({statusCode:t.statusCode,headers:{"retry-after":n,"x-sentry-rate-limits":Array.isArray(e)?e[0]||null:e}})}));m.on("error",p),d.pipe(m)}))}))}}(t,t.httpModule??o,f);return tn(t,h)}({url:(vn=mn.dsn,wn=mn.tunnel,Sn=mn.sdkMetadata.sdk,wn||`${function(t){return`${function(t){const n=t.protocol?`${t.protocol}:`:"",e=t.port?`:${t.port}`:"";return`${n}//${t.host}${e}${t.path?`/${t.path}`:""}/api/`}(t)}${t.projectId}/envelope/`}(vn)}?${function(t,n){const e={sentry_version:Kt};return t.publicKey&&(e.sentry_key=t.publicKey),n&&(e.sentry_client=`${n.name}/${n.version}`),new URLSearchParams(e).toString()}(vn,Sn)}`),recordDroppedEvent:()=>{}});async function En(){if(gn){_n("Sending abnormal session"),V(gn,{status:"abnormal",abnormal_mechanism:"anr_foreground"});const t=function(t,n,e,r){const o=Yt(e);return Mt({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&n&&{dsn:At(n)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(gn,mn.dsn,mn.sdkMetadata,mn.tunnel);_n(JSON.stringify(t)),await $n.send(t);try{n?.postMessage("session-ended")}catch(t){}}}function xn(t){if(!t)return;const n=function(t){if(!t.length)return[];const n=Array.from(t);return/sentryWrapped/.test(x(n).function||"")&&n.pop(),n.reverse(),E.test(x(n).function||"")&&(n.pop(),E.test(x(n).function||"")&&n.pop()),n.slice(0,S).map((t=>({...t,filename:t.filename||x(n).filename,function:t.function||$})))}(t);if(mn.appRootPath)for(const t of n)t.filename&&(t.filename=Ut(t.filename,mn.appRootPath));return n}async function Nn(t,n){if(yn>=mn.maxAnrEvents)return;yn+=1,await En(),_n("Sending event");const e={event_id:z(),contexts:mn.contexts,release:mn.release,environment:mn.environment,dist:mn.dist,platform:"node",level:"error",exception:{values:[{type:"ApplicationNotResponding",value:`Application Not Responding for at least ${mn.anrThreshold} ms`,stacktrace:{frames:xn(t)},mechanism:{type:"ANR"}}]},tags:mn.staticTags};n&&function(t,n){if(Ft(t,n),!t.contexts?.trace){const{traceId:e,parentSpanId:r,propagationSpanId:o}=n.propagationContext;t.contexts={trace:{trace_id:e,span_id:o||q(),parent_span_id:r},...t.contexts}}}(e,n),function(t){if(0===Object.keys(bn).length)return;const n=mn.appRootPath?{}:bn;if(mn.appRootPath)for(const[t,e]of Object.entries(bn))n[Ut(t,mn.appRootPath)]=e;const e=new Map;for(const r of t.exception?.values||[])for(const t of r.stacktrace?.frames||[]){const r=t.abs_path||t.filename;r&&n[r]&&e.set(r,n[r])}if(e.size>0){const n=[];for(const[t,r]of e.entries())n.push({type:"sourcemap",code_file:t,debug_id:r});t.debug_meta={images:n}}}(e);const r=zt(e,mn.dsn,mn.sdkMetadata,mn.tunnel);_n(JSON.stringify(r)),await $n.send(r),await $n.flush(2e3),yn>=mn.maxAnrEvents&&setTimeout((()=>{process.exit(0)}),5e3)}let Tn;if(_n("Started"),mn.captureStackTrace){_n("Connecting to debugger");const n=new t;n.connectToMainThread(),_n("Connected to debugger");const e=new Map;n.on("Debugger.scriptParsed",(t=>{e.set(t.params.scriptId,t.params.url)})),n.on("Debugger.paused",(t=>{if("other"===t.params.reason)try{_n("Debugger paused");const s=[...t.params.callFrames],i=mn.appRootPath?function(t=(process.argv[1]?en(process.argv[1]):process.cwd()),n="\\"===o){const e=n?ln(t):t;return t=>{if(!t)return;const o=n?ln(t):t;let{dir:s,base:i,ext:c}=r.parse(o);".js"!==c&&".mjs"!==c&&".cjs"!==c||(i=i.slice(0,-1*c.length));const u=decodeURIComponent(i);s||(s=".");const a=s.lastIndexOf("/node_modules");if(a>-1)return`${s.slice(a+14).replace(/\//g,".")}:${u}`;if(s.startsWith(e)){const t=s.slice(e.length+1).replace(/\//g,".");return t?`${t}:${u}`:u}return u}}(mn.appRootPath):()=>{},c=s.map((t=>function(t,n,e){const r=n?n.replace(/^file:\/\//,""):void 0,o=t.location.columnNumber?t.location.columnNumber+1:void 0,s=t.location.lineNumber?t.location.lineNumber+1:void 0;return L({filename:r,module:e(r),function:t.functionName||$,colno:o,lineno:s,in_app:r?rn(r):void 0})}(t,e.get(t.location.scriptId),i))),u=setTimeout((()=>{Nn(c).then(null,(()=>{_n("Sending ANR event failed.")}))}),5e3);n.post("Runtime.evaluate",{expression:"global.__SENTRY_GET_SCOPES__();",silent:!0,returnByValue:!0},((t,e)=>{t&&_n(`Error executing script: '${t.message}'`),clearTimeout(u);const r=e?.result?e.result.value:void 0;n.post("Debugger.resume"),n.post("Debugger.disable"),Nn(c,r).then(null,(()=>{_n("Sending ANR event failed.")}))}))}catch(t){throw n.post("Debugger.resume"),n.post("Debugger.disable"),t}})),Tn=()=>{try{n.post("Debugger.enable",(()=>{n.post("Debugger.pause")}))}catch(t){}}}const{poll:jn}=function(t,n,e,r){const o=t();let s=!1,i=!0;return setInterval((()=>{const t=o.getTimeMs();!1===s&&t>n+e&&(s=!0,i&&r()),t<n+e&&(s=!1)}),20),{poll:()=>{o.reset()},enabled:t=>{i=t}}}((function(){let t=process.hrtime();return{getTimeMs:()=>{const[n,e]=process.hrtime(t);return Math.floor(1e3*n+e/1e6)},reset:()=>{t=process.hrtime()}}}),mn.pollInterval,mn.anrThreshold,(function(){_n("Watchdog timeout"),Tn?(_n("Pausing debugger to capture stack trace"),Tn()):(_n("Capturing event without a stack trace"),Nn().then(null,(()=>{_n("Sending ANR event failed on watchdog timeout.")})))}));n?.on("message",(t=>{t.session&&(gn=K(t.session)),t.debugImages&&(bn=t.debugImages),jn()}));
@@ -1,40 +1,30 @@
1
1
  import * as diagnosticsChannel from 'node:diagnostics_channel';
2
- import { defineIntegration, addBreadcrumb } from '@sentry/core';
2
+ import { defineIntegration, addBreadcrumb, captureException } from '@sentry/core';
3
3
 
4
- // TODO(v9): Update this name and mention in migration docs.
5
- const INTEGRATION_NAME = 'ProcessAndThreadBreadcrumbs';
4
+ const INTEGRATION_NAME = 'ChildProcess';
6
5
 
7
6
  /**
8
- * Capture breadcrumbs for child processes and worker threads.
7
+ * Capture breadcrumbs and events for child processes and worker threads.
9
8
  */
10
9
  const childProcessIntegration = defineIntegration((options = {}) => {
11
10
  return {
12
11
  name: INTEGRATION_NAME,
13
- setup(_client) {
14
- // eslint-disable-next-line deprecation/deprecation
12
+ setup() {
15
13
  diagnosticsChannel.channel('child_process').subscribe((event) => {
16
14
  if (event && typeof event === 'object' && 'process' in event) {
17
15
  captureChildProcessEvents(event.process , options);
18
16
  }
19
17
  });
20
18
 
21
- // eslint-disable-next-line deprecation/deprecation
22
19
  diagnosticsChannel.channel('worker_threads').subscribe((event) => {
23
20
  if (event && typeof event === 'object' && 'worker' in event) {
24
- captureWorkerThreadEvents(event.worker );
21
+ captureWorkerThreadEvents(event.worker , options);
25
22
  }
26
23
  });
27
24
  },
28
25
  };
29
26
  });
30
27
 
31
- /**
32
- * Capture breadcrumbs for child processes and worker threads.
33
- *
34
- * @deprecated Use `childProcessIntegration` integration instead. Functionally they are the same. `processThreadBreadcrumbIntegration` will be removed in the next major version.
35
- */
36
- const processThreadBreadcrumbIntegration = childProcessIntegration;
37
-
38
28
  function captureChildProcessEvents(child, options) {
39
29
  let hasExited = false;
40
30
  let data;
@@ -61,7 +51,7 @@ function captureChildProcessEvents(child, options) {
61
51
  addBreadcrumb({
62
52
  category: 'child_process',
63
53
  message: `Child process exited with code '${code}'`,
64
- level: 'warning',
54
+ level: code === 0 ? 'info' : 'warning',
65
55
  data,
66
56
  });
67
57
  }
@@ -81,7 +71,7 @@ function captureChildProcessEvents(child, options) {
81
71
  });
82
72
  }
83
73
 
84
- function captureWorkerThreadEvents(worker) {
74
+ function captureWorkerThreadEvents(worker, options) {
85
75
  let threadId;
86
76
 
87
77
  worker
@@ -89,14 +79,20 @@ function captureWorkerThreadEvents(worker) {
89
79
  threadId = worker.threadId;
90
80
  })
91
81
  .on('error', error => {
92
- addBreadcrumb({
93
- category: 'worker_thread',
94
- message: `Worker thread errored with '${error.message}'`,
95
- level: 'error',
96
- data: { threadId },
97
- });
82
+ if (options.captureWorkerErrors !== false) {
83
+ captureException(error, {
84
+ mechanism: { type: 'instrument', handled: false, data: { threadId: String(threadId) } },
85
+ });
86
+ } else {
87
+ addBreadcrumb({
88
+ category: 'worker_thread',
89
+ message: `Worker thread errored with '${error.message}'`,
90
+ level: 'error',
91
+ data: { threadId },
92
+ });
93
+ }
98
94
  });
99
95
  }
100
96
 
101
- export { childProcessIntegration, processThreadBreadcrumbIntegration };
97
+ export { childProcessIntegration };
102
98
  //# sourceMappingURL=childProcess.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"childProcess.js","sources":["../../../src/integrations/childProcess.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { Worker } from 'node:worker_threads';\nimport { addBreadcrumb, defineIntegration } from '@sentry/core';\n\ninterface Options {\n /**\n * Whether to include child process arguments in breadcrumbs data.\n *\n * @default false\n */\n includeChildProcessArgs?: boolean;\n}\n\n// TODO(v9): Update this name and mention in migration docs.\nconst INTEGRATION_NAME = 'ProcessAndThreadBreadcrumbs';\n\n/**\n * Capture breadcrumbs for child processes and worker threads.\n */\nexport const childProcessIntegration = defineIntegration((options: Options = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup(_client) {\n // eslint-disable-next-line deprecation/deprecation\n diagnosticsChannel.channel('child_process').subscribe((event: unknown) => {\n if (event && typeof event === 'object' && 'process' in event) {\n captureChildProcessEvents(event.process as ChildProcess, options);\n }\n });\n\n // eslint-disable-next-line deprecation/deprecation\n diagnosticsChannel.channel('worker_threads').subscribe((event: unknown) => {\n if (event && typeof event === 'object' && 'worker' in event) {\n captureWorkerThreadEvents(event.worker as Worker);\n }\n });\n },\n };\n});\n\n/**\n * Capture breadcrumbs for child processes and worker threads.\n *\n * @deprecated Use `childProcessIntegration` integration instead. Functionally they are the same. `processThreadBreadcrumbIntegration` will be removed in the next major version.\n */\nexport const processThreadBreadcrumbIntegration = childProcessIntegration;\n\nfunction captureChildProcessEvents(child: ChildProcess, options: Options): void {\n let hasExited = false;\n let data: Record<string, unknown> | undefined;\n\n child\n .on('spawn', () => {\n // This is Sentry getting macOS OS context\n if (child.spawnfile === '/usr/bin/sw_vers') {\n hasExited = true;\n return;\n }\n\n data = { spawnfile: child.spawnfile };\n if (options.includeChildProcessArgs) {\n data.spawnargs = child.spawnargs;\n }\n })\n .on('exit', code => {\n if (!hasExited) {\n hasExited = true;\n\n // Only log for non-zero exit codes\n if (code !== null && code !== 0) {\n addBreadcrumb({\n category: 'child_process',\n message: `Child process exited with code '${code}'`,\n level: 'warning',\n data,\n });\n }\n }\n })\n .on('error', error => {\n if (!hasExited) {\n hasExited = true;\n\n addBreadcrumb({\n category: 'child_process',\n message: `Child process errored with '${error.message}'`,\n level: 'error',\n data,\n });\n }\n });\n}\n\nfunction captureWorkerThreadEvents(worker: Worker): void {\n let threadId: number | undefined;\n\n worker\n .on('online', () => {\n threadId = worker.threadId;\n })\n .on('error', error => {\n addBreadcrumb({\n category: 'worker_thread',\n message: `Worker thread errored with '${error.message}'`,\n level: 'error',\n data: { threadId },\n });\n });\n}\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"childProcess.js","sources":["../../../src/integrations/childProcess.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { Worker } from 'node:worker_threads';\nimport { addBreadcrumb, captureException, defineIntegration } from '@sentry/core';\n\ninterface Options {\n /**\n * Whether to include child process arguments in breadcrumbs data.\n *\n * @default false\n */\n includeChildProcessArgs?: boolean;\n\n /**\n * Whether to capture errors from worker threads.\n *\n * @default true\n */\n captureWorkerErrors?: boolean;\n}\n\nconst INTEGRATION_NAME = 'ChildProcess';\n\n/**\n * Capture breadcrumbs and events for child processes and worker threads.\n */\nexport const childProcessIntegration = defineIntegration((options: Options = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup() {\n diagnosticsChannel.channel('child_process').subscribe((event: unknown) => {\n if (event && typeof event === 'object' && 'process' in event) {\n captureChildProcessEvents(event.process as ChildProcess, options);\n }\n });\n\n diagnosticsChannel.channel('worker_threads').subscribe((event: unknown) => {\n if (event && typeof event === 'object' && 'worker' in event) {\n captureWorkerThreadEvents(event.worker as Worker, options);\n }\n });\n },\n };\n});\n\nfunction captureChildProcessEvents(child: ChildProcess, options: Options): void {\n let hasExited = false;\n let data: Record<string, unknown> | undefined;\n\n child\n .on('spawn', () => {\n // This is Sentry getting macOS OS context\n if (child.spawnfile === '/usr/bin/sw_vers') {\n hasExited = true;\n return;\n }\n\n data = { spawnfile: child.spawnfile };\n if (options.includeChildProcessArgs) {\n data.spawnargs = child.spawnargs;\n }\n })\n .on('exit', code => {\n if (!hasExited) {\n hasExited = true;\n\n // Only log for non-zero exit codes\n if (code !== null && code !== 0) {\n addBreadcrumb({\n category: 'child_process',\n message: `Child process exited with code '${code}'`,\n level: code === 0 ? 'info' : 'warning',\n data,\n });\n }\n }\n })\n .on('error', error => {\n if (!hasExited) {\n hasExited = true;\n\n addBreadcrumb({\n category: 'child_process',\n message: `Child process errored with '${error.message}'`,\n level: 'error',\n data,\n });\n }\n });\n}\n\nfunction captureWorkerThreadEvents(worker: Worker, options: Options): void {\n let threadId: number | undefined;\n\n worker\n .on('online', () => {\n threadId = worker.threadId;\n })\n .on('error', error => {\n if (options.captureWorkerErrors !== false) {\n captureException(error, {\n mechanism: { type: 'instrument', handled: false, data: { threadId: String(threadId) } },\n });\n } else {\n addBreadcrumb({\n category: 'worker_thread',\n message: `Worker thread errored with '${error.message}'`,\n level: 'error',\n data: { threadId },\n });\n }\n });\n}\n"],"names":[],"mappings":"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"}
@@ -1,4 +1,3 @@
1
- import { _optionalChain } from '@sentry/core';
2
1
  import { execFile } from 'node:child_process';
3
2
  import { readFile, readdir } from 'node:fs';
4
3
  import * as os from 'node:os';
@@ -8,6 +7,7 @@ import { defineIntegration } from '@sentry/core';
8
7
 
9
8
  /* eslint-disable max-lines */
10
9
 
10
+
11
11
  const readFileAsync = promisify(readFile);
12
12
  const readDirAsync = promisify(readdir);
13
13
 
@@ -38,11 +38,11 @@ const _nodeContextIntegration = ((options = {}) => {
38
38
 
39
39
  event.contexts = {
40
40
  ...event.contexts,
41
- app: { ...updatedContext.app, ..._optionalChain([event, 'access', _ => _.contexts, 'optionalAccess', _2 => _2.app]) },
42
- os: { ...updatedContext.os, ..._optionalChain([event, 'access', _3 => _3.contexts, 'optionalAccess', _4 => _4.os]) },
43
- device: { ...updatedContext.device, ..._optionalChain([event, 'access', _5 => _5.contexts, 'optionalAccess', _6 => _6.device]) },
44
- culture: { ...updatedContext.culture, ..._optionalChain([event, 'access', _7 => _7.contexts, 'optionalAccess', _8 => _8.culture]) },
45
- cloud_resource: { ...updatedContext.cloud_resource, ..._optionalChain([event, 'access', _9 => _9.contexts, 'optionalAccess', _10 => _10.cloud_resource]) },
41
+ app: { ...updatedContext.app, ...event.contexts?.app },
42
+ os: { ...updatedContext.os, ...event.contexts?.os },
43
+ device: { ...updatedContext.device, ...event.contexts?.device },
44
+ culture: { ...updatedContext.culture, ...event.contexts?.culture },
45
+ cloud_resource: { ...updatedContext.cloud_resource, ...event.contexts?.cloud_resource },
46
46
  };
47
47
 
48
48
  return event;
@@ -98,18 +98,18 @@ const nodeContextIntegration = defineIntegration(_nodeContextIntegration);
98
98
  function _updateContext(contexts) {
99
99
  // Only update properties if they exist
100
100
 
101
- if (_optionalChain([contexts, 'optionalAccess', _11 => _11.app, 'optionalAccess', _12 => _12.app_memory])) {
101
+ if (contexts.app?.app_memory) {
102
102
  contexts.app.app_memory = process.memoryUsage().rss;
103
103
  }
104
104
 
105
- if (_optionalChain([contexts, 'optionalAccess', _13 => _13.app, 'optionalAccess', _14 => _14.free_memory]) && typeof (process ).availableMemory === 'function') {
106
- const freeMemory = _optionalChain([(process ), 'access', _15 => _15.availableMemory, 'optionalCall', _16 => _16()]);
105
+ if (contexts.app?.free_memory && typeof (process ).availableMemory === 'function') {
106
+ const freeMemory = (process ).availableMemory?.();
107
107
  if (freeMemory != null) {
108
108
  contexts.app.free_memory = freeMemory;
109
109
  }
110
110
  }
111
111
 
112
- if (_optionalChain([contexts, 'optionalAccess', _17 => _17.device, 'optionalAccess', _18 => _18.free_memory])) {
112
+ if (contexts.device?.free_memory) {
113
113
  contexts.device.free_memory = os.freemem();
114
114
  }
115
115
 
@@ -183,7 +183,7 @@ function getAppContext() {
183
183
  const appContext = { app_start_time, app_memory };
184
184
 
185
185
  if (typeof (process ).availableMemory === 'function') {
186
- const freeMemory = _optionalChain([(process ), 'access', _19 => _19.availableMemory, 'optionalCall', _20 => _20()]);
186
+ const freeMemory = (process ).availableMemory?.();
187
187
  if (freeMemory != null) {
188
188
  appContext.free_memory = freeMemory;
189
189
  }
@@ -201,7 +201,7 @@ function getDeviceContext(deviceOpt) {
201
201
  // Sometimes os.uptime() throws due to lacking permissions: https://github.com/getsentry/sentry-javascript/issues/8202
202
202
  let uptime;
203
203
  try {
204
- uptime = os.uptime && os.uptime();
204
+ uptime = os.uptime();
205
205
  } catch (e) {
206
206
  // noop
207
207
  }
@@ -221,8 +221,8 @@ function getDeviceContext(deviceOpt) {
221
221
  }
222
222
 
223
223
  if (deviceOpt === true || deviceOpt.cpu) {
224
- const cpuInfo = os.cpus();
225
- const firstCpu = cpuInfo && cpuInfo[0];
224
+ const cpuInfo = os.cpus() ;
225
+ const firstCpu = cpuInfo?.[0];
226
226
  if (firstCpu) {
227
227
  device.processor_count = cpuInfo.length;
228
228
  device.cpu_description = firstCpu.model;
@@ -369,7 +369,7 @@ async function getLinuxInfo() {
369
369
  // number. This is different for every distribution, so several strategies
370
370
  // are computed in `LINUX_VERSIONS`.
371
371
  const id = getLinuxDistroId(linuxInfo.name);
372
- linuxInfo.version = _optionalChain([LINUX_VERSIONS, 'access', _21 => _21[id], 'optionalCall', _22 => _22(contents)]);
372
+ linuxInfo.version = LINUX_VERSIONS[id]?.(contents);
373
373
  } catch (e) {
374
374
  // ignore
375
375
  }