@cloudflare/vite-plugin 0.1.14 → 0.1.16
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.
- package/dist/asset-workers/asset-worker.js +158 -151
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5010 -202
- package/dist/runner-worker/index.js +9 -0
- package/package.json +6 -6
|
@@ -9,7 +9,7 @@ var X = class {
|
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
var Xt = Object.prototype.toString;
|
|
12
|
-
function
|
|
12
|
+
function Y(t14) {
|
|
13
13
|
switch (Xt.call(t14)) {
|
|
14
14
|
case "[object Error]":
|
|
15
15
|
case "[object Exception]":
|
|
@@ -174,7 +174,7 @@ var x = class extends Error {
|
|
|
174
174
|
super(e), this.message = e, this.name = new.target.prototype.constructor.name, Object.setPrototypeOf(this, new.target.prototype), this.logLevel = n;
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
|
-
function
|
|
177
|
+
function z(t14, e, n) {
|
|
178
178
|
try {
|
|
179
179
|
Object.defineProperty(t14, e, { value: n, writable: true, configurable: true });
|
|
180
180
|
} catch {
|
|
@@ -185,7 +185,7 @@ function gt(t14) {
|
|
|
185
185
|
return Object.keys(t14).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(t14[e])}`).join("&");
|
|
186
186
|
}
|
|
187
187
|
function ve(t14) {
|
|
188
|
-
if (
|
|
188
|
+
if (Y(t14)) return { message: t14.message, name: t14.name, stack: t14.stack, ...rn(t14) };
|
|
189
189
|
if (ct(t14)) {
|
|
190
190
|
let e = { type: t14.type, target: nn(t14.target), currentTarget: nn(t14.currentTarget), ...rn(t14) };
|
|
191
191
|
return typeof CustomEvent < "u" && M(t14, CustomEvent) && (e.detail = t14.detail), e;
|
|
@@ -383,7 +383,7 @@ function le(t14, e, n) {
|
|
|
383
383
|
let r = t14.exception = t14.exception || {}, s = r.values = r.values || [], o = s[0] = s[0] || {};
|
|
384
384
|
o.value || (o.value = e || ""), o.type || (o.type = n || "Error");
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function J(t14, e) {
|
|
387
387
|
let n = Cr(t14);
|
|
388
388
|
if (!n) return;
|
|
389
389
|
let r = { type: "generic", handled: true }, s = n.mechanism;
|
|
@@ -395,7 +395,7 @@ function z(t14, e) {
|
|
|
395
395
|
function $e(t14) {
|
|
396
396
|
if (t14 && t14.__sentry_captured__) return true;
|
|
397
397
|
try {
|
|
398
|
-
|
|
398
|
+
z(t14, "__sentry_captured__", true);
|
|
399
399
|
} catch {
|
|
400
400
|
}
|
|
401
401
|
return false;
|
|
@@ -527,7 +527,7 @@ function b(t14) {
|
|
|
527
527
|
e(t14);
|
|
528
528
|
});
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function V(t14) {
|
|
531
531
|
return new v((e, n) => {
|
|
532
532
|
n(t14);
|
|
533
533
|
});
|
|
@@ -619,7 +619,7 @@ function At(t14) {
|
|
|
619
619
|
return e.splice(e.indexOf(i), 1)[0];
|
|
620
620
|
}
|
|
621
621
|
function s(i) {
|
|
622
|
-
if (!n()) return
|
|
622
|
+
if (!n()) return V(new x("Not adding Promise because buffer limit was reached."));
|
|
623
623
|
let a = i();
|
|
624
624
|
return e.indexOf(a) === -1 && e.push(a), a.then(() => r(a)).then(null, () => r(a).then(null, () => {
|
|
625
625
|
})), a;
|
|
@@ -784,7 +784,7 @@ function $r(t14) {
|
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
786
|
function Br(t14, e, n, r) {
|
|
787
|
-
if (
|
|
787
|
+
if (Y(n)) return [n, void 0];
|
|
788
788
|
if (e.synthetic = true, N(n)) {
|
|
789
789
|
let o = t14 && t14.getOptions().normalizeDepth, i = { __serialized__: ne(n, o) }, a = Fr(n);
|
|
790
790
|
if (a) return [a, i];
|
|
@@ -796,7 +796,7 @@ function Br(t14, e, n, r) {
|
|
|
796
796
|
}
|
|
797
797
|
function Mt(t14, e, n, r) {
|
|
798
798
|
let o = r && r.data && r.data.mechanism || { handled: true, type: "generic" }, [i, a] = Br(t14, o, n, r), c = { exception: { values: [hn(e, i)] } };
|
|
799
|
-
return a && (c.extra = a), le(c, void 0, void 0),
|
|
799
|
+
return a && (c.extra = a), le(c, void 0, void 0), J(c, o), { ...c, event_id: r && r.event_id };
|
|
800
800
|
}
|
|
801
801
|
function Pt(t14, e, n = "info", r, s) {
|
|
802
802
|
let o = { event_id: r && r.event_id, level: n };
|
|
@@ -832,9 +832,9 @@ function me(t14, e = {}) {
|
|
|
832
832
|
}
|
|
833
833
|
var kt = "_sentrySpan";
|
|
834
834
|
function Lt(t14, e) {
|
|
835
|
-
e ?
|
|
835
|
+
e ? z(t14, kt, e) : delete t14[kt];
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function q(t14) {
|
|
838
838
|
return t14[kt];
|
|
839
839
|
}
|
|
840
840
|
var jr = 100;
|
|
@@ -844,7 +844,7 @@ var Ft = class t2 {
|
|
|
844
844
|
}
|
|
845
845
|
clone() {
|
|
846
846
|
let e = new t2();
|
|
847
|
-
return e._breadcrumbs = [...this._breadcrumbs], e._tags = { ...this._tags }, e._extra = { ...this._extra }, e._contexts = { ...this._contexts }, e._user = this._user, e._level = this._level, e._session = this._session, e._transactionName = this._transactionName, e._fingerprint = this._fingerprint, e._eventProcessors = [...this._eventProcessors], e._requestSession = this._requestSession, e._attachments = [...this._attachments], e._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, e._propagationContext = { ...this._propagationContext }, e._client = this._client, e._lastEventId = this._lastEventId, Lt(e,
|
|
847
|
+
return e._breadcrumbs = [...this._breadcrumbs], e._tags = { ...this._tags }, e._extra = { ...this._extra }, e._contexts = { ...this._contexts }, e._user = this._user, e._level = this._level, e._session = this._session, e._transactionName = this._transactionName, e._fingerprint = this._fingerprint, e._eventProcessors = [...this._eventProcessors], e._requestSession = this._requestSession, e._attachments = [...this._attachments], e._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }, e._propagationContext = { ...this._propagationContext }, e._client = this._client, e._lastEventId = this._lastEventId, Lt(e, q(this)), e;
|
|
848
848
|
}
|
|
849
849
|
setClient(e) {
|
|
850
850
|
this._client = e;
|
|
@@ -933,7 +933,7 @@ var Ft = class t2 {
|
|
|
933
933
|
return this._attachments = [], this;
|
|
934
934
|
}
|
|
935
935
|
getScopeData() {
|
|
936
|
-
return { breadcrumbs: this._breadcrumbs, attachments: this._attachments, contexts: this._contexts, tags: this._tags, extra: this._extra, user: this._user, level: this._level, fingerprint: this._fingerprint || [], eventProcessors: this._eventProcessors, propagationContext: this._propagationContext, sdkProcessingMetadata: this._sdkProcessingMetadata, transactionName: this._transactionName, span:
|
|
936
|
+
return { breadcrumbs: this._breadcrumbs, attachments: this._attachments, contexts: this._contexts, tags: this._tags, extra: this._extra, user: this._user, level: this._level, fingerprint: this._fingerprint || [], eventProcessors: this._eventProcessors, propagationContext: this._propagationContext, sdkProcessingMetadata: this._sdkProcessingMetadata, transactionName: this._transactionName, span: q(this) };
|
|
937
937
|
}
|
|
938
938
|
setSDKProcessingMetadata(e) {
|
|
939
939
|
return this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...e }, this;
|
|
@@ -1021,7 +1021,7 @@ function re() {
|
|
|
1021
1021
|
function Gr(t14) {
|
|
1022
1022
|
return re().withScope(t14);
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function Yr(t14, e) {
|
|
1025
1025
|
let n = re();
|
|
1026
1026
|
return n.withScope(() => (n.getStackTop().scope = t14, e(t14)));
|
|
1027
1027
|
}
|
|
@@ -1029,7 +1029,7 @@ function Sn(t14) {
|
|
|
1029
1029
|
return re().withScope(() => t14(re().getIsolationScope()));
|
|
1030
1030
|
}
|
|
1031
1031
|
function yn() {
|
|
1032
|
-
return { withIsolationScope: Sn, withScope: Gr, withSetScope:
|
|
1032
|
+
return { withIsolationScope: Sn, withScope: Gr, withSetScope: Yr, withSetIsolationScope: (t14, e) => Sn(e), getCurrentScope: () => re().getScope(), getIsolationScope: () => re().getIsolationScope() };
|
|
1033
1033
|
}
|
|
1034
1034
|
function ge(t14) {
|
|
1035
1035
|
let e = fe(t14);
|
|
@@ -1049,9 +1049,9 @@ function Tn() {
|
|
|
1049
1049
|
function In() {
|
|
1050
1050
|
return $t().getClient();
|
|
1051
1051
|
}
|
|
1052
|
-
var
|
|
1052
|
+
var zr = "_sentryMetrics";
|
|
1053
1053
|
function An(t14) {
|
|
1054
|
-
let e = t14[
|
|
1054
|
+
let e = t14[zr];
|
|
1055
1055
|
if (!e) return;
|
|
1056
1056
|
let n = {};
|
|
1057
1057
|
for (let [, [r, s]] of e) n[r] || (n[r] = []), n[r].push(S(s));
|
|
@@ -1061,8 +1061,8 @@ var xn = "sentry.source";
|
|
|
1061
1061
|
var bn = "sentry.sample_rate";
|
|
1062
1062
|
var Rn = "sentry.op";
|
|
1063
1063
|
var Cn = "sentry.origin";
|
|
1064
|
-
var
|
|
1065
|
-
function
|
|
1064
|
+
var Jr = 1;
|
|
1065
|
+
function Ye(t14) {
|
|
1066
1066
|
let { spanId: e, traceId: n } = t14.spanContext(), { parent_span_id: r } = se(t14);
|
|
1067
1067
|
return S({ parent_span_id: r, span_id: e, trace_id: n });
|
|
1068
1068
|
}
|
|
@@ -1073,10 +1073,10 @@ function On(t14) {
|
|
|
1073
1073
|
return t14 > 9999999999 ? t14 / 1e3 : t14;
|
|
1074
1074
|
}
|
|
1075
1075
|
function se(t14) {
|
|
1076
|
-
if (
|
|
1076
|
+
if (qr(t14)) return t14.getSpanJSON();
|
|
1077
1077
|
try {
|
|
1078
1078
|
let { spanId: e, traceId: n } = t14.spanContext();
|
|
1079
|
-
if (
|
|
1079
|
+
if (Vr(t14)) {
|
|
1080
1080
|
let { attributes: r, startTime: s, name: o, endTime: i, parentSpanId: a, status: c } = t14;
|
|
1081
1081
|
return S({ span_id: e, trace_id: n, data: r, description: o, parent_span_id: a, start_timestamp: Nn(s), timestamp: Nn(i) || void 0, status: Wr(c), op: r[Rn], origin: r[Cn], _metrics_summary: An(t14) });
|
|
1082
1082
|
}
|
|
@@ -1085,16 +1085,16 @@ function se(t14) {
|
|
|
1085
1085
|
return {};
|
|
1086
1086
|
}
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1088
|
+
function Vr(t14) {
|
|
1089
1089
|
let e = t14;
|
|
1090
1090
|
return !!e.attributes && !!e.startTime && !!e.name && !!e.endTime && !!e.status;
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function qr(t14) {
|
|
1093
1093
|
return typeof t14.getSpanJSON == "function";
|
|
1094
1094
|
}
|
|
1095
1095
|
function vn(t14) {
|
|
1096
1096
|
let { traceFlags: e } = t14.spanContext();
|
|
1097
|
-
return e ===
|
|
1097
|
+
return e === Jr;
|
|
1098
1098
|
}
|
|
1099
1099
|
function Wr(t14) {
|
|
1100
1100
|
if (!(!t14 || t14.code === 0)) return t14.code === 1 ? "ok" : t14.message || "unknown_error";
|
|
@@ -1105,7 +1105,7 @@ function H(t14) {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
function wn() {
|
|
1107
1107
|
let t14 = B(), e = ge(t14);
|
|
1108
|
-
return e.getActiveSpan ? e.getActiveSpan() :
|
|
1108
|
+
return e.getActiveSpan ? e.getActiveSpan() : q($t());
|
|
1109
1109
|
}
|
|
1110
1110
|
var Dn = false;
|
|
1111
1111
|
function Mn() {
|
|
@@ -1119,13 +1119,13 @@ function Bt() {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
}
|
|
1121
1121
|
Bt.tag = "sentry_tracingErrorCallback";
|
|
1122
|
-
var
|
|
1122
|
+
var ze = "production";
|
|
1123
1123
|
var Zr = "_frozenDsc";
|
|
1124
1124
|
function he(t14, e) {
|
|
1125
|
-
let n = e.getOptions(), { publicKey: r } = e.getDsn() || {}, s = S({ environment: n.environment ||
|
|
1125
|
+
let n = e.getOptions(), { publicKey: r } = e.getDsn() || {}, s = S({ environment: n.environment || ze, release: n.release, public_key: r, trace_id: t14 });
|
|
1126
1126
|
return e.emit("createDsc", s), s;
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function Je(t14) {
|
|
1129
1129
|
let e = In();
|
|
1130
1130
|
if (!e) return {};
|
|
1131
1131
|
let n = he(se(t14).trace_id || "", e), r = H(t14);
|
|
@@ -1159,13 +1159,13 @@ function Ln(t14, e, n, r) {
|
|
|
1159
1159
|
let i = Ot(t14, s, r, e);
|
|
1160
1160
|
return delete t14.sdkProcessingMetadata, $(i, [[{ type: o }, t14]]);
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1162
|
+
function Ve(t14, e, n, r = 0) {
|
|
1163
1163
|
return new v((s, o) => {
|
|
1164
1164
|
let i = t14[r];
|
|
1165
1165
|
if (e === null || typeof i != "function") s(e);
|
|
1166
1166
|
else {
|
|
1167
1167
|
let a = i({ ...e }, n);
|
|
1168
|
-
_ && i.id && a === null && m.log(`Event processor "${i.id}" dropped event`), D(a) ? a.then((c) =>
|
|
1168
|
+
_ && i.id && a === null && m.log(`Event processor "${i.id}" dropped event`), D(a) ? a.then((c) => Ve(t14, c, n, r + 1).then(s)).then(null, o) : Ve(t14, a, n, r + 1).then(s).then(null, o);
|
|
1169
1169
|
}
|
|
1170
1170
|
});
|
|
1171
1171
|
}
|
|
@@ -1201,7 +1201,7 @@ function ts(t14, e) {
|
|
|
1201
1201
|
t14.sdkProcessingMetadata = { ...t14.sdkProcessingMetadata, ...e };
|
|
1202
1202
|
}
|
|
1203
1203
|
function ns(t14, e) {
|
|
1204
|
-
t14.contexts = { trace:
|
|
1204
|
+
t14.contexts = { trace: Ye(e), ...t14.contexts }, t14.sdkProcessingMetadata = { dynamicSamplingContext: Je(e), ...t14.sdkProcessingMetadata };
|
|
1205
1205
|
let n = H(e), r = se(n).description;
|
|
1206
1206
|
r && !t14.transaction && t14.type === "transaction" && (t14.transaction = r);
|
|
1207
1207
|
}
|
|
@@ -1212,7 +1212,7 @@ function $n(t14, e, n, r, s, o) {
|
|
|
1212
1212
|
let { normalizeDepth: i = 3, normalizeMaxBreadth: a = 1e3 } = t14, c = { ...e, event_id: e.event_id || n.event_id || A(), timestamp: e.timestamp || te() }, u = n.integrations || t14.integrations.map((T) => T.name);
|
|
1213
1213
|
ss(c, t14), as(c, u), e.type === void 0 && os(c, t14.stackParser);
|
|
1214
1214
|
let l = us(r, n.captureContext);
|
|
1215
|
-
n.mechanism &&
|
|
1215
|
+
n.mechanism && J(c, n.mechanism);
|
|
1216
1216
|
let p = s ? s.getEventProcessors() : [], f = Tn().getScopeData();
|
|
1217
1217
|
if (o) {
|
|
1218
1218
|
let T = o.getScopeData();
|
|
@@ -1225,11 +1225,11 @@ function $n(t14, e, n, r, s, o) {
|
|
|
1225
1225
|
let d = [...n.attachments || [], ...f.attachments];
|
|
1226
1226
|
d.length && (n.attachments = d), Fn(c, f);
|
|
1227
1227
|
let h = [...p, ...f.eventProcessors];
|
|
1228
|
-
return
|
|
1228
|
+
return Ve(h, c, n).then((T) => (T && is(T), typeof i == "number" && i > 0 ? cs(T, i, a) : T));
|
|
1229
1229
|
}
|
|
1230
1230
|
function ss(t14, e) {
|
|
1231
1231
|
let { environment: n, release: r, dist: s, maxValueLength: o = 250 } = e;
|
|
1232
|
-
"environment" in t14 || (t14.environment = "environment" in e ? n :
|
|
1232
|
+
"environment" in t14 || (t14.environment = "environment" in e ? n : ze), t14.release === void 0 && r !== void 0 && (t14.release = r), t14.dist === void 0 && s !== void 0 && (t14.dist = s), t14.message && (t14.message = k(t14.message, o));
|
|
1233
1233
|
let i = t14.exception && t14.exception.values && t14.exception.values[0];
|
|
1234
1234
|
i && i.value && (i.value = k(i.value, o));
|
|
1235
1235
|
let a = t14.request;
|
|
@@ -1292,7 +1292,7 @@ function us(t14, e) {
|
|
|
1292
1292
|
let n = t14 ? t14.clone() : new R();
|
|
1293
1293
|
return n.update(e), n;
|
|
1294
1294
|
}
|
|
1295
|
-
var
|
|
1295
|
+
var qe = class {
|
|
1296
1296
|
constructor(e, n) {
|
|
1297
1297
|
this._client = e, this.flushTimeout = 60, this._pendingAggregates = {}, this._isEnabled = true, this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1e3), this._intervalId.unref && this._intervalId.unref(), this._sessionAttrs = n;
|
|
1298
1298
|
}
|
|
@@ -1365,13 +1365,13 @@ function jt(t14) {
|
|
|
1365
1365
|
function jn(t14, e) {
|
|
1366
1366
|
let n = {};
|
|
1367
1367
|
return e.forEach((r) => {
|
|
1368
|
-
r &&
|
|
1368
|
+
r && Yt(t14, r, n);
|
|
1369
1369
|
}), n;
|
|
1370
1370
|
}
|
|
1371
1371
|
function Gt(t14, e) {
|
|
1372
1372
|
for (let n of e) n && n.afterAllSetup && n.afterAllSetup(t14);
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1374
|
+
function Yt(t14, e, n) {
|
|
1375
1375
|
if (n[e.name]) {
|
|
1376
1376
|
_ && m.log(`Integration skipped because it was already installed: ${e.name}`);
|
|
1377
1377
|
return;
|
|
@@ -1450,7 +1450,7 @@ var We = class {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
addIntegration(e) {
|
|
1452
1452
|
let n = this._integrations[e.name];
|
|
1453
|
-
|
|
1453
|
+
Yt(this, e, this._integrations), n || Gt(this, [e]);
|
|
1454
1454
|
}
|
|
1455
1455
|
sendEvent(e, n = {}) {
|
|
1456
1456
|
this.emit("beforeSendEvent", e, n);
|
|
@@ -1530,8 +1530,8 @@ var We = class {
|
|
|
1530
1530
|
});
|
|
1531
1531
|
}
|
|
1532
1532
|
_processEvent(e, n, r) {
|
|
1533
|
-
let s = this.getOptions(), { sampleRate: o } = s, i =
|
|
1534
|
-
if (a && typeof l == "number" && Math.random() > l) return this.recordDroppedEvent("sample_rate", "error", e),
|
|
1533
|
+
let s = this.getOptions(), { sampleRate: o } = s, i = zn(e), a = Yn(e), c = e.type || "error", u = `before send for type \`${c}\``, l = typeof o > "u" ? void 0 : Pn(o);
|
|
1534
|
+
if (a && typeof l == "number" && Math.random() > l) return this.recordDroppedEvent("sample_rate", "error", e), V(new x(`Discarding event because it's not included in the random sample (sampling rate = ${o})`, "log"));
|
|
1535
1535
|
let p = c === "replay_event" ? "replay" : c, d = (e.sdkProcessingMetadata || {}).capturedSpanIsolationScope;
|
|
1536
1536
|
return this._prepareEvent(e, n, r, d).then((h) => {
|
|
1537
1537
|
if (h === null) throw this.recordDroppedEvent("event_processor", p, e), new x("An event processor returned `null`, will not send event.", "log");
|
|
@@ -1577,8 +1577,8 @@ function hs(t14, e) {
|
|
|
1577
1577
|
}
|
|
1578
1578
|
function _s(t14, e, n) {
|
|
1579
1579
|
let { beforeSend: r, beforeSendTransaction: s, beforeSendSpan: o } = t14;
|
|
1580
|
-
if (
|
|
1581
|
-
if (
|
|
1580
|
+
if (Yn(e) && r) return r(e, n);
|
|
1581
|
+
if (zn(e)) {
|
|
1582
1582
|
if (e.spans && o) {
|
|
1583
1583
|
let i = [];
|
|
1584
1584
|
for (let a of e.spans) {
|
|
@@ -1591,13 +1591,13 @@ function _s(t14, e, n) {
|
|
|
1591
1591
|
}
|
|
1592
1592
|
return e;
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1594
|
+
function Yn(t14) {
|
|
1595
1595
|
return t14.type === void 0;
|
|
1596
1596
|
}
|
|
1597
|
-
function
|
|
1597
|
+
function zn(t14) {
|
|
1598
1598
|
return t14.type === "transaction";
|
|
1599
1599
|
}
|
|
1600
|
-
function
|
|
1600
|
+
function Jn(t14, e, n, r, s) {
|
|
1601
1601
|
let o = { sent_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
1602
1602
|
n && n.sdk && (o.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (o.dsn = U(s)), e && (o.trace = S(e));
|
|
1603
1603
|
let i = Es(t14);
|
|
@@ -1635,7 +1635,7 @@ var Ee = class extends We {
|
|
|
1635
1635
|
}
|
|
1636
1636
|
initSessionFlusher() {
|
|
1637
1637
|
let { release: e, environment: n } = this._options;
|
|
1638
|
-
e ? this._sessionFlusher = new
|
|
1638
|
+
e ? this._sessionFlusher = new qe(this, { release: e, environment: n }) : _ && m.warn("Cannot initialise an instance of SessionFlusher if no release is provided!");
|
|
1639
1639
|
}
|
|
1640
1640
|
captureCheckIn(e, n, r) {
|
|
1641
1641
|
let s = "checkInId" in e && e.checkInId ? e.checkInId : A();
|
|
@@ -1644,7 +1644,7 @@ var Ee = class extends We {
|
|
|
1644
1644
|
"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 });
|
|
1645
1645
|
let [l, p] = this._getTraceInfoFromScope(r);
|
|
1646
1646
|
p && (u.contexts = { trace: p });
|
|
1647
|
-
let f =
|
|
1647
|
+
let f = Jn(u, l, this.getSdkMetadata(), c, this.getDsn());
|
|
1648
1648
|
return _ && m.info("Sending checkin:", e.monitorSlug, e.status), this.sendEnvelope(f), s;
|
|
1649
1649
|
}
|
|
1650
1650
|
_captureRequestSession() {
|
|
@@ -1655,30 +1655,30 @@ var Ee = class extends We {
|
|
|
1655
1655
|
}
|
|
1656
1656
|
_getTraceInfoFromScope(e) {
|
|
1657
1657
|
if (!e) return [void 0, void 0];
|
|
1658
|
-
let n =
|
|
1658
|
+
let n = q(e);
|
|
1659
1659
|
if (n) {
|
|
1660
1660
|
let c = H(n);
|
|
1661
|
-
return [
|
|
1661
|
+
return [Je(c), Ye(c)];
|
|
1662
1662
|
}
|
|
1663
1663
|
let { traceId: r, spanId: s, parentSpanId: o, dsc: i } = e.getPropagationContext(), a = { trace_id: r, span_id: s, parent_span_id: o };
|
|
1664
1664
|
return i ? [i, a] : [he(r, this), a];
|
|
1665
1665
|
}
|
|
1666
1666
|
};
|
|
1667
1667
|
var Ss = 64;
|
|
1668
|
-
function
|
|
1668
|
+
function zt(t14, e, n = At(t14.bufferSize || Ss)) {
|
|
1669
1669
|
let r = {}, s = (i) => n.drain(i);
|
|
1670
1670
|
function o(i) {
|
|
1671
1671
|
let a = [];
|
|
1672
1672
|
if (Be(i, (p, f) => {
|
|
1673
1673
|
let d = He(f);
|
|
1674
1674
|
if (vt(r, d)) {
|
|
1675
|
-
let h =
|
|
1675
|
+
let h = Vn(p, f);
|
|
1676
1676
|
t14.recordDroppedEvent("ratelimit_backoff", d, h);
|
|
1677
1677
|
} else a.push(p);
|
|
1678
1678
|
}), a.length === 0) return b({});
|
|
1679
1679
|
let c = $(i[0], a), u = (p) => {
|
|
1680
1680
|
Be(c, (f, d) => {
|
|
1681
|
-
let h =
|
|
1681
|
+
let h = Vn(f, d);
|
|
1682
1682
|
t14.recordDroppedEvent(p, He(d), h);
|
|
1683
1683
|
});
|
|
1684
1684
|
}, l = () => e({ body: Ct(c) }).then((p) => (p.statusCode !== void 0 && (p.statusCode < 200 || p.statusCode >= 300) && _ && m.warn(`Sentry responded with status code ${p.statusCode} to sent event.`), r = wt(r, p), p), (p) => {
|
|
@@ -1691,7 +1691,7 @@ function Yt(t14, e, n = At(t14.bufferSize || Ss)) {
|
|
|
1691
1691
|
}
|
|
1692
1692
|
return { send: o, flush: s };
|
|
1693
1693
|
}
|
|
1694
|
-
function
|
|
1694
|
+
function Vn(t14, e) {
|
|
1695
1695
|
if (!(e !== "event" && e !== "transaction")) return Array.isArray(t14) ? t14[1] : void 0;
|
|
1696
1696
|
}
|
|
1697
1697
|
var ys = "RewriteFrames";
|
|
@@ -1740,7 +1740,7 @@ function xs(t14) {
|
|
|
1740
1740
|
function bs() {
|
|
1741
1741
|
if (g.SENTRY_RELEASE && g.SENTRY_RELEASE.id) return g.SENTRY_RELEASE.id;
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1743
|
+
function qn(t14, e) {
|
|
1744
1744
|
return t14 !== void 0 ? (t14[e[0]] = e[1], t14) : { [e[0]]: e[1] };
|
|
1745
1745
|
}
|
|
1746
1746
|
function Kn(t14, e) {
|
|
@@ -1756,7 +1756,7 @@ function Zn(t14, e) {
|
|
|
1756
1756
|
}
|
|
1757
1757
|
function Cs(t14, e, n, r) {
|
|
1758
1758
|
let s, i = (r && r.data && xs(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
|
|
1759
|
-
if (
|
|
1759
|
+
if (Y(n)) s = n;
|
|
1760
1760
|
else {
|
|
1761
1761
|
if (N(n)) {
|
|
1762
1762
|
let c = `Non-Error exception captured with keys: ${ie(n)}`, u = t14?.getClient(), l = u && u.getOptions().normalizeDepth;
|
|
@@ -1765,7 +1765,7 @@ function Cs(t14, e, n, r) {
|
|
|
1765
1765
|
i.synthetic = true;
|
|
1766
1766
|
}
|
|
1767
1767
|
let a = { exception: { values: [Zn(e, s)] } };
|
|
1768
|
-
return le(a, void 0, void 0),
|
|
1768
|
+
return le(a, void 0, void 0), J(a, i), { ...a, event_id: r && r.event_id };
|
|
1769
1769
|
}
|
|
1770
1770
|
function Ns(t14, e, n = "info", r, s) {
|
|
1771
1771
|
let o = { event_id: r && r.event_id, level: n, message: e };
|
|
@@ -1816,9 +1816,9 @@ function ks(t14, e) {
|
|
|
1816
1816
|
l < 0 ? o.url = t14.url : (o.url = t14.url.substr(0, l), o.query_string = t14.url.substr(l + 1));
|
|
1817
1817
|
}
|
|
1818
1818
|
let { allowedHeaders: i, allowedCookies: a, allowedSearchParams: c } = e;
|
|
1819
|
-
if (i !== void 0 && o.headers ? (o.headers =
|
|
1819
|
+
if (i !== void 0 && o.headers ? (o.headers = Jt(o.headers, i), Object.keys(o.headers).length === 0 && delete o.headers) : delete o.headers, a !== void 0 && o.cookies ? (o.cookies = Jt(o.cookies, a), Object.keys(o.cookies).length === 0 && delete o.cookies) : delete o.cookies, c !== void 0) {
|
|
1820
1820
|
let u = Object.fromEntries(new URLSearchParams(o.query_string)), l = new URLSearchParams();
|
|
1821
|
-
Object.keys(
|
|
1821
|
+
Object.keys(Jt(u, c)).forEach((p) => {
|
|
1822
1822
|
l.set(p, u[p]);
|
|
1823
1823
|
}), o.query_string = l.toString();
|
|
1824
1824
|
} else delete o.query_string;
|
|
@@ -1827,7 +1827,7 @@ function ks(t14, e) {
|
|
|
1827
1827
|
function Ls(t14, e) {
|
|
1828
1828
|
return typeof e == "boolean" ? e : e instanceof RegExp ? e.test(t14) : Array.isArray(e) ? e.map((r) => r.toLowerCase()).includes(t14) : false;
|
|
1829
1829
|
}
|
|
1830
|
-
function
|
|
1830
|
+
function Jt(t14, e) {
|
|
1831
1831
|
let n = () => false;
|
|
1832
1832
|
if (typeof e == "boolean") return e ? t14 : {};
|
|
1833
1833
|
if (e instanceof RegExp) n = (r) => e.test(r);
|
|
@@ -1862,7 +1862,7 @@ function Us(t14, e) {
|
|
|
1862
1862
|
}
|
|
1863
1863
|
}), n;
|
|
1864
1864
|
}
|
|
1865
|
-
var
|
|
1865
|
+
var Vt = class extends Ee {
|
|
1866
1866
|
#e = null;
|
|
1867
1867
|
#t = false;
|
|
1868
1868
|
constructor(e) {
|
|
@@ -1878,7 +1878,7 @@ var Jt = class extends Ee {
|
|
|
1878
1878
|
return b(Ns(this._options.stackParser, e, n, r, this._options.attachStacktrace));
|
|
1879
1879
|
}
|
|
1880
1880
|
_prepareEvent(e, n, r) {
|
|
1881
|
-
return e.platform = e.platform || "javascript", this.getOptions().request && (e.sdkProcessingMetadata =
|
|
1881
|
+
return e.platform = e.platform || "javascript", this.getOptions().request && (e.sdkProcessingMetadata = qn(e.sdkProcessingMetadata, ["request", this.getOptions().request])), this.getOptions().requestData && (e.sdkProcessingMetadata = qn(e.sdkProcessingMetadata, ["requestData", this.getOptions().requestData])), super._prepareEvent(e, n, r);
|
|
1882
1882
|
}
|
|
1883
1883
|
getSdk() {
|
|
1884
1884
|
return this.#e;
|
|
@@ -1914,10 +1914,10 @@ function js(t14) {
|
|
|
1914
1914
|
let s = (t14.fetcher ?? fetch)(t14.url, { method: "POST", headers: t14.headers, body: n }).then((o) => ({ statusCode: o.status, headers: { "retry-after": o.headers.get("Retry-After"), "x-sentry-rate-limits": o.headers.get("X-Sentry-Rate-Limits") } }));
|
|
1915
1915
|
return t14.context && t14.context.waitUntil(s), s;
|
|
1916
1916
|
} catch (r) {
|
|
1917
|
-
return
|
|
1917
|
+
return V(r);
|
|
1918
1918
|
}
|
|
1919
1919
|
}
|
|
1920
|
-
return
|
|
1920
|
+
return zt(t14, e);
|
|
1921
1921
|
}
|
|
1922
1922
|
var Ze = class t3 extends R {
|
|
1923
1923
|
#e;
|
|
@@ -1929,7 +1929,7 @@ var Ze = class t3 extends R {
|
|
|
1929
1929
|
this.#e = e, this.attachNewClient();
|
|
1930
1930
|
}
|
|
1931
1931
|
attachNewClient() {
|
|
1932
|
-
let e = new
|
|
1932
|
+
let e = new Vt({ ...this.#e, transport: js, integrations: jt(this.#e), stackParser: _t(this.#e.stackParser || Hs), transportOptions: { ...this.#e.transportOptions, context: this.#e.context } });
|
|
1933
1933
|
this.setClient(e), e.setSdk(this), e.setupIntegrations();
|
|
1934
1934
|
}
|
|
1935
1935
|
setRequestBody(e) {
|
|
@@ -1967,10 +1967,10 @@ function Gs() {
|
|
|
1967
1967
|
}, end: () => {
|
|
1968
1968
|
}, isRecording: true };
|
|
1969
1969
|
}
|
|
1970
|
-
function
|
|
1970
|
+
function qt() {
|
|
1971
1971
|
return { enterSpan: (t14, e, ...n) => e(Gs(), ...n), getSpanContext: () => ({ traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", traceFlags: 0 }), runWithSpanContext: (t14, e, ...n) => e(...n), traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", cfTraceIdHeader: "test-trace:test-span:0" };
|
|
1972
1972
|
}
|
|
1973
|
-
var
|
|
1973
|
+
var Ys = { assets_navigation_prefers_asset_serving: 1 };
|
|
1974
1974
|
var Xe = class {
|
|
1975
1975
|
constructor(e) {
|
|
1976
1976
|
this.data = {};
|
|
@@ -1986,7 +1986,7 @@ var Xe = class {
|
|
|
1986
1986
|
if (!this.readyAnalytics) return;
|
|
1987
1987
|
let e = 0;
|
|
1988
1988
|
for (let n of this.data.compatibilityFlags || []) {
|
|
1989
|
-
let r =
|
|
1989
|
+
let r = Ys[n];
|
|
1990
1990
|
r && (e += r);
|
|
1991
1991
|
}
|
|
1992
1992
|
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.status ?? -1, e], blobs: [this.data.hostname?.substring(0, 256), this.data.userAgent?.substring(0, 256), this.data.htmlHandling, this.data.notFoundHandling, this.data.error?.substring(0, 256), this.data.version, this.data.coloRegion, this.data.cacheStatus] });
|
|
@@ -1997,11 +1997,11 @@ var et = class {
|
|
|
1997
1997
|
this.data = e;
|
|
1998
1998
|
}
|
|
1999
1999
|
async get(e) {
|
|
2000
|
-
let n = await
|
|
2000
|
+
let n = await Vs(e), r = Wt(new Uint8Array(this.data, 20), n);
|
|
2001
2001
|
return r ? Ws(r) : null;
|
|
2002
2002
|
}
|
|
2003
2003
|
};
|
|
2004
|
-
var
|
|
2004
|
+
var Vs = async (t14) => {
|
|
2005
2005
|
let n = new TextEncoder().encode(t14), r = await crypto.subtle.digest("SHA-256", n.buffer);
|
|
2006
2006
|
return new Uint8Array(r, 0, 16);
|
|
2007
2007
|
};
|
|
@@ -2009,7 +2009,7 @@ var Wt = (t14, e) => {
|
|
|
2009
2009
|
if (t14.byteLength === 0) return false;
|
|
2010
2010
|
let n = t14.byteOffset + (t14.byteLength / 40 >> 1) * 40, r = new Uint8Array(t14.buffer, n, 16);
|
|
2011
2011
|
if (r.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
|
|
2012
|
-
let s =
|
|
2012
|
+
let s = qs(e, r);
|
|
2013
2013
|
if (s < 0) {
|
|
2014
2014
|
let o = t14.byteOffset, i = n - t14.byteOffset;
|
|
2015
2015
|
return Wt(new Uint8Array(t14.buffer, o, i), e);
|
|
@@ -2018,7 +2018,7 @@ var Wt = (t14, e) => {
|
|
|
2018
2018
|
return Wt(new Uint8Array(t14.buffer, o, i), e);
|
|
2019
2019
|
} else return new Uint8Array(t14.buffer, n, 40);
|
|
2020
2020
|
};
|
|
2021
|
-
var
|
|
2021
|
+
var qs = (t14, e) => {
|
|
2022
2022
|
if (t14.byteLength < e.byteLength) return -1;
|
|
2023
2023
|
if (t14.byteLength > e.byteLength) return 1;
|
|
2024
2024
|
for (let [n, r] of t14.entries()) {
|
|
@@ -2219,7 +2219,7 @@ var ir = async (t14, e, n, r) => {
|
|
|
2219
2219
|
return new xe(oe);
|
|
2220
2220
|
}
|
|
2221
2221
|
}
|
|
2222
|
-
let f = co(a), d = await ur(f, n, r);
|
|
2222
|
+
let f = co(a), d = await ur(f, t14, n, r);
|
|
2223
2223
|
if (!d) {
|
|
2224
2224
|
let I = p ? new j() : new ye();
|
|
2225
2225
|
return e.JAEGER.enterSpan("no_intent", (w) => (w.setTags({ decodedPathname: f, configuration: JSON.stringify(n), proxied: p, status: I.status }), I));
|
|
@@ -2230,7 +2230,7 @@ var ir = async (t14, e, n, r) => {
|
|
|
2230
2230
|
return T !== a && d.asset || d.redirect ? e.JAEGER.enterSpan("redirect", (I) => (I.setTags({ originalPath: a, location: T !== a ? T : d.redirect ?? "<unknown>", status: K.status }), new K(T + i))) : d.asset ? d.asset : e.JAEGER.enterSpan("unknown_action", (I) => (I.setTags({ pathname: a, status: G.status }), new G(new Error("Unknown action"))));
|
|
2231
2231
|
};
|
|
2232
2232
|
var ro = async (t14, e, n, r, s) => {
|
|
2233
|
-
let { pathname: o } = new URL(e.url), i = e.method.toUpperCase(), a = await n.JAEGER.enterSpan("getByETag", async (f) => (f.setTags({ pathname: o, eTag: t14.eTag, status: t14.status }), await r(t14.eTag))), c = rr(t14.eTag, a.contentType, a.cacheStatus, e);
|
|
2233
|
+
let { pathname: o } = new URL(e.url), i = e.method.toUpperCase(), a = await n.JAEGER.enterSpan("getByETag", async (f) => (f.setTags({ pathname: o, eTag: t14.eTag, status: t14.status }), await r(t14.eTag, e))), c = rr(t14.eTag, a.contentType, a.cacheStatus, e);
|
|
2234
2234
|
s.setData({ cacheStatus: a.cacheStatus });
|
|
2235
2235
|
let u = `"${t14.eTag}"`, l = `W/${u}`, p = e.headers.get("If-None-Match") || "";
|
|
2236
2236
|
return [l, u].includes(p) ? n.JAEGER.enterSpan("matched_etag", (f) => (f.setTags({ matchedEtag: p, status: Ie.status }), new Ie(null, { headers: c }))) : n.JAEGER.enterSpan("response", (f) => {
|
|
@@ -2249,100 +2249,100 @@ var cr = async (t14, e, n, r, s, o) => {
|
|
|
2249
2249
|
let i = await ir(t14, e, n, r), a = i instanceof Response ? i : await ro(i, t14, e, s, o);
|
|
2250
2250
|
return sr(t14, a, n);
|
|
2251
2251
|
};
|
|
2252
|
-
var ur = async (t14, e, n, r = false) => {
|
|
2253
|
-
switch (
|
|
2252
|
+
var ur = async (t14, e, n, r, s = false) => {
|
|
2253
|
+
switch (n.html_handling) {
|
|
2254
2254
|
case "auto-trailing-slash":
|
|
2255
|
-
return so(t14, e, n, r);
|
|
2255
|
+
return so(t14, e, n, r, s);
|
|
2256
2256
|
case "force-trailing-slash":
|
|
2257
|
-
return oo(t14, e, n, r);
|
|
2257
|
+
return oo(t14, e, n, r, s);
|
|
2258
2258
|
case "drop-trailing-slash":
|
|
2259
|
-
return io(t14, e, n, r);
|
|
2259
|
+
return io(t14, e, n, r, s);
|
|
2260
2260
|
case "none":
|
|
2261
|
-
return ao(t14, e, n);
|
|
2261
|
+
return ao(t14, e, n, r);
|
|
2262
2262
|
}
|
|
2263
2263
|
};
|
|
2264
|
-
var so = async (t14, e, n, r) => {
|
|
2265
|
-
let
|
|
2264
|
+
var so = async (t14, e, n, r, s) => {
|
|
2265
|
+
let o = null, i = null, a = await r(t14, e);
|
|
2266
2266
|
if (t14.endsWith("/index")) {
|
|
2267
|
-
if (
|
|
2268
|
-
if (
|
|
2269
|
-
if (
|
|
2267
|
+
if (a) return { asset: { eTag: a, status: y.status }, redirect: null };
|
|
2268
|
+
if (o = await E(`${t14}.html`, e, t14.slice(0, -5), n, r, s)) return o;
|
|
2269
|
+
if (o = await E(`${t14.slice(0, -6)}.html`, e, t14.slice(0, -6), n, r, s)) return o;
|
|
2270
2270
|
} else if (t14.endsWith("/index.html")) {
|
|
2271
|
-
if (
|
|
2272
|
-
if (
|
|
2271
|
+
if (o = await E(t14, e, t14.slice(0, -10), n, r, s)) return o;
|
|
2272
|
+
if (o = await E(`${t14.slice(0, -11)}.html`, e, t14.slice(0, -11), n, r, s)) return o;
|
|
2273
2273
|
} else if (t14.endsWith("/")) {
|
|
2274
|
-
if (
|
|
2275
|
-
if (
|
|
2274
|
+
if (i = await r(`${t14}index.html`, e)) return { asset: { eTag: i, status: y.status }, redirect: null };
|
|
2275
|
+
if (o = await E(`${t14.slice(0, -1)}.html`, e, t14.slice(0, -1), n, r, s)) return o;
|
|
2276
2276
|
} else if (t14.endsWith(".html")) {
|
|
2277
|
-
if (
|
|
2278
|
-
if (
|
|
2277
|
+
if (o = await E(t14, e, t14.slice(0, -5), n, r, s)) return o;
|
|
2278
|
+
if (o = await E(`${t14.slice(0, -5)}/index.html`, e, `${t14.slice(0, -5)}/`, n, r, s)) return o;
|
|
2279
2279
|
}
|
|
2280
|
-
return
|
|
2280
|
+
return a ? { asset: { eTag: a, status: y.status }, redirect: null } : (i = await r(`${t14}.html`, e)) ? { asset: { eTag: i, status: y.status }, redirect: null } : (o = await E(`${t14}/index.html`, e, `${t14}/`, n, r, s)) ? o : st(t14, e, n, r);
|
|
2281
2281
|
};
|
|
2282
|
-
var oo = async (t14, e, n, r) => {
|
|
2283
|
-
let
|
|
2282
|
+
var oo = async (t14, e, n, r, s) => {
|
|
2283
|
+
let o = null, i = null, a = await r(t14, e);
|
|
2284
2284
|
if (t14.endsWith("/index")) {
|
|
2285
|
-
if (
|
|
2286
|
-
if (
|
|
2287
|
-
if (
|
|
2285
|
+
if (a) return { asset: { eTag: a, status: y.status }, redirect: null };
|
|
2286
|
+
if (o = await E(`${t14}.html`, e, t14.slice(0, -5), n, r, s)) return o;
|
|
2287
|
+
if (o = await E(`${t14.slice(0, -6)}.html`, e, t14.slice(0, -5), n, r, s)) return o;
|
|
2288
2288
|
} else if (t14.endsWith("/index.html")) {
|
|
2289
|
-
if (
|
|
2290
|
-
if (
|
|
2289
|
+
if (o = await E(t14, e, t14.slice(0, -10), n, r, s)) return o;
|
|
2290
|
+
if (o = await E(`${t14.slice(0, -11)}.html`, e, t14.slice(0, -10), n, r, s)) return o;
|
|
2291
2291
|
} else if (t14.endsWith("/")) {
|
|
2292
|
-
if (
|
|
2293
|
-
if (
|
|
2292
|
+
if (i = await r(`${t14}index.html`, e)) return { asset: { eTag: i, status: y.status }, redirect: null };
|
|
2293
|
+
if (i = await r(`${t14.slice(0, -1)}.html`, e)) return { asset: { eTag: i, status: y.status }, redirect: null };
|
|
2294
2294
|
} else if (t14.endsWith(".html")) {
|
|
2295
|
-
if (
|
|
2296
|
-
if (
|
|
2297
|
-
if (
|
|
2295
|
+
if (o = await E(t14, e, `${t14.slice(0, -5)}/`, n, r, s)) return o;
|
|
2296
|
+
if (a) return { asset: { eTag: a, status: y.status }, redirect: null };
|
|
2297
|
+
if (o = await E(`${t14.slice(0, -5)}/index.html`, e, `${t14.slice(0, -5)}/`, n, r, s)) return o;
|
|
2298
2298
|
}
|
|
2299
|
-
return
|
|
2299
|
+
return a ? { asset: { eTag: a, status: y.status }, redirect: null } : (o = await E(`${t14}.html`, e, `${t14}/`, n, r, s)) || (o = await E(`${t14}/index.html`, e, `${t14}/`, n, r, s)) ? o : st(t14, e, n, r);
|
|
2300
2300
|
};
|
|
2301
|
-
var io = async (t14, e, n, r) => {
|
|
2302
|
-
let
|
|
2301
|
+
var io = async (t14, e, n, r, s) => {
|
|
2302
|
+
let o = null, i = null, a = await r(t14, e);
|
|
2303
2303
|
if (t14.endsWith("/index")) {
|
|
2304
|
-
if (
|
|
2304
|
+
if (a) return { asset: { eTag: a, status: y.status }, redirect: null };
|
|
2305
2305
|
if (t14 === "/index") {
|
|
2306
|
-
if (
|
|
2306
|
+
if (o = await E("/index.html", e, "/", n, r, s)) return o;
|
|
2307
2307
|
} else {
|
|
2308
|
-
if (
|
|
2309
|
-
if (
|
|
2308
|
+
if (o = await E(`${t14.slice(0, -6)}.html`, e, t14.slice(0, -6), n, r, s)) return o;
|
|
2309
|
+
if (o = await E(`${t14}.html`, e, t14.slice(0, -6), n, r, s)) return o;
|
|
2310
2310
|
}
|
|
2311
2311
|
} else if (t14.endsWith("/index.html")) if (t14 === "/index.html") {
|
|
2312
|
-
if (
|
|
2312
|
+
if (o = await E("/index.html", e, "/", n, r, s)) return o;
|
|
2313
2313
|
} else {
|
|
2314
|
-
if (
|
|
2315
|
-
if (
|
|
2316
|
-
if (
|
|
2314
|
+
if (o = await E(t14, e, t14.slice(0, -11), n, r, s)) return o;
|
|
2315
|
+
if (a) return { asset: { eTag: a, status: y.status }, redirect: null };
|
|
2316
|
+
if (o = await E(`${t14.slice(0, -11)}.html`, e, t14.slice(0, -11), n, r, s)) return o;
|
|
2317
2317
|
}
|
|
2318
2318
|
else if (t14.endsWith("/")) if (t14 === "/") {
|
|
2319
|
-
if (
|
|
2319
|
+
if (i = await r("/index.html", e)) return { asset: { eTag: i, status: y.status }, redirect: null };
|
|
2320
2320
|
} else {
|
|
2321
|
-
if (
|
|
2322
|
-
if (
|
|
2321
|
+
if (o = await E(`${t14.slice(0, -1)}.html`, e, t14.slice(0, -1), n, r, s)) return o;
|
|
2322
|
+
if (o = await E(`${t14.slice(0, -1)}/index.html`, e, t14.slice(0, -1), n, r, s)) return o;
|
|
2323
2323
|
}
|
|
2324
2324
|
else if (t14.endsWith(".html")) {
|
|
2325
|
-
if (
|
|
2326
|
-
if (
|
|
2325
|
+
if (o = await E(t14, e, t14.slice(0, -5), n, r, s)) return o;
|
|
2326
|
+
if (o = await E(`${t14.slice(0, -5)}/index.html`, e, t14.slice(0, -5), n, r, s)) return o;
|
|
2327
2327
|
}
|
|
2328
|
-
return
|
|
2328
|
+
return a ? { asset: { eTag: a, status: y.status }, redirect: null } : (i = await r(`${t14}.html`, e)) ? { asset: { eTag: i, status: y.status }, redirect: null } : (i = await r(`${t14}/index.html`, e)) ? { asset: { eTag: i, status: y.status }, redirect: null } : st(t14, e, n, r);
|
|
2329
2329
|
};
|
|
2330
|
-
var ao = async (t14, e, n) => {
|
|
2331
|
-
let
|
|
2332
|
-
return
|
|
2330
|
+
var ao = async (t14, e, n, r) => {
|
|
2331
|
+
let s = await r(t14, e);
|
|
2332
|
+
return s ? { asset: { eTag: s, status: y.status }, redirect: null } : st(t14, e, n, r);
|
|
2333
2333
|
};
|
|
2334
|
-
var st = async (t14, e, n) => {
|
|
2335
|
-
switch (
|
|
2334
|
+
var st = async (t14, e, n, r) => {
|
|
2335
|
+
switch (n.not_found_handling) {
|
|
2336
2336
|
case "single-page-application": {
|
|
2337
|
-
let
|
|
2338
|
-
return
|
|
2337
|
+
let s = await r("/index.html", e);
|
|
2338
|
+
return s ? { asset: { eTag: s, status: y.status }, redirect: null } : null;
|
|
2339
2339
|
}
|
|
2340
2340
|
case "404-page": {
|
|
2341
|
-
let
|
|
2342
|
-
for (;
|
|
2343
|
-
|
|
2344
|
-
let
|
|
2345
|
-
if (
|
|
2341
|
+
let s = t14;
|
|
2342
|
+
for (; s; ) {
|
|
2343
|
+
s = s.slice(0, s.lastIndexOf("/"));
|
|
2344
|
+
let o = await r(`${s}/404.html`, e);
|
|
2345
|
+
if (o) return { asset: { eTag: o, status: j.status }, redirect: null };
|
|
2346
2346
|
}
|
|
2347
2347
|
return null;
|
|
2348
2348
|
}
|
|
@@ -2351,11 +2351,11 @@ var st = async (t14, e, n) => {
|
|
|
2351
2351
|
return null;
|
|
2352
2352
|
}
|
|
2353
2353
|
};
|
|
2354
|
-
var E = async (t14, e, n, r, s) => {
|
|
2355
|
-
if (
|
|
2356
|
-
if (!await
|
|
2357
|
-
let
|
|
2358
|
-
if (
|
|
2354
|
+
var E = async (t14, e, n, r, s, o) => {
|
|
2355
|
+
if (o) return null;
|
|
2356
|
+
if (!await s(n, e)) {
|
|
2357
|
+
let i = await ur(n, e, r, s, true);
|
|
2358
|
+
if (i?.asset && i.asset.eTag === await s(t14, e)) return { asset: null, redirect: n };
|
|
2359
2359
|
}
|
|
2360
2360
|
return null;
|
|
2361
2361
|
};
|
|
@@ -2409,7 +2409,7 @@ var fr = class extends lo {
|
|
|
2409
2409
|
async fetch(t14) {
|
|
2410
2410
|
let e, n = new Xe(this.env.ANALYTICS), r = new X(this.env.UNSAFE_PERFORMANCE), s = r.now();
|
|
2411
2411
|
try {
|
|
2412
|
-
this.env.JAEGER ??=
|
|
2412
|
+
this.env.JAEGER ??= qt(), e = Qn(t14, this.ctx, this.env.SENTRY_DSN, this.env.SENTRY_ACCESS_CLIENT_ID, this.env.SENTRY_ACCESS_CLIENT_SECRET, this.env.COLO_METADATA, this.env.VERSION_METADATA, this.env.CONFIG?.account_id, this.env.CONFIG?.script_id);
|
|
2413
2413
|
let o = Zt(this.env.CONFIG);
|
|
2414
2414
|
e?.setContext("compatibilityOptions", { compatibilityDate: o.compatibility_date, compatibilityFlags: o.compatibility_flags, originalCompatibilityFlags: this.env.CONFIG.compatibility_flags });
|
|
2415
2415
|
let i = t14.headers.get("user-agent") ?? "UA UNKNOWN", a = new URL(t14.url);
|
|
@@ -2425,25 +2425,25 @@ var fr = class extends lo {
|
|
|
2425
2425
|
}
|
|
2426
2426
|
}
|
|
2427
2427
|
async unstable_canFetch(t14) {
|
|
2428
|
-
return this.env.JAEGER ??=
|
|
2428
|
+
return this.env.JAEGER ??= qt(), ar(t14, this.env, Zt(this.env.CONFIG), this.unstable_exists.bind(this));
|
|
2429
2429
|
}
|
|
2430
|
-
async unstable_getByETag(t14) {
|
|
2431
|
-
let
|
|
2432
|
-
if (!
|
|
2433
|
-
return { readableStream:
|
|
2430
|
+
async unstable_getByETag(t14, e) {
|
|
2431
|
+
let n = new X(this.env.UNSAFE_PERFORMANCE), r = n.now(), s = await dr(this.env.ASSETS_KV_NAMESPACE, t14), i = n.now() - r;
|
|
2432
|
+
if (!s || !s.value) throw new Error(`Requested asset ${t14} exists in the asset manifest but not in the KV namespace.`);
|
|
2433
|
+
return { readableStream: s.value, contentType: s.metadata?.contentType, cacheStatus: i <= 100 ? "HIT" : "MISS" };
|
|
2434
2434
|
}
|
|
2435
|
-
async unstable_getByPathname(t14) {
|
|
2436
|
-
let
|
|
2437
|
-
return
|
|
2435
|
+
async unstable_getByPathname(t14, e) {
|
|
2436
|
+
let n = await this.unstable_exists(t14, e);
|
|
2437
|
+
return n ? this.unstable_getByETag(n, e) : null;
|
|
2438
2438
|
}
|
|
2439
|
-
async unstable_exists(t14) {
|
|
2440
|
-
let
|
|
2441
|
-
this.env.COLO_METADATA && this.env.VERSION_METADATA && this.env.CONFIG &&
|
|
2442
|
-
let
|
|
2439
|
+
async unstable_exists(t14, e) {
|
|
2440
|
+
let n = new tt(this.env.EXPERIMENT_ANALYTICS), r = new X(this.env.UNSAFE_PERFORMANCE);
|
|
2441
|
+
this.env.COLO_METADATA && this.env.VERSION_METADATA && this.env.CONFIG && n.setData({ accountId: this.env.CONFIG.account_id, experimentName: "manifest-read-timing" });
|
|
2442
|
+
let s = r.now();
|
|
2443
2443
|
try {
|
|
2444
2444
|
return await new et(this.env.ASSETS_MANIFEST).get(t14);
|
|
2445
2445
|
} finally {
|
|
2446
|
-
|
|
2446
|
+
n.setData({ manifestReadTime: r.now() - s }), n.write();
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
2449
|
};
|
|
@@ -2487,6 +2487,13 @@ var CustomAssetWorker = class extends fr {
|
|
|
2487
2487
|
const exists = await response.json();
|
|
2488
2488
|
return exists ? pathname : null;
|
|
2489
2489
|
}
|
|
2490
|
+
async unstable_canFetch(request) {
|
|
2491
|
+
const secFetchMode = request.headers.get("X-Mf-Sec-Fetch-Mode");
|
|
2492
|
+
if (secFetchMode) {
|
|
2493
|
+
request.headers.set("Sec-Fetch-Mode", secFetchMode);
|
|
2494
|
+
}
|
|
2495
|
+
return await super.unstable_canFetch(request);
|
|
2496
|
+
}
|
|
2490
2497
|
};
|
|
2491
2498
|
export {
|
|
2492
2499
|
CustomAssetWorker as default
|