@cloudflare/vite-plugin 0.0.1 → 0.0.3

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.
@@ -1,7 +1,7 @@
1
1
  // ../workers-shared/dist/router-worker.mjs
2
2
  var Pn = Object.defineProperty;
3
- var Cn = (t, e, n) => e in t ? Pn(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
4
- var fe = (t, e, n) => (Cn(t, typeof e != "symbol" ? e + "" : e, n), n);
3
+ var Mn = (t, e, n) => e in t ? Pn(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
4
+ var fe = (t, e, n) => (Mn(t, typeof e != "symbol" ? e + "" : e, n), n);
5
5
  var bt = (t, e, n) => {
6
6
  if (!e.has(t)) throw TypeError("Cannot " + n);
7
7
  };
@@ -10,7 +10,7 @@ var Rt = (t, e, n) => {
10
10
  if (e.has(t)) throw TypeError("Cannot add the same private member more than once");
11
11
  e instanceof WeakSet ? e.add(t) : e.set(t, n);
12
12
  };
13
- var xt = (t, e, n, r) => (bt(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n);
13
+ var It = (t, e, n, r) => (bt(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n);
14
14
  var pe = class {
15
15
  constructor(e) {
16
16
  this.performanceTimer = e;
@@ -19,9 +19,9 @@ var pe = class {
19
19
  return this.performanceTimer ? this.performanceTimer.timeOrigin + this.performanceTimer.now() : Date.now();
20
20
  }
21
21
  };
22
- var It = Object.prototype.toString;
22
+ var xt = Object.prototype.toString;
23
23
  function U(t) {
24
- switch (It.call(t)) {
24
+ switch (xt.call(t)) {
25
25
  case "[object Error]":
26
26
  case "[object Exception]":
27
27
  case "[object DOMException]":
@@ -31,7 +31,7 @@ function U(t) {
31
31
  }
32
32
  }
33
33
  function Dt(t, e) {
34
- return It.call(t) === `[object ${e}]`;
34
+ return xt.call(t) === `[object ${e}]`;
35
35
  }
36
36
  function j(t) {
37
37
  return Dt(t, "String");
@@ -67,7 +67,7 @@ function O(t, e) {
67
67
  function qe(t) {
68
68
  return !!(typeof t == "object" && t !== null && (t.__isVue || t._isVue));
69
69
  }
70
- function w(t, e = 0) {
70
+ function v(t, e = 0) {
71
71
  return typeof t != "string" || e === 0 || t.length <= e ? t : `${t.slice(0, e)}...`;
72
72
  }
73
73
  function me(t) {
@@ -76,26 +76,26 @@ function me(t) {
76
76
  var m = typeof globalThis == "object" && me(globalThis) || typeof window == "object" && me(window) || typeof self == "object" && me(self) || typeof global == "object" && me(global) || /* @__PURE__ */ function() {
77
77
  return this;
78
78
  }() || {};
79
- function I() {
79
+ function x() {
80
80
  return m;
81
81
  }
82
82
  function Q(t, e, n) {
83
83
  let r = n || m, s = r.__SENTRY__ = r.__SENTRY__ || {};
84
84
  return s[t] || (s[t] = e());
85
85
  }
86
- var us = I();
87
- var Mn = 80;
86
+ var fs = x();
87
+ var Un = 80;
88
88
  function Nt(t, e = {}) {
89
89
  if (!t) return "<unknown>";
90
90
  try {
91
- let n = t, r = 5, s = [], i = 0, o = 0, a = " > ", c = a.length, u, f = Array.isArray(e) ? e : e.keyAttrs, d = !Array.isArray(e) && e.maxStringLength || Mn;
92
- for (; n && i++ < r && (u = Un(n, f), !(u === "html" || i > 1 && o + s.length * c + u.length >= d)); ) s.push(u), o += u.length, n = n.parentNode;
91
+ let n = t, r = 5, s = [], i = 0, o = 0, a = " > ", c = a.length, u, f = Array.isArray(e) ? e : e.keyAttrs, d = !Array.isArray(e) && e.maxStringLength || Un;
92
+ for (; n && i++ < r && (u = Gn(n, f), !(u === "html" || i > 1 && o + s.length * c + u.length >= d)); ) s.push(u), o += u.length, n = n.parentNode;
93
93
  return s.reverse().join(a);
94
94
  } catch {
95
95
  return "<unknown>";
96
96
  }
97
97
  }
98
- function Un(t, e) {
98
+ function Gn(t, e) {
99
99
  let n = t, r = [], s, i, o, a, c;
100
100
  if (!n || !n.tagName) return "";
101
101
  r.push(n.tagName.toLowerCase());
@@ -108,7 +108,7 @@ function Un(t, e) {
108
108
  for (c = 0; c < f.length; c++) o = f[c], a = n.getAttribute(o), a && r.push(`[${o}="${a}"]`);
109
109
  return r.join("");
110
110
  }
111
- var Gn = "Sentry Logger ";
111
+ var Fn = "Sentry Logger ";
112
112
  var ee = ["debug", "info", "warn", "error", "log", "assert", "trace"];
113
113
  var H = {};
114
114
  function _e(t) {
@@ -126,7 +126,7 @@ function _e(t) {
126
126
  });
127
127
  }
128
128
  }
129
- function Fn() {
129
+ function Bn() {
130
130
  let t = false, e = { enable: () => {
131
131
  t = true;
132
132
  }, disable: () => {
@@ -135,7 +135,7 @@ function Fn() {
135
135
  return typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__ ? ee.forEach((n) => {
136
136
  e[n] = (...r) => {
137
137
  t && _e(() => {
138
- m.console[n](`${Gn}[${n}]:`, ...r);
138
+ m.console[n](`${Fn}[${n}]:`, ...r);
139
139
  });
140
140
  };
141
141
  }) : ee.forEach((n) => {
@@ -143,17 +143,17 @@ function Fn() {
143
143
  };
144
144
  }), e;
145
145
  }
146
- var p = Fn();
147
- var Bn = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
148
- function Ln(t) {
146
+ var p = Bn();
147
+ var Ln = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
148
+ function Yn(t) {
149
149
  return t === "http" || t === "https";
150
150
  }
151
- function P(t, e = false) {
151
+ function C(t, e = false) {
152
152
  let { host: n, path: r, pass: s, port: i, projectId: o, protocol: a, publicKey: c } = t;
153
153
  return `${a}://${c}${e && s ? `:${s}` : ""}@${n}${i ? `:${i}` : ""}/${r && `${r}/`}${o}`;
154
154
  }
155
155
  function kt(t) {
156
- let e = Bn.exec(t);
156
+ let e = Ln.exec(t);
157
157
  if (!e) {
158
158
  console.error(`Invalid Sentry Dsn: ${t}`);
159
159
  return;
@@ -168,24 +168,24 @@ function kt(t) {
168
168
  function Ot(t) {
169
169
  return { protocol: t.protocol, publicKey: t.publicKey || "", pass: t.pass || "", host: t.host, port: t.port || "", path: t.path || "", projectId: t.projectId };
170
170
  }
171
- function Yn(t) {
171
+ function $n(t) {
172
172
  if (!(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__)) return true;
173
173
  let { port: e, projectId: n, protocol: r } = t;
174
- return ["protocol", "publicKey", "host", "projectId"].find((o) => t[o] ? false : (p.error(`Invalid Sentry Dsn: ${o} missing`), true)) ? false : n.match(/^\d+$/) ? Ln(r) ? e && isNaN(parseInt(e, 10)) ? (p.error(`Invalid Sentry Dsn: Invalid port ${e}`), false) : true : (p.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), false) : (p.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), false);
174
+ return ["protocol", "publicKey", "host", "projectId"].find((o) => t[o] ? false : (p.error(`Invalid Sentry Dsn: ${o} missing`), true)) ? false : n.match(/^\d+$/) ? Yn(r) ? e && isNaN(parseInt(e, 10)) ? (p.error(`Invalid Sentry Dsn: Invalid port ${e}`), false) : true : (p.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), false) : (p.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), false);
175
175
  }
176
176
  function he(t) {
177
177
  let e = typeof t == "string" ? kt(t) : Ot(t);
178
- if (!(!e || !Yn(e))) return e;
178
+ if (!(!e || !$n(e))) return e;
179
179
  }
180
180
  var y = class extends Error {
181
181
  constructor(e, n = "warn") {
182
182
  super(e), this.message = e, this.name = new.target.prototype.constructor.name, Object.setPrototypeOf(this, new.target.prototype), this.logLevel = n;
183
183
  }
184
184
  };
185
- function x(t, e, n) {
185
+ function I(t, e, n) {
186
186
  if (!(e in t)) return;
187
187
  let r = t[e], s = n(r);
188
- typeof s == "function" && wt(s, r), t[e] = s;
188
+ typeof s == "function" && vt(s, r), t[e] = s;
189
189
  }
190
190
  function q(t, e, n) {
191
191
  try {
@@ -194,7 +194,7 @@ function q(t, e, n) {
194
194
  (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(`Failed to add non-enumerable property "${e}" to object`, t);
195
195
  }
196
196
  }
197
- function wt(t, e) {
197
+ function vt(t, e) {
198
198
  try {
199
199
  let n = e.prototype || {};
200
200
  t.prototype = e.prototype = n, q(t, "__sentry_original__", e);
@@ -205,9 +205,9 @@ function We(t) {
205
205
  return Object.keys(t).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&");
206
206
  }
207
207
  function ge(t) {
208
- if (U(t)) return { message: t.message, name: t.name, stack: t.stack, ...vt(t) };
208
+ if (U(t)) return { message: t.message, name: t.name, stack: t.stack, ...wt(t) };
209
209
  if ($e(t)) {
210
- let e = { type: t.type, target: At(t.target), currentTarget: At(t.currentTarget), ...vt(t) };
210
+ let e = { type: t.type, target: At(t.target), currentTarget: At(t.currentTarget), ...wt(t) };
211
211
  return typeof CustomEvent < "u" && O(t, CustomEvent) && (e.detail = t.detail), e;
212
212
  } else return t;
213
213
  }
@@ -218,7 +218,7 @@ function At(t) {
218
218
  return "<unknown>";
219
219
  }
220
220
  }
221
- function vt(t) {
221
+ function wt(t) {
222
222
  if (typeof t == "object" && t !== null) {
223
223
  let e = {};
224
224
  for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
@@ -228,10 +228,10 @@ function vt(t) {
228
228
  function te(t, e = 40) {
229
229
  let n = Object.keys(ge(t));
230
230
  if (n.sort(), !n.length) return "[object has no keys]";
231
- if (n[0].length >= e) return w(n[0], e);
231
+ if (n[0].length >= e) return v(n[0], e);
232
232
  for (let r = n.length; r > 0; r--) {
233
233
  let s = n.slice(0, r).join(", ");
234
- if (!(s.length > e)) return r === n.length ? s : w(s, e);
234
+ if (!(s.length > e)) return r === n.length ? s : v(s, e);
235
235
  }
236
236
  return "";
237
237
  }
@@ -257,10 +257,10 @@ function ze(t, e) {
257
257
  }
258
258
  return t;
259
259
  }
260
- function $n(t, e = false) {
260
+ function jn(t, e = false) {
261
261
  return !(e || t && !t.startsWith("/") && !t.includes(":\\") && !t.startsWith(".") && !t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)) && t !== void 0 && !t.includes("node_modules/");
262
262
  }
263
- function Pt(t) {
263
+ function Ct(t) {
264
264
  let e = /^\s*[-]{4,}$/, n = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
265
265
  return (r) => {
266
266
  let s = r.match(n);
@@ -278,13 +278,13 @@ function Pt(t) {
278
278
  }
279
279
  o && (c = i, u = o), o === "<anonymous>" && (u = void 0, a = void 0), a === void 0 && (u = u || "<anonymous>", a = c ? `${c}.${u}` : u);
280
280
  let f = s[2] && s[2].startsWith("file://") ? s[2].slice(7) : s[2], d = s[5] === "native";
281
- return !f && s[5] && !d && (f = s[5]), { filename: f, module: t ? t(f) : void 0, function: a, lineno: parseInt(s[3], 10) || void 0, colno: parseInt(s[4], 10) || void 0, in_app: $n(f, d) };
281
+ return !f && s[5] && !d && (f = s[5]), { filename: f, module: t ? t(f) : void 0, function: a, lineno: parseInt(s[3], 10) || void 0, colno: parseInt(s[4], 10) || void 0, in_app: jn(f, d) };
282
282
  }
283
283
  if (r.match(e)) return { filename: r };
284
284
  };
285
285
  }
286
286
  var Ut = 50;
287
- var Ct = /\(error: (.*)\)/;
287
+ var Pt = /\(error: (.*)\)/;
288
288
  var Mt = /captureMessage|captureException/;
289
289
  function Ee(...t) {
290
290
  let e = t.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
@@ -294,7 +294,7 @@ function Ee(...t) {
294
294
  for (let o = r; o < i.length; o++) {
295
295
  let a = i[o];
296
296
  if (a.length > 1024) continue;
297
- let c = Ct.test(a) ? a.replace(Ct, "$1") : a;
297
+ let c = Pt.test(a) ? a.replace(Pt, "$1") : a;
298
298
  if (!c.match(/\S*Error: /)) {
299
299
  for (let u of e) {
300
300
  let f = u(c);
@@ -326,10 +326,10 @@ function ne(t) {
326
326
  }
327
327
  }
328
328
  function Je(t) {
329
- return [90, Pt(t)];
329
+ return [90, Ct(t)];
330
330
  }
331
- var Xe = I();
332
- function jn() {
331
+ var Xe = x();
332
+ function Hn() {
333
333
  if (!("fetch" in Xe)) return false;
334
334
  try {
335
335
  return new Headers(), new Request("http://www.example.com"), new Response(), true;
@@ -341,7 +341,7 @@ function Ft(t) {
341
341
  return t && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString());
342
342
  }
343
343
  function Bt() {
344
- if (!jn()) return false;
344
+ if (!Hn()) return false;
345
345
  if (Ft(Xe.fetch)) return true;
346
346
  let t = false, e = Xe.document;
347
347
  if (e && typeof e.createElement == "function") try {
@@ -352,19 +352,19 @@ function Bt() {
352
352
  }
353
353
  return t;
354
354
  }
355
- var Se = I();
355
+ var Se = x();
356
356
  function Lt() {
357
357
  let t = Se.chrome, e = t && t.app && t.app.runtime, n = "history" in Se && !!Se.history.pushState && !!Se.history.replaceState;
358
358
  return !e && n;
359
359
  }
360
- var E = I();
360
+ var E = x();
361
361
  var re = "__sentry_xhr_v2__";
362
362
  var se = {};
363
363
  var Yt = {};
364
- function Hn(t) {
364
+ function qn(t) {
365
365
  if (!Yt[t]) switch (Yt[t] = true, t) {
366
366
  case "console":
367
- qn();
367
+ zn();
368
368
  break;
369
369
  case "dom":
370
370
  Wt();
@@ -373,24 +373,24 @@ function Hn(t) {
373
373
  zt();
374
374
  break;
375
375
  case "fetch":
376
- zn();
376
+ Wn();
377
377
  break;
378
378
  case "history":
379
- Wn();
379
+ Kn();
380
380
  break;
381
381
  case "error":
382
- Xn();
382
+ Zn();
383
383
  break;
384
384
  case "unhandledrejection":
385
- Zn();
385
+ Qn();
386
386
  break;
387
387
  default:
388
388
  (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("unknown instrumentation type:", t);
389
389
  return;
390
390
  }
391
391
  }
392
- function xe(t, e) {
393
- se[t] = se[t] || [], se[t].push(e), Hn(t);
392
+ function Ie(t, e) {
393
+ se[t] = se[t] || [], se[t].push(e), qn(t);
394
394
  }
395
395
  function D(t, e) {
396
396
  if (!(!t || !se[t])) for (let n of se[t] || []) try {
@@ -402,9 +402,9 @@ Name: ${ne(n)}
402
402
  Error:`, r);
403
403
  }
404
404
  }
405
- function qn() {
405
+ function zn() {
406
406
  "console" in m && ee.forEach(function(t) {
407
- t in m.console && x(m.console, t, function(e) {
407
+ t in m.console && I(m.console, t, function(e) {
408
408
  return H[t] = e, function(...n) {
409
409
  D("console", { args: n, level: t });
410
410
  let r = H[t];
@@ -413,8 +413,8 @@ function qn() {
413
413
  });
414
414
  });
415
415
  }
416
- function zn() {
417
- Bt() && x(m, "fetch", function(t) {
416
+ function Wn() {
417
+ Bt() && I(m, "fetch", function(t) {
418
418
  return function(...e) {
419
419
  let { method: n, url: r } = qt(e), s = { args: e, fetchData: { method: n, url: r }, startTimestamp: Date.now() };
420
420
  return D("fetch", { ...s }), t.apply(m, e).then((i) => (D("fetch", { ...s, endTimestamp: Date.now(), response: i }), i), (i) => {
@@ -441,7 +441,7 @@ function qt(t) {
441
441
  function zt() {
442
442
  if (!E.XMLHttpRequest) return;
443
443
  let t = XMLHttpRequest.prototype;
444
- x(t, "open", function(e) {
444
+ I(t, "open", function(e) {
445
445
  return function(...n) {
446
446
  let r = Date.now(), s = n[1], i = this[re] = { method: j(n[0]) ? n[0].toUpperCase() : n[0], url: n[1], request_headers: {} };
447
447
  j(s) && i.method === "POST" && s.match(/sentry_key/) && (this.__sentry_own_request__ = true);
@@ -455,18 +455,18 @@ function zt() {
455
455
  D("xhr", { args: n, endTimestamp: Date.now(), startTimestamp: r, xhr: this });
456
456
  }
457
457
  };
458
- return "onreadystatechange" in this && typeof this.onreadystatechange == "function" ? x(this, "onreadystatechange", function(a) {
458
+ return "onreadystatechange" in this && typeof this.onreadystatechange == "function" ? I(this, "onreadystatechange", function(a) {
459
459
  return function(...c) {
460
460
  return o(), a.apply(this, c);
461
461
  };
462
- }) : this.addEventListener("readystatechange", o), x(this, "setRequestHeader", function(a) {
462
+ }) : this.addEventListener("readystatechange", o), I(this, "setRequestHeader", function(a) {
463
463
  return function(...c) {
464
464
  let [u, f] = c, d = this[re];
465
465
  return d && (d.request_headers[u.toLowerCase()] = f), a.apply(this, c);
466
466
  };
467
467
  }), e.apply(this, n);
468
468
  };
469
- }), x(t, "send", function(e) {
469
+ }), I(t, "send", function(e) {
470
470
  return function(...n) {
471
471
  let r = this[re];
472
472
  return r && n[0] !== void 0 && (r.body = n[0]), D("xhr", { args: n, startTimestamp: Date.now(), xhr: this }), e.apply(this, n);
@@ -474,7 +474,7 @@ function zt() {
474
474
  });
475
475
  }
476
476
  var ye;
477
- function Wn() {
477
+ function Kn() {
478
478
  if (!Lt()) return;
479
479
  let t = E.onpopstate;
480
480
  E.onpopstate = function(...n) {
@@ -494,12 +494,12 @@ function Wn() {
494
494
  return n.apply(this, r);
495
495
  };
496
496
  }
497
- x(E.history, "pushState", e), x(E.history, "replaceState", e);
497
+ I(E.history, "pushState", e), I(E.history, "replaceState", e);
498
498
  }
499
- var Kn = 1e3;
499
+ var Vn = 1e3;
500
500
  var jt;
501
501
  var Te;
502
- function Vn(t, e) {
502
+ function Jn(t, e) {
503
503
  if (t.type !== e.type) return false;
504
504
  try {
505
505
  if (t.target !== e.target) return false;
@@ -507,7 +507,7 @@ function Vn(t, e) {
507
507
  }
508
508
  return true;
509
509
  }
510
- function Jn(t) {
510
+ function Xn(t) {
511
511
  if (t.type !== "keypress") return false;
512
512
  try {
513
513
  let e = t.target;
@@ -519,12 +519,12 @@ function Jn(t) {
519
519
  }
520
520
  function Ht(t, e = false) {
521
521
  return (n) => {
522
- if (!n || n._sentryCaptured || Jn(n)) return;
522
+ if (!n || n._sentryCaptured || Xn(n)) return;
523
523
  q(n, "_sentryCaptured", true);
524
524
  let r = n.type === "keypress" ? "input" : n.type;
525
- (Te === void 0 || !Vn(Te, n)) && (t({ event: n, name: r, global: e }), Te = n), clearTimeout(jt), jt = E.setTimeout(() => {
525
+ (Te === void 0 || !Jn(Te, n)) && (t({ event: n, name: r, global: e }), Te = n), clearTimeout(jt), jt = E.setTimeout(() => {
526
526
  Te = void 0;
527
- }, Kn);
527
+ }, Vn);
528
528
  };
529
529
  }
530
530
  function Wt() {
@@ -532,7 +532,7 @@ function Wt() {
532
532
  let t = D.bind(null, "dom"), e = Ht(t, true);
533
533
  E.document.addEventListener("click", e, false), E.document.addEventListener("keypress", e, false), ["EventTarget", "Node"].forEach((n) => {
534
534
  let r = E[n] && E[n].prototype;
535
- !r || !r.hasOwnProperty || !r.hasOwnProperty("addEventListener") || (x(r, "addEventListener", function(s) {
535
+ !r || !r.hasOwnProperty || !r.hasOwnProperty("addEventListener") || (I(r, "addEventListener", function(s) {
536
536
  return function(i, o, a) {
537
537
  if (i === "click" || i == "keypress") try {
538
538
  let c = this, u = c.__sentry_instrumentation_handlers__ = c.__sentry_instrumentation_handlers__ || {}, f = u[i] = u[i] || { refCount: 0 };
@@ -545,7 +545,7 @@ function Wt() {
545
545
  }
546
546
  return s.call(this, i, o, a);
547
547
  };
548
- }), x(r, "removeEventListener", function(s) {
548
+ }), I(r, "removeEventListener", function(s) {
549
549
  return function(i, o, a) {
550
550
  if (i === "click" || i == "keypress") try {
551
551
  let c = this, u = c.__sentry_instrumentation_handlers__ || {}, f = u[i];
@@ -558,13 +558,13 @@ function Wt() {
558
558
  });
559
559
  }
560
560
  var be = null;
561
- function Xn() {
561
+ function Zn() {
562
562
  be = E.onerror, E.onerror = function(t, e, n, r, s) {
563
563
  return D("error", { column: r, error: s, line: n, msg: t, url: e }), be && !be.__SENTRY_LOADER__ ? be.apply(this, arguments) : false;
564
564
  }, E.onerror.__SENTRY_INSTRUMENTED__ = true;
565
565
  }
566
566
  var Re = null;
567
- function Zn() {
567
+ function Qn() {
568
568
  Re = E.onunhandledrejection, E.onunhandledrejection = function(t) {
569
569
  return D("unhandledrejection", t), Re && !Re.__SENTRY_LOADER__ ? Re.apply(this, arguments) : true;
570
570
  }, E.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
@@ -603,7 +603,7 @@ function h() {
603
603
  }
604
604
  return ("10000000100040008000" + 1e11).replace(/[018]/g, (r) => (r ^ (n() & 15) >> r / 4).toString(16));
605
605
  }
606
- function Qn(t) {
606
+ function er(t) {
607
607
  return t.exception && t.exception.values ? t.exception.values[0] : void 0;
608
608
  }
609
609
  function ie(t, e, n) {
@@ -611,7 +611,7 @@ function ie(t, e, n) {
611
611
  i.value || (i.value = e || ""), i.type || (i.type = n || "Error");
612
612
  }
613
613
  function oe(t, e) {
614
- let n = Qn(t);
614
+ let n = er(t);
615
615
  if (!n) return;
616
616
  let r = { type: "generic", handled: true }, s = n.mechanism;
617
617
  if (n.mechanism = { ...r, ...s, ...e }, e && "data" in e) {
@@ -619,7 +619,7 @@ function oe(t, e) {
619
619
  n.mechanism.data = i;
620
620
  }
621
621
  }
622
- function Ie(t) {
622
+ function xe(t) {
623
623
  if (t && t.__sentry_captured__) return true;
624
624
  try {
625
625
  q(t, "__sentry_captured__", true);
@@ -639,12 +639,12 @@ function N(t, e = 100, n = 1 / 0) {
639
639
  }
640
640
  function z(t, e = 3, n = 100 * 1024) {
641
641
  let r = N(t, e);
642
- return rr(r) > n ? z(t, e - 1, n) : r;
642
+ return sr(r) > n ? z(t, e - 1, n) : r;
643
643
  }
644
644
  function De(t, e, n = 1 / 0, r = 1 / 0, s = Xt()) {
645
645
  let [i, o] = s;
646
646
  if (e == null || ["number", "boolean", "string"].includes(typeof e) && !Z(e)) return e;
647
- let a = er(t, e);
647
+ let a = tr(t, e);
648
648
  if (!a.startsWith("[object ")) return a;
649
649
  if (e.__sentry_skip_normalization__) return e;
650
650
  let c = typeof e.__sentry_override_normalization_depth__ == "number" ? e.__sentry_override_normalization_depth__ : n;
@@ -668,7 +668,7 @@ function De(t, e, n = 1 / 0, r = 1 / 0, s = Xt()) {
668
668
  }
669
669
  return o(e), f;
670
670
  }
671
- function er(t, e) {
671
+ function tr(t, e) {
672
672
  try {
673
673
  if (t === "domain" && e && typeof e == "object" && e._events) return "[Domain]";
674
674
  if (t === "domainEmitter") return "[DomainEmitter]";
@@ -681,29 +681,29 @@ function er(t, e) {
681
681
  if (typeof e == "function") return `[Function: ${ne(e)}]`;
682
682
  if (typeof e == "symbol") return `[${String(e)}]`;
683
683
  if (typeof e == "bigint") return `[BigInt: ${String(e)}]`;
684
- let n = tr(e);
684
+ let n = nr(e);
685
685
  return /^HTML(\w*)Element$/.test(n) ? `[HTMLElement: ${n}]` : `[object ${n}]`;
686
686
  } catch (n) {
687
687
  return `**non-serializable** (${n})`;
688
688
  }
689
689
  }
690
- function tr(t) {
690
+ function nr(t) {
691
691
  let e = Object.getPrototypeOf(t);
692
692
  return e ? e.constructor.name : "null prototype";
693
693
  }
694
- function nr(t) {
694
+ function rr(t) {
695
695
  return ~-encodeURI(t).split(/%..|./).length;
696
696
  }
697
- function rr(t) {
698
- return nr(JSON.stringify(t));
697
+ function sr(t) {
698
+ return rr(JSON.stringify(t));
699
699
  }
700
- var sr = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;
701
- function ir(t) {
702
- let e = t.length > 1024 ? `<truncated>${t.slice(-1024)}` : t, n = sr.exec(e);
700
+ var ir = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;
701
+ function or(t) {
702
+ let e = t.length > 1024 ? `<truncated>${t.slice(-1024)}` : t, n = ir.exec(e);
703
703
  return n ? n.slice(1) : [];
704
704
  }
705
705
  function Qe(t, e) {
706
- let n = ir(t)[2];
706
+ let n = or(t)[2];
707
707
  return e && n.slice(e.length * -1) === e && (n = n.slice(0, n.length - e.length)), n;
708
708
  }
709
709
  var A;
@@ -832,27 +832,27 @@ function et(t) {
832
832
  }
833
833
  return { $: e, add: s, drain: i };
834
834
  }
835
- var Qt = I();
835
+ var Qt = x();
836
836
  var nt = { nowSeconds: () => Date.now() / 1e3 };
837
- function or() {
837
+ function ar() {
838
838
  let { performance: t } = Qt;
839
839
  if (!t || !t.now) return;
840
840
  let e = Date.now() - t.now();
841
841
  return { now: () => t.now(), timeOrigin: e };
842
842
  }
843
- function ar() {
843
+ function cr() {
844
844
  try {
845
845
  return Jt(module, "perf_hooks").performance;
846
846
  } catch {
847
847
  return;
848
848
  }
849
849
  }
850
- var tt = Vt() ? ar() : or();
850
+ var tt = Vt() ? cr() : ar();
851
851
  var Zt = tt === void 0 ? nt : { nowSeconds: () => (tt.timeOrigin + tt.now()) / 1e3 };
852
852
  var B = nt.nowSeconds.bind(nt);
853
853
  var L = Zt.nowSeconds.bind(Zt);
854
854
  var ce;
855
- var cr = (() => {
855
+ var ur = (() => {
856
856
  let { performance: t } = Qt;
857
857
  if (!t || !t.now) {
858
858
  ce = "none";
@@ -861,12 +861,12 @@ var cr = (() => {
861
861
  let e = 3600 * 1e3, n = t.now(), r = Date.now(), s = t.timeOrigin ? Math.abs(t.timeOrigin + n - r) : e, i = s < e, o = t.timing && t.timing.navigationStart, c = typeof o == "number" ? Math.abs(o + n - r) : e, u = c < e;
862
862
  return i || u ? s <= c ? (ce = "timeOrigin", t.timeOrigin) : (ce = "navigationStart", o) : (ce = "dateNow", r);
863
863
  })();
864
- var ur = new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");
864
+ var dr = new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");
865
865
  function rt(t = h(), e = h().substring(16), n) {
866
866
  let r = "";
867
867
  return n !== void 0 && (r = n ? "-1" : "-0"), `${t}-${e}${r}`;
868
868
  }
869
- function C(t, e = []) {
869
+ function P(t, e = []) {
870
870
  return [t, e];
871
871
  }
872
872
  function it(t, e) {
@@ -904,9 +904,9 @@ ${JSON.stringify(a)}
904
904
  i(u);
905
905
  }
906
906
  }
907
- return typeof s == "string" ? s : dr(s);
907
+ return typeof s == "string" ? s : fr(s);
908
908
  }
909
- function dr(t) {
909
+ function fr(t) {
910
910
  let e = t.reduce((s, i) => s + i.length, 0), n = new Uint8Array(e), r = 0;
911
911
  for (let s of t) n.set(s, r), r += s.length;
912
912
  return n;
@@ -915,9 +915,9 @@ function at(t, e) {
915
915
  let n = typeof t.data == "string" ? st(t.data, e) : t.data;
916
916
  return [g({ type: "attachment", length: n.length, filename: t.filename, content_type: t.contentType, attachment_type: t.attachmentType }), n];
917
917
  }
918
- var fr = { session: "session", sessions: "session", attachment: "attachment", transaction: "transaction", event: "error", client_report: "internal", user_report: "default", profile: "profile", replay_event: "replay", replay_recording: "replay", check_in: "monitor", statsd: "unknown" };
918
+ var pr = { session: "session", sessions: "session", attachment: "attachment", transaction: "transaction", event: "error", client_report: "internal", user_report: "default", profile: "profile", replay_event: "replay", replay_recording: "replay", check_in: "monitor", statsd: "unknown" };
919
919
  function ke(t) {
920
- return fr[t];
920
+ return pr[t];
921
921
  }
922
922
  function Oe(t) {
923
923
  if (!t || !t.sdk) return;
@@ -926,7 +926,7 @@ function Oe(t) {
926
926
  }
927
927
  function ct(t, e, n, r) {
928
928
  let s = t.sdkProcessingMetadata && t.sdkProcessingMetadata.dynamicSamplingContext;
929
- return { event_id: t.event_id, sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...e && { sdk: e }, ...!!n && r && { dsn: P(r) }, ...s && { trace: g({ ...s }) } };
929
+ return { event_id: t.event_id, sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...e && { sdk: e }, ...!!n && r && { dsn: C(r) }, ...s && { trace: g({ ...s }) } };
930
930
  }
931
931
  function en(t, e = Date.now()) {
932
932
  let n = parseInt(`${t}`, 10);
@@ -957,7 +957,7 @@ function nn(t, e) {
957
957
  let n = { type: e.name || e.constructor.name, value: e.message }, r = ft(t, e);
958
958
  return r.length && (n.stacktrace = { frames: r }), n;
959
959
  }
960
- function pr(t) {
960
+ function lr(t) {
961
961
  if ("name" in t && typeof t.name == "string") {
962
962
  let e = `'${t.name}' captured as exception`;
963
963
  return "message" in t && typeof t.message == "string" && (e += ` with message '${t.message}'`), e;
@@ -971,7 +971,7 @@ function pt(t, e, n, r) {
971
971
  c.configureScope((l) => {
972
972
  l.setExtra("__serialized__", z(n, f));
973
973
  });
974
- let d = pr(n);
974
+ let d = lr(n);
975
975
  s = r && r.syntheticException || new Error(d), s.message = d;
976
976
  } else s = r && r.syntheticException || new Error(n), s.message = n;
977
977
  o.synthetic = true;
@@ -1005,10 +1005,10 @@ function K(t, e, n, r = 0) {
1005
1005
  });
1006
1006
  }
1007
1007
  function sn(t) {
1008
- let e = L(), n = { sid: h(), init: true, timestamp: e, started: e, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => lr(n) };
1009
- return t && v(n, t), n;
1008
+ let e = L(), n = { sid: h(), init: true, timestamp: e, started: e, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => mr(n) };
1009
+ return t && w(n, t), n;
1010
1010
  }
1011
- function v(t, e = {}) {
1011
+ function w(t, e = {}) {
1012
1012
  if (e.user && (!t.ipAddress && e.user.ip_address && (t.ipAddress = e.user.ip_address), !t.did && !e.did && (t.did = e.user.id || e.user.email || e.user.username)), t.timestamp = e.timestamp || L(), e.abnormal_mechanism && (t.abnormal_mechanism = e.abnormal_mechanism), e.ignoreDuration && (t.ignoreDuration = e.ignoreDuration), e.sid && (t.sid = e.sid.length === 32 ? e.sid : h()), e.init !== void 0 && (t.init = e.init), !t.did && e.did && (t.did = `${e.did}`), typeof e.started == "number" && (t.started = e.started), t.ignoreDuration) t.duration = void 0;
1013
1013
  else if (typeof e.duration == "number") t.duration = e.duration;
1014
1014
  else {
@@ -1019,12 +1019,12 @@ function v(t, e = {}) {
1019
1019
  }
1020
1020
  function on(t, e) {
1021
1021
  let n = {};
1022
- e ? n = { status: e } : t.status === "ok" && (n = { status: "exited" }), v(t, n);
1022
+ e ? n = { status: e } : t.status === "ok" && (n = { status: "exited" }), w(t, n);
1023
1023
  }
1024
- function lr(t) {
1024
+ function mr(t) {
1025
1025
  return g({ sid: `${t.sid}`, init: t.init, started: new Date(t.started * 1e3).toISOString(), timestamp: new Date(t.timestamp * 1e3).toISOString(), status: t.status, errors: t.errors, did: typeof t.did == "number" || typeof t.did == "string" ? `${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 } });
1026
1026
  }
1027
- var mr = 100;
1027
+ var _r = 100;
1028
1028
  var k = class {
1029
1029
  constructor() {
1030
1030
  this._notifyingListeners = false, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext = an();
@@ -1040,7 +1040,7 @@ var k = class {
1040
1040
  return this._eventProcessors.push(e), this;
1041
1041
  }
1042
1042
  setUser(e) {
1043
- return this._user = e || {}, this._session && v(this._session, { user: e }), this._notifyScopeListeners(), this;
1043
+ return this._user = e || {}, this._session && w(this._session, { user: e }), this._notifyScopeListeners(), this;
1044
1044
  }
1045
1045
  getUser() {
1046
1046
  return this._user;
@@ -1103,7 +1103,7 @@ var k = class {
1103
1103
  return this._breadcrumbs = [], this._tags = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._requestSession = void 0, this._span = void 0, this._session = void 0, this._notifyScopeListeners(), this._attachments = [], this._propagationContext = an(), this;
1104
1104
  }
1105
1105
  addBreadcrumb(e, n) {
1106
- let r = typeof n == "number" ? n : mr;
1106
+ let r = typeof n == "number" ? n : _r;
1107
1107
  if (r <= 0) return this;
1108
1108
  let s = { timestamp: B(), ...e }, i = this._breadcrumbs;
1109
1109
  return i.push(s), this._breadcrumbs = i.length > r ? i.slice(-r) : i, this._notifyScopeListeners(), this;
@@ -1162,7 +1162,7 @@ function an() {
1162
1162
  return { traceId: h(), spanId: h().substring(16) };
1163
1163
  }
1164
1164
  var cn = 4;
1165
- var _r = 100;
1165
+ var hr = 100;
1166
1166
  var Y = class {
1167
1167
  constructor(e, n = new k(), r = cn) {
1168
1168
  this._version = r, this._stack = [{ scope: n }], e && this.bindClient(e);
@@ -1225,7 +1225,7 @@ var Y = class {
1225
1225
  addBreadcrumb(e, n) {
1226
1226
  let { scope: r, client: s } = this.getStackTop();
1227
1227
  if (!s) return;
1228
- let { beforeBreadcrumb: i = null, maxBreadcrumbs: o = _r } = s.getOptions && s.getOptions() || {};
1228
+ let { beforeBreadcrumb: i = null, maxBreadcrumbs: o = hr } = s.getOptions && s.getOptions() || {};
1229
1229
  if (o <= 0) return;
1230
1230
  let c = { timestamp: B(), ...e }, u = i ? _e(() => i(c, n)) : c;
1231
1231
  u !== null && (s.emit && s.emit("beforeAddBreadcrumb", u, n), r.addBreadcrumb(u, o));
@@ -1293,7 +1293,7 @@ Sentry.init({...});
1293
1293
  }
1294
1294
  startSession(e) {
1295
1295
  let { scope: n, client: r } = this.getStackTop(), { release: s, environment: i = W } = r && r.getOptions() || {}, { userAgent: o } = m.navigator || {}, a = sn({ release: s, environment: i, user: n.getUser(), ...o && { userAgent: o }, ...e }), c = n.getSession && n.getSession();
1296
- return c && c.status === "ok" && v(c, { status: "exited" }), this.endSession(), n.setSession(a), a;
1296
+ return c && c.status === "ok" && w(c, { status: "exited" }), this.endSession(), n.setSession(a), a;
1297
1297
  }
1298
1298
  shouldSendDefaultPii() {
1299
1299
  let e = this.getClient(), n = e && e.getOptions();
@@ -1326,12 +1326,12 @@ function b() {
1326
1326
  let e = t.__SENTRY__.acs.getCurrentHub();
1327
1327
  if (e) return e;
1328
1328
  }
1329
- return hr(t);
1329
+ return gr(t);
1330
1330
  }
1331
- function hr(t = $()) {
1332
- return (!gr(t) || Ae(t).isOlderThan(cn)) && _t(t, new Y()), Ae(t);
1331
+ function gr(t = $()) {
1332
+ return (!Er(t) || Ae(t).isOlderThan(cn)) && _t(t, new Y()), Ae(t);
1333
1333
  }
1334
- function gr(t) {
1334
+ function Er(t) {
1335
1335
  return !!(t && t.__SENTRY__ && t.__SENTRY__.hub);
1336
1336
  }
1337
1337
  function Ae(t) {
@@ -1347,7 +1347,7 @@ function un(t) {
1347
1347
  }
1348
1348
  var dn = false;
1349
1349
  function fn() {
1350
- dn || (dn = true, xe("error", ht), xe("unhandledrejection", ht));
1350
+ dn || (dn = true, Ie("error", ht), Ie("unhandledrejection", ht));
1351
1351
  }
1352
1352
  function ht() {
1353
1353
  let t = un();
@@ -1357,7 +1357,7 @@ function ht() {
1357
1357
  }
1358
1358
  }
1359
1359
  ht.tag = "sentry_tracingErrorCallback";
1360
- var ve = class {
1360
+ var we = class {
1361
1361
  constructor(e = 1e3) {
1362
1362
  this._maxlen = e, this.spans = [];
1363
1363
  }
@@ -1394,7 +1394,7 @@ var V = class {
1394
1394
  }
1395
1395
  setHttpStatus(e) {
1396
1396
  this.setTag("http.status_code", String(e)), this.setData("http.response.status_code", e);
1397
- let n = Er(e);
1397
+ let n = Sr(e);
1398
1398
  return n !== "unknown_error" && this.setStatus(n), this;
1399
1399
  }
1400
1400
  setName(e) {
@@ -1426,7 +1426,7 @@ var V = class {
1426
1426
  return g({ data: Object.keys(this.data).length > 0 ? this.data : void 0, description: this.description, op: this.op, parent_span_id: this.parentSpanId, span_id: this.spanId, start_timestamp: this.startTimestamp, status: this.status, tags: Object.keys(this.tags).length > 0 ? this.tags : void 0, timestamp: this.endTimestamp, trace_id: this.traceId, origin: this.origin });
1427
1427
  }
1428
1428
  };
1429
- function Er(t) {
1429
+ function Sr(t) {
1430
1430
  if (t < 400 && t >= 100) return "ok";
1431
1431
  if (t >= 400 && t < 500) switch (t) {
1432
1432
  case 401:
@@ -1460,7 +1460,7 @@ function J(t, e, n) {
1460
1460
  let r = e.getOptions(), { publicKey: s } = e.getDsn() || {}, { segment: i } = n && n.getUser() || {}, o = g({ environment: r.environment || W, release: r.release, user_segment: i, public_key: s, trace_id: t });
1461
1461
  return e.emit && e.emit("createDsc", o), o;
1462
1462
  }
1463
- var we = class extends V {
1463
+ var ve = class extends V {
1464
1464
  constructor(e, n) {
1465
1465
  super(e), delete this.description, this._measurements = {}, this._contexts = {}, this._hub = n || b(), this._name = e.name || "", this.metadata = { source: "custom", ...e.metadata, spanMetadata: {} }, this._trimEnd = e.trimEnd, this.transaction = this;
1466
1466
  let r = this.metadata.dynamicSamplingContext;
@@ -1476,7 +1476,7 @@ var we = class extends V {
1476
1476
  this._name = e, this.metadata.source = n;
1477
1477
  }
1478
1478
  initSpanRecorder(e = 1e3) {
1479
- this.spanRecorder || (this.spanRecorder = new ve(e)), this.spanRecorder.add(this);
1479
+ this.spanRecorder || (this.spanRecorder = new we(e)), this.spanRecorder.add(this);
1480
1480
  }
1481
1481
  setContext(e, n) {
1482
1482
  n === null ? delete this._contexts[e] : this._contexts[e] = n;
@@ -1533,27 +1533,27 @@ function ln(t, e, n) {
1533
1533
  if (!pn(e)) return t.sampled = false, t;
1534
1534
  if (t.sampled !== void 0) return t.setMetadata({ sampleRate: Number(t.sampled) }), t;
1535
1535
  let r;
1536
- return typeof e.tracesSampler == "function" ? (r = e.tracesSampler(n), t.setMetadata({ sampleRate: Number(r) })) : n.parentSampled !== void 0 ? r = n.parentSampled : typeof e.tracesSampleRate < "u" ? (r = e.tracesSampleRate, t.setMetadata({ sampleRate: Number(r) })) : (r = 1, t.setMetadata({ sampleRate: r })), Sr(r) ? r ? (t.sampled = Math.random() < r, t.sampled ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(`[Tracing] starting ${t.op} transaction - ${t.name}`), t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`), t)) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler == "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}`), t.sampled = false, t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("[Tracing] Discarding transaction because of invalid sample rate."), t.sampled = false, t);
1536
+ return typeof e.tracesSampler == "function" ? (r = e.tracesSampler(n), t.setMetadata({ sampleRate: Number(r) })) : n.parentSampled !== void 0 ? r = n.parentSampled : typeof e.tracesSampleRate < "u" ? (r = e.tracesSampleRate, t.setMetadata({ sampleRate: Number(r) })) : (r = 1, t.setMetadata({ sampleRate: r })), yr(r) ? r ? (t.sampled = Math.random() < r, t.sampled ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(`[Tracing] starting ${t.op} transaction - ${t.name}`), t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`), t)) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler == "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}`), t.sampled = false, t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("[Tracing] Discarding transaction because of invalid sample rate."), t.sampled = false, t);
1537
1537
  }
1538
- function Sr(t) {
1538
+ function yr(t) {
1539
1539
  return Z(t) || !(typeof t == "number" || typeof t == "boolean") ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`), false) : t < 0 || t > 1 ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`), false) : true;
1540
1540
  }
1541
- function yr() {
1541
+ function Tr() {
1542
1542
  let e = this.getScope().getSpan();
1543
1543
  return e ? { "sentry-trace": e.toTraceparent() } : {};
1544
1544
  }
1545
- function Tr(t, e) {
1545
+ function br(t, e) {
1546
1546
  let n = this.getClient(), r = n && n.getOptions() || {}, s = r.instrumenter || "sentry", i = t.instrumenter || "sentry";
1547
1547
  s !== i && ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${s}\` instrumenter.
1548
1548
  The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`), t.sampled = false);
1549
- let o = new we(t, this);
1549
+ let o = new ve(t, this);
1550
1550
  return o = ln(o, r, { parentSampled: t.parentSampled, transactionContext: t, ...e }), o.sampled && o.initSpanRecorder(r._experiments && r._experiments.maxSpans), n && n.emit && n.emit("startTransaction", o), o;
1551
1551
  }
1552
1552
  function mn() {
1553
1553
  let t = $();
1554
- t.__SENTRY__ && (t.__SENTRY__.extensions = t.__SENTRY__.extensions || {}, t.__SENTRY__.extensions.startTransaction || (t.__SENTRY__.extensions.startTransaction = Tr), t.__SENTRY__.extensions.traceHeaders || (t.__SENTRY__.extensions.traceHeaders = yr), fn());
1554
+ t.__SENTRY__ && (t.__SENTRY__.extensions = t.__SENTRY__.extensions || {}, t.__SENTRY__.extensions.startTransaction || (t.__SENTRY__.extensions.startTransaction = br), t.__SENTRY__.extensions.traceHeaders || (t.__SENTRY__.extensions.traceHeaders = Tr), fn());
1555
1555
  }
1556
- var Pe = class {
1556
+ var Ce = class {
1557
1557
  constructor(e, n) {
1558
1558
  this._client = e, this.flushTimeout = 60, this._pendingAggregates = {}, this._isEnabled = true, this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1e3), this._sessionAttrs = n;
1559
1559
  }
@@ -1587,36 +1587,36 @@ var Pe = class {
1587
1587
  }
1588
1588
  }
1589
1589
  };
1590
- var br = "7";
1591
- function Rr(t) {
1590
+ var Rr = "7";
1591
+ function Ir(t) {
1592
1592
  let e = t.protocol ? `${t.protocol}:` : "", n = t.port ? `:${t.port}` : "";
1593
1593
  return `${e}//${t.host}${n}${t.path ? `/${t.path}` : ""}/api/`;
1594
1594
  }
1595
1595
  function xr(t) {
1596
- return `${Rr(t)}${t.projectId}/envelope/`;
1596
+ return `${Ir(t)}${t.projectId}/envelope/`;
1597
1597
  }
1598
- function Ir(t, e) {
1599
- return We({ sentry_key: t.publicKey, sentry_version: br, ...e && { sentry_client: `${e.name}/${e.version}` } });
1598
+ function Dr(t, e) {
1599
+ return We({ sentry_key: t.publicKey, sentry_version: Rr, ...e && { sentry_client: `${e.name}/${e.version}` } });
1600
1600
  }
1601
1601
  function _n(t, e = {}) {
1602
1602
  let n = typeof e == "string" ? e : e.tunnel, r = typeof e == "string" || !e._metadata ? void 0 : e._metadata.sdk;
1603
- return n || `${xr(t)}?${Ir(t, r)}`;
1603
+ return n || `${xr(t)}?${Dr(t, r)}`;
1604
1604
  }
1605
- function Dr(t, e) {
1605
+ function Nr(t, e) {
1606
1606
  return e && (t.sdk = t.sdk || {}, t.sdk.name = t.sdk.name || e.name, t.sdk.version = t.sdk.version || e.version, t.sdk.integrations = [...t.sdk.integrations || [], ...e.integrations || []], t.sdk.packages = [...t.sdk.packages || [], ...e.packages || []]), t;
1607
1607
  }
1608
1608
  function hn(t, e, n, r) {
1609
- let s = Oe(n), i = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn: P(e) } }, o = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
1610
- return C(i, [o]);
1609
+ let s = Oe(n), i = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn: C(e) } }, o = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
1610
+ return P(i, [o]);
1611
1611
  }
1612
1612
  function gn(t, e, n, r) {
1613
1613
  let s = Oe(n), i = t.type && t.type !== "replay_event" ? t.type : "event";
1614
- Dr(t, n && n.sdk);
1614
+ Nr(t, n && n.sdk);
1615
1615
  let o = ct(t, s, r, e);
1616
- return delete t.sdkProcessingMetadata, C(o, [[{ type: i }, t]]);
1616
+ return delete t.sdkProcessingMetadata, P(o, [[{ type: i }, t]]);
1617
1617
  }
1618
1618
  var En = [];
1619
- function Nr(t) {
1619
+ function kr(t) {
1620
1620
  let e = {};
1621
1621
  return t.forEach((n) => {
1622
1622
  let { name: r } = n, s = e[r];
@@ -1630,7 +1630,7 @@ function gt(t) {
1630
1630
  });
1631
1631
  let r;
1632
1632
  Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r = ae(n(e)) : r = e;
1633
- let s = Nr(r), i = kr(s, (o) => o.name === "Debug");
1633
+ let s = kr(r), i = Or(s, (o) => o.name === "Debug");
1634
1634
  if (i !== -1) {
1635
1635
  let [o] = s.splice(i, 1);
1636
1636
  s.push(o);
@@ -1654,13 +1654,13 @@ function Et(t, e, n) {
1654
1654
  }
1655
1655
  (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(`Integration installed: ${e.name}`);
1656
1656
  }
1657
- function kr(t, e) {
1657
+ function Or(t, e) {
1658
1658
  for (let n = 0; n < t.length; n++) if (e(t[n]) === true) return n;
1659
1659
  return -1;
1660
1660
  }
1661
1661
  function Tn(t, e, n, r, s) {
1662
1662
  let { normalizeDepth: i = 3, normalizeMaxBreadth: o = 1e3 } = t, a = { ...e, event_id: e.event_id || n.event_id || h(), timestamp: e.timestamp || B() }, c = n.integrations || t.integrations.map((l) => l.name);
1663
- Or(a, t), wr(a, c), e.type === void 0 && Ar(a, t.stackParser);
1663
+ Ar(a, t), Cr(a, c), e.type === void 0 && wr(a, t.stackParser);
1664
1664
  let u = r;
1665
1665
  n.captureContext && (u = k.clone(u).update(n.captureContext));
1666
1666
  let f = T(a), d = s && s.getEventProcessors ? s.getEventProcessors() : [];
@@ -1673,16 +1673,16 @@ function Tn(t, e, n, r, s) {
1673
1673
  } else f = K([...d, ...ue()], a, n);
1674
1674
  return f.then((l) => (l && vr(l), typeof i == "number" && i > 0 ? Pr(l, i, o) : l));
1675
1675
  }
1676
- function Or(t, e) {
1676
+ function Ar(t, e) {
1677
1677
  let { environment: n, release: r, dist: s, maxValueLength: i = 250 } = e;
1678
- "environment" in t || (t.environment = "environment" in e ? n : W), t.release === void 0 && r !== void 0 && (t.release = r), t.dist === void 0 && s !== void 0 && (t.dist = s), t.message && (t.message = w(t.message, i));
1678
+ "environment" in t || (t.environment = "environment" in e ? n : W), t.release === void 0 && r !== void 0 && (t.release = r), t.dist === void 0 && s !== void 0 && (t.dist = s), t.message && (t.message = v(t.message, i));
1679
1679
  let o = t.exception && t.exception.values && t.exception.values[0];
1680
- o && o.value && (o.value = w(o.value, i));
1680
+ o && o.value && (o.value = v(o.value, i));
1681
1681
  let a = t.request;
1682
- a && a.url && (a.url = w(a.url, i));
1682
+ a && a.url && (a.url = v(a.url, i));
1683
1683
  }
1684
1684
  var yn = /* @__PURE__ */ new WeakMap();
1685
- function Ar(t, e) {
1685
+ function wr(t, e) {
1686
1686
  let n = m._sentryDebugIds;
1687
1687
  if (!n) return;
1688
1688
  let r, s = yn.get(e);
@@ -1725,7 +1725,7 @@ function vr(t) {
1725
1725
  n.push({ type: "sourcemap", code_file: r, debug_id: e[r] });
1726
1726
  });
1727
1727
  }
1728
- function wr(t, e) {
1728
+ function Cr(t, e) {
1729
1729
  e.length > 0 && (t.sdk = t.sdk || {}, t.sdk.integrations = [...t.sdk.integrations || [], ...e]);
1730
1730
  }
1731
1731
  function Pr(t, e, n) {
@@ -1734,7 +1734,7 @@ function Pr(t, e, n) {
1734
1734
  return t.contexts && t.contexts.trace && r.contexts && (r.contexts.trace = t.contexts.trace, t.contexts.trace.data && (r.contexts.trace.data = N(t.contexts.trace.data, e, n))), t.spans && (r.spans = t.spans.map((s) => (s.data && (s.data = N(s.data, e, n)), s))), r;
1735
1735
  }
1736
1736
  var bn = "Not capturing exception because it's already been captured.";
1737
- var Ce = class {
1737
+ var Pe = class {
1738
1738
  constructor(e) {
1739
1739
  if (this._options = e, this._integrations = {}, this._integrationsInitialized = false, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn = he(e.dsn) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("No DSN provided, client will not send events."), this._dsn) {
1740
1740
  let n = _n(this._dsn, e);
@@ -1742,7 +1742,7 @@ var Ce = class {
1742
1742
  }
1743
1743
  }
1744
1744
  captureException(e, n, r) {
1745
- if (Ie(e)) {
1745
+ if (xe(e)) {
1746
1746
  (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(bn);
1747
1747
  return;
1748
1748
  }
@@ -1758,7 +1758,7 @@ var Ce = class {
1758
1758
  })), i;
1759
1759
  }
1760
1760
  captureEvent(e, n, r) {
1761
- if (n && n.originalException && Ie(n.originalException)) {
1761
+ if (n && n.originalException && xe(n.originalException)) {
1762
1762
  (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.log(bn);
1763
1763
  return;
1764
1764
  }
@@ -1768,7 +1768,7 @@ var Ce = class {
1768
1768
  })), s;
1769
1769
  }
1770
1770
  captureSession(e) {
1771
- typeof e.release != "string" ? (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("Discarded session because of missing or non-string release") : (this.sendSession(e), v(e, { init: false }));
1771
+ typeof e.release != "string" ? (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("Discarded session because of missing or non-string release") : (this.sendSession(e), w(e, { init: false }));
1772
1772
  }
1773
1773
  getDsn() {
1774
1774
  return this._dsn;
@@ -1847,7 +1847,7 @@ var Ce = class {
1847
1847
  }
1848
1848
  }
1849
1849
  let o = e.status === "ok";
1850
- (o && e.errors === 0 || o && r) && (v(e, { ...r && { status: "crashed" }, errors: e.errors || Number(s || r) }), this.captureSession(e));
1850
+ (o && e.errors === 0 || o && r) && (w(e, { ...r && { status: "crashed" }, errors: e.errors || Number(s || r) }), this.captureSession(e));
1851
1851
  }
1852
1852
  _isClientDoneProcessing(e) {
1853
1853
  return new S((n) => {
@@ -1882,14 +1882,14 @@ var Ce = class {
1882
1882
  });
1883
1883
  }
1884
1884
  _processEvent(e, n, r) {
1885
- let s = this.getOptions(), { sampleRate: i } = s, o = xn(e), a = Rn(e), c = e.type || "error", u = `before send for type \`${c}\``;
1885
+ let s = this.getOptions(), { sampleRate: i } = s, o = In(e), a = Rn(e), c = e.type || "error", u = `before send for type \`${c}\``;
1886
1886
  if (a && typeof i == "number" && Math.random() > i) return this.recordDroppedEvent("sample_rate", "error", e), F(new y(`Discarding event because it's not included in the random sample (sampling rate = ${i})`, "log"));
1887
1887
  let f = c === "replay_event" ? "replay" : c;
1888
1888
  return this._prepareEvent(e, n, r).then((d) => {
1889
1889
  if (d === null) throw this.recordDroppedEvent("event_processor", f, e), new y("An event processor returned `null`, will not send event.", "log");
1890
1890
  if (n.data && n.data.__sentry__ === true) return d;
1891
- let _ = Mr(s, d, n);
1892
- return Cr(_, u);
1891
+ let _ = Ur(s, d, n);
1892
+ return Mr(_, u);
1893
1893
  }).then((d) => {
1894
1894
  if (d === null) throw this.recordDroppedEvent("before_send", f, e), new y(`${u} returned \`null\`, will not send event.`, "log");
1895
1895
  let l = r && r.getSession();
@@ -1922,7 +1922,7 @@ Reason: ${d}`));
1922
1922
  });
1923
1923
  }
1924
1924
  };
1925
- function Cr(t, e) {
1925
+ function Mr(t, e) {
1926
1926
  let n = `${e} must return \`null\` or a valid event.`;
1927
1927
  if (G(t)) return t.then((r) => {
1928
1928
  if (!R(r) && r !== null) throw new y(n);
@@ -1933,26 +1933,26 @@ function Cr(t, e) {
1933
1933
  if (!R(t) && t !== null) throw new y(n);
1934
1934
  return t;
1935
1935
  }
1936
- function Mr(t, e, n) {
1936
+ function Ur(t, e, n) {
1937
1937
  let { beforeSend: r, beforeSendTransaction: s } = t;
1938
- return Rn(e) && r ? r(e, n) : xn(e) && s ? s(e, n) : e;
1938
+ return Rn(e) && r ? r(e, n) : In(e) && s ? s(e, n) : e;
1939
1939
  }
1940
1940
  function Rn(t) {
1941
1941
  return t.type === void 0;
1942
1942
  }
1943
- function xn(t) {
1943
+ function In(t) {
1944
1944
  return t.type === "transaction";
1945
1945
  }
1946
- function In(t, e, n, r, s) {
1946
+ function xn(t, e, n, r, s) {
1947
1947
  let i = { sent_at: (/* @__PURE__ */ new Date()).toISOString() };
1948
- n && n.sdk && (i.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (i.dsn = P(s)), e && (i.trace = g(e));
1949
- let o = Ur(t);
1950
- return C(i, [o]);
1948
+ n && n.sdk && (i.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (i.dsn = C(s)), e && (i.trace = g(e));
1949
+ let o = Gr(t);
1950
+ return P(i, [o]);
1951
1951
  }
1952
- function Ur(t) {
1952
+ function Gr(t) {
1953
1953
  return [{ type: "check_in" }, t];
1954
1954
  }
1955
- var de = class extends Ce {
1955
+ var de = class extends Pe {
1956
1956
  constructor(e) {
1957
1957
  mn(), super(e);
1958
1958
  }
@@ -1981,7 +1981,7 @@ var de = class extends Ce {
1981
1981
  }
1982
1982
  initSessionFlusher() {
1983
1983
  let { release: e, environment: n } = this._options;
1984
- e ? this._sessionFlusher = new Pe(this, { release: e, environment: n }) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("Cannot initialise an instance of SessionFlusher if no release is provided!");
1984
+ e ? this._sessionFlusher = new Ce(this, { release: e, environment: n }) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.warn("Cannot initialise an instance of SessionFlusher if no release is provided!");
1985
1985
  }
1986
1986
  captureCheckIn(e, n, r) {
1987
1987
  let s = e.status !== "in_progress" && e.checkInId ? e.checkInId : h();
@@ -1990,7 +1990,7 @@ var de = class extends Ce {
1990
1990
  e.status !== "in_progress" && (u.duration = e.duration), n && (u.monitor_config = { schedule: n.schedule, checkin_margin: n.checkinMargin, max_runtime: n.maxRuntime, timezone: n.timezone });
1991
1991
  let [f, d] = this._getTraceInfoFromScope(r);
1992
1992
  d && (u.contexts = { trace: d });
1993
- let l = In(u, f, this.getSdkMetadata(), c, this.getDsn());
1993
+ let l = xn(u, f, this.getSdkMetadata(), c, this.getDsn());
1994
1994
  return (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && p.info("Sending checkin:", e.monitorSlug, e.status), this._sendEnvelope(l), s;
1995
1995
  }
1996
1996
  _captureRequestSession() {
@@ -2007,8 +2007,8 @@ var de = class extends Ce {
2007
2007
  return o ? [o, a] : [J(r, this, e), a];
2008
2008
  }
2009
2009
  };
2010
- var Gr = 30;
2011
- function St(t, e, n = et(t.bufferSize || Gr)) {
2010
+ var Fr = 30;
2011
+ function St(t, e, n = et(t.bufferSize || Fr)) {
2012
2012
  let r = {}, s = (o) => n.drain(o);
2013
2013
  function i(o) {
2014
2014
  let a = [];
@@ -2019,7 +2019,7 @@ function St(t, e, n = et(t.bufferSize || Gr)) {
2019
2019
  t.recordDroppedEvent("ratelimit_backoff", _, M);
2020
2020
  } else a.push(d);
2021
2021
  }), a.length === 0) return T();
2022
- let c = C(o[0], a), u = (d) => {
2022
+ let c = P(o[0], a), u = (d) => {
2023
2023
  Ne(c, (l, _) => {
2024
2024
  let M = Dn(l, _);
2025
2025
  t.recordDroppedEvent(d, ke(_), M);
@@ -2040,13 +2040,13 @@ function Dn(t, e) {
2040
2040
  function kn(t) {
2041
2041
  return typeof t == "object" && t !== null;
2042
2042
  }
2043
- function Fr(t) {
2043
+ function Br(t) {
2044
2044
  return kn(t) && "handled" in t && typeof t.handled == "boolean" && "type" in t && typeof t.type == "string";
2045
2045
  }
2046
- function Br(t) {
2047
- return kn(t) && "mechanism" in t && Fr(t.mechanism);
2046
+ function Lr(t) {
2047
+ return kn(t) && "mechanism" in t && Br(t.mechanism);
2048
2048
  }
2049
- function Lr() {
2049
+ function Yr() {
2050
2050
  if (m.SENTRY_RELEASE && m.SENTRY_RELEASE.id) return m.SENTRY_RELEASE.id;
2051
2051
  }
2052
2052
  function Nn(t, e) {
@@ -2055,16 +2055,16 @@ function Nn(t, e) {
2055
2055
  function On(t, e) {
2056
2056
  return t(e.stack || "", 1);
2057
2057
  }
2058
- function Yr(t) {
2058
+ function $r(t) {
2059
2059
  let e = t && t.message;
2060
2060
  return e ? e.error && typeof e.error.message == "string" ? e.error.message : e : "No error message";
2061
2061
  }
2062
2062
  function An(t, e) {
2063
- let n = { type: e.name || e.constructor.name, value: Yr(e) }, r = On(t, e);
2063
+ let n = { type: e.name || e.constructor.name, value: $r(e) }, r = On(t, e);
2064
2064
  return r.length && (n.stacktrace = { frames: r }), n.type === void 0 && n.value === "" && (n.value = "Unrecoverable error caught"), n;
2065
2065
  }
2066
- function $r(t, e, n, r) {
2067
- let s, o = (r && r.data && Br(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
2066
+ function jr(t, e, n, r) {
2067
+ let s, o = (r && r.data && Lr(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
2068
2068
  if (U(n)) s = n;
2069
2069
  else {
2070
2070
  if (R(n)) {
@@ -2078,7 +2078,7 @@ function $r(t, e, n, r) {
2078
2078
  let a = { exception: { values: [An(e, s)] } };
2079
2079
  return ie(a, void 0, void 0), oe(a, o), { ...a, event_id: r && r.event_id };
2080
2080
  }
2081
- function jr(t, e, n = "info", r, s) {
2081
+ function Hr(t, e, n = "info", r, s) {
2082
2082
  let i = { event_id: r && r.event_id, level: n, message: e };
2083
2083
  if (s && r && r.syntheticException) {
2084
2084
  let o = On(t, r.syntheticException);
@@ -2086,58 +2086,58 @@ function jr(t, e, n = "info", r, s) {
2086
2086
  }
2087
2087
  return i;
2088
2088
  }
2089
- var Hr = 5;
2089
+ var qr = 5;
2090
2090
  var Fe = class {
2091
2091
  name = Fe.id;
2092
2092
  limit;
2093
2093
  constructor(e = {}) {
2094
- this.limit = e.limit || Hr;
2094
+ this.limit = e.limit || qr;
2095
2095
  }
2096
2096
  setupOnce(e, n) {
2097
2097
  let r = n().getClient();
2098
2098
  r && e((s, i) => {
2099
2099
  let o = n().getIntegration(Fe);
2100
- return o ? qr(r.getOptions().stackParser, o.limit, s, i) : s;
2100
+ return o ? zr(r.getOptions().stackParser, o.limit, s, i) : s;
2101
2101
  });
2102
2102
  }
2103
2103
  };
2104
2104
  var Me = Fe;
2105
2105
  fe(Me, "id", "LinkedErrors");
2106
- function qr(t, e, n, r) {
2106
+ function zr(t, e, n, r) {
2107
2107
  if (!n.exception || !n.exception.values || !r || !O(r.originalException, Error)) return n;
2108
- let s = vn(t, e, r.originalException);
2108
+ let s = wn(t, e, r.originalException);
2109
2109
  return n.exception.values = [...s, ...n.exception.values], n;
2110
2110
  }
2111
- function vn(t, e, n, r = []) {
2111
+ function wn(t, e, n, r = []) {
2112
2112
  if (!O(n.cause, Error) || r.length + 1 >= e) return r;
2113
2113
  let s = An(t, n.cause);
2114
- return vn(t, e, n.cause, [s, ...r]);
2114
+ return wn(t, e, n.cause, [s, ...r]);
2115
2115
  }
2116
- var zr = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
2116
+ var Wr = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
2117
2117
  var X;
2118
2118
  var Be = class {
2119
2119
  constructor(e = {}) {
2120
2120
  fe(this, "name", Be.id);
2121
2121
  Rt(this, X, void 0);
2122
- xt(this, X, { ...zr, ...e });
2122
+ It(this, X, { ...Wr, ...e });
2123
2123
  }
2124
2124
  setupOnce(e, n) {
2125
2125
  n().getClient() && e((s) => {
2126
2126
  let { sdkProcessingMetadata: i } = s;
2127
- return !n().getIntegration(Be) || !i || ("request" in i && i.request instanceof Request && (s.request = Kr(i.request, Ye(this, X)), s.user = Wr(s.user ?? {}, i.request, Ye(this, X))), "requestData" in i && (s.request ? s.request.data = i.requestData : s.request = { data: i.requestData })), s;
2127
+ return !n().getIntegration(Be) || !i || ("request" in i && i.request instanceof Request && (s.request = Vr(i.request, Ye(this, X)), s.user = Kr(s.user ?? {}, i.request, Ye(this, X))), "requestData" in i && (s.request ? s.request.data = i.requestData : s.request = { data: i.requestData })), s;
2128
2128
  });
2129
2129
  }
2130
2130
  };
2131
2131
  var Ue = Be;
2132
2132
  X = /* @__PURE__ */ new WeakMap(), fe(Ue, "id", "RequestData");
2133
- function Wr(t, e, n) {
2133
+ function Kr(t, e, n) {
2134
2134
  let r = e.headers.get("CF-Connecting-IP"), { allowedIps: s } = n, i = { ...t };
2135
- return !("ip_address" in t) && r && s !== void 0 && Vr(r, s) && (i.ip_address = r), Object.keys(i).length > 0 ? i : void 0;
2135
+ return !("ip_address" in t) && r && s !== void 0 && Jr(r, s) && (i.ip_address = r), Object.keys(i).length > 0 ? i : void 0;
2136
2136
  }
2137
- function Kr(t, e) {
2137
+ function Vr(t, e) {
2138
2138
  let n = t.headers.get("cookie"), r;
2139
2139
  if (n) try {
2140
- r = Jr(n);
2140
+ r = Xr(n);
2141
2141
  } catch {
2142
2142
  }
2143
2143
  let s = {};
@@ -2159,7 +2159,7 @@ function Kr(t, e) {
2159
2159
  } else delete i.query_string;
2160
2160
  return i;
2161
2161
  }
2162
- function Vr(t, e) {
2162
+ function Jr(t, e) {
2163
2163
  return typeof e == "boolean" ? e : e instanceof RegExp ? e.test(t) : Array.isArray(e) ? e.map((r) => r.toLowerCase()).includes(t) : false;
2164
2164
  }
2165
2165
  function yt(t, e) {
@@ -2172,7 +2172,7 @@ function yt(t, e) {
2172
2172
  } else return {};
2173
2173
  return Object.keys(t).filter(n).reduce((r, s) => (r[s] = t[s], r), {});
2174
2174
  }
2175
- function Jr(t) {
2175
+ function Xr(t) {
2176
2176
  if (typeof t != "string") return {};
2177
2177
  try {
2178
2178
  return t.split(";").map((e) => e.split("=")).reduce((e, [n, r]) => (e[decodeURIComponent(n.trim())] = decodeURIComponent(r.trim()), e), {});
@@ -2180,7 +2180,7 @@ function Jr(t) {
2180
2180
  return {};
2181
2181
  }
2182
2182
  }
2183
- function Xr(t, e) {
2183
+ function Zr(t, e) {
2184
2184
  let n = {};
2185
2185
  return t.forEach((r) => {
2186
2186
  n[r.name] = r, r.setupOnce((s) => {
@@ -2194,13 +2194,13 @@ var Tt = class extends de {
2194
2194
  e._metadata = e._metadata || {}, e._metadata.sdk = e._metadata.sdk || { name: "toucan-js", packages: [{ name: "npm:toucan-js", version: "3.3.1" }], version: "3.3.1" }, super(e);
2195
2195
  }
2196
2196
  setupIntegrations() {
2197
- this._isEnabled() && !this._integrationsInitialized && this.#e && (this._integrations = Xr(this._options.integrations, this.#e), this._integrationsInitialized = true);
2197
+ this._isEnabled() && !this._integrationsInitialized && this.#e && (this._integrations = Zr(this._options.integrations, this.#e), this._integrationsInitialized = true);
2198
2198
  }
2199
2199
  eventFromException(e, n) {
2200
- return T($r(this.#e, this._options.stackParser, e, n));
2200
+ return T(jr(this.#e, this._options.stackParser, e, n));
2201
2201
  }
2202
2202
  eventFromMessage(e, n = "info", r) {
2203
- return T(jr(this._options.stackParser, e, n, r, this._options.attachStacktrace));
2203
+ return T(Hr(this._options.stackParser, e, n, r, this._options.attachStacktrace));
2204
2204
  }
2205
2205
  _prepareEvent(e, n, r) {
2206
2206
  return e.platform = e.platform || "javascript", this.getOptions().request && (e.sdkProcessingMetadata = Nn(e.sdkProcessingMetadata, ["request", this.getOptions().request])), this.getOptions().requestData && (e.sdkProcessingMetadata = Nn(e.sdkProcessingMetadata, ["requestData", this.getOptions().requestData])), super._prepareEvent(e, n, r);
@@ -2218,7 +2218,7 @@ var Tt = class extends de {
2218
2218
  this.getOptions().enabled = e;
2219
2219
  }
2220
2220
  };
2221
- function Zr(t) {
2221
+ function Qr(t) {
2222
2222
  let [e, n] = Je(t);
2223
2223
  return [e, (s) => {
2224
2224
  let i = n(s);
@@ -2229,11 +2229,11 @@ function Zr(t) {
2229
2229
  return i;
2230
2230
  }];
2231
2231
  }
2232
- function Qr(t) {
2232
+ function es(t) {
2233
2233
  if (t) return Qe(t, ".js");
2234
2234
  }
2235
- var es = Ee(Zr(Qr));
2236
- function ts(t) {
2235
+ var ts = Ee(Qr(es));
2236
+ function ns(t) {
2237
2237
  function e({ body: n }) {
2238
2238
  try {
2239
2239
  let s = (t.fetcher ?? fetch)(t.url, { method: "POST", headers: t.headers, body: n }).then((i) => ({ statusCode: i.status, headers: { "retry-after": i.headers.get("Retry-After"), "x-sentry-rate-limits": i.headers.get("X-Sentry-Rate-Limits") } }));
@@ -2247,10 +2247,10 @@ function ts(t) {
2247
2247
  var Ge = class extends Y {
2248
2248
  constructor(e) {
2249
2249
  if (e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [new Ue(e.requestDataOptions), new Me()]], e.release === void 0) {
2250
- let r = Lr();
2250
+ let r = Yr();
2251
2251
  r !== void 0 && (e.release = r);
2252
2252
  }
2253
- let n = new Tt({ ...e, transport: ts, integrations: gt(e), stackParser: Ve(e.stackParser || es), transportOptions: { ...e.transportOptions, context: e.context } });
2253
+ let n = new Tt({ ...e, transport: ns, integrations: gt(e), stackParser: Ve(e.stackParser || ts), transportOptions: { ...e.transportOptions, context: e.context } });
2254
2254
  super(n), n.setSdk(this), n.setupIntegrations();
2255
2255
  }
2256
2256
  setRequestBody(e) {
@@ -2263,12 +2263,19 @@ var Ge = class extends Y {
2263
2263
  return e.status === "in_progress" && this.setContext("monitor", { slug: e.monitorSlug }), this.getClient().captureCheckIn(e, n, r);
2264
2264
  }
2265
2265
  };
2266
- function wn(t, e, n, r, s) {
2266
+ function vn(t, e, n, r, s, i, o, a) {
2267
2267
  if (!(n && r && s)) return;
2268
- let i = new Ge({ dsn: n, request: t, context: e, sampleRate: 1, requestDataOptions: { allowedHeaders: ["user-agent", "cf-challenge", "accept-encoding", "accept-language", "cf-ray", "content-length", "content-type", "host"], allowedSearchParams: /(.*)/ }, transportOptions: { headers: { "CF-Access-Client-ID": r, "CF-Access-Client-Secret": s } } }), o = t.cf?.colo ?? "UNKNOWN";
2269
- i.setTag("colo", o);
2270
- let a = t.headers.get("user-agent") ?? "UA UNKNOWN";
2271
- return i.setUser({ userAgent: a, colo: o }), i;
2268
+ let c = new Ge({ dsn: n, request: t, context: e, sampleRate: 1, requestDataOptions: { allowedHeaders: ["user-agent", "cf-challenge", "accept-encoding", "accept-language", "cf-ray", "content-length", "content-type", "host"], allowedSearchParams: /(.*)/ }, transportOptions: { headers: { "CF-Access-Client-ID": r, "CF-Access-Client-Secret": s } } });
2269
+ return i && (c.setTag("colo", i.coloId), c.setTag("metal", i.metalId)), o && a && (c.setTag("accountId", o), c.setTag("scriptId", a)), c.setUser({ id: o?.toString() }), c;
2270
+ }
2271
+ function rs() {
2272
+ return { addLogs: () => {
2273
+ }, setTags: () => {
2274
+ }, end: () => {
2275
+ }, isRecording: true };
2276
+ }
2277
+ function Cn() {
2278
+ return { enterSpan: (t, e, ...n) => e(rs(), ...n), getSpanContext: () => ({ traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", traceFlags: 0 }), runWithSpanContext: (t, e, ...n) => e(...n), traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", cfTraceIdHeader: "test-trace:test-span:0" };
2272
2279
  }
2273
2280
  var Le = class {
2274
2281
  constructor(e) {
@@ -2282,21 +2289,20 @@ var Le = class {
2282
2289
  return this.data[e];
2283
2290
  }
2284
2291
  write() {
2285
- this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId: 0, indexId: this.data.hostname?.substring(0, 96), doubles: [this.data.requestTime ?? -1, this.data.coloId ?? -1, this.data.metalId ?? -1, this.data.coloTier ?? -1, this.data.userWorkerAhead === void 0 ? -1 : Number(this.data.userWorkerAhead)], blobs: [this.data.hostname?.substring(0, 256), this.data.dispatchtype, this.data.error?.substring(0, 256), this.data.version, this.data.coloRegion] });
2292
+ this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId: this.data.accountId, indexId: this.data.scriptId?.toString(), doubles: [this.data.requestTime ?? -1, this.data.coloId ?? -1, this.data.metalId ?? -1, this.data.coloTier ?? -1, this.data.userWorkerAhead === void 0 ? -1 : Number(this.data.userWorkerAhead)], blobs: [this.data.hostname?.substring(0, 256), this.data.dispatchtype, this.data.error?.substring(0, 256), this.data.version, this.data.coloRegion] });
2286
2293
  }
2287
2294
  };
2288
- var Za = { async fetch(t, e, n) {
2295
+ var nc = { async fetch(t, e, n) {
2289
2296
  let r, s = new Le(e.ANALYTICS), i = new pe(e.UNSAFE_PERFORMANCE), o = i.now();
2290
2297
  try {
2291
- r = wn(t, n, e.SENTRY_DSN, e.SENTRY_ACCESS_CLIENT_ID, e.SENTRY_ACCESS_CLIENT_SECRET);
2298
+ e.JAEGER || (e.JAEGER = Cn()), r = vn(t, n, e.SENTRY_DSN, e.SENTRY_ACCESS_CLIENT_ID, e.SENTRY_ACCESS_CLIENT_SECRET, e.COLO_METADATA, e.CONFIG?.account_id, e.CONFIG?.script_id);
2292
2299
  let a = new URL(t.url);
2293
- r && (r.setUser({ username: a.hostname }), r.setTag("colo", e.COLO_METADATA.coloId), r.setTag("metal", e.COLO_METADATA.metalId)), e.COLO_METADATA && e.VERSION_METADATA && e.CONFIG && s.setData({ coloId: e.COLO_METADATA.coloId, metalId: e.COLO_METADATA.metalId, coloTier: e.COLO_METADATA.coloTier, coloRegion: e.COLO_METADATA.coloRegion, hostname: a.hostname, version: e.VERSION_METADATA.id, userWorkerAhead: e.CONFIG.invoke_user_worker_ahead_of_assets });
2300
+ e.COLO_METADATA && e.VERSION_METADATA && e.CONFIG && s.setData({ accountId: e.CONFIG.account_id, scriptId: e.CONFIG.script_id, coloId: e.COLO_METADATA.coloId, metalId: e.COLO_METADATA.metalId, coloTier: e.COLO_METADATA.coloTier, coloRegion: e.COLO_METADATA.coloRegion, hostname: a.hostname, version: e.VERSION_METADATA.id, userWorkerAhead: e.CONFIG.invoke_user_worker_ahead_of_assets });
2294
2301
  let c = t.clone();
2295
- if (e.CONFIG.invoke_user_worker_ahead_of_assets) {
2302
+ return e.CONFIG.invoke_user_worker_ahead_of_assets ? e.JAEGER.enterSpan("invoke_user_worker_first", async () => {
2296
2303
  if (!e.CONFIG.has_user_worker) throw new Error("Fetch for user worker without having a user worker binding");
2297
2304
  return e.USER_WORKER.fetch(c);
2298
- }
2299
- return e.CONFIG.has_user_worker ? await e.ASSET_WORKER.unstable_canFetch(t) ? (s.setData({ dispatchtype: "asset" }), e.ASSET_WORKER.fetch(c)) : (s.setData({ dispatchtype: "worker" }), e.USER_WORKER.fetch(c)) : (s.setData({ dispatchtype: "asset" }), e.ASSET_WORKER.fetch(t));
2305
+ }) : e.CONFIG.has_user_worker ? e.JAEGER.enterSpan("has_user_worker", async (u) => await e.ASSET_WORKER.unstable_canFetch(t) ? (u.setTags({ asset: true, dispatchType: "asset" }), s.setData({ dispatchtype: "asset" }), e.ASSET_WORKER.fetch(c)) : (u.setTags({ asset: false, dispatchType: "worker" }), s.setData({ dispatchtype: "worker" }), e.USER_WORKER.fetch(c))) : e.JAEGER.enterSpan("assets_only", async (u) => (u.setTags({ asset: true, dispatchType: "asset" }), s.setData({ dispatchtype: "asset" }), e.ASSET_WORKER.fetch(t)));
2300
2306
  } catch (a) {
2301
2307
  throw a instanceof Error && s.setData({ error: a.message }), r && r.captureException(a), a;
2302
2308
  } finally {
@@ -2305,7 +2311,7 @@ var Za = { async fetch(t, e, n) {
2305
2311
  } };
2306
2312
 
2307
2313
  // src/asset-workers/router-worker.ts
2308
- var router_worker_default = Za;
2314
+ var router_worker_default = nc;
2309
2315
  export {
2310
2316
  router_worker_default as default
2311
2317
  };