@cloudflare/vite-plugin 0.1.8 → 0.1.10

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.
@@ -8,7 +8,7 @@ var fe = class {
8
8
  }
9
9
  };
10
10
  var bt = Object.prototype.toString;
11
- function L(t) {
11
+ function F(t) {
12
12
  switch (bt.call(t)) {
13
13
  case "[object Error]":
14
14
  case "[object Exception]":
@@ -18,14 +18,14 @@ function L(t) {
18
18
  return O(t, Error);
19
19
  }
20
20
  }
21
- function Le(t, e) {
21
+ function Fe(t, e) {
22
22
  return bt.call(t) === `[object ${e}]`;
23
23
  }
24
24
  function Ue(t) {
25
- return Le(t, "ErrorEvent");
25
+ return Fe(t, "ErrorEvent");
26
26
  }
27
27
  function Be(t) {
28
- return Le(t, "String");
28
+ return Fe(t, "String");
29
29
  }
30
30
  function H(t) {
31
31
  return typeof t == "object" && t !== null && "__sentry_template_string__" in t && "__sentry_template_values__" in t;
@@ -34,7 +34,7 @@ function de(t) {
34
34
  return t === null || H(t) || typeof t != "object" && typeof t != "function";
35
35
  }
36
36
  function b(t) {
37
- return Le(t, "Object");
37
+ return Fe(t, "Object");
38
38
  }
39
39
  function $e(t) {
40
40
  return typeof Event < "u" && O(t, Event);
@@ -62,27 +62,27 @@ function k(t, e = 0) {
62
62
  return typeof t != "string" || e === 0 || t.length <= e ? t : `${t.slice(0, e)}...`;
63
63
  }
64
64
  var D = "8.9.2";
65
- var l = globalThis;
65
+ var m = globalThis;
66
66
  function q(t, e, n) {
67
- let r = n || l, o = r.__SENTRY__ = r.__SENTRY__ || {}, s = o[D] = o[D] || {};
67
+ let r = n || m, o = r.__SENTRY__ = r.__SENTRY__ || {}, s = o[D] = o[D] || {};
68
68
  return s[t] || (s[t] = e());
69
69
  }
70
- var Nn = l;
71
- var kn = 80;
70
+ var kn = m;
71
+ var Dn = 80;
72
72
  function Rt(t, e = {}) {
73
73
  if (!t) return "<unknown>";
74
74
  try {
75
- let n = t, r = 5, o = [], s = 0, i = 0, a = " > ", c = a.length, u, f = Array.isArray(e) ? e : e.keyAttrs, p = !Array.isArray(e) && e.maxStringLength || kn;
76
- for (; n && s++ < r && (u = Dn(n, f), !(u === "html" || s > 1 && i + o.length * c + u.length >= p)); ) o.push(u), i += u.length, n = n.parentNode;
75
+ let n = t, r = 5, o = [], s = 0, i = 0, a = " > ", c = a.length, u, f = Array.isArray(e) ? e : e.keyAttrs, p = !Array.isArray(e) && e.maxStringLength || Dn;
76
+ for (; n && s++ < r && (u = vn(n, f), !(u === "html" || s > 1 && i + o.length * c + u.length >= p)); ) o.push(u), i += u.length, n = n.parentNode;
77
77
  return o.reverse().join(a);
78
78
  } catch {
79
79
  return "<unknown>";
80
80
  }
81
81
  }
82
- function Dn(t, e) {
82
+ function vn(t, e) {
83
83
  let n = t, r = [], o, s, i, a, c;
84
84
  if (!n || !n.tagName) return "";
85
- if (Nn.HTMLElement && n instanceof HTMLElement && n.dataset) {
85
+ if (kn.HTMLElement && n instanceof HTMLElement && n.dataset) {
86
86
  if (n.dataset.sentryComponent) return n.dataset.sentryComponent;
87
87
  if (n.dataset.sentryElement) return n.dataset.sentryElement;
88
88
  }
@@ -97,12 +97,12 @@ function Dn(t, e) {
97
97
  return r.join("");
98
98
  }
99
99
  var v = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__;
100
- var vn = "Sentry Logger ";
100
+ var Mn = "Sentry Logger ";
101
101
  var qe = ["debug", "info", "warn", "error", "log", "assert", "trace"];
102
102
  var ze = {};
103
103
  function le(t) {
104
- if (!("console" in l)) return t();
105
- let e = l.console, n = {}, r = Object.keys(ze);
104
+ if (!("console" in m)) return t();
105
+ let e = m.console, n = {}, r = Object.keys(ze);
106
106
  r.forEach((o) => {
107
107
  let s = ze[o];
108
108
  n[o] = e[o], e[o] = s;
@@ -115,7 +115,7 @@ function le(t) {
115
115
  });
116
116
  }
117
117
  }
118
- function Mn() {
118
+ function Pn() {
119
119
  let t = false, e = { enable: () => {
120
120
  t = true;
121
121
  }, disable: () => {
@@ -124,7 +124,7 @@ function Mn() {
124
124
  return v ? qe.forEach((n) => {
125
125
  e[n] = (...r) => {
126
126
  t && le(() => {
127
- l.console[n](`${vn}[${n}]:`, ...r);
127
+ m.console[n](`${Mn}[${n}]:`, ...r);
128
128
  });
129
129
  };
130
130
  }) : qe.forEach((n) => {
@@ -132,9 +132,9 @@ function Mn() {
132
132
  };
133
133
  }), e;
134
134
  }
135
- var d = Mn();
136
- var Pn = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
137
- function wn(t) {
135
+ var d = Pn();
136
+ var wn = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
137
+ function Ln(t) {
138
138
  return t === "http" || t === "https";
139
139
  }
140
140
  function M(t, e = false) {
@@ -142,7 +142,7 @@ function M(t, e = false) {
142
142
  return `${a}://${c}${e && o ? `:${o}` : ""}@${n}${s ? `:${s}` : ""}/${r && `${r}/`}${i}`;
143
143
  }
144
144
  function Ct(t) {
145
- let e = Pn.exec(t);
145
+ let e = wn.exec(t);
146
146
  if (!e) {
147
147
  le(() => {
148
148
  console.error(`Invalid Sentry Dsn: ${t}`);
@@ -162,7 +162,7 @@ function Ot(t) {
162
162
  function Fn(t) {
163
163
  if (!v) return true;
164
164
  let { port: e, projectId: n, protocol: r } = t;
165
- return ["protocol", "publicKey", "host", "projectId"].find((i) => t[i] ? false : (d.error(`Invalid Sentry Dsn: ${i} missing`), true)) ? false : n.match(/^\d+$/) ? wn(r) ? e && isNaN(parseInt(e, 10)) ? (d.error(`Invalid Sentry Dsn: Invalid port ${e}`), false) : true : (d.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), false) : (d.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), false);
165
+ return ["protocol", "publicKey", "host", "projectId"].find((i) => t[i] ? false : (d.error(`Invalid Sentry Dsn: ${i} missing`), true)) ? false : n.match(/^\d+$/) ? Ln(r) ? e && isNaN(parseInt(e, 10)) ? (d.error(`Invalid Sentry Dsn: Invalid port ${e}`), false) : true : (d.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), false) : (d.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), false);
166
166
  }
167
167
  function me(t) {
168
168
  let e = typeof t == "string" ? Ct(t) : Ot(t);
@@ -184,7 +184,7 @@ function Je(t) {
184
184
  return Object.keys(t).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&");
185
185
  }
186
186
  function ge(t) {
187
- if (L(t)) return { message: t.message, name: t.name, stack: t.stack, ...kt(t) };
187
+ if (F(t)) return { message: t.message, name: t.name, stack: t.stack, ...kt(t) };
188
188
  if ($e(t)) {
189
189
  let e = { type: t.type, target: Nt(t.target), currentTarget: Nt(t.currentTarget), ...kt(t) };
190
190
  return typeof CustomEvent < "u" && O(t, CustomEvent) && (e.detail = t.detail), e;
@@ -218,7 +218,7 @@ function E(t) {
218
218
  return Ye(t, /* @__PURE__ */ new Map());
219
219
  }
220
220
  function Ye(t, e) {
221
- if (Ln(t)) {
221
+ if (Un(t)) {
222
222
  let n = e.get(t);
223
223
  if (n !== void 0) return n;
224
224
  let r = {};
@@ -236,7 +236,7 @@ function Ye(t, e) {
236
236
  }
237
237
  return t;
238
238
  }
239
- function Ln(t) {
239
+ function Un(t) {
240
240
  if (!b(t)) return false;
241
241
  try {
242
242
  let e = Object.getPrototypeOf(t).constructor.name;
@@ -310,16 +310,16 @@ var wt = 1e3;
310
310
  function z() {
311
311
  return Date.now() / wt;
312
312
  }
313
- function Un() {
314
- let { performance: t } = l;
313
+ function Bn() {
314
+ let { performance: t } = m;
315
315
  if (!t || !t.now) return z;
316
316
  let e = Date.now() - t.now(), n = t.timeOrigin == null ? e : t.timeOrigin;
317
317
  return () => (n + t.now()) / wt;
318
318
  }
319
- var Q = Un();
319
+ var Q = Bn();
320
320
  var Z;
321
- var Bn = (() => {
322
- let { performance: t } = l;
321
+ var $n = (() => {
322
+ let { performance: t } = m;
323
323
  if (!t || !t.now) {
324
324
  Z = "none";
325
325
  return;
@@ -330,24 +330,24 @@ var Bn = (() => {
330
330
  var Ie = null;
331
331
  function Ve(t) {
332
332
  let e = "error";
333
- Se(e, t), ye(e, $n);
333
+ Se(e, t), ye(e, jn);
334
334
  }
335
- function $n() {
336
- Ie = l.onerror, l.onerror = function(t, e, n, r, o) {
335
+ function jn() {
336
+ Ie = m.onerror, m.onerror = function(t, e, n, r, o) {
337
337
  return Te("error", { column: r, error: o, line: n, msg: t, url: e }), Ie && !Ie.__SENTRY_LOADER__ ? Ie.apply(this, arguments) : false;
338
- }, l.onerror.__SENTRY_INSTRUMENTED__ = true;
338
+ }, m.onerror.__SENTRY_INSTRUMENTED__ = true;
339
339
  }
340
340
  var xe = null;
341
341
  function Xe(t) {
342
342
  let e = "unhandledrejection";
343
- Se(e, t), ye(e, jn);
343
+ Se(e, t), ye(e, Gn);
344
344
  }
345
- function jn() {
346
- xe = l.onunhandledrejection, l.onunhandledrejection = function(t) {
345
+ function Gn() {
346
+ xe = m.onunhandledrejection, m.onunhandledrejection = function(t) {
347
347
  return Te("unhandledrejection", t), xe && !xe.__SENTRY_LOADER__ ? xe.apply(this, arguments) : true;
348
- }, l.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
348
+ }, m.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
349
349
  }
350
- function Ft() {
350
+ function Lt() {
351
351
  let t = typeof WeakSet == "function", e = t ? /* @__PURE__ */ new WeakSet() : [];
352
352
  function n(o) {
353
353
  if (t) return e.has(o) ? true : (e.add(o), false);
@@ -364,7 +364,7 @@ function Ft() {
364
364
  return [n, r];
365
365
  }
366
366
  function S() {
367
- let t = l, e = t.crypto || t.msCrypto, n = () => Math.random() * 16;
367
+ let t = m, e = t.crypto || t.msCrypto, n = () => Math.random() * 16;
368
368
  try {
369
369
  if (e && e.randomUUID) return e.randomUUID().replace(/-/g, "");
370
370
  e && e.getRandomValues && (n = () => {
@@ -375,7 +375,7 @@ function S() {
375
375
  }
376
376
  return ("10000000100040008000" + 1e11).replace(/[018]/g, (r) => (r ^ (n() & 15) >> r / 4).toString(16));
377
377
  }
378
- function Gn(t) {
378
+ function Hn(t) {
379
379
  return t.exception && t.exception.values ? t.exception.values[0] : void 0;
380
380
  }
381
381
  function ee(t, e, n) {
@@ -383,7 +383,7 @@ function ee(t, e, n) {
383
383
  s.value || (s.value = e || ""), s.type || (s.type = n || "Error");
384
384
  }
385
385
  function B(t, e) {
386
- let n = Gn(t);
386
+ let n = Hn(t);
387
387
  if (!n) return;
388
388
  let r = { type: "generic", handled: true }, o = n.mechanism;
389
389
  if (n.mechanism = { ...r, ...o, ...e }, e && "data" in e) {
@@ -411,12 +411,12 @@ function R(t, e = 100, n = 1 / 0) {
411
411
  }
412
412
  function Y(t, e = 3, n = 100 * 1024) {
413
413
  let r = R(t, e);
414
- return Yn(r) > n ? Y(t, e - 1, n) : r;
414
+ return Jn(r) > n ? Y(t, e - 1, n) : r;
415
415
  }
416
- function Ze(t, e, n = 1 / 0, r = 1 / 0, o = Ft()) {
416
+ function Ze(t, e, n = 1 / 0, r = 1 / 0, o = Lt()) {
417
417
  let [s, i] = o;
418
418
  if (e == null || ["number", "boolean", "string"].includes(typeof e) && !Number.isNaN(e)) return e;
419
- let a = Hn(t, e);
419
+ let a = qn(t, e);
420
420
  if (!a.startsWith("[object ")) return a;
421
421
  if (e.__sentry_skip_normalization__) return e;
422
422
  let c = typeof e.__sentry_override_normalization_depth__ == "number" ? e.__sentry_override_normalization_depth__ : n;
@@ -424,23 +424,23 @@ function Ze(t, e, n = 1 / 0, r = 1 / 0, o = Ft()) {
424
424
  if (s(e)) return "[Circular ~]";
425
425
  let u = e;
426
426
  if (u && typeof u.toJSON == "function") try {
427
- let m = u.toJSON();
428
- return Ze("", m, c - 1, r, o);
427
+ let g = u.toJSON();
428
+ return Ze("", g, c - 1, r, o);
429
429
  } catch {
430
430
  }
431
- let f = Array.isArray(e) ? [] : {}, p = 0, g = ge(e);
432
- for (let m in g) {
433
- if (!Object.prototype.hasOwnProperty.call(g, m)) continue;
431
+ let f = Array.isArray(e) ? [] : {}, p = 0, l = ge(e);
432
+ for (let g in l) {
433
+ if (!Object.prototype.hasOwnProperty.call(l, g)) continue;
434
434
  if (p >= r) {
435
- f[m] = "[MaxProperties ~]";
435
+ f[g] = "[MaxProperties ~]";
436
436
  break;
437
437
  }
438
- let h = g[m];
439
- f[m] = Ze(m, h, c - 1, r, o), p++;
438
+ let h = l[g];
439
+ f[g] = Ze(g, h, c - 1, r, o), p++;
440
440
  }
441
441
  return i(e), f;
442
442
  }
443
- function Hn(t, e) {
443
+ function qn(t, e) {
444
444
  try {
445
445
  if (t === "domain" && e && typeof e == "object" && e._events) return "[Domain]";
446
446
  if (t === "domainEmitter") return "[DomainEmitter]";
@@ -453,23 +453,23 @@ function Hn(t, e) {
453
453
  if (typeof e == "function") return `[Function: ${X(e)}]`;
454
454
  if (typeof e == "symbol") return `[${String(e)}]`;
455
455
  if (typeof e == "bigint") return `[BigInt: ${String(e)}]`;
456
- let n = qn(e);
456
+ let n = zn(e);
457
457
  return /^HTML(\w*)Element$/.test(n) ? `[HTMLElement: ${n}]` : `[object ${n}]`;
458
458
  } catch (n) {
459
459
  return `**non-serializable** (${n})`;
460
460
  }
461
461
  }
462
- function qn(t) {
462
+ function zn(t) {
463
463
  let e = Object.getPrototypeOf(t);
464
464
  return e ? e.constructor.name : "null prototype";
465
465
  }
466
- function zn(t) {
466
+ function Yn(t) {
467
467
  return ~-encodeURI(t).split(/%..|./).length;
468
468
  }
469
- function Yn(t) {
470
- return zn(JSON.stringify(t));
469
+ function Jn(t) {
470
+ return Yn(JSON.stringify(t));
471
471
  }
472
- function Jn(t, e) {
472
+ function Wn(t, e) {
473
473
  let n = 0;
474
474
  for (let r = t.length - 1; r >= 0; r--) {
475
475
  let o = t[r];
@@ -478,9 +478,9 @@ function Jn(t, e) {
478
478
  if (e) for (; n--; n) t.unshift("..");
479
479
  return t;
480
480
  }
481
- var Wn = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;
482
- function Kn(t) {
483
- let e = t.length > 1024 ? `<truncated>${t.slice(-1024)}` : t, n = Wn.exec(e);
481
+ var Kn = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;
482
+ function Vn(t) {
483
+ let e = t.length > 1024 ? `<truncated>${t.slice(-1024)}` : t, n = Kn.exec(e);
484
484
  return n ? n.slice(1) : [];
485
485
  }
486
486
  function Qe(...t) {
@@ -489,9 +489,9 @@ function Qe(...t) {
489
489
  let o = r >= 0 ? t[r] : "/";
490
490
  o && (e = `${o}/${e}`, n = o.charAt(0) === "/");
491
491
  }
492
- return e = Jn(e.split("/").filter((r) => !!r), !n).join("/"), (n ? "/" : "") + e || ".";
492
+ return e = Wn(e.split("/").filter((r) => !!r), !n).join("/"), (n ? "/" : "") + e || ".";
493
493
  }
494
- function Lt(t) {
494
+ function Ft(t) {
495
495
  let e = 0;
496
496
  for (; e < t.length && t[e] === ""; e++) ;
497
497
  let n = t.length - 1;
@@ -500,7 +500,7 @@ function Lt(t) {
500
500
  }
501
501
  function et(t, e) {
502
502
  t = Qe(t).slice(1), e = Qe(e).slice(1);
503
- let n = Lt(t.split("/")), r = Lt(e.split("/")), o = Math.min(n.length, r.length), s = o;
503
+ let n = Ft(t.split("/")), r = Ft(e.split("/")), o = Math.min(n.length, r.length), s = o;
504
504
  for (let a = 0; a < o; a++) if (n[a] !== r[a]) {
505
505
  s = a;
506
506
  break;
@@ -510,7 +510,7 @@ function et(t, e) {
510
510
  return i = i.concat(r.slice(s)), i.join("/");
511
511
  }
512
512
  function ne(t, e) {
513
- let n = Kn(t)[2];
513
+ let n = Vn(t)[2];
514
514
  return e && n.slice(e.length * -1) === e && (n = n.slice(0, n.length - e.length)), n;
515
515
  }
516
516
  var N;
@@ -650,11 +650,11 @@ function Bt(t) {
650
650
  let s, i, a, c, u;
651
651
  if (o[1]) {
652
652
  a = o[1];
653
- let g = a.lastIndexOf(".");
654
- if (a[g - 1] === "." && g--, g > 0) {
655
- s = a.slice(0, g), i = a.slice(g + 1);
656
- let m = s.indexOf(".Module");
657
- m > 0 && (a = a.slice(m + 1), s = s.slice(0, m));
653
+ let l = a.lastIndexOf(".");
654
+ if (a[l - 1] === "." && l--, l > 0) {
655
+ s = a.slice(0, l), i = a.slice(l + 1);
656
+ let g = s.indexOf(".Module");
657
+ g > 0 && (a = a.slice(g + 1), s = s.slice(0, g));
658
658
  }
659
659
  c = void 0;
660
660
  }
@@ -684,7 +684,7 @@ function be(t, e) {
684
684
  return false;
685
685
  }
686
686
  function rt(t) {
687
- return l.__SENTRY__ && l.__SENTRY__.encodePolyfill ? l.__SENTRY__.encodePolyfill(t) : new TextEncoder().encode(t);
687
+ return m.__SENTRY__ && m.__SENTRY__.encodePolyfill ? m.__SENTRY__.encodePolyfill(t) : new TextEncoder().encode(t);
688
688
  }
689
689
  function st(t) {
690
690
  let [e, n] = t, r = JSON.stringify(e);
@@ -706,9 +706,9 @@ ${JSON.stringify(i)}
706
706
  o(c);
707
707
  }
708
708
  }
709
- return typeof r == "string" ? r : Vn(r);
709
+ return typeof r == "string" ? r : Xn(r);
710
710
  }
711
- function Vn(t) {
711
+ function Xn(t) {
712
712
  let e = t.reduce((o, s) => o + s.length, 0), n = new Uint8Array(e), r = 0;
713
713
  for (let o of t) n.set(o, r), r += o.length;
714
714
  return n;
@@ -717,9 +717,9 @@ function it(t) {
717
717
  let e = typeof t.data == "string" ? rt(t.data) : t.data;
718
718
  return [E({ type: "attachment", length: e.length, filename: t.filename, content_type: t.contentType, attachment_type: t.attachmentType }), e];
719
719
  }
720
- var Xn = { 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" };
720
+ var Zn = { 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" };
721
721
  function Re(t) {
722
- return Xn[t];
722
+ return Zn[t];
723
723
  }
724
724
  function Ce(t) {
725
725
  if (!t || !t.sdk) return;
@@ -745,9 +745,9 @@ function ct(t, e, n = Date.now()) {
745
745
  function ut(t, { statusCode: e, headers: n }, r = Date.now()) {
746
746
  let o = { ...t }, s = n && n["x-sentry-rate-limits"], i = n && n["retry-after"];
747
747
  if (s) for (let a of s.trim().split(",")) {
748
- let [c, u, , , f] = a.split(":", 5), p = parseInt(c, 10), g = (isNaN(p) ? 60 : p) * 1e3;
749
- if (!u) o.all = r + g;
750
- else for (let m of u.split(";")) m === "metric_bucket" ? (!f || f.split(";").includes("custom")) && (o[m] = r + g) : o[m] = r + g;
748
+ let [c, u, , , f] = a.split(":", 5), p = parseInt(c, 10), l = (isNaN(p) ? 60 : p) * 1e3;
749
+ if (!u) o.all = r + l;
750
+ else for (let g of u.split(";")) g === "metric_bucket" ? (!f || f.split(";").includes("custom")) && (o[g] = r + l) : o[g] = r + l;
751
751
  }
752
752
  else i ? o.all = r + $t(i, r) : e === 429 && (o.all = r + 60 * 1e3);
753
753
  return o;
@@ -759,42 +759,42 @@ function Gt(t, e) {
759
759
  let n = { type: e.name || e.constructor.name, value: e.message }, r = pt(t, e);
760
760
  return r.length && (n.stacktrace = { frames: r }), n;
761
761
  }
762
- function Zn(t) {
762
+ function Qn(t) {
763
763
  for (let e in t) if (Object.prototype.hasOwnProperty.call(t, e)) {
764
764
  let n = t[e];
765
765
  if (n instanceof Error) return n;
766
766
  }
767
767
  }
768
- function Qn(t) {
768
+ function er(t) {
769
769
  if ("name" in t && typeof t.name == "string") {
770
770
  let r = `'${t.name}' captured as exception`;
771
771
  return "message" in t && typeof t.message == "string" && (r += ` with message '${t.message}'`), r;
772
772
  } else if ("message" in t && typeof t.message == "string") return t.message;
773
773
  let e = V(t);
774
774
  if (Ue(t)) return `Event \`ErrorEvent\` captured as exception with message \`${t.message}\``;
775
- let n = er(t);
775
+ let n = tr(t);
776
776
  return `${n && n !== "Object" ? `'${n}'` : "Object"} captured as exception with keys: ${e}`;
777
777
  }
778
- function er(t) {
778
+ function tr(t) {
779
779
  try {
780
780
  let e = Object.getPrototypeOf(t);
781
781
  return e ? e.constructor.name : void 0;
782
782
  } catch {
783
783
  }
784
784
  }
785
- function tr(t, e, n, r) {
786
- if (L(n)) return [n, void 0];
785
+ function nr(t, e, n, r) {
786
+ if (F(n)) return [n, void 0];
787
787
  if (e.synthetic = true, b(n)) {
788
- let s = t && t.getOptions().normalizeDepth, i = { __serialized__: Y(n, s) }, a = Zn(n);
788
+ let s = t && t.getOptions().normalizeDepth, i = { __serialized__: Y(n, s) }, a = Qn(n);
789
789
  if (a) return [a, i];
790
- let c = Qn(n), u = r && r.syntheticException || new Error(c);
790
+ let c = er(n), u = r && r.syntheticException || new Error(c);
791
791
  return u.message = c, [u, i];
792
792
  }
793
793
  let o = r && r.syntheticException || new Error(n);
794
794
  return o.message = `${n}`, [o, void 0];
795
795
  }
796
796
  function ft(t, e, n, r) {
797
- let s = r && r.data && r.data.mechanism || { handled: true, type: "generic" }, [i, a] = tr(t, s, n, r), c = { exception: { values: [Gt(e, i)] } };
797
+ let s = r && r.data && r.data.mechanism || { handled: true, type: "generic" }, [i, a] = nr(t, s, n, r), c = { exception: { values: [Gt(e, i)] } };
798
798
  return a && (c.extra = a), ee(c, void 0, void 0), B(c, s), { ...c, event_id: r && r.event_id };
799
799
  }
800
800
  function dt(t, e, n = "info", r, o) {
@@ -814,7 +814,7 @@ function Oe() {
814
814
  }
815
815
  var _ = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__;
816
816
  function w() {
817
- return re(l), l;
817
+ return re(m), m;
818
818
  }
819
819
  function re(t) {
820
820
  let e = t.__SENTRY__ = t.__SENTRY__ || {};
@@ -836,7 +836,7 @@ function mt(t, e) {
836
836
  function j(t) {
837
837
  return t[lt];
838
838
  }
839
- var rr = 100;
839
+ var or = 100;
840
840
  var se = class {
841
841
  constructor() {
842
842
  this._notifyingListeners = false, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext = Oe();
@@ -914,7 +914,7 @@ var se = class {
914
914
  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._session = void 0, mt(this, void 0), this._attachments = [], this._propagationContext = Oe(), this._notifyScopeListeners(), this;
915
915
  }
916
916
  addBreadcrumb(e, n) {
917
- let r = typeof n == "number" ? n : rr;
917
+ let r = typeof n == "number" ? n : or;
918
918
  if (r <= 0) return this;
919
919
  let o = { timestamp: z(), ...e }, s = this._breadcrumbs;
920
920
  return s.push(o), this._breadcrumbs = s.length > r ? s.slice(-r) : s, this._notifyScopeListeners(), this;
@@ -1017,10 +1017,10 @@ function J() {
1017
1017
  let t = w(), e = re(t);
1018
1018
  return e.stack = e.stack || new gt(Ht(), qt());
1019
1019
  }
1020
- function or(t) {
1020
+ function sr(t) {
1021
1021
  return J().withScope(t);
1022
1022
  }
1023
- function sr(t, e) {
1023
+ function ir(t, e) {
1024
1024
  let n = J();
1025
1025
  return n.withScope(() => (n.getStackTop().scope = t, e(t)));
1026
1026
  }
@@ -1028,7 +1028,7 @@ function zt(t) {
1028
1028
  return J().withScope(() => t(J().getIsolationScope()));
1029
1029
  }
1030
1030
  function Yt() {
1031
- return { withIsolationScope: zt, withScope: or, withSetScope: sr, withSetIsolationScope: (t, e) => zt(e), getCurrentScope: () => J().getScope(), getIsolationScope: () => J().getIsolationScope() };
1031
+ return { withIsolationScope: zt, withScope: sr, withSetScope: ir, withSetIsolationScope: (t, e) => zt(e), getCurrentScope: () => J().getScope(), getIsolationScope: () => J().getIsolationScope() };
1032
1032
  }
1033
1033
  function ie(t) {
1034
1034
  let e = re(t);
@@ -1048,9 +1048,9 @@ function Jt() {
1048
1048
  function Wt() {
1049
1049
  return ht().getClient();
1050
1050
  }
1051
- var ir = "_sentryMetrics";
1051
+ var ar = "_sentryMetrics";
1052
1052
  function Kt(t) {
1053
- let e = t[ir];
1053
+ let e = t[ar];
1054
1054
  if (!e) return;
1055
1055
  let n = {};
1056
1056
  for (let [, [r, o]] of e) n[r] || (n[r] = []), n[r].push(E(o));
@@ -1060,7 +1060,7 @@ var Vt = "sentry.source";
1060
1060
  var Xt = "sentry.sample_rate";
1061
1061
  var Zt = "sentry.op";
1062
1062
  var Qt = "sentry.origin";
1063
- var ar = 1;
1063
+ var cr = 1;
1064
1064
  function Ne(t) {
1065
1065
  let { spanId: e, traceId: n } = t.spanContext(), { parent_span_id: r } = W(t);
1066
1066
  return E({ parent_span_id: r, span_id: e, trace_id: n });
@@ -1072,35 +1072,35 @@ function tn(t) {
1072
1072
  return t > 9999999999 ? t / 1e3 : t;
1073
1073
  }
1074
1074
  function W(t) {
1075
- if (ur(t)) return t.getSpanJSON();
1075
+ if (pr(t)) return t.getSpanJSON();
1076
1076
  try {
1077
1077
  let { spanId: e, traceId: n } = t.spanContext();
1078
- if (cr(t)) {
1078
+ if (ur(t)) {
1079
1079
  let { attributes: r, startTime: o, name: s, endTime: i, parentSpanId: a, status: c } = t;
1080
- return E({ span_id: e, trace_id: n, data: r, description: s, parent_span_id: a, start_timestamp: en(o), timestamp: en(i) || void 0, status: pr(c), op: r[Zt], origin: r[Qt], _metrics_summary: Kt(t) });
1080
+ return E({ span_id: e, trace_id: n, data: r, description: s, parent_span_id: a, start_timestamp: en(o), timestamp: en(i) || void 0, status: fr(c), op: r[Zt], origin: r[Qt], _metrics_summary: Kt(t) });
1081
1081
  }
1082
1082
  return { span_id: e, trace_id: n };
1083
1083
  } catch {
1084
1084
  return {};
1085
1085
  }
1086
1086
  }
1087
- function cr(t) {
1087
+ function ur(t) {
1088
1088
  let e = t;
1089
1089
  return !!e.attributes && !!e.startTime && !!e.name && !!e.endTime && !!e.status;
1090
1090
  }
1091
- function ur(t) {
1091
+ function pr(t) {
1092
1092
  return typeof t.getSpanJSON == "function";
1093
1093
  }
1094
1094
  function nn(t) {
1095
1095
  let { traceFlags: e } = t.spanContext();
1096
- return e === ar;
1096
+ return e === cr;
1097
1097
  }
1098
- function pr(t) {
1098
+ function fr(t) {
1099
1099
  if (!(!t || t.code === 0)) return t.code === 1 ? "ok" : t.message || "unknown_error";
1100
1100
  }
1101
- var fr = "_sentryRootSpan";
1102
- function F(t) {
1103
- return t[fr] || t;
1101
+ var dr = "_sentryRootSpan";
1102
+ function L(t) {
1103
+ return t[dr] || t;
1104
1104
  }
1105
1105
  function rn() {
1106
1106
  let t = w(), e = ie(t);
@@ -1111,7 +1111,7 @@ function sn() {
1111
1111
  on || (on = true, Ve(_t), Xe(_t));
1112
1112
  }
1113
1113
  function _t() {
1114
- let t = rn(), e = t && F(t);
1114
+ let t = rn(), e = t && L(t);
1115
1115
  if (e) {
1116
1116
  let n = "internal_error";
1117
1117
  _ && d.log(`[Tracing] Root span: ${n} -> Global error occured`), e.setStatus({ code: 2, message: n });
@@ -1119,7 +1119,7 @@ function _t() {
1119
1119
  }
1120
1120
  _t.tag = "sentry_tracingErrorCallback";
1121
1121
  var ke = "production";
1122
- var dr = "_frozenDsc";
1122
+ var lr = "_frozenDsc";
1123
1123
  function ae(t, e) {
1124
1124
  let n = e.getOptions(), { publicKey: r } = e.getDsn() || {}, o = E({ environment: n.environment || ke, release: n.release, public_key: r, trace_id: t });
1125
1125
  return e.emit("createDsc", o), o;
@@ -1127,9 +1127,9 @@ function ae(t, e) {
1127
1127
  function De(t) {
1128
1128
  let e = Wt();
1129
1129
  if (!e) return {};
1130
- let n = ae(W(t).trace_id || "", e), r = F(t);
1130
+ let n = ae(W(t).trace_id || "", e), r = L(t);
1131
1131
  if (!r) return n;
1132
- let o = r[dr];
1132
+ let o = r[lr];
1133
1133
  if (o) return o;
1134
1134
  let s = W(r), i = s.data || {}, a = i[Xt];
1135
1135
  a != null && (n.sample_rate = `${a}`);
@@ -1145,7 +1145,7 @@ function an(t) {
1145
1145
  }
1146
1146
  return e;
1147
1147
  }
1148
- function lr(t, e) {
1148
+ function mr(t, e) {
1149
1149
  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;
1150
1150
  }
1151
1151
  function cn(t, e, n, r) {
@@ -1154,7 +1154,7 @@ function cn(t, e, n, r) {
1154
1154
  }
1155
1155
  function un(t, e, n, r) {
1156
1156
  let o = Ce(n), s = t.type && t.type !== "replay_event" ? t.type : "event";
1157
- lr(t, n && n.sdk);
1157
+ mr(t, n && n.sdk);
1158
1158
  let i = at(t, o, r, e);
1159
1159
  return delete t.sdkProcessingMetadata, P(i, [[{ type: s }, t]]);
1160
1160
  }
@@ -1170,11 +1170,11 @@ function ve(t, e, n, r = 0) {
1170
1170
  }
1171
1171
  function pn(t, e) {
1172
1172
  let { fingerprint: n, span: r, breadcrumbs: o, sdkProcessingMetadata: s } = e;
1173
- mr(t, e), r && _r(t, r), Er(t, n), gr(t, o), hr(t, s);
1173
+ gr(t, e), r && Er(t, r), Sr(t, n), hr(t, o), _r(t, s);
1174
1174
  }
1175
1175
  function Et(t, e) {
1176
- let { extra: n, tags: r, user: o, contexts: s, level: i, sdkProcessingMetadata: a, breadcrumbs: c, fingerprint: u, eventProcessors: f, attachments: p, propagationContext: g, transactionName: m, span: h } = e;
1177
- ce(t, "extra", n), ce(t, "tags", r), ce(t, "user", o), ce(t, "contexts", s), ce(t, "sdkProcessingMetadata", a), i && (t.level = i), m && (t.transactionName = m), h && (t.span = h), c.length && (t.breadcrumbs = [...t.breadcrumbs, ...c]), u.length && (t.fingerprint = [...t.fingerprint, ...u]), f.length && (t.eventProcessors = [...t.eventProcessors, ...f]), p.length && (t.attachments = [...t.attachments, ...p]), t.propagationContext = { ...t.propagationContext, ...g };
1176
+ let { extra: n, tags: r, user: o, contexts: s, level: i, sdkProcessingMetadata: a, breadcrumbs: c, fingerprint: u, eventProcessors: f, attachments: p, propagationContext: l, transactionName: g, span: h } = e;
1177
+ ce(t, "extra", n), ce(t, "tags", r), ce(t, "user", o), ce(t, "contexts", s), ce(t, "sdkProcessingMetadata", a), i && (t.level = i), g && (t.transactionName = g), h && (t.span = h), c.length && (t.breadcrumbs = [...t.breadcrumbs, ...c]), u.length && (t.fingerprint = [...t.fingerprint, ...u]), f.length && (t.eventProcessors = [...t.eventProcessors, ...f]), p.length && (t.attachments = [...t.attachments, ...p]), t.propagationContext = { ...t.propagationContext, ...l };
1178
1178
  }
1179
1179
  function ce(t, e, n) {
1180
1180
  if (n && Object.keys(n).length) {
@@ -1182,7 +1182,7 @@ function ce(t, e, n) {
1182
1182
  for (let r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[e][r] = n[r]);
1183
1183
  }
1184
1184
  }
1185
- function mr(t, e) {
1185
+ function gr(t, e) {
1186
1186
  let { extra: n, tags: r, user: o, contexts: s, level: i, transactionName: a } = e, c = E(n);
1187
1187
  c && Object.keys(c).length && (t.extra = { ...c, ...t.extra });
1188
1188
  let u = E(r);
@@ -1192,41 +1192,41 @@ function mr(t, e) {
1192
1192
  let p = E(s);
1193
1193
  p && Object.keys(p).length && (t.contexts = { ...p, ...t.contexts }), i && (t.level = i), a && t.type !== "transaction" && (t.transaction = a);
1194
1194
  }
1195
- function gr(t, e) {
1195
+ function hr(t, e) {
1196
1196
  let n = [...t.breadcrumbs || [], ...e];
1197
1197
  t.breadcrumbs = n.length ? n : void 0;
1198
1198
  }
1199
- function hr(t, e) {
1199
+ function _r(t, e) {
1200
1200
  t.sdkProcessingMetadata = { ...t.sdkProcessingMetadata, ...e };
1201
1201
  }
1202
- function _r(t, e) {
1202
+ function Er(t, e) {
1203
1203
  t.contexts = { trace: Ne(e), ...t.contexts }, t.sdkProcessingMetadata = { dynamicSamplingContext: De(e), ...t.sdkProcessingMetadata };
1204
- let n = F(e), r = W(n).description;
1204
+ let n = L(e), r = W(n).description;
1205
1205
  r && !t.transaction && t.type === "transaction" && (t.transaction = r);
1206
1206
  }
1207
- function Er(t, e) {
1207
+ function Sr(t, e) {
1208
1208
  t.fingerprint = t.fingerprint ? te(t.fingerprint) : [], e && (t.fingerprint = t.fingerprint.concat(e)), t.fingerprint && !t.fingerprint.length && delete t.fingerprint;
1209
1209
  }
1210
1210
  function dn(t, e, n, r, o, s) {
1211
1211
  let { normalizeDepth: i = 3, normalizeMaxBreadth: a = 1e3 } = t, c = { ...e, event_id: e.event_id || n.event_id || S(), timestamp: e.timestamp || z() }, u = n.integrations || t.integrations.map((I) => I.name);
1212
- Sr(c, t), Ir(c, u), e.type === void 0 && yr(c, t.stackParser);
1213
- let f = Ar(r, n.captureContext);
1212
+ yr(c, t), xr(c, u), e.type === void 0 && Tr(c, t.stackParser);
1213
+ let f = br(r, n.captureContext);
1214
1214
  n.mechanism && B(c, n.mechanism);
1215
- let p = o ? o.getEventProcessors() : [], g = Jt().getScopeData();
1215
+ let p = o ? o.getEventProcessors() : [], l = Jt().getScopeData();
1216
1216
  if (s) {
1217
1217
  let I = s.getScopeData();
1218
- Et(g, I);
1218
+ Et(l, I);
1219
1219
  }
1220
1220
  if (f) {
1221
1221
  let I = f.getScopeData();
1222
- Et(g, I);
1222
+ Et(l, I);
1223
1223
  }
1224
- let m = [...n.attachments || [], ...g.attachments];
1225
- m.length && (n.attachments = m), pn(c, g);
1226
- let h = [...p, ...g.eventProcessors];
1227
- return ve(h, c, n).then((I) => (I && Tr(I), typeof i == "number" && i > 0 ? xr(I, i, a) : I));
1224
+ let g = [...n.attachments || [], ...l.attachments];
1225
+ g.length && (n.attachments = g), pn(c, l);
1226
+ let h = [...p, ...l.eventProcessors];
1227
+ return ve(h, c, n).then((I) => (I && Ir(I), typeof i == "number" && i > 0 ? Ar(I, i, a) : I));
1228
1228
  }
1229
- function Sr(t, e) {
1229
+ function yr(t, e) {
1230
1230
  let { environment: n, release: r, dist: o, maxValueLength: s = 250 } = e;
1231
1231
  "environment" in t || (t.environment = "environment" in e ? n : ke), t.release === void 0 && r !== void 0 && (t.release = r), t.dist === void 0 && o !== void 0 && (t.dist = o), t.message && (t.message = k(t.message, s));
1232
1232
  let i = t.exception && t.exception.values && t.exception.values[0];
@@ -1235,8 +1235,8 @@ function Sr(t, e) {
1235
1235
  a && a.url && (a.url = k(a.url, s));
1236
1236
  }
1237
1237
  var fn = /* @__PURE__ */ new WeakMap();
1238
- function yr(t, e) {
1239
- let n = l._sentryDebugIds;
1238
+ function Tr(t, e) {
1239
+ let n = m._sentryDebugIds;
1240
1240
  if (!n) return;
1241
1241
  let r, o = fn.get(e);
1242
1242
  o ? r = o : (r = /* @__PURE__ */ new Map(), fn.set(e, r));
@@ -1261,7 +1261,7 @@ function yr(t, e) {
1261
1261
  } catch {
1262
1262
  }
1263
1263
  }
1264
- function Tr(t) {
1264
+ function Ir(t) {
1265
1265
  let e = {};
1266
1266
  try {
1267
1267
  t.exception.values.forEach((r) => {
@@ -1278,15 +1278,15 @@ function Tr(t) {
1278
1278
  n.push({ type: "sourcemap", code_file: r, debug_id: e[r] });
1279
1279
  });
1280
1280
  }
1281
- function Ir(t, e) {
1281
+ function xr(t, e) {
1282
1282
  e.length > 0 && (t.sdk = t.sdk || {}, t.sdk.integrations = [...t.sdk.integrations || [], ...e]);
1283
1283
  }
1284
- function xr(t, e, n) {
1284
+ function Ar(t, e, n) {
1285
1285
  if (!t) return null;
1286
1286
  let r = { ...t, ...t.breadcrumbs && { breadcrumbs: t.breadcrumbs.map((o) => ({ ...o, ...o.data && { data: R(o.data, e, n) } })) }, ...t.user && { user: R(t.user, e, n) }, ...t.contexts && { contexts: R(t.contexts, e, n) }, ...t.extra && { extra: R(t.extra, e, n) } };
1287
1287
  return t.contexts && t.contexts.trace && r.contexts && (r.contexts.trace = t.contexts.trace, t.contexts.trace.data && (r.contexts.trace.data = R(t.contexts.trace.data, e, n))), t.spans && (r.spans = t.spans.map((o) => ({ ...o, ...o.data && { data: R(o.data, e, n) } }))), r;
1288
1288
  }
1289
- function Ar(t, e) {
1289
+ function br(t, e) {
1290
1290
  if (!e) return t;
1291
1291
  let n = t ? t.clone() : new A();
1292
1292
  return n.update(e), n;
@@ -1325,22 +1325,22 @@ var Me = class {
1325
1325
  }
1326
1326
  }
1327
1327
  };
1328
- var br = "7";
1329
- function Rr(t) {
1328
+ var Rr = "7";
1329
+ function Cr(t) {
1330
1330
  let e = t.protocol ? `${t.protocol}:` : "", n = t.port ? `:${t.port}` : "";
1331
1331
  return `${e}//${t.host}${n}${t.path ? `/${t.path}` : ""}/api/`;
1332
1332
  }
1333
- function Cr(t) {
1334
- return `${Rr(t)}${t.projectId}/envelope/`;
1333
+ function Or(t) {
1334
+ return `${Cr(t)}${t.projectId}/envelope/`;
1335
1335
  }
1336
- function Or(t, e) {
1337
- return Je({ sentry_key: t.publicKey, sentry_version: br, ...e && { sentry_client: `${e.name}/${e.version}` } });
1336
+ function Nr(t, e) {
1337
+ return Je({ sentry_key: t.publicKey, sentry_version: Rr, ...e && { sentry_client: `${e.name}/${e.version}` } });
1338
1338
  }
1339
1339
  function ln(t, e, n) {
1340
- return e || `${Cr(t)}?${Or(t, n)}`;
1340
+ return e || `${Or(t)}?${Nr(t, n)}`;
1341
1341
  }
1342
1342
  var mn = [];
1343
- function Nr(t) {
1343
+ function kr(t) {
1344
1344
  let e = {};
1345
1345
  return t.forEach((n) => {
1346
1346
  let { name: r } = n, o = e[r];
@@ -1354,7 +1354,7 @@ function St(t) {
1354
1354
  });
1355
1355
  let r;
1356
1356
  Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r = te(n(e)) : r = e;
1357
- let o = Nr(r), s = kr(o, (i) => i.name === "Debug");
1357
+ let o = kr(r), s = Dr(o, (i) => i.name === "Debug");
1358
1358
  if (s !== -1) {
1359
1359
  let [i] = o.splice(s, 1);
1360
1360
  o.push(i);
@@ -1385,7 +1385,7 @@ function Tt(t, e, n) {
1385
1385
  }
1386
1386
  _ && d.log(`Integration installed: ${e.name}`);
1387
1387
  }
1388
- function kr(t, e) {
1388
+ function Dr(t, e) {
1389
1389
  for (let n = 0; n < t.length; n++) if (e(t[n]) === true) return n;
1390
1390
  return -1;
1391
1391
  }
@@ -1512,9 +1512,9 @@ var Pe = class {
1512
1512
  if (a === null) return a;
1513
1513
  let c = { ...o.getPropagationContext(), ...r ? r.getPropagationContext() : void 0 };
1514
1514
  if (!(a.contexts && a.contexts.trace) && c) {
1515
- let { traceId: f, spanId: p, parentSpanId: g, dsc: m } = c;
1516
- a.contexts = { trace: E({ trace_id: f, span_id: p, parent_span_id: g }), ...a.contexts };
1517
- let h = m || ae(f, this);
1515
+ let { traceId: f, spanId: p, parentSpanId: l, dsc: g } = c;
1516
+ a.contexts = { trace: E({ trace_id: f, span_id: p, parent_span_id: l }), ...a.contexts };
1517
+ let h = g || ae(f, this);
1518
1518
  a.sdkProcessingMetadata = { dynamicSamplingContext: h, ...a.sdkProcessingMetadata };
1519
1519
  }
1520
1520
  return a;
@@ -1531,20 +1531,20 @@ var Pe = class {
1531
1531
  _processEvent(e, n, r) {
1532
1532
  let o = this.getOptions(), { sampleRate: s } = o, i = En(e), a = _n(e), c = e.type || "error", u = `before send for type \`${c}\``, f = typeof s > "u" ? void 0 : an(s);
1533
1533
  if (a && typeof f == "number" && Math.random() > f) return this.recordDroppedEvent("sample_rate", "error", e), $(new T(`Discarding event because it's not included in the random sample (sampling rate = ${s})`, "log"));
1534
- let p = c === "replay_event" ? "replay" : c, m = (e.sdkProcessingMetadata || {}).capturedSpanIsolationScope;
1535
- return this._prepareEvent(e, n, r, m).then((h) => {
1534
+ let p = c === "replay_event" ? "replay" : c, g = (e.sdkProcessingMetadata || {}).capturedSpanIsolationScope;
1535
+ return this._prepareEvent(e, n, r, g).then((h) => {
1536
1536
  if (h === null) throw this.recordDroppedEvent("event_processor", p, e), new T("An event processor returned `null`, will not send event.", "log");
1537
1537
  if (n.data && n.data.__sentry__ === true) return h;
1538
- let I = vr(o, h, n);
1539
- return Dr(I, u);
1538
+ let I = Mr(o, h, n);
1539
+ return vr(I, u);
1540
1540
  }).then((h) => {
1541
1541
  if (h === null) throw this.recordDroppedEvent("before_send", p, e), new T(`${u} returned \`null\`, will not send event.`, "log");
1542
1542
  let pe = r && r.getSession();
1543
1543
  !i && pe && this._updateSessionFromEvent(pe, h);
1544
1544
  let I = h.transaction_info;
1545
1545
  if (i && I && h.transaction !== e.transaction) {
1546
- let On = "custom";
1547
- h.transaction_info = { ...I, source: On };
1546
+ let Nn = "custom";
1547
+ h.transaction_info = { ...I, source: Nn };
1548
1548
  }
1549
1549
  return this.sendEvent(h, n), h;
1550
1550
  }).then(null, (h) => {
@@ -1563,7 +1563,7 @@ Reason: ${h}`));
1563
1563
  });
1564
1564
  }
1565
1565
  };
1566
- function Dr(t, e) {
1566
+ function vr(t, e) {
1567
1567
  let n = `${e} must return \`null\` or a valid event.`;
1568
1568
  if (C(t)) return t.then((r) => {
1569
1569
  if (!b(r) && r !== null) throw new T(n);
@@ -1574,7 +1574,7 @@ function Dr(t, e) {
1574
1574
  if (!b(t) && t !== null) throw new T(n);
1575
1575
  return t;
1576
1576
  }
1577
- function vr(t, e, n) {
1577
+ function Mr(t, e, n) {
1578
1578
  let { beforeSend: r, beforeSendTransaction: o, beforeSendSpan: s } = t;
1579
1579
  if (_n(e) && r) return r(e, n);
1580
1580
  if (En(e)) {
@@ -1599,10 +1599,10 @@ function En(t) {
1599
1599
  function Sn(t, e, n, r, o) {
1600
1600
  let s = { sent_at: (/* @__PURE__ */ new Date()).toISOString() };
1601
1601
  n && n.sdk && (s.sdk = { name: n.sdk.name, version: n.sdk.version }), r && o && (s.dsn = M(o)), e && (s.trace = E(e));
1602
- let i = Mr(t);
1602
+ let i = Pr(t);
1603
1603
  return P(s, [i]);
1604
1604
  }
1605
- function Mr(t) {
1605
+ function Pr(t) {
1606
1606
  return [{ type: "check_in" }, t];
1607
1607
  }
1608
1608
  var ue = class extends Pe {
@@ -1643,8 +1643,8 @@ var ue = class extends Pe {
1643
1643
  "duration" in e && (u.duration = e.duration), n && (u.monitor_config = { schedule: n.schedule, checkin_margin: n.checkinMargin, max_runtime: n.maxRuntime, timezone: n.timezone, failure_issue_threshold: n.failureIssueThreshold, recovery_threshold: n.recoveryThreshold });
1644
1644
  let [f, p] = this._getTraceInfoFromScope(r);
1645
1645
  p && (u.contexts = { trace: p });
1646
- let g = Sn(u, f, this.getSdkMetadata(), c, this.getDsn());
1647
- return _ && d.info("Sending checkin:", e.monitorSlug, e.status), this.sendEnvelope(g), o;
1646
+ let l = Sn(u, f, this.getSdkMetadata(), c, this.getDsn());
1647
+ return _ && d.info("Sending checkin:", e.monitorSlug, e.status), this.sendEnvelope(l), o;
1648
1648
  }
1649
1649
  _captureRequestSession() {
1650
1650
  this._sessionFlusher ? this._sessionFlusher.incrementSessionStatusCount() : _ && d.warn("Discarded request mode session because autoSessionTracking option was disabled");
@@ -1656,29 +1656,29 @@ var ue = class extends Pe {
1656
1656
  if (!e) return [void 0, void 0];
1657
1657
  let n = j(e);
1658
1658
  if (n) {
1659
- let c = F(n);
1659
+ let c = L(n);
1660
1660
  return [De(c), Ne(c)];
1661
1661
  }
1662
1662
  let { traceId: r, spanId: o, parentSpanId: s, dsc: i } = e.getPropagationContext(), a = { trace_id: r, span_id: o, parent_span_id: s };
1663
1663
  return i ? [i, a] : [ae(r, this), a];
1664
1664
  }
1665
1665
  };
1666
- var Pr = 64;
1667
- function It(t, e, n = tt(t.bufferSize || Pr)) {
1666
+ var wr = 64;
1667
+ function It(t, e, n = tt(t.bufferSize || wr)) {
1668
1668
  let r = {}, o = (i) => n.drain(i);
1669
1669
  function s(i) {
1670
1670
  let a = [];
1671
- if (be(i, (p, g) => {
1672
- let m = Re(g);
1673
- if (ct(r, m)) {
1674
- let h = yn(p, g);
1675
- t.recordDroppedEvent("ratelimit_backoff", m, h);
1671
+ if (be(i, (p, l) => {
1672
+ let g = Re(l);
1673
+ if (ct(r, g)) {
1674
+ let h = yn(p, l);
1675
+ t.recordDroppedEvent("ratelimit_backoff", g, h);
1676
1676
  } else a.push(p);
1677
1677
  }), a.length === 0) return x({});
1678
1678
  let c = P(i[0], a), u = (p) => {
1679
- be(c, (g, m) => {
1680
- let h = yn(g, m);
1681
- t.recordDroppedEvent(p, Re(m), h);
1679
+ be(c, (l, g) => {
1680
+ let h = yn(l, g);
1681
+ t.recordDroppedEvent(p, Re(g), h);
1682
1682
  });
1683
1683
  }, f = () => e({ body: st(c) }).then((p) => (p.statusCode !== void 0 && (p.statusCode < 200 || p.statusCode >= 300) && _ && d.warn(`Sentry responded with status code ${p.statusCode} to sent event.`), r = ut(r, p), p), (p) => {
1684
1684
  throw u("network_error"), p;
@@ -1693,9 +1693,9 @@ function It(t, e, n = tt(t.bufferSize || Pr)) {
1693
1693
  function yn(t, e) {
1694
1694
  if (!(e !== "event" && e !== "transaction")) return Array.isArray(t) ? t[1] : void 0;
1695
1695
  }
1696
- var wr = "RewriteFrames";
1696
+ var Lr = "RewriteFrames";
1697
1697
  var we = (t = {}) => {
1698
- let e = t.root, n = t.prefix || "app:///", r = "window" in l && l.window !== void 0, o = t.iteratee || Fr({ isBrowser: r, root: e, prefix: n });
1698
+ let e = t.root, n = t.prefix || "app:///", r = "window" in m && m.window !== void 0, o = t.iteratee || Fr({ isBrowser: r, root: e, prefix: n });
1699
1699
  function s(a) {
1700
1700
  try {
1701
1701
  return { ...a, exception: { ...a.exception, values: a.exception.values.map((c) => ({ ...c, ...c.stacktrace && { stacktrace: i(c.stacktrace) } })) } };
@@ -1706,7 +1706,7 @@ var we = (t = {}) => {
1706
1706
  function i(a) {
1707
1707
  return { ...a, frames: a && a.frames && a.frames.map((c) => o(c)) };
1708
1708
  }
1709
- return { name: wr, processEvent(a) {
1709
+ return { name: Lr, processEvent(a) {
1710
1710
  let c = a;
1711
1711
  return a.exception && Array.isArray(a.exception.values) && (c = s(c)), c;
1712
1712
  } };
@@ -1730,14 +1730,14 @@ function Fr({ isBrowser: t, root: e, prefix: n }) {
1730
1730
  function In(t) {
1731
1731
  return typeof t == "object" && t !== null;
1732
1732
  }
1733
- function Ur(t) {
1733
+ function Br(t) {
1734
1734
  return In(t) && "handled" in t && typeof t.handled == "boolean" && "type" in t && typeof t.type == "string";
1735
1735
  }
1736
- function Br(t) {
1737
- return In(t) && "mechanism" in t && Ur(t.mechanism);
1736
+ function $r(t) {
1737
+ return In(t) && "mechanism" in t && Br(t.mechanism);
1738
1738
  }
1739
- function $r() {
1740
- if (l.SENTRY_RELEASE && l.SENTRY_RELEASE.id) return l.SENTRY_RELEASE.id;
1739
+ function jr() {
1740
+ if (m.SENTRY_RELEASE && m.SENTRY_RELEASE.id) return m.SENTRY_RELEASE.id;
1741
1741
  }
1742
1742
  function Tn(t, e) {
1743
1743
  return t !== void 0 ? (t[e[0]] = e[1], t) : { [e[0]]: e[1] };
@@ -1745,17 +1745,17 @@ function Tn(t, e) {
1745
1745
  function xn(t, e) {
1746
1746
  return t(e.stack || "", 1);
1747
1747
  }
1748
- function jr(t) {
1748
+ function Gr(t) {
1749
1749
  let e = t && t.message;
1750
1750
  return e ? e.error && typeof e.error.message == "string" ? e.error.message : e : "No error message";
1751
1751
  }
1752
1752
  function An(t, e) {
1753
- let n = { type: e.name || e.constructor.name, value: jr(e) }, r = xn(t, e);
1753
+ let n = { type: e.name || e.constructor.name, value: Gr(e) }, r = xn(t, e);
1754
1754
  return r.length && (n.stacktrace = { frames: r }), n.type === void 0 && n.value === "" && (n.value = "Unrecoverable error caught"), n;
1755
1755
  }
1756
- function Gr(t, e, n, r) {
1757
- let o, i = (r && r.data && Br(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
1758
- if (L(n)) o = n;
1756
+ function Hr(t, e, n, r) {
1757
+ let o, i = (r && r.data && $r(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
1758
+ if (F(n)) o = n;
1759
1759
  else {
1760
1760
  if (b(n)) {
1761
1761
  let c = `Non-Error exception captured with keys: ${V(n)}`, u = t?.getClient(), f = u && u.getOptions().normalizeDepth;
@@ -1766,7 +1766,7 @@ function Gr(t, e, n, r) {
1766
1766
  let a = { exception: { values: [An(e, o)] } };
1767
1767
  return ee(a, void 0, void 0), B(a, i), { ...a, event_id: r && r.event_id };
1768
1768
  }
1769
- function Hr(t, e, n = "info", r, o) {
1769
+ function qr(t, e, n = "info", r, o) {
1770
1770
  let s = { event_id: r && r.event_id, level: n, message: e };
1771
1771
  if (o && r && r.syntheticException) {
1772
1772
  let i = xn(t, r.syntheticException);
@@ -1774,9 +1774,9 @@ function Hr(t, e, n = "info", r, o) {
1774
1774
  }
1775
1775
  return s;
1776
1776
  }
1777
- var qr = 5;
1778
- var zr = (t = { limit: qr }) => ({ name: "LinkedErrors", processEvent: (e, n, r) => Yr(r.getOptions().stackParser, t.limit, e, n) });
1779
- function Yr(t, e, n, r) {
1777
+ var zr = 5;
1778
+ var Yr = (t = { limit: zr }) => ({ name: "LinkedErrors", processEvent: (e, n, r) => Jr(r.getOptions().stackParser, t.limit, e, n) });
1779
+ function Jr(t, e, n, r) {
1780
1780
  if (!n.exception || !n.exception.values || !r || !O(r.originalException, Error)) return n;
1781
1781
  let o = bn(t, e, r.originalException);
1782
1782
  return n.exception.values = [...o, ...n.exception.values], n;
@@ -1786,22 +1786,22 @@ function bn(t, e, n, r = []) {
1786
1786
  let o = An(t, n.cause);
1787
1787
  return bn(t, e, n.cause, [o, ...r]);
1788
1788
  }
1789
- var Jr = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
1790
- var Wr = (t = {}) => {
1791
- let e = { ...Jr, ...t };
1789
+ var Wr = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
1790
+ var Kr = (t = {}) => {
1791
+ let e = { ...Wr, ...t };
1792
1792
  return { name: "RequestData", preprocessEvent: (n) => {
1793
1793
  let { sdkProcessingMetadata: r } = n;
1794
- return r && ("request" in r && r.request instanceof Request && (n.request = Vr(r.request, e), n.user = Kr(n.user ?? {}, r.request, e)), "requestData" in r && (n.request ? n.request.data = r.requestData : n.request = { data: r.requestData })), n;
1794
+ return r && ("request" in r && r.request instanceof Request && (n.request = Xr(r.request, e), n.user = Vr(n.user ?? {}, r.request, e)), "requestData" in r && (n.request ? n.request.data = r.requestData : n.request = { data: r.requestData })), n;
1795
1795
  } };
1796
1796
  };
1797
- function Kr(t, e, n) {
1797
+ function Vr(t, e, n) {
1798
1798
  let r = e.headers.get("CF-Connecting-IP"), { allowedIps: o } = n, s = { ...t };
1799
- return !("ip_address" in t) && r && o !== void 0 && Xr(r, o) && (s.ip_address = r), Object.keys(s).length > 0 ? s : void 0;
1799
+ return !("ip_address" in t) && r && o !== void 0 && Zr(r, o) && (s.ip_address = r), Object.keys(s).length > 0 ? s : void 0;
1800
1800
  }
1801
- function Vr(t, e) {
1801
+ function Xr(t, e) {
1802
1802
  let n = t.headers.get("cookie"), r;
1803
1803
  if (n) try {
1804
- r = Zr(n);
1804
+ r = Qr(n);
1805
1805
  } catch {
1806
1806
  }
1807
1807
  let o = {};
@@ -1823,7 +1823,7 @@ function Vr(t, e) {
1823
1823
  } else delete s.query_string;
1824
1824
  return s;
1825
1825
  }
1826
- function Xr(t, e) {
1826
+ function Zr(t, e) {
1827
1827
  return typeof e == "boolean" ? e : e instanceof RegExp ? e.test(t) : Array.isArray(e) ? e.map((r) => r.toLowerCase()).includes(t) : false;
1828
1828
  }
1829
1829
  function xt(t, e) {
@@ -1836,7 +1836,7 @@ function xt(t, e) {
1836
1836
  } else return {};
1837
1837
  return Object.keys(t).filter(n).reduce((r, o) => (r[o] = t[o], r), {});
1838
1838
  }
1839
- function Zr(t) {
1839
+ function Qr(t) {
1840
1840
  if (typeof t != "string") return {};
1841
1841
  try {
1842
1842
  return t.split(";").map((e) => e.split("=")).reduce((e, [n, r]) => (e[decodeURIComponent(n.trim())] = decodeURIComponent(r.trim()), e), {});
@@ -1844,7 +1844,7 @@ function Zr(t) {
1844
1844
  return {};
1845
1845
  }
1846
1846
  }
1847
- function Qr(t, e) {
1847
+ function eo(t, e) {
1848
1848
  let n = {};
1849
1849
  return t.forEach((r) => {
1850
1850
  n[r.name] = r, typeof r.setupOnce == "function" && r.setupOnce();
@@ -1868,13 +1868,13 @@ var At = class extends ue {
1868
1868
  e._metadata = e._metadata || {}, e._metadata.sdk = e._metadata.sdk || { name: "toucan-js", packages: [{ name: "npm:toucan-js", version: "4.0.0" }], version: "4.0.0" }, super(e);
1869
1869
  }
1870
1870
  setupIntegrations() {
1871
- this._isEnabled() && !this.#t && this.#e && (this._integrations = Qr(this._options.integrations, this.#e), this.#t = true);
1871
+ this._isEnabled() && !this.#t && this.#e && (this._integrations = eo(this._options.integrations, this.#e), this.#t = true);
1872
1872
  }
1873
1873
  eventFromException(e, n) {
1874
- return x(Gr(this.#e, this._options.stackParser, e, n));
1874
+ return x(Hr(this.#e, this._options.stackParser, e, n));
1875
1875
  }
1876
1876
  eventFromMessage(e, n = "info", r) {
1877
- return x(Hr(this._options.stackParser, e, n, r, this._options.attachStacktrace));
1877
+ return x(qr(this._options.stackParser, e, n, r, this._options.attachStacktrace));
1878
1878
  }
1879
1879
  _prepareEvent(e, n, r) {
1880
1880
  return e.platform = e.platform || "javascript", this.getOptions().request && (e.sdkProcessingMetadata = Tn(e.sdkProcessingMetadata, ["request", this.getOptions().request])), this.getOptions().requestData && (e.sdkProcessingMetadata = Tn(e.sdkProcessingMetadata, ["requestData", this.getOptions().requestData])), super._prepareEvent(e, n, r);
@@ -1892,7 +1892,7 @@ var At = class extends ue {
1892
1892
  this.getOptions().enabled = e;
1893
1893
  }
1894
1894
  };
1895
- function eo(t) {
1895
+ function to(t) {
1896
1896
  let [e, n] = nt(t);
1897
1897
  return [e, (o) => {
1898
1898
  let s = n(o);
@@ -1903,11 +1903,11 @@ function eo(t) {
1903
1903
  return s;
1904
1904
  }];
1905
1905
  }
1906
- function to(t) {
1906
+ function no(t) {
1907
1907
  if (t) return ne(t, ".js");
1908
1908
  }
1909
- var no = _e(eo(to));
1910
- function ro(t) {
1909
+ var ro = _e(to(no));
1910
+ function oo(t) {
1911
1911
  function e({ body: n }) {
1912
1912
  try {
1913
1913
  let o = (t.fetcher ?? fetch)(t.url, { method: "POST", headers: t.headers, body: n }).then((s) => ({ statusCode: s.status, headers: { "retry-after": s.headers.get("Retry-After"), "x-sentry-rate-limits": s.headers.get("X-Sentry-Rate-Limits") } }));
@@ -1921,14 +1921,14 @@ function ro(t) {
1921
1921
  var K = class extends A {
1922
1922
  #e;
1923
1923
  constructor(e) {
1924
- if (super(), e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [Wr(e.requestDataOptions), zr()]], e.release === void 0) {
1925
- let n = $r();
1924
+ if (super(), e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [Kr(e.requestDataOptions), Yr()]], e.release === void 0) {
1925
+ let n = jr();
1926
1926
  n !== void 0 && (e.release = n);
1927
1927
  }
1928
1928
  this.#e = e, this.attachNewClient();
1929
1929
  }
1930
1930
  attachNewClient() {
1931
- let e = new At({ ...this.#e, transport: ro, integrations: St(this.#e), stackParser: Ke(this.#e.stackParser || no), transportOptions: { ...this.#e.transportOptions, context: this.#e.context } });
1931
+ let e = new At({ ...this.#e, transport: oo, integrations: St(this.#e), stackParser: Ke(this.#e.stackParser || ro), transportOptions: { ...this.#e.transportOptions, context: this.#e.context } });
1932
1932
  this.setClient(e), e.setSdk(this), e.setupIntegrations();
1933
1933
  }
1934
1934
  setRequestBody(e) {
@@ -1960,16 +1960,16 @@ function Rn(t, e, n, r, o, s, i, a, c) {
1960
1960
  } })], 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": o } } });
1961
1961
  return s && (u.setTag("colo", s.coloId), u.setTag("metal", s.metalId)), a && c && (u.setTag("accountId", a), u.setTag("scriptId", c)), u.setUser({ id: a?.toString() }), u;
1962
1962
  }
1963
- function oo() {
1963
+ function so() {
1964
1964
  return { addLogs: () => {
1965
1965
  }, setTags: () => {
1966
1966
  }, end: () => {
1967
1967
  }, isRecording: true };
1968
1968
  }
1969
1969
  function Cn() {
1970
- return { enterSpan: (t, e, ...n) => e(oo(), ...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" };
1970
+ return { enterSpan: (t, e, ...n) => e(so(), ...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" };
1971
1971
  }
1972
- var Fe = class {
1972
+ var Le = class {
1973
1973
  constructor(e) {
1974
1974
  this.data = {};
1975
1975
  this.hasWritten = false;
@@ -1985,29 +1985,29 @@ var Fe = class {
1985
1985
  this.hasWritten || this.readyAnalytics && (this.hasWritten = true, 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] }));
1986
1986
  }
1987
1987
  };
1988
- var Fc = { async fetch(t, e, n) {
1989
- let r, o = false, s = new Fe(e.ANALYTICS), i = new fe(e.UNSAFE_PERFORMANCE), a = i.now();
1988
+ var On = (t) => ({ invoke_user_worker_ahead_of_assets: t?.invoke_user_worker_ahead_of_assets ?? false, has_user_worker: t?.has_user_worker ?? false, account_id: t?.account_id ?? -1, script_id: t?.script_id ?? -1 });
1989
+ var Bc = { async fetch(t, e, n) {
1990
+ let r, o = false, s = new Le(e.ANALYTICS), i = new fe(e.UNSAFE_PERFORMANCE), a = i.now();
1990
1991
  try {
1991
1992
  e.JAEGER || (e.JAEGER = Cn()), r = Rn(t, n, e.SENTRY_DSN, e.SENTRY_ACCESS_CLIENT_ID, e.SENTRY_ACCESS_CLIENT_SECRET, e.COLO_METADATA, e.VERSION_METADATA, e.CONFIG?.account_id, e.CONFIG?.script_id);
1992
- let c = new URL(t.url);
1993
- 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: c.hostname, version: e.VERSION_METADATA.tag, userWorkerAhead: e.CONFIG.invoke_user_worker_ahead_of_assets });
1994
- let u = t.clone();
1995
- if (e.CONFIG.invoke_user_worker_ahead_of_assets) {
1996
- if (!e.CONFIG.has_user_worker) throw new Error("Fetch for user worker without having a user worker binding");
1997
- return s.setData({ dispatchtype: "worker" }), await e.JAEGER.enterSpan("dispatch_worker", async (p) => (p.setTags({ hasUserWorker: true, asset: "ignored", dispatchType: "worker" }), o = true, e.USER_WORKER.fetch(u)));
1993
+ let c = On(e.CONFIG), u = new URL(t.url);
1994
+ 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: u.hostname, version: e.VERSION_METADATA.tag, userWorkerAhead: c.invoke_user_worker_ahead_of_assets });
1995
+ let f = t.clone();
1996
+ if (c.invoke_user_worker_ahead_of_assets) {
1997
+ if (!c.has_user_worker) throw new Error("Fetch for user worker without having a user worker binding");
1998
+ return s.setData({ dispatchtype: "worker" }), await e.JAEGER.enterSpan("dispatch_worker", async (l) => (l.setTags({ hasUserWorker: true, asset: "ignored", dispatchType: "worker" }), o = true, e.USER_WORKER.fetch(f)));
1998
1999
  }
1999
- let f = await e.ASSET_WORKER.unstable_canFetch(t);
2000
- return e.CONFIG.has_user_worker && !f ? (s.setData({ dispatchtype: "worker" }), await e.JAEGER.enterSpan("dispatch_worker", async (p) => (p.setTags({ hasUserWorker: e.CONFIG.has_user_worker || false, asset: f, dispatchType: "worker" }), o = true, e.USER_WORKER.fetch(u)))) : (s.setData({ dispatchtype: "asset" }), await e.JAEGER.enterSpan("dispatch_assets", async (p) => (p.setTags({ hasUserWorker: e.CONFIG.has_user_worker || false, asset: f, dispatchType: "asset" }), e.ASSET_WORKER.fetch(u))));
2000
+ let p = await e.ASSET_WORKER.unstable_canFetch(t);
2001
+ return c.has_user_worker && !p ? (s.setData({ dispatchtype: "worker" }), await e.JAEGER.enterSpan("dispatch_worker", async (l) => (l.setTags({ hasUserWorker: c.has_user_worker, asset: p, dispatchType: "worker" }), o = true, e.USER_WORKER.fetch(f)))) : (s.setData({ dispatchtype: "asset" }), await e.JAEGER.enterSpan("dispatch_assets", async (l) => (l.setTags({ hasUserWorker: c.has_user_worker, asset: p, dispatchType: "asset" }), e.ASSET_WORKER.fetch(f))));
2001
2002
  } catch (c) {
2002
- if (o) return;
2003
- throw c instanceof Error && s.setData({ error: c.message }), r && r.captureException(c), c;
2003
+ throw o || (c instanceof Error && s.setData({ error: c.message }), r && r.captureException(c)), c;
2004
2004
  } finally {
2005
2005
  s.setData({ requestTime: i.now() - a }), s.write();
2006
2006
  }
2007
2007
  } };
2008
2008
 
2009
2009
  // src/asset-workers/router-worker.ts
2010
- var router_worker_default = Fc;
2010
+ var router_worker_default = Bc;
2011
2011
  export {
2012
2012
  router_worker_default as default
2013
2013
  };