@qwik.dev/core 2.0.0-beta.35 → 2.0.0-beta.36
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/backpatch/index.mjs +2 -2
- package/dist/backpatch/package.json +1 -1
- package/dist/backpatch-executor.debug.js +2 -1
- package/dist/backpatch-executor.js +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +183 -39
- package/dist/core.min.mjs +8 -9
- package/dist/core.mjs +2223 -1290
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +4492 -3645
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +0 -4
- package/dist/optimizer.mjs +429 -424
- package/dist/out-of-order-executor.debug.js +163 -0
- package/dist/out-of-order-executor.js +1 -0
- package/dist/preloader.mjs +1 -1
- package/dist/qwikloader.debug.js +47 -26
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.mjs +1160 -143
- package/dist/server.prod.mjs +1231 -428
- package/dist/testing/index.d.ts +75 -20
- package/dist/testing/index.mjs +2966 -1218
- package/dist/testing/package.json +1 -1
- package/dist/worker/package.json +1 -1
- package/package.json +4 -4
- package/public.d.ts +1 -0
package/dist/optimizer.mjs
CHANGED
|
@@ -270,8 +270,8 @@ function mn(t, e, n, r, i, s, a) {
|
|
|
270
270
|
w.length > 0 && (u.imports = w);
|
|
271
271
|
const T = h.dynamicImports.filter((I) => h.code.includes(t.basename(I))).map((I) => c(I)).filter(Boolean);
|
|
272
272
|
T.length > 0 && (u.dynamicImports = T), h.facadeModuleId && (gt.test(h.facadeModuleId) ? l.preloader = d : mt.test(h.facadeModuleId) ? l.core = d : wt.test(h.facadeModuleId) && (l.qwikLoader = d));
|
|
273
|
-
const
|
|
274
|
-
|
|
273
|
+
const j = (h.moduleIds || Object.keys(h.modules)).filter((I) => !I.startsWith("\0")).map((I) => t.relative(i.rootDir, I));
|
|
274
|
+
j.length > 0 && (u.origins = j, !l.preloader && j.some((I) => gt.test(I)) && (l.preloader = d), !l.core && j.some((I) => mt.test(I)) && (l.core = d), !l.qwikLoader && j.some((I) => wt.test(I)) && (l.qwikLoader = d)), l.bundles[d] = u;
|
|
275
275
|
}
|
|
276
276
|
for (const h of e) {
|
|
277
277
|
const d = h.name, f = l.mapping[d];
|
|
@@ -447,7 +447,7 @@ async function xn(t, e, n) {
|
|
|
447
447
|
for (const h of b.messages) {
|
|
448
448
|
if (h.ruleId != null && !h.ruleId.startsWith("qwik/"))
|
|
449
449
|
continue;
|
|
450
|
-
const d =
|
|
450
|
+
const d = En(b.filePath, h);
|
|
451
451
|
l.warn(d);
|
|
452
452
|
}
|
|
453
453
|
});
|
|
@@ -460,7 +460,7 @@ async function xn(t, e, n) {
|
|
|
460
460
|
function kn(t) {
|
|
461
461
|
return t.split("?", 2)[0];
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function En(t, e) {
|
|
464
464
|
return Object.assign(new Error(e.message), {
|
|
465
465
|
id: t,
|
|
466
466
|
plugin: "vite-plugin-eslint",
|
|
@@ -472,7 +472,7 @@ function Sn(t, e) {
|
|
|
472
472
|
stack: ""
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
|
-
async function
|
|
475
|
+
async function Sn(t, e) {
|
|
476
476
|
const n = e;
|
|
477
477
|
let r = n.loc;
|
|
478
478
|
if (!n.frame && !n.plugin && (r || (r = In(n)), r && (n.loc = r, r.file))) {
|
|
@@ -611,7 +611,7 @@ var xt = 1024 * 16, kt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDeco
|
|
|
611
611
|
return n > 0 ? e + kt.decode(t.subarray(0, n)) : e;
|
|
612
612
|
}
|
|
613
613
|
};
|
|
614
|
-
function
|
|
614
|
+
function On(t) {
|
|
615
615
|
const e = new Ln();
|
|
616
616
|
let n = 0, r = 0, i = 0, s = 0;
|
|
617
617
|
for (let a = 0; a < t.length; a++) {
|
|
@@ -703,15 +703,15 @@ class Be {
|
|
|
703
703
|
} else if (this.edit("", void 0, !0), this.outro = this.outro.replace(e, ""), this.outro.length) return !0;
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
|
-
function
|
|
706
|
+
function Rn() {
|
|
707
707
|
return typeof globalThis < "u" && typeof globalThis.btoa == "function" ? (t) => globalThis.btoa(unescape(encodeURIComponent(t))) : typeof Buffer == "function" ? (t) => Buffer.from(t, "utf-8").toString("base64") : () => {
|
|
708
708
|
throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
|
|
709
709
|
};
|
|
710
710
|
}
|
|
711
|
-
const Mn = /* @__PURE__ */
|
|
711
|
+
const Mn = /* @__PURE__ */ Rn();
|
|
712
712
|
class jn {
|
|
713
713
|
constructor(e) {
|
|
714
|
-
this.version = 3, this.file = e.file, this.sources = e.sources, this.sourcesContent = e.sourcesContent, this.names = e.names, this.mappings =
|
|
714
|
+
this.version = 3, this.file = e.file, this.sources = e.sources, this.sourcesContent = e.sourcesContent, this.names = e.names, this.mappings = On(e.mappings), typeof e.x_google_ignoreList < "u" && (this.x_google_ignoreList = e.x_google_ignoreList), typeof e.debugId < "u" && (this.debugId = e.debugId);
|
|
715
715
|
}
|
|
716
716
|
toString() {
|
|
717
717
|
return JSON.stringify(this);
|
|
@@ -733,7 +733,7 @@ function $n(t) {
|
|
|
733
733
|
}, 1 / 0);
|
|
734
734
|
return new Array(i + 1).join(" ");
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function Un(t, e) {
|
|
737
737
|
const n = t.split(/[/\\]/), r = e.split(/[/\\]/);
|
|
738
738
|
for (n.pop(); n[0] === r[0]; )
|
|
739
739
|
n.shift(), r.shift();
|
|
@@ -743,11 +743,11 @@ function qn(t, e) {
|
|
|
743
743
|
}
|
|
744
744
|
return n.concat(r).join("/");
|
|
745
745
|
}
|
|
746
|
-
const
|
|
746
|
+
const qn = Object.prototype.toString;
|
|
747
747
|
function Bn(t) {
|
|
748
|
-
return
|
|
748
|
+
return qn.call(t) === "[object Object]";
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function Et(t) {
|
|
751
751
|
const e = t.split(`
|
|
752
752
|
`), n = [];
|
|
753
753
|
for (let r = 0, i = 0; r < e.length; r++)
|
|
@@ -869,7 +869,7 @@ class lt {
|
|
|
869
869
|
}
|
|
870
870
|
generateDecodedMap(e) {
|
|
871
871
|
e = e || {};
|
|
872
|
-
const n = 0, r = Object.keys(this.storedNames), i = new An(e.hires), s =
|
|
872
|
+
const n = 0, r = Object.keys(this.storedNames), i = new An(e.hires), s = Et(this.original);
|
|
873
873
|
return this.intro && i.advance(this.intro), this.firstChunk.eachNext((a) => {
|
|
874
874
|
const l = s(a.start);
|
|
875
875
|
a.intro.length && i.advance(a.intro), a.edited ? i.addEdit(
|
|
@@ -881,7 +881,7 @@ class lt {
|
|
|
881
881
|
}), this.outro && i.advance(this.outro), {
|
|
882
882
|
file: e.file ? e.file.split(/[/\\]/).pop() : void 0,
|
|
883
883
|
sources: [
|
|
884
|
-
e.source ?
|
|
884
|
+
e.source ? Un(e.file || "", e.source) : e.file || ""
|
|
885
885
|
],
|
|
886
886
|
sourcesContent: e.includeContent ? [this.original] : void 0,
|
|
887
887
|
names: r,
|
|
@@ -1113,7 +1113,7 @@ class lt {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
_splitChunk(e, n) {
|
|
1115
1115
|
if (e.edited && e.content.length) {
|
|
1116
|
-
const i =
|
|
1116
|
+
const i = Et(this.original)(n);
|
|
1117
1117
|
throw new Error(
|
|
1118
1118
|
`Cannot split a chunk that has already been edited (${i.line}:${i.column} – "${e.original}")`
|
|
1119
1119
|
);
|
|
@@ -1259,13 +1259,13 @@ const zn = "__QWIK_WORKER_QRL__", Wn = `${zn}:`, rt = "__QWIK_WORKER_CORE__", Hn
|
|
|
1259
1259
|
const [, i = "", s = ""] = /^([^?#]*)(.*)$/.exec(r) ?? [], a = i.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, ""), l = it(n, `${a}.js`);
|
|
1260
1260
|
return s.startsWith("?") ? `${l}?worker_file&type=module&${s.slice(1)}` : s.startsWith("#") ? `${l}?worker_file&type=module${s}` : `${l}?worker_file&type=module`;
|
|
1261
1261
|
};
|
|
1262
|
-
}, Yn = (t) => t.startsWith(".") ? t : `./${t}`,
|
|
1262
|
+
}, Yn = (t) => t.startsWith(".") ? t : `./${t}`, St = (t) => {
|
|
1263
1263
|
const e = [];
|
|
1264
1264
|
for (const n of t.replace(/\\/g, "/").split("/"))
|
|
1265
1265
|
!n || n === "." || (n === ".." && e.length > 0 && e[e.length - 1] !== ".." ? e.pop() : e.push(n));
|
|
1266
1266
|
return e;
|
|
1267
1267
|
}, Xn = (t, e) => {
|
|
1268
|
-
const n = t === "." ? [] :
|
|
1268
|
+
const n = t === "." ? [] : St(t), r = St(e);
|
|
1269
1269
|
let i = 0;
|
|
1270
1270
|
for (; i < n.length && i < r.length && n[i] === r[i]; )
|
|
1271
1271
|
i++;
|
|
@@ -1305,7 +1305,7 @@ const zn = "__QWIK_WORKER_QRL__", Wn = `${zn}:`, rt = "__QWIK_WORKER_CORE__", Hn
|
|
|
1305
1305
|
"browser",
|
|
1306
1306
|
"event$"
|
|
1307
1307
|
];
|
|
1308
|
-
var Yt = /* @__PURE__ */ ((t) => (t.each = "each", t.suspense = "suspense", t.
|
|
1308
|
+
var Yt = /* @__PURE__ */ ((t) => (t.each = "each", t.suspense = "suspense", t.valibot = "valibot", t.noSPA = "noSPA", t.insights = "insights", t))(Yt || {});
|
|
1309
1309
|
function Xt(t = {}) {
|
|
1310
1310
|
const e = `${Math.round(Math.random() * 899) + 100}`, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
1311
1311
|
let a = null, l, c = () => {
|
|
@@ -1360,31 +1360,31 @@ function Xt(t = {}) {
|
|
|
1360
1360
|
const w = (y) => {
|
|
1361
1361
|
u = y;
|
|
1362
1362
|
}, T = async (y) => {
|
|
1363
|
-
const p = Object.assign({}, y),
|
|
1363
|
+
const p = Object.assign({}, y), E = h(), P = E.sys.path, C = (...D) => A(P.resolve(...D));
|
|
1364
1364
|
o.debug = !!p.debug, p.devTools && (o.devTools = {
|
|
1365
1365
|
...o.devTools,
|
|
1366
1366
|
...p.devTools
|
|
1367
|
-
}), p.assetsDir && (o.assetsDir = p.assetsDir), p.target === "ssr" || p.target === "client" || p.target === "lib" || p.target === "test" ? o.target = p.target : o.target ||= "client", o.target === "lib" ? o.buildMode = "development" : p.buildMode === "production" || p.buildMode === "development" ? o.buildMode = p.buildMode : o.buildMode ||= "development", o.csr = !!p.csr, p.entryStrategy && typeof p.entryStrategy == "object" && (o.entryStrategy = { ...p.entryStrategy }), o.entryStrategy || (o.target === "ssr" || o.target === "test" ? o.entryStrategy = { type: "hoist" } : o.target === "lib" ? o.entryStrategy = { type: "inline" } : o.buildMode === "production" ? o.entryStrategy = { type: "smart" } : o.entryStrategy = { type: "segment" }), typeof p.rootDir == "string" && (o.rootDir = p.rootDir), typeof o.rootDir != "string" && (o.rootDir ||=
|
|
1368
|
-
let
|
|
1369
|
-
if (typeof p.srcDir == "string" ? (o.srcDir =
|
|
1367
|
+
}), p.assetsDir && (o.assetsDir = p.assetsDir), p.target === "ssr" || p.target === "client" || p.target === "lib" || p.target === "test" ? o.target = p.target : o.target ||= "client", o.target === "lib" ? o.buildMode = "development" : p.buildMode === "production" || p.buildMode === "development" ? o.buildMode = p.buildMode : o.buildMode ||= "development", o.csr = !!p.csr, p.entryStrategy && typeof p.entryStrategy == "object" && (o.entryStrategy = { ...p.entryStrategy }), o.entryStrategy || (o.target === "ssr" || o.target === "test" ? o.entryStrategy = { type: "hoist" } : o.target === "lib" ? o.entryStrategy = { type: "inline" } : o.buildMode === "production" ? o.entryStrategy = { type: "smart" } : o.entryStrategy = { type: "segment" }), typeof p.rootDir == "string" && (o.rootDir = p.rootDir), typeof o.rootDir != "string" && (o.rootDir ||= E.sys.cwd()), o.rootDir = C(E.sys.cwd(), o.rootDir);
|
|
1368
|
+
let S = C(o.rootDir, sr);
|
|
1369
|
+
if (typeof p.srcDir == "string" ? (o.srcDir = C(o.rootDir, p.srcDir), S = o.srcDir) : o.srcDir ||= S, o.srcDir = C(o.rootDir, o.srcDir), Array.isArray(p.tsconfigFileNames) && p.tsconfigFileNames.length > 0 && (o.tsconfigFileNames = p.tsconfigFileNames), !o.csr && !p.input && !o.input && (o.target === "ssr" ? o.input = [C(S, "entry.ssr")] : o.target === "client" ? o.input = [C(S, "root")] : o.input = void 0), p.outDir && (o.outDir = C(o.rootDir, p.outDir)), o.clientOutDir = C(o.rootDir, p.clientOutDir || _t), o.ssrOutDir = C(o.rootDir, p.ssrOutDir || ar), o.target === "ssr" ? o.outDir ||= o.ssrOutDir : o.target === "lib" ? o.outDir ||= C(o.rootDir, lr) : o.outDir ||= o.clientOutDir, typeof p.manifestOutput == "function" && (o.manifestOutput = p.manifestOutput), p.manifestInput && (o.manifestInput = pt(p.manifestInput) || null), typeof p.transformedModuleOutput == "function" && (o.transformedModuleOutput = p.transformedModuleOutput), p.scope !== void 0)
|
|
1370
1370
|
o.scope = p.scope;
|
|
1371
1371
|
else if (!o.scope && m) {
|
|
1372
1372
|
let D = "";
|
|
1373
1373
|
try {
|
|
1374
|
-
let
|
|
1375
|
-
for (; D = P.resolve(
|
|
1376
|
-
const L = P.resolve(
|
|
1377
|
-
if (L ===
|
|
1374
|
+
let U = o.rootDir;
|
|
1375
|
+
for (; D = P.resolve(U, "package.json"), !await m.promises.stat(D).catch(() => !1); ) {
|
|
1376
|
+
const L = P.resolve(U, "..");
|
|
1377
|
+
if (L === U)
|
|
1378
1378
|
break;
|
|
1379
|
-
|
|
1379
|
+
U = L, D = "";
|
|
1380
1380
|
}
|
|
1381
1381
|
if (D) {
|
|
1382
1382
|
const L = await m.promises.readFile(D, "utf-8"), N = JSON.parse(L);
|
|
1383
1383
|
typeof N.name == "string" && (o.scope = N.name);
|
|
1384
1384
|
}
|
|
1385
|
-
} catch (
|
|
1385
|
+
} catch (U) {
|
|
1386
1386
|
console.warn(
|
|
1387
|
-
`could not read ${D || "package.json"} to determine package name, ignoring. (${
|
|
1387
|
+
`could not read ${D || "package.json"} to determine package name, ignoring. (${U})`
|
|
1388
1388
|
);
|
|
1389
1389
|
}
|
|
1390
1390
|
}
|
|
@@ -1393,34 +1393,34 @@ function Xt(t = {}) {
|
|
|
1393
1393
|
for (const D of p.experimental ?? [])
|
|
1394
1394
|
Yt[D] ? (o.experimental ||= {})[D] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${D}`);
|
|
1395
1395
|
}
|
|
1396
|
-
const
|
|
1397
|
-
return o.input ||= p.input, o.input && typeof o.input == "string" && (o.input = [o.input]),
|
|
1396
|
+
const q = { ...o };
|
|
1397
|
+
return o.input ||= p.input, o.input && typeof o.input == "string" && (o.input = [o.input]), q;
|
|
1398
1398
|
};
|
|
1399
|
-
let
|
|
1400
|
-
const
|
|
1401
|
-
if (!
|
|
1402
|
-
|
|
1399
|
+
let Y = !1;
|
|
1400
|
+
const j = async (y) => {
|
|
1401
|
+
if (!Y) {
|
|
1402
|
+
Y = !0;
|
|
1403
1403
|
const p = d();
|
|
1404
1404
|
if (p.env === "node") {
|
|
1405
|
-
const
|
|
1406
|
-
if (!
|
|
1405
|
+
const E = await p.dynamicImport("node:fs");
|
|
1406
|
+
if (!E.existsSync(o.rootDir))
|
|
1407
1407
|
throw new Error(`Qwik rootDir "${o.rootDir}" not found.`);
|
|
1408
|
-
if (typeof o.srcDir == "string" && !
|
|
1408
|
+
if (typeof o.srcDir == "string" && !E.existsSync(o.srcDir))
|
|
1409
1409
|
throw new Error(`Qwik srcDir "${o.srcDir}" not found.`);
|
|
1410
|
-
for (const [P,
|
|
1411
|
-
if (!await y(
|
|
1412
|
-
throw new Error(`Qwik input "${
|
|
1410
|
+
for (const [P, C] of Object.entries(o.input || {}))
|
|
1411
|
+
if (!await y(C))
|
|
1412
|
+
throw new Error(`Qwik input "${C}" not found.`);
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
1415
1415
|
};
|
|
1416
1416
|
let I, v = !1;
|
|
1417
1417
|
const k = async (y) => {
|
|
1418
|
-
if (
|
|
1418
|
+
if (M("buildStart()", o.buildMode, o.scope, o.target, o.rootDir, o.srcDir), I = h(), v = !u, I.sys.env === "node" && o.target === "ssr" && o.lint)
|
|
1419
1419
|
try {
|
|
1420
1420
|
l = await xn(I.sys, o.rootDir, o.tsconfigFileNames);
|
|
1421
1421
|
} catch {
|
|
1422
1422
|
}
|
|
1423
|
-
if (
|
|
1423
|
+
if (M("transformedOutputs.clear()"), r.clear(), i.clear(), o.target === "client" && !u) {
|
|
1424
1424
|
const p = await y.resolve("@qwik.dev/core/qwikloader.js", void 0, {
|
|
1425
1425
|
skipSelf: !0
|
|
1426
1426
|
});
|
|
@@ -1431,15 +1431,15 @@ function Xt(t = {}) {
|
|
|
1431
1431
|
});
|
|
1432
1432
|
}
|
|
1433
1433
|
}, x = (y, p) => y.environment ? y.environment.config.consumer === "server" : u ? !!p?.ssr : o.target === "ssr" || o.target === "test";
|
|
1434
|
-
let $ = 0,
|
|
1435
|
-
const
|
|
1434
|
+
let $ = 0, _ = !1;
|
|
1435
|
+
const O = async (y, p, E, P) => {
|
|
1436
1436
|
if (ae(p))
|
|
1437
1437
|
return;
|
|
1438
|
-
const
|
|
1439
|
-
if (
|
|
1440
|
-
if (!
|
|
1441
|
-
|
|
1442
|
-
const [, B, W] =
|
|
1438
|
+
const C = u && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(p);
|
|
1439
|
+
if (C) {
|
|
1440
|
+
if (!_) {
|
|
1441
|
+
_ = !0, setTimeout(() => _ = !1, 500);
|
|
1442
|
+
const [, B, W] = C, ue = await y.resolve(B, E);
|
|
1443
1443
|
if (ue) {
|
|
1444
1444
|
const ne = y.environment.moduleGraph.getModuleById(ue.id)?.file;
|
|
1445
1445
|
if (ne) {
|
|
@@ -1456,14 +1456,14 @@ function Xt(t = {}) {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
return { id: "\0editor" };
|
|
1458
1458
|
}
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
const D =
|
|
1462
|
-
if (
|
|
1459
|
+
const S = $++, q = x(y, P);
|
|
1460
|
+
M(`resolveId(${S})`, `begin ${p} | ${q ? "server" : "client"} | ${E}`);
|
|
1461
|
+
const D = E && We(E);
|
|
1462
|
+
if (E = D && A(D.pathId), p.startsWith(".") && D) {
|
|
1463
1463
|
const B = f(), W = B.dirname(D.pathId);
|
|
1464
1464
|
W && (p = B.resolve(W, p));
|
|
1465
1465
|
}
|
|
1466
|
-
const
|
|
1466
|
+
const U = We(p), L = A(U.pathId);
|
|
1467
1467
|
let N;
|
|
1468
1468
|
if (
|
|
1469
1469
|
/**
|
|
@@ -1472,8 +1472,8 @@ function Xt(t = {}) {
|
|
|
1472
1472
|
*/
|
|
1473
1473
|
s.get(L)
|
|
1474
1474
|
)
|
|
1475
|
-
|
|
1476
|
-
id: L +
|
|
1475
|
+
M(`resolveId(${S}) Resolved already known ${L}`), N = {
|
|
1476
|
+
id: L + U.query,
|
|
1477
1477
|
moduleSideEffects: !1
|
|
1478
1478
|
};
|
|
1479
1479
|
else if (
|
|
@@ -1484,20 +1484,20 @@ function Xt(t = {}) {
|
|
|
1484
1484
|
// We test with endsWith because the dev server adds the base pathname
|
|
1485
1485
|
L.endsWith(se)
|
|
1486
1486
|
)
|
|
1487
|
-
o.resolveQwikBuild && (
|
|
1487
|
+
o.resolveQwikBuild && (M(`resolveId(${S})`, "Resolved", se), N = {
|
|
1488
1488
|
id: se,
|
|
1489
1489
|
moduleSideEffects: !1
|
|
1490
1490
|
});
|
|
1491
1491
|
else if (L.endsWith(oe))
|
|
1492
1492
|
console.error(
|
|
1493
|
-
`${
|
|
1494
|
-
),
|
|
1493
|
+
`${E ? `${E}: ` : ""}importing ${oe} is deprecated. Use \`getClientManifest()\` instead.`
|
|
1494
|
+
), M(`resolveId(${S})`, "Resolved", oe), N = {
|
|
1495
1495
|
id: oe,
|
|
1496
1496
|
moduleSideEffects: !1
|
|
1497
1497
|
};
|
|
1498
|
-
else if (!u && !
|
|
1499
|
-
|
|
1500
|
-
const B = await y.resolve(Ze,
|
|
1498
|
+
else if (!u && !q && L.endsWith(Ze)) {
|
|
1499
|
+
M(`resolveId(${S})`, "Resolved", Ze);
|
|
1500
|
+
const B = await y.resolve(Ze, E, {
|
|
1501
1501
|
skipSelf: !0
|
|
1502
1502
|
});
|
|
1503
1503
|
if (B)
|
|
@@ -1507,14 +1507,14 @@ function Xt(t = {}) {
|
|
|
1507
1507
|
preserveSignature: "allow-extension"
|
|
1508
1508
|
}), B;
|
|
1509
1509
|
} else if (L.endsWith(ke))
|
|
1510
|
-
|
|
1510
|
+
M(`resolveId(${S})`, "Resolved", ke), N = {
|
|
1511
1511
|
id: ke,
|
|
1512
1512
|
moduleSideEffects: !1
|
|
1513
1513
|
};
|
|
1514
1514
|
else {
|
|
1515
|
-
if (!
|
|
1515
|
+
if (!q && v && p.endsWith("@qwik.dev/core")) {
|
|
1516
1516
|
v = !1;
|
|
1517
|
-
const W = await y.resolve("@qwik.dev/core/handlers.mjs",
|
|
1517
|
+
const W = await y.resolve("@qwik.dev/core/handlers.mjs", E, {
|
|
1518
1518
|
skipSelf: !0
|
|
1519
1519
|
});
|
|
1520
1520
|
if (!W)
|
|
@@ -1527,91 +1527,91 @@ function Xt(t = {}) {
|
|
|
1527
1527
|
}
|
|
1528
1528
|
const B = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(p)?.groups;
|
|
1529
1529
|
if (B) {
|
|
1530
|
-
const { parent: W, name: ue, query: Ae } = B, ne = await y.resolve(W,
|
|
1530
|
+
const { parent: W, name: ue, query: Ae } = B, ne = await y.resolve(W, E, { skipSelf: !0 });
|
|
1531
1531
|
if (ne) {
|
|
1532
|
-
const re = ne.id.split("?")[0], V = u &&
|
|
1533
|
-
|
|
1532
|
+
const re = ne.id.split("?")[0], V = u && E?.endsWith(".html") ? `${re}_${ue}.js` : L;
|
|
1533
|
+
M(`resolveId(${S})`, `resolved to QRL ${ue} of ${re}`), s.set(V, re), N = {
|
|
1534
1534
|
id: V + Ae,
|
|
1535
1535
|
// QRL segments can't have side effects. Probably never useful, but it's here for consistency
|
|
1536
1536
|
moduleSideEffects: !1
|
|
1537
1537
|
};
|
|
1538
1538
|
} else
|
|
1539
|
-
console.error(`resolveId(${
|
|
1540
|
-
} else if (
|
|
1541
|
-
const W = s.get(
|
|
1539
|
+
console.error(`resolveId(${S})`, `QRL parent ${W} does not exist!`);
|
|
1540
|
+
} else if (E) {
|
|
1541
|
+
const W = s.get(E);
|
|
1542
1542
|
if (W)
|
|
1543
|
-
return
|
|
1543
|
+
return M(`resolveId(${S}) end`, `resolving via ${W}`), y.resolve(p, W, { skipSelf: !0 });
|
|
1544
1544
|
}
|
|
1545
1545
|
}
|
|
1546
|
-
return
|
|
1546
|
+
return M(`resolveId(${S}) end`, N?.id || N), N;
|
|
1547
1547
|
};
|
|
1548
|
-
let
|
|
1549
|
-
const F = async (y, p,
|
|
1548
|
+
let Q = 0;
|
|
1549
|
+
const F = async (y, p, E) => {
|
|
1550
1550
|
if (p === "\0editor")
|
|
1551
1551
|
return '"opening in editor"';
|
|
1552
1552
|
if (ae(p) || p.startsWith("/@fs/"))
|
|
1553
1553
|
return;
|
|
1554
|
-
const P =
|
|
1554
|
+
const P = Q++, C = x(y, E);
|
|
1555
1555
|
if (o.resolveQwikBuild && p === se)
|
|
1556
|
-
return
|
|
1556
|
+
return M(`load(${P})`, se, o.buildMode), {
|
|
1557
1557
|
moduleSideEffects: !1,
|
|
1558
|
-
code: ve(
|
|
1558
|
+
code: ve(C, o.target)
|
|
1559
1559
|
};
|
|
1560
1560
|
if (p === oe)
|
|
1561
|
-
return
|
|
1561
|
+
return M(`load(${P})`, oe, o.buildMode), {
|
|
1562
1562
|
moduleSideEffects: !1,
|
|
1563
1563
|
code: `import { getClientManifest } from '@qwik.dev/core'; export const manifest = getClientManifest();
|
|
1564
1564
|
`
|
|
1565
1565
|
};
|
|
1566
1566
|
if (p === ke)
|
|
1567
|
-
return
|
|
1567
|
+
return M(`load(${P})`, ke, o.buildMode), {
|
|
1568
1568
|
moduleSideEffects: !1,
|
|
1569
1569
|
code: "export * from '@qwik.dev/core';"
|
|
1570
1570
|
};
|
|
1571
|
-
const
|
|
1572
|
-
p = A(
|
|
1573
|
-
const
|
|
1574
|
-
if (u && !
|
|
1575
|
-
const
|
|
1576
|
-
if (
|
|
1577
|
-
const L = u.moduleGraph.getModuleById(
|
|
1571
|
+
const S = We(p);
|
|
1572
|
+
p = A(S.pathId);
|
|
1573
|
+
const q = C ? i : r;
|
|
1574
|
+
if (u && !q.has(p)) {
|
|
1575
|
+
const U = s.get(p);
|
|
1576
|
+
if (U) {
|
|
1577
|
+
const L = u.moduleGraph.getModuleById(U);
|
|
1578
1578
|
if (L) {
|
|
1579
|
-
if (
|
|
1580
|
-
return
|
|
1579
|
+
if (M(`load(${P})`, "transforming QRL parent", U), await u.transformRequest(L.url), !q.has(p))
|
|
1580
|
+
return M(`load(${P})`, `QRL segment ${p} not found in ${U}`), null;
|
|
1581
1581
|
} else
|
|
1582
|
-
console.error(`load(${P})`, `module ${
|
|
1582
|
+
console.error(`load(${P})`, `module ${U} does not exist in the build graph!`);
|
|
1583
1583
|
}
|
|
1584
1584
|
}
|
|
1585
|
-
const D =
|
|
1585
|
+
const D = q.get(p);
|
|
1586
1586
|
if (D) {
|
|
1587
|
-
|
|
1588
|
-
let { code:
|
|
1587
|
+
M(`load(${P})`, "Found", p);
|
|
1588
|
+
let { code: U } = D[0];
|
|
1589
1589
|
const { map: L, segment: N } = D[0], B = D[1];
|
|
1590
1590
|
if (u?.hot && B && o.devTools.hmr && N?.ctxName !== "worker$") {
|
|
1591
1591
|
const W = B.startsWith(o.rootDir) ? B.slice(o.rootDir.length) : B;
|
|
1592
|
-
|
|
1592
|
+
U += `
|
|
1593
1593
|
if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(()=>{document.dispatchEvent(new CustomEvent('qHmr', {detail: {files:[${JSON.stringify(W)}], t: document.__hmrT}}));});}`;
|
|
1594
1594
|
}
|
|
1595
|
-
return { code:
|
|
1595
|
+
return { code: U, map: L, meta: { segment: N } };
|
|
1596
1596
|
}
|
|
1597
|
-
return
|
|
1597
|
+
return M(`load(${P})`, "Not a QRL or virtual module", p), null;
|
|
1598
1598
|
};
|
|
1599
|
-
let R,
|
|
1600
|
-
const
|
|
1601
|
-
if (ae(
|
|
1599
|
+
let R, J = 0;
|
|
1600
|
+
const K = async function(y, p, E, P = {}) {
|
|
1601
|
+
if (ae(E))
|
|
1602
1602
|
return;
|
|
1603
|
-
const
|
|
1604
|
-
if (
|
|
1603
|
+
const C = x(y, P), S = C ? i : r;
|
|
1604
|
+
if (S.has(E))
|
|
1605
1605
|
return;
|
|
1606
|
-
let
|
|
1607
|
-
const D =
|
|
1606
|
+
let q = !1;
|
|
1607
|
+
const D = J++, U = h(), L = f(), { pathId: N } = We(E), B = L.parse(N), W = B.dir, ue = B.base, Ae = B.ext.toLowerCase();
|
|
1608
1608
|
let ne, re;
|
|
1609
1609
|
const he = o.target === "lib" ? "lib" : o.buildMode === "development" ? u?.hot && o.devTools.hmr ? "hmr" : "dev" : "prod";
|
|
1610
|
-
if (he !== "lib" && (p = p.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (V, fe) => (
|
|
1610
|
+
if (he !== "lib" && (p = p.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (V, fe) => (q = !0, o.experimental?.[fe] ? "true" : "false"))), Ae in or || Zt.test(N)) {
|
|
1611
1611
|
const V = o.target === "client" || o.target === "ssr";
|
|
1612
|
-
|
|
1612
|
+
M(
|
|
1613
1613
|
`transform(${D})`,
|
|
1614
|
-
`Transforming ${
|
|
1614
|
+
`Transforming ${E} (for: ${C ? "server" : "client"}${V ? ", strip" : ""})`
|
|
1615
1615
|
);
|
|
1616
1616
|
let fe = ue;
|
|
1617
1617
|
o.srcDir && (fe = L.relative(o.srcDir, N)), fe = A(fe);
|
|
@@ -1624,7 +1624,7 @@ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(
|
|
|
1624
1624
|
}
|
|
1625
1625
|
const pe = {
|
|
1626
1626
|
input: [{ code: p, path: fe, devPath: ie }],
|
|
1627
|
-
entryStrategy:
|
|
1627
|
+
entryStrategy: C ? { type: "hoist" } : an,
|
|
1628
1628
|
minify: "simplify",
|
|
1629
1629
|
// Always enable sourcemaps in dev for click-to-source
|
|
1630
1630
|
sourceMaps: o.sourcemap || o.buildMode === "development",
|
|
@@ -1636,11 +1636,11 @@ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(
|
|
|
1636
1636
|
rootDir: o.rootDir,
|
|
1637
1637
|
mode: he,
|
|
1638
1638
|
scope: o.scope || void 0,
|
|
1639
|
-
isServer:
|
|
1639
|
+
isServer: C
|
|
1640
1640
|
};
|
|
1641
|
-
V && (
|
|
1642
|
-
const ln = Date.now(), ge = await
|
|
1643
|
-
if (
|
|
1641
|
+
V && (C ? (pe.stripCtxName = tr, pe.stripEventHandlers = !0, pe.regCtxName = Zn) : (pe.stripCtxName = er, pe.stripExports = Vn));
|
|
1642
|
+
const ln = Date.now(), ge = await U.transformModules(pe);
|
|
1643
|
+
if (M(`transform(${D})`, `done in ${Date.now() - ln}ms`), ie) {
|
|
1644
1644
|
const ee = Jn(ie);
|
|
1645
1645
|
for (const Z of ge.modules)
|
|
1646
1646
|
Z.code = Kt(
|
|
@@ -1649,12 +1649,12 @@ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(
|
|
|
1649
1649
|
);
|
|
1650
1650
|
}
|
|
1651
1651
|
const ze = ge.modules.find((ee) => !rr(ee));
|
|
1652
|
-
c(ge.diagnostics,
|
|
1652
|
+
c(ge.diagnostics, U, Xe), C ? ge.diagnostics.length === 0 && l && l.lint(y, p, E) : n.set(E, ge);
|
|
1653
1653
|
const dt = /* @__PURE__ */ new Set();
|
|
1654
1654
|
for (const ee of ge.modules)
|
|
1655
1655
|
if (ee !== ze) {
|
|
1656
1656
|
const Z = A(L.join(Xe, ee.path));
|
|
1657
|
-
if (
|
|
1657
|
+
if (M(`transform(${D})`, `segment ${Z}`, ee.segment.displayName), s.set(Z, E), S.set(Z, [ee, E]), dt.add(Z), u) {
|
|
1658
1658
|
const ut = u.moduleGraph.getModuleById(Z);
|
|
1659
1659
|
ut && u.moduleGraph.invalidateModule(ut);
|
|
1660
1660
|
}
|
|
@@ -1664,33 +1664,33 @@ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(
|
|
|
1664
1664
|
preserveSignature: "allow-extension"
|
|
1665
1665
|
});
|
|
1666
1666
|
}
|
|
1667
|
-
y.addWatchFile(
|
|
1667
|
+
y.addWatchFile(E), p = ze.code, ne = ze.map, re = {
|
|
1668
1668
|
segment: ze.segment,
|
|
1669
1669
|
qwikdeps: Array.from(dt)
|
|
1670
|
-
},
|
|
1670
|
+
}, q = !0;
|
|
1671
1671
|
}
|
|
1672
1672
|
if (p.includes(`globalThis.${Ge}`)) {
|
|
1673
|
-
R === void 0 && (R = await tn(
|
|
1673
|
+
R === void 0 && (R = await tn(C));
|
|
1674
1674
|
const V = new lt(p);
|
|
1675
|
-
V.replace(`!globalThis.${Ge}`, "false"), R && V.replace(`globalThis.${Ge}`, R), p = V.toString(), ne ||= V.generateMap({ source:
|
|
1675
|
+
V.replace(`!globalThis.${Ge}`, "false"), R && V.replace(`globalThis.${Ge}`, R), p = V.toString(), ne ||= V.generateMap({ source: E, includeContent: !1 }), q = !0, M(`transform(${D})`, `Replaced globalThis.${Ge} with manifest input`);
|
|
1676
1676
|
}
|
|
1677
|
-
if (
|
|
1678
|
-
return { code: p, map: ne, meta: re };
|
|
1679
|
-
|
|
1677
|
+
if (q)
|
|
1678
|
+
return ir(E) && (ne = null), { code: p, map: ne, meta: re };
|
|
1679
|
+
M(`transform(${D})`, "Not transforming", E);
|
|
1680
1680
|
}, X = (y) => {
|
|
1681
|
-
const p = [],
|
|
1681
|
+
const p = [], E = {
|
|
1682
1682
|
addInjection: (P) => p.push(P)
|
|
1683
1683
|
};
|
|
1684
|
-
return
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1689
|
-
|
|
1684
|
+
return E.generateManifest = async (P) => {
|
|
1685
|
+
const S = h().sys.path, q = S.resolve(o.rootDir, o.outDir, "build"), D = (N) => S.relative(q, S.resolve(o.rootDir, o.outDir, N));
|
|
1686
|
+
E.canonPath = D;
|
|
1687
|
+
const U = Array.from(n.values()).flatMap((N) => N.modules).map((N) => N.segment).filter((N) => !!N), L = mn(
|
|
1688
|
+
S,
|
|
1689
|
+
U,
|
|
1690
1690
|
p,
|
|
1691
1691
|
y,
|
|
1692
1692
|
o,
|
|
1693
|
-
|
|
1693
|
+
M,
|
|
1694
1694
|
D
|
|
1695
1695
|
);
|
|
1696
1696
|
P && Object.assign(L, P);
|
|
@@ -1699,8 +1699,8 @@ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(
|
|
|
1699
1699
|
for (const N of Object.values(L.bundles))
|
|
1700
1700
|
N.origins && (N.origins = N.origins.sort());
|
|
1701
1701
|
return L.manifestHash = cn(JSON.stringify(L)), L;
|
|
1702
|
-
},
|
|
1703
|
-
}, te = () => o, ce = () => Array.from(r.values()).map((y) => y[0]),
|
|
1702
|
+
}, E;
|
|
1703
|
+
}, te = () => o, ce = () => Array.from(r.values()).map((y) => y[0]), M = (...y) => {
|
|
1704
1704
|
o.debug && console.debug(`[QWIK PLUGIN: ${e}]`, ...y);
|
|
1705
1705
|
}, z = (...y) => {
|
|
1706
1706
|
console.log(`[QWIK PLUGIN: ${e}]`, ...y);
|
|
@@ -1708,8 +1708,8 @@ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(
|
|
|
1708
1708
|
c = y;
|
|
1709
1709
|
}, A = (y) => g(y);
|
|
1710
1710
|
function ve(y, p) {
|
|
1711
|
-
const
|
|
1712
|
-
return
|
|
1711
|
+
const E = o.buildMode === "development";
|
|
1712
|
+
return E ? `// @qwik.dev/core/build
|
|
1713
1713
|
export const isBrowser = /*#__PURE__*/ (() =>
|
|
1714
1714
|
typeof window !== 'undefined' &&
|
|
1715
1715
|
typeof HTMLElement !== 'undefined' &&
|
|
@@ -1720,33 +1720,33 @@ export const isDev = true;
|
|
|
1720
1720
|
` : `// @qwik.dev/core/build
|
|
1721
1721
|
export const isServer = ${JSON.stringify(y)};
|
|
1722
1722
|
export const isBrowser = ${JSON.stringify(!y)};
|
|
1723
|
-
export const isDev = ${JSON.stringify(
|
|
1723
|
+
export const isDev = ${JSON.stringify(E)};
|
|
1724
1724
|
`;
|
|
1725
1725
|
}
|
|
1726
1726
|
async function tn(y) {
|
|
1727
1727
|
if (!o.manifestInput && o.target === "ssr" && o.buildMode === "production" && m) {
|
|
1728
1728
|
const P = f();
|
|
1729
|
-
let
|
|
1730
|
-
await m.promises.stat(
|
|
1729
|
+
let C = o.manifestInputPath || P.resolve(o.clientOutDir, Ve);
|
|
1730
|
+
await m.promises.stat(C).catch(() => !1) || (C = P.resolve(o.rootDir, _t, Ve));
|
|
1731
1731
|
try {
|
|
1732
|
-
const
|
|
1733
|
-
o.manifestInput = pt(JSON.parse(
|
|
1734
|
-
} catch (
|
|
1732
|
+
const S = await m.promises.readFile(C, "utf-8");
|
|
1733
|
+
o.manifestInput = pt(JSON.parse(S)) || null, console.info("Read client manifest from", C);
|
|
1734
|
+
} catch (S) {
|
|
1735
1735
|
console.warn(
|
|
1736
1736
|
`
|
|
1737
1737
|
==========
|
|
1738
|
-
Could not read Qwik client manifest ${
|
|
1738
|
+
Could not read Qwik client manifest ${C}.
|
|
1739
1739
|
Make sure you provide it to the qwikVite plugin via the \`manifestInput\` \`manifestInputPath\` arguments, or to the SSR renderer via the \`manifest\` argument, or define it in \`globalThis.__QWIK_MANIFEST__\` before the server bundle is loaded, or embed it in the server bundle by replacing \`globalThis.__QWIK_MANIFEST__\`.
|
|
1740
1740
|
Without the manifest, the SSR renderer will not be able to generate event handlers.
|
|
1741
|
-
(${
|
|
1741
|
+
(${S})
|
|
1742
1742
|
==========
|
|
1743
1743
|
`
|
|
1744
1744
|
);
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
1747
|
const p = y ? o.manifestInput : null;
|
|
1748
|
-
let
|
|
1749
|
-
return p?.manifestHash && (
|
|
1748
|
+
let E = null;
|
|
1749
|
+
return p?.manifestHash && (E = {
|
|
1750
1750
|
manifestHash: p.manifestHash,
|
|
1751
1751
|
core: p.core,
|
|
1752
1752
|
preloader: p.preloader,
|
|
@@ -1755,23 +1755,23 @@ Without the manifest, the SSR renderer will not be able to generate event handle
|
|
|
1755
1755
|
injections: p.injections,
|
|
1756
1756
|
mapping: p.mapping,
|
|
1757
1757
|
bundleGraph: p.bundleGraph
|
|
1758
|
-
}),
|
|
1758
|
+
}), E && JSON.stringify(E);
|
|
1759
1759
|
}
|
|
1760
1760
|
function nn(y) {
|
|
1761
1761
|
o.sourcemap = y;
|
|
1762
1762
|
}
|
|
1763
1763
|
function rn(y, p) {
|
|
1764
|
-
const
|
|
1765
|
-
|
|
1766
|
-
const P =
|
|
1767
|
-
for (const
|
|
1768
|
-
const { id:
|
|
1769
|
-
if (
|
|
1770
|
-
|
|
1771
|
-
for (const [
|
|
1772
|
-
if (
|
|
1773
|
-
|
|
1774
|
-
const L = y.moduleGraph.getModuleById(
|
|
1764
|
+
const E = y.name === "ssr";
|
|
1765
|
+
M("hotUpdate()", p.file, y.name);
|
|
1766
|
+
const P = E ? i : r;
|
|
1767
|
+
for (const C of p.modules) {
|
|
1768
|
+
const { id: S } = C;
|
|
1769
|
+
if (S) {
|
|
1770
|
+
M("hotUpdate()", `invalidate ${S}`), n.delete(S);
|
|
1771
|
+
for (const [q, [D, U]] of P)
|
|
1772
|
+
if (U === S) {
|
|
1773
|
+
M("hotUpdate()", `invalidate ${S} segment ${q}`), P.delete(q);
|
|
1774
|
+
const L = y.moduleGraph.getModuleById(q);
|
|
1775
1775
|
L && y.moduleGraph.invalidateModule(L);
|
|
1776
1776
|
}
|
|
1777
1777
|
}
|
|
@@ -1781,8 +1781,7 @@ Without the manifest, the SSR renderer will not be able to generate event handle
|
|
|
1781
1781
|
if (o.target === "client") {
|
|
1782
1782
|
if (
|
|
1783
1783
|
// The preloader has to stay in a separate chunk if it's a client build
|
|
1784
|
-
|
|
1785
|
-
y.endsWith("@qwik.dev/core/build") || /[/\\](core|qwik)[/\\]dist[/\\]preloader\.[cm]js$/.test(y) || y === "\0vite/preload-helper.js"
|
|
1784
|
+
y.endsWith("@qwik.dev/core/build") || /[/\\](core|qwik)[/\\]dist[/\\]preloader\.[cm]js$/.test(y)
|
|
1786
1785
|
)
|
|
1787
1786
|
return "qwik-preloader";
|
|
1788
1787
|
if (
|
|
@@ -1793,42 +1792,42 @@ Without the manifest, the SSR renderer will not be able to generate event handle
|
|
|
1793
1792
|
if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(y))
|
|
1794
1793
|
return "qwik-loader";
|
|
1795
1794
|
}
|
|
1796
|
-
const
|
|
1797
|
-
if (
|
|
1798
|
-
const P =
|
|
1795
|
+
const E = p(y);
|
|
1796
|
+
if (E) {
|
|
1797
|
+
const P = E.meta.segment;
|
|
1799
1798
|
if (P) {
|
|
1800
1799
|
if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(P.ctxName))
|
|
1801
1800
|
return null;
|
|
1802
|
-
const { hash:
|
|
1803
|
-
if (
|
|
1804
|
-
return
|
|
1801
|
+
const { hash: C } = P, S = o.entryStrategy.manual?.[C] || P.entry;
|
|
1802
|
+
if (S)
|
|
1803
|
+
return S;
|
|
1805
1804
|
}
|
|
1806
1805
|
}
|
|
1807
1806
|
return null;
|
|
1808
1807
|
};
|
|
1809
|
-
async function sn(y, p,
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1808
|
+
async function sn(y, p, E, P) {
|
|
1809
|
+
const S = await X(p).generateManifest(P);
|
|
1810
|
+
S.platform = {
|
|
1812
1811
|
...P?.platform,
|
|
1813
1812
|
rollup: y.meta?.rollupVersion || "",
|
|
1814
1813
|
env: I.sys.env,
|
|
1815
1814
|
os: I.sys.os
|
|
1816
|
-
}, I.sys.env === "node" && (
|
|
1817
|
-
const
|
|
1815
|
+
}, I.sys.env === "node" && (S.platform.node = process.versions.node);
|
|
1816
|
+
const q = yn(S, E), D = y.emitFile({
|
|
1818
1817
|
type: "asset",
|
|
1819
1818
|
name: "bundle-graph.json",
|
|
1820
|
-
source: JSON.stringify(
|
|
1821
|
-
}),
|
|
1822
|
-
|
|
1819
|
+
source: JSON.stringify(q)
|
|
1820
|
+
}), U = y.getFileName(D);
|
|
1821
|
+
S.bundleGraphAsset = U, S.assets[U] = {
|
|
1823
1822
|
name: "bundle-graph.json",
|
|
1824
|
-
size:
|
|
1823
|
+
size: q.length
|
|
1825
1824
|
};
|
|
1826
|
-
const L = JSON.stringify(
|
|
1825
|
+
const L = JSON.stringify(S, null, " ");
|
|
1827
1826
|
return y.emitFile({
|
|
1828
1827
|
fileName: Ve,
|
|
1829
1828
|
type: "asset",
|
|
1830
1829
|
source: L
|
|
1831
|
-
}), typeof o.manifestOutput == "function" && await o.manifestOutput(
|
|
1830
|
+
}), typeof o.manifestOutput == "function" && await o.manifestOutput(S), typeof o.transformedModuleOutput == "function" && await o.transformedModuleOutput(ce()), S;
|
|
1832
1831
|
}
|
|
1833
1832
|
return {
|
|
1834
1833
|
buildStart: k,
|
|
@@ -1841,14 +1840,14 @@ Without the manifest, the SSR renderer will not be able to generate event handle
|
|
|
1841
1840
|
getTransformedOutputs: ce,
|
|
1842
1841
|
init: b,
|
|
1843
1842
|
load: F,
|
|
1844
|
-
debug:
|
|
1843
|
+
debug: M,
|
|
1845
1844
|
log: z,
|
|
1846
1845
|
normalizeOptions: T,
|
|
1847
1846
|
normalizePath: A,
|
|
1848
1847
|
onDiagnostics: de,
|
|
1849
|
-
resolveId:
|
|
1850
|
-
transform:
|
|
1851
|
-
validateSource:
|
|
1848
|
+
resolveId: O,
|
|
1849
|
+
transform: K,
|
|
1850
|
+
validateSource: j,
|
|
1852
1851
|
setSourceMapSupport: nn,
|
|
1853
1852
|
configureServer: w,
|
|
1854
1853
|
hotUpdate: rn,
|
|
@@ -1860,12 +1859,12 @@ const nr = (t) => (e) => typeof e == "string" ? Tn(t.os) ? (e.startsWith("\\\\?\
|
|
|
1860
1859
|
function rr(t) {
|
|
1861
1860
|
return t.isEntry || t.segment;
|
|
1862
1861
|
}
|
|
1863
|
-
const ir = {
|
|
1862
|
+
const ir = (t) => t.startsWith("virtual:"), or = {
|
|
1864
1863
|
".jsx": !0,
|
|
1865
1864
|
".ts": !0,
|
|
1866
1865
|
".tsx": !0
|
|
1867
|
-
}, Zt = /\.qwik\.[mc]?js$/, we = "@qwik.dev/core", be = "@qwik.dev/core/internal", se = "@qwik.dev/core/build", ot = "@qwik.dev/core/jsx-runtime", st = "@qwik.dev/core/jsx-dev-runtime", He = "@qwik.dev/core/server", oe = "@qwik-client-manifest", Ze = "@qwik.dev/core/preloader", ke = "@qwik-handlers",
|
|
1868
|
-
async function
|
|
1866
|
+
}, Zt = /\.qwik\.[mc]?js$/, we = "@qwik.dev/core", be = "@qwik.dev/core/internal", se = "@qwik.dev/core/build", ot = "@qwik.dev/core/jsx-runtime", st = "@qwik.dev/core/jsx-dev-runtime", He = "@qwik.dev/core/server", oe = "@qwik-client-manifest", Ze = "@qwik.dev/core/preloader", ke = "@qwik-handlers", sr = "src", _t = "dist", ar = "server", lr = "lib", Ve = "q-manifest.json", Ge = "__QWIK_MANIFEST__";
|
|
1867
|
+
async function cr(t, e, n) {
|
|
1869
1868
|
if (t.env === "browsermain" || t.env === "webworker")
|
|
1870
1869
|
return;
|
|
1871
1870
|
const r = await t.dynamicImport("node:fs");
|
|
@@ -1882,7 +1881,7 @@ async function lr(t, e, n) {
|
|
|
1882
1881
|
i = a;
|
|
1883
1882
|
}
|
|
1884
1883
|
}
|
|
1885
|
-
function
|
|
1884
|
+
function Wi(t = {}) {
|
|
1886
1885
|
const e = Xt(t.optimizerOptions);
|
|
1887
1886
|
return {
|
|
1888
1887
|
name: "rollup-plugin-qwik",
|
|
@@ -1943,7 +1942,7 @@ function zi(t = {}) {
|
|
|
1943
1942
|
}
|
|
1944
1943
|
};
|
|
1945
1944
|
}
|
|
1946
|
-
async function
|
|
1945
|
+
async function dr(t, e, n, r) {
|
|
1947
1946
|
return Array.isArray(e) ? (e.length || e.push({}), await Promise.all(
|
|
1948
1947
|
e.map(async (i) => ({
|
|
1949
1948
|
...await at(t, i, n),
|
|
@@ -1954,8 +1953,8 @@ async function cr(t, e, n, r) {
|
|
|
1954
1953
|
dir: r || e?.dir
|
|
1955
1954
|
};
|
|
1956
1955
|
}
|
|
1957
|
-
const
|
|
1958
|
-
const r =
|
|
1956
|
+
const ur = (t) => t ? `${t.replace(/\/+$/, "")}/` : "", hr = (t) => `${ur(t)}build/`, fr = (t, e, n) => {
|
|
1957
|
+
const r = hr(t);
|
|
1959
1958
|
return e.buildMode === "production" && !e.debug ? `${r}q-[hash].js` : (i) => {
|
|
1960
1959
|
if (i.moduleIds?.some((l) => /core\.(prod|min)\.mjs$/.test(l)))
|
|
1961
1960
|
return `${r}core.js`;
|
|
@@ -1968,7 +1967,7 @@ const dr = (t) => t ? `${t.replace(/\/+$/, "")}/` : "", ur = (t) => `${dr(t)}bui
|
|
|
1968
1967
|
async function at(t, e, n) {
|
|
1969
1968
|
const r = { ...e }, i = t.getOptions(), s = t.getOptimizer(), a = t.manualChunks;
|
|
1970
1969
|
r.assetFileNames || (r.assetFileNames = `${n ? `${i.assetsDir}/` : ""}assets/[hash]-[name].[ext]`);
|
|
1971
|
-
const l =
|
|
1970
|
+
const l = fr(n ? `${i.assetsDir}` : "", i, s);
|
|
1972
1971
|
if (i.target === "client") {
|
|
1973
1972
|
r.entryFileNames || (r.entryFileNames = l), r.chunkFileNames || (r.chunkFileNames = l), r.format = "es";
|
|
1974
1973
|
const o = r.manualChunks;
|
|
@@ -1978,7 +1977,7 @@ async function at(t, e, n) {
|
|
|
1978
1977
|
} else
|
|
1979
1978
|
r.chunkFileNames || (r.chunkFileNames = l);
|
|
1980
1979
|
r.dir || (r.dir = i.outDir), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
|
|
1981
|
-
const c = await
|
|
1980
|
+
const c = await cr(s.sys, "rollup", s.sys.cwd());
|
|
1982
1981
|
if (c)
|
|
1983
1982
|
try {
|
|
1984
1983
|
const g = await (await s.sys.dynamicImport("node:fs")).promises.readFile(c, "utf-8"), m = JSON.parse(g), b = String(m?.version || ""), [h, d, f] = b.split(".").map((w) => parseInt(w, 10));
|
|
@@ -2001,7 +2000,7 @@ function Je(t, e) {
|
|
|
2001
2000
|
stack: ""
|
|
2002
2001
|
});
|
|
2003
2002
|
}
|
|
2004
|
-
const fr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikViteLog=!0,console.debug("%c⭐️ Qwik Dev SSR Mode","background: #0c75d2; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;","App is running in SSR development mode!\\n - Additional JS is loaded by Vite for debugging and live reloading\\n - Rendering performance might not be optimal\\n - Delayed interactivity because prefetching is disabled\\n - Vite dev bundles do not represent production output\\n\\nProduction build can be tested running 'npm run preview'"))`, pr = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`,{cache:"no-cache"}).then(e=>{r.style.removeProperty("cursor"),e.blob()})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', gr = `if("undefined"!=typeof HTMLElement){class e extends HTMLElement{get _root(){return this.shadowRoot||this}constructor(){super(),this.state={},this.props||(this.props={}),this.componentProps=["children","error"],this.nodesToDestroy=[],this.pendingUpdate=!1,this.attachShadow({mode:"open"})}destroyAnyNodes(){this.nodesToDestroy.forEach(e=>e.remove()),this.nodesToDestroy=[]}connectedCallback(){this.getAttributeNames().forEach(e=>{const t=e.replace(/-/g,""),o=new RegExp(t,"i");this.componentProps.forEach(t=>{if(o.test(t)){const o=this.getAttribute(e);this.props[t]!==o&&(this.props[t]=o)}})}),this._root.innerHTML='\\n\\n <template data-el="show-errored-host">\\n <div class="error">\\n <template data-el="div-errored-host-2">\\n \\x3c!-- String(props.error) --\\x3e\\n </template>\\n </div>\\n </template>\\n\\n <div class="arrow">👇 Uncaught error happened here 👇\\n <span class="dev-tools">DevTools: Cmd+Alt+I</span>\\n </div>\\n <div class="div">\\n <slot></slot>\\n </div>\\n\\n <style>\\n .error {\\n border-radius: 5px 5px 0px 0;\\n background: black;\\n color: white;\\n font-family: monospace;\\n font-size: 12px;\\n margin: 0;\\n padding: 10px;\\n }\\n .arrow {\\n background: #f47e81;\\n color: black;\\n font-size: 14px;\\n padding: 10px;\\n text-align: center;\\n font-family: sans-serif;\\n }\\n .dev-tools {\\n background: red;\\n padding: 2px 5px;\\n border-radius: 3px;\\n font-weight: 800;\\n }\\n .div {\\n outline: 5px solid red;\\n border-radius: 10px;\\n }\\n </style>',this.pendingUpdate=!0,this.render(),this.onMount(),this.pendingUpdate=!1,this.update()}showContent(e){const t=e.content.cloneNode(!0);Array.from(t.childNodes).forEach(t=>{e?.scope&&(t.scope=e.scope),e?.context&&(t.context=e.context),this.nodesToDestroy.push(t)}),e.after(t)}onMount(){}onUpdate(){}update(){!0!==this.pendingUpdate&&(this.pendingUpdate=!0,this.render(),this.onUpdate(),this.pendingUpdate=!1)}render(){this.destroyAnyNodes(),this.updateBindings()}updateBindings(){this._root.querySelectorAll("[data-el='show-errored-host']").forEach(e=>{this.props.error&&this.showContent(e)}),this._root.querySelectorAll("[data-el='div-errored-host-2']").forEach(e=>{this.renderTextNode(e,String(this.props.error))})}renderTextNode(e,t){const o=document.createTextNode(t);e?.scope&&(o.scope=e.scope),e?.context&&(o.context=e.context),e.after(o),this.nodesToDestroy.push(e.nextSibling)}}customElements.define("errored-host",e),document.addEventListener("qerror",e=>{const t=customElements.get("vite-error-overlay");if(!t)return;const o=new t(e.detail.error);document.body.appendChild(o)})}`, mr = '[data-qwik-cls]{outline:2px solid red}[data-qwik-cls]:after{position:absolute;font-size:12px;content:"CLS " attr(data-qwik-cls);font-family:monospace;font-weight:700;background:red;color:#fff;margin:-2px;padding:1px;line-height:1;pointer-events:none}#qwik-image-warning-container{position:absolute!important;top:0!important;left:0!important;width:0!important;overflow:visible!important;height:0!important;pointer-events:none!important;contain:size layout style content;z-index:1}', wr = 'if("undefined"!=typeof document){const e=()=>{class e extends HTMLElement{#e=null;constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(document.createElement("template").innerHTML=globalThis.__TEMPLATE__);const e=this.shadowRoot.querySelector("dialog");this.shadowRoot.addEventListener("click",async t=>{const o=t.target;"BUTTON"===o.nodeName&&("action-btn"===o.id?this.#e&&(this.#e(),e.close()):"icon"===o.id?e.open?e.close():(e.className=function(e){const{x:t}=e.getBoundingClientRect();let o="right";return t>window.innerWidth-260&&(o="left"),`bottom ${o}`}(o),e.show()):"loc"===o.id&&o.dataset.url&&globalThis.qwikOpenInEditor(o.dataset.url))})}set loc(e){const t=this.shadowRoot.querySelector("#loc");t.textContent=e,globalThis.qwikOpenInEditor&&(t.dataset.url=e)}set header(e){this.shadowRoot.querySelector("#title").textContent=e}set message(e){this.shadowRoot.querySelector("#message").innerHTML=e}set actionFn(e){this.#e=e}set actionName(e){e&&(this.shadowRoot.querySelector(".action-container").innerHTML=`<button id="action-btn" type="button">${e}</button>`)}}customElements.define("image-warning",e);const t=new Map;let o=document.querySelector("#qwik-image-warning-container");o||(o=document.createElement("div"),o.id="qwik-image-warning-container",document.body.appendChild(o));let n=!1;const i=new Map;function r(e){let t=i.get(e);return void 0===t&&(t=async function(e){if(!/^(https?|file|capacitor):/.test(e))return;const t=new URL("/__image_info",location.href);return t.searchParams.set("url",e),fetch(t).then(e=>e.json()).catch(()=>null)}(e),i.set(e,t)),t}function a(e){return e.endsWith("px")}async function s(e){const i=t.get(e);e.isConnected?e.complete&&async function(e){const i=window.scrollX,s=window.scrollY,c=e.getBoundingClientRect(),d=e.currentSrc,l=await r(d);let h=t.get(e);const u=window.innerWidth>500;if(l&&u){let r=!1;const d=e.getAttribute("data-qwik-inspector"),u=c.width*c.height;if(!e.hasAttribute("width")||!e.hasAttribute("height")){n=!0;const t=getComputedStyle(e),o="auto"!==t.getPropertyValue("aspect-ratio").toString(),i=a(t.getPropertyValue("width").toString()),s=a(t.getPropertyValue("height").toString()),c="absolute"===t.getPropertyValue("position").toString();r=u>1e3&&!c&&!o&&(!i||!s)}const g=u<.5*(l.width&&l.height)&&"svg"!==l.type;if(n=!1,r||g){if(h||(h=document.createElement("image-warning"),o.appendChild(h),t.set(e,h)),h.style.top=c.top+s+"px",h.style.left=c.left+i+"px",h.style.width=c.width+"px",h.style.height=c.height+"px",h.info=l,h.loc=d,r){const t=`width="${l.width}" height="${l.height}"`;h.header="Perf: layout shift",h.message=`Image\'s size is unknown until it\'s loaded, <a href="https://web.dev/cls/" target="_blank" rel="noopener noreferrer">causing layout shift</a>.</p><p>To solve this problem set the width/height in the img tag:</p><pre><img <span>${t}</span></pre>`;const o=1===document.querySelectorAll(\'[data-qwik-inspector="\'+d+\'"]\').length;d&&(o?(h.actionName="Auto fix",h.actionFn=async()=>{const t=new URL("/__image_fix",location.href);t.searchParams.set("loc",d),t.searchParams.set("width",l.width),t.searchParams.set("height",l.height),e.srcset||(t.searchParams.set("src",e.currentSrc),t.searchParams.set("currentHref",location.href)),await fetch(t,{method:"POST"})}):(h.actionName="Open in editor",h.actionFn=async()=>{await navigator.clipboard.writeText(t),globalThis.qwikOpenInEditor(d)}))}else g&&(h.header="Perf: properly size image",h.message=`The image is too big, <a href="https://developer.chrome.com/en/docs/lighthouse/performance/uses-responsive-images/" target="_blank" rel="noopener noreferrer">hurting performance</a>, it should be resized to the size it\'s displayed at. The image dimensions are ${l.width} x ${l.height} but it\'s displayed at ${c.width}x${c.height}.</p>`);return}}h&&(h.remove(),t.delete(e))}(e):i&&(i.remove(),t.delete(e))}const c=new ResizeObserver(e=>{if(!n)for(const t of e)s(t.target)}),d=new MutationObserver(e=>{for(const t of e){for(const e of t.addedNodes)"IMG"===e.nodeName?c.observe(e):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{c.observe(e)});for(const e of t.removedNodes)"IMG"===e.nodeName?(s(e),c.unobserve(e)):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{s(e),c.unobserve(e)})}});let l,h=0;const u=()=>{setTimeout(()=>{l&&(l.disconnect(),h>.005&&console.error("Detected Layout Shift during page load",h)),d.observe(document.body,{childList:!0,subtree:!0}),document.body.querySelectorAll("img").forEach(e=>{c.observe(e)})},100)};"complete"===document.readyState?u():window.addEventListener("load",u);const g=1===performance?.navigation.type||performance.getEntriesByType("navigation").map(e=>e.type).includes("reload");"undefined"==typeof PerformanceObserver||g||(l=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{if(!e.hadRecentInput){if(e.value>.006)for(const t of e.sources)t.node&&1===t.node.nodeType&&"IMAGE-WARNING"!==t.node.nodeName&&t.node.setAttribute("data-qwik-cls",Number(e.value).toFixed(3));h+=e.value}})}),l.observe({type:"layout-shift",buffered:!0}))};document.addEventListener("load",e)}', br = `<style>
|
|
2003
|
+
const pr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikViteLog=!0,console.debug("%c⭐️ Qwik Dev SSR Mode","background: #0c75d2; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;","App is running in SSR development mode!\\n - Additional JS is loaded by Vite for debugging and live reloading\\n - Rendering performance might not be optimal\\n - Delayed interactivity because prefetching is disabled\\n - Vite dev bundles do not represent production output\\n\\nProduction build can be tested running 'npm run preview'"))`, gr = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`,{cache:"no-cache"}).then(e=>{r.style.removeProperty("cursor"),e.blob()})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', mr = `if("undefined"!=typeof HTMLElement){class e extends HTMLElement{get _root(){return this.shadowRoot||this}constructor(){super(),this.state={},this.props||(this.props={}),this.componentProps=["children","error"],this.nodesToDestroy=[],this.pendingUpdate=!1,this.attachShadow({mode:"open"})}destroyAnyNodes(){this.nodesToDestroy.forEach(e=>e.remove()),this.nodesToDestroy=[]}connectedCallback(){this.getAttributeNames().forEach(e=>{const t=e.replace(/-/g,""),o=new RegExp(t,"i");this.componentProps.forEach(t=>{if(o.test(t)){const o=this.getAttribute(e);this.props[t]!==o&&(this.props[t]=o)}})}),this._root.innerHTML='\\n\\n <template data-el="show-errored-host">\\n <div class="error">\\n <template data-el="div-errored-host-2">\\n \\x3c!-- String(props.error) --\\x3e\\n </template>\\n </div>\\n </template>\\n\\n <div class="arrow">👇 Uncaught error happened here 👇\\n <span class="dev-tools">DevTools: Cmd+Alt+I</span>\\n </div>\\n <div class="div">\\n <slot></slot>\\n </div>\\n\\n <style>\\n .error {\\n border-radius: 5px 5px 0px 0;\\n background: black;\\n color: white;\\n font-family: monospace;\\n font-size: 12px;\\n margin: 0;\\n padding: 10px;\\n }\\n .arrow {\\n background: #f47e81;\\n color: black;\\n font-size: 14px;\\n padding: 10px;\\n text-align: center;\\n font-family: sans-serif;\\n }\\n .dev-tools {\\n background: red;\\n padding: 2px 5px;\\n border-radius: 3px;\\n font-weight: 800;\\n }\\n .div {\\n outline: 5px solid red;\\n border-radius: 10px;\\n }\\n </style>',this.pendingUpdate=!0,this.render(),this.onMount(),this.pendingUpdate=!1,this.update()}showContent(e){const t=e.content.cloneNode(!0);Array.from(t.childNodes).forEach(t=>{e?.scope&&(t.scope=e.scope),e?.context&&(t.context=e.context),this.nodesToDestroy.push(t)}),e.after(t)}onMount(){}onUpdate(){}update(){!0!==this.pendingUpdate&&(this.pendingUpdate=!0,this.render(),this.onUpdate(),this.pendingUpdate=!1)}render(){this.destroyAnyNodes(),this.updateBindings()}updateBindings(){this._root.querySelectorAll("[data-el='show-errored-host']").forEach(e=>{this.props.error&&this.showContent(e)}),this._root.querySelectorAll("[data-el='div-errored-host-2']").forEach(e=>{this.renderTextNode(e,String(this.props.error))})}renderTextNode(e,t){const o=document.createTextNode(t);e?.scope&&(o.scope=e.scope),e?.context&&(o.context=e.context),e.after(o),this.nodesToDestroy.push(e.nextSibling)}}customElements.define("errored-host",e),document.addEventListener("qerror",e=>{const t=customElements.get("vite-error-overlay");if(!t)return;const o=new t(e.detail.error);document.body.appendChild(o)})}`, wr = '[data-qwik-cls]{outline:2px solid red}[data-qwik-cls]:after{position:absolute;font-size:12px;content:"CLS " attr(data-qwik-cls);font-family:monospace;font-weight:700;background:red;color:#fff;margin:-2px;padding:1px;line-height:1;pointer-events:none}#qwik-image-warning-container{position:absolute!important;top:0!important;left:0!important;width:0!important;overflow:visible!important;height:0!important;pointer-events:none!important;contain:size layout style content;z-index:1}', br = 'if("undefined"!=typeof document){const e=()=>{class e extends HTMLElement{#e=null;constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(document.createElement("template").innerHTML=globalThis.__TEMPLATE__);const e=this.shadowRoot.querySelector("dialog");this.shadowRoot.addEventListener("click",async t=>{const o=t.target;"BUTTON"===o.nodeName&&("action-btn"===o.id?this.#e&&(this.#e(),e.close()):"icon"===o.id?e.open?e.close():(e.className=function(e){const{x:t}=e.getBoundingClientRect();let o="right";return t>window.innerWidth-260&&(o="left"),`bottom ${o}`}(o),e.show()):"loc"===o.id&&o.dataset.url&&globalThis.qwikOpenInEditor(o.dataset.url))})}set loc(e){const t=this.shadowRoot.querySelector("#loc");t.textContent=e,globalThis.qwikOpenInEditor&&(t.dataset.url=e)}set header(e){this.shadowRoot.querySelector("#title").textContent=e}set message(e){this.shadowRoot.querySelector("#message").innerHTML=e}set actionFn(e){this.#e=e}set actionName(e){e&&(this.shadowRoot.querySelector(".action-container").innerHTML=`<button id="action-btn" type="button">${e}</button>`)}}customElements.define("image-warning",e);const t=new Map;let o=document.querySelector("#qwik-image-warning-container");o||(o=document.createElement("div"),o.id="qwik-image-warning-container",document.body.appendChild(o));let n=!1;const i=new Map;function r(e){let t=i.get(e);return void 0===t&&(t=async function(e){if(!/^(https?|file|capacitor):/.test(e))return;const t=new URL("/__image_info",location.href);return t.searchParams.set("url",e),fetch(t).then(e=>e.json()).catch(()=>null)}(e),i.set(e,t)),t}function a(e){return e.endsWith("px")}async function s(e){const i=t.get(e);e.isConnected?e.complete&&async function(e){const i=window.scrollX,s=window.scrollY,c=e.getBoundingClientRect(),d=e.currentSrc,l=await r(d);let h=t.get(e);const u=window.innerWidth>500;if(l&&u){let r=!1;const d=e.getAttribute("data-qwik-inspector"),u=c.width*c.height;if(!e.hasAttribute("width")||!e.hasAttribute("height")){n=!0;const t=getComputedStyle(e),o="auto"!==t.getPropertyValue("aspect-ratio").toString(),i=a(t.getPropertyValue("width").toString()),s=a(t.getPropertyValue("height").toString()),c="absolute"===t.getPropertyValue("position").toString();r=u>1e3&&!c&&!o&&(!i||!s)}const g=u<.5*(l.width&&l.height)&&"svg"!==l.type;if(n=!1,r||g){if(h||(h=document.createElement("image-warning"),o.appendChild(h),t.set(e,h)),h.style.top=c.top+s+"px",h.style.left=c.left+i+"px",h.style.width=c.width+"px",h.style.height=c.height+"px",h.info=l,h.loc=d,r){const t=`width="${l.width}" height="${l.height}"`;h.header="Perf: layout shift",h.message=`Image\'s size is unknown until it\'s loaded, <a href="https://web.dev/cls/" target="_blank" rel="noopener noreferrer">causing layout shift</a>.</p><p>To solve this problem set the width/height in the img tag:</p><pre><img <span>${t}</span></pre>`;const o=1===document.querySelectorAll(\'[data-qwik-inspector="\'+d+\'"]\').length;d&&(o?(h.actionName="Auto fix",h.actionFn=async()=>{const t=new URL("/__image_fix",location.href);t.searchParams.set("loc",d),t.searchParams.set("width",l.width),t.searchParams.set("height",l.height),e.srcset||(t.searchParams.set("src",e.currentSrc),t.searchParams.set("currentHref",location.href)),await fetch(t,{method:"POST"})}):(h.actionName="Open in editor",h.actionFn=async()=>{await navigator.clipboard.writeText(t),globalThis.qwikOpenInEditor(d)}))}else g&&(h.header="Perf: properly size image",h.message=`The image is too big, <a href="https://developer.chrome.com/en/docs/lighthouse/performance/uses-responsive-images/" target="_blank" rel="noopener noreferrer">hurting performance</a>, it should be resized to the size it\'s displayed at. The image dimensions are ${l.width} x ${l.height} but it\'s displayed at ${c.width}x${c.height}.</p>`);return}}h&&(h.remove(),t.delete(e))}(e):i&&(i.remove(),t.delete(e))}const c=new ResizeObserver(e=>{if(!n)for(const t of e)s(t.target)}),d=new MutationObserver(e=>{for(const t of e){for(const e of t.addedNodes)"IMG"===e.nodeName?c.observe(e):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{c.observe(e)});for(const e of t.removedNodes)"IMG"===e.nodeName?(s(e),c.unobserve(e)):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{s(e),c.unobserve(e)})}});let l,h=0;const u=()=>{setTimeout(()=>{l&&(l.disconnect(),h>.005&&console.error("Detected Layout Shift during page load",h)),d.observe(document.body,{childList:!0,subtree:!0}),document.body.querySelectorAll("img").forEach(e=>{c.observe(e)})},100)};"complete"===document.readyState?u():window.addEventListener("load",u);const g=1===performance?.navigation.type||performance.getEntriesByType("navigation").map(e=>e.type).includes("reload");"undefined"==typeof PerformanceObserver||g||(l=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{if(!e.hadRecentInput){if(e.value>.006)for(const t of e.sources)t.node&&1===t.node.nodeType&&"IMAGE-WARNING"!==t.node.nodeName&&t.node.setAttribute("data-qwik-cls",Number(e.value).toFixed(3));h+=e.value}})}),l.observe({type:"layout-shift",buffered:!0}))};document.addEventListener("load",e)}', vr = `<style>
|
|
2005
2004
|
:host {
|
|
2006
2005
|
position: absolute;
|
|
2007
2006
|
border: 1px solid red;
|
|
@@ -2165,8 +2164,8 @@ const fr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
|
|
|
2165
2164
|
<p class="action-container"></p>
|
|
2166
2165
|
</div>
|
|
2167
2166
|
</dialog>
|
|
2168
|
-
`,
|
|
2169
|
-
async function
|
|
2167
|
+
`, yr = `vite-error-overlay{--color-bright: rgba(255, 255, 255, .8);--color-yellow: rgba(255, 246, 85, .8);--qwik-dark-blue: #006ce9;--qwik-light-blue: #3ec2f7;--qwik-light-purple: #ac7ff4;--qwik-dark-purple: #713fc2;--yellow: #fff;--purple: var(--color-bright);--red: var(--qwik-light-blue);--vertical-box-spacing: 15px;--box-padding: 20px;--box-margin: 0 0 var(--vertical-box-spacing) 0;--box-background: rgba(0, 0, 0, .5);--box-border-radius: 8px}vite-error-overlay::part(backdrop){background:#020b1199}vite-error-overlay::part(window){background:transparent;border:none;box-shadow:none;box-sizing:border-box;margin:50px auto;max-width:1200px;padding:var(--box-padding);width:90%}vite-error-overlay::part(message){display:flex;flex-direction:column;font-size:1.6rem;line-height:1.7;margin-bottom:30px}vite-error-overlay::part(plugin){font-size:.8rem;font-weight:100}vite-error-overlay::part(file),vite-error-overlay::part(frame),vite-error-overlay::part(stack),vite-error-overlay::part(tip){background:var(--box-background);border-left:5px solid transparent;border-radius:var(--box-border-radius);margin:var(--box-margin);min-height:50px;padding:var(--box-padding);position:relative}vite-error-overlay::part(file){border-left-color:#19b6f6;color:var(--color-bright)}vite-error-overlay::part(frame){border-left-color:var(--color-yellow);color:var(--color-yellow)}vite-error-overlay::part(stack){border-left-color:#ff5722}vite-error-overlay::part(tip){border-top:none;border-left-color:#ac7ff4}vite-error-overlay::part(file):before,vite-error-overlay::part(frame):before,vite-error-overlay::part(stack):before{border-bottom:1px solid #222;color:var(--color-bright);display:block;margin-bottom:15px;padding-bottom:5px;padding-left:30px;font-size:.8rem}vite-error-overlay::part(file):before{content:"File"}vite-error-overlay::part(frame):before{content:"Frame"}vite-error-overlay::part(stack):before{content:"Stack Trace"}vite-error-overlay::part(file):after,vite-error-overlay::part(frame):after,vite-error-overlay::part(stack):after{content:"";display:block;height:20px;position:absolute;left:var(--box-padding);top:var(--box-padding);width:20px}vite-error-overlay::part(file):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3EFile-Generic%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='File-Generic'%3E%3Crect id='Rectangle' fill-rule='nonzero' x='0' y='0' width='24' height='24'%3E%3C/rect%3E%3Cpath d='M4 5 C4 3.89543 4.89543 3 6 3 L15.1716 3 C15.702 3 16.2107 3.21071 16.5858 3.58579 L19.4142 6.41421 C19.7893 6.78929 20 7.29799 20 7.82843 L20 19 C20 20.1046 19.1046 21 18 21 L6 21 C4.89543 21 4 20.1046 4 19 L4 5 Z' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3Cpath d='M15 4 L15 6 C15 7.10457 15.8954 8 17 8 L19 8' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}vite-error-overlay::part(frame):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.6602 2.84952H19.1516C20.2555 2.84952 21.1504 3.74444 21.1504 4.84839V8.3398' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M2.84949 8.33981L2.84949 4.8484C2.84949 3.74446 3.74441 2.84953 4.84836 2.84953L8.33977 2.84953' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M21.1505 15.6602L21.1505 19.1516C21.1505 20.2555 20.2556 21.1505 19.1516 21.1505L15.6602 21.1505' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M8.33984 21.1505L4.84843 21.1505C3.74449 21.1505 2.84956 20.2555 2.84956 19.1516L2.84956 15.6602' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3C/svg%3E")}vite-error-overlay::part(stack):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.78 20H9.78C7.98 20 4.58 19.09 4.58 15.64C4.58 12.19 7.98 11.28 9.78 11.28H14.22C14.37 11.28 17.92 11.23 17.92 8.42C17.92 5.61 14.37 5.56 14.22 5.56H9.22C9.02109 5.56 8.83032 5.48098 8.68967 5.34033C8.54902 5.19968 8.47 5.00891 8.47 4.81C8.47 4.61109 8.54902 4.42032 8.68967 4.27967C8.83032 4.13902 9.02109 4.06 9.22 4.06H14.22C16.02 4.06 19.42 4.97 19.42 8.42C19.42 11.87 16.02 12.78 14.22 12.78H9.78C9.63 12.78 6.08 12.83 6.08 15.64C6.08 18.45 9.63 18.5 9.78 18.5H14.78C14.9789 18.5 15.1697 18.579 15.3103 18.7197C15.451 18.8603 15.53 19.0511 15.53 19.25C15.53 19.4489 15.451 19.6397 15.3103 19.7803C15.1697 19.921 14.9789 20 14.78 20Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M6.44 8.31C5.74314 8.30407 5.06363 8.09202 4.48708 7.70056C3.91054 7.30909 3.46276 6.75573 3.20018 6.11021C2.93759 5.46469 2.87195 4.75589 3.01153 4.07312C3.1511 3.39036 3.48965 2.76418 3.9845 2.2735C4.47935 1.78281 5.10837 1.44958 5.79229 1.31579C6.47622 1.182 7.18444 1.25363 7.82771 1.52167C8.47099 1.78971 9.02054 2.24215 9.40711 2.82199C9.79368 3.40182 9.99998 4.08311 10 4.78C10 5.2461 9.90773 5.70759 9.72846 6.13783C9.54919 6.56808 9.28648 6.95856 8.95551 7.28675C8.62453 7.61494 8.23184 7.87433 7.80009 8.04995C7.36834 8.22558 6.90609 8.31396 6.44 8.31ZM6.44 2.75C6.04444 2.75 5.65776 2.86729 5.32886 3.08706C4.99996 3.30682 4.74362 3.61918 4.59224 3.98463C4.44087 4.35008 4.40126 4.75221 4.47843 5.14018C4.5556 5.52814 4.74609 5.8845 5.02579 6.16421C5.3055 6.44391 5.66186 6.6344 6.04982 6.71157C6.43779 6.78874 6.83992 6.74913 7.20537 6.59776C7.57082 6.44638 7.88318 6.19003 8.10294 5.86114C8.32271 5.53224 8.44 5.14556 8.44 4.75C8.44 4.48735 8.38827 4.22728 8.28776 3.98463C8.18725 3.74198 8.03993 3.5215 7.85422 3.33578C7.6685 3.15007 7.44802 3.00275 7.20537 2.90224C6.96272 2.80173 6.70265 2.75 6.44 2.75Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M17.56 22.75C16.8614 22.752 16.1779 22.5466 15.5961 22.1599C15.0143 21.7733 14.5603 21.2227 14.2916 20.5778C14.0229 19.933 13.9515 19.2229 14.0866 18.5375C14.2217 17.8521 14.5571 17.2221 15.0504 16.7275C15.5437 16.2328 16.1726 15.8956 16.8577 15.7586C17.5427 15.6215 18.253 15.6909 18.8986 15.9577C19.5442 16.2246 20.0961 16.6771 20.4844 17.2578C20.8727 17.8385 21.08 18.5214 21.08 19.22C21.08 20.1545 20.7095 21.0508 20.0496 21.7125C19.3898 22.3743 18.4945 22.7473 17.56 22.75ZM17.56 17.19C17.1644 17.19 16.7778 17.3073 16.4489 17.5271C16.12 17.7468 15.8636 18.0592 15.7122 18.4246C15.5609 18.7901 15.5213 19.1922 15.5984 19.5802C15.6756 19.9681 15.8661 20.3245 16.1458 20.6042C16.4255 20.8839 16.7819 21.0744 17.1698 21.1516C17.5578 21.2287 17.9599 21.1891 18.3254 21.0377C18.6908 20.8864 19.0032 20.63 19.2229 20.3011C19.4427 19.9722 19.56 19.5856 19.56 19.19C19.56 18.6596 19.3493 18.1508 18.9742 17.7758C18.5991 17.4007 18.0904 17.19 17.56 17.19Z' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E")}vite-error-overlay::part(tip):before{content:"Not sure how to solve this? Visit https://qwik.dev or connect with the community on Discord.";display:block;margin-bottom:1em}`, xr = "#qwik-inspector-overlay{position:fixed;background:#18b6f645;pointer-events:none;box-sizing:border-box;border:2px solid rgba(172,126,244,.46);border-radius:4px;contain:strict;cursor:pointer;z-index:999999}#qwik-inspector-info-popup{position:fixed;bottom:10px;right:10px;font-family:monospace;background:#000000c2;color:#fff;padding:10px 20px;border-radius:8px;box-shadow:0 20px 25px -5px #00000057,0 8px 10px -6px #0000003d;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);-webkit-animation:fadeOut .3s 3s ease-in-out forwards;animation:fadeOut .3s 3s ease-in-out forwards;z-index:999999;contain:layout}#qwik-inspector-info-popup p{margin:0}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0;visibility:hidden}}";
|
|
2168
|
+
async function kr(t, e, n, r) {
|
|
2170
2169
|
const i = await n.dynamicImport("node:fs"), s = await n.dynamicImport("node:url"), l = ["mjs", "cjs", "js"].map(
|
|
2171
2170
|
(c) => r.join(e, `entry.preview.${c}`)
|
|
2172
2171
|
).find((c) => i.existsSync(c));
|
|
@@ -2199,25 +2198,25 @@ function et(t, e) {
|
|
|
2199
2198
|
}), r.end(e);
|
|
2200
2199
|
});
|
|
2201
2200
|
}
|
|
2202
|
-
const
|
|
2201
|
+
const Er = (t, e) => {
|
|
2203
2202
|
const n = [
|
|
2204
|
-
{ tag: "style", children: vr, injectTo: "body" },
|
|
2205
2203
|
{ tag: "style", children: yr, injectTo: "body" },
|
|
2206
|
-
{ tag: "
|
|
2207
|
-
{ tag: "script", attrs: { type: "module" }, children:
|
|
2204
|
+
{ tag: "style", children: xr, injectTo: "body" },
|
|
2205
|
+
{ tag: "script", attrs: { type: "module" }, children: mr, injectTo: "body" },
|
|
2206
|
+
{ tag: "script", attrs: { type: "module" }, children: pr, injectTo: "body" }
|
|
2208
2207
|
];
|
|
2209
2208
|
if ((t.devTools?.imageDevTools ?? !0) && n.push(
|
|
2210
2209
|
{
|
|
2211
2210
|
tag: "style",
|
|
2212
|
-
children:
|
|
2211
|
+
children: wr,
|
|
2213
2212
|
injectTo: "body"
|
|
2214
2213
|
},
|
|
2215
2214
|
{
|
|
2216
2215
|
tag: "script",
|
|
2217
2216
|
attrs: { type: "module" },
|
|
2218
|
-
children:
|
|
2217
|
+
children: br.replace(
|
|
2219
2218
|
"globalThis.__TEMPLATE__",
|
|
2220
|
-
JSON.stringify(
|
|
2219
|
+
JSON.stringify(vr)
|
|
2221
2220
|
),
|
|
2222
2221
|
injectTo: "body"
|
|
2223
2222
|
}
|
|
@@ -2226,7 +2225,7 @@ const kr = (t, e) => {
|
|
|
2226
2225
|
e.endsWith("/") && (e = e.slice(0, -1)), n.push({
|
|
2227
2226
|
tag: "script",
|
|
2228
2227
|
attrs: { type: "module" },
|
|
2229
|
-
children:
|
|
2228
|
+
children: gr.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(e)),
|
|
2230
2229
|
injectTo: "body"
|
|
2231
2230
|
});
|
|
2232
2231
|
}
|
|
@@ -2235,13 +2234,13 @@ const kr = (t, e) => {
|
|
|
2235
2234
|
function H(t) {
|
|
2236
2235
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
2237
2236
|
}
|
|
2238
|
-
var
|
|
2237
|
+
var Ee = {}, tt = {}, Ct;
|
|
2239
2238
|
function G() {
|
|
2240
2239
|
return Ct || (Ct = 1, (function(t) {
|
|
2241
2240
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.findBox = t.readUInt = t.readUInt32LE = t.readUInt32BE = t.readInt32LE = t.readUInt24LE = t.readUInt16LE = t.readUInt16BE = t.readInt16LE = t.toHexString = t.toUTF8String = void 0;
|
|
2242
2241
|
const e = new TextDecoder(), n = (f, u = 0, w = f.length) => e.decode(f.slice(u, w));
|
|
2243
2242
|
t.toUTF8String = n;
|
|
2244
|
-
const r = (f, u = 0, w = f.length) => f.slice(u, w).reduce((T,
|
|
2243
|
+
const r = (f, u = 0, w = f.length) => f.slice(u, w).reduce((T, Y) => T + ("0" + Y.toString(16)).slice(-2), "");
|
|
2245
2244
|
t.toHexString = r;
|
|
2246
2245
|
const i = (f, u = 0) => {
|
|
2247
2246
|
const w = f[u] + f[u + 1] * 256;
|
|
@@ -2268,8 +2267,8 @@ function G() {
|
|
|
2268
2267
|
};
|
|
2269
2268
|
function b(f, u, w, T) {
|
|
2270
2269
|
w = w || 0;
|
|
2271
|
-
const
|
|
2272
|
-
return m[
|
|
2270
|
+
const Y = T ? "BE" : "LE", j = "readUInt" + u + Y;
|
|
2271
|
+
return m[j](f, w);
|
|
2273
2272
|
}
|
|
2274
2273
|
t.readUInt = b;
|
|
2275
2274
|
function h(f, u) {
|
|
@@ -2298,20 +2297,20 @@ function G() {
|
|
|
2298
2297
|
}
|
|
2299
2298
|
var Tt;
|
|
2300
2299
|
function Sr() {
|
|
2301
|
-
if (Tt) return
|
|
2302
|
-
Tt = 1, Object.defineProperty(
|
|
2300
|
+
if (Tt) return Ee;
|
|
2301
|
+
Tt = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.BMP = void 0;
|
|
2303
2302
|
const t = G();
|
|
2304
|
-
return
|
|
2303
|
+
return Ee.BMP = {
|
|
2305
2304
|
validate: (e) => (0, t.toUTF8String)(e, 0, 2) === "BM",
|
|
2306
2305
|
calculate: (e) => ({
|
|
2307
2306
|
height: Math.abs((0, t.readInt32LE)(e, 22)),
|
|
2308
2307
|
width: (0, t.readUInt32LE)(e, 18)
|
|
2309
2308
|
})
|
|
2310
|
-
},
|
|
2309
|
+
}, Ee;
|
|
2311
2310
|
}
|
|
2312
|
-
var
|
|
2313
|
-
const
|
|
2314
|
-
var
|
|
2311
|
+
var Ir = Sr();
|
|
2312
|
+
const _r = /* @__PURE__ */ H(Ir);
|
|
2313
|
+
var Se = {}, Ie = {}, Pt;
|
|
2315
2314
|
function Vt() {
|
|
2316
2315
|
if (Pt) return Ie;
|
|
2317
2316
|
Pt = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.ICO = void 0;
|
|
@@ -2348,22 +2347,22 @@ function Vt() {
|
|
|
2348
2347
|
}, Ie;
|
|
2349
2348
|
}
|
|
2350
2349
|
var Nt;
|
|
2351
|
-
function
|
|
2352
|
-
if (Nt) return
|
|
2353
|
-
Nt = 1, Object.defineProperty(
|
|
2350
|
+
function Cr() {
|
|
2351
|
+
if (Nt) return Se;
|
|
2352
|
+
Nt = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.CUR = void 0;
|
|
2354
2353
|
const t = Vt(), e = G(), n = 2;
|
|
2355
|
-
return
|
|
2354
|
+
return Se.CUR = {
|
|
2356
2355
|
validate(r) {
|
|
2357
2356
|
const i = (0, e.readUInt16LE)(r, 0), s = (0, e.readUInt16LE)(r, 4);
|
|
2358
2357
|
return i !== 0 || s === 0 ? !1 : (0, e.readUInt16LE)(r, 2) === n;
|
|
2359
2358
|
},
|
|
2360
2359
|
calculate: (r) => t.ICO.calculate(r)
|
|
2361
|
-
},
|
|
2360
|
+
}, Se;
|
|
2362
2361
|
}
|
|
2363
|
-
var
|
|
2364
|
-
const
|
|
2362
|
+
var Tr = Cr();
|
|
2363
|
+
const Pr = /* @__PURE__ */ H(Tr);
|
|
2365
2364
|
var _e = {}, Dt;
|
|
2366
|
-
function
|
|
2365
|
+
function Nr() {
|
|
2367
2366
|
if (Dt) return _e;
|
|
2368
2367
|
Dt = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.DDS = void 0;
|
|
2369
2368
|
const t = G();
|
|
@@ -2375,10 +2374,10 @@ function Pr() {
|
|
|
2375
2374
|
})
|
|
2376
2375
|
}, _e;
|
|
2377
2376
|
}
|
|
2378
|
-
var
|
|
2379
|
-
const
|
|
2377
|
+
var Dr = Nr();
|
|
2378
|
+
const Lr = /* @__PURE__ */ H(Dr);
|
|
2380
2379
|
var Ce = {}, Lt;
|
|
2381
|
-
function
|
|
2380
|
+
function Or() {
|
|
2382
2381
|
if (Lt) return Ce;
|
|
2383
2382
|
Lt = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.GIF = void 0;
|
|
2384
2383
|
const t = G(), e = /^GIF8[79]a/;
|
|
@@ -2390,12 +2389,12 @@ function Lr() {
|
|
|
2390
2389
|
})
|
|
2391
2390
|
}, Ce;
|
|
2392
2391
|
}
|
|
2393
|
-
var Rr =
|
|
2394
|
-
const
|
|
2395
|
-
var Te = {},
|
|
2396
|
-
function
|
|
2397
|
-
if (
|
|
2398
|
-
|
|
2392
|
+
var Rr = Or();
|
|
2393
|
+
const Mr = /* @__PURE__ */ H(Rr);
|
|
2394
|
+
var Te = {}, Ot;
|
|
2395
|
+
function jr() {
|
|
2396
|
+
if (Ot) return Te;
|
|
2397
|
+
Ot = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.ICNS = void 0;
|
|
2399
2398
|
const t = G(), e = 8, n = 4, r = 4, i = {
|
|
2400
2399
|
ICON: 32,
|
|
2401
2400
|
"ICN#": 32,
|
|
@@ -2467,14 +2466,14 @@ function Mr() {
|
|
|
2467
2466
|
}
|
|
2468
2467
|
}, Te;
|
|
2469
2468
|
}
|
|
2470
|
-
var
|
|
2471
|
-
const
|
|
2469
|
+
var $r = jr();
|
|
2470
|
+
const Ur = /* @__PURE__ */ H($r);
|
|
2472
2471
|
var qr = Vt();
|
|
2473
|
-
const
|
|
2474
|
-
var Pe = {},
|
|
2475
|
-
function
|
|
2476
|
-
if (
|
|
2477
|
-
|
|
2472
|
+
const Br = /* @__PURE__ */ H(qr);
|
|
2473
|
+
var Pe = {}, Rt;
|
|
2474
|
+
function Fr() {
|
|
2475
|
+
if (Rt) return Pe;
|
|
2476
|
+
Rt = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.J2C = void 0;
|
|
2478
2477
|
const t = G();
|
|
2479
2478
|
return Pe.J2C = {
|
|
2480
2479
|
// TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
|
|
@@ -2485,10 +2484,10 @@ function Br() {
|
|
|
2485
2484
|
})
|
|
2486
2485
|
}, Pe;
|
|
2487
2486
|
}
|
|
2488
|
-
var
|
|
2489
|
-
const
|
|
2487
|
+
var Ar = Fr();
|
|
2488
|
+
const zr = /* @__PURE__ */ H(Ar);
|
|
2490
2489
|
var Ne = {}, Mt;
|
|
2491
|
-
function
|
|
2490
|
+
function Wr() {
|
|
2492
2491
|
if (Mt) return Ne;
|
|
2493
2492
|
Mt = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.JP2 = void 0;
|
|
2494
2493
|
const t = G();
|
|
@@ -2510,10 +2509,10 @@ function zr() {
|
|
|
2510
2509
|
}
|
|
2511
2510
|
}, Ne;
|
|
2512
2511
|
}
|
|
2513
|
-
var
|
|
2514
|
-
const
|
|
2512
|
+
var Hr = Wr();
|
|
2513
|
+
const Gr = /* @__PURE__ */ H(Hr);
|
|
2515
2514
|
var De = {}, jt;
|
|
2516
|
-
function
|
|
2515
|
+
function Qr() {
|
|
2517
2516
|
if (jt) return De;
|
|
2518
2517
|
jt = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.JPG = void 0;
|
|
2519
2518
|
const t = G(), e = "45786966", n = 2, r = 6, i = 2, s = "4d4d", a = "4949", l = 12, c = 2;
|
|
@@ -2528,11 +2527,11 @@ function Gr() {
|
|
|
2528
2527
|
}
|
|
2529
2528
|
function m(d, f) {
|
|
2530
2529
|
const w = r + 8, T = (0, t.readUInt)(d, 16, w, f);
|
|
2531
|
-
for (let
|
|
2532
|
-
const
|
|
2533
|
-
if (
|
|
2530
|
+
for (let Y = 0; Y < T; Y++) {
|
|
2531
|
+
const j = w + c + Y * l, I = j + l;
|
|
2532
|
+
if (j > d.length)
|
|
2534
2533
|
return;
|
|
2535
|
-
const v = d.slice(
|
|
2534
|
+
const v = d.slice(j, I);
|
|
2536
2535
|
if ((0, t.readUInt)(v, 16, 0, f) === 274)
|
|
2537
2536
|
return (0, t.readUInt)(v, 16, 2, f) !== 3 || (0, t.readUInt)(v, 32, 4, f) !== 1 ? void 0 : (0, t.readUInt)(v, 16, 8, f);
|
|
2538
2537
|
}
|
|
@@ -2571,10 +2570,10 @@ function Gr() {
|
|
|
2571
2570
|
}
|
|
2572
2571
|
}, De;
|
|
2573
2572
|
}
|
|
2574
|
-
var
|
|
2575
|
-
const
|
|
2573
|
+
var Kr = Qr();
|
|
2574
|
+
const Jr = /* @__PURE__ */ H(Kr);
|
|
2576
2575
|
var Le = {}, $t;
|
|
2577
|
-
function
|
|
2576
|
+
function Yr() {
|
|
2578
2577
|
if ($t) return Le;
|
|
2579
2578
|
$t = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.KTX = void 0;
|
|
2580
2579
|
const t = G();
|
|
@@ -2593,16 +2592,16 @@ function Jr() {
|
|
|
2593
2592
|
}
|
|
2594
2593
|
}, Le;
|
|
2595
2594
|
}
|
|
2596
|
-
var
|
|
2597
|
-
const
|
|
2598
|
-
var
|
|
2599
|
-
function
|
|
2600
|
-
if (
|
|
2601
|
-
|
|
2595
|
+
var Xr = Yr();
|
|
2596
|
+
const Zr = /* @__PURE__ */ H(Xr);
|
|
2597
|
+
var Oe = {}, Ut;
|
|
2598
|
+
function Vr() {
|
|
2599
|
+
if (Ut) return Oe;
|
|
2600
|
+
Ut = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.PNG = void 0;
|
|
2602
2601
|
const t = G(), e = `PNG\r
|
|
2603
2602
|
|
|
2604
2603
|
`, n = "IHDR", r = "CgBI";
|
|
2605
|
-
return
|
|
2604
|
+
return Oe.PNG = {
|
|
2606
2605
|
validate(i) {
|
|
2607
2606
|
if (e === (0, t.toUTF8String)(i, 1, 8)) {
|
|
2608
2607
|
let s = (0, t.toUTF8String)(i, 12, 16);
|
|
@@ -2621,14 +2620,14 @@ function Zr() {
|
|
|
2621
2620
|
width: (0, t.readUInt32BE)(i, 16)
|
|
2622
2621
|
};
|
|
2623
2622
|
}
|
|
2624
|
-
},
|
|
2623
|
+
}, Oe;
|
|
2625
2624
|
}
|
|
2626
|
-
var
|
|
2627
|
-
const
|
|
2628
|
-
var
|
|
2629
|
-
function
|
|
2630
|
-
if (
|
|
2631
|
-
|
|
2625
|
+
var ei = Vr();
|
|
2626
|
+
const ti = /* @__PURE__ */ H(ei);
|
|
2627
|
+
var Re = {}, qt;
|
|
2628
|
+
function ni() {
|
|
2629
|
+
if (qt) return Re;
|
|
2630
|
+
qt = 1, Object.defineProperty(Re, "__esModule", { value: !0 }), Re.PNM = void 0;
|
|
2632
2631
|
const t = G(), e = {
|
|
2633
2632
|
P1: "pbm/ascii",
|
|
2634
2633
|
P2: "pgm/ascii",
|
|
@@ -2673,18 +2672,18 @@ function ti() {
|
|
|
2673
2672
|
throw new TypeError("Invalid PAM");
|
|
2674
2673
|
}
|
|
2675
2674
|
};
|
|
2676
|
-
return
|
|
2675
|
+
return Re.PNM = {
|
|
2677
2676
|
validate: (r) => (0, t.toUTF8String)(r, 0, 2) in e,
|
|
2678
2677
|
calculate(r) {
|
|
2679
2678
|
const i = (0, t.toUTF8String)(r, 0, 2), s = e[i], a = (0, t.toUTF8String)(r, 3).split(/[\r\n]+/);
|
|
2680
2679
|
return (n[s] || n.default)(a);
|
|
2681
2680
|
}
|
|
2682
|
-
},
|
|
2681
|
+
}, Re;
|
|
2683
2682
|
}
|
|
2684
|
-
var
|
|
2685
|
-
const
|
|
2683
|
+
var ri = ni();
|
|
2684
|
+
const ii = /* @__PURE__ */ H(ri);
|
|
2686
2685
|
var Me = {}, Bt;
|
|
2687
|
-
function
|
|
2686
|
+
function oi() {
|
|
2688
2687
|
if (Bt) return Me;
|
|
2689
2688
|
Bt = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.PSD = void 0;
|
|
2690
2689
|
const t = G();
|
|
@@ -2696,10 +2695,10 @@ function ii() {
|
|
|
2696
2695
|
})
|
|
2697
2696
|
}, Me;
|
|
2698
2697
|
}
|
|
2699
|
-
var
|
|
2700
|
-
const
|
|
2698
|
+
var si = oi();
|
|
2699
|
+
const ai = /* @__PURE__ */ H(si);
|
|
2701
2700
|
var je = {}, Ft;
|
|
2702
|
-
function
|
|
2701
|
+
function li() {
|
|
2703
2702
|
if (Ft) return je;
|
|
2704
2703
|
Ft = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.SVG = void 0;
|
|
2705
2704
|
const t = G(), e = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, n = {
|
|
@@ -2773,10 +2772,10 @@ function ai() {
|
|
|
2773
2772
|
}
|
|
2774
2773
|
}, je;
|
|
2775
2774
|
}
|
|
2776
|
-
var
|
|
2777
|
-
const
|
|
2775
|
+
var ci = li();
|
|
2776
|
+
const di = /* @__PURE__ */ H(ci);
|
|
2778
2777
|
var $e = {}, At;
|
|
2779
|
-
function
|
|
2778
|
+
function ui() {
|
|
2780
2779
|
if (At) return $e;
|
|
2781
2780
|
At = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.TGA = void 0;
|
|
2782
2781
|
const t = G();
|
|
@@ -2792,12 +2791,12 @@ function di() {
|
|
|
2792
2791
|
}
|
|
2793
2792
|
}, $e;
|
|
2794
2793
|
}
|
|
2795
|
-
var
|
|
2796
|
-
const
|
|
2797
|
-
var
|
|
2798
|
-
function
|
|
2799
|
-
if (zt) return
|
|
2800
|
-
zt = 1, Object.defineProperty(
|
|
2794
|
+
var hi = ui();
|
|
2795
|
+
const fi = /* @__PURE__ */ H(hi);
|
|
2796
|
+
var Ue = {}, zt;
|
|
2797
|
+
function pi() {
|
|
2798
|
+
if (zt) return Ue;
|
|
2799
|
+
zt = 1, Object.defineProperty(Ue, "__esModule", { value: !0 }), Ue.WEBP = void 0;
|
|
2801
2800
|
const t = G();
|
|
2802
2801
|
function e(i) {
|
|
2803
2802
|
return {
|
|
@@ -2817,7 +2816,7 @@ function fi() {
|
|
|
2817
2816
|
width: (0, t.readInt16LE)(i, 6) & 16383
|
|
2818
2817
|
};
|
|
2819
2818
|
}
|
|
2820
|
-
return
|
|
2819
|
+
return Ue.WEBP = {
|
|
2821
2820
|
validate(i) {
|
|
2822
2821
|
const s = (0, t.toUTF8String)(i, 0, 4) === "RIFF", a = (0, t.toUTF8String)(i, 8, 12) === "WEBP", l = (0, t.toUTF8String)(i, 12, 15) === "VP8";
|
|
2823
2822
|
return s && a && l;
|
|
@@ -2837,14 +2836,14 @@ function fi() {
|
|
|
2837
2836
|
return n(i);
|
|
2838
2837
|
throw new TypeError("Invalid WebP");
|
|
2839
2838
|
}
|
|
2840
|
-
},
|
|
2839
|
+
}, Ue;
|
|
2841
2840
|
}
|
|
2842
|
-
var
|
|
2843
|
-
const
|
|
2844
|
-
var
|
|
2845
|
-
function
|
|
2846
|
-
if (Wt) return
|
|
2847
|
-
Wt = 1, Object.defineProperty(
|
|
2841
|
+
var gi = pi();
|
|
2842
|
+
const mi = /* @__PURE__ */ H(gi);
|
|
2843
|
+
var qe = {}, Wt;
|
|
2844
|
+
function wi() {
|
|
2845
|
+
if (Wt) return qe;
|
|
2846
|
+
Wt = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.HEIF = void 0;
|
|
2848
2847
|
const t = G(), e = {
|
|
2849
2848
|
avif: "avif",
|
|
2850
2849
|
mif1: "heif",
|
|
@@ -2857,7 +2856,7 @@ function mi() {
|
|
|
2857
2856
|
hevx: "heic"
|
|
2858
2857
|
// heic-sequence
|
|
2859
2858
|
};
|
|
2860
|
-
return
|
|
2859
|
+
return qe.HEIF = {
|
|
2861
2860
|
validate(n) {
|
|
2862
2861
|
if ((0, t.toUTF8String)(n, 4, 8) !== "ftyp")
|
|
2863
2862
|
return !1;
|
|
@@ -2874,10 +2873,10 @@ function mi() {
|
|
|
2874
2873
|
};
|
|
2875
2874
|
throw new TypeError("Invalid HEIF, no size found");
|
|
2876
2875
|
}
|
|
2877
|
-
},
|
|
2876
|
+
}, qe;
|
|
2878
2877
|
}
|
|
2879
|
-
var
|
|
2880
|
-
const
|
|
2878
|
+
var bi = wi();
|
|
2879
|
+
const vi = /* @__PURE__ */ H(bi), yi = {
|
|
2881
2880
|
56: "psd",
|
|
2882
2881
|
66: "bmp",
|
|
2883
2882
|
68: "dds",
|
|
@@ -2887,30 +2886,30 @@ const bi = /* @__PURE__ */ H(wi), vi = {
|
|
|
2887
2886
|
137: "png",
|
|
2888
2887
|
255: "jpg"
|
|
2889
2888
|
}, Ye = {
|
|
2890
|
-
webp:
|
|
2891
|
-
jpg:
|
|
2892
|
-
png:
|
|
2893
|
-
svg:
|
|
2894
|
-
gif:
|
|
2895
|
-
avif:
|
|
2896
|
-
bmp:
|
|
2897
|
-
cur:
|
|
2898
|
-
dds:
|
|
2899
|
-
icns:
|
|
2900
|
-
ico:
|
|
2901
|
-
j2c:
|
|
2902
|
-
jp2:
|
|
2903
|
-
ktx:
|
|
2904
|
-
pnm:
|
|
2905
|
-
psd:
|
|
2906
|
-
tga:
|
|
2907
|
-
},
|
|
2908
|
-
function xi(t) {
|
|
2909
|
-
const e = t[0], n = vi[e];
|
|
2910
|
-
return n && Ye[n].validate(t) ? n : yi.find((r) => Ye[r].validate(t));
|
|
2911
|
-
}
|
|
2889
|
+
webp: mi.WEBP,
|
|
2890
|
+
jpg: Jr.JPG,
|
|
2891
|
+
png: ti.PNG,
|
|
2892
|
+
svg: di.SVG,
|
|
2893
|
+
gif: Mr.GIF,
|
|
2894
|
+
avif: vi.HEIF,
|
|
2895
|
+
bmp: _r.BMP,
|
|
2896
|
+
cur: Pr.CUR,
|
|
2897
|
+
dds: Lr.DDS,
|
|
2898
|
+
icns: Ur.ICNS,
|
|
2899
|
+
ico: Br.ICO,
|
|
2900
|
+
j2c: zr.J2C,
|
|
2901
|
+
jp2: Gr.JP2,
|
|
2902
|
+
ktx: Zr.KTX,
|
|
2903
|
+
pnm: ii.PNM,
|
|
2904
|
+
psd: ai.PSD,
|
|
2905
|
+
tga: fi.TGA
|
|
2906
|
+
}, xi = Object.keys(Ye);
|
|
2912
2907
|
function ki(t) {
|
|
2913
|
-
const e =
|
|
2908
|
+
const e = t[0], n = yi[e];
|
|
2909
|
+
return n && Ye[n].validate(t) ? n : xi.find((r) => Ye[r].validate(t));
|
|
2910
|
+
}
|
|
2911
|
+
function Ei(t) {
|
|
2912
|
+
const e = ki(t);
|
|
2914
2913
|
if (typeof e < "u") {
|
|
2915
2914
|
const n = Ye[e].calculate(t);
|
|
2916
2915
|
if (n !== void 0)
|
|
@@ -2927,7 +2926,7 @@ async function Si(t) {
|
|
|
2927
2926
|
console.error("can not fetch", t);
|
|
2928
2927
|
return;
|
|
2929
2928
|
}
|
|
2930
|
-
const n = await e.arrayBuffer(), r =
|
|
2929
|
+
const n = await e.arrayBuffer(), r = Ei(Buffer.from(n));
|
|
2931
2930
|
if (r)
|
|
2932
2931
|
return {
|
|
2933
2932
|
width: r.width,
|
|
@@ -2940,7 +2939,7 @@ async function Si(t) {
|
|
|
2940
2939
|
return;
|
|
2941
2940
|
}
|
|
2942
2941
|
}
|
|
2943
|
-
const
|
|
2942
|
+
const Ii = (t, e, n) => async (r, i, s) => {
|
|
2944
2943
|
try {
|
|
2945
2944
|
const a = await t.dynamicImport("node:fs"), l = await t.dynamicImport("node:path");
|
|
2946
2945
|
let c;
|
|
@@ -2966,23 +2965,23 @@ const Ei = (t, e, n) => async (r, i, s) => {
|
|
|
2966
2965
|
const o = c.searchParams.get("loc"), g = c.searchParams.get("width"), m = c.searchParams.get("height"), b = c.searchParams.get("src"), h = c.searchParams.get("currentHref"), d = o.split(":"), f = parseInt(d[d.length - 1], 10) - 1;
|
|
2967
2966
|
let u = parseInt(d[d.length - 2], 10) - 1;
|
|
2968
2967
|
const w = l.resolve(n, d.slice(0, d.length - 2).join(":")), T = l.extname(w).toLowerCase();
|
|
2969
|
-
let
|
|
2970
|
-
for (; I <
|
|
2968
|
+
let j = a.readFileSync(w).toString("utf-8"), I = 0;
|
|
2969
|
+
for (; I < j.length; I++)
|
|
2971
2970
|
if (u === 0) {
|
|
2972
2971
|
I += f;
|
|
2973
2972
|
break;
|
|
2974
|
-
} else if (
|
|
2973
|
+
} else if (j[I] === `
|
|
2975
2974
|
`) {
|
|
2976
2975
|
u--;
|
|
2977
2976
|
continue;
|
|
2978
2977
|
}
|
|
2979
|
-
if (
|
|
2978
|
+
if (j.slice(I, I + 4) !== "<img") {
|
|
2980
2979
|
console.error(
|
|
2981
2980
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
2982
2981
|
), i.statusCode = 500;
|
|
2983
2982
|
return;
|
|
2984
2983
|
}
|
|
2985
|
-
const v =
|
|
2984
|
+
const v = j.indexOf(">", I) + 1;
|
|
2986
2985
|
if (v < I) {
|
|
2987
2986
|
console.error(
|
|
2988
2987
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
@@ -2990,68 +2989,68 @@ const Ei = (t, e, n) => async (r, i, s) => {
|
|
|
2990
2989
|
return;
|
|
2991
2990
|
}
|
|
2992
2991
|
const k = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(T);
|
|
2993
|
-
let x =
|
|
2992
|
+
let x = j.slice(I, v);
|
|
2994
2993
|
if (b && h && k) {
|
|
2995
|
-
const $ = new URL(b),
|
|
2996
|
-
if ($.origin ===
|
|
2997
|
-
const
|
|
2994
|
+
const $ = new URL(b), _ = new URL(h);
|
|
2995
|
+
if ($.origin === _.origin) {
|
|
2996
|
+
const O = l.join(e, "public", $.pathname), Q = l.join(e, $.pathname);
|
|
2998
2997
|
let F;
|
|
2999
|
-
if (a.existsSync(
|
|
2998
|
+
if (a.existsSync(O)) {
|
|
3000
2999
|
const te = l.join(n, "media", l.dirname($.pathname));
|
|
3001
3000
|
await a.promises.mkdir(te, { recursive: !0 }), await a.promises.copyFile(
|
|
3002
|
-
|
|
3001
|
+
O,
|
|
3003
3002
|
l.join(n, "media", $.pathname)
|
|
3004
3003
|
), F = "~/media" + $.pathname;
|
|
3005
|
-
} else if (a.existsSync(
|
|
3004
|
+
} else if (a.existsSync(Q))
|
|
3006
3005
|
F = $.pathname.replace("/src/", "~/");
|
|
3007
3006
|
else
|
|
3008
3007
|
return;
|
|
3009
|
-
const R =
|
|
3008
|
+
const R = _i($.pathname), J = `${F}?jsx`;
|
|
3010
3009
|
x = x.replace(/^<img/, `<${R}`), x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), x = x.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
|
|
3011
|
-
let
|
|
3012
|
-
if (T === ".mdx" &&
|
|
3010
|
+
let K = 0;
|
|
3011
|
+
if (T === ".mdx" && j.startsWith("---") && (K = j.indexOf("---", 4) + 3, K === -1))
|
|
3013
3012
|
return;
|
|
3014
3013
|
const X = `
|
|
3015
|
-
import ${R} from '${
|
|
3016
|
-
|
|
3017
|
-
|
|
3014
|
+
import ${R} from '${J}';`;
|
|
3015
|
+
j = `${j.slice(0, K)}${X}${j.slice(
|
|
3016
|
+
K,
|
|
3018
3017
|
I
|
|
3019
|
-
)}${x}${
|
|
3018
|
+
)}${x}${j.slice(v)}`, a.writeFileSync(w, j);
|
|
3020
3019
|
return;
|
|
3021
3020
|
}
|
|
3022
3021
|
}
|
|
3023
|
-
x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${g}"`), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${m}"`), x.includes("height=") || (x = x.replace(/<img/, `<img height="${m}"`)), x.includes("width=") || (x = x.replace(/<img/, `<img width="${g}"`)),
|
|
3022
|
+
x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${g}"`), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${m}"`), x.includes("height=") || (x = x.replace(/<img/, `<img height="${m}"`)), x.includes("width=") || (x = x.replace(/<img/, `<img width="${g}"`)), j = j.slice(0, I) + x + j.slice(v), a.writeFileSync(w, j);
|
|
3024
3023
|
} else
|
|
3025
3024
|
s();
|
|
3026
3025
|
} catch (a) {
|
|
3027
|
-
a instanceof Error && await
|
|
3026
|
+
a instanceof Error && await Sn(t, a), s(a);
|
|
3028
3027
|
}
|
|
3029
3028
|
};
|
|
3030
|
-
function
|
|
3029
|
+
function _i(t) {
|
|
3031
3030
|
const e = t.lastIndexOf("."), n = t.lastIndexOf("/");
|
|
3032
|
-
return t = t.substring(n + 1, e), `Img${
|
|
3031
|
+
return t = t.substring(n + 1, e), `Img${Ci(t)}`;
|
|
3033
3032
|
}
|
|
3034
|
-
function
|
|
3033
|
+
function Ci(t) {
|
|
3035
3034
|
return `${t}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (e, n, r) => `${n.toUpperCase() + r}`).replace(new RegExp(/\w/), (e) => e.toUpperCase());
|
|
3036
3035
|
}
|
|
3037
|
-
const Fe = "@qwik-worker-core",
|
|
3036
|
+
const Fe = "@qwik-worker-core", Ti = `
|
|
3038
3037
|
export { setPlatform } from '@qwik.dev/core';
|
|
3039
3038
|
export { _deserialize } from '@qwik.dev/core/internal';
|
|
3040
|
-
`,
|
|
3039
|
+
`, Pi = (t) => t.endsWith(Fe), Ni = () => ({
|
|
3041
3040
|
moduleSideEffects: !1,
|
|
3042
|
-
code:
|
|
3043
|
-
}),
|
|
3041
|
+
code: Ti
|
|
3042
|
+
}), Di = (t) => {
|
|
3044
3043
|
t.emitFile({
|
|
3045
3044
|
id: Fe,
|
|
3046
3045
|
name: "qwik-worker-core",
|
|
3047
3046
|
type: "chunk",
|
|
3048
3047
|
preserveSignature: "allow-extension"
|
|
3049
3048
|
});
|
|
3050
|
-
},
|
|
3049
|
+
}, Li = (t, e, n) => e !== "client" && e !== "ssr" || n !== "build" ? t : {
|
|
3051
3050
|
...t,
|
|
3052
3051
|
format: "es",
|
|
3053
|
-
plugins:
|
|
3054
|
-
},
|
|
3052
|
+
plugins: ji(t?.plugins)
|
|
3053
|
+
}, Oi = (t) => {
|
|
3055
3054
|
const e = Object.values(t).find(
|
|
3056
3055
|
(r) => r.type === "chunk" && r.facadeModuleId === Fe
|
|
3057
3056
|
), n = e ? Jt(e.fileName) : void 0;
|
|
@@ -3060,12 +3059,12 @@ export { _deserialize } from '@qwik.dev/core/internal';
|
|
|
3060
3059
|
(r) => n?.(r)
|
|
3061
3060
|
);
|
|
3062
3061
|
}, Ri = (t, e) => {
|
|
3063
|
-
const n =
|
|
3062
|
+
const n = $i(e), r = n ? Jt(n) : void 0;
|
|
3064
3063
|
en(
|
|
3065
3064
|
t,
|
|
3066
3065
|
(i) => r?.(i)
|
|
3067
3066
|
);
|
|
3068
|
-
},
|
|
3067
|
+
}, Mi = () => ({
|
|
3069
3068
|
name: "vite-plugin-qwik-worker-core-external",
|
|
3070
3069
|
enforce: "pre",
|
|
3071
3070
|
resolveId(t) {
|
|
@@ -3074,7 +3073,7 @@ export { _deserialize } from '@qwik.dev/core/internal';
|
|
|
3074
3073
|
external: !0
|
|
3075
3074
|
} : null;
|
|
3076
3075
|
}
|
|
3077
|
-
}),
|
|
3076
|
+
}), ji = (t) => () => [...typeof t == "function" ? t() : Array.isArray(t) ? t : [], Mi()], en = (t, e) => {
|
|
3078
3077
|
for (const n of Object.values(t))
|
|
3079
3078
|
n.type === "chunk" ? n.code = It(
|
|
3080
3079
|
n.code,
|
|
@@ -3083,7 +3082,7 @@ export { _deserialize } from '@qwik.dev/core/internal';
|
|
|
3083
3082
|
n.source,
|
|
3084
3083
|
() => e(n.fileName)
|
|
3085
3084
|
));
|
|
3086
|
-
},
|
|
3085
|
+
}, $i = (t) => {
|
|
3087
3086
|
if (!t)
|
|
3088
3087
|
return;
|
|
3089
3088
|
const e = Object.keys(t.bundles).find(
|
|
@@ -3091,7 +3090,7 @@ export { _deserialize } from '@qwik.dev/core/internal';
|
|
|
3091
3090
|
);
|
|
3092
3091
|
if (e)
|
|
3093
3092
|
return e === "build" || e.startsWith("build/") || /[/\\]build[/\\]/.test(e) ? e : `build/${e}`;
|
|
3094
|
-
},
|
|
3093
|
+
}, Ui = [
|
|
3095
3094
|
we,
|
|
3096
3095
|
ot,
|
|
3097
3096
|
st,
|
|
@@ -3099,7 +3098,7 @@ export { _deserialize } from '@qwik.dev/core/internal';
|
|
|
3099
3098
|
"@builder.io/qwik",
|
|
3100
3099
|
"@builder.io/qwik/jsx-runtime",
|
|
3101
3100
|
"@builder.io/qwik/jsx-dev-runtime"
|
|
3102
|
-
], qi = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"],
|
|
3101
|
+
], qi = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], Bi = [".woff", ".woff2", ".ttf"], nt = "@qwik-hmr-bridge", Fi = `
|
|
3103
3102
|
// HMR bridge: connects Vite HMR events to Qwik's component re-rendering.
|
|
3104
3103
|
if (import.meta.hot) {
|
|
3105
3104
|
let timeout;
|
|
@@ -3124,7 +3123,7 @@ export { _deserialize } from '@qwik.dev/core/internal';
|
|
|
3124
3123
|
});
|
|
3125
3124
|
}
|
|
3126
3125
|
`;
|
|
3127
|
-
function
|
|
3126
|
+
function Hi(t = {}) {
|
|
3128
3127
|
let e = "serve", n = null, r = null, i = "/", s = null, a, l = null, c = null, o = null, g = "development", m;
|
|
3129
3128
|
const b = t.client?.outDir;
|
|
3130
3129
|
let h = null;
|
|
@@ -3147,10 +3146,10 @@ function Wi(t = {}) {
|
|
|
3147
3146
|
await w.init();
|
|
3148
3147
|
let x;
|
|
3149
3148
|
k.mode === "lib" ? x = "lib" : v.build?.ssr || k.mode === "ssr" ? x = "ssr" : k.mode === "test" || k.mode === "benchmark" ? x = "test" : x = "client", e = k.command, k.mode === "production" ? g = "production" : k.mode === "development" ? g = "development" : e === "build" && x === "client" ? g = "production" : g = "development", w.debug(`vite config(), command: ${e}, env.mode: ${k.mode}`), e === "serve" ? t.entryStrategy = { type: "segment" } : x === "ssr" ? t.entryStrategy = { type: "hoist" } : x === "lib" && (t.entryStrategy = { type: "inline" });
|
|
3150
|
-
const $ = x === "ssr" ? typeof v.build?.ssr == "string" ? v.build.ssr : t.ssr?.input : void 0,
|
|
3151
|
-
let
|
|
3152
|
-
|
|
3153
|
-
const
|
|
3149
|
+
const $ = x === "ssr" ? typeof v.build?.ssr == "string" ? v.build.ssr : t.ssr?.input : void 0, _ = x === "client" ? t.client?.input : void 0;
|
|
3150
|
+
let O = v.build?.rollupOptions?.input || _ || $;
|
|
3151
|
+
O && typeof O == "string" && (O = [O]), a = v.build?.assetsDir;
|
|
3152
|
+
const Q = x === "client" && !!a && a !== "_astro", F = {
|
|
3154
3153
|
target: x,
|
|
3155
3154
|
buildMode: g,
|
|
3156
3155
|
csr: t.csr,
|
|
@@ -3166,25 +3165,25 @@ function Wi(t = {}) {
|
|
|
3166
3165
|
clientOutDir: b || // When ssr is true, this is probably an adapter build and not where the client build is
|
|
3167
3166
|
// However, if client.outDir was explicitly set, always use it
|
|
3168
3167
|
(v.build?.ssr && !b ? void 0 : v.build?.outDir),
|
|
3169
|
-
assetsDir:
|
|
3168
|
+
assetsDir: Q ? a : void 0,
|
|
3170
3169
|
devTools: t.devTools,
|
|
3171
3170
|
sourcemap: !!v.build?.sourcemap,
|
|
3172
3171
|
lint: t.lint,
|
|
3173
3172
|
experimental: t.experimental,
|
|
3174
|
-
input:
|
|
3173
|
+
input: O,
|
|
3175
3174
|
manifestInput: t.ssr?.manifestInput,
|
|
3176
3175
|
manifestInputPath: t.ssr?.manifestInputPath,
|
|
3177
3176
|
manifestOutput: t.client?.manifestOutput
|
|
3178
3177
|
}, R = await w.normalizeOptions(F);
|
|
3179
|
-
|
|
3180
|
-
const
|
|
3178
|
+
O ||= R.input, h = F, n = R.manifestInput, l = R.srcDir, c = R.rootDir, t.csr || (r = R.clientOutDir, s = r, o = R.ssrOutDir);
|
|
3179
|
+
const J = g === "development", K = "globalThis.qDev", X = "globalThis.qTest", te = "globalThis.qInspector", ce = v?.define?.[K] ?? J, M = v?.define?.[te] ?? J, z = {
|
|
3181
3180
|
// Duplicated in configEnvironment to support legacy vite build --ssr compatibility
|
|
3182
3181
|
ssr: {
|
|
3183
3182
|
noExternal: [we, be, He, se]
|
|
3184
3183
|
},
|
|
3185
3184
|
envPrefix: ["VITE_", "PUBLIC_"],
|
|
3186
3185
|
resolve: {
|
|
3187
|
-
dedupe: [
|
|
3186
|
+
dedupe: [...Ui],
|
|
3188
3187
|
alias: {
|
|
3189
3188
|
"@builder.io/qwik": "@qwik.dev/core",
|
|
3190
3189
|
"@builder.io/qwik/build": "@qwik.dev/core/build",
|
|
@@ -3213,7 +3212,7 @@ function Wi(t = {}) {
|
|
|
3213
3212
|
"@builder.io/qwik"
|
|
3214
3213
|
],
|
|
3215
3214
|
// Enforce scanning our input even when overridden later
|
|
3216
|
-
entries:
|
|
3215
|
+
entries: O && (typeof O == "string" ? [O] : typeof O == "object" ? Object.values(O) : O)
|
|
3217
3216
|
},
|
|
3218
3217
|
build: {
|
|
3219
3218
|
modulePreload: !1,
|
|
@@ -3223,14 +3222,14 @@ function Wi(t = {}) {
|
|
|
3223
3222
|
rollupOptions: {
|
|
3224
3223
|
external: ["node:async_hooks"],
|
|
3225
3224
|
// This will amend the existing input
|
|
3226
|
-
input:
|
|
3225
|
+
input: O
|
|
3227
3226
|
// temporary fix for rolldown-vite types
|
|
3228
3227
|
}
|
|
3229
3228
|
},
|
|
3230
|
-
worker:
|
|
3229
|
+
worker: Li(v.worker, x, e),
|
|
3231
3230
|
define: {
|
|
3232
|
-
[
|
|
3233
|
-
[te]:
|
|
3231
|
+
[K]: ce,
|
|
3232
|
+
[te]: M,
|
|
3234
3233
|
[X]: JSON.stringify(process.env.NODE_ENV === "test")
|
|
3235
3234
|
}
|
|
3236
3235
|
};
|
|
@@ -3239,10 +3238,10 @@ function Wi(t = {}) {
|
|
|
3239
3238
|
const de = z.build.rollupOptions?.onwarn;
|
|
3240
3239
|
z.build.rollupOptions = {
|
|
3241
3240
|
...z.build.rollupOptions,
|
|
3242
|
-
output: await
|
|
3241
|
+
output: await dr(
|
|
3243
3242
|
w,
|
|
3244
3243
|
v.build?.rollupOptions?.output,
|
|
3245
|
-
|
|
3244
|
+
Q,
|
|
3246
3245
|
R.outDir
|
|
3247
3246
|
),
|
|
3248
3247
|
preserveEntrySignatures: "exports-only",
|
|
@@ -3258,10 +3257,10 @@ function Wi(t = {}) {
|
|
|
3258
3257
|
se,
|
|
3259
3258
|
oe
|
|
3260
3259
|
]) : z.define = {
|
|
3261
|
-
[
|
|
3260
|
+
[K]: !0,
|
|
3262
3261
|
[X]: !0,
|
|
3263
3262
|
[te]: !1
|
|
3264
|
-
}), globalThis.qDev = ce, globalThis.qTest = !0, globalThis.qInspector =
|
|
3263
|
+
}), globalThis.qDev = ce, globalThis.qTest = !0, globalThis.qInspector = M;
|
|
3265
3264
|
}
|
|
3266
3265
|
return z;
|
|
3267
3266
|
},
|
|
@@ -3279,31 +3278,37 @@ function Wi(t = {}) {
|
|
|
3279
3278
|
async configResolved(v) {
|
|
3280
3279
|
if (i = v.base, !(i.startsWith("/") && i.endsWith("/")))
|
|
3281
3280
|
throw new Error("vite's config.base must begin and end with /");
|
|
3282
|
-
v.build.sourcemap && t.optimizerOptions?.sourcemap === void 0 && w.setSourceMapSupport(!0), h ? w.normalizeOptions(h) : w.normalizeOptions(t)
|
|
3281
|
+
if (v.build.sourcemap && t.optimizerOptions?.sourcemap === void 0 && w.setSourceMapSupport(!0), h ? w.normalizeOptions(h) : w.normalizeOptions(t), e === "build" && !t.csr && w.getOptions().target === "client") {
|
|
3282
|
+
const x = ["vite:build-import-analysis"], $ = v.plugins;
|
|
3283
|
+
for (const _ of x) {
|
|
3284
|
+
const O = $.findIndex((Q) => Q?.name === _);
|
|
3285
|
+
O >= 0 && $.splice(O, 1);
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3283
3288
|
},
|
|
3284
3289
|
async buildStart() {
|
|
3285
3290
|
u.length = 0;
|
|
3286
3291
|
const v = this.resolve.bind(this);
|
|
3287
3292
|
await w.validateSource(v), w.onDiagnostics((k, x, $) => {
|
|
3288
|
-
k.forEach((
|
|
3289
|
-
const
|
|
3290
|
-
|
|
3293
|
+
k.forEach((_) => {
|
|
3294
|
+
const O = w.normalizePath(x.sys.path.join($, _.file));
|
|
3295
|
+
_.category === "error" ? this.error(Je(O, _)) : this.warn(Je(O, _));
|
|
3291
3296
|
});
|
|
3292
|
-
}), await w.buildStart(this), e === "build" && w.getOptions().target === "client" &&
|
|
3297
|
+
}), await w.buildStart(this), e === "build" && w.getOptions().target === "client" && Di(this);
|
|
3293
3298
|
},
|
|
3294
3299
|
resolveId(v, k, x) {
|
|
3295
3300
|
if (v.endsWith(nt))
|
|
3296
3301
|
return nt;
|
|
3297
|
-
if (
|
|
3302
|
+
if (Pi(v))
|
|
3298
3303
|
return Fe;
|
|
3299
3304
|
const $ = d(v, "resolveId");
|
|
3300
3305
|
return ae(v) || !$ ? null : w.resolveId(this, v, k, x);
|
|
3301
3306
|
},
|
|
3302
3307
|
load(v, k) {
|
|
3303
3308
|
if (v === nt)
|
|
3304
|
-
return { code:
|
|
3309
|
+
return { code: Fi };
|
|
3305
3310
|
if (v === Fe)
|
|
3306
|
-
return
|
|
3311
|
+
return Ni();
|
|
3307
3312
|
const x = d(v, "load");
|
|
3308
3313
|
return ae(v) || !x ? null : (v = w.normalizePath(v), e === "serve" && v.endsWith(oe) ? {
|
|
3309
3314
|
code: "export const manifest = undefined;"
|
|
@@ -3311,7 +3316,7 @@ function Wi(t = {}) {
|
|
|
3311
3316
|
},
|
|
3312
3317
|
transform(v, k, x) {
|
|
3313
3318
|
if (k.includes(".vite/deps/") && v.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(v)) {
|
|
3314
|
-
const
|
|
3319
|
+
const O = c && k.startsWith(c) ? k.slice(c.length) : k;
|
|
3315
3320
|
throw new Error(
|
|
3316
3321
|
`
|
|
3317
3322
|
|
|
@@ -3320,15 +3325,15 @@ function Wi(t = {}) {
|
|
|
3320
3325
|
⚠️ IMPORTANT: This dependency was pre-bundled by Vite, but it seems to use Qwik, which needs processing by the optimizer.
|
|
3321
3326
|
|
|
3322
3327
|
👉 Please add the original modulename to the "optimizeDeps.exclude" array in your Vite config
|
|
3323
|
-
👉 ${
|
|
3328
|
+
👉 ${O}
|
|
3324
3329
|
|
|
3325
3330
|
==============
|
|
3326
3331
|
|
|
3327
3332
|
`
|
|
3328
3333
|
);
|
|
3329
3334
|
}
|
|
3330
|
-
const $ = d(k, "transform"),
|
|
3331
|
-
return ae(k) || !$ ||
|
|
3335
|
+
const $ = d(k, "transform"), _ = k.includes("?raw");
|
|
3336
|
+
return ae(k) || !$ || _ ? null : w.transform(this, v, k, x);
|
|
3332
3337
|
}
|
|
3333
3338
|
}, {
|
|
3334
3339
|
name: "vite-plugin-qwik-post",
|
|
@@ -3338,16 +3343,16 @@ function Wi(t = {}) {
|
|
|
3338
3343
|
async handler(v, k) {
|
|
3339
3344
|
const x = this.environment.config.consumer === "client", $ = this.environment.config.consumer === "server";
|
|
3340
3345
|
if (x) {
|
|
3341
|
-
const
|
|
3346
|
+
const _ = w.getOptions();
|
|
3342
3347
|
for (const [F, R] of Object.entries(k))
|
|
3343
3348
|
if (R.type === "asset") {
|
|
3344
|
-
const
|
|
3345
|
-
if (qi.some((
|
|
3346
|
-
typeof R.source == "string" && R.source.length <
|
|
3349
|
+
const J = i + F;
|
|
3350
|
+
if (qi.some((K) => F.endsWith(K)))
|
|
3351
|
+
typeof R.source == "string" && R.source.length < _.inlineStylesUpToBytes ? u.push({
|
|
3347
3352
|
tag: "style",
|
|
3348
3353
|
location: "head",
|
|
3349
3354
|
attributes: {
|
|
3350
|
-
"data-src":
|
|
3355
|
+
"data-src": J,
|
|
3351
3356
|
dangerouslySetInnerHTML: R.source
|
|
3352
3357
|
}
|
|
3353
3358
|
}) : u.push({
|
|
@@ -3355,25 +3360,25 @@ function Wi(t = {}) {
|
|
|
3355
3360
|
location: "head",
|
|
3356
3361
|
attributes: {
|
|
3357
3362
|
rel: "stylesheet",
|
|
3358
|
-
href:
|
|
3363
|
+
href: J
|
|
3359
3364
|
}
|
|
3360
3365
|
});
|
|
3361
3366
|
else {
|
|
3362
|
-
const
|
|
3363
|
-
|
|
3367
|
+
const K = Bi.find((X) => F.endsWith(X));
|
|
3368
|
+
K && !f && u.unshift({
|
|
3364
3369
|
tag: "link",
|
|
3365
3370
|
location: "head",
|
|
3366
3371
|
attributes: {
|
|
3367
3372
|
rel: "preload",
|
|
3368
|
-
href:
|
|
3373
|
+
href: J,
|
|
3369
3374
|
as: "font",
|
|
3370
|
-
type: `font/${
|
|
3375
|
+
type: `font/${K.slice(1)}`,
|
|
3371
3376
|
crossorigin: ""
|
|
3372
3377
|
}
|
|
3373
3378
|
});
|
|
3374
3379
|
}
|
|
3375
3380
|
}
|
|
3376
|
-
const
|
|
3381
|
+
const O = await w.generateManifest(
|
|
3377
3382
|
this,
|
|
3378
3383
|
k,
|
|
3379
3384
|
T,
|
|
@@ -3381,27 +3386,27 @@ function Wi(t = {}) {
|
|
|
3381
3386
|
injections: u,
|
|
3382
3387
|
platform: { vite: "" }
|
|
3383
3388
|
}
|
|
3384
|
-
),
|
|
3389
|
+
), Q = Kn(O, i);
|
|
3385
3390
|
for (const F of Object.values(k))
|
|
3386
|
-
F.type === "chunk" && (F.code = Kt(F.code,
|
|
3387
|
-
|
|
3391
|
+
F.type === "chunk" && (F.code = Kt(F.code, Q));
|
|
3392
|
+
Oi(k);
|
|
3388
3393
|
} else $ && Ri(k, n);
|
|
3389
3394
|
}
|
|
3390
3395
|
},
|
|
3391
3396
|
async writeBundle(v, k) {
|
|
3392
3397
|
const x = w.getOptions();
|
|
3393
3398
|
if (this.environment.config.consumer === "server") {
|
|
3394
|
-
const
|
|
3395
|
-
if (
|
|
3396
|
-
const
|
|
3399
|
+
const _ = w.getSys();
|
|
3400
|
+
if (_.env === "node" || _.env === "bun" || _.env === "deno") {
|
|
3401
|
+
const O = Object.keys(k), Q = async (F) => {
|
|
3397
3402
|
try {
|
|
3398
|
-
const R =
|
|
3399
|
-
if ((R.startsWith("entry.") || R.startsWith("entry_")) && !R.includes("preview") && (
|
|
3400
|
-
const X =
|
|
3401
|
-
if (!
|
|
3402
|
-
const z =
|
|
3403
|
+
const R = _.path.basename(F), J = _.path.extname(R);
|
|
3404
|
+
if ((R.startsWith("entry.") || R.startsWith("entry_")) && !R.includes("preview") && (J === ".mjs" || J === ".cjs")) {
|
|
3405
|
+
const X = _.path.basename(R, J), te = `${X}.js`, ce = X + J;
|
|
3406
|
+
if (!O.some((z) => _.path.basename(z) === te)) {
|
|
3407
|
+
const z = _.path.dirname(F), de = await _.dynamicImport("node:fs"), A = _.path.join(x.outDir, z);
|
|
3403
3408
|
await de.promises.mkdir(A, { recursive: !0 }), await de.promises.writeFile(
|
|
3404
|
-
|
|
3409
|
+
_.path.join(A, te),
|
|
3405
3410
|
`export * from "./${ce}";`
|
|
3406
3411
|
);
|
|
3407
3412
|
}
|
|
@@ -3410,21 +3415,21 @@ function Wi(t = {}) {
|
|
|
3410
3415
|
console.error("patchModuleFormat", R);
|
|
3411
3416
|
}
|
|
3412
3417
|
};
|
|
3413
|
-
await Promise.all(
|
|
3418
|
+
await Promise.all(O.map(Q));
|
|
3414
3419
|
}
|
|
3415
3420
|
}
|
|
3416
3421
|
},
|
|
3417
3422
|
transformIndexHtml() {
|
|
3418
3423
|
if (e === "serve")
|
|
3419
|
-
return
|
|
3424
|
+
return Er(w.getOptions(), i);
|
|
3420
3425
|
},
|
|
3421
3426
|
configureServer(v) {
|
|
3422
|
-
m = v, w.configureServer(v), (t?.devTools?.imageDevTools ?? !0) && v.middlewares.use(
|
|
3427
|
+
m = v, w.configureServer(v), (t?.devTools?.imageDevTools ?? !0) && v.middlewares.use(Ii(w.getSys(), c, l));
|
|
3423
3428
|
},
|
|
3424
3429
|
configurePreviewServer(v) {
|
|
3425
3430
|
return async () => {
|
|
3426
3431
|
const k = w.getSys(), x = w.getPath();
|
|
3427
|
-
await
|
|
3432
|
+
await kr(v.middlewares, o, k, x);
|
|
3428
3433
|
};
|
|
3429
3434
|
},
|
|
3430
3435
|
hotUpdate(v) {
|
|
@@ -3432,14 +3437,14 @@ function Wi(t = {}) {
|
|
|
3432
3437
|
const k = t?.devTools?.hmr ?? !0;
|
|
3433
3438
|
if (this.environment.name === "ssr" && v.modules.length)
|
|
3434
3439
|
if (k) {
|
|
3435
|
-
const x = /* @__PURE__ */ new Set(), $ = (
|
|
3436
|
-
for (const
|
|
3437
|
-
const
|
|
3438
|
-
if (
|
|
3439
|
-
x.add(
|
|
3440
|
+
const x = /* @__PURE__ */ new Set(), $ = (_) => /\.([mc]?[jt]sx?|mdx?)$/.test(_.split("?")[0]);
|
|
3441
|
+
for (const _ of v.modules) {
|
|
3442
|
+
const O = _.url.split("?")[0];
|
|
3443
|
+
if (_.type === "js" && $(_.url))
|
|
3444
|
+
x.add(O);
|
|
3440
3445
|
else
|
|
3441
|
-
for (const
|
|
3442
|
-
|
|
3446
|
+
for (const Q of _.importers)
|
|
3447
|
+
Q.type === "js" && $(Q.url) && x.add(Q.url.split("?")[0]);
|
|
3443
3448
|
}
|
|
3444
3449
|
x.size > 0 && m && m.environments.client.hot.send({
|
|
3445
3450
|
type: "custom",
|
|
@@ -3451,9 +3456,9 @@ function Wi(t = {}) {
|
|
|
3451
3456
|
},
|
|
3452
3457
|
onLog(v, k) {
|
|
3453
3458
|
if (k.plugin == "vite-plugin-qwik") {
|
|
3454
|
-
const x =
|
|
3459
|
+
const x = zi[v] || le.White, $ = (k.frame || "").split(`
|
|
3455
3460
|
`).map(
|
|
3456
|
-
(
|
|
3461
|
+
(_) => (_.match(/^\s*\^\s*$/) ? le.BrightWhite : le.BrightBlack) + _
|
|
3457
3462
|
);
|
|
3458
3463
|
return console[v](
|
|
3459
3464
|
`${x}%s
|
|
@@ -3469,9 +3474,9 @@ ${le.BrightWhite}%s
|
|
|
3469
3474
|
), !1;
|
|
3470
3475
|
}
|
|
3471
3476
|
}
|
|
3472
|
-
},
|
|
3477
|
+
}, Ai()];
|
|
3473
3478
|
}
|
|
3474
|
-
async function
|
|
3479
|
+
async function Ai() {
|
|
3475
3480
|
let t, e, n = !1;
|
|
3476
3481
|
async function r() {
|
|
3477
3482
|
if (n)
|
|
@@ -3597,12 +3602,12 @@ const le = {
|
|
|
3597
3602
|
BrightBlack: "\x1B[90m",
|
|
3598
3603
|
BrightWhite: "\x1B[97m",
|
|
3599
3604
|
RESET: "\x1B[0m"
|
|
3600
|
-
},
|
|
3605
|
+
}, zi = {
|
|
3601
3606
|
warn: le.Yellow,
|
|
3602
3607
|
info: le.Cyan,
|
|
3603
3608
|
debug: le.BrightBlack
|
|
3604
3609
|
};
|
|
3605
3610
|
export {
|
|
3606
|
-
|
|
3607
|
-
|
|
3611
|
+
Wi as qwikRollup,
|
|
3612
|
+
Hi as qwikVite
|
|
3608
3613
|
};
|