@ryuzaki13/react-foundation-lib 2.1.3 → 2.1.4
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/error-report-source-maps/index.js +97 -94
- package/dist/error-report-source-maps/index.js.map +1 -1
- package/dist/error-report-source-maps/package.d.ts +1 -0
- package/dist/error-report-source-maps/package.d.ts.map +1 -1
- package/dist/error-report-source-maps/types.d.ts +2 -0
- package/dist/error-report-source-maps/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3,44 +3,44 @@ import { createHash as t } from "node:crypto";
|
|
|
3
3
|
import { lstat as n, mkdir as r, readFile as i, readdir as a, realpath as o, rename as s, rm as c, stat as l, unlink as u, writeFile as d } from "node:fs/promises";
|
|
4
4
|
import f from "node:path";
|
|
5
5
|
//#region \0rolldown/runtime.js
|
|
6
|
-
var p = Object.create, m = Object.defineProperty, h = Object.getOwnPropertyDescriptor, g = Object.getOwnPropertyNames, _ = Object.getPrototypeOf, v = Object.prototype.hasOwnProperty,
|
|
6
|
+
var p = Object.create, m = Object.defineProperty, h = Object.getOwnPropertyDescriptor, g = Object.getOwnPropertyNames, _ = Object.getPrototypeOf, v = Object.prototype.hasOwnProperty, y = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ee = (e, t, n, r) => {
|
|
7
7
|
if (t && typeof t == "object" || typeof t == "function") for (var i = g(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !v.call(e, s) && s !== n && m(e, s, {
|
|
8
8
|
get: ((e) => t[e]).bind(null, s),
|
|
9
9
|
enumerable: !(r = h(t, s)) || r.enumerable
|
|
10
10
|
});
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, te = (e, t, n) => (n = e == null ? {} : p(_(e)), ee(t || !e || !e.__esModule || !v.call(e, "default") ? m(n, "default", {
|
|
13
13
|
value: e,
|
|
14
14
|
enumerable: !0
|
|
15
|
-
}) : n, e)),
|
|
16
|
-
function
|
|
15
|
+
}) : n, e)), ne = 1, b = /^[0-9a-f]{40}$/, re = 2097152, x = 33554432, S = 268435456, ie = 83808e5, C = /^[a-z0-9]+(?:[.-][a-z0-9]+)*$/, ae = /^[0-9a-f]{64}$/;
|
|
16
|
+
function w(e) {
|
|
17
17
|
return !e || e.startsWith("/") || e.includes("\\") || e.includes("\0") ? !1 : e.split("/").every((e) => e !== "" && e !== "." && e !== "..");
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return e.includes("\\") || e.includes("\0") || e.includes("?") || e.includes("#") ? !1 : t === "client" ? e.startsWith("/") &&
|
|
19
|
+
function oe(e, t) {
|
|
20
|
+
return e.includes("\\") || e.includes("\0") || e.includes("?") || e.includes("#") ? !1 : t === "client" ? e.startsWith("/") && w(e.slice(1)) : e.startsWith("server/") && w(e);
|
|
21
21
|
}
|
|
22
|
-
var
|
|
22
|
+
var se = e.object({
|
|
23
23
|
kind: e.enum(["client", "server"]),
|
|
24
24
|
bundle: e.string().max(1024),
|
|
25
25
|
map: e.string().max(1024),
|
|
26
|
-
sha256: e.string().regex(
|
|
27
|
-
size: e.number().int().positive().max(
|
|
26
|
+
sha256: e.string().regex(ae),
|
|
27
|
+
size: e.number().int().positive().max(x)
|
|
28
28
|
}).strict().superRefine((e, t) => {
|
|
29
|
-
|
|
29
|
+
oe(e.bundle, e.kind) || t.addIssue({
|
|
30
30
|
code: "custom",
|
|
31
31
|
path: ["bundle"],
|
|
32
32
|
message: "Bundle path должен быть нормализован."
|
|
33
|
-
}), (!
|
|
33
|
+
}), (!w(e.map) || !e.map.startsWith(`${e.kind}/`) || !e.map.endsWith(".map")) && t.addIssue({
|
|
34
34
|
code: "custom",
|
|
35
35
|
path: ["map"],
|
|
36
36
|
message: "Map path должен оставаться внутри kind-каталога."
|
|
37
37
|
});
|
|
38
|
-
}),
|
|
38
|
+
}), ce = e.object({
|
|
39
39
|
version: e.literal(1),
|
|
40
|
-
application: e.string().min(1).max(128).regex(
|
|
41
|
-
buildId: e.string().regex(
|
|
40
|
+
application: e.string().min(1).max(128).regex(C),
|
|
41
|
+
buildId: e.string().regex(b),
|
|
42
42
|
createdUtc: e.iso.datetime({ offset: !0 }),
|
|
43
|
-
entries: e.array(
|
|
43
|
+
entries: e.array(se).max(1e4)
|
|
44
44
|
}).strict().superRefine((e, t) => {
|
|
45
45
|
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = 0;
|
|
46
46
|
for (let [a, o] of e.entries.entries()) n.has(o.bundle) && t.addIssue({
|
|
@@ -66,83 +66,83 @@ var ce = e.object({
|
|
|
66
66
|
message: "Private source-map artifact превышает общий предел."
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
|
-
function
|
|
70
|
-
let t =
|
|
69
|
+
function le(e) {
|
|
70
|
+
let t = ce.safeParse(e);
|
|
71
71
|
return t.success ? t.data : null;
|
|
72
72
|
}
|
|
73
|
-
function w(e) {
|
|
74
|
-
return typeof e == "string" && e.length <= 128 && S.test(e);
|
|
75
|
-
}
|
|
76
73
|
function T(e) {
|
|
77
|
-
return typeof e == "string" &&
|
|
74
|
+
return typeof e == "string" && e.length <= 128 && C.test(e);
|
|
75
|
+
}
|
|
76
|
+
function E(e) {
|
|
77
|
+
return typeof e == "string" && b.test(e);
|
|
78
78
|
}
|
|
79
79
|
//#endregion
|
|
80
80
|
//#region src/error-report-source-maps/artifact.ts
|
|
81
|
-
var
|
|
81
|
+
var D = class extends Error {
|
|
82
82
|
constructor() {
|
|
83
83
|
super("Private source-map artifact не прошёл проверку целостности."), this.name = "PrivateSourceMapArtifactError";
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
function
|
|
86
|
+
function ue(e) {
|
|
87
87
|
return e instanceof Error && "code" in e && e.code === "ENOENT";
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function O(e, t) {
|
|
90
90
|
let n = f.relative(e, t);
|
|
91
91
|
return n !== "" && !n.startsWith("..") && !f.isAbsolute(n);
|
|
92
92
|
}
|
|
93
|
-
async function
|
|
93
|
+
async function k(e, t, r) {
|
|
94
94
|
let a = await n(e);
|
|
95
|
-
if (!a.isFile() || a.isSymbolicLink() || a.size <= 0 || a.size > r) throw new
|
|
95
|
+
if (!a.isFile() || a.isSymbolicLink() || a.size <= 0 || a.size > r) throw new D();
|
|
96
96
|
let s = await o(e);
|
|
97
|
-
if (!
|
|
97
|
+
if (!O(t, s)) throw new D();
|
|
98
98
|
let c = await i(s);
|
|
99
|
-
if (c.byteLength !== a.size) throw new
|
|
99
|
+
if (c.byteLength !== a.size) throw new D();
|
|
100
100
|
return c;
|
|
101
101
|
}
|
|
102
|
-
async function
|
|
103
|
-
if (!
|
|
102
|
+
async function A(e, t, n) {
|
|
103
|
+
if (!T(t) || !E(n)) throw new D();
|
|
104
104
|
let r, i;
|
|
105
105
|
try {
|
|
106
106
|
r = await o(f.resolve(e)), i = await o(f.join(r, t, n));
|
|
107
107
|
} catch (e) {
|
|
108
|
-
if (
|
|
109
|
-
throw new
|
|
108
|
+
if (ue(e)) return null;
|
|
109
|
+
throw new D();
|
|
110
110
|
}
|
|
111
|
-
if (!
|
|
111
|
+
if (!O(r, i)) throw new D();
|
|
112
112
|
let a;
|
|
113
113
|
try {
|
|
114
|
-
a = await
|
|
114
|
+
a = await k(f.join(i, "manifest.json"), i, re);
|
|
115
115
|
} catch (e) {
|
|
116
|
-
if (
|
|
117
|
-
throw e instanceof
|
|
116
|
+
if (ue(e)) return null;
|
|
117
|
+
throw e instanceof D ? e : new D();
|
|
118
118
|
}
|
|
119
119
|
let s;
|
|
120
120
|
try {
|
|
121
121
|
s = JSON.parse(a.toString("utf8"));
|
|
122
122
|
} catch {
|
|
123
|
-
throw new
|
|
123
|
+
throw new D();
|
|
124
124
|
}
|
|
125
|
-
let c =
|
|
126
|
-
if (!c || c.application !== t || c.buildId !== n) throw new
|
|
125
|
+
let c = le(s);
|
|
126
|
+
if (!c || c.application !== t || c.buildId !== n) throw new D();
|
|
127
127
|
return {
|
|
128
128
|
buildDirectory: i,
|
|
129
129
|
manifest: c,
|
|
130
130
|
entriesByBundle: new Map(c.entries.map((e) => [e.bundle, e]))
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
async function
|
|
133
|
+
async function j(e, n) {
|
|
134
134
|
try {
|
|
135
|
-
let r = await
|
|
136
|
-
if (r.byteLength !== n.size || t("sha256").update(r).digest("hex") !== n.sha256) throw new
|
|
135
|
+
let r = await k(f.join(e.buildDirectory, n.map), e.buildDirectory, n.size);
|
|
136
|
+
if (r.byteLength !== n.size || t("sha256").update(r).digest("hex") !== n.sha256) throw new D();
|
|
137
137
|
return r.toString("utf8");
|
|
138
138
|
} catch (e) {
|
|
139
|
-
throw e instanceof
|
|
139
|
+
throw e instanceof D ? e : new D();
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
143
143
|
//#region src/error-report-source-maps/archive.ts
|
|
144
|
-
var
|
|
145
|
-
async function
|
|
144
|
+
var de = 864e5;
|
|
145
|
+
async function fe(e, t, n, i) {
|
|
146
146
|
let a = f.join(f.resolve(t), n), o = f.join(a, i), l = f.join(a, `.${i}.tmp-${process.pid}`);
|
|
147
147
|
await r(a, { recursive: !0 }), await c(l, {
|
|
148
148
|
force: !0,
|
|
@@ -150,7 +150,7 @@ async function pe(e, t, n, i) {
|
|
|
150
150
|
}), await r(l, { recursive: !1 });
|
|
151
151
|
try {
|
|
152
152
|
for (let t of e.manifest.entries) {
|
|
153
|
-
let n = await
|
|
153
|
+
let n = await j(e, t), i = f.join(l, t.map);
|
|
154
154
|
await r(f.dirname(i), { recursive: !0 }), await d(i, n, {
|
|
155
155
|
encoding: "utf8",
|
|
156
156
|
flag: "wx"
|
|
@@ -164,34 +164,34 @@ async function pe(e, t, n, i) {
|
|
|
164
164
|
if (await c(l, {
|
|
165
165
|
force: !0,
|
|
166
166
|
recursive: !0
|
|
167
|
-
}), !await
|
|
167
|
+
}), !await A(t, n, i).catch(() => null)) throw e;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
async function
|
|
171
|
-
if (!
|
|
170
|
+
async function M(e) {
|
|
171
|
+
if (!E(e.buildId)) return;
|
|
172
172
|
await r(e.archiveRoot, { recursive: !0 });
|
|
173
|
-
let t = await
|
|
173
|
+
let t = await A(e.archiveRoot, e.application, e.buildId), n = e.seedRoot ? await A(e.seedRoot, e.application, e.buildId) : null;
|
|
174
174
|
if (t && n && JSON.stringify(t.manifest.entries) !== JSON.stringify(n.manifest.entries)) throw Error("Persistent source-map artifact не совпадает с image seed для того же build ID.");
|
|
175
|
-
!t && n && await
|
|
175
|
+
!t && n && await fe(n, e.archiveRoot, e.application, e.buildId);
|
|
176
176
|
let i = f.join(f.resolve(e.archiveRoot), e.application);
|
|
177
177
|
await r(i, { recursive: !0 });
|
|
178
178
|
let o = (e.now ?? (() => /* @__PURE__ */ new Date()))().getTime();
|
|
179
|
-
for (let t of await a(i, { withFileTypes: !0 })) if (!(!t.isDirectory() || !
|
|
180
|
-
let n = await
|
|
179
|
+
for (let t of await a(i, { withFileTypes: !0 })) if (!(!t.isDirectory() || !E(t.name) || t.name === e.buildId)) try {
|
|
180
|
+
let n = await A(e.archiveRoot, e.application, t.name);
|
|
181
181
|
if (!n) continue;
|
|
182
182
|
let r = Date.parse(n.manifest.createdUtc);
|
|
183
183
|
Number.isFinite(r) && r + 83808e5 <= o && await c(n.buildDirectory, { recursive: !0 });
|
|
184
184
|
} catch {}
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
let t = () => void
|
|
186
|
+
function pe(e) {
|
|
187
|
+
let t = () => void M(e).catch((t) => e.onError?.(t));
|
|
188
188
|
t();
|
|
189
|
-
let n = setInterval(t,
|
|
189
|
+
let n = setInterval(t, de);
|
|
190
190
|
return n.unref(), () => clearInterval(n);
|
|
191
191
|
}
|
|
192
192
|
//#endregion
|
|
193
193
|
//#region src/error-report-source-maps/package.ts
|
|
194
|
-
var
|
|
194
|
+
var me = /(?:\/\*[#@]\s*sourceMappingURL=[^*]*\*\/|\/\/[#@]\s*sourceMappingURL=.*)$/gm, N = /\.(?:css|html|js|mjs)$/, he = /"(\/[^"\n]+\.map)"\s*:\s*\{/, ge = ".private-source-maps-staging/client";
|
|
195
195
|
async function P(e, t = /* @__PURE__ */ new Set()) {
|
|
196
196
|
let n = [];
|
|
197
197
|
for (let r of await a(e, { withFileTypes: !0 })) {
|
|
@@ -204,7 +204,7 @@ async function P(e, t = /* @__PURE__ */ new Set()) {
|
|
|
204
204
|
return n.sort((e, t) => e.localeCompare(t));
|
|
205
205
|
}
|
|
206
206
|
function _e(e, t) {
|
|
207
|
-
if (e.byteLength === 0 || e.byteLength > 33554432) throw Error(`Source map выходит за предел ${
|
|
207
|
+
if (e.byteLength === 0 || e.byteLength > 33554432) throw Error(`Source map выходит за предел ${x} bytes: ${t}`);
|
|
208
208
|
let n;
|
|
209
209
|
try {
|
|
210
210
|
n = JSON.parse(e.toString("utf8"));
|
|
@@ -216,8 +216,8 @@ function _e(e, t) {
|
|
|
216
216
|
if (!Array.isArray(r)) throw Error(`Source map не содержит список sources: ${t}`);
|
|
217
217
|
if (i !== void 0 && (!Array.isArray(i) || i.length !== r.length)) throw Error(`Source map содержит неполный sourcesContent: ${t}`);
|
|
218
218
|
}
|
|
219
|
-
function ve(e, t) {
|
|
220
|
-
let
|
|
219
|
+
function ve(e, t, n) {
|
|
220
|
+
let r = f.join(e, "public"), i = f.join(e, "server"), a = f.relative(r, n);
|
|
221
221
|
if (a && !a.startsWith("..") && !f.isAbsolute(a)) {
|
|
222
222
|
let e = a.split(f.sep).join("/");
|
|
223
223
|
return {
|
|
@@ -226,7 +226,7 @@ function ve(e, t) {
|
|
|
226
226
|
map: `client/${e}`
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
|
-
let o = f.relative(
|
|
229
|
+
let o = f.relative(t, n);
|
|
230
230
|
if (o && !o.startsWith("..") && !f.isAbsolute(o)) {
|
|
231
231
|
let e = o.split(f.sep).join("/");
|
|
232
232
|
return {
|
|
@@ -235,7 +235,7 @@ function ve(e, t) {
|
|
|
235
235
|
map: `client/${e}`
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
|
-
let s = f.relative(
|
|
238
|
+
let s = f.relative(i, n);
|
|
239
239
|
if (s && !s.startsWith("..") && !f.isAbsolute(s)) {
|
|
240
240
|
let e = s.split(f.sep).join("/");
|
|
241
241
|
return {
|
|
@@ -244,74 +244,77 @@ function ve(e, t) {
|
|
|
244
244
|
map: `server/${e}`
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
throw Error(`Source map находится вне public/server output: ${
|
|
247
|
+
throw Error(`Source map находится вне public/server output: ${n}`);
|
|
248
248
|
}
|
|
249
249
|
async function F(e) {
|
|
250
|
-
let t = await i(e, "utf8"), n = t.replace(
|
|
250
|
+
let t = await i(e, "utf8"), n = t.replace(me, "");
|
|
251
251
|
n !== t && await d(e, n, "utf8");
|
|
252
252
|
}
|
|
253
253
|
async function ye(e, t = {}) {
|
|
254
|
-
let n = f.resolve(e), i = f.resolve(t.publicRoot ?? f.join(n, "public")), a = f.join(n,
|
|
254
|
+
let n = f.resolve(e), i = f.resolve(t.publicRoot ?? f.join(n, "public")), a = f.resolve(t.clientSourceMapStagingRoot ?? f.join(n, ".private-source-maps-staging/client")), o = await P(i), c = o.filter((e) => e.endsWith(".map"));
|
|
255
255
|
for (let e of c) {
|
|
256
256
|
let t = f.relative(i, e), n = f.join(a, t);
|
|
257
257
|
await r(f.dirname(n), { recursive: !0 }), await s(e, n);
|
|
258
258
|
}
|
|
259
|
-
for (let e of o) !e.endsWith(".map") &&
|
|
259
|
+
for (let e of o) !e.endsWith(".map") && N.test(e) && await F(e);
|
|
260
260
|
return c.length;
|
|
261
261
|
}
|
|
262
262
|
async function I(e) {
|
|
263
|
-
let t = await i(e, "utf8"), n =
|
|
263
|
+
let t = await i(e, "utf8"), n = he.exec(t)?.[1];
|
|
264
264
|
if (n) throw Error(`Nitro static asset manifest содержит source map: ${n}`);
|
|
265
265
|
}
|
|
266
266
|
async function L(e) {
|
|
267
267
|
for (let t of await P(e)) {
|
|
268
268
|
if (t.endsWith(".map")) throw Error(`Public output содержит source map: ${t}`);
|
|
269
|
-
if (
|
|
269
|
+
if (N.test(t) && (await i(t, "utf8")).includes("sourceMappingURL")) throw Error(`Public output содержит sourceMappingURL: ${t}`);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
async function be(e) {
|
|
273
|
-
if (!
|
|
274
|
-
let n = f.resolve(e.outputRoot), a = f.resolve(e.artifactRoot), o = f.join(a, e.application, e.buildId),
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
if (!T(e.application) || !E(e.buildId)) throw Error("Application или build ID private source-map artifact недопустим.");
|
|
274
|
+
let n = f.resolve(e.outputRoot), a = f.resolve(e.artifactRoot), o = f.resolve(e.clientSourceMapStagingRoot ?? f.join(n, ".private-source-maps-staging/client")), p = f.join(a, e.application, e.buildId), m = `${p}.tmp-${process.pid}`, h = await P(n, /* @__PURE__ */ new Set([f.resolve(n, "server/node_modules")])), g = (() => {
|
|
275
|
+
let e = f.relative(n, o);
|
|
276
|
+
return e === "" || !e.startsWith("..") && !f.isAbsolute(e);
|
|
277
|
+
})() ? [] : await P(o), _ = [...h, ...g].filter((e) => e.endsWith(".map"));
|
|
278
|
+
if (_.length === 0) throw Error("Production build не создал private source maps.");
|
|
279
|
+
await c(m, {
|
|
277
280
|
force: !0,
|
|
278
281
|
recursive: !0
|
|
279
|
-
}), await r(
|
|
280
|
-
let
|
|
282
|
+
}), await r(m, { recursive: !0 });
|
|
283
|
+
let v = [], y = 0;
|
|
281
284
|
try {
|
|
282
|
-
for (let e of
|
|
285
|
+
for (let e of _) {
|
|
283
286
|
let a = await i(e);
|
|
284
|
-
if (_e(a, e),
|
|
285
|
-
let
|
|
286
|
-
await r(f.dirname(
|
|
287
|
-
...
|
|
287
|
+
if (_e(a, e), y += a.byteLength, y > 268435456) throw Error(`Private source-map artifact превышает ${S} bytes.`);
|
|
288
|
+
let s = ve(n, o, e), c = f.join(m, s.map);
|
|
289
|
+
await r(f.dirname(c), { recursive: !0 }), await d(c, a, { flag: "wx" }), v.push({
|
|
290
|
+
...s,
|
|
288
291
|
sha256: t("sha256").update(a).digest("hex"),
|
|
289
292
|
size: a.byteLength
|
|
290
293
|
});
|
|
291
294
|
}
|
|
292
|
-
if (!
|
|
293
|
-
if (!
|
|
294
|
-
|
|
295
|
+
if (!v.some((e) => e.kind === "client")) throw Error("Private source-map artifact не содержит client maps.");
|
|
296
|
+
if (!v.some((e) => e.kind === "server")) throw Error("Private source-map artifact не содержит server maps.");
|
|
297
|
+
v.sort((e, t) => e.bundle.localeCompare(t.bundle));
|
|
295
298
|
let a = {
|
|
296
299
|
version: 1,
|
|
297
300
|
application: e.application,
|
|
298
301
|
buildId: e.buildId,
|
|
299
302
|
createdUtc: e.createdUtc ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
300
|
-
entries:
|
|
303
|
+
entries: v
|
|
301
304
|
};
|
|
302
|
-
await d(f.join(
|
|
305
|
+
await d(f.join(m, "manifest.json"), `${JSON.stringify(a, null, 2)}\n`, {
|
|
303
306
|
encoding: "utf8",
|
|
304
307
|
flag: "wx"
|
|
305
|
-
}), await c(
|
|
308
|
+
}), await c(p, {
|
|
306
309
|
force: !0,
|
|
307
310
|
recursive: !0
|
|
308
|
-
}), await r(f.dirname(
|
|
309
|
-
for (let e of
|
|
310
|
-
for (let e of
|
|
311
|
-
if (await L(f.join(n, "public")), await I(f.join(n, "server/index.mjs")), !(await l(f.join(
|
|
311
|
+
}), await r(f.dirname(p), { recursive: !0 }), await s(m, p);
|
|
312
|
+
for (let e of _) await u(e);
|
|
313
|
+
for (let e of h) !e.endsWith(".map") && N.test(e) && await F(e);
|
|
314
|
+
if (await L(f.join(n, "public")), await I(f.join(n, "server/index.mjs")), !(await l(f.join(p, "manifest.json"))).isFile()) throw Error("Private source-map manifest не был создан.");
|
|
312
315
|
return a;
|
|
313
316
|
} catch (e) {
|
|
314
|
-
throw await c(
|
|
317
|
+
throw await c(m, {
|
|
315
318
|
force: !0,
|
|
316
319
|
recursive: !0
|
|
317
320
|
}), e;
|
|
@@ -381,7 +384,7 @@ function Ee(e, t) {
|
|
|
381
384
|
}
|
|
382
385
|
//#endregion
|
|
383
386
|
//#region node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
|
384
|
-
var De = /* @__PURE__ */
|
|
387
|
+
var De = /* @__PURE__ */ te((/* @__PURE__ */ y(((e, t) => {
|
|
385
388
|
(function(n, r) {
|
|
386
389
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self, n.resolveURI = r());
|
|
387
390
|
})(e, (function() {
|
|
@@ -782,7 +785,7 @@ function ut(e, t) {
|
|
|
782
785
|
}
|
|
783
786
|
async function dt(e, t, n) {
|
|
784
787
|
for (let r of e) {
|
|
785
|
-
let e = await
|
|
788
|
+
let e = await A(r, t, n);
|
|
786
789
|
if (e) return e;
|
|
787
790
|
}
|
|
788
791
|
return null;
|
|
@@ -823,7 +826,7 @@ async function pt(e, t, n, r = {}) {
|
|
|
823
826
|
continue;
|
|
824
827
|
}
|
|
825
828
|
let r = c.get(t.map);
|
|
826
|
-
r || (r = new ze(await
|
|
829
|
+
r || (r = new ze(await j(n, t), t.map), c.set(t.map, r));
|
|
827
830
|
let a = Ke(r, {
|
|
828
831
|
line: e.line,
|
|
829
832
|
column: e.column - 1
|
|
@@ -872,6 +875,6 @@ async function pt(e, t, n, r = {}) {
|
|
|
872
875
|
}
|
|
873
876
|
}
|
|
874
877
|
//#endregion
|
|
875
|
-
export {
|
|
878
|
+
export { b as ERROR_REPORT_BUILD_ID_PATTERN, S as PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES, ie as PRIVATE_SOURCE_MAP_ARTIFACT_RETENTION_MS, re as PRIVATE_SOURCE_MAP_MANIFEST_MAX_BYTES, ne as PRIVATE_SOURCE_MAP_MANIFEST_VERSION, x as PRIVATE_SOURCE_MAP_MAX_BYTES, D as PrivateSourceMapArtifactError, ge as STAGED_CLIENT_SOURCE_MAP_DIRECTORY, I as assertNoNitroSourceMapManifestLeaks, L as assertNoPublicSourceMapLeaks, E as isErrorReportBuildId, T as isPrivateSourceMapApplicationId, A as loadPrivateSourceMapArtifact, M as maintainPrivateSourceMapArchive, be as packageErrorReportSourceMaps, le as parsePrivateSourceMapManifest, j as readPrivateSourceMap, ye as stageClientSourceMapsForNitro, pe as startPrivateSourceMapArchiveMaintenance, pt as symbolicateErrorReportStack };
|
|
876
879
|
|
|
877
880
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["sortComparator","resolveUri"],"sources":["../../src/error-report-source-maps/types.ts","../../src/error-report-source-maps/manifest.ts","../../src/error-report-source-maps/artifact.ts","../../src/error-report-source-maps/archive.ts","../../src/error-report-source-maps/package.ts","../../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../../node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js","../../node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs","../../src/error-report-source-maps/symbolicate.ts"],"sourcesContent":["/** Версия immutable manifest, общего для build packager и server reader. */\nexport const PRIVATE_SOURCE_MAP_MANIFEST_VERSION = 1 as const;\n\n/** Полный lowercase Git commit SHA является identity одной сборки. */\nexport const ERROR_REPORT_BUILD_ID_PATTERN = /^[0-9a-f]{40}$/;\n\n/**\n * Лимиты едины для build и runtime: packager не должен создавать artifact,\n * который server reader затем не сможет безопасно прочитать.\n */\nexport const PRIVATE_SOURCE_MAP_MANIFEST_MAX_BYTES = 2 * 1024 * 1024;\nexport const PRIVATE_SOURCE_MAP_MAX_BYTES = 32 * 1024 * 1024;\nexport const PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES = 256 * 1024 * 1024;\nexport const PRIVATE_SOURCE_MAP_ARTIFACT_RETENTION_MS = 97 * 24 * 60 * 60 * 1_000;\n\nexport type PrivateSourceMapManifestEntry = {\n\treadonly kind: \"client\" | \"server\";\n\treadonly bundle: string;\n\treadonly map: string;\n\treadonly sha256: string;\n\treadonly size: number;\n};\n\nexport type PrivateSourceMapManifest = {\n\treadonly version: typeof PRIVATE_SOURCE_MAP_MANIFEST_VERSION;\n\treadonly application: string;\n\treadonly buildId: string;\n\treadonly createdUtc: string;\n\treadonly entries: readonly PrivateSourceMapManifestEntry[];\n};\n\nexport type LoadedPrivateSourceMapArtifact = {\n\treadonly buildDirectory: string;\n\treadonly manifest: PrivateSourceMapManifest;\n\treadonly entriesByBundle: ReadonlyMap<string, PrivateSourceMapManifestEntry>;\n};\n\nexport type ErrorReportSourceContextLine = {\n\treadonly line: number;\n\treadonly content: string;\n\treadonly focus: boolean;\n};\n\nexport type ErrorReportStackFrame = {\n\treadonly functionName?: string;\n\treadonly generated: {\n\t\treadonly source: string;\n\t\treadonly line: number;\n\t\treadonly column: number;\n\t};\n\treadonly original?: {\n\t\treadonly source: string;\n\t\treadonly line: number;\n\t\treadonly column: number;\n\t\treadonly name?: string;\n\t};\n\treadonly sourceContext?: readonly ErrorReportSourceContextLine[];\n};\n\nexport type ErrorReportSymbolicationResult = {\n\treadonly status: \"not-required\" | \"resolved\" | \"maps-unavailable\" | \"failed\";\n\treadonly stackTrace?: string;\n\treadonly frames?: readonly ErrorReportStackFrame[];\n};\n\nexport type PackageErrorReportSourceMapsOptions = {\n\treadonly outputRoot: string;\n\treadonly artifactRoot: string;\n\treadonly application: string;\n\treadonly buildId: string;\n\treadonly createdUtc?: string;\n};\n\nexport type PrivateSourceMapArchiveOptions = {\n\treadonly archiveRoot: string;\n\treadonly seedRoot?: string;\n\treadonly application: string;\n\treadonly buildId: string;\n\treadonly now?: () => Date;\n\treadonly onError?: (error: unknown) => void;\n};\n\nexport type SymbolicateErrorReportStackOptions = {\n\treadonly artifactRoots?: readonly string[];\n};\n","import { z } from \"zod\";\n\nimport {\n\tERROR_REPORT_BUILD_ID_PATTERN,\n\tPRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES,\n\tPRIVATE_SOURCE_MAP_MANIFEST_VERSION,\n\tPRIVATE_SOURCE_MAP_MAX_BYTES,\n\ttype PrivateSourceMapManifest\n} from \"./types\";\n\nconst APPLICATION_ID_PATTERN = /^[a-z0-9]+(?:[.-][a-z0-9]+)*$/;\nconst SHA256_PATTERN = /^[0-9a-f]{64}$/;\n\nfunction isNormalizedRelativePath(value: string): boolean {\n\tif (!value || value.startsWith(\"/\") || value.includes(\"\\\\\") || value.includes(\"\\0\")) return false;\n\treturn value.split(\"/\").every((segment) => segment !== \"\" && segment !== \".\" && segment !== \"..\");\n}\n\nfunction isNormalizedBundlePath(value: string, kind: \"client\" | \"server\"): boolean {\n\tif (value.includes(\"\\\\\") || value.includes(\"\\0\") || value.includes(\"?\") || value.includes(\"#\")) return false;\n\tif (kind === \"client\") return value.startsWith(\"/\") && isNormalizedRelativePath(value.slice(1));\n\treturn value.startsWith(\"server/\") && isNormalizedRelativePath(value);\n}\n\nconst privateSourceMapManifestEntrySchema = z\n\t.object({\n\t\tkind: z.enum([\"client\", \"server\"]),\n\t\tbundle: z.string().max(1_024),\n\t\tmap: z.string().max(1_024),\n\t\tsha256: z.string().regex(SHA256_PATTERN),\n\t\tsize: z.number().int().positive().max(PRIVATE_SOURCE_MAP_MAX_BYTES)\n\t})\n\t.strict()\n\t.superRefine((entry, context) => {\n\t\tif (!isNormalizedBundlePath(entry.bundle, entry.kind)) {\n\t\t\tcontext.addIssue({ code: \"custom\", path: [\"bundle\"], message: \"Bundle path должен быть нормализован.\" });\n\t\t}\n\t\tif (!isNormalizedRelativePath(entry.map) || !entry.map.startsWith(`${entry.kind}/`) || !entry.map.endsWith(\".map\")) {\n\t\t\tcontext.addIssue({ code: \"custom\", path: [\"map\"], message: \"Map path должен оставаться внутри kind-каталога.\" });\n\t\t}\n\t});\n\nconst privateSourceMapManifestSchema = z\n\t.object({\n\t\tversion: z.literal(PRIVATE_SOURCE_MAP_MANIFEST_VERSION),\n\t\tapplication: z.string().min(1).max(128).regex(APPLICATION_ID_PATTERN),\n\t\tbuildId: z.string().regex(ERROR_REPORT_BUILD_ID_PATTERN),\n\t\tcreatedUtc: z.iso.datetime({ offset: true }),\n\t\tentries: z.array(privateSourceMapManifestEntrySchema).max(10_000)\n\t})\n\t.strict()\n\t.superRefine((manifest, context) => {\n\t\tconst bundles = new Set<string>();\n\t\tconst maps = new Set<string>();\n\t\tlet totalBytes = 0;\n\t\tfor (const [index, entry] of manifest.entries.entries()) {\n\t\t\tif (bundles.has(entry.bundle)) {\n\t\t\t\tcontext.addIssue({ code: \"custom\", path: [\"entries\", index, \"bundle\"], message: \"Bundle должен быть уникальным.\" });\n\t\t\t}\n\t\t\tif (maps.has(entry.map)) {\n\t\t\t\tcontext.addIssue({ code: \"custom\", path: [\"entries\", index, \"map\"], message: \"Map path должен быть уникальным.\" });\n\t\t\t}\n\t\t\tbundles.add(entry.bundle);\n\t\t\tmaps.add(entry.map);\n\t\t\ttotalBytes += entry.size;\n\t\t}\n\t\tif (totalBytes > PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES) {\n\t\t\tcontext.addIssue({ code: \"custom\", path: [\"entries\"], message: \"Private source-map artifact превышает общий предел.\" });\n\t\t}\n\t});\n\n/** Проверяет manifest до любого обращения к указанным в нём файлам. */\nexport function parsePrivateSourceMapManifest(value: unknown): PrivateSourceMapManifest | null {\n\tconst parsed = privateSourceMapManifestSchema.safeParse(value);\n\treturn parsed.success ? parsed.data : null;\n}\n\n/** Проверяет недоверенные application/build path segments до filesystem access. */\nexport function isPrivateSourceMapApplicationId(value: unknown): value is string {\n\treturn typeof value === \"string\" && value.length <= 128 && APPLICATION_ID_PATTERN.test(value);\n}\n\nexport function isErrorReportBuildId(value: unknown): value is string {\n\treturn typeof value === \"string\" && ERROR_REPORT_BUILD_ID_PATTERN.test(value);\n}\n","import { isErrorReportBuildId, isPrivateSourceMapApplicationId, parsePrivateSourceMapManifest } from \"./manifest\";\nimport { PRIVATE_SOURCE_MAP_MANIFEST_MAX_BYTES, type LoadedPrivateSourceMapArtifact, type PrivateSourceMapManifestEntry } from \"./types\";\n\nimport { createHash } from \"node:crypto\";\nimport { lstat, readFile, realpath } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nexport class PrivateSourceMapArtifactError extends Error {\n\tpublic constructor() {\n\t\tsuper(\"Private source-map artifact не прошёл проверку целостности.\");\n\t\tthis.name = \"PrivateSourceMapArtifactError\";\n\t}\n}\n\nfunction isMissingFileError(error: unknown): boolean {\n\treturn error instanceof Error && \"code\" in error && error.code === \"ENOENT\";\n}\n\nfunction isPathInside(parent: string, candidate: string): boolean {\n\tconst relativePath = path.relative(parent, candidate);\n\treturn relativePath !== \"\" && !relativePath.startsWith(\"..\") && !path.isAbsolute(relativePath);\n}\n\nasync function readBoundedRegularFile(filePath: string, buildDirectory: string, maxBytes: number): Promise<Buffer> {\n\tconst fileInfo = await lstat(filePath);\n\tif (!fileInfo.isFile() || fileInfo.isSymbolicLink() || fileInfo.size <= 0 || fileInfo.size > maxBytes) {\n\t\tthrow new PrivateSourceMapArtifactError();\n\t}\n\tconst resolvedFilePath = await realpath(filePath);\n\tif (!isPathInside(buildDirectory, resolvedFilePath)) throw new PrivateSourceMapArtifactError();\n\tconst content = await readFile(resolvedFilePath);\n\tif (content.byteLength !== fileInfo.size) throw new PrivateSourceMapArtifactError();\n\treturn content;\n}\n\n/** Загружает manifest только из каталога точного application/build ID. */\nexport async function loadPrivateSourceMapArtifact(\n\troot: string,\n\tapplication: string,\n\tbuildId: string\n): Promise<LoadedPrivateSourceMapArtifact | null> {\n\tif (!isPrivateSourceMapApplicationId(application) || !isErrorReportBuildId(buildId)) throw new PrivateSourceMapArtifactError();\n\n\tlet resolvedRoot: string;\n\tlet buildDirectory: string;\n\ttry {\n\t\tresolvedRoot = await realpath(path.resolve(root));\n\t\tbuildDirectory = await realpath(path.join(resolvedRoot, application, buildId));\n\t} catch (error) {\n\t\tif (isMissingFileError(error)) return null;\n\t\tthrow new PrivateSourceMapArtifactError();\n\t}\n\tif (!isPathInside(resolvedRoot, buildDirectory)) throw new PrivateSourceMapArtifactError();\n\n\tlet manifestContent: Buffer;\n\ttry {\n\t\tmanifestContent = await readBoundedRegularFile(\n\t\t\tpath.join(buildDirectory, \"manifest.json\"),\n\t\t\tbuildDirectory,\n\t\t\tPRIVATE_SOURCE_MAP_MANIFEST_MAX_BYTES\n\t\t);\n\t} catch (error) {\n\t\tif (isMissingFileError(error)) return null;\n\t\tif (error instanceof PrivateSourceMapArtifactError) throw error;\n\t\tthrow new PrivateSourceMapArtifactError();\n\t}\n\n\tlet rawManifest: unknown;\n\ttry {\n\t\trawManifest = JSON.parse(manifestContent.toString(\"utf8\"));\n\t} catch {\n\t\tthrow new PrivateSourceMapArtifactError();\n\t}\n\tconst manifest = parsePrivateSourceMapManifest(rawManifest);\n\tif (!manifest || manifest.application !== application || manifest.buildId !== buildId) throw new PrivateSourceMapArtifactError();\n\n\treturn {\n\t\tbuildDirectory,\n\t\tmanifest,\n\t\tentriesByBundle: new Map(manifest.entries.map((entry) => [entry.bundle, entry]))\n\t};\n}\n\n/** Читает карту только после size/hash verification из manifest. */\nexport async function readPrivateSourceMap(\n\tartifact: LoadedPrivateSourceMapArtifact,\n\tentry: PrivateSourceMapManifestEntry\n): Promise<string> {\n\ttry {\n\t\tconst content = await readBoundedRegularFile(path.join(artifact.buildDirectory, entry.map), artifact.buildDirectory, entry.size);\n\t\tif (content.byteLength !== entry.size || createHash(\"sha256\").update(content).digest(\"hex\") !== entry.sha256) {\n\t\t\tthrow new PrivateSourceMapArtifactError();\n\t\t}\n\t\treturn content.toString(\"utf8\");\n\t} catch (error) {\n\t\tif (error instanceof PrivateSourceMapArtifactError) throw error;\n\t\tthrow new PrivateSourceMapArtifactError();\n\t}\n}\n","import { loadPrivateSourceMapArtifact, readPrivateSourceMap } from \"./artifact\";\nimport { isErrorReportBuildId } from \"./manifest\";\nimport {\n\tPRIVATE_SOURCE_MAP_ARTIFACT_RETENTION_MS,\n\ttype LoadedPrivateSourceMapArtifact,\n\ttype PrivateSourceMapArchiveOptions\n} from \"./types\";\n\nimport { mkdir, readdir, rename, rm, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nconst ARCHIVE_MAINTENANCE_INTERVAL_MS = 24 * 60 * 60 * 1_000;\n\nasync function copyArtifact(\n\tartifact: LoadedPrivateSourceMapArtifact,\n\tarchiveRoot: string,\n\tapplication: string,\n\tbuildId: string\n): Promise<void> {\n\tconst applicationDirectory = path.join(path.resolve(archiveRoot), application);\n\tconst buildDirectory = path.join(applicationDirectory, buildId);\n\tconst temporaryDirectory = path.join(applicationDirectory, `.${buildId}.tmp-${process.pid}`);\n\tawait mkdir(applicationDirectory, { recursive: true });\n\tawait rm(temporaryDirectory, { force: true, recursive: true });\n\tawait mkdir(temporaryDirectory, { recursive: false });\n\n\ttry {\n\t\tfor (const entry of artifact.manifest.entries) {\n\t\t\tconst content = await readPrivateSourceMap(artifact, entry);\n\t\t\tconst targetPath = path.join(temporaryDirectory, entry.map);\n\t\t\tawait mkdir(path.dirname(targetPath), { recursive: true });\n\t\t\tawait writeFile(targetPath, content, { encoding: \"utf8\", flag: \"wx\" });\n\t\t}\n\t\tawait writeFile(path.join(temporaryDirectory, \"manifest.json\"), `${JSON.stringify(artifact.manifest, null, 2)}\\n`, {\n\t\t\tencoding: \"utf8\",\n\t\t\tflag: \"wx\"\n\t\t});\n\t\tawait rename(temporaryDirectory, buildDirectory);\n\t} catch (error) {\n\t\tawait rm(temporaryDirectory, { force: true, recursive: true });\n\t\tconst concurrentlyInstalled = await loadPrivateSourceMapArtifact(archiveRoot, application, buildId).catch(() => null);\n\t\tif (!concurrentlyInstalled) throw error;\n\t}\n}\n\n/** Устанавливает seed и удаляет только валидные завершённые artifacts старше retention. */\nexport async function maintainPrivateSourceMapArchive(options: PrivateSourceMapArchiveOptions): Promise<void> {\n\tif (!isErrorReportBuildId(options.buildId)) return;\n\tawait mkdir(options.archiveRoot, { recursive: true });\n\n\tconst existing = await loadPrivateSourceMapArtifact(options.archiveRoot, options.application, options.buildId);\n\tconst seed = options.seedRoot ? await loadPrivateSourceMapArtifact(options.seedRoot, options.application, options.buildId) : null;\n\tif (existing && seed && JSON.stringify(existing.manifest.entries) !== JSON.stringify(seed.manifest.entries)) {\n\t\tthrow new Error(\"Persistent source-map artifact не совпадает с image seed для того же build ID.\");\n\t}\n\tif (!existing && seed) await copyArtifact(seed, options.archiveRoot, options.application, options.buildId);\n\n\tconst applicationDirectory = path.join(path.resolve(options.archiveRoot), options.application);\n\tawait mkdir(applicationDirectory, { recursive: true });\n\tconst now = (options.now ?? (() => new Date()))().getTime();\n\tfor (const entry of await readdir(applicationDirectory, { withFileTypes: true })) {\n\t\tif (!entry.isDirectory() || !isErrorReportBuildId(entry.name) || entry.name === options.buildId) continue;\n\t\ttry {\n\t\t\tconst artifact = await loadPrivateSourceMapArtifact(options.archiveRoot, options.application, entry.name);\n\t\t\tif (!artifact) continue;\n\t\t\tconst createdAt = Date.parse(artifact.manifest.createdUtc);\n\t\t\tif (Number.isFinite(createdAt) && createdAt + PRIVATE_SOURCE_MAP_ARTIFACT_RETENTION_MS <= now) {\n\t\t\t\tawait rm(artifact.buildDirectory, { recursive: true });\n\t\t\t}\n\t\t} catch {\n\t\t\t// Повреждённый artifact сохраняется как forensic evidence.\n\t\t}\n\t}\n}\n\n/** Запускает bounded daily maintenance и возвращает явный cleanup timer. */\nexport function startPrivateSourceMapArchiveMaintenance(options: PrivateSourceMapArchiveOptions): () => void {\n\tconst run = () => void maintainPrivateSourceMapArchive(options).catch((error: unknown) => options.onError?.(error));\n\trun();\n\tconst timer = setInterval(run, ARCHIVE_MAINTENANCE_INTERVAL_MS);\n\ttimer.unref();\n\treturn () => clearInterval(timer);\n}\n","import { isErrorReportBuildId, isPrivateSourceMapApplicationId } from \"./manifest\";\nimport {\n\tPRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES,\n\tPRIVATE_SOURCE_MAP_MANIFEST_VERSION,\n\tPRIVATE_SOURCE_MAP_MAX_BYTES,\n\ttype PackageErrorReportSourceMapsOptions,\n\ttype PrivateSourceMapManifest,\n\ttype PrivateSourceMapManifestEntry\n} from \"./types\";\n\nimport { createHash } from \"node:crypto\";\nimport { mkdir, readFile, readdir, rename, rm, stat, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nconst SOURCE_MAP_REFERENCE_PATTERN = /(?:\\/\\*[#@]\\s*sourceMappingURL=[^*]*\\*\\/|\\/\\/[#@]\\s*sourceMappingURL=.*)$/gm;\nconst PUBLIC_TEXT_ASSET_PATTERN = /\\.(?:css|html|js|mjs)$/;\nconst NITRO_PUBLIC_SOURCE_MAP_ENTRY_PATTERN = /\"(\\/[^\"\\n]+\\.map)\"\\s*:\\s*\\{/;\n\n/** Временное расположение client maps между client и Nitro server build. */\nexport const STAGED_CLIENT_SOURCE_MAP_DIRECTORY = \".private-source-maps-staging/client\";\n\nasync function listFiles(directory: string, skippedPaths: ReadonlySet<string> = new Set()): Promise<string[]> {\n\tconst files: string[] = [];\n\tfor (const entry of await readdir(directory, { withFileTypes: true })) {\n\t\tconst entryPath = path.join(directory, entry.name);\n\t\tif (skippedPaths.has(path.resolve(entryPath))) continue;\n\t\tif (entry.isSymbolicLink()) throw new Error(`Build output содержит недопустимую symbolic link: ${entryPath}`);\n\t\tif (entry.isDirectory()) files.push(...(await listFiles(entryPath, skippedPaths)));\n\t\telse if (entry.isFile()) files.push(entryPath);\n\t}\n\treturn files.sort((left, right) => left.localeCompare(right));\n}\n\nfunction validateSourceMap(content: Buffer, filePath: string): void {\n\tif (content.byteLength === 0 || content.byteLength > PRIVATE_SOURCE_MAP_MAX_BYTES) {\n\t\tthrow new Error(`Source map выходит за предел ${PRIVATE_SOURCE_MAP_MAX_BYTES} bytes: ${filePath}`);\n\t}\n\tlet sourceMap: unknown;\n\ttry {\n\t\tsourceMap = JSON.parse(content.toString(\"utf8\"));\n\t} catch {\n\t\tthrow new Error(`Source map содержит некорректный JSON: ${filePath}`);\n\t}\n\tif (!sourceMap || typeof sourceMap !== \"object\" || !(\"version\" in sourceMap) || sourceMap.version !== 3) {\n\t\tthrow new Error(`Source map имеет неподдерживаемый формат: ${filePath}`);\n\t}\n\tconst sources = \"sources\" in sourceMap ? sourceMap.sources : undefined;\n\tconst sourcesContent = \"sourcesContent\" in sourceMap ? sourceMap.sourcesContent : undefined;\n\tif (!Array.isArray(sources)) throw new Error(`Source map не содержит список sources: ${filePath}`);\n\t// Nitro вправе не встраивать исходный текст в server maps. Координаты и\n\t// имена кадров при этом восстанавливаются, а source context просто остаётся\n\t// недоступным. Если sourcesContent присутствует, проверяем его целостность.\n\tif (sourcesContent !== undefined && (!Array.isArray(sourcesContent) || sourcesContent.length !== sources.length)) {\n\t\tthrow new Error(`Source map содержит неполный sourcesContent: ${filePath}`);\n\t}\n}\n\nfunction resolveArtifactPaths(outputRoot: string, mapPath: string): Pick<PrivateSourceMapManifestEntry, \"kind\" | \"bundle\" | \"map\"> {\n\tconst publicRoot = path.join(outputRoot, \"public\");\n\tconst serverRoot = path.join(outputRoot, \"server\");\n\tconst stagedClientRoot = path.join(outputRoot, STAGED_CLIENT_SOURCE_MAP_DIRECTORY);\n\tconst relativeToPublic = path.relative(publicRoot, mapPath);\n\tif (relativeToPublic && !relativeToPublic.startsWith(\"..\") && !path.isAbsolute(relativeToPublic)) {\n\t\tconst normalizedMap = relativeToPublic.split(path.sep).join(\"/\");\n\t\treturn { kind: \"client\", bundle: `/${normalizedMap.slice(0, -\".map\".length)}`, map: `client/${normalizedMap}` };\n\t}\n\tconst relativeToStagedClient = path.relative(stagedClientRoot, mapPath);\n\tif (relativeToStagedClient && !relativeToStagedClient.startsWith(\"..\") && !path.isAbsolute(relativeToStagedClient)) {\n\t\tconst normalizedMap = relativeToStagedClient.split(path.sep).join(\"/\");\n\t\treturn { kind: \"client\", bundle: `/${normalizedMap.slice(0, -\".map\".length)}`, map: `client/${normalizedMap}` };\n\t}\n\tconst relativeToServer = path.relative(serverRoot, mapPath);\n\tif (relativeToServer && !relativeToServer.startsWith(\"..\") && !path.isAbsolute(relativeToServer)) {\n\t\tconst normalizedMap = relativeToServer.split(path.sep).join(\"/\");\n\t\treturn { kind: \"server\", bundle: `server/${normalizedMap.slice(0, -\".map\".length)}`, map: `server/${normalizedMap}` };\n\t}\n\tthrow new Error(`Source map находится вне public/server output: ${mapPath}`);\n}\n\nasync function stripSourceMapReferences(filePath: string): Promise<void> {\n\tconst source = await readFile(filePath, \"utf8\");\n\tconst withoutReferences = source.replace(SOURCE_MAP_REFERENCE_PATTERN, \"\");\n\tif (withoutReferences !== source) await writeFile(filePath, withoutReferences, \"utf8\");\n}\n\n/** Извлекает клиентские карты до формирования Nitro static asset manifest. */\nexport async function stageClientSourceMapsForNitro(outputRoot: string, options: { readonly publicRoot?: string } = {}): Promise<number> {\n\tconst resolvedOutputRoot = path.resolve(outputRoot);\n\tconst publicRoot = path.resolve(options.publicRoot ?? path.join(resolvedOutputRoot, \"public\"));\n\tconst stagingRoot = path.join(resolvedOutputRoot, STAGED_CLIENT_SOURCE_MAP_DIRECTORY);\n\tconst publicFiles = await listFiles(publicRoot);\n\tconst sourceMapFiles = publicFiles.filter((filePath) => filePath.endsWith(\".map\"));\n\tfor (const mapFile of sourceMapFiles) {\n\t\tconst relativePath = path.relative(publicRoot, mapFile);\n\t\tconst stagedPath = path.join(stagingRoot, relativePath);\n\t\tawait mkdir(path.dirname(stagedPath), { recursive: true });\n\t\tawait rename(mapFile, stagedPath);\n\t}\n\tfor (const filePath of publicFiles) {\n\t\tif (!filePath.endsWith(\".map\") && PUBLIC_TEXT_ASSET_PATTERN.test(filePath)) await stripSourceMapReferences(filePath);\n\t}\n\treturn sourceMapFiles.length;\n}\n\n/** Проверяет скомпилированный Nitro manifest, а не только оставшиеся файлы. */\nexport async function assertNoNitroSourceMapManifestLeaks(serverEntryPath: string): Promise<void> {\n\tconst serverEntry = await readFile(serverEntryPath, \"utf8\");\n\tconst leakedEntry = NITRO_PUBLIC_SOURCE_MAP_ENTRY_PATTERN.exec(serverEntry)?.[1];\n\tif (leakedEntry) throw new Error(`Nitro static asset manifest содержит source map: ${leakedEntry}`);\n}\n\n/** Доказывает отсутствие карт и sourceMappingURL в public output. */\nexport async function assertNoPublicSourceMapLeaks(publicRoot: string): Promise<void> {\n\tfor (const filePath of await listFiles(publicRoot)) {\n\t\tif (filePath.endsWith(\".map\")) throw new Error(`Public output содержит source map: ${filePath}`);\n\t\tif (!PUBLIC_TEXT_ASSET_PATTERN.test(filePath)) continue;\n\t\tconst source = await readFile(filePath, \"utf8\");\n\t\tif (source.includes(\"sourceMappingURL\")) throw new Error(`Public output содержит sourceMappingURL: ${filePath}`);\n\t}\n}\n\n/** Извлекает карты из multi-environment output в immutable private artifact. */\nexport async function packageErrorReportSourceMaps(options: PackageErrorReportSourceMapsOptions): Promise<PrivateSourceMapManifest> {\n\tif (!isPrivateSourceMapApplicationId(options.application) || !isErrorReportBuildId(options.buildId)) {\n\t\tthrow new Error(\"Application или build ID private source-map artifact недопустим.\");\n\t}\n\tconst outputRoot = path.resolve(options.outputRoot);\n\tconst artifactRoot = path.resolve(options.artifactRoot);\n\tconst buildDirectory = path.join(artifactRoot, options.application, options.buildId);\n\tconst temporaryBuildDirectory = `${buildDirectory}.tmp-${process.pid}`;\n\t// Nitro v2 создаёт служебное dependency tree с допустимыми package-manager\n\t// symlink. Оно не является исполняемым bundle output и не участвует в maps.\n\tconst outputFiles = await listFiles(outputRoot, new Set([path.resolve(outputRoot, \"server/node_modules\")]));\n\tconst mapFiles = outputFiles.filter((filePath) => filePath.endsWith(\".map\"));\n\tif (mapFiles.length === 0) throw new Error(\"Production build не создал private source maps.\");\n\n\tawait rm(temporaryBuildDirectory, { force: true, recursive: true });\n\tawait mkdir(temporaryBuildDirectory, { recursive: true });\n\tconst entries: PrivateSourceMapManifestEntry[] = [];\n\tlet totalBytes = 0;\n\ttry {\n\t\tfor (const mapFile of mapFiles) {\n\t\t\tconst content = await readFile(mapFile);\n\t\t\tvalidateSourceMap(content, mapFile);\n\t\t\ttotalBytes += content.byteLength;\n\t\t\tif (totalBytes > PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES) {\n\t\t\t\tthrow new Error(`Private source-map artifact превышает ${PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES} bytes.`);\n\t\t\t}\n\t\t\tconst artifactPaths = resolveArtifactPaths(outputRoot, mapFile);\n\t\t\tconst targetPath = path.join(temporaryBuildDirectory, artifactPaths.map);\n\t\t\tawait mkdir(path.dirname(targetPath), { recursive: true });\n\t\t\tawait writeFile(targetPath, content, { flag: \"wx\" });\n\t\t\tentries.push({\n\t\t\t\t...artifactPaths,\n\t\t\t\tsha256: createHash(\"sha256\").update(content).digest(\"hex\"),\n\t\t\t\tsize: content.byteLength\n\t\t\t});\n\t\t}\n\t\tif (!entries.some((entry) => entry.kind === \"client\")) throw new Error(\"Private source-map artifact не содержит client maps.\");\n\t\tif (!entries.some((entry) => entry.kind === \"server\")) throw new Error(\"Private source-map artifact не содержит server maps.\");\n\t\tentries.sort((left, right) => left.bundle.localeCompare(right.bundle));\n\t\tconst manifest: PrivateSourceMapManifest = {\n\t\t\tversion: PRIVATE_SOURCE_MAP_MANIFEST_VERSION,\n\t\t\tapplication: options.application,\n\t\t\tbuildId: options.buildId,\n\t\t\tcreatedUtc: options.createdUtc ?? new Date().toISOString(),\n\t\t\tentries\n\t\t};\n\t\tawait writeFile(path.join(temporaryBuildDirectory, \"manifest.json\"), `${JSON.stringify(manifest, null, 2)}\\n`, {\n\t\t\tencoding: \"utf8\",\n\t\t\tflag: \"wx\"\n\t\t});\n\t\tawait rm(buildDirectory, { force: true, recursive: true });\n\t\tawait mkdir(path.dirname(buildDirectory), { recursive: true });\n\t\tawait rename(temporaryBuildDirectory, buildDirectory);\n\t\tfor (const mapFile of mapFiles) await unlink(mapFile);\n\t\tfor (const filePath of outputFiles) {\n\t\t\tif (!filePath.endsWith(\".map\") && PUBLIC_TEXT_ASSET_PATTERN.test(filePath)) await stripSourceMapReferences(filePath);\n\t\t}\n\t\tawait assertNoPublicSourceMapLeaks(path.join(outputRoot, \"public\"));\n\t\tawait assertNoNitroSourceMapManifestLeaks(path.join(outputRoot, \"server/index.mjs\"));\n\t\tconst manifestStat = await stat(path.join(buildDirectory, \"manifest.json\"));\n\t\tif (!manifestStat.isFile()) throw new Error(\"Private source-map manifest не был создан.\");\n\t\treturn manifest;\n\t} catch (error) {\n\t\tawait rm(temporaryBuildDirectory, { force: true, recursive: true });\n\t\tthrow error;\n\t}\n}\n","// src/vlq.ts\nvar comma = \",\".charCodeAt(0);\nvar semicolon = \";\".charCodeAt(0);\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nvar intToChar = new Uint8Array(64);\nvar charToInt = new Uint8Array(128);\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\nfunction decodeInteger(reader, relative) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = reader.next();\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n const shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = -2147483648 | -value;\n }\n return relative + value;\n}\nfunction encodeInteger(builder, num, relative) {\n let delta = num - relative;\n delta = delta < 0 ? -delta << 1 | 1 : delta << 1;\n do {\n let clamped = delta & 31;\n delta >>>= 5;\n if (delta > 0) clamped |= 32;\n builder.write(intToChar[clamped]);\n } while (delta > 0);\n return num;\n}\nfunction hasMoreVlq(reader, max) {\n if (reader.pos >= max) return false;\n return reader.peek() !== comma;\n}\n\n// src/strings.ts\nvar bufLength = 1024 * 16;\nvar td = typeof TextDecoder !== \"undefined\" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== \"undefined\" ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n }\n} : {\n decode(buf) {\n let out = \"\";\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n }\n};\nvar StringWriter = class {\n constructor() {\n this.pos = 0;\n this.out = \"\";\n this.buffer = new Uint8Array(bufLength);\n }\n write(v) {\n const { buffer } = this;\n buffer[this.pos++] = v;\n if (this.pos === bufLength) {\n this.out += td.decode(buffer);\n this.pos = 0;\n }\n }\n flush() {\n const { buffer, out, pos } = this;\n return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;\n }\n};\nvar StringReader = class {\n constructor(buffer) {\n this.pos = 0;\n this.buffer = buffer;\n }\n next() {\n return this.buffer.charCodeAt(this.pos++);\n }\n peek() {\n return this.buffer.charCodeAt(this.pos);\n }\n indexOf(char) {\n const { buffer, pos } = this;\n const idx = buffer.indexOf(char, pos);\n return idx === -1 ? buffer.length : idx;\n }\n};\n\n// src/scopes.ts\nvar EMPTY = [];\nfunction decodeOriginalScopes(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const scopes = [];\n const stack = [];\n let line = 0;\n for (; reader.pos < length; reader.pos++) {\n line = decodeInteger(reader, line);\n const column = decodeInteger(reader, 0);\n if (!hasMoreVlq(reader, length)) {\n const last = stack.pop();\n last[2] = line;\n last[3] = column;\n continue;\n }\n const kind = decodeInteger(reader, 0);\n const fields = decodeInteger(reader, 0);\n const hasName = fields & 1;\n const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind];\n let vars = EMPTY;\n if (hasMoreVlq(reader, length)) {\n vars = [];\n do {\n const varsIndex = decodeInteger(reader, 0);\n vars.push(varsIndex);\n } while (hasMoreVlq(reader, length));\n }\n scope.vars = vars;\n scopes.push(scope);\n stack.push(scope);\n }\n return scopes;\n}\nfunction encodeOriginalScopes(scopes) {\n const writer = new StringWriter();\n for (let i = 0; i < scopes.length; ) {\n i = _encodeOriginalScopes(scopes, i, writer, [0]);\n }\n return writer.flush();\n}\nfunction _encodeOriginalScopes(scopes, index, writer, state) {\n const scope = scopes[index];\n const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;\n if (index > 0) writer.write(comma);\n state[0] = encodeInteger(writer, startLine, state[0]);\n encodeInteger(writer, startColumn, 0);\n encodeInteger(writer, kind, 0);\n const fields = scope.length === 6 ? 1 : 0;\n encodeInteger(writer, fields, 0);\n if (scope.length === 6) encodeInteger(writer, scope[5], 0);\n for (const v of vars) {\n encodeInteger(writer, v, 0);\n }\n for (index++; index < scopes.length; ) {\n const next = scopes[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeOriginalScopes(scopes, index, writer, state);\n }\n writer.write(comma);\n state[0] = encodeInteger(writer, endLine, state[0]);\n encodeInteger(writer, endColumn, 0);\n return index;\n}\nfunction decodeGeneratedRanges(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const ranges = [];\n const stack = [];\n let genLine = 0;\n let definitionSourcesIndex = 0;\n let definitionScopeIndex = 0;\n let callsiteSourcesIndex = 0;\n let callsiteLine = 0;\n let callsiteColumn = 0;\n let bindingLine = 0;\n let bindingColumn = 0;\n do {\n const semi = reader.indexOf(\";\");\n let genColumn = 0;\n for (; reader.pos < semi; reader.pos++) {\n genColumn = decodeInteger(reader, genColumn);\n if (!hasMoreVlq(reader, semi)) {\n const last = stack.pop();\n last[2] = genLine;\n last[3] = genColumn;\n continue;\n }\n const fields = decodeInteger(reader, 0);\n const hasDefinition = fields & 1;\n const hasCallsite = fields & 2;\n const hasScope = fields & 4;\n let callsite = null;\n let bindings = EMPTY;\n let range;\n if (hasDefinition) {\n const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex);\n definitionScopeIndex = decodeInteger(\n reader,\n definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0\n );\n definitionSourcesIndex = defSourcesIndex;\n range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];\n } else {\n range = [genLine, genColumn, 0, 0];\n }\n range.isScope = !!hasScope;\n if (hasCallsite) {\n const prevCsi = callsiteSourcesIndex;\n const prevLine = callsiteLine;\n callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex);\n const sameSource = prevCsi === callsiteSourcesIndex;\n callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0);\n callsiteColumn = decodeInteger(\n reader,\n sameSource && prevLine === callsiteLine ? callsiteColumn : 0\n );\n callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];\n }\n range.callsite = callsite;\n if (hasMoreVlq(reader, semi)) {\n bindings = [];\n do {\n bindingLine = genLine;\n bindingColumn = genColumn;\n const expressionsCount = decodeInteger(reader, 0);\n let expressionRanges;\n if (expressionsCount < -1) {\n expressionRanges = [[decodeInteger(reader, 0)]];\n for (let i = -1; i > expressionsCount; i--) {\n const prevBl = bindingLine;\n bindingLine = decodeInteger(reader, bindingLine);\n bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0);\n const expression = decodeInteger(reader, 0);\n expressionRanges.push([expression, bindingLine, bindingColumn]);\n }\n } else {\n expressionRanges = [[expressionsCount]];\n }\n bindings.push(expressionRanges);\n } while (hasMoreVlq(reader, semi));\n }\n range.bindings = bindings;\n ranges.push(range);\n stack.push(range);\n }\n genLine++;\n reader.pos = semi + 1;\n } while (reader.pos < length);\n return ranges;\n}\nfunction encodeGeneratedRanges(ranges) {\n if (ranges.length === 0) return \"\";\n const writer = new StringWriter();\n for (let i = 0; i < ranges.length; ) {\n i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);\n }\n return writer.flush();\n}\nfunction _encodeGeneratedRanges(ranges, index, writer, state) {\n const range = ranges[index];\n const {\n 0: startLine,\n 1: startColumn,\n 2: endLine,\n 3: endColumn,\n isScope,\n callsite,\n bindings\n } = range;\n if (state[0] < startLine) {\n catchupLine(writer, state[0], startLine);\n state[0] = startLine;\n state[1] = 0;\n } else if (index > 0) {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, range[1], state[1]);\n const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);\n encodeInteger(writer, fields, 0);\n if (range.length === 6) {\n const { 4: sourcesIndex, 5: scopesIndex } = range;\n if (sourcesIndex !== state[2]) {\n state[3] = 0;\n }\n state[2] = encodeInteger(writer, sourcesIndex, state[2]);\n state[3] = encodeInteger(writer, scopesIndex, state[3]);\n }\n if (callsite) {\n const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;\n if (sourcesIndex !== state[4]) {\n state[5] = 0;\n state[6] = 0;\n } else if (callLine !== state[5]) {\n state[6] = 0;\n }\n state[4] = encodeInteger(writer, sourcesIndex, state[4]);\n state[5] = encodeInteger(writer, callLine, state[5]);\n state[6] = encodeInteger(writer, callColumn, state[6]);\n }\n if (bindings) {\n for (const binding of bindings) {\n if (binding.length > 1) encodeInteger(writer, -binding.length, 0);\n const expression = binding[0][0];\n encodeInteger(writer, expression, 0);\n let bindingStartLine = startLine;\n let bindingStartColumn = startColumn;\n for (let i = 1; i < binding.length; i++) {\n const expRange = binding[i];\n bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine);\n bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn);\n encodeInteger(writer, expRange[0], 0);\n }\n }\n }\n for (index++; index < ranges.length; ) {\n const next = ranges[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeGeneratedRanges(ranges, index, writer, state);\n }\n if (state[0] < endLine) {\n catchupLine(writer, state[0], endLine);\n state[0] = endLine;\n state[1] = 0;\n } else {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, endColumn, state[1]);\n return index;\n}\nfunction catchupLine(writer, lastLine, line) {\n do {\n writer.write(semicolon);\n } while (++lastLine < line);\n}\n\n// src/sourcemap-codec.ts\nfunction decode(mappings) {\n const { length } = mappings;\n const reader = new StringReader(mappings);\n const decoded = [];\n let genColumn = 0;\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n do {\n const semi = reader.indexOf(\";\");\n const line = [];\n let sorted = true;\n let lastCol = 0;\n genColumn = 0;\n while (reader.pos < semi) {\n let seg;\n genColumn = decodeInteger(reader, genColumn);\n if (genColumn < lastCol) sorted = false;\n lastCol = genColumn;\n if (hasMoreVlq(reader, semi)) {\n sourcesIndex = decodeInteger(reader, sourcesIndex);\n sourceLine = decodeInteger(reader, sourceLine);\n sourceColumn = decodeInteger(reader, sourceColumn);\n if (hasMoreVlq(reader, semi)) {\n namesIndex = decodeInteger(reader, namesIndex);\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];\n } else {\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];\n }\n } else {\n seg = [genColumn];\n }\n line.push(seg);\n reader.pos++;\n }\n if (!sorted) sort(line);\n decoded.push(line);\n reader.pos = semi + 1;\n } while (reader.pos <= length);\n return decoded;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const writer = new StringWriter();\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) writer.write(semicolon);\n if (line.length === 0) continue;\n let genColumn = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n if (j > 0) writer.write(comma);\n genColumn = encodeInteger(writer, segment[0], genColumn);\n if (segment.length === 1) continue;\n sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);\n sourceLine = encodeInteger(writer, segment[2], sourceLine);\n sourceColumn = encodeInteger(writer, segment[3], sourceColumn);\n if (segment.length === 4) continue;\n namesIndex = encodeInteger(writer, segment[4], namesIndex);\n }\n }\n return writer.flush();\n}\nexport {\n decode,\n decodeGeneratedRanges,\n decodeOriginalScopes,\n encode,\n encodeGeneratedRanges,\n encodeOriginalScopes\n};\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.resolveURI = factory());\n})(this, (function () { 'use strict';\n\n // Matches the scheme of a URL, eg \"http://\"\n const schemeRegex = /^[\\w+.-]+:\\/\\//;\n /**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\n const urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n /**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\n const fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n function isAbsoluteUrl(input) {\n return schemeRegex.test(input);\n }\n function isSchemeRelativeUrl(input) {\n return input.startsWith('//');\n }\n function isAbsolutePath(input) {\n return input.startsWith('/');\n }\n function isFileUrl(input) {\n return input.startsWith('file:');\n }\n function isRelative(input) {\n return /^[.?#]/.test(input);\n }\n function parseAbsoluteUrl(input) {\n const match = urlRegex.exec(input);\n return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');\n }\n function parseFileUrl(input) {\n const match = fileRegex.exec(input);\n const path = match[2];\n return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');\n }\n function makeUrl(scheme, user, host, port, path, query, hash) {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: 7 /* Absolute */,\n };\n }\n function parseUrl(input) {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = 6 /* SchemeRelative */;\n return url;\n }\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = 5 /* AbsolutePath */;\n return url;\n }\n if (isFileUrl(input))\n return parseFileUrl(input);\n if (isAbsoluteUrl(input))\n return parseAbsoluteUrl(input);\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? 3 /* Query */\n : input.startsWith('#')\n ? 2 /* Hash */\n : 4 /* RelativePath */\n : 1 /* Empty */;\n return url;\n }\n function stripPathFilename(path) {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..'))\n return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n }\n function mergePaths(url, base) {\n normalizePath(base, base.type);\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n }\n else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n }\n /**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\n function normalizePath(url, type) {\n const rel = type <= 4 /* RelativePath */;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n }\n /**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\n function resolve(input, base) {\n if (!input && !base)\n return '';\n const url = parseUrl(input);\n let inputType = url.type;\n if (base && inputType !== 7 /* Absolute */) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n switch (inputType) {\n case 1 /* Empty */:\n url.hash = baseUrl.hash;\n // fall through\n case 2 /* Hash */:\n url.query = baseUrl.query;\n // fall through\n case 3 /* Query */:\n case 4 /* RelativePath */:\n mergePaths(url, baseUrl);\n // fall through\n case 5 /* AbsolutePath */:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n case 6 /* SchemeRelative */:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType)\n inputType = baseType;\n }\n normalizePath(url, inputType);\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n case 2 /* Hash */:\n case 3 /* Query */:\n return queryHash;\n case 4 /* RelativePath */: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n if (!path)\n return queryHash || '.';\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n return path + queryHash;\n }\n case 5 /* AbsolutePath */:\n return url.path + queryHash;\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n }\n\n return resolve;\n\n}));\n//# sourceMappingURL=resolve-uri.umd.js.map\n","// src/trace-mapping.ts\nimport { encode, decode } from \"@jridgewell/sourcemap-codec\";\n\n// src/resolve.ts\nimport resolveUri from \"@jridgewell/resolve-uri\";\n\n// src/strip-filename.ts\nfunction stripFilename(path) {\n if (!path) return \"\";\n const index = path.lastIndexOf(\"/\");\n return path.slice(0, index + 1);\n}\n\n// src/resolve.ts\nfunction resolver(mapUrl, sourceRoot) {\n const from = stripFilename(mapUrl);\n const prefix = sourceRoot ? sourceRoot + \"/\" : \"\";\n return (source) => resolveUri(prefix + (source || \"\"), from);\n}\n\n// src/sourcemap-segment.ts\nvar COLUMN = 0;\nvar SOURCES_INDEX = 1;\nvar SOURCE_LINE = 2;\nvar SOURCE_COLUMN = 3;\nvar NAMES_INDEX = 4;\nvar REV_GENERATED_LINE = 1;\nvar REV_GENERATED_COLUMN = 2;\n\n// src/sort.ts\nfunction maybeSort(mappings, owned) {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n if (!owned) mappings = mappings.slice();\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\nfunction nextUnsortedSegmentLine(mappings, start) {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\nfunction isSorted(line) {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\nfunction sortSegments(line, owned) {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[COLUMN] - b[COLUMN];\n}\n\n// src/by-source.ts\nfunction buildBySources(decoded, memos) {\n const sources = memos.map(() => []);\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n const sourceIndex2 = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const source = sources[sourceIndex2];\n const segs = source[sourceLine] || (source[sourceLine] = []);\n segs.push([sourceColumn, i, seg[COLUMN]]);\n }\n }\n for (let i = 0; i < sources.length; i++) {\n const source = sources[i];\n for (let j = 0; j < source.length; j++) {\n const line = source[j];\n if (line) line.sort(sortComparator);\n }\n }\n return sources;\n}\n\n// src/binary-search.ts\nvar found = false;\nfunction binarySearch(haystack, needle, low, high) {\n while (low <= high) {\n const mid = low + (high - low >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n if (cmp === 0) {\n found = true;\n return mid;\n }\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n found = false;\n return low - 1;\n}\nfunction upperBound(haystack, needle, index) {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\nfunction lowerBound(haystack, needle, index) {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\nfunction memoizedState() {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1\n };\n}\nfunction memoizedBinarySearch(haystack, needle, state, key) {\n const { lastKey, lastNeedle, lastIndex } = state;\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n if (needle >= lastNeedle) {\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n return state.lastIndex = binarySearch(haystack, needle, low, high);\n}\n\n// src/types.ts\nfunction parse(map) {\n return typeof map === \"string\" ? JSON.parse(map) : map;\n}\n\n// src/flatten-map.ts\nvar FlattenMap = function(map, mapUrl) {\n const parsed = parse(map);\n if (!(\"sections\" in parsed)) {\n return new TraceMap(parsed, mapUrl);\n }\n const mappings = [];\n const sources = [];\n const sourcesContent = [];\n const names = [];\n const ignoreList = [];\n recurse(\n parsed,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n ignoreList,\n 0,\n 0,\n Infinity,\n Infinity\n );\n const joined = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n ignoreList\n };\n return presortedDecodedMap(joined);\n};\nfunction recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n ignoreList,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc\n );\n }\n}\nfunction addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {\n const parsed = parse(input);\n if (\"sections\" in parsed) return recurse(...arguments);\n const map = new TraceMap(parsed, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map;\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset);\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n if (lineI > stopLine) return;\n const out = getLine(mappings, lineI);\n const cOffset = i === 0 ? columnOffset : 0;\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n if (lineI === stopLine && column >= stopColumn) return;\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]\n );\n }\n }\n}\nfunction append(arr, other) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\nfunction getLine(arr, index) {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n\n// src/trace-mapping.ts\nvar LINE_GTR_ZERO = \"`line` must be greater than 0 (lines start at line 1)\";\nvar COL_GTR_EQ_ZERO = \"`column` must be greater than or equal to 0 (columns start at column 0)\";\nvar LEAST_UPPER_BOUND = -1;\nvar GREATEST_LOWER_BOUND = 1;\nvar TraceMap = class {\n constructor(map, mapUrl) {\n const isString = typeof map === \"string\";\n if (!isString && map._decodedMemo) return map;\n const parsed = parse(map);\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names || [];\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;\n const resolve = resolver(mapUrl, sourceRoot);\n this.resolvedSources = sources.map(resolve);\n const { mappings } = parsed;\n if (typeof mappings === \"string\") {\n this._encoded = mappings;\n this._decoded = void 0;\n } else if (Array.isArray(mappings)) {\n this._encoded = void 0;\n this._decoded = maybeSort(mappings, isString);\n } else if (parsed.sections) {\n throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);\n } else {\n throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);\n }\n this._decodedMemo = memoizedState();\n this._bySources = void 0;\n this._bySourceMemos = void 0;\n }\n};\nfunction cast(map) {\n return map;\n}\nfunction encodedMappings(map) {\n var _a, _b;\n return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = encode(cast(map)._decoded);\n}\nfunction decodedMappings(map) {\n var _a;\n return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));\n}\nfunction traceSegment(map, line, column) {\n const decoded = decodedMappings(map);\n if (line >= decoded.length) return null;\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n cast(map)._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND\n );\n return index === -1 ? null : segments[index];\n}\nfunction originalPositionFor(map, needle) {\n let { line, column, bias } = needle;\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n const decoded = decodedMappings(map);\n if (line >= decoded.length) return OMapping(null, null, null, null);\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n cast(map)._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND\n );\n if (index === -1) return OMapping(null, null, null, null);\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null\n );\n}\nfunction generatedPositionFor(map, needle) {\n const { source, line, column, bias } = needle;\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n}\nfunction allGeneratedPositionsFor(map, needle) {\n const { source, line, column, bias } = needle;\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n}\nfunction eachMapping(map, cb) {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name\n });\n }\n }\n}\nfunction sourceIndex(map, source) {\n const { sources, resolvedSources } = map;\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n return index;\n}\nfunction sourceContentFor(map, source) {\n const { sourcesContent } = map;\n if (sourcesContent == null) return null;\n const index = sourceIndex(map, source);\n return index === -1 ? null : sourcesContent[index];\n}\nfunction isIgnored(map, source) {\n const { ignoreList } = map;\n if (ignoreList == null) return false;\n const index = sourceIndex(map, source);\n return index === -1 ? false : ignoreList.includes(index);\n}\nfunction presortedDecodedMap(map, mapUrl) {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n cast(tracer)._decoded = map.mappings;\n return tracer;\n}\nfunction decodedMap(map) {\n return clone(map, decodedMappings(map));\n}\nfunction encodedMap(map) {\n return clone(map, encodedMappings(map));\n}\nfunction clone(map, mappings) {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n ignoreList: map.ignoreList || map.x_google_ignoreList\n };\n}\nfunction OMapping(source, line, column, name) {\n return { source, line, column, name };\n}\nfunction GMapping(line, column) {\n return { line, column };\n}\nfunction traceSegmentInternal(segments, memo, line, column, bias) {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (found) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\nfunction sliceGeneratedPositions(segments, memo, line, column, bias) {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n if (!found && bias === LEAST_UPPER_BOUND) min++;\n if (min === -1 || min === segments.length) return [];\n const matchedColumn = found ? column : segments[min][COLUMN];\n if (!found) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n const result = [];\n for (; min <= max; min++) {\n const segment = segments[min];\n result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));\n }\n return result;\n}\nfunction generatedPosition(map, source, line, column, bias, all) {\n var _a, _b;\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n const { sources, resolvedSources } = map;\n let sourceIndex2 = sources.indexOf(source);\n if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source);\n if (sourceIndex2 === -1) return all ? [] : GMapping(null, null);\n const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState));\n const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos));\n const segments = generated[sourceIndex2][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n const memo = bySourceMemos[sourceIndex2];\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n}\nexport {\n FlattenMap as AnyMap,\n FlattenMap,\n GREATEST_LOWER_BOUND,\n LEAST_UPPER_BOUND,\n TraceMap,\n allGeneratedPositionsFor,\n decodedMap,\n decodedMappings,\n eachMapping,\n encodedMap,\n encodedMappings,\n generatedPositionFor,\n isIgnored,\n originalPositionFor,\n presortedDecodedMap,\n sourceContentFor,\n traceSegment\n};\n//# sourceMappingURL=trace-mapping.mjs.map\n","import { AnyMap, originalPositionFor, sourceContentFor, type TraceMap } from \"@jridgewell/trace-mapping\";\n\nimport { loadPrivateSourceMapArtifact, readPrivateSourceMap } from \"./artifact\";\nimport {\n\ttype ErrorReportStackFrame,\n\ttype ErrorReportSymbolicationResult,\n\ttype LoadedPrivateSourceMapArtifact,\n\ttype PrivateSourceMapManifestEntry,\n\ttype SymbolicateErrorReportStackOptions\n} from \"./types\";\n\nconst MAX_STACK_FRAMES = 40;\nconst MAX_CONTEXT_FRAMES = 10;\nconst CONTEXT_RADIUS = 2;\nconst MAX_SOURCE_LINE_LENGTH = 500;\nconst MAX_SYMBOLICATED_STACK_LENGTH = 262_144;\n\ntype ParsedStackFrame = {\n\treadonly lineIndex: number;\n\treadonly style: \"chromium\" | \"safari\";\n\treadonly functionName?: string;\n\treadonly source: string;\n\treadonly line: number;\n\treadonly column: number;\n\treadonly bundle: string;\n};\n\nfunction parsePositiveInteger(value: string): number | null {\n\tconst parsed = Number(value);\n\treturn Number.isSafeInteger(parsed) && parsed > 0 ? parsed : null;\n}\n\nfunction normalizeFunctionName(value: string | undefined): string | undefined {\n\tconst normalized = value\n\t\t?.trim()\n\t\t.replace(/^async\\s+/, \"\")\n\t\t.slice(0, 256);\n\treturn normalized || undefined;\n}\n\nfunction safeUrlPathname(value: string): string | null {\n\ttry {\n\t\treturn new URL(value).pathname;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction resolveBundle(source: string): string | null {\n\tconst withoutLocationSuffix = source.replace(/[?#].*$/, \"\").replaceAll(\"\\\\\", \"/\");\n\tconst urlPathname = safeUrlPathname(withoutLocationSuffix);\n\tconst normalized = (urlPathname ?? withoutLocationSuffix).replaceAll(\"\\\\\", \"/\");\n\tif (normalized.startsWith(\"/static/\") || normalized === \"/sw.js\" || normalized === \"/sw.mjs\") return normalized;\n\tif (normalized.startsWith(\"server/\")) return normalized;\n\tconst serverMarker = normalized.lastIndexOf(\"/server/\");\n\treturn serverMarker >= 0 ? `server/${normalized.slice(serverMarker + \"/server/\".length)}` : null;\n}\n\nfunction parseStackFrame(line: string, lineIndex: number): ParsedStackFrame | null {\n\tconst chromiumWithFunction = /^\\s*at\\s+(.+?)\\s+\\((.+):(\\d+):(\\d+)\\)\\s*$/.exec(line);\n\tconst chromiumBare = /^\\s*at\\s+(.+):(\\d+):(\\d+)\\s*$/.exec(line);\n\tconst safari = /^([^@]*)@(.+):(\\d+):(\\d+)\\s*$/.exec(line);\n\tconst match = chromiumWithFunction ?? chromiumBare ?? safari;\n\tif (!match) return null;\n\n\tconst hasChromiumFunction = match === chromiumWithFunction;\n\tconst hasSafariFunction = match === safari;\n\tconst sourceIndex = hasChromiumFunction ? 2 : hasSafariFunction ? 2 : 1;\n\tconst source = match[sourceIndex];\n\tconst generatedLine = match[sourceIndex + 1] ? parsePositiveInteger(match[sourceIndex + 1]) : null;\n\tconst generatedColumn = match[sourceIndex + 2] ? parsePositiveInteger(match[sourceIndex + 2]) : null;\n\tif (!source || generatedLine === null || generatedColumn === null) return null;\n\tconst bundle = resolveBundle(source);\n\tif (!bundle) return null;\n\treturn {\n\t\tlineIndex,\n\t\tstyle: hasSafariFunction ? \"safari\" : \"chromium\",\n\t\tfunctionName: normalizeFunctionName(hasChromiumFunction || hasSafariFunction ? match[1] : undefined),\n\t\tsource,\n\t\tline: generatedLine,\n\t\tcolumn: generatedColumn,\n\t\tbundle\n\t};\n}\n\nfunction normalizeOriginalSource(source: string): string {\n\tconst normalized = source\n\t\t.replaceAll(\"\\\\\", \"/\")\n\t\t.replace(/[?#].*$/, \"\")\n\t\t.replaceAll(\"\\0\", \"\");\n\tfor (const marker of [\"/src/\", \"/config/\", \"/scripts/\", \"/node_modules/\"] as const) {\n\t\tconst markerIndex = normalized.lastIndexOf(marker);\n\t\tif (markerIndex >= 0) return normalized.slice(markerIndex + 1).slice(0, 1_024);\n\t}\n\tfor (const prefix of [\"src/\", \"config/\", \"scripts/\", \"node_modules/\"] as const) {\n\t\tconst prefixIndex = normalized.indexOf(prefix);\n\t\tif (prefixIndex >= 0) return normalized.slice(prefixIndex).slice(0, 1_024);\n\t}\n\tconst filename = normalized.split(\"/\").filter(Boolean).at(-1) ?? \"unknown-source\";\n\treturn `source/${filename.slice(0, 512)}`;\n}\n\nfunction createSourceContext(traceMap: TraceMap, source: string, line: number) {\n\tconst content = sourceContentFor(traceMap, source);\n\tif (content === null) return undefined;\n\tconst lines = content.split(/\\r?\\n/);\n\tconst firstLine = Math.max(1, line - CONTEXT_RADIUS);\n\tconst lastLine = Math.min(lines.length, line + CONTEXT_RADIUS);\n\treturn Array.from({ length: lastLine - firstLine + 1 }, (_, index) => {\n\t\tconst sourceLine = firstLine + index;\n\t\treturn { line: sourceLine, content: (lines[sourceLine - 1] ?? \"\").slice(0, MAX_SOURCE_LINE_LENGTH), focus: sourceLine === line };\n\t});\n}\n\nfunction formatSymbolicatedLine(frame: ParsedStackFrame, resolved: ErrorReportStackFrame): string {\n\tconst original = resolved.original;\n\tif (!original) return \"\";\n\tconst functionName = original.name ?? frame.functionName;\n\tconst location = `${original.source}:${original.line}:${original.column}`;\n\tif (frame.style === \"safari\") return `${functionName ?? \"global code\"}@${location}`;\n\treturn functionName ? ` at ${functionName} (${location})` : ` at ${location}`;\n}\n\nasync function findArtifact(\n\troots: readonly string[],\n\tapplication: string,\n\tbuildId: string\n): Promise<LoadedPrivateSourceMapArtifact | null> {\n\tfor (const root of roots) {\n\t\tconst artifact = await loadPrivateSourceMapArtifact(root, application, buildId);\n\t\tif (artifact) return artifact;\n\t}\n\treturn null;\n}\n\nfunction resolveDefaultArtifactRoots(): string[] {\n\treturn [process.env.ERROR_REPORT_SOURCE_MAP_SEED_ROOT, process.env.ERROR_REPORT_SOURCE_MAP_ROOT].filter((root): root is string =>\n\t\tBoolean(root)\n\t);\n}\n\n/** Символизирует только bundle frames из artifact того же application/build ID. */\nexport async function symbolicateErrorReportStack(\n\tapplication: string,\n\tbuildId: string,\n\tstackTrace: string | undefined,\n\toptions: SymbolicateErrorReportStackOptions = {}\n): Promise<ErrorReportSymbolicationResult> {\n\tif (!stackTrace?.trim()) return { status: \"not-required\" };\n\tconst stackLines = stackTrace.split(\"\\n\");\n\tconst parsedFrames = stackLines.map(parseStackFrame).filter((frame): frame is ParsedStackFrame => frame !== null);\n\tif (parsedFrames.length === 0) return { status: \"not-required\" };\n\tconst boundedFrames = parsedFrames.slice(0, MAX_STACK_FRAMES);\n\tconst generatedFrames = boundedFrames.map<ErrorReportStackFrame>((frame) => ({\n\t\t...(frame.functionName ? { functionName: frame.functionName } : {}),\n\t\tgenerated: { source: frame.bundle, line: frame.line, column: frame.column }\n\t}));\n\n\ttry {\n\t\tconst artifact = await findArtifact(options.artifactRoots ?? resolveDefaultArtifactRoots(), application, buildId);\n\t\tif (!artifact) return { status: \"maps-unavailable\", frames: generatedFrames };\n\t\tconst traceMaps = new Map<string, TraceMap>();\n\t\tconst resultFrames: ErrorReportStackFrame[] = [];\n\t\tlet failed = parsedFrames.length > MAX_STACK_FRAMES;\n\t\tlet contextFrames = 0;\n\n\t\tfor (const frame of boundedFrames) {\n\t\t\tconst entry: PrivateSourceMapManifestEntry | undefined = artifact.entriesByBundle.get(frame.bundle);\n\t\t\tif (!entry) {\n\t\t\t\tfailed = true;\n\t\t\t\tresultFrames.push({\n\t\t\t\t\t...(frame.functionName ? { functionName: frame.functionName } : {}),\n\t\t\t\t\tgenerated: { source: frame.bundle, line: frame.line, column: frame.column }\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet traceMap = traceMaps.get(entry.map);\n\t\t\tif (!traceMap) {\n\t\t\t\ttraceMap = new AnyMap(await readPrivateSourceMap(artifact, entry), entry.map);\n\t\t\t\ttraceMaps.set(entry.map, traceMap);\n\t\t\t}\n\t\t\tconst original = originalPositionFor(traceMap, { line: frame.line, column: frame.column - 1 });\n\t\t\tif (original.source === null || original.line === null || original.column === null) {\n\t\t\t\tfailed = true;\n\t\t\t\tresultFrames.push({\n\t\t\t\t\t...(frame.functionName ? { functionName: frame.functionName } : {}),\n\t\t\t\t\tgenerated: { source: frame.bundle, line: frame.line, column: frame.column }\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst sourceContext =\n\t\t\t\tcontextFrames < MAX_CONTEXT_FRAMES ? createSourceContext(traceMap, original.source, original.line) : undefined;\n\t\t\tif (sourceContext) contextFrames += 1;\n\t\t\tconst resolvedFrame: ErrorReportStackFrame = {\n\t\t\t\t...(frame.functionName ? { functionName: frame.functionName } : {}),\n\t\t\t\tgenerated: { source: frame.bundle, line: frame.line, column: frame.column },\n\t\t\t\toriginal: {\n\t\t\t\t\tsource: normalizeOriginalSource(original.source),\n\t\t\t\t\tline: original.line,\n\t\t\t\t\tcolumn: original.column + 1,\n\t\t\t\t\t...(original.name ? { name: original.name.slice(0, 256) } : {})\n\t\t\t\t},\n\t\t\t\t...(sourceContext ? { sourceContext } : {})\n\t\t\t};\n\t\t\tresultFrames.push(resolvedFrame);\n\t\t\tstackLines[frame.lineIndex] = formatSymbolicatedLine(frame, resolvedFrame);\n\t\t}\n\n\t\tconst hasResolvedFrame = resultFrames.some((frame) => frame.original !== undefined);\n\t\treturn {\n\t\t\tstatus: failed || !hasResolvedFrame ? \"failed\" : \"resolved\",\n\t\t\t...(hasResolvedFrame ? { stackTrace: stackLines.join(\"\\n\").slice(0, MAX_SYMBOLICATED_STACK_LENGTH) } : {}),\n\t\t\tframes: resultFrames\n\t\t};\n\t} catch {\n\t\treturn { status: \"failed\", frames: generatedFrames };\n\t}\n}\n"],"x_google_ignoreList":[5,6,7],"mappings":";;;;;;;;;;;;;;aACa,KAAsC,GAGtC,IAAgC,kBAMhC,KAAwC,SACxC,IAA+B,UAC/B,IAAwC,WACxC,KAA2C,SCHlD,IAAyB,iCACzB,KAAiB;AAEvB,SAAS,EAAyB,GAAwB;CAEzD,OADI,CAAC,KAAS,EAAM,WAAW,GAAG,KAAK,EAAM,SAAS,IAAI,KAAK,EAAM,SAAS,IAAI,IAAU,KACrF,EAAM,MAAM,GAAG,CAAC,CAAC,OAAO,MAAY,MAAY,MAAM,MAAY,OAAO,MAAY,IAAI;AACjG;AAEA,SAAS,GAAuB,GAAe,GAAoC;CAGlF,OAFI,EAAM,SAAS,IAAI,KAAK,EAAM,SAAS,IAAI,KAAK,EAAM,SAAS,GAAG,KAAK,EAAM,SAAS,GAAG,IAAU,KACnG,MAAS,WAAiB,EAAM,WAAW,GAAG,KAAK,EAAyB,EAAM,MAAM,CAAC,CAAC,IACvF,EAAM,WAAW,SAAS,KAAK,EAAyB,CAAK;AACrE;AAEA,IAAM,KAAsC,EAC1C,OAAO;CACP,MAAM,EAAE,KAAK,CAAC,UAAU,QAAQ,CAAC;CACjC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,IAAK;CAC5B,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,IAAK;CACzB,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,EAAc;CACvC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAA4B;AACnE,CAAC,CAAC,CACD,OAAO,CAAC,CACR,aAAa,GAAO,MAAY;CAIhC,AAHK,GAAuB,EAAM,QA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AM,IAAuC;IAC5C,GAAI,EAAM,eAAe,EAAE,cAAc,EAAM,aAAa,IAAI,CAAC;IACjE,WAAW;KAAE,QAAQ,EAAM;KAAQ,MAAM,EAAM;KAAM,QAAQ,EAAM;IAAO;IAC1E,UAAU;KACT,QAAQ,GAAwB,EAAS,MAAM;KAC/C,MAAM,EAAS;KACf,QAAQ,EAAS,SAAS;KAC1B,GAAI,EAAS,OAAO,EAAE,MAAM,EAAS,KAAK,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC;IAC9D;IACA,GAAI,IAAgB,EAAE,iBAAc,IAAI,CAAC;GAC1C;GAEA,AADA,EAAa,KAAK,CAAa,GAC/B,EAAW,EAAM,aAAa,GAAuB,GAAO,CAAa;EAC1E;EAEA,IAAM,IAAmB,EAAa,MAAM,MAAU,EAAM,aAAa,KAAA,CAAS;EAClF,OAAO;GACN,QAAQ,KAAU,CAAC,IAAmB,WAAW;GACjD,GAAI,IAAmB,EAAE,YAAY,EAAW,KAAK,IAAI,CAAC,CAAC,MAAM,GAAG,EAA6B,EAAE,IAAI,CAAC;GACxG,QAAQ;EACT;CACD,QAAQ;EACP,OAAO;GAAE,QAAQ;GAAU,QAAQ;EAAgB;CACpD;AACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["sortComparator","resolveUri"],"sources":["../../src/error-report-source-maps/types.ts","../../src/error-report-source-maps/manifest.ts","../../src/error-report-source-maps/artifact.ts","../../src/error-report-source-maps/archive.ts","../../src/error-report-source-maps/package.ts","../../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../../node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js","../../node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs","../../src/error-report-source-maps/symbolicate.ts"],"sourcesContent":["/** Версия immutable manifest, общего для build packager и server reader. */\nexport const PRIVATE_SOURCE_MAP_MANIFEST_VERSION = 1 as const;\n\n/** Полный lowercase Git commit SHA является identity одной сборки. */\nexport const ERROR_REPORT_BUILD_ID_PATTERN = /^[0-9a-f]{40}$/;\n\n/**\n * Лимиты едины для build и runtime: packager не должен создавать artifact,\n * который server reader затем не сможет безопасно прочитать.\n */\nexport const PRIVATE_SOURCE_MAP_MANIFEST_MAX_BYTES = 2 * 1024 * 1024;\nexport const PRIVATE_SOURCE_MAP_MAX_BYTES = 32 * 1024 * 1024;\nexport const PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES = 256 * 1024 * 1024;\nexport const PRIVATE_SOURCE_MAP_ARTIFACT_RETENTION_MS = 97 * 24 * 60 * 60 * 1_000;\n\nexport type PrivateSourceMapManifestEntry = {\n\treadonly kind: \"client\" | \"server\";\n\treadonly bundle: string;\n\treadonly map: string;\n\treadonly sha256: string;\n\treadonly size: number;\n};\n\nexport type PrivateSourceMapManifest = {\n\treadonly version: typeof PRIVATE_SOURCE_MAP_MANIFEST_VERSION;\n\treadonly application: string;\n\treadonly buildId: string;\n\treadonly createdUtc: string;\n\treadonly entries: readonly PrivateSourceMapManifestEntry[];\n};\n\nexport type LoadedPrivateSourceMapArtifact = {\n\treadonly buildDirectory: string;\n\treadonly manifest: PrivateSourceMapManifest;\n\treadonly entriesByBundle: ReadonlyMap<string, PrivateSourceMapManifestEntry>;\n};\n\nexport type ErrorReportSourceContextLine = {\n\treadonly line: number;\n\treadonly content: string;\n\treadonly focus: boolean;\n};\n\nexport type ErrorReportStackFrame = {\n\treadonly functionName?: string;\n\treadonly generated: {\n\t\treadonly source: string;\n\t\treadonly line: number;\n\t\treadonly column: number;\n\t};\n\treadonly original?: {\n\t\treadonly source: string;\n\t\treadonly line: number;\n\t\treadonly column: number;\n\t\treadonly name?: string;\n\t};\n\treadonly sourceContext?: readonly ErrorReportSourceContextLine[];\n};\n\nexport type ErrorReportSymbolicationResult = {\n\treadonly status: \"not-required\" | \"resolved\" | \"maps-unavailable\" | \"failed\";\n\treadonly stackTrace?: string;\n\treadonly frames?: readonly ErrorReportStackFrame[];\n};\n\nexport type PackageErrorReportSourceMapsOptions = {\n\treadonly outputRoot: string;\n\treadonly artifactRoot: string;\n\t/** Staging вне outputRoot нужен, когда Nitro очищает свой output после client build. */\n\treadonly clientSourceMapStagingRoot?: string;\n\treadonly application: string;\n\treadonly buildId: string;\n\treadonly createdUtc?: string;\n};\n\nexport type PrivateSourceMapArchiveOptions = {\n\treadonly archiveRoot: string;\n\treadonly seedRoot?: string;\n\treadonly application: string;\n\treadonly buildId: string;\n\treadonly now?: () => Date;\n\treadonly onError?: (error: unknown) => void;\n};\n\nexport type SymbolicateErrorReportStackOptions = {\n\treadonly artifactRoots?: readonly string[];\n};\n","import { z } from \"zod\";\n\nimport {\n\tERROR_REPORT_BUILD_ID_PATTERN,\n\tPRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES,\n\tPRIVATE_SOURCE_MAP_MANIFEST_VERSION,\n\tPRIVATE_SOURCE_MAP_MAX_BYTES,\n\ttype PrivateSourceMapManifest\n} from \"./types\";\n\nconst APPLICATION_ID_PATTERN = /^[a-z0-9]+(?:[.-][a-z0-9]+)*$/;\nconst SHA256_PATTERN = /^[0-9a-f]{64}$/;\n\nfunction isNormalizedRelativePath(value: string): boolean {\n\tif (!value || value.startsWith(\"/\") || value.includes(\"\\\\\") || value.includes(\"\\0\")) return false;\n\treturn value.split(\"/\").every((segment) => segment !== \"\" && segment !== \".\" && segment !== \"..\");\n}\n\nfunction isNormalizedBundlePath(value: string, kind: \"client\" | \"server\"): boolean {\n\tif (value.includes(\"\\\\\") || value.includes(\"\\0\") || value.includes(\"?\") || value.includes(\"#\")) return false;\n\tif (kind === \"client\") return value.startsWith(\"/\") && isNormalizedRelativePath(value.slice(1));\n\treturn value.startsWith(\"server/\") && isNormalizedRelativePath(value);\n}\n\nconst privateSourceMapManifestEntrySchema = z\n\t.object({\n\t\tkind: z.enum([\"client\", \"server\"]),\n\t\tbundle: z.string().max(1_024),\n\t\tmap: z.string().max(1_024),\n\t\tsha256: z.string().regex(SHA256_PATTERN),\n\t\tsize: z.number().int().positive().max(PRIVATE_SOURCE_MAP_MAX_BYTES)\n\t})\n\t.strict()\n\t.superRefine((entry, context) => {\n\t\tif (!isNormalizedBundlePath(entry.bundle, entry.kind)) {\n\t\t\tcontext.addIssue({ code: \"custom\", path: [\"bundle\"], message: \"Bundle path должен быть нормализован.\" });\n\t\t}\n\t\tif (!isNormalizedRelativePath(entry.map) || !entry.map.startsWith(`${entry.kind}/`) || !entry.map.endsWith(\".map\")) {\n\t\t\tcontext.addIssue({ code: \"custom\", path: [\"map\"], message: \"Map path должен оставаться внутри kind-каталога.\" });\n\t\t}\n\t});\n\nconst privateSourceMapManifestSchema = z\n\t.object({\n\t\tversion: z.literal(PRIVATE_SOURCE_MAP_MANIFEST_VERSION),\n\t\tapplication: z.string().min(1).max(128).regex(APPLICATION_ID_PATTERN),\n\t\tbuildId: z.string().regex(ERROR_REPORT_BUILD_ID_PATTERN),\n\t\tcreatedUtc: z.iso.datetime({ offset: true }),\n\t\tentries: z.array(privateSourceMapManifestEntrySchema).max(10_000)\n\t})\n\t.strict()\n\t.superRefine((manifest, context) => {\n\t\tconst bundles = new Set<string>();\n\t\tconst maps = new Set<string>();\n\t\tlet totalBytes = 0;\n\t\tfor (const [index, entry] of manifest.entries.entries()) {\n\t\t\tif (bundles.has(entry.bundle)) {\n\t\t\t\tcontext.addIssue({ code: \"custom\", path: [\"entries\", index, \"bundle\"], message: \"Bundle должен быть уникальным.\" });\n\t\t\t}\n\t\t\tif (maps.has(entry.map)) {\n\t\t\t\tcontext.addIssue({ code: \"custom\", path: [\"entries\", index, \"map\"], message: \"Map path должен быть уникальным.\" });\n\t\t\t}\n\t\t\tbundles.add(entry.bundle);\n\t\t\tmaps.add(entry.map);\n\t\t\ttotalBytes += entry.size;\n\t\t}\n\t\tif (totalBytes > PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES) {\n\t\t\tcontext.addIssue({ code: \"custom\", path: [\"entries\"], message: \"Private source-map artifact превышает общий предел.\" });\n\t\t}\n\t});\n\n/** Проверяет manifest до любого обращения к указанным в нём файлам. */\nexport function parsePrivateSourceMapManifest(value: unknown): PrivateSourceMapManifest | null {\n\tconst parsed = privateSourceMapManifestSchema.safeParse(value);\n\treturn parsed.success ? parsed.data : null;\n}\n\n/** Проверяет недоверенные application/build path segments до filesystem access. */\nexport function isPrivateSourceMapApplicationId(value: unknown): value is string {\n\treturn typeof value === \"string\" && value.length <= 128 && APPLICATION_ID_PATTERN.test(value);\n}\n\nexport function isErrorReportBuildId(value: unknown): value is string {\n\treturn typeof value === \"string\" && ERROR_REPORT_BUILD_ID_PATTERN.test(value);\n}\n","import { isErrorReportBuildId, isPrivateSourceMapApplicationId, parsePrivateSourceMapManifest } from \"./manifest\";\nimport { PRIVATE_SOURCE_MAP_MANIFEST_MAX_BYTES, type LoadedPrivateSourceMapArtifact, type PrivateSourceMapManifestEntry } from \"./types\";\n\nimport { createHash } from \"node:crypto\";\nimport { lstat, readFile, realpath } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nexport class PrivateSourceMapArtifactError extends Error {\n\tpublic constructor() {\n\t\tsuper(\"Private source-map artifact не прошёл проверку целостности.\");\n\t\tthis.name = \"PrivateSourceMapArtifactError\";\n\t}\n}\n\nfunction isMissingFileError(error: unknown): boolean {\n\treturn error instanceof Error && \"code\" in error && error.code === \"ENOENT\";\n}\n\nfunction isPathInside(parent: string, candidate: string): boolean {\n\tconst relativePath = path.relative(parent, candidate);\n\treturn relativePath !== \"\" && !relativePath.startsWith(\"..\") && !path.isAbsolute(relativePath);\n}\n\nasync function readBoundedRegularFile(filePath: string, buildDirectory: string, maxBytes: number): Promise<Buffer> {\n\tconst fileInfo = await lstat(filePath);\n\tif (!fileInfo.isFile() || fileInfo.isSymbolicLink() || fileInfo.size <= 0 || fileInfo.size > maxBytes) {\n\t\tthrow new PrivateSourceMapArtifactError();\n\t}\n\tconst resolvedFilePath = await realpath(filePath);\n\tif (!isPathInside(buildDirectory, resolvedFilePath)) throw new PrivateSourceMapArtifactError();\n\tconst content = await readFile(resolvedFilePath);\n\tif (content.byteLength !== fileInfo.size) throw new PrivateSourceMapArtifactError();\n\treturn content;\n}\n\n/** Загружает manifest только из каталога точного application/build ID. */\nexport async function loadPrivateSourceMapArtifact(\n\troot: string,\n\tapplication: string,\n\tbuildId: string\n): Promise<LoadedPrivateSourceMapArtifact | null> {\n\tif (!isPrivateSourceMapApplicationId(application) || !isErrorReportBuildId(buildId)) throw new PrivateSourceMapArtifactError();\n\n\tlet resolvedRoot: string;\n\tlet buildDirectory: string;\n\ttry {\n\t\tresolvedRoot = await realpath(path.resolve(root));\n\t\tbuildDirectory = await realpath(path.join(resolvedRoot, application, buildId));\n\t} catch (error) {\n\t\tif (isMissingFileError(error)) return null;\n\t\tthrow new PrivateSourceMapArtifactError();\n\t}\n\tif (!isPathInside(resolvedRoot, buildDirectory)) throw new PrivateSourceMapArtifactError();\n\n\tlet manifestContent: Buffer;\n\ttry {\n\t\tmanifestContent = await readBoundedRegularFile(\n\t\t\tpath.join(buildDirectory, \"manifest.json\"),\n\t\t\tbuildDirectory,\n\t\t\tPRIVATE_SOURCE_MAP_MANIFEST_MAX_BYTES\n\t\t);\n\t} catch (error) {\n\t\tif (isMissingFileError(error)) return null;\n\t\tif (error instanceof PrivateSourceMapArtifactError) throw error;\n\t\tthrow new PrivateSourceMapArtifactError();\n\t}\n\n\tlet rawManifest: unknown;\n\ttry {\n\t\trawManifest = JSON.parse(manifestContent.toString(\"utf8\"));\n\t} catch {\n\t\tthrow new PrivateSourceMapArtifactError();\n\t}\n\tconst manifest = parsePrivateSourceMapManifest(rawManifest);\n\tif (!manifest || manifest.application !== application || manifest.buildId !== buildId) throw new PrivateSourceMapArtifactError();\n\n\treturn {\n\t\tbuildDirectory,\n\t\tmanifest,\n\t\tentriesByBundle: new Map(manifest.entries.map((entry) => [entry.bundle, entry]))\n\t};\n}\n\n/** Читает карту только после size/hash verification из manifest. */\nexport async function readPrivateSourceMap(\n\tartifact: LoadedPrivateSourceMapArtifact,\n\tentry: PrivateSourceMapManifestEntry\n): Promise<string> {\n\ttry {\n\t\tconst content = await readBoundedRegularFile(path.join(artifact.buildDirectory, entry.map), artifact.buildDirectory, entry.size);\n\t\tif (content.byteLength !== entry.size || createHash(\"sha256\").update(content).digest(\"hex\") !== entry.sha256) {\n\t\t\tthrow new PrivateSourceMapArtifactError();\n\t\t}\n\t\treturn content.toString(\"utf8\");\n\t} catch (error) {\n\t\tif (error instanceof PrivateSourceMapArtifactError) throw error;\n\t\tthrow new PrivateSourceMapArtifactError();\n\t}\n}\n","import { loadPrivateSourceMapArtifact, readPrivateSourceMap } from \"./artifact\";\nimport { isErrorReportBuildId } from \"./manifest\";\nimport {\n\tPRIVATE_SOURCE_MAP_ARTIFACT_RETENTION_MS,\n\ttype LoadedPrivateSourceMapArtifact,\n\ttype PrivateSourceMapArchiveOptions\n} from \"./types\";\n\nimport { mkdir, readdir, rename, rm, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nconst ARCHIVE_MAINTENANCE_INTERVAL_MS = 24 * 60 * 60 * 1_000;\n\nasync function copyArtifact(\n\tartifact: LoadedPrivateSourceMapArtifact,\n\tarchiveRoot: string,\n\tapplication: string,\n\tbuildId: string\n): Promise<void> {\n\tconst applicationDirectory = path.join(path.resolve(archiveRoot), application);\n\tconst buildDirectory = path.join(applicationDirectory, buildId);\n\tconst temporaryDirectory = path.join(applicationDirectory, `.${buildId}.tmp-${process.pid}`);\n\tawait mkdir(applicationDirectory, { recursive: true });\n\tawait rm(temporaryDirectory, { force: true, recursive: true });\n\tawait mkdir(temporaryDirectory, { recursive: false });\n\n\ttry {\n\t\tfor (const entry of artifact.manifest.entries) {\n\t\t\tconst content = await readPrivateSourceMap(artifact, entry);\n\t\t\tconst targetPath = path.join(temporaryDirectory, entry.map);\n\t\t\tawait mkdir(path.dirname(targetPath), { recursive: true });\n\t\t\tawait writeFile(targetPath, content, { encoding: \"utf8\", flag: \"wx\" });\n\t\t}\n\t\tawait writeFile(path.join(temporaryDirectory, \"manifest.json\"), `${JSON.stringify(artifact.manifest, null, 2)}\\n`, {\n\t\t\tencoding: \"utf8\",\n\t\t\tflag: \"wx\"\n\t\t});\n\t\tawait rename(temporaryDirectory, buildDirectory);\n\t} catch (error) {\n\t\tawait rm(temporaryDirectory, { force: true, recursive: true });\n\t\tconst concurrentlyInstalled = await loadPrivateSourceMapArtifact(archiveRoot, application, buildId).catch(() => null);\n\t\tif (!concurrentlyInstalled) throw error;\n\t}\n}\n\n/** Устанавливает seed и удаляет только валидные завершённые artifacts старше retention. */\nexport async function maintainPrivateSourceMapArchive(options: PrivateSourceMapArchiveOptions): Promise<void> {\n\tif (!isErrorReportBuildId(options.buildId)) return;\n\tawait mkdir(options.archiveRoot, { recursive: true });\n\n\tconst existing = await loadPrivateSourceMapArtifact(options.archiveRoot, options.application, options.buildId);\n\tconst seed = options.seedRoot ? await loadPrivateSourceMapArtifact(options.seedRoot, options.application, options.buildId) : null;\n\tif (existing && seed && JSON.stringify(existing.manifest.entries) !== JSON.stringify(seed.manifest.entries)) {\n\t\tthrow new Error(\"Persistent source-map artifact не совпадает с image seed для того же build ID.\");\n\t}\n\tif (!existing && seed) await copyArtifact(seed, options.archiveRoot, options.application, options.buildId);\n\n\tconst applicationDirectory = path.join(path.resolve(options.archiveRoot), options.application);\n\tawait mkdir(applicationDirectory, { recursive: true });\n\tconst now = (options.now ?? (() => new Date()))().getTime();\n\tfor (const entry of await readdir(applicationDirectory, { withFileTypes: true })) {\n\t\tif (!entry.isDirectory() || !isErrorReportBuildId(entry.name) || entry.name === options.buildId) continue;\n\t\ttry {\n\t\t\tconst artifact = await loadPrivateSourceMapArtifact(options.archiveRoot, options.application, entry.name);\n\t\t\tif (!artifact) continue;\n\t\t\tconst createdAt = Date.parse(artifact.manifest.createdUtc);\n\t\t\tif (Number.isFinite(createdAt) && createdAt + PRIVATE_SOURCE_MAP_ARTIFACT_RETENTION_MS <= now) {\n\t\t\t\tawait rm(artifact.buildDirectory, { recursive: true });\n\t\t\t}\n\t\t} catch {\n\t\t\t// Повреждённый artifact сохраняется как forensic evidence.\n\t\t}\n\t}\n}\n\n/** Запускает bounded daily maintenance и возвращает явный cleanup timer. */\nexport function startPrivateSourceMapArchiveMaintenance(options: PrivateSourceMapArchiveOptions): () => void {\n\tconst run = () => void maintainPrivateSourceMapArchive(options).catch((error: unknown) => options.onError?.(error));\n\trun();\n\tconst timer = setInterval(run, ARCHIVE_MAINTENANCE_INTERVAL_MS);\n\ttimer.unref();\n\treturn () => clearInterval(timer);\n}\n","import { isErrorReportBuildId, isPrivateSourceMapApplicationId } from \"./manifest\";\nimport {\n\tPRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES,\n\tPRIVATE_SOURCE_MAP_MANIFEST_VERSION,\n\tPRIVATE_SOURCE_MAP_MAX_BYTES,\n\ttype PackageErrorReportSourceMapsOptions,\n\ttype PrivateSourceMapManifest,\n\ttype PrivateSourceMapManifestEntry\n} from \"./types\";\n\nimport { createHash } from \"node:crypto\";\nimport { mkdir, readFile, readdir, rename, rm, stat, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nconst SOURCE_MAP_REFERENCE_PATTERN = /(?:\\/\\*[#@]\\s*sourceMappingURL=[^*]*\\*\\/|\\/\\/[#@]\\s*sourceMappingURL=.*)$/gm;\nconst PUBLIC_TEXT_ASSET_PATTERN = /\\.(?:css|html|js|mjs)$/;\nconst NITRO_PUBLIC_SOURCE_MAP_ENTRY_PATTERN = /\"(\\/[^\"\\n]+\\.map)\"\\s*:\\s*\\{/;\n\n/** Временное расположение client maps между client и Nitro server build. */\nexport const STAGED_CLIENT_SOURCE_MAP_DIRECTORY = \".private-source-maps-staging/client\";\n\nasync function listFiles(directory: string, skippedPaths: ReadonlySet<string> = new Set()): Promise<string[]> {\n\tconst files: string[] = [];\n\tfor (const entry of await readdir(directory, { withFileTypes: true })) {\n\t\tconst entryPath = path.join(directory, entry.name);\n\t\tif (skippedPaths.has(path.resolve(entryPath))) continue;\n\t\tif (entry.isSymbolicLink()) throw new Error(`Build output содержит недопустимую symbolic link: ${entryPath}`);\n\t\tif (entry.isDirectory()) files.push(...(await listFiles(entryPath, skippedPaths)));\n\t\telse if (entry.isFile()) files.push(entryPath);\n\t}\n\treturn files.sort((left, right) => left.localeCompare(right));\n}\n\nfunction validateSourceMap(content: Buffer, filePath: string): void {\n\tif (content.byteLength === 0 || content.byteLength > PRIVATE_SOURCE_MAP_MAX_BYTES) {\n\t\tthrow new Error(`Source map выходит за предел ${PRIVATE_SOURCE_MAP_MAX_BYTES} bytes: ${filePath}`);\n\t}\n\tlet sourceMap: unknown;\n\ttry {\n\t\tsourceMap = JSON.parse(content.toString(\"utf8\"));\n\t} catch {\n\t\tthrow new Error(`Source map содержит некорректный JSON: ${filePath}`);\n\t}\n\tif (!sourceMap || typeof sourceMap !== \"object\" || !(\"version\" in sourceMap) || sourceMap.version !== 3) {\n\t\tthrow new Error(`Source map имеет неподдерживаемый формат: ${filePath}`);\n\t}\n\tconst sources = \"sources\" in sourceMap ? sourceMap.sources : undefined;\n\tconst sourcesContent = \"sourcesContent\" in sourceMap ? sourceMap.sourcesContent : undefined;\n\tif (!Array.isArray(sources)) throw new Error(`Source map не содержит список sources: ${filePath}`);\n\t// Nitro вправе не встраивать исходный текст в server maps. Координаты и\n\t// имена кадров при этом восстанавливаются, а source context просто остаётся\n\t// недоступным. Если sourcesContent присутствует, проверяем его целостность.\n\tif (sourcesContent !== undefined && (!Array.isArray(sourcesContent) || sourcesContent.length !== sources.length)) {\n\t\tthrow new Error(`Source map содержит неполный sourcesContent: ${filePath}`);\n\t}\n}\n\nfunction resolveArtifactPaths(\n\toutputRoot: string,\n\tclientSourceMapStagingRoot: string,\n\tmapPath: string\n): Pick<PrivateSourceMapManifestEntry, \"kind\" | \"bundle\" | \"map\"> {\n\tconst publicRoot = path.join(outputRoot, \"public\");\n\tconst serverRoot = path.join(outputRoot, \"server\");\n\tconst relativeToPublic = path.relative(publicRoot, mapPath);\n\tif (relativeToPublic && !relativeToPublic.startsWith(\"..\") && !path.isAbsolute(relativeToPublic)) {\n\t\tconst normalizedMap = relativeToPublic.split(path.sep).join(\"/\");\n\t\treturn { kind: \"client\", bundle: `/${normalizedMap.slice(0, -\".map\".length)}`, map: `client/${normalizedMap}` };\n\t}\n\tconst relativeToStagedClient = path.relative(clientSourceMapStagingRoot, mapPath);\n\tif (relativeToStagedClient && !relativeToStagedClient.startsWith(\"..\") && !path.isAbsolute(relativeToStagedClient)) {\n\t\tconst normalizedMap = relativeToStagedClient.split(path.sep).join(\"/\");\n\t\treturn { kind: \"client\", bundle: `/${normalizedMap.slice(0, -\".map\".length)}`, map: `client/${normalizedMap}` };\n\t}\n\tconst relativeToServer = path.relative(serverRoot, mapPath);\n\tif (relativeToServer && !relativeToServer.startsWith(\"..\") && !path.isAbsolute(relativeToServer)) {\n\t\tconst normalizedMap = relativeToServer.split(path.sep).join(\"/\");\n\t\treturn { kind: \"server\", bundle: `server/${normalizedMap.slice(0, -\".map\".length)}`, map: `server/${normalizedMap}` };\n\t}\n\tthrow new Error(`Source map находится вне public/server output: ${mapPath}`);\n}\n\nasync function stripSourceMapReferences(filePath: string): Promise<void> {\n\tconst source = await readFile(filePath, \"utf8\");\n\tconst withoutReferences = source.replace(SOURCE_MAP_REFERENCE_PATTERN, \"\");\n\tif (withoutReferences !== source) await writeFile(filePath, withoutReferences, \"utf8\");\n}\n\n/** Извлекает клиентские карты до формирования Nitro static asset manifest. */\nexport async function stageClientSourceMapsForNitro(\n\toutputRoot: string,\n\toptions: { readonly publicRoot?: string; readonly clientSourceMapStagingRoot?: string } = {}\n): Promise<number> {\n\tconst resolvedOutputRoot = path.resolve(outputRoot);\n\tconst publicRoot = path.resolve(options.publicRoot ?? path.join(resolvedOutputRoot, \"public\"));\n\tconst stagingRoot = path.resolve(\n\t\toptions.clientSourceMapStagingRoot ?? path.join(resolvedOutputRoot, STAGED_CLIENT_SOURCE_MAP_DIRECTORY)\n\t);\n\tconst publicFiles = await listFiles(publicRoot);\n\tconst sourceMapFiles = publicFiles.filter((filePath) => filePath.endsWith(\".map\"));\n\tfor (const mapFile of sourceMapFiles) {\n\t\tconst relativePath = path.relative(publicRoot, mapFile);\n\t\tconst stagedPath = path.join(stagingRoot, relativePath);\n\t\tawait mkdir(path.dirname(stagedPath), { recursive: true });\n\t\tawait rename(mapFile, stagedPath);\n\t}\n\tfor (const filePath of publicFiles) {\n\t\tif (!filePath.endsWith(\".map\") && PUBLIC_TEXT_ASSET_PATTERN.test(filePath)) await stripSourceMapReferences(filePath);\n\t}\n\treturn sourceMapFiles.length;\n}\n\n/** Проверяет скомпилированный Nitro manifest, а не только оставшиеся файлы. */\nexport async function assertNoNitroSourceMapManifestLeaks(serverEntryPath: string): Promise<void> {\n\tconst serverEntry = await readFile(serverEntryPath, \"utf8\");\n\tconst leakedEntry = NITRO_PUBLIC_SOURCE_MAP_ENTRY_PATTERN.exec(serverEntry)?.[1];\n\tif (leakedEntry) throw new Error(`Nitro static asset manifest содержит source map: ${leakedEntry}`);\n}\n\n/** Доказывает отсутствие карт и sourceMappingURL в public output. */\nexport async function assertNoPublicSourceMapLeaks(publicRoot: string): Promise<void> {\n\tfor (const filePath of await listFiles(publicRoot)) {\n\t\tif (filePath.endsWith(\".map\")) throw new Error(`Public output содержит source map: ${filePath}`);\n\t\tif (!PUBLIC_TEXT_ASSET_PATTERN.test(filePath)) continue;\n\t\tconst source = await readFile(filePath, \"utf8\");\n\t\tif (source.includes(\"sourceMappingURL\")) throw new Error(`Public output содержит sourceMappingURL: ${filePath}`);\n\t}\n}\n\n/** Извлекает карты из multi-environment output в immutable private artifact. */\nexport async function packageErrorReportSourceMaps(options: PackageErrorReportSourceMapsOptions): Promise<PrivateSourceMapManifest> {\n\tif (!isPrivateSourceMapApplicationId(options.application) || !isErrorReportBuildId(options.buildId)) {\n\t\tthrow new Error(\"Application или build ID private source-map artifact недопустим.\");\n\t}\n\tconst outputRoot = path.resolve(options.outputRoot);\n\tconst artifactRoot = path.resolve(options.artifactRoot);\n\tconst clientSourceMapStagingRoot = path.resolve(\n\t\toptions.clientSourceMapStagingRoot ?? path.join(outputRoot, STAGED_CLIENT_SOURCE_MAP_DIRECTORY)\n\t);\n\tconst buildDirectory = path.join(artifactRoot, options.application, options.buildId);\n\tconst temporaryBuildDirectory = `${buildDirectory}.tmp-${process.pid}`;\n\t// Nitro v2 создаёт служебное dependency tree с допустимыми package-manager\n\t// symlink. Оно не является исполняемым bundle output и не участвует в maps.\n\tconst outputFiles = await listFiles(outputRoot, new Set([path.resolve(outputRoot, \"server/node_modules\")]));\n\tconst stagingIsInsideOutput = (() => {\n\t\tconst relative = path.relative(outputRoot, clientSourceMapStagingRoot);\n\t\treturn relative === \"\" || (!relative.startsWith(\"..\") && !path.isAbsolute(relative));\n\t})();\n\tconst stagedClientFiles = stagingIsInsideOutput ? [] : await listFiles(clientSourceMapStagingRoot);\n\tconst mapFiles = [...outputFiles, ...stagedClientFiles].filter((filePath) => filePath.endsWith(\".map\"));\n\tif (mapFiles.length === 0) throw new Error(\"Production build не создал private source maps.\");\n\n\tawait rm(temporaryBuildDirectory, { force: true, recursive: true });\n\tawait mkdir(temporaryBuildDirectory, { recursive: true });\n\tconst entries: PrivateSourceMapManifestEntry[] = [];\n\tlet totalBytes = 0;\n\ttry {\n\t\tfor (const mapFile of mapFiles) {\n\t\t\tconst content = await readFile(mapFile);\n\t\t\tvalidateSourceMap(content, mapFile);\n\t\t\ttotalBytes += content.byteLength;\n\t\t\tif (totalBytes > PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES) {\n\t\t\t\tthrow new Error(`Private source-map artifact превышает ${PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES} bytes.`);\n\t\t\t}\n\t\t\tconst artifactPaths = resolveArtifactPaths(outputRoot, clientSourceMapStagingRoot, mapFile);\n\t\t\tconst targetPath = path.join(temporaryBuildDirectory, artifactPaths.map);\n\t\t\tawait mkdir(path.dirname(targetPath), { recursive: true });\n\t\t\tawait writeFile(targetPath, content, { flag: \"wx\" });\n\t\t\tentries.push({\n\t\t\t\t...artifactPaths,\n\t\t\t\tsha256: createHash(\"sha256\").update(content).digest(\"hex\"),\n\t\t\t\tsize: content.byteLength\n\t\t\t});\n\t\t}\n\t\tif (!entries.some((entry) => entry.kind === \"client\")) throw new Error(\"Private source-map artifact не содержит client maps.\");\n\t\tif (!entries.some((entry) => entry.kind === \"server\")) throw new Error(\"Private source-map artifact не содержит server maps.\");\n\t\tentries.sort((left, right) => left.bundle.localeCompare(right.bundle));\n\t\tconst manifest: PrivateSourceMapManifest = {\n\t\t\tversion: PRIVATE_SOURCE_MAP_MANIFEST_VERSION,\n\t\t\tapplication: options.application,\n\t\t\tbuildId: options.buildId,\n\t\t\tcreatedUtc: options.createdUtc ?? new Date().toISOString(),\n\t\t\tentries\n\t\t};\n\t\tawait writeFile(path.join(temporaryBuildDirectory, \"manifest.json\"), `${JSON.stringify(manifest, null, 2)}\\n`, {\n\t\t\tencoding: \"utf8\",\n\t\t\tflag: \"wx\"\n\t\t});\n\t\tawait rm(buildDirectory, { force: true, recursive: true });\n\t\tawait mkdir(path.dirname(buildDirectory), { recursive: true });\n\t\tawait rename(temporaryBuildDirectory, buildDirectory);\n\t\tfor (const mapFile of mapFiles) await unlink(mapFile);\n\t\tfor (const filePath of outputFiles) {\n\t\t\tif (!filePath.endsWith(\".map\") && PUBLIC_TEXT_ASSET_PATTERN.test(filePath)) await stripSourceMapReferences(filePath);\n\t\t}\n\t\tawait assertNoPublicSourceMapLeaks(path.join(outputRoot, \"public\"));\n\t\tawait assertNoNitroSourceMapManifestLeaks(path.join(outputRoot, \"server/index.mjs\"));\n\t\tconst manifestStat = await stat(path.join(buildDirectory, \"manifest.json\"));\n\t\tif (!manifestStat.isFile()) throw new Error(\"Private source-map manifest не был создан.\");\n\t\treturn manifest;\n\t} catch (error) {\n\t\tawait rm(temporaryBuildDirectory, { force: true, recursive: true });\n\t\tthrow error;\n\t}\n}\n","// src/vlq.ts\nvar comma = \",\".charCodeAt(0);\nvar semicolon = \";\".charCodeAt(0);\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nvar intToChar = new Uint8Array(64);\nvar charToInt = new Uint8Array(128);\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\nfunction decodeInteger(reader, relative) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = reader.next();\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n const shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = -2147483648 | -value;\n }\n return relative + value;\n}\nfunction encodeInteger(builder, num, relative) {\n let delta = num - relative;\n delta = delta < 0 ? -delta << 1 | 1 : delta << 1;\n do {\n let clamped = delta & 31;\n delta >>>= 5;\n if (delta > 0) clamped |= 32;\n builder.write(intToChar[clamped]);\n } while (delta > 0);\n return num;\n}\nfunction hasMoreVlq(reader, max) {\n if (reader.pos >= max) return false;\n return reader.peek() !== comma;\n}\n\n// src/strings.ts\nvar bufLength = 1024 * 16;\nvar td = typeof TextDecoder !== \"undefined\" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== \"undefined\" ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n }\n} : {\n decode(buf) {\n let out = \"\";\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n }\n};\nvar StringWriter = class {\n constructor() {\n this.pos = 0;\n this.out = \"\";\n this.buffer = new Uint8Array(bufLength);\n }\n write(v) {\n const { buffer } = this;\n buffer[this.pos++] = v;\n if (this.pos === bufLength) {\n this.out += td.decode(buffer);\n this.pos = 0;\n }\n }\n flush() {\n const { buffer, out, pos } = this;\n return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;\n }\n};\nvar StringReader = class {\n constructor(buffer) {\n this.pos = 0;\n this.buffer = buffer;\n }\n next() {\n return this.buffer.charCodeAt(this.pos++);\n }\n peek() {\n return this.buffer.charCodeAt(this.pos);\n }\n indexOf(char) {\n const { buffer, pos } = this;\n const idx = buffer.indexOf(char, pos);\n return idx === -1 ? buffer.length : idx;\n }\n};\n\n// src/scopes.ts\nvar EMPTY = [];\nfunction decodeOriginalScopes(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const scopes = [];\n const stack = [];\n let line = 0;\n for (; reader.pos < length; reader.pos++) {\n line = decodeInteger(reader, line);\n const column = decodeInteger(reader, 0);\n if (!hasMoreVlq(reader, length)) {\n const last = stack.pop();\n last[2] = line;\n last[3] = column;\n continue;\n }\n const kind = decodeInteger(reader, 0);\n const fields = decodeInteger(reader, 0);\n const hasName = fields & 1;\n const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind];\n let vars = EMPTY;\n if (hasMoreVlq(reader, length)) {\n vars = [];\n do {\n const varsIndex = decodeInteger(reader, 0);\n vars.push(varsIndex);\n } while (hasMoreVlq(reader, length));\n }\n scope.vars = vars;\n scopes.push(scope);\n stack.push(scope);\n }\n return scopes;\n}\nfunction encodeOriginalScopes(scopes) {\n const writer = new StringWriter();\n for (let i = 0; i < scopes.length; ) {\n i = _encodeOriginalScopes(scopes, i, writer, [0]);\n }\n return writer.flush();\n}\nfunction _encodeOriginalScopes(scopes, index, writer, state) {\n const scope = scopes[index];\n const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;\n if (index > 0) writer.write(comma);\n state[0] = encodeInteger(writer, startLine, state[0]);\n encodeInteger(writer, startColumn, 0);\n encodeInteger(writer, kind, 0);\n const fields = scope.length === 6 ? 1 : 0;\n encodeInteger(writer, fields, 0);\n if (scope.length === 6) encodeInteger(writer, scope[5], 0);\n for (const v of vars) {\n encodeInteger(writer, v, 0);\n }\n for (index++; index < scopes.length; ) {\n const next = scopes[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeOriginalScopes(scopes, index, writer, state);\n }\n writer.write(comma);\n state[0] = encodeInteger(writer, endLine, state[0]);\n encodeInteger(writer, endColumn, 0);\n return index;\n}\nfunction decodeGeneratedRanges(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const ranges = [];\n const stack = [];\n let genLine = 0;\n let definitionSourcesIndex = 0;\n let definitionScopeIndex = 0;\n let callsiteSourcesIndex = 0;\n let callsiteLine = 0;\n let callsiteColumn = 0;\n let bindingLine = 0;\n let bindingColumn = 0;\n do {\n const semi = reader.indexOf(\";\");\n let genColumn = 0;\n for (; reader.pos < semi; reader.pos++) {\n genColumn = decodeInteger(reader, genColumn);\n if (!hasMoreVlq(reader, semi)) {\n const last = stack.pop();\n last[2] = genLine;\n last[3] = genColumn;\n continue;\n }\n const fields = decodeInteger(reader, 0);\n const hasDefinition = fields & 1;\n const hasCallsite = fields & 2;\n const hasScope = fields & 4;\n let callsite = null;\n let bindings = EMPTY;\n let range;\n if (hasDefinition) {\n const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex);\n definitionScopeIndex = decodeInteger(\n reader,\n definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0\n );\n definitionSourcesIndex = defSourcesIndex;\n range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];\n } else {\n range = [genLine, genColumn, 0, 0];\n }\n range.isScope = !!hasScope;\n if (hasCallsite) {\n const prevCsi = callsiteSourcesIndex;\n const prevLine = callsiteLine;\n callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex);\n const sameSource = prevCsi === callsiteSourcesIndex;\n callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0);\n callsiteColumn = decodeInteger(\n reader,\n sameSource && prevLine === callsiteLine ? callsiteColumn : 0\n );\n callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];\n }\n range.callsite = callsite;\n if (hasMoreVlq(reader, semi)) {\n bindings = [];\n do {\n bindingLine = genLine;\n bindingColumn = genColumn;\n const expressionsCount = decodeInteger(reader, 0);\n let expressionRanges;\n if (expressionsCount < -1) {\n expressionRanges = [[decodeInteger(reader, 0)]];\n for (let i = -1; i > expressionsCount; i--) {\n const prevBl = bindingLine;\n bindingLine = decodeInteger(reader, bindingLine);\n bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0);\n const expression = decodeInteger(reader, 0);\n expressionRanges.push([expression, bindingLine, bindingColumn]);\n }\n } else {\n expressionRanges = [[expressionsCount]];\n }\n bindings.push(expressionRanges);\n } while (hasMoreVlq(reader, semi));\n }\n range.bindings = bindings;\n ranges.push(range);\n stack.push(range);\n }\n genLine++;\n reader.pos = semi + 1;\n } while (reader.pos < length);\n return ranges;\n}\nfunction encodeGeneratedRanges(ranges) {\n if (ranges.length === 0) return \"\";\n const writer = new StringWriter();\n for (let i = 0; i < ranges.length; ) {\n i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);\n }\n return writer.flush();\n}\nfunction _encodeGeneratedRanges(ranges, index, writer, state) {\n const range = ranges[index];\n const {\n 0: startLine,\n 1: startColumn,\n 2: endLine,\n 3: endColumn,\n isScope,\n callsite,\n bindings\n } = range;\n if (state[0] < startLine) {\n catchupLine(writer, state[0], startLine);\n state[0] = startLine;\n state[1] = 0;\n } else if (index > 0) {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, range[1], state[1]);\n const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);\n encodeInteger(writer, fields, 0);\n if (range.length === 6) {\n const { 4: sourcesIndex, 5: scopesIndex } = range;\n if (sourcesIndex !== state[2]) {\n state[3] = 0;\n }\n state[2] = encodeInteger(writer, sourcesIndex, state[2]);\n state[3] = encodeInteger(writer, scopesIndex, state[3]);\n }\n if (callsite) {\n const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;\n if (sourcesIndex !== state[4]) {\n state[5] = 0;\n state[6] = 0;\n } else if (callLine !== state[5]) {\n state[6] = 0;\n }\n state[4] = encodeInteger(writer, sourcesIndex, state[4]);\n state[5] = encodeInteger(writer, callLine, state[5]);\n state[6] = encodeInteger(writer, callColumn, state[6]);\n }\n if (bindings) {\n for (const binding of bindings) {\n if (binding.length > 1) encodeInteger(writer, -binding.length, 0);\n const expression = binding[0][0];\n encodeInteger(writer, expression, 0);\n let bindingStartLine = startLine;\n let bindingStartColumn = startColumn;\n for (let i = 1; i < binding.length; i++) {\n const expRange = binding[i];\n bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine);\n bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn);\n encodeInteger(writer, expRange[0], 0);\n }\n }\n }\n for (index++; index < ranges.length; ) {\n const next = ranges[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeGeneratedRanges(ranges, index, writer, state);\n }\n if (state[0] < endLine) {\n catchupLine(writer, state[0], endLine);\n state[0] = endLine;\n state[1] = 0;\n } else {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, endColumn, state[1]);\n return index;\n}\nfunction catchupLine(writer, lastLine, line) {\n do {\n writer.write(semicolon);\n } while (++lastLine < line);\n}\n\n// src/sourcemap-codec.ts\nfunction decode(mappings) {\n const { length } = mappings;\n const reader = new StringReader(mappings);\n const decoded = [];\n let genColumn = 0;\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n do {\n const semi = reader.indexOf(\";\");\n const line = [];\n let sorted = true;\n let lastCol = 0;\n genColumn = 0;\n while (reader.pos < semi) {\n let seg;\n genColumn = decodeInteger(reader, genColumn);\n if (genColumn < lastCol) sorted = false;\n lastCol = genColumn;\n if (hasMoreVlq(reader, semi)) {\n sourcesIndex = decodeInteger(reader, sourcesIndex);\n sourceLine = decodeInteger(reader, sourceLine);\n sourceColumn = decodeInteger(reader, sourceColumn);\n if (hasMoreVlq(reader, semi)) {\n namesIndex = decodeInteger(reader, namesIndex);\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];\n } else {\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];\n }\n } else {\n seg = [genColumn];\n }\n line.push(seg);\n reader.pos++;\n }\n if (!sorted) sort(line);\n decoded.push(line);\n reader.pos = semi + 1;\n } while (reader.pos <= length);\n return decoded;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const writer = new StringWriter();\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) writer.write(semicolon);\n if (line.length === 0) continue;\n let genColumn = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n if (j > 0) writer.write(comma);\n genColumn = encodeInteger(writer, segment[0], genColumn);\n if (segment.length === 1) continue;\n sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);\n sourceLine = encodeInteger(writer, segment[2], sourceLine);\n sourceColumn = encodeInteger(writer, segment[3], sourceColumn);\n if (segment.length === 4) continue;\n namesIndex = encodeInteger(writer, segment[4], namesIndex);\n }\n }\n return writer.flush();\n}\nexport {\n decode,\n decodeGeneratedRanges,\n decodeOriginalScopes,\n encode,\n encodeGeneratedRanges,\n encodeOriginalScopes\n};\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.resolveURI = factory());\n})(this, (function () { 'use strict';\n\n // Matches the scheme of a URL, eg \"http://\"\n const schemeRegex = /^[\\w+.-]+:\\/\\//;\n /**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\n const urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n /**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\n const fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n function isAbsoluteUrl(input) {\n return schemeRegex.test(input);\n }\n function isSchemeRelativeUrl(input) {\n return input.startsWith('//');\n }\n function isAbsolutePath(input) {\n return input.startsWith('/');\n }\n function isFileUrl(input) {\n return input.startsWith('file:');\n }\n function isRelative(input) {\n return /^[.?#]/.test(input);\n }\n function parseAbsoluteUrl(input) {\n const match = urlRegex.exec(input);\n return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');\n }\n function parseFileUrl(input) {\n const match = fileRegex.exec(input);\n const path = match[2];\n return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');\n }\n function makeUrl(scheme, user, host, port, path, query, hash) {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: 7 /* Absolute */,\n };\n }\n function parseUrl(input) {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = 6 /* SchemeRelative */;\n return url;\n }\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = 5 /* AbsolutePath */;\n return url;\n }\n if (isFileUrl(input))\n return parseFileUrl(input);\n if (isAbsoluteUrl(input))\n return parseAbsoluteUrl(input);\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? 3 /* Query */\n : input.startsWith('#')\n ? 2 /* Hash */\n : 4 /* RelativePath */\n : 1 /* Empty */;\n return url;\n }\n function stripPathFilename(path) {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..'))\n return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n }\n function mergePaths(url, base) {\n normalizePath(base, base.type);\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n }\n else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n }\n /**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\n function normalizePath(url, type) {\n const rel = type <= 4 /* RelativePath */;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n }\n /**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\n function resolve(input, base) {\n if (!input && !base)\n return '';\n const url = parseUrl(input);\n let inputType = url.type;\n if (base && inputType !== 7 /* Absolute */) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n switch (inputType) {\n case 1 /* Empty */:\n url.hash = baseUrl.hash;\n // fall through\n case 2 /* Hash */:\n url.query = baseUrl.query;\n // fall through\n case 3 /* Query */:\n case 4 /* RelativePath */:\n mergePaths(url, baseUrl);\n // fall through\n case 5 /* AbsolutePath */:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n case 6 /* SchemeRelative */:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType)\n inputType = baseType;\n }\n normalizePath(url, inputType);\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n case 2 /* Hash */:\n case 3 /* Query */:\n return queryHash;\n case 4 /* RelativePath */: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n if (!path)\n return queryHash || '.';\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n return path + queryHash;\n }\n case 5 /* AbsolutePath */:\n return url.path + queryHash;\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n }\n\n return resolve;\n\n}));\n//# sourceMappingURL=resolve-uri.umd.js.map\n","// src/trace-mapping.ts\nimport { encode, decode } from \"@jridgewell/sourcemap-codec\";\n\n// src/resolve.ts\nimport resolveUri from \"@jridgewell/resolve-uri\";\n\n// src/strip-filename.ts\nfunction stripFilename(path) {\n if (!path) return \"\";\n const index = path.lastIndexOf(\"/\");\n return path.slice(0, index + 1);\n}\n\n// src/resolve.ts\nfunction resolver(mapUrl, sourceRoot) {\n const from = stripFilename(mapUrl);\n const prefix = sourceRoot ? sourceRoot + \"/\" : \"\";\n return (source) => resolveUri(prefix + (source || \"\"), from);\n}\n\n// src/sourcemap-segment.ts\nvar COLUMN = 0;\nvar SOURCES_INDEX = 1;\nvar SOURCE_LINE = 2;\nvar SOURCE_COLUMN = 3;\nvar NAMES_INDEX = 4;\nvar REV_GENERATED_LINE = 1;\nvar REV_GENERATED_COLUMN = 2;\n\n// src/sort.ts\nfunction maybeSort(mappings, owned) {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n if (!owned) mappings = mappings.slice();\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\nfunction nextUnsortedSegmentLine(mappings, start) {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\nfunction isSorted(line) {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\nfunction sortSegments(line, owned) {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[COLUMN] - b[COLUMN];\n}\n\n// src/by-source.ts\nfunction buildBySources(decoded, memos) {\n const sources = memos.map(() => []);\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n const sourceIndex2 = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const source = sources[sourceIndex2];\n const segs = source[sourceLine] || (source[sourceLine] = []);\n segs.push([sourceColumn, i, seg[COLUMN]]);\n }\n }\n for (let i = 0; i < sources.length; i++) {\n const source = sources[i];\n for (let j = 0; j < source.length; j++) {\n const line = source[j];\n if (line) line.sort(sortComparator);\n }\n }\n return sources;\n}\n\n// src/binary-search.ts\nvar found = false;\nfunction binarySearch(haystack, needle, low, high) {\n while (low <= high) {\n const mid = low + (high - low >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n if (cmp === 0) {\n found = true;\n return mid;\n }\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n found = false;\n return low - 1;\n}\nfunction upperBound(haystack, needle, index) {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\nfunction lowerBound(haystack, needle, index) {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\nfunction memoizedState() {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1\n };\n}\nfunction memoizedBinarySearch(haystack, needle, state, key) {\n const { lastKey, lastNeedle, lastIndex } = state;\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n if (needle >= lastNeedle) {\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n return state.lastIndex = binarySearch(haystack, needle, low, high);\n}\n\n// src/types.ts\nfunction parse(map) {\n return typeof map === \"string\" ? JSON.parse(map) : map;\n}\n\n// src/flatten-map.ts\nvar FlattenMap = function(map, mapUrl) {\n const parsed = parse(map);\n if (!(\"sections\" in parsed)) {\n return new TraceMap(parsed, mapUrl);\n }\n const mappings = [];\n const sources = [];\n const sourcesContent = [];\n const names = [];\n const ignoreList = [];\n recurse(\n parsed,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n ignoreList,\n 0,\n 0,\n Infinity,\n Infinity\n );\n const joined = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n ignoreList\n };\n return presortedDecodedMap(joined);\n};\nfunction recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n ignoreList,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc\n );\n }\n}\nfunction addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {\n const parsed = parse(input);\n if (\"sections\" in parsed) return recurse(...arguments);\n const map = new TraceMap(parsed, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map;\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset);\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n if (lineI > stopLine) return;\n const out = getLine(mappings, lineI);\n const cOffset = i === 0 ? columnOffset : 0;\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n if (lineI === stopLine && column >= stopColumn) return;\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]\n );\n }\n }\n}\nfunction append(arr, other) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\nfunction getLine(arr, index) {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n\n// src/trace-mapping.ts\nvar LINE_GTR_ZERO = \"`line` must be greater than 0 (lines start at line 1)\";\nvar COL_GTR_EQ_ZERO = \"`column` must be greater than or equal to 0 (columns start at column 0)\";\nvar LEAST_UPPER_BOUND = -1;\nvar GREATEST_LOWER_BOUND = 1;\nvar TraceMap = class {\n constructor(map, mapUrl) {\n const isString = typeof map === \"string\";\n if (!isString && map._decodedMemo) return map;\n const parsed = parse(map);\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names || [];\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;\n const resolve = resolver(mapUrl, sourceRoot);\n this.resolvedSources = sources.map(resolve);\n const { mappings } = parsed;\n if (typeof mappings === \"string\") {\n this._encoded = mappings;\n this._decoded = void 0;\n } else if (Array.isArray(mappings)) {\n this._encoded = void 0;\n this._decoded = maybeSort(mappings, isString);\n } else if (parsed.sections) {\n throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);\n } else {\n throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);\n }\n this._decodedMemo = memoizedState();\n this._bySources = void 0;\n this._bySourceMemos = void 0;\n }\n};\nfunction cast(map) {\n return map;\n}\nfunction encodedMappings(map) {\n var _a, _b;\n return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = encode(cast(map)._decoded);\n}\nfunction decodedMappings(map) {\n var _a;\n return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));\n}\nfunction traceSegment(map, line, column) {\n const decoded = decodedMappings(map);\n if (line >= decoded.length) return null;\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n cast(map)._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND\n );\n return index === -1 ? null : segments[index];\n}\nfunction originalPositionFor(map, needle) {\n let { line, column, bias } = needle;\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n const decoded = decodedMappings(map);\n if (line >= decoded.length) return OMapping(null, null, null, null);\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n cast(map)._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND\n );\n if (index === -1) return OMapping(null, null, null, null);\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null\n );\n}\nfunction generatedPositionFor(map, needle) {\n const { source, line, column, bias } = needle;\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n}\nfunction allGeneratedPositionsFor(map, needle) {\n const { source, line, column, bias } = needle;\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n}\nfunction eachMapping(map, cb) {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name\n });\n }\n }\n}\nfunction sourceIndex(map, source) {\n const { sources, resolvedSources } = map;\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n return index;\n}\nfunction sourceContentFor(map, source) {\n const { sourcesContent } = map;\n if (sourcesContent == null) return null;\n const index = sourceIndex(map, source);\n return index === -1 ? null : sourcesContent[index];\n}\nfunction isIgnored(map, source) {\n const { ignoreList } = map;\n if (ignoreList == null) return false;\n const index = sourceIndex(map, source);\n return index === -1 ? false : ignoreList.includes(index);\n}\nfunction presortedDecodedMap(map, mapUrl) {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n cast(tracer)._decoded = map.mappings;\n return tracer;\n}\nfunction decodedMap(map) {\n return clone(map, decodedMappings(map));\n}\nfunction encodedMap(map) {\n return clone(map, encodedMappings(map));\n}\nfunction clone(map, mappings) {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n ignoreList: map.ignoreList || map.x_google_ignoreList\n };\n}\nfunction OMapping(source, line, column, name) {\n return { source, line, column, name };\n}\nfunction GMapping(line, column) {\n return { line, column };\n}\nfunction traceSegmentInternal(segments, memo, line, column, bias) {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (found) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\nfunction sliceGeneratedPositions(segments, memo, line, column, bias) {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n if (!found && bias === LEAST_UPPER_BOUND) min++;\n if (min === -1 || min === segments.length) return [];\n const matchedColumn = found ? column : segments[min][COLUMN];\n if (!found) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n const result = [];\n for (; min <= max; min++) {\n const segment = segments[min];\n result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));\n }\n return result;\n}\nfunction generatedPosition(map, source, line, column, bias, all) {\n var _a, _b;\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n const { sources, resolvedSources } = map;\n let sourceIndex2 = sources.indexOf(source);\n if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source);\n if (sourceIndex2 === -1) return all ? [] : GMapping(null, null);\n const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState));\n const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos));\n const segments = generated[sourceIndex2][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n const memo = bySourceMemos[sourceIndex2];\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n}\nexport {\n FlattenMap as AnyMap,\n FlattenMap,\n GREATEST_LOWER_BOUND,\n LEAST_UPPER_BOUND,\n TraceMap,\n allGeneratedPositionsFor,\n decodedMap,\n decodedMappings,\n eachMapping,\n encodedMap,\n encodedMappings,\n generatedPositionFor,\n isIgnored,\n originalPositionFor,\n presortedDecodedMap,\n sourceContentFor,\n traceSegment\n};\n//# sourceMappingURL=trace-mapping.mjs.map\n","import { AnyMap, originalPositionFor, sourceContentFor, type TraceMap } from \"@jridgewell/trace-mapping\";\n\nimport { loadPrivateSourceMapArtifact, readPrivateSourceMap } from \"./artifact\";\nimport {\n\ttype ErrorReportStackFrame,\n\ttype ErrorReportSymbolicationResult,\n\ttype LoadedPrivateSourceMapArtifact,\n\ttype PrivateSourceMapManifestEntry,\n\ttype SymbolicateErrorReportStackOptions\n} from \"./types\";\n\nconst MAX_STACK_FRAMES = 40;\nconst MAX_CONTEXT_FRAMES = 10;\nconst CONTEXT_RADIUS = 2;\nconst MAX_SOURCE_LINE_LENGTH = 500;\nconst MAX_SYMBOLICATED_STACK_LENGTH = 262_144;\n\ntype ParsedStackFrame = {\n\treadonly lineIndex: number;\n\treadonly style: \"chromium\" | \"safari\";\n\treadonly functionName?: string;\n\treadonly source: string;\n\treadonly line: number;\n\treadonly column: number;\n\treadonly bundle: string;\n};\n\nfunction parsePositiveInteger(value: string): number | null {\n\tconst parsed = Number(value);\n\treturn Number.isSafeInteger(parsed) && parsed > 0 ? parsed : null;\n}\n\nfunction normalizeFunctionName(value: string | undefined): string | undefined {\n\tconst normalized = value\n\t\t?.trim()\n\t\t.replace(/^async\\s+/, \"\")\n\t\t.slice(0, 256);\n\treturn normalized || undefined;\n}\n\nfunction safeUrlPathname(value: string): string | null {\n\ttry {\n\t\treturn new URL(value).pathname;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction resolveBundle(source: string): string | null {\n\tconst withoutLocationSuffix = source.replace(/[?#].*$/, \"\").replaceAll(\"\\\\\", \"/\");\n\tconst urlPathname = safeUrlPathname(withoutLocationSuffix);\n\tconst normalized = (urlPathname ?? withoutLocationSuffix).replaceAll(\"\\\\\", \"/\");\n\tif (normalized.startsWith(\"/static/\") || normalized === \"/sw.js\" || normalized === \"/sw.mjs\") return normalized;\n\tif (normalized.startsWith(\"server/\")) return normalized;\n\tconst serverMarker = normalized.lastIndexOf(\"/server/\");\n\treturn serverMarker >= 0 ? `server/${normalized.slice(serverMarker + \"/server/\".length)}` : null;\n}\n\nfunction parseStackFrame(line: string, lineIndex: number): ParsedStackFrame | null {\n\tconst chromiumWithFunction = /^\\s*at\\s+(.+?)\\s+\\((.+):(\\d+):(\\d+)\\)\\s*$/.exec(line);\n\tconst chromiumBare = /^\\s*at\\s+(.+):(\\d+):(\\d+)\\s*$/.exec(line);\n\tconst safari = /^([^@]*)@(.+):(\\d+):(\\d+)\\s*$/.exec(line);\n\tconst match = chromiumWithFunction ?? chromiumBare ?? safari;\n\tif (!match) return null;\n\n\tconst hasChromiumFunction = match === chromiumWithFunction;\n\tconst hasSafariFunction = match === safari;\n\tconst sourceIndex = hasChromiumFunction ? 2 : hasSafariFunction ? 2 : 1;\n\tconst source = match[sourceIndex];\n\tconst generatedLine = match[sourceIndex + 1] ? parsePositiveInteger(match[sourceIndex + 1]) : null;\n\tconst generatedColumn = match[sourceIndex + 2] ? parsePositiveInteger(match[sourceIndex + 2]) : null;\n\tif (!source || generatedLine === null || generatedColumn === null) return null;\n\tconst bundle = resolveBundle(source);\n\tif (!bundle) return null;\n\treturn {\n\t\tlineIndex,\n\t\tstyle: hasSafariFunction ? \"safari\" : \"chromium\",\n\t\tfunctionName: normalizeFunctionName(hasChromiumFunction || hasSafariFunction ? match[1] : undefined),\n\t\tsource,\n\t\tline: generatedLine,\n\t\tcolumn: generatedColumn,\n\t\tbundle\n\t};\n}\n\nfunction normalizeOriginalSource(source: string): string {\n\tconst normalized = source\n\t\t.replaceAll(\"\\\\\", \"/\")\n\t\t.replace(/[?#].*$/, \"\")\n\t\t.replaceAll(\"\\0\", \"\");\n\tfor (const marker of [\"/src/\", \"/config/\", \"/scripts/\", \"/node_modules/\"] as const) {\n\t\tconst markerIndex = normalized.lastIndexOf(marker);\n\t\tif (markerIndex >= 0) return normalized.slice(markerIndex + 1).slice(0, 1_024);\n\t}\n\tfor (const prefix of [\"src/\", \"config/\", \"scripts/\", \"node_modules/\"] as const) {\n\t\tconst prefixIndex = normalized.indexOf(prefix);\n\t\tif (prefixIndex >= 0) return normalized.slice(prefixIndex).slice(0, 1_024);\n\t}\n\tconst filename = normalized.split(\"/\").filter(Boolean).at(-1) ?? \"unknown-source\";\n\treturn `source/${filename.slice(0, 512)}`;\n}\n\nfunction createSourceContext(traceMap: TraceMap, source: string, line: number) {\n\tconst content = sourceContentFor(traceMap, source);\n\tif (content === null) return undefined;\n\tconst lines = content.split(/\\r?\\n/);\n\tconst firstLine = Math.max(1, line - CONTEXT_RADIUS);\n\tconst lastLine = Math.min(lines.length, line + CONTEXT_RADIUS);\n\treturn Array.from({ length: lastLine - firstLine + 1 }, (_, index) => {\n\t\tconst sourceLine = firstLine + index;\n\t\treturn { line: sourceLine, content: (lines[sourceLine - 1] ?? \"\").slice(0, MAX_SOURCE_LINE_LENGTH), focus: sourceLine === line };\n\t});\n}\n\nfunction formatSymbolicatedLine(frame: ParsedStackFrame, resolved: ErrorReportStackFrame): string {\n\tconst original = resolved.original;\n\tif (!original) return \"\";\n\tconst functionName = original.name ?? frame.functionName;\n\tconst location = `${original.source}:${original.line}:${original.column}`;\n\tif (frame.style === \"safari\") return `${functionName ?? \"global code\"}@${location}`;\n\treturn functionName ? ` at ${functionName} (${location})` : ` at ${location}`;\n}\n\nasync function findArtifact(\n\troots: readonly string[],\n\tapplication: string,\n\tbuildId: string\n): Promise<LoadedPrivateSourceMapArtifact | null> {\n\tfor (const root of roots) {\n\t\tconst artifact = await loadPrivateSourceMapArtifact(root, application, buildId);\n\t\tif (artifact) return artifact;\n\t}\n\treturn null;\n}\n\nfunction resolveDefaultArtifactRoots(): string[] {\n\treturn [process.env.ERROR_REPORT_SOURCE_MAP_SEED_ROOT, process.env.ERROR_REPORT_SOURCE_MAP_ROOT].filter((root): root is string =>\n\t\tBoolean(root)\n\t);\n}\n\n/** Символизирует только bundle frames из artifact того же application/build ID. */\nexport async function symbolicateErrorReportStack(\n\tapplication: string,\n\tbuildId: string,\n\tstackTrace: string | undefined,\n\toptions: SymbolicateErrorReportStackOptions = {}\n): Promise<ErrorReportSymbolicationResult> {\n\tif (!stackTrace?.trim()) return { status: \"not-required\" };\n\tconst stackLines = stackTrace.split(\"\\n\");\n\tconst parsedFrames = stackLines.map(parseStackFrame).filter((frame): frame is ParsedStackFrame => frame !== null);\n\tif (parsedFrames.length === 0) return { status: \"not-required\" };\n\tconst boundedFrames = parsedFrames.slice(0, MAX_STACK_FRAMES);\n\tconst generatedFrames = boundedFrames.map<ErrorReportStackFrame>((frame) => ({\n\t\t...(frame.functionName ? { functionName: frame.functionName } : {}),\n\t\tgenerated: { source: frame.bundle, line: frame.line, column: frame.column }\n\t}));\n\n\ttry {\n\t\tconst artifact = await findArtifact(options.artifactRoots ?? resolveDefaultArtifactRoots(), application, buildId);\n\t\tif (!artifact) return { status: \"maps-unavailable\", frames: generatedFrames };\n\t\tconst traceMaps = new Map<string, TraceMap>();\n\t\tconst resultFrames: ErrorReportStackFrame[] = [];\n\t\tlet failed = parsedFrames.length > MAX_STACK_FRAMES;\n\t\tlet contextFrames = 0;\n\n\t\tfor (const frame of boundedFrames) {\n\t\t\tconst entry: PrivateSourceMapManifestEntry | undefined = artifact.entriesByBundle.get(frame.bundle);\n\t\t\tif (!entry) {\n\t\t\t\tfailed = true;\n\t\t\t\tresultFrames.push({\n\t\t\t\t\t...(frame.functionName ? { functionName: frame.functionName } : {}),\n\t\t\t\t\tgenerated: { source: frame.bundle, line: frame.line, column: frame.column }\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet traceMap = traceMaps.get(entry.map);\n\t\t\tif (!traceMap) {\n\t\t\t\ttraceMap = new AnyMap(await readPrivateSourceMap(artifact, entry), entry.map);\n\t\t\t\ttraceMaps.set(entry.map, traceMap);\n\t\t\t}\n\t\t\tconst original = originalPositionFor(traceMap, { line: frame.line, column: frame.column - 1 });\n\t\t\tif (original.source === null || original.line === null || original.column === null) {\n\t\t\t\tfailed = true;\n\t\t\t\tresultFrames.push({\n\t\t\t\t\t...(frame.functionName ? { functionName: frame.functionName } : {}),\n\t\t\t\t\tgenerated: { source: frame.bundle, line: frame.line, column: frame.column }\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst sourceContext =\n\t\t\t\tcontextFrames < MAX_CONTEXT_FRAMES ? createSourceContext(traceMap, original.source, original.line) : undefined;\n\t\t\tif (sourceContext) contextFrames += 1;\n\t\t\tconst resolvedFrame: ErrorReportStackFrame = {\n\t\t\t\t...(frame.functionName ? { functionName: frame.functionName } : {}),\n\t\t\t\tgenerated: { source: frame.bundle, line: frame.line, column: frame.column },\n\t\t\t\toriginal: {\n\t\t\t\t\tsource: normalizeOriginalSource(original.source),\n\t\t\t\t\tline: original.line,\n\t\t\t\t\tcolumn: original.column + 1,\n\t\t\t\t\t...(original.name ? { name: original.name.slice(0, 256) } : {})\n\t\t\t\t},\n\t\t\t\t...(sourceContext ? { sourceContext } : {})\n\t\t\t};\n\t\t\tresultFrames.push(resolvedFrame);\n\t\t\tstackLines[frame.lineIndex] = formatSymbolicatedLine(frame, resolvedFrame);\n\t\t}\n\n\t\tconst hasResolvedFrame = resultFrames.some((frame) => frame.original !== undefined);\n\t\treturn {\n\t\t\tstatus: failed || !hasResolvedFrame ? \"failed\" : \"resolved\",\n\t\t\t...(hasResolvedFrame ? { stackTrace: stackLines.join(\"\\n\").slice(0, MAX_SYMBOLICATED_STACK_LENGTH) } : {}),\n\t\t\tframes: resultFrames\n\t\t};\n\t} catch {\n\t\treturn { status: \"failed\", frames: generatedFrames };\n\t}\n}\n"],"x_google_ignoreList":[5,6,7],"mappings":";;;;;;;;;;;;;;aACa,KAAsC,GAGtC,IAAgC,kBAMhC,KAAwC,SACxC,IAA+B,UAC/B,IAAwC,WACxC,KAA2C,SCHlD,IAAyB,iCACzB,KAAiB;AAEvB,SAAS,EAAyB,GAAwB;CAEzD,OADI,CAAC,KAAS,EAAM,WAAW,GAAG,KAAK,EA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AAQ,EAAM;IAAO;IAC1E,UAAU;KACT,QAAQ,GAAwB,EAAS,MAAM;KAC/C,MAAM,EAAS;KACf,QAAQ,EAAS,SAAS;KAC1B,GAAI,EAAS,OAAO,EAAE,MAAM,EAAS,KAAK,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC;IAC9D;IACA,GAAI,IAAgB,EAAE,iBAAc,IAAI,CAAC;GAC1C;GAEA,AADA,EAAa,KAAK,CAAa,GAC/B,EAAW,EAAM,aAAa,GAAuB,GAAO,CAAa;EAC1E;EAEA,IAAM,IAAmB,EAAa,MAAM,MAAU,EAAM,aAAa,KAAA,CAAS;EAClF,OAAO;GACN,QAAQ,KAAU,CAAC,IAAmB,WAAW;GACjD,GAAI,IAAmB,EAAE,YAAY,EAAW,KAAK,IAAI,CAAC,CAAC,MAAM,GAAG,EAA6B,EAAE,IAAI,CAAC;GACxG,QAAQ;EACT;CACD,QAAQ;EACP,OAAO;GAAE,QAAQ;GAAU,QAAQ;EAAgB;CACpD;AACD"}
|
|
@@ -4,6 +4,7 @@ export declare const STAGED_CLIENT_SOURCE_MAP_DIRECTORY = ".private-source-maps-
|
|
|
4
4
|
/** Извлекает клиентские карты до формирования Nitro static asset manifest. */
|
|
5
5
|
export declare function stageClientSourceMapsForNitro(outputRoot: string, options?: {
|
|
6
6
|
readonly publicRoot?: string;
|
|
7
|
+
readonly clientSourceMapStagingRoot?: string;
|
|
7
8
|
}): Promise<number>;
|
|
8
9
|
/** Проверяет скомпилированный Nitro manifest, а не только оставшиеся файлы. */
|
|
9
10
|
export declare function assertNoNitroSourceMapManifestLeaks(serverEntryPath: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../src/error-report-source-maps/package.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAE7B,MAAM,SAAS,CAAC;AAUjB,4EAA4E;AAC5E,eAAO,MAAM,kCAAkC,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../src/error-report-source-maps/package.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAE7B,MAAM,SAAS,CAAC;AAUjB,4EAA4E;AAC5E,eAAO,MAAM,kCAAkC,wCAAwC,CAAC;AAqExF,8EAA8E;AAC9E,wBAAsB,6BAA6B,CAClD,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,0BAA0B,CAAC,EAAE,MAAM,CAAA;CAAO,GAC1F,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED,+EAA+E;AAC/E,wBAAsB,mCAAmC,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIhG;AAED,qEAAqE;AACrE,wBAAsB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOpF;AAED,gFAAgF;AAChF,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,mCAAmC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CA0ElI"}
|
|
@@ -57,6 +57,8 @@ export type ErrorReportSymbolicationResult = {
|
|
|
57
57
|
export type PackageErrorReportSourceMapsOptions = {
|
|
58
58
|
readonly outputRoot: string;
|
|
59
59
|
readonly artifactRoot: string;
|
|
60
|
+
/** Staging вне outputRoot нужен, когда Nitro очищает свой output после client build. */
|
|
61
|
+
readonly clientSourceMapStagingRoot?: string;
|
|
60
62
|
readonly application: string;
|
|
61
63
|
readonly buildId: string;
|
|
62
64
|
readonly createdUtc?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/error-report-source-maps/types.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,eAAO,MAAM,mCAAmC,EAAG,CA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